From 23396f637b5a224a595311404fbf76efec84c138 Mon Sep 17 00:00:00 2001 From: WalterNorthwoods Date: Tue, 25 Apr 2017 12:46:45 -0400 Subject: [PATCH] 1.7.8 * Added the Link Label On Path Dragging sample, demonstrating how to restrict the dragging of link labels to remain on the path of the link. This makes use of the LinkLabelOnPathDraggingTool.js extension. * TableRows and TableColumns now update their ports correctly when scrolling by setting Panel.topIndex or Panel.leftIndex. * Links that have TwoWay Bindings of Link.points now copy faithfully between different Diagrams. * When the DraggingTool.dragsLink is true, a drag of a Link that reconnects one or both ends of the Link will now raise one or two "LinkRelinked" DiagramEvents. Just as with a "LinkRelinked" event raised by the RelinkingTool, the DiagramEvent.parameter will be the old port with which the Link had been connected. --- api/index.html | 4 +- api/symbols/ActionTool.html | 2 +- api/symbols/Adornment.html | 2 +- api/symbols/AnimationManager.html | 2 +- api/symbols/Binding.html | 2 +- api/symbols/Brush.html | 2 +- api/symbols/ChangedEvent.html | 2 +- api/symbols/CircularEdge.html | 2 +- api/symbols/CircularLayout.html | 2 +- api/symbols/CircularVertex.html | 2 +- api/symbols/ClickCreatingTool.html | 2 +- api/symbols/ClickSelectingTool.html | 2 +- api/symbols/CommandHandler.html | 2 +- api/symbols/ContextMenuTool.html | 2 +- api/symbols/Diagram.html | 2 +- api/symbols/DiagramEvent.html | 4 +- api/symbols/DragSelectingTool.html | 2 +- api/symbols/DraggingTool.html | 2 +- api/symbols/ForceDirectedEdge.html | 2 +- api/symbols/ForceDirectedLayout.html | 2 +- api/symbols/ForceDirectedVertex.html | 2 +- api/symbols/Geometry.html | 2 +- api/symbols/GraphLinksModel.html | 2 +- api/symbols/GraphObject.html | 2 +- api/symbols/GridLayout.html | 2 +- api/symbols/Group.html | 2 +- api/symbols/HTMLInfo.html | 2 +- api/symbols/InputEvent.html | 2 +- api/symbols/Iterable.html | 2 +- api/symbols/Iterator.html | 2 +- api/symbols/Layer.html | 2 +- api/symbols/LayeredDigraphEdge.html | 2 +- api/symbols/LayeredDigraphLayout.html | 2 +- api/symbols/LayeredDigraphVertex.html | 2 +- api/symbols/Layout.html | 2 +- api/symbols/LayoutEdge.html | 2 +- api/symbols/LayoutNetwork.html | 2 +- api/symbols/LayoutVertex.html | 2 +- api/symbols/Link.html | 2 +- api/symbols/LinkReshapingTool.html | 2 +- api/symbols/LinkingBaseTool.html | 2 +- api/symbols/LinkingTool.html | 2 +- api/symbols/List.html | 42 +- api/symbols/Map.html | 42 +- api/symbols/Margin.html | 2 +- api/symbols/Model.html | 2 +- api/symbols/Node.html | 2 +- api/symbols/Overview.html | 2 +- api/symbols/Palette.html | 2 +- api/symbols/Panel.html | 2 +- api/symbols/PanningTool.html | 2 +- api/symbols/Part.html | 2 +- api/symbols/PathFigure.html | 2 +- api/symbols/PathSegment.html | 2 +- api/symbols/Picture.html | 2 +- api/symbols/Placeholder.html | 2 +- api/symbols/Point.html | 2 +- api/symbols/Rect.html | 2 +- api/symbols/RelinkingTool.html | 2 +- api/symbols/ResizingTool.html | 2 +- api/symbols/RotatingTool.html | 2 +- api/symbols/RowColumnDefinition.html | 2 +- api/symbols/Set.html | 42 +- api/symbols/Shape.html | 2 +- api/symbols/Size.html | 2 +- api/symbols/Spot.html | 2 +- api/symbols/TextBlock.html | 2 +- api/symbols/TextEditingTool.html | 2 +- api/symbols/Tool.html | 2 +- api/symbols/ToolManager.html | 2 +- api/symbols/Transaction.html | 2 +- api/symbols/TreeEdge.html | 2 +- api/symbols/TreeLayout.html | 2 +- api/symbols/TreeModel.html | 2 +- api/symbols/TreeVertex.html | 2 +- api/symbols/UndoManager.html | 2 +- .../screenshots/LinkLabelOnPathDragging.png | Bin 0 -> 7044 bytes doc/changelog.html | 21 +- extensions/FloorPlanner.html | 278 +- extensions/FloorPlanner.js | 2588 ----------- extensions/GuidedDraggingTool.js | 24 +- extensions/LinkLabelDragging.html | 4 + extensions/LinkLabelOnPathDragging.html | 111 + extensions/LinkLabelOnPathDraggingTool.js | 152 + extensions/ScrollingTable.js | 18 +- package.json | 2 +- .../FloorPlanner-Templates-Furniture.js | 200 + .../FloorPlanner-Templates-General.js | 390 ++ .../FloorPlanner-Templates-Walls.js | 482 ++ .../FloorPlanner-WallBuildingTool.js | 55 +- .../FloorPlanner-WallReshapingTool.js | 115 +- .../floorplanner}/FloorPlanner.css | 31 +- projects/floorplanner/FloorPlanner.html | 636 +++ projects/floorplanner/Floorplan.js | 789 ++++ projects/floorplanner/FloorplanFilesystem.js | 246 + projects/floorplanner/FloorplanPalette.js | 28 + projects/floorplanner/FloorplanUI.js | 793 ++++ .../icons/flipDoorOpeningLeft.png | Bin .../icons/flipDoorOpeningRight.png | Bin .../floorplanner}/icons/flipDoorSide.png | Bin .../floorplanner}/icons/selectionTool.png | Bin .../floorplanner}/icons/wallBuildingTool.png | Bin release/go-debug.js | 4048 +++++++++-------- release/go.d.ts | 1 + release/go.js | 3887 ++++++++-------- samples/all.html | 1 + samples/indexList.js | 12 +- samples/treeMapper.html | 22 +- samples/virtualized.html | 2 + samples/virtualizedForceLayout.html | 1 + samples/virtualizedTree.html | 1 + samples/virtualizedTreeLayout.html | 1 + 112 files changed, 8081 insertions(+), 7134 deletions(-) create mode 100644 assets/images/screenshots/LinkLabelOnPathDragging.png delete mode 100644 extensions/FloorPlanner.js create mode 100644 extensions/LinkLabelOnPathDragging.html create mode 100644 extensions/LinkLabelOnPathDraggingTool.js create mode 100644 projects/floorplanner/FloorPlanner-Templates-Furniture.js create mode 100644 projects/floorplanner/FloorPlanner-Templates-General.js create mode 100644 projects/floorplanner/FloorPlanner-Templates-Walls.js rename extensions/WallBuildingTool.js => projects/floorplanner/FloorPlanner-WallBuildingTool.js (73%) rename extensions/WallReshapingTool.js => projects/floorplanner/FloorPlanner-WallReshapingTool.js (82%) rename {extensions => projects/floorplanner}/FloorPlanner.css (90%) create mode 100644 projects/floorplanner/FloorPlanner.html create mode 100644 projects/floorplanner/Floorplan.js create mode 100644 projects/floorplanner/FloorplanFilesystem.js create mode 100644 projects/floorplanner/FloorplanPalette.js create mode 100644 projects/floorplanner/FloorplanUI.js rename {extensions => projects/floorplanner}/icons/flipDoorOpeningLeft.png (100%) rename {extensions => projects/floorplanner}/icons/flipDoorOpeningRight.png (100%) rename {extensions => projects/floorplanner}/icons/flipDoorSide.png (100%) rename {extensions => projects/floorplanner}/icons/selectionTool.png (100%) rename {extensions => projects/floorplanner}/icons/wallBuildingTool.png (100%) diff --git a/api/index.html b/api/index.html index 9bdd8b021..670780bab 100644 --- a/api/index.html +++ b/api/index.html @@ -1105,7 +1105,7 @@

GoJS Class Index

@@ -1140,7 +1140,7 @@

GoJS Class Index

Diagram

A Diagram is associated with an HTML DIV element.More... Constructing a Diagram creates an HTML Canvas element which it places inside of the given DIV element, in addition to several helper DIVs. GoJS will manage the contents of this DIV -- you should not modify the contents of the DIV, although you may style the given DIV (background, border, etc) and position and size it as needed.

Minimal Diagram construction looks like this. HTML:

<div id="myDiagramDiv" style="border: solid 1px black; width:400px; height:400px"></div>

JavaScript:

var $ = go.GraphObject.make;  // for conciseness

 myDiagram = $(go.Diagram, "myDiagramDiv",  // create a Diagram for the DIV HTML element
               {
                 initialContentAlignment: go.Spot.Center,  // center the content
                 "undoManager.isEnabled": true  // enable undo & redo
               });

The diagram will draw onto an HTML Canvas element, created inside the Diagram DIV.

Each Diagram holds a set of Layers each of which holds some number of Parts such as Nodes and Links. Each Part consists of GraphObjects such as TextBlocks and Shapes and Panels holding yet more GraphObjects.

A Diagram and its Parts provide the visual representation of a Model that holds JavaScript data objects for the nodes and the links. The model provides the way to recognize the relationships between the data.

Two Diagrams can display and manipulate the same Model. (Example)

A diagram will automatically create Nodes and Links corresponding to the model data. The diagram has a number of named templates it uses to create the actual parts: #nodeTemplateMap, #groupTemplateMap, and #linkTemplateMap. Each template may have some data Bindings that set the part's GraphObjects' properties based on the value of properties of the data.

A simple Node template and Model data (both nodes and links) may look like this:

var $ = go.GraphObject.make;  // for conciseness

// define a simple Node template
myDiagram.nodeTemplate =
  $(go.Node, "Auto",  // the Shape will go around the TextBlock
    $(go.Shape, "RoundedRectangle",
      // Shape.fill is bound to Node.data.color
      new go.Binding("fill", "color")),
    $(go.TextBlock,
      { margin: 3 },  // some room around the text
      // TextBlock.text is bound to Node.data.key
      new go.Binding("text", "key"))
  );

// create the model data that will be represented by Nodes and Links
myDiagram.model = new go.GraphLinksModel(
[
  { key: "Alpha", color: "lightblue" },
  { key: "Beta", color: "orange" },
  { key: "Gamma", color: "lightgreen" },
  { key: "Delta", color: "pink" }
],
[
  { from: "Alpha", to: "Beta" },
  { from: "Alpha", to: "Gamma" },
  { from: "Beta", to: "Beta" },
  { from: "Gamma", to: "Delta" },
  { from: "Delta", to: "Alpha" }
]);

The above code is used to make the Minimal sample, a simple example of creating a Diagram and setting its model.

Read about models on the Using Models page in the introduction. A diagram is responsible for scrolling (#position) and zooming (#scale) all of the parts that it shows. Each Part occupies some area given by its GraphObject.actualBounds.

The union of all of the parts' bounds constitutes the #documentBounds. The document bounds determines the area that the diagram can be scrolled to. There are several properties that you can set, such as #initialContentAlignment, that control the initial size and position of the diagram contents.

At any later time you can also explicitly set the #position and/or #scale to get the appearance that you want. But you may find it easier to call methods to get the desired effect. For example, if you want to make a particular Node be centered in the viewport, call either #centerRect or #scrollToRect with the Node's GraphObject.actualBounds, depending on whether or not you want the view to be scrolled if the node is already in view.

Read in the Introduction about Viewports and the Initial Viewport. You can have the diagram perform automatic layouts of its nodes and links by setting #layout to an instance of the Layout subclass of your choice. The default #layout is an instance of the Layout base class that ignores links and only positions Nodes that do not have a location. This default layout will allow you to programmatically position nodes (including by loading from a database) and will also allow the user to manually position nodes using the DraggingTool.

If you do supply a particular layout as the #layout, you can control which Parts it operates on by setting Part.isLayoutPositioned. Normally, of course, it works on all top-level nodes and links. The layout is performed both after the model is first loaded as well as after any part is added or removed or changes visibility or size. You can disable the initial layout by setting Layout.isInitial to false. You can disable later automatic layouts by setting Layout.isOngoing to false.

See the Layouts page in the Introduction for a summary of layout behavior.

A diagram maintains a collection of selected parts, the Diagram.selection. To select a Part you set its Part.isSelected property to true.

There are many properties, named "allow...", that control what operations the user may perform on the parts in the diagram. These correspond to the same named properties on Layer that govern the behavior for those parts in a particular layer. Furthermore for some of these properties there are corresponding properties on Part, named "...able", that govern the behavior for that individual part. For example, the #allowCopy property corresponds to Layer.allowCopy and to the property Part.copyable. The Part.canCopy predicate is false if any of these properties is false.

See the Permissions page for a more thorough discussion.

The #commandHandler implements various standard commands, such as the CommandHandler.deleteSelection method and the CommandHandler.canDeleteSelection predicate.

See the Commands page for a listing of keyboard commands and the use of commands in general.

The diagram supports modular behavior for mouse events by implementing "tools". All mouse and keyboard events are represented by InputEvents and redirected to the #currentTool. The default tool is an instance of ToolManager which keeps three lists of mode-less tools: ToolManager.mouseDownTools, ToolManager.mouseMoveTools, and ToolManager.mouseUpTools. The ToolManager searches these lists when a mouse event happens to find the first tool that can run. It then makes that tool the new #currentTool, where it can continue to process input events. When the tool is done, it stops itself, causing the #defaultTool to be the new #currentTool.

Mouse-down tools include:

Mouse-move tools include: Mouse-up tools include:

You can also run a tool in a modal fashion by explicitly setting #currentTool. That tool will keep running until some code replaces the #currentTool/ This normally happens when the current tool calls Tool.stopTool, such as on a mouse-up event.

See the Tools page for a listing of predefined tools and how they operate.

A diagram raises various DiagramEvents when interesting things happen that may have affected the whole diagram. See the documentation for DiagramEvent for a complete listing.

-

DiagramEvent

A DiagramEvent represents a more abstract event than an InputEvent.More... They are raised on the Diagram class. One can receive such events by registering a DiagramEvent listener on a Diagram by calling Diagram.addDiagramListener. The listener function, when called, will be passed an instance of a DiagramEvent. Use the #name property to decide what kind of diagram event it is. The #diagram property refers to the Diagram, and you can get additional information from that, such as the Diagram.lastInput, which in turn provides information such as InputEvent.documentPoint that may be relevant for that kind of DiagramEvent.

The #subject and #parameter properties optionally provide additional information about the diagram event. The subject could be a collection of Parts or it could be an individual object such as a Link or a GraphObject within a Node. Everything depends on the kind of diagram event that it is.

Some DiagramEvents such as "ObjectSingleClicked" or "BackgroundDoubleClicked" are normally associated with InputEvents. Some DiagramEvents such as "SelectionMoved" or "PartRotated" are associated with the results of Tool-handled gestures or CommandHandler actions. Some DiagramEvents are not necessarily associated with any input events at all, such as "ViewportBoundsChanged", which can happen due to programmatic changes to the Diagram.position and Diagram.scale properties.

DiagramEvents that occur during a transaction may be called before the state of the whole diagram has settled down. This often means that such events occur before a layout, so nodes may not have their final positions, links may not have their final routes, and the Diagram.documentBounds and Diagram.viewportBounds may not yet have been updated. Such events may make additional changes to the diagram, which may in turn result in additional side-effects.

DiagramEvents that occur outside of a transaction require you to start and commit a transaction around any side-effects that you want to do. However, some DiagramEvents do not allow you to make any changes to the Diagram or Model.

Currently defined diagram event names include:

+

DiagramEvent

A DiagramEvent represents a more abstract event than an InputEvent.More... They are raised on the Diagram class. One can receive such events by registering a DiagramEvent listener on a Diagram by calling Diagram.addDiagramListener. The listener function, when called, will be passed an instance of a DiagramEvent. Use the #name property to decide what kind of diagram event it is. The #diagram property refers to the Diagram, and you can get additional information from that, such as the Diagram.lastInput, which in turn provides information such as InputEvent.documentPoint that may be relevant for that kind of DiagramEvent.

The #subject and #parameter properties optionally provide additional information about the diagram event. The subject could be a collection of Parts or it could be an individual object such as a Link or a GraphObject within a Node. Everything depends on the kind of diagram event that it is.

Some DiagramEvents such as "ObjectSingleClicked" or "BackgroundDoubleClicked" are normally associated with InputEvents. Some DiagramEvents such as "SelectionMoved" or "PartRotated" are associated with the results of Tool-handled gestures or CommandHandler actions. Some DiagramEvents are not necessarily associated with any input events at all, such as "ViewportBoundsChanged", which can happen due to programmatic changes to the Diagram.position and Diagram.scale properties.

DiagramEvents that occur during a transaction may be called before the state of the whole diagram has settled down. This often means that such events occur before a layout, so nodes may not have their final positions, links may not have their final routes, and the Diagram.documentBounds and Diagram.viewportBounds may not yet have been updated. Such events may make additional changes to the diagram, which may in turn result in additional side-effects.

DiagramEvents that occur outside of a transaction require you to start and commit a transaction around any side-effects that you want to do. However, some DiagramEvents do not allow you to make any changes to the Diagram or Model.

Currently defined diagram event names include:

DraggingTool

The DraggingTool is used to move or copy selected parts with the mouse.More... This sets the Part.location property; you may want to save the location to the model by using a TwoWay Binding on the "location" property in your Parts/Nodes/Groups templates.

Dragging the selection moves parts for which Part.canMove is true. If the user holds down the Control key (Option key on Mac), this tool will make a copy of the parts being dragged, for those parts for which Part.canCopy is true.

When the drag starts it calls #computeEffectiveCollection to find the actual collection of Parts to be dragged. Normally this collection includes not only the Diagram.selection, but also parts that belong to those selected parts, such as members of groups. If #dragsTree is true, the effective collection also includes all of the nodes and links that constitute the subtree starting from selected nodes. The result of #computeEffectiveCollection is not a Set but a Map which remembers the original Part.location for all of the dragged parts. This map is saved as the value of #draggedParts.

During the drag if the user holds down the Control/Option key this tool makes a copy of the #draggedParts and proceeds to drag it around. (It only copies the Diagram.selection, not the whole effective collection, if #copiesEffectiveCollection is false.) The collection of copied parts is held by #copiedParts. It too is a Map remembering the original locations of the parts. #copiedParts will be null when this tool is moving (not copying) at the moment.

Each Part's movement is limited by the #computeMove method. By default it limits the Part.location to be within the bounds given by Part.minLocation and Part.maxLocation. (Those default to minus Infinity to plus Infinity.) As a further convenience, the value of NaN in minLocation and maxLocation cause #computeMove to use the part's current location. So, for example, an easy way to declare that the user may only drag a node horizontally is to just set:

$(go.Node,
  . . .
  { minLocation: new go.Point(-Infinity, NaN), maxLocation: new go.Point(Infinity, NaN) },
  . . .
)

If you set #isGridSnapEnabled to true, dragged or copied parts will be snapped to points on a grid. The snapping occurs continuously during a drag unless you set #isGridSnapRealtime to false. Normally the grid points come from the Diagram.grid, even if that grid is not GraphObject.visible. However you can override those grid's properties for the snapping grid cell size and offset by setting the properties here: #gridSnapCellSize and #gridSnapOrigin. This computes the point to snap to for each dragged part. The resulting point is used as the new Part.location.

For the most general control over where a part may be dragged, either set the Part.dragComputation property or override #computeMove. For the common case of wanting to keep member nodes within the Group that they are members of, you can do something like:

 // this is a Part.dragComputation function for limiting where a Node may be dragged
 function stayInGroup(part, pt, gridpt) {
   // don't constrain top-level nodes
   var grp = part.containingGroup;
   if (grp === null) return pt;
   // try to stay within the background Shape of the Group
   var back = grp.findObject("SHAPE");
   if (back === null) return pt;
   // allow dragging a Node out of a Group if the Shift key is down
   //if (part.diagram.lastInput.shift) return pt;
   var p1 = back.getDocumentPoint(go.Spot.TopLeft);
   var p2 = back.getDocumentPoint(go.Spot.BottomRight);
   var b = part.actualBounds;
   var loc = part.location;
   // find the padding inside the group's placeholder that is around the member parts
   var m = (grp.placeholder !== null ? grp.placeholder.padding : new go.Margin(0));
   // now limit the location appropriately
   var x = Math.max(p1.x + m.left, Math.min(pt.x, p2.x - m.right - b.width - 1)) + (loc.x-b.x);
   var y = Math.max(p1.y + m.top, Math.min(pt.y, p2.y - m.bottom - b.height - 1)) + (loc.y-b.y);
   return new go.Point(x, y);
 }
Note that this expects there to be a "SHAPE" object within the Group's visual tree that delimits where the part may be dragged within the group. This also expects that Group.computesBoundsIncludingLinks is false. Then in your node template(s), just set:
$(go.Node,
  . . .,
  { dragComputation: stayInGroup },
  . . .
)

This tool does not utilize any Adornments or tool handles. If the drag is successful, it raises the "SelectionMoved" or "SelectionCopied" DiagramEvent and produces a "Move" or a "Copy" transaction.

If you want to programmatically start a new user mouse-gesture to drag a particular existing node, you can set the #currentPart property and then start and activate the tool.

  var tool = myDiagram.toolManager.draggingTool;
  tool.currentPart = ...;
  myDiagram.currentTool = tool;
  tool.doActivate();
diff --git a/api/symbols/ActionTool.html b/api/symbols/ActionTool.html index e495eb22d..c71786c72 100644 --- a/api/symbols/ActionTool.html +++ b/api/symbols/ActionTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Adornment.html b/api/symbols/Adornment.html index 30a20614d..1fc4ba22b 100644 --- a/api/symbols/Adornment.html +++ b/api/symbols/Adornment.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/AnimationManager.html b/api/symbols/AnimationManager.html index 086355b38..5f141c5b5 100644 --- a/api/symbols/AnimationManager.html +++ b/api/symbols/AnimationManager.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Binding.html b/api/symbols/Binding.html index 4bdb7f561..30078eac5 100644 --- a/api/symbols/Binding.html +++ b/api/symbols/Binding.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Brush.html b/api/symbols/Brush.html index edd59cc97..18c903e00 100644 --- a/api/symbols/Brush.html +++ b/api/symbols/Brush.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ChangedEvent.html b/api/symbols/ChangedEvent.html index 27bd705c4..caff39462 100644 --- a/api/symbols/ChangedEvent.html +++ b/api/symbols/ChangedEvent.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/CircularEdge.html b/api/symbols/CircularEdge.html index 0b8ab9119..95a6a9eba 100644 --- a/api/symbols/CircularEdge.html +++ b/api/symbols/CircularEdge.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/CircularLayout.html b/api/symbols/CircularLayout.html index 0d2c950bc..cd62334c6 100644 --- a/api/symbols/CircularLayout.html +++ b/api/symbols/CircularLayout.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/CircularVertex.html b/api/symbols/CircularVertex.html index e35b78fa6..381d8ed6c 100644 --- a/api/symbols/CircularVertex.html +++ b/api/symbols/CircularVertex.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ClickCreatingTool.html b/api/symbols/ClickCreatingTool.html index 4c2e47100..6c9c16cb3 100644 --- a/api/symbols/ClickCreatingTool.html +++ b/api/symbols/ClickCreatingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ClickSelectingTool.html b/api/symbols/ClickSelectingTool.html index 2c38eadd3..3f66fe693 100644 --- a/api/symbols/ClickSelectingTool.html +++ b/api/symbols/ClickSelectingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/CommandHandler.html b/api/symbols/CommandHandler.html index 7561bfd44..fd2f9fabd 100644 --- a/api/symbols/CommandHandler.html +++ b/api/symbols/CommandHandler.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ContextMenuTool.html b/api/symbols/ContextMenuTool.html index 419e30935..4f9b9a063 100644 --- a/api/symbols/ContextMenuTool.html +++ b/api/symbols/ContextMenuTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Diagram.html b/api/symbols/Diagram.html index f294e1e48..11ec1a4d2 100644 --- a/api/symbols/Diagram.html +++ b/api/symbols/Diagram.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/DiagramEvent.html b/api/symbols/DiagramEvent.html index 74a4c4906..129c28440 100644 --- a/api/symbols/DiagramEvent.html +++ b/api/symbols/DiagramEvent.html @@ -1111,7 +1111,7 @@
@@ -1131,7 +1131,7 @@

- A DiagramEvent represents a more abstract event than an InputEvent. They are raised on the Diagram class. One can receive such events by registering a DiagramEvent listener on a Diagram by calling Diagram.addDiagramListener. The listener function, when called, will be passed an instance of a DiagramEvent. Use the name property to decide what kind of diagram event it is. The diagram property refers to the Diagram, and you can get additional information from that, such as the Diagram.lastInput, which in turn provides information such as InputEvent.documentPoint that may be relevant for that kind of DiagramEvent.

The subject and parameter properties optionally provide additional information about the diagram event. The subject could be a collection of Parts or it could be an individual object such as a Link or a GraphObject within a Node. Everything depends on the kind of diagram event that it is.

Some DiagramEvents such as "ObjectSingleClicked" or "BackgroundDoubleClicked" are normally associated with InputEvents. Some DiagramEvents such as "SelectionMoved" or "PartRotated" are associated with the results of Tool-handled gestures or CommandHandler actions. Some DiagramEvents are not necessarily associated with any input events at all, such as "ViewportBoundsChanged", which can happen due to programmatic changes to the Diagram.position and Diagram.scale properties.

DiagramEvents that occur during a transaction may be called before the state of the whole diagram has settled down. This often means that such events occur before a layout, so nodes may not have their final positions, links may not have their final routes, and the Diagram.documentBounds and Diagram.viewportBounds may not yet have been updated. Such events may make additional changes to the diagram, which may in turn result in additional side-effects.

DiagramEvents that occur outside of a transaction require you to start and commit a transaction around any side-effects that you want to do. However, some DiagramEvents do not allow you to make any changes to the Diagram or Model.

Currently defined diagram event names include:

+ A DiagramEvent represents a more abstract event than an InputEvent. They are raised on the Diagram class. One can receive such events by registering a DiagramEvent listener on a Diagram by calling Diagram.addDiagramListener. The listener function, when called, will be passed an instance of a DiagramEvent. Use the name property to decide what kind of diagram event it is. The diagram property refers to the Diagram, and you can get additional information from that, such as the Diagram.lastInput, which in turn provides information such as InputEvent.documentPoint that may be relevant for that kind of DiagramEvent.

The subject and parameter properties optionally provide additional information about the diagram event. The subject could be a collection of Parts or it could be an individual object such as a Link or a GraphObject within a Node. Everything depends on the kind of diagram event that it is.

Some DiagramEvents such as "ObjectSingleClicked" or "BackgroundDoubleClicked" are normally associated with InputEvents. Some DiagramEvents such as "SelectionMoved" or "PartRotated" are associated with the results of Tool-handled gestures or CommandHandler actions. Some DiagramEvents are not necessarily associated with any input events at all, such as "ViewportBoundsChanged", which can happen due to programmatic changes to the Diagram.position and Diagram.scale properties.

DiagramEvents that occur during a transaction may be called before the state of the whole diagram has settled down. This often means that such events occur before a layout, so nodes may not have their final positions, links may not have their final routes, and the Diagram.documentBounds and Diagram.viewportBounds may not yet have been updated. Such events may make additional changes to the diagram, which may in turn result in additional side-effects.

DiagramEvents that occur outside of a transaction require you to start and commit a transaction around any side-effects that you want to do. However, some DiagramEvents do not allow you to make any changes to the Diagram or Model.

Currently defined diagram event names include:

diff --git a/api/symbols/DragSelectingTool.html b/api/symbols/DragSelectingTool.html index c3a0b2147..efb1161a4 100644 --- a/api/symbols/DragSelectingTool.html +++ b/api/symbols/DragSelectingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/DraggingTool.html b/api/symbols/DraggingTool.html index 5ef894693..79788ed57 100644 --- a/api/symbols/DraggingTool.html +++ b/api/symbols/DraggingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ForceDirectedEdge.html b/api/symbols/ForceDirectedEdge.html index 455925ead..68e7cca11 100644 --- a/api/symbols/ForceDirectedEdge.html +++ b/api/symbols/ForceDirectedEdge.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ForceDirectedLayout.html b/api/symbols/ForceDirectedLayout.html index eb5d34d38..afc87d809 100644 --- a/api/symbols/ForceDirectedLayout.html +++ b/api/symbols/ForceDirectedLayout.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ForceDirectedVertex.html b/api/symbols/ForceDirectedVertex.html index 37e4006ad..857b99454 100644 --- a/api/symbols/ForceDirectedVertex.html +++ b/api/symbols/ForceDirectedVertex.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Geometry.html b/api/symbols/Geometry.html index ab0fede08..52afedeb9 100644 --- a/api/symbols/Geometry.html +++ b/api/symbols/Geometry.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/GraphLinksModel.html b/api/symbols/GraphLinksModel.html index eb5e388af..cb79e592e 100644 --- a/api/symbols/GraphLinksModel.html +++ b/api/symbols/GraphLinksModel.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/GraphObject.html b/api/symbols/GraphObject.html index b113ea06c..e2157de08 100644 --- a/api/symbols/GraphObject.html +++ b/api/symbols/GraphObject.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/GridLayout.html b/api/symbols/GridLayout.html index 6cfc15180..7003fabf4 100644 --- a/api/symbols/GridLayout.html +++ b/api/symbols/GridLayout.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Group.html b/api/symbols/Group.html index f7c785f36..e3f1c6c6a 100644 --- a/api/symbols/Group.html +++ b/api/symbols/Group.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/HTMLInfo.html b/api/symbols/HTMLInfo.html index a4debf37a..e5e9bc8ce 100644 --- a/api/symbols/HTMLInfo.html +++ b/api/symbols/HTMLInfo.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/InputEvent.html b/api/symbols/InputEvent.html index c8811a28d..db08a5fcc 100644 --- a/api/symbols/InputEvent.html +++ b/api/symbols/InputEvent.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Iterable.html b/api/symbols/Iterable.html index b9f96f432..ab2e701d2 100644 --- a/api/symbols/Iterable.html +++ b/api/symbols/Iterable.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Iterator.html b/api/symbols/Iterator.html index c6b1632d9..ca9084c31 100644 --- a/api/symbols/Iterator.html +++ b/api/symbols/Iterator.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Layer.html b/api/symbols/Layer.html index a9238018d..f3a38f866 100644 --- a/api/symbols/Layer.html +++ b/api/symbols/Layer.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LayeredDigraphEdge.html b/api/symbols/LayeredDigraphEdge.html index 3fb570453..26887f84e 100644 --- a/api/symbols/LayeredDigraphEdge.html +++ b/api/symbols/LayeredDigraphEdge.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LayeredDigraphLayout.html b/api/symbols/LayeredDigraphLayout.html index 39d2af5e2..dd66843c2 100644 --- a/api/symbols/LayeredDigraphLayout.html +++ b/api/symbols/LayeredDigraphLayout.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LayeredDigraphVertex.html b/api/symbols/LayeredDigraphVertex.html index 6a3b62ae3..fa65c7adc 100644 --- a/api/symbols/LayeredDigraphVertex.html +++ b/api/symbols/LayeredDigraphVertex.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Layout.html b/api/symbols/Layout.html index 03ed8398a..ff49c00b1 100644 --- a/api/symbols/Layout.html +++ b/api/symbols/Layout.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LayoutEdge.html b/api/symbols/LayoutEdge.html index ca79f75bc..4b11d6727 100644 --- a/api/symbols/LayoutEdge.html +++ b/api/symbols/LayoutEdge.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LayoutNetwork.html b/api/symbols/LayoutNetwork.html index 47372b69e..7b49ef9d5 100644 --- a/api/symbols/LayoutNetwork.html +++ b/api/symbols/LayoutNetwork.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LayoutVertex.html b/api/symbols/LayoutVertex.html index c5d992e9b..e42a05e08 100644 --- a/api/symbols/LayoutVertex.html +++ b/api/symbols/LayoutVertex.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Link.html b/api/symbols/Link.html index 7a7ca7d18..8a88ad3fd 100644 --- a/api/symbols/Link.html +++ b/api/symbols/Link.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LinkReshapingTool.html b/api/symbols/LinkReshapingTool.html index 93f1c4b96..f862062a9 100644 --- a/api/symbols/LinkReshapingTool.html +++ b/api/symbols/LinkReshapingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LinkingBaseTool.html b/api/symbols/LinkingBaseTool.html index c0036f074..334340ea4 100644 --- a/api/symbols/LinkingBaseTool.html +++ b/api/symbols/LinkingBaseTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/LinkingTool.html b/api/symbols/LinkingTool.html index aad904eee..26973557b 100644 --- a/api/symbols/LinkingTool.html +++ b/api/symbols/LinkingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/List.html b/api/symbols/List.html index 07177ace7..e96267a33 100644 --- a/api/symbols/List.html +++ b/api/symbols/List.html @@ -1111,7 +1111,7 @@
@@ -1544,46 +1544,6 @@

Method Summary - - - -
- delete(val) -
-
- {boolean} - -
- - -
-

Removes a given value (if found) from the List.More...

Be careful not to call this method while iterating over the collection.

- - -
-
Parameters:
- -
- {T} val - -
-
The value to remove.
- -
- - -
-
Returns:
- -
{boolean} true if the value was found and removed, false otherwise.
- -
- - -
- - - diff --git a/api/symbols/Map.html b/api/symbols/Map.html index 24318dd7b..f287668d3 100644 --- a/api/symbols/Map.html +++ b/api/symbols/Map.html @@ -1111,7 +1111,7 @@
@@ -1567,46 +1567,6 @@

Method Summary - - - -
- delete(key) -
-
- {boolean} - -
- - -
-

Removes a key (if found) from the Map.More...

Be careful not to call this method while iterating over the collection.

- - -
-
Parameters:
- -
- {K} key - -
-
The key to insert.
- -
- - -
-
Returns:
- -
{boolean} true if the key was found and removed, false otherwise.
- -
- - -
- - - diff --git a/api/symbols/Margin.html b/api/symbols/Margin.html index fdf7bd9d6..796e130ce 100644 --- a/api/symbols/Margin.html +++ b/api/symbols/Margin.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Model.html b/api/symbols/Model.html index 0aace3433..db5c4f169 100644 --- a/api/symbols/Model.html +++ b/api/symbols/Model.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Node.html b/api/symbols/Node.html index e33a66498..075caeea6 100644 --- a/api/symbols/Node.html +++ b/api/symbols/Node.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Overview.html b/api/symbols/Overview.html index a7d309db0..06cf9ac7e 100644 --- a/api/symbols/Overview.html +++ b/api/symbols/Overview.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Palette.html b/api/symbols/Palette.html index fbf0fb4ff..1412fd7a1 100644 --- a/api/symbols/Palette.html +++ b/api/symbols/Palette.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Panel.html b/api/symbols/Panel.html index d75ea6940..f6e116790 100644 --- a/api/symbols/Panel.html +++ b/api/symbols/Panel.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/PanningTool.html b/api/symbols/PanningTool.html index beda414c6..85a282628 100644 --- a/api/symbols/PanningTool.html +++ b/api/symbols/PanningTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Part.html b/api/symbols/Part.html index 78c4f40d1..0df8d75df 100644 --- a/api/symbols/Part.html +++ b/api/symbols/Part.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/PathFigure.html b/api/symbols/PathFigure.html index afc303788..b8c7e59b3 100644 --- a/api/symbols/PathFigure.html +++ b/api/symbols/PathFigure.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/PathSegment.html b/api/symbols/PathSegment.html index 56f7af61b..9f870f9f6 100644 --- a/api/symbols/PathSegment.html +++ b/api/symbols/PathSegment.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Picture.html b/api/symbols/Picture.html index 8a0fbe0d8..f2e0f07c2 100644 --- a/api/symbols/Picture.html +++ b/api/symbols/Picture.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Placeholder.html b/api/symbols/Placeholder.html index f1f0a5f5d..1ea423b55 100644 --- a/api/symbols/Placeholder.html +++ b/api/symbols/Placeholder.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Point.html b/api/symbols/Point.html index 8a64d2f62..bcba7199c 100644 --- a/api/symbols/Point.html +++ b/api/symbols/Point.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Rect.html b/api/symbols/Rect.html index 6290afd2e..7e943db68 100644 --- a/api/symbols/Rect.html +++ b/api/symbols/Rect.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/RelinkingTool.html b/api/symbols/RelinkingTool.html index ebd1135df..2dbf83497 100644 --- a/api/symbols/RelinkingTool.html +++ b/api/symbols/RelinkingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ResizingTool.html b/api/symbols/ResizingTool.html index 3900f3015..aefa7c2ae 100644 --- a/api/symbols/ResizingTool.html +++ b/api/symbols/ResizingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/RotatingTool.html b/api/symbols/RotatingTool.html index b28a0fe13..32a6012fc 100644 --- a/api/symbols/RotatingTool.html +++ b/api/symbols/RotatingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/RowColumnDefinition.html b/api/symbols/RowColumnDefinition.html index 82f9e57b3..913a89615 100644 --- a/api/symbols/RowColumnDefinition.html +++ b/api/symbols/RowColumnDefinition.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Set.html b/api/symbols/Set.html index 0bfe27744..ad3218942 100644 --- a/api/symbols/Set.html +++ b/api/symbols/Set.html @@ -1111,7 +1111,7 @@
@@ -1591,46 +1591,6 @@

Method Summary - - - -
- delete(val) -
-
- {boolean} - -
- - -
-

Removes a value (if found) from the Set.More...

Be careful not to call this method while iterating over the collection.

- - -
-
Parameters:
- -
- {T} val - -
-
The value to insert.
- -
- - -
-
Returns:
- -
{boolean} true if the value was found and removed, false otherwise.
- -
- - -
- - - diff --git a/api/symbols/Shape.html b/api/symbols/Shape.html index b2316e2be..615f608c9 100644 --- a/api/symbols/Shape.html +++ b/api/symbols/Shape.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Size.html b/api/symbols/Size.html index d3bde49ec..21dd55552 100644 --- a/api/symbols/Size.html +++ b/api/symbols/Size.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Spot.html b/api/symbols/Spot.html index 7d0cf9a4a..6eb4e1702 100644 --- a/api/symbols/Spot.html +++ b/api/symbols/Spot.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/TextBlock.html b/api/symbols/TextBlock.html index 8c8fa8ccc..940504d61 100644 --- a/api/symbols/TextBlock.html +++ b/api/symbols/TextBlock.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/TextEditingTool.html b/api/symbols/TextEditingTool.html index 8915ed101..87ed2ffbe 100644 --- a/api/symbols/TextEditingTool.html +++ b/api/symbols/TextEditingTool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Tool.html b/api/symbols/Tool.html index 71016f172..d6307d843 100644 --- a/api/symbols/Tool.html +++ b/api/symbols/Tool.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/ToolManager.html b/api/symbols/ToolManager.html index a6b8a9317..9fca1d42b 100644 --- a/api/symbols/ToolManager.html +++ b/api/symbols/ToolManager.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/Transaction.html b/api/symbols/Transaction.html index 9daa9f98a..f8cd797d8 100644 --- a/api/symbols/Transaction.html +++ b/api/symbols/Transaction.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/TreeEdge.html b/api/symbols/TreeEdge.html index 323691b46..ef8a2f109 100644 --- a/api/symbols/TreeEdge.html +++ b/api/symbols/TreeEdge.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/TreeLayout.html b/api/symbols/TreeLayout.html index 17bf5349d..58e4978cc 100644 --- a/api/symbols/TreeLayout.html +++ b/api/symbols/TreeLayout.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/TreeModel.html b/api/symbols/TreeModel.html index c14842fb3..8fd9a91f5 100644 --- a/api/symbols/TreeModel.html +++ b/api/symbols/TreeModel.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/TreeVertex.html b/api/symbols/TreeVertex.html index 0dd66cac3..952a0e9f1 100644 --- a/api/symbols/TreeVertex.html +++ b/api/symbols/TreeVertex.html @@ -1111,7 +1111,7 @@
diff --git a/api/symbols/UndoManager.html b/api/symbols/UndoManager.html index 20a32ba8f..ffb0abb13 100644 --- a/api/symbols/UndoManager.html +++ b/api/symbols/UndoManager.html @@ -1111,7 +1111,7 @@
diff --git a/assets/images/screenshots/LinkLabelOnPathDragging.png b/assets/images/screenshots/LinkLabelOnPathDragging.png new file mode 100644 index 0000000000000000000000000000000000000000..68100777453435461a3f4dba9aec5047baba0015 GIT binary patch literal 7044 zcmds62T+sSwnhy_x+oxBgkT}SwSZI+(1Vb}LBWI|2aF0LT@geBgkummh!m+xM~$=y zKOF)gMieO`%}@m_D7{H&k@9u|c+b4K^XA=o^WMCBnaPm-|9h{!%D2}3)=ub|-;4!# zC3!hGI0Q^ipS0lM*b>G1@N5N7g!(d)z`rdwEQ}2~^4>|0fC0?Wz|4Syqac!R`64G6 zZ@+fh`UVGwU=8cD<&8&{JqL%Bgvm*RbGPg!`U39TIy`zYvn4}6Sgh@sy#Nz8jNoKlo0*o&7NT1+Rbmh}M+vI|_v&U0uD< z(UP&ik*>re_D9bi42N?dc1xB3fiqp>|K>sPDmTYoYgb)i1V;fvLl$g`5t9;v@tr_~ zg>w@)_r$-h-A3Cg+<58B9qg7r9SUYnKpd|MyKVthFa7H*V|;78u=+jDsa9jz zv3Q6n+lJwA*w`KJ)p>F1E#lrUbgK*H9|@xKpU;@EeL#7DmC;@N=sUGyb*i>G6JXr!uj)vXz__gF_rcg2mNCy_UKTZGt;*;tI8|GSetTP_FLlS|lU{lMEccAIT1 zc#BH+N#_Ha9tng?<$96E3_ru&oNW{_Sz9UFY=ucVNy->Sivy_!90{=#1F< z3+3_}i*e|T0gjuz2ZK6h1>Kb%>qIdpDoe8`!c+)BZ6h+n1T4xn1nZP}j@R;htn~B) zVb*S8-(bkqCX%GD17D0lhoLYc_O-i#P}BB~@1H)osFAO>H^iZKyTq#v`1iWaH;4se zGbYEy7%f>?nF{9U<*^Rb#Sbeqq5cAw1WI9$JSI!0l2cEZ6lDOB_hJHTfGC)m$$Ax~r0hA4|EH)0A#R4aslB zlUE{wcJQ&Y+`_#*K;-&-0$r3QDa}ffpW<1GARmbJJ_T`wuwcL|0n1e;sB41s<5I;K z85wb_Qmfor{WrAfy0tqUtA~Fr%1k>1Tz29gtb${*(W9SFh1u89R^*sbcIoYr`Irn# zt*DU+@e8DO>hGoFZ)=_rL%ep&5ayO=n|mMZG@(yVLuR9aSOLMX@DQ3n{HxP~#b-uH zq_MdkwZ5>CY|{IZidqs4_c?Um`R5(;6TNPegM;-kW1abBCO|dX#e$i?mCJ4ankns) zVc-5V^X~8Qd9jvcdfS)rxDQch*!=;F+m(!rs3I#bKbL;4;u%yqY1OsCegWs_Xu zysY3R4er%#kB^@W#_Rr?Cgvz}027^~?$QAxnvM@p1Lj8Q0gE+qu6A-TmunbTU4Ad9 z*iz)lIr!3nutdf1Sm{5<@uqS_tt6MzP~J+Nv6#yFVrP1eicP7X(uX~m zt~_XoJGVc@wAAaMoRIe^AVV(NXigd}F)>k6QZhPC8%5UC(sG)8$%D@S`F`|O=*~`C zpA@sLpx{HBB67U$Fe^_LW<@bJ|lW5VGO(LZm@2TG8LFdxh#c6vo zqT$Y745e^$+jL{u+b7Rodn4l`t$FQZnr+{WW<8yo<1LlCN%9%+QE7xcH;xh&GF<)Z zX-LDZ$DVpWW+>HnGE;wLq;jg-WeQm|{No#ez59pefYsTW5TU8wGLN#{rleyY1J$-u z-(90$4G&-K#E#@0MEckm64VbLz67Ksc~mde$gNI;zsr$&SEi7GKLwEmFOZurhs234 zJeUSFrLWYjSG;1Z0=)(ygnrzqBkgow`Ao8<54%7o|P7DSM~HcO{?S z;h_W~{6UK>5nF#znK-DV~9#j34UZrrXM>01d&IpnOL?Z-f&x01E zIfF>a%-7!DgVBQJ9^yfJ|6CfyE}H{e{Z_^CWNz?;pM53*XddM3us5Q*z6{ z%Q~Z2uAMx2|HowI6v){uv#J!`+iiCKa%}DdLi0IZ)dsgJ3MvV44YMlV*o*$XwgUMM zjtMt}&U}cTjpz4wx;l(?t1Uz(>>&LDq(xvw*{li}c25Dr`BM-N+JJppg6L`zP*Izk z{|}}s?;=r*9P66B5MDhC22diP2IZ49a^u!hP!-$!&wtsoT$N^8VqrBH2)CRI)wc~8 zV=xFA8Pvq%!sOJvUEh<*Sw^bA@t%yrs)J79`m7LIwGpyFwH4YwT2$uy@$r#Zm|1klWv)m?iqOW22Ked9J=1c;e zhnyac(P}Igw{}~t6_AKdK-ZhpJN>472a2pTc282*@JkcDPjhfQ@llBkNrc2_=@@mv8VBg7CNIyB)bFEJx#2Z0v9&@T7C71#JCk8+nsvT>{+bosydgI4<;tJ_KSj z%u{ir*<<VG@Cz5WtH$@*6M(4L-^U;$=6CC4ff< zZ$KF|{V0J=$y~G?$qoGG2oO-}u-rYYqZcIw%XQwsTdu}`vB8ll*IV^J5)dmzL~jX4 z>Xa)X=(s!vHJdhPpI;rhp%dbLEW42qAOt0Ds&mGY-I9Te2WNJ3O9zITvC|9aopoSC z2|ji9B>+%42&)g%<%JITR_o|s+k`VVPg}e$FvrDWZ^U?&$Bah}> zreFK`;tps+-q~3P?I0|2P*9FJ$~*uqGJ8GB6-ZPe&rHad952Onr{w@ zjL*6_rWk22hbS-Z?_x9f*Y&%{ zjePprzC-ydMh#6q(3ncs4|{L<-4Y#}495%~SvQHV`(mhd{(H+%M1wK4bf`6??p(y& zVR=h{fOQ=^5RPq;EqXE`CwRk>k&{?8Ut`3Rz*FKpX^V5G6* zph-{%4Zg|vH^2d3?jV7XnO$O=8-Z;Cw+kZcD#Khr$YQ#hSadB0JCk;LQWU&nbIsof zuP+$3Dii36>$qHWss7IpMfG^#XQgx+xX0dSTjE;If&JK+B+4B3Tf8jyYcSwtwI^}`%QGV};isTPHj_Zv_Sic?_P!-onk4n;*iDH7 z!%E0Nb)H^ja1OBN(f@ESRK!H;&3El_&4+F1j1nrWCx1(H0gO}guX6)k3kL^2p>omP zRe*xTu#e9k&7tHQwY9abZGeodt6lE@W8M~ra{2Uy5Vlt3=74|VO^>5{Z27xKN=9hZ zim9fAgNK6?)D$qo`!+n~{Y8J=e~_}4Ri`<%qJH(~iVa`0XZ^F^^BC9(=A^#Eo9IuU z6pSNu#hdYKvxXby2Px}eYy|r&Z}!zi*m$%Sxb>E%==k(&2O@A15)$3i0P4!>P!PyT zcB5()1a8u9wXEJ*2wL`p@rCw@fv9f+q;whpM3ledUdL#LlV^+Mii_6b;-ZmT=UWfJ z>KfhoSPA(6Ym!uqHgrA(vEbtN3BW~JgyizZz5QIt^UC|$TrTy|@J#cx((TUg)>i;} zjX&6}H4{EAh!men_Cu@1Z?kQ6BA+0>9?!Cc`u%2`kg650l(O_IRao_ak3ZhMdN9+D zBq!U>c)RWUDt@#))%1x9CMG5Z_qD6*;c{&D)spj1o;*36lBnUo%CAL?OsvRKW-4Ct z^ZPx27axDek!IbZ+p|}a(pSgXMm2p=xTt|46VJDvf1Wvb;+crLmV200@6qs5Y`waq z_|kzl?G)`8C^U3C<-}*Ac-=ixbIC(OoS4Jcw?sa^4jT`OH>jFx(;@oBTBGJuyy7tB z4_gD_Mhft+(S0$XiFI(Z=xM9tLiRp=V+hE>(PM7nr!y6QDN=QY7-zdL%Tqsq&eCq| zb;0E~)w3y6uDzvh-GvT9dW2ZicylPHfEAi*>cuSGfQ>`uW<71B|?D2GC0tT@1M(T4V&r+-es{ zloQgqA2bfVCxxX1&c)^Xy~eNYzJ;?Y2Q^zvmQ=h~(ZcDhTpXH_SiENXnN%THz#W;&YG#~L- zp&3SO&LnCOn**JO$<8`N5Hb@R2k9LM`|eGgv^)?%-?VwEgRosV1w}cO1+l8G1x=*q z0P(A*@y{pDw9##ZAjCQzV0_y)kR(c&o30UB^N_1o19REQdkw|YQ4uCiy#7vW2yw6M z#ab2rdRbuQh1(OcfF|*cu>xlIH8wAmroH@weLeY!M~o|(ofgK>-#)VIl_nu*3;SmA zgQ=_4vJq-u8(YB6Vv`LIR*g16zu=-=#`{@?j0h<_Q|_!jzo b*SJl(gY9c~lGoJS Change Log

} +

Changes for 1.7.8

+ +

Changes for 1.7.7

  • @@ -82,7 +102,6 @@

    Changes for 1.7.7

-

Changes for 1.7.6

  • diff --git a/extensions/FloorPlanner.html b/extensions/FloorPlanner.html index ff8c4fa5b..e97a952cd 100644 --- a/extensions/FloorPlanner.html +++ b/extensions/FloorPlanner.html @@ -1,274 +1,8 @@ - - - - - - - Floor Planner - - - - - - - - - - - - -
    (Unsaved File)
    - - + -
    -
    -
    -

    Drag a node to the Diagram or select the Wall Drawing Tool (Ctrl + 1) to begin

    -
    -
    + + - -
    -
    Palettes
    -
    - -

    Furniture

    -
    - -
    -
    -

    Wall Parts

    -
    -
    -
    - - - - - - - - - - - - - -

    - This sample allows for users to create detailed floor plans. Furniture can be directly dragged from the Furniture Palette onto the main grid. - Doors and windows may be dragged directly onto walls from the Wall Parts Palette. - Pertinent selection information can be viewed and edited from the Selection Info Window (Ctrl + I or right click -> 'Show Selection Info' or double click a node). -

    -

    - Users may drag walls from the Wall Parts Palette, or they may create walls with the Wall Building Tool (Ctrl + 1 or simply click on the tool icon to the right of the 'View' menu). - The Wall Building Tool allows users to click anywhere on the diagram, use that point as a startpoint for the wall, then hold the mouse button and drag to the desired wall endpoint. - The dragging functionality is supplied by the Wall Reshaping Tool. The Wall Reshaping Tool also allows for selected walls to be reshaped from their endpoints. -

    -

    - Core functionality for this sample can be found in FloorPlanner.js. -

    - - - - - - \ No newline at end of file + diff --git a/extensions/FloorPlanner.js b/extensions/FloorPlanner.js deleted file mode 100644 index 61407e9e8..000000000 --- a/extensions/FloorPlanner.js +++ /dev/null @@ -1,2588 +0,0 @@ -/* -* Copyright (C) 1998-2017 by Northwoods Software Corporation -* All Rights Reserved. -* -* FLOOR PLANNER CODE -* Provides core functionality for FloorPlanner.html -*/ - -function checkLocalStorage() { - try { - window.localStorage.setItem('item', 'item'); - window.localStorage.removeItem('item'); - return true; - } catch (e) { - return false; - } -} - -function updateFileList(id) { - // displays cached floor plan files in the listboxes - var listbox = document.getElementById(id); - // remove any old listing of files - var last; - while (last = listbox.lastChild) listbox.removeChild(last); - // now add all saved files to the listbox - for (key in window.localStorage) { - var storedFile = window.localStorage.getItem(key); - if (!storedFile) continue; - var option = document.createElement("option"); - option.value = key; - option.text = key; - listbox.add(option, null) - } -} - -// deletes selected file from local storage -function removeFile() { - var listbox = document.getElementById("mySavedFiles2"); - // get selected filename - var fileName = undefined; - for (var i = 0; i < listbox.options.length; i++) { - if (listbox.options[i].selected) fileName = listbox.options[i].text; // selected file - } - if (fileName !== undefined) { - // removes file from local storage - window.localStorage.removeItem(fileName); - // the current document remains open, even if its storage was deleted - } - closeElement("removeDocument"); -} - -function loadFileToModel(str) { - myDiagram.model = go.Model.fromJson(str); - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("generate walls"); - var wallParts = []; - myDiagram.nodes.each(function (node) { - if (node.category === "WallGroup") updateWall(node); - if ((node.category === "WindowNode" || node.category === "DoorNode") && node.containingGroup !== null) wallParts.push(node); - }); - updateUI(); - - myDiagram.commitTransaction("generate walls"); - myDiagram.undoManager.isEnabled = true; - myDiagram.addModelChangedListener(function (e) { - if (e.isTransactionFinished) enableAll(); - }); - myDiagram.isModified = false; -} - -function loadFile() { - var listbox = document.getElementById("mySavedFiles"); - // get selected filename - var fileName = undefined; - for (var i = 0; i < listbox.options.length; i++) { - if (listbox.options[i].selected) fileName = listbox.options[i].text; // selected file - } - if (fileName !== undefined) { - var savedFile = window.localStorage.getItem(fileName); - loadFileToModel(savedFile); - } - closeElement("openDocument"); -} - -// Store shared model state in the Model.modelData property -// (will be loaded by loadDiagramProperties) -function saveDiagramProperties() { - myDiagram.model.modelData.position = go.Point.stringify(myDiagram.position); -} - -// Called by myDiagram.addDiagramListener("InitialLayoutCompleted" ..., -// NOT directly by loadFile. -function loadDiagramProperties(e) { - var pos = myDiagram.model.modelData.position; - if (pos) myDiagram.position = go.Point.parse(pos); -} - -function openElement(id, listid) { - var panel = document.getElementById(id); - if (panel.style.visibility === "hidden") { - updateFileList(listid); - panel.style.visibility = "visible"; - } -} - -// hides the open/remove elements when the "X" button is pressed -function closeElement(id) { - var panel = document.getElementById(id); - if (id === "nodeInfoWindow") document.getElementById("nodeInfoWindowButton").innerHTML = "Show Node Info Help

    (Ctrl + I)

    "; - if (id === "myPaletteWindow") document.getElementById("myPaletteWindowButton").innerHTML = "Show Palettes

    (Ctrl + P)

    "; - if (id === "myOverviewWindow") document.getElementById("myOverviewWindowButton").innerHTML = "Show Overview

    (Ctrl + E)

    "; - if (id === "optionsWindow") document.getElementById("optionsWindowButton").innerHTML = "Show Options

    (Ctrl + B)

    "; - if (id === "statisticsWindow") document.getElementById("statisticsWindowButton").innerHTML = "Show Statistics

    (Ctrl + G)

    "; - panel.style.visibility = "hidden"; -} - -var UnsavedFileName = "(Unsaved File)"; -var DEFAULT_MODELDATA = { - "units": "centimeters", - "unitsAbbreviation": "cm", - "gridSize": 10, - "wallWidth": 5, - "preferences": { - showWallGuidelines: true, - showWallLengths: true, - showWallAngles: true, - showOnlySmallWallAngles: true, - showGrid: true, - gridSnap: true - } -}; - -function setCurrentFileName(name) { - var currentFile = document.getElementById("currentFile"); - if (myDiagram.isModified) { - name += "*"; - } - currentFile.textContent = name; -} - -function getCurrentFileName() { - var currentFile = document.getElementById("currentFile"); - var name = currentFile.textContent; - if (name[name.length - 1] === "*") return name.substr(0, name.length - 1); - return name; -} - -// enable or disable a particular button -function enable(name, ok) { - var button = document.getElementById(name); - if (button) button.disabled = !ok; -} - -// enable or disable all context-sensitive command buttons -function enableAll() { - var cmdhnd = myDiagram.commandHandler; - enable("Undo", cmdhnd.canUndo()); - enable("Redo", cmdhnd.canRedo()); - enable("Cut", cmdhnd.canCutSelection()); - enable("Copy", cmdhnd.canCopySelection()); - enable("Paste", cmdhnd.canPasteSelection()); - enable("Delete", cmdhnd.canDeleteSelection()); - enable("SelectAll", cmdhnd.canSelectAll()); -} - -function newDocument() { - // checks to see if all changes have been saved - if (myDiagram.isModified) { - var save = confirm("Would you like to save changes to " + getCurrentFileName() + "?"); - if (save) { - saveDocument(); - } - } - setCurrentFileName(UnsavedFileName); - // loads an empty diagram - var model = new go.GraphLinksModel; - // initialize all modelData - model.modelData = DEFAULT_MODELDATA; - myDiagram.model = model; - myDiagram.undoManager.isEnabled = true; - myDiagram.addModelChangedListener(function (e) { - if (e.isTransactionFinished) enableAll(); - }); - myDiagram.isModified = false; - updateUI(); -} - -// update the UI properly in accordance with model.modelData -function updateUI() { - var modelData = myDiagram.model.modelData; - changeUnits(modelData.units); - // update options GUI based on model.modelData.preferences - var preferences = modelData.preferences; - document.getElementById("showGridCheckbox").checked = preferences.showGrid; - document.getElementById("gridSnapCheckbox").checked = preferences.gridSnap; - document.getElementById("wallGuidelinesCheckbox").checked = preferences.showWallGuidelines; - document.getElementById("wallLengthsCheckbox").checked = preferences.showWallLengths; - document.getElementById("wallAnglesCheckbox").checked = preferences.showWallAngles; - document.getElementById("smallWallAnglesCheckbox").checked = preferences.showOnlySmallWallAngles; -} - -// checks to see if all changes have been saved -> shows the open HTML element -function openDocument() { - if (checkLocalStorage()) { - if (myDiagram.isModified) { - var save = confirm("Would you like to save changes to " + getCurrentFileName() + "?"); - if (save) { - saveDocument(); - } - } - openElement("openDocument", "mySavedFiles"); - } -} - -// saves the current floor plan to local storage -function saveDocument() { - if (checkLocalStorage()) { - var saveName = getCurrentFileName(); - if (saveName === UnsavedFileName) { - saveDocumentAs(); - } else { - saveDiagramProperties() - window.localStorage.setItem(saveName, myDiagram.model.toJson()); - myDiagram.isModified = false; - } - } -} - -// saves floor plan to local storage with a new name -function saveDocumentAs() { - if (checkLocalStorage()) { - var saveName = prompt("Save file as...", getCurrentFileName()); - // if saveName is already in list of files, ask if overwrite is ok - if (saveName && saveName !== UnsavedFileName) { - var override = true; - if (window.localStorage.getItem(saveName) !== null) { - override = confirm("Do you want to overwrite " + saveName + "?"); - } - if (override) { - setCurrentFileName(saveName); - saveDiagramProperties() - window.localStorage.setItem(saveName, myDiagram.model.toJson()); - myDiagram.isModified = false; - } - } - } -} - -// shows the remove file HTML element -function removeDocument() { - if (checkLocalStorage()) { - openElement("removeDocument", "mySavedFiles2"); - } -} - -// if user closes browser with unsaved changes, let them know they may lose unsaved data -window.onbeforeunload = function (e) { - if (myDiagram.isModified) { - var e = e || window.event; - //IE, Chrome, Firefox, Opera - if (e) { - e.returnValue = 'You have unsaved changes!'; - } - // For Safari - return 'You have unsaved changes!'; - } -}; - -/***************************************************NON-INIT() functionality **************************************************/ - -var furnitureNodeDataArray = [ - - { - category: "MultiPurposeNode", - key: "MultiPurposeNode", - color: "#ffffff", - stroke: '#000000', - name: "Writable Node", - type: "Writable Node", - shape: "Rectangle", - text: "Write here", - width: 60, - height: 60, - notes: "" - }, - { - key: "roundTable", - color: "#ffffff", - stroke: '#000000', - caption: "Round Table", - type: "Round Table", - shape: "Ellipse", - width: 61, - height: 61, - notes: "" - }, - { - key: "armChair", - color: "#ffffff", - stroke: '#000000', - caption: "Arm Chair", - type: "Arm Chair", - geo: "F1 M0 0 L40 0 40 40 0 40 0 0 M10 30 L10 10 M0 0 Q8 0 10 10 M0 40 Q20 15 40 40 M30 10 Q32 0 40 0 M30 10 L30 30", - width: 45, - height: 45, - notes: "" - }, - { - key: "sofaMedium", - color: "#ffffff", - stroke: "#000000", - caption: "Sofa", - type: "Sofa", - geo: "F1 M0 0 L80 0 80 40 0 40 0 0 M10 35 L10 10 M0 0 Q8 0 10 10 M0 40 Q40 15 80 40 M70 10 Q72 0 80 0 M70 10 L70 35", - height: 45, - width: 90, - notes: "" - }, - { - key: "sink", - color: "#ffffff", - stroke: '#000000', - caption: "Sink", - type: "Sink", - geo: "F1 M0 0 L40 0 40 40 0 40 0 0z M5 7.5 L18.5 7.5 M 21.5 7.5 L35 7.5 35 35 5 35 5 7.5 M 15 21.25 A 5 5 180 1 0 15 21.24 M23 3.75 A 3 3 180 1 1 23 3.74 M21.5 6.25 L 21.5 12.5 18.5 12.5 18.5 6.25 M15 3.75 A 1 1 180 1 1 15 3.74 M 10 4.25 L 10 3.25 13 3.25 M 13 4.25 L 10 4.25 M27 3.75 A 1 1 180 1 1 27 3.74 M 26.85 3.25 L 30 3.25 30 4.25 M 26.85 4.25 L 30 4.25", - width: 27, - height: 27, - notes: "" - }, - { - key: "doubleSink", - color: "#ffffff", - stroke: '#000000', - caption: "Double Sink", - type: "Double Sink", - geo: "F1 M0 0 L75 0 75 40 0 40 0 0 M5 7.5 L35 7.5 35 35 5 35 5 7.5 M44 7.5 L70 7.5 70 35 40 35 40 9 M15 21.25 A5 5 180 1 0 15 21.24 M50 21.25 A 5 5 180 1 0 50 21.24 M40.5 3.75 A3 3 180 1 1 40.5 3.74 M40.5 3.75 L50.5 13.75 47.5 16.5 37.5 6.75 M32.5 3.75 A 1 1 180 1 1 32.5 3.74 M 27.5 4.25 L 27.5 3.25 30.5 3.25 M 30.5 4.25 L 27.5 4.25 M44.5 3.75 A 1 1 180 1 1 44.5 3.74 M 44.35 3.25 L 47.5 3.25 47.5 4.25 M 44.35 4.25 L 47.5 4.25", - height: 27, - width: 52, - notes: "" - }, - { - key: "toilet", - color: "#ffffff", - stroke: '#000000', - caption: "Toilet", - type: "Toilet", - geo: "F1 M0 0 L25 0 25 10 0 10 0 0 M20 10 L20 15 5 15 5 10 20 10 M5 15 Q0 15 0 25 Q0 40 12.5 40 Q25 40 25 25 Q25 15 20 15", - width: 25, - height: 35, - notes: "" - }, - { - key: "shower", - color: "#ffffff", - stroke: '#000000', - caption: "Shower/Tub", - type: "Shower/Tub", - geo: "F1 M0 0 L40 0 40 60 0 60 0 0 M35 15 L35 55 5 55 5 15 Q5 5 20 5 Q35 5 35 15 M22.5 20 A2.5 2.5 180 1 1 22.5 19.99", - width: 45, - height: 75, - notes: "" - }, - { - key: "bed", - color: "#ffffff", - stroke: '#000000', - caption: "Bed", - type: "Bed", - geo: "F1 M0 0 L40 0 40 60 0 60 0 0 M 7.5 2.5 L32.5 2.5 32.5 17.5 7.5 17.5 7.5 2.5 M0 20 L40 20 M0 25 L40 25", - width: 76.2, - height: 101.6, - notes: "" - }, - { - key: "staircase", - color: "#ffffff", - stroke: '#000000', - caption: "Staircase", - type: "Staircase", - geo: "F1 M0 0 L 0 100 250 100 250 0 0 0 M25 100 L 25 0 M 50 100 L 50 0 M 75 100 L 75 0 M 100 100 L 100 0 M 125 100 L 125 0 M 150 100 L 150 0 M 175 100 L 175 0 M 200 100 L 200 0 M 225 100 L 225 0", - width: 125, - height: 50, - notes: "" - }, - { - key: "stove", - color: "#ffffff", - stroke: '#000000', - caption: "Stove", - type: "Stove", - geo: "F1 M 0 0 L 0 100 100 100 100 0 0 0 M 30 15 A 15 15 180 1 0 30.01 15 M 70 15 A 15 15 180 1 0 70.01 15" - + "M 30 55 A 15 15 180 1 0 30.01 55 M 70 55 A 15 15 180 1 0 70.01 55", - width: 75, - height: 75, - notes: "" - }, - { - key: "diningTable", - color: "#ffffff", - stroke: '#000000', - caption: "Dining Table", - type: "Dining Table", - geo: "F1 M 0 0 L 0 100 200 100 200 0 0 0 M 25 0 L 25 -10 75 -10 75 0 M 125 0 L 125 -10 175 -10 175 0 M 200 25 L 210 25 210 75 200 75 M 125 100 L 125 110 L 175 110 L 175 100 M 25 100 L 25 110 75 110 75 100 M 0 75 -10 75 -10 25 0 25", - width: 125, - height: 62.5, - notes: "" - } -]; - -var searchFurniture = function () { - var str = document.getElementById("furnitureSearchBar").value; - var items = furnitureNodeDataArray.slice(); - if (str !== null && str !== undefined && str !== "") { - for (var i = 0; i < items.length; i += 0) { - var item = items[i]; - if (!item.type.toLowerCase().includes(str.toLowerCase())) { - items.splice(i, 1); - } - else i++; - } - myPalette.model.nodeDataArray = items; - } - else myPalette.model.nodeDataArray = furnitureNodeDataArray; - myPalette.updateAllRelationshipsFromData() -} - -// checks what units are being used, converts to cm then divides by 2, (1px = 2cm, change this if you want to use a different paradigm) -function convertPixelsToUnits(num) { - var units = myDiagram.model.modelData.units; - if (units === 'meters') return (num / 100) * 2; - if (units === 'feet') return (num / 30.48) * 2; - if (units === 'inches') return (num / 2.54) * 2; - return num * 2; -} - -// takes a number of units, converts to cm, then divides by 2, since 1px = 2cm (change this if you want to use a different paradigm) -function convertUnitsToPixels(num) { - var units = myDiagram.model.modelData.units; - if (units === 'meters') return (num * 100) / 2; - if (units === 'feet') return (num * 30.48) / 2; - if (units === 'inches') return (num * 2.54) / 2; - return num / 2; -} - -// adjust units based on the selected radio button in the Options Menu -function changeUnits() { - myDiagram.startTransaction("set units"); - var prevUnits = myDiagram.model.modelData.units; - var radios = document.forms["unitsForm"].elements["units"]; - for (var i = 0; i < radios.length; i++) { - if (radios[i].checked) { - myDiagram.model.setDataProperty(myDiagram.model.modelData, "units", radios[i].id); - } - } - var units = myDiagram.model.modelData.units; - switch (units) { - case 'centimeters': myDiagram.model.setDataProperty(myDiagram.model.modelData, "unitsAbbreviation", 'cm'); break; - case 'meters': myDiagram.model.setDataProperty(myDiagram.model.modelData, "unitsAbbreviation", 'm'); break; - case 'feet': myDiagram.model.setDataProperty(myDiagram.model.modelData, "unitsAbbreviation", 'ft'); break; - case 'inches': myDiagram.model.setDataProperty(myDiagram.model.modelData, "unitsAbbreviation", 'in'); break; - } - var unitsAbbreviation = myDiagram.model.modelData.unitsAbbreviation; - // update all units boxes with new units - var unitAbbrevInputs = document.getElementsByClassName('unitsBox'); - for (var i = 0; i < unitAbbrevInputs.length; i++) { - unitAbbrevInputs[i].value = unitsAbbreviation; - } - var unitInputs = document.getElementsByClassName('unitsInput'); - for (var i = 0; i < unitInputs.length; i++) { - var input = unitInputs[i]; - myDiagram.model.setDataProperty(myDiagram.model.modelData, "units", prevUnits); - var value = convertUnitsToPixels(input.value); - myDiagram.model.setDataProperty(myDiagram.model.modelData, "units", units) - value = convertPixelsToUnits(value); - input.value = value; - } - if (myDiagram.selection.count === 1) setSelectionInfo(myDiagram.selection.first()); // reload node info measurements according to new units - myDiagram.commitTransaction("set units"); -} - -// set current tool (selecting/dragging or wallbuilding/reshaping) -function setBehavior(string) { - var wallBuildingTool = myDiagram.toolManager.mouseDownTools.elt(0); - var wallReshapingTool = myDiagram.toolManager.mouseDownTools.elt(3); - // style the current tool HTML button accordingly - var elements = document.getElementsByClassName('setBehavior'); - for (var i = 0; i < elements.length; i++) { - var el = elements[i]; - if (el.id === string + "Button") el.style.backgroundColor = '#4b545f'; - else el.style.backgroundColor = '#bbbbbb'; - } - if (string === 'wallBuilding') { - wallBuildingTool.isEnabled = true; - wallReshapingTool.isEnabled = false; - - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("change wallWidth"); - // create walls with wallWidth in input box - myDiagram.model.setDataProperty(myDiagram.model.modelData, 'wallWidth', parseFloat(document.getElementById('wallWidthInput').value)); - var wallWidth = myDiagram.model.modelData.wallWidth; - if (isNaN(wallWidth)) myDiagram.model.setDataProperty(myDiagram.model.modelData, 'wallWidth', 5); - else { - var width = convertUnitsToPixels(wallWidth); - myDiagram.model.setDataProperty(myDiagram.model.modelData, 'wallWidth', width); - } - myDiagram.commitTransaction("change wallWidth"); - myDiagram.skipsUndoManager = false; - document.getElementById('wallWidthBox').style.visibility = 'visible'; - document.getElementById('wallWidthBox').style.display = 'inline-block'; - setDiagramHelper("Click and drag on the diagram to draw a wall (hold SHIFT for 45 degree angles)"); - } - if (string === 'dragging') { - wallBuildingTool.isEnabled = false; - wallReshapingTool.isEnabled = true; - document.getElementById('wallWidthBox').style.visibility = 'hidden'; - document.getElementById('wallWidthBox').style.display = 'none'; - } - // clear resize adornments on walls/windows, if there are any - myDiagram.nodes.iterator.each(function (n) { n.clearAdornments(); }) - myDiagram.clearSelection(); -} - -// returns inverted color (in hex) of a given hex code color; used to determine furniture node stroke color -function invertColor(hexnum) { - if (hexnum.includes('#')) hexnum = hexnum.substring(1); - if (hexnum.length != 6) { - console.error("Hex color must be six hex numbers in length."); - return false; - } - - hexnum = hexnum.toUpperCase(); - var splitnum = hexnum.split(""); - var resultnum = ""; - var simplenum = "FEDCBA9876".split(""); - var complexnum = new Array(); - complexnum.A = "5"; - complexnum.B = "4"; - complexnum.C = "3"; - complexnum.D = "2"; - complexnum.E = "1"; - complexnum.F = "0"; - - for (i = 0; i < 6; i++) { - if (!isNaN(splitnum[i])) { - resultnum += simplenum[splitnum[i]]; - } else if (complexnum[splitnum[i]]) { - resultnum += complexnum[splitnum[i]]; - } else { - console.error("Hex colors must only include hex numbers 0-9, and A-F"); - return false; - } - } - return '#' + resultnum; -} - -// returns a given color (in hex) lightened by a given percentage -var lightenColor = function (color, percent) { - var num = parseInt(color, 16), - amt = Math.round(2.55 * percent), - R = (num >> 16) + amt, - B = (num >> 8 & 0x00FF) + amt, - G = (num & 0x0000FF) + amt; - return '#' + (0x1000000 + (R < 255 ? R < 1 ? 0 : R : 255) * 0x10000 + (B < 255 ? B < 1 ? 0 : B : 255) * 0x100 + (G < 255 ? G < 1 ? 0 : G : 255)).toString(16).slice(1); -}; - -// find and return an array of the endpoints of a given wallpart (window or door) -function getWallPartEndpoints(wallPart) { - var loc = wallPart.location; - var partLength = wallPart.data.width; - if (wallPart.containingGroup !== null) var angle = wallPart.containingGroup.rotateObject.angle; - else var angle = 180; - var point1 = new go.Point((loc.x + (partLength / 2)), loc.y); - var point2 = new go.Point((loc.x - (partLength / 2)), loc.y); - point1.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y); - point2.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y); - var arr = []; arr.push(point1); arr.push(point2); - return arr; -} - -// returns a "stretch" (2 Points) that constrains a wallPart (door or window) -// this stretch is comprised of either "part"'s containing wall endpoints or other wallPart endpoints -function getWallPartStretch(part) { - var wall = part.containingGroup; - var startpoint = wall.data.startpoint.copy(); - var endpoint = wall.data.endpoint.copy(); - - // sort all possible endpoints into either left/above or right/below - var leftOrAbove = new go.Set(go.Point); var rightOrBelow = new go.Set(go.Point); - wall.memberParts.iterator.each(function (wallPart) { - if (wallPart.data.key !== part.data.key) { - var endpoints = getWallPartEndpoints(wallPart); - for (var i = 0; i < endpoints.length; i++) { - if (endpoints[i].x < part.location.x || (endpoints[i].y > part.location.y && endpoints[i].x === part.location.x)) leftOrAbove.add(endpoints[i]); - else rightOrBelow.add(endpoints[i]); - } - } - }); - - // do the same with the startpoint and endpoint of the dragging part's wall - if (parseFloat(startpoint.x.toFixed(2)) < parseFloat(part.location.x.toFixed(2)) || (startpoint.y > part.location.y && parseFloat(startpoint.x.toFixed(2)) === parseFloat(part.location.x.toFixed(2)))) leftOrAbove.add(startpoint); - else rightOrBelow.add(startpoint); - if (parseFloat(endpoint.x.toFixed(2)) < parseFloat(part.location.x.toFixed(2)) || (endpoint.y > part.location.y && parseFloat(endpoint.x.toFixed(2)) === parseFloat(part.location.x.toFixed(2)))) leftOrAbove.add(endpoint); - else rightOrBelow.add(endpoint); - - // of each set, find the closest point to the dragging part - var leftOrAbovePt; var closestDistLeftOrAbove = Number.MAX_VALUE; - leftOrAbove.iterator.each(function (point) { - var distance = Math.sqrt(point.distanceSquaredPoint(part.location)); - if (distance < closestDistLeftOrAbove) { - closestDistLeftOrAbove = distance; - leftOrAbovePt = point; - } - }); - var rightOrBelowPt; var closestDistRightOrBelow = Number.MAX_VALUE; - rightOrBelow.iterator.each(function (point) { - var distance = Math.sqrt(point.distanceSquaredPoint(part.location)); - if (distance < closestDistRightOrBelow) { - closestDistRightOrBelow = distance; - rightOrBelowPt = point; - } - }); - - var stretch = { point1: leftOrAbovePt, point2: rightOrBelowPt }; - return stretch; -} - -// update the geometry, angle, and location of a given wall -var updateWall = function (wall) { - var shape = wall.findObject("SHAPE"); - var geo = new go.Geometry(go.Geometry.Line); - var sPt = wall.data.startpoint; - var ePt = wall.data.endpoint; - var mPt = new go.Point((sPt.x + ePt.x) / 2, (sPt.y + ePt.y) / 2); - // define a wall's geometry as a simple horizontal line, then rotate it - geo.startX = 0; - geo.startY = 0; - geo.endX = Math.sqrt(sPt.distanceSquaredPoint(ePt)); - geo.endY = 0; - shape.geometry = geo; - wall.location = mPt; // a wall's location is the midpoint between it's startpoint and endpoint - var angle = sPt.directionPoint(ePt); - wall.rotateObject.angle = angle; - updateWallDimensions(); -} - -function makePointNode() { - var $ = go.GraphObject.make; - return $(go.Node, "Position", new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify)); -} - -function makeDimensionLink() { - var $ = go.GraphObject.make; - return $(go.Link, { locationSpot: go.Spot.TopLeft }, - $(go.Shape, { stroke: "gray", strokeWidth: 2, name: 'SHAPE' }), - $(go.Shape, { toArrow: "OpenTriangle", stroke: "gray", strokeWidth: 2 }), - $(go.Shape, { fromArrow: "BackwardOpenTriangle", stroke: "gray", strokeWidth: 2 }), - $(go.TextBlock, { text: 'sometext', segmentOffset: new go.Point(0, -10), font: "13px sans-serif" }, - new go.Binding("text", "", function (link) { - var fromPtNode = null; var toPtNode = null; - allPointNodes.iterator.each(function (node) { - if (node.data.key === link.data.from) fromPtNode = node; - if (node.data.key === link.data.to) toPtNode = node; - }); - if (fromPtNode !== null) { - var fromPt = fromPtNode.location; - var toPt = toPtNode.location; - return convertPixelsToUnits(Math.sqrt(fromPt.distanceSquaredPoint(toPt))).toFixed(2) + myDiagram.model.modelData.unitsAbbreviation; - } return null; - }).ofObject(), - new go.Binding("angle", "angle", function (angle, link) { - if (angle > 90 && angle < 270) return (angle + 180) % 360; - return angle; - }), - new go.Binding("segmentOffset", "angle", function (angle, textblock) { - var wall = myDiagram.findPartForKey(textblock.part.data.wall); - if (wall.rotateObject.angle > 135 && wall.rotateObject.angle < 315) return new go.Point(0, 10); - return new go.Point(0, -10); - }).ofObject(), - // scale font size according to the length of the link - new go.Binding("font", "", function (link) { - var fromPtNode = null; var toPtNode = null; - allPointNodes.iterator.each(function (node) { - if (node.data.key === link.data.from) fromPtNode = node; - if (node.data.key === link.data.to) toPtNode = node; - }); - if (fromPtNode !== null) { - var fromPt = fromPtNode.location; - var toPt = toPtNode.location; - var distance = Math.sqrt(fromPt.distanceSquaredPoint(toPt)); - if (distance > 40) return "13px sans-serif"; - if (distance <= 40 && distance >= 20) return "11px sans-serif"; - else return "9px sans-serif"; - } return "13px sans-serif"; - }).ofObject() - ) - ) -} - -var allPointNodes = new go.Set(go.Node); -var allDimensionLinks = new go.Set(go.Link); - -// update the Dimension Links shown along a wall, based on which wallParts are selected -var updateWallDimensions = function () { - /* helper function to build dimension links - Parameters: - "wall": {WallGroup} the wall the Link runs along (either describing the wall itself or some wallPart on "wall") - "index": {Number} number appended to PointNode keys; used for finding PointNodes of Dimension Links later on - "point1": {Point} the first point of the wallPart being described by the Link - "point2": {Point} the second point of the wallPart being described by the Link - "angle": {Number} the angle of the wallPart - "wallOffset": {Number} how far from the wall (in px) the Link should be - "soloWallFlag": {Boolean} if this Link is the only Dimension Link for "wall" (no other wallParts on "wall" selected) this is true; else, false - */ - function buildDimensionLink(wall, index, point1, point2, angle, wallOffset, soloWallFlag) { - point1 = getAdjustedPoint(point1, wall, angle, wallOffset); - point2 = getAdjustedPoint(point2, wall, angle, wallOffset); - var data1 = { key: wall.data.key + "PointNode" + index, category: "PointNode", loc: go.Point.stringify(point1) }; - var data2 = { key: wall.data.key + "PointNode" + (index + 1), category: "PointNode", loc: go.Point.stringify(point2) }; - var data3 = { key: wall.data.key + "DimensionLink", category: 'DimensionLink', from: data1.key, to: data2.key, stroke: 'gray', angle: angle, wall: wall.data.key, soloWallFlag: soloWallFlag }; - var pointNode1 = makePointNode(); - var pointNode2 = makePointNode(); - var link = makeDimensionLink(); - - allPointNodes.add(pointNode1); - allPointNodes.add(pointNode2); - allDimensionLinks.add(link); - myDiagram.add(pointNode1); - myDiagram.add(pointNode2); - myDiagram.add(link); - - pointNode1.data = data1; - pointNode2.data = data2; - link.data = data3; - link.fromNode = pointNode1; - link.toNode = pointNode2; - } - - // helper function: get a to/from point for a Dimension Link, based on wall/wallpart's endpoint angle, and a given wallOffset (dist from wall) - function getAdjustedPoint(point, wall, angle, wallOffset) { - var oldPoint = point.copy(); - point.offset(0, -(wall.data.strokeWidth * .5) - wallOffset); - point.offset(-oldPoint.x, -oldPoint.y).rotate(angle).offset(oldPoint.x, oldPoint.y); - return point; - } - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("update wall dimensions"); - // if showWallLengths === false, remove all pointNodes (used to build wall dimensions) - if (!myDiagram.model.modelData.preferences.showWallLengths) { - allPointNodes.iterator.each(function (node) { myDiagram.remove(node); }); - allDimensionLinks.iterator.each(function (link) { myDiagram.remove(link); }); - allPointNodes.clear(); - allDimensionLinks.clear(); - myDiagram.commitTransaction("update wall dimensions"); - myDiagram.skipsUndoManager = false; - return; - } - // make visible all dimension links (zero-length dimension links are set to invisible at the end of the function) - allDimensionLinks.iterator.each(function (link) { link.visible = true; }); - - var selection = myDiagram.selection; - // gather all selected walls, including walls of selected DoorNodes and WindowNodes - var walls = new go.Set(go.Group); - selection.iterator.each(function (part) { - if ((part.category === 'WindowNode' || part.category === 'DoorNode') && part.containingGroup !== null) walls.add(part.containingGroup); - if (part.category === 'WallGroup' && part.data !== null) { - var soloWallLink = null; - allDimensionLinks.iterator.each(function (link) { if (link.data.soloWallFlag && link.data.wall === part.data.key) soloWallLink = link; }); - // if there's 1 Dimension Link for this wall (link has soloWallFlag), adjust to/from pointNodes of link, rather than deleting / redrawing - if (soloWallLink !== null) { - // since this is the only Dimension Link for this wall, keys of its pointNodes will be (wall.data.key) + 1 / (wall.data.key) + 2 - var linkPoint1 = null; var linkPoint2 = null; - allPointNodes.iterator.each(function (node) { - if (node.data.key === part.data.key + "PointNode1") linkPoint1 = node; - if (node.data.key === part.data.key + "PointNode2") linkPoint2 = node; - }); - - var startpoint = part.data.startpoint; var endpoint = part.data.endpoint; - // adjust left/top-most / right/bottom-most wall endpoints so link angle is correct (else text appears on wrong side of Link) - var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; - var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; - var newLoc1 = getAdjustedPoint(firstWallPt.copy(), part, part.rotateObject.angle, 10); - var newLoc2 = getAdjustedPoint(lastWallPt.copy(), part, part.rotateObject.angle, 10); - linkPoint1.data.loc = go.Point.stringify(newLoc1); - linkPoint2.data.loc = go.Point.stringify(newLoc2); - soloWallLink.data.angle = part.rotateObject.angle; - linkPoint1.updateTargetBindings(); - linkPoint2.updateTargetBindings(); - soloWallLink.updateTargetBindings(); - } - // else build a Dimension Link for this wall; this is removed / replaced if Dimension Links for wallParts this wall are built - else { - var startpoint = part.data.startpoint; - var endpoint = part.data.endpoint; - var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; - var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; - buildDimensionLink(part, 1, firstWallPt.copy(), lastWallPt.copy(), part.rotateObject.angle, 10, true); - } - } - }); - // create array of selected wall endpoints and selected wallPart endpoints along the wall that represent measured stretches - walls.iterator.each(function (wall) { - var startpoint = wall.data.startpoint; - var endpoint = wall.data.endpoint; - var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; - var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; - - // store all endpoints along with the part they correspond to (used later to either create DimensionLinks or simply adjust them) - var wallPartEndpoints = []; - wall.memberParts.iterator.each(function (wallPart) { - if (wallPart.isSelected) { - var endpoints = getWallPartEndpoints(wallPart); - wallPartEndpoints.push(endpoints[0]); - wallPartEndpoints.push(endpoints[1]); - } - }); - // sort all wallPartEndpoints by x coordinate left to right/ up to down - wallPartEndpoints.sort(function (a, b) { - if ((a.x + a.y) > (b.x + b.y)) return 1; - if ((a.x + a.y) < (b.x + b.y)) return -1; - else return 0; - }); - wallPartEndpoints.unshift(firstWallPt); - wallPartEndpoints.push(lastWallPt); - - var angle = wall.rotateObject.angle; - var k = 1; // k is a counter for the indices of PointNodes - // build / edit dimension links for each stretch, defined by pairs of points in wallPartEndpoints - for (var j = 0; j < wallPartEndpoints.length - 1; j++) { - var linkPoint1 = null; linkPoint2 = null; - allPointNodes.iterator.each(function (node) { - if (node.data.key === wall.data.key + "PointNode" + k) linkPoint1 = node; - if (node.data.key === wall.data.key + "PointNode" + (k + 1)) linkPoint2 = node; - }); - if (linkPoint1 !== null) { - var newLoc1 = getAdjustedPoint(wallPartEndpoints[j].copy(), wall, angle, 5); - var newLoc2 = getAdjustedPoint(wallPartEndpoints[j + 1].copy(), wall, angle, 5); - linkPoint1.data.loc = go.Point.stringify(newLoc1); - linkPoint2.data.loc = go.Point.stringify(newLoc2); - linkPoint1.updateTargetBindings(); - linkPoint2.updateTargetBindings(); - } - // only build new links if needed -- normally simply change pointNode locations - else buildDimensionLink(wall, k, wallPartEndpoints[j].copy(), wallPartEndpoints[j + 1].copy(), angle, 5, false); - k += 2; - } - // total wall Dimension Link would be constructed of a kth and k+1st pointNode - var totalWallDimensionLink = null; - allDimensionLinks.iterator.each(function (link) { - if ((link.fromNode.data.key === wall.data.key + "PointNode" + k) && - (link.toNode.data.key === wall.data.key + "PointNode" + (k + 1))) totalWallDimensionLink = link; - }); - // if a total wall Dimension Link already exists, adjust its constituent point nodes - if (totalWallDimensionLink !== null) { - var linkPoint1 = null; var linkPoint2 = null; - allPointNodes.iterator.each(function (node) { - if (node.data.key === wall.data.key + "PointNode" + k) linkPoint1 = node; - if (node.data.key === wall.data.key + "PointNode" + (k + 1)) linkPoint2 = node; - }); - var newLoc1 = getAdjustedPoint(wallPartEndpoints[0].copy(), wall, angle, 25); - var newLoc2 = getAdjustedPoint(wallPartEndpoints[wallPartEndpoints.length - 1].copy(), wall, angle, 25); - linkPoint1.data.loc = go.Point.stringify(newLoc1); - linkPoint2.data.loc = go.Point.stringify(newLoc2); - linkPoint1.updateTargetBindings(); - linkPoint2.updateTargetBindings(); - } - // only build total wall Dimension Link (far out from wall to accomodate wallPart Dimension Links) if one does not already exist - else buildDimensionLink(wall, k, wallPartEndpoints[0].copy(), wallPartEndpoints[wallPartEndpoints.length - 1].copy(), angle, 25, false); - }); - - // Cleanup: hide zero-length Dimension Links - allDimensionLinks.iterator.each(function (link) { - var length = Math.sqrt(link.toNode.location.distanceSquaredPoint(link.fromNode.location)); - if (length < 1 && !link.data.soloWallFlag) link.visible = false; - }); - - myDiagram.commitTransaction("update wall dimensions"); - myDiagram.skipsUndoManager = false; -} - -// helper function for updateWallAngles(); returns the Point where two walls intersect; if they do not intersect, return null -var getWallsIntersection = function (wall1, wall2) { - if (wall1 === null || wall2 === null) return null; - // treat walls as lines; get lines in formula of ax + by = c - var a1 = wall1.data.endpoint.y - wall1.data.startpoint.y; - var b1 = wall1.data.startpoint.x - wall1.data.endpoint.x; - var c1 = (a1 * wall1.data.startpoint.x) + (b1 * wall1.data.startpoint.y); - var a2 = wall2.data.endpoint.y - wall2.data.startpoint.y; - var b2 = wall2.data.startpoint.x - wall2.data.endpoint.x; - var c2 = (a2 * wall2.data.startpoint.x) + (b2 * wall2.data.startpoint.y); - // now solve the system of equations, finding where the lines (not segments) would intersect - /** Algebra Explanation: - Line 1: a1x + b1y = c1 - Line 2: a2x + b2y = c2 - - Multiply Line1 equation by b2, Line2 equation by b1, get: - a1b1x + b1b2y = b2c1 - a2b1x + b1b2y = b1c2 - - Subtract bottom from top: - a1b2x - a2b1x = b2c1 - b1c2 - - Divide both sides by a1b2 - a2b1, get equation for x. Equation for y is analogous - **/ - var det = a1 * b2 - a2 * b1; - var x = null; var y = null; - // Edge Case: Lines are paralell - if (det === 0) { - // Edge Case: wall1 and wall2 have an endpoint to endpoint intersection (the only instance in which paralell walls could intersect at a specific point) - if (wall1.data.startpoint.equals(wall2.data.startpoint) || wall1.data.startpoint.equals(wall2.data.endpoint)) return wall1.data.startpoint; - if (wall1.data.endpoint.equals(wall2.data.startpoint) || wall1.data.endpoint.equals(wall2.data.endpoint)) return wall1.data.endpoint; - return null; - } - else { - x = (b2 * c1 - b1 * c2) / det; - y = (a1 * c2 - a2 * c1) / det; - } - // test that the proposed intersection is contained in both line segments (walls) - var inWall1 = ((Math.min(wall1.data.startpoint.x, wall1.data.endpoint.x) <= x) && (Math.max(wall1.data.startpoint.x, wall1.data.endpoint.x) >= x) - && (Math.min(wall1.data.startpoint.y, wall1.data.endpoint.y) <= y) && (Math.max(wall1.data.startpoint.y, wall1.data.endpoint.y) >= y)); - var inWall2 = ((Math.min(wall2.data.startpoint.x, wall2.data.endpoint.x) <= x) && (Math.max(wall2.data.startpoint.x, wall2.data.endpoint.x) >= x) - && (Math.min(wall2.data.startpoint.y, wall2.data.endpoint.y) <= y) && (Math.max(wall2.data.startpoint.y, wall2.data.endpoint.y) >= y)); - if (inWall1 && inWall2) return new go.Point(x, y); - else return null; -} - -// determines arc geometry for angleNodes -function makeArc(node) { - var ang = node.data.angle; - var sweep = node.data.sweep; - var rad = Math.min(30, node.data.maxRadius); - if (typeof sweep === "number" && sweep > 0) { - var start = new go.Point(rad, 0).rotate(ang); - // this is much more efficient than calling go.GraphObject.make: - return new go.Geometry() - .add(new go.PathFigure(start.x + rad, start.y + rad) // start point - .add(new go.PathSegment(go.PathSegment.Arc, - ang, sweep, // angles - rad, rad, // center - rad, rad) // radius - )) - .add(new go.PathFigure(0, 0)) - .add(new go.PathFigure(2 * rad, 2 * rad)); - } else { // make sure this arc always occupies the same circular area of RAD radius - return new go.Geometry() - .add(new go.PathFigure(0, 0)) - .add(new go.PathFigure(2 * rad, 2 * rad)); - } -} - -function makeAngleNode() { - var $ = go.GraphObject.make; - return $(go.Node, "Spot", { locationSpot: go.Spot.Center, locationObjectName: "SHAPE", selectionAdorned: false }, - new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), - $(go.Shape, "Circle", // placed where walls intersect, is invisible - { name: "SHAPE", fill: "red", height: 0, width: 0 }), - $(go.Shape, { stroke: "green", strokeWidth: 1.5, fill: null }, // arc - new go.Binding("geometry", "", makeArc).ofObject(), - new go.Binding("stroke", "sweep", function (sweep) { return (sweep % 45 < 1 || sweep % 45 > 44) ? "dodgerblue" : "lightblue"; })), - $(go.Panel, "Auto", { name: "ARCLABEL" }, - // position the label in the center of the arcv - new go.Binding("alignment", "sweep", function (sweep, panel) { - var rad = Math.min(30, panel.part.data.maxRadius); - var angle = panel.part.data.angle; - var cntr = new go.Point(rad, 0).rotate(angle + sweep / 2); - return new go.Spot(0.5, 0.5, cntr.x, cntr.y); - }), - $(go.Shape, { stroke: "black", fill: "white" }, - new go.Binding("stroke", "sweep", function (sweep) { return (sweep % 45 < 1 || sweep % 45 > 44) ? "dodgerblue" : "lightblue"; })), - $(go.TextBlock, { font: "7pt sans-serif", margin: new go.Margin(2, 2, 2, 2) }, - new go.Binding("text", "sweep", function (sweep) { return sweep.toFixed(2) + String.fromCharCode(176); }), - new go.Binding("stroke", "color")) - )); -} - -var allAngleNodes = new go.Set(go.Node); - -// update the angle links shown along a wall, based on which wall(s) is/are selected -var updateWallAngles = function () { - myDiagram.skipsUndoManager = true; // do not store displaying angles as a transaction - myDiagram.startTransaction("display angles"); - if (myDiagram.model.modelData.preferences.showWallAngles) { - allAngleNodes.iterator.each(function(node){node.visible = true;}); - var selectedWalls = []; - myDiagram.selection.iterator.each(function (part) { if (part.category === "WallGroup") selectedWalls.push(part); }); - for (var i = 0; i < selectedWalls.length; i++) { - var seen = new go.Set("string"); // Set of all walls "seen" thus far for "wall" - var wall = selectedWalls[i]; - var possibleWalls = myDiagram.findNodesByExample({ category: "WallGroup" }); - - // go through all other walls; if the other wall intersects this wall, make angles - possibleWalls.iterator.each(function (otherWall) { - if (otherWall.data === null || wall.data === null || seen.contains(otherWall.data.key)) return; - if ((otherWall.data.key !== wall.data.key) && (getWallsIntersection(wall, otherWall) !== null) && (!seen.contains(otherWall.data.key))) { - - seen.add(otherWall.data.key); - // "otherWall" intersects "wall"; make or update angle nodes - var intersectionPoint = getWallsIntersection(wall, otherWall); - var wallsInvolved = myDiagram.findObjectsNear(intersectionPoint, - 1, - function (x) { if (x.part !== null) return x.part; }, - function (p) { return p.category === "WallGroup"; }, - false); - - var endpoints = []; // store endpoints and their corresponding walls here - // gather endpoints of each wall in wallsInvolved; discard endpoints within a tolerance distance of intersectionPoint - wallsInvolved.iterator.each(function (w) { - var tolerance = (myDiagram.model.modelData.gridSize >= 10) ? myDiagram.model.modelData.gridSize : 10; - if (Math.sqrt(w.data.startpoint.distanceSquaredPoint(intersectionPoint)) > tolerance) endpoints.push({ point: w.data.startpoint, wall: w.data.key }); - if (Math.sqrt(w.data.endpoint.distanceSquaredPoint(intersectionPoint)) > tolerance) endpoints.push({ point: w.data.endpoint, wall: w.data.key }); - }); - - // find maxRadius (shortest distance from an involved wall's endpoint to intersectionPoint or 30, whichever is smaller) - var maxRadius = 30; - for (var i = 0; i < endpoints.length; i++) { - var distance = Math.sqrt(endpoints[i].point.distanceSquaredPoint(intersectionPoint)); - if (distance < maxRadius) maxRadius = distance; - } - - // sort endpoints in a clockwise fashion around the intersectionPoint - endpoints.sort(function (a, b) { - a = a.point; b = b.point; - if (a.x - intersectionPoint.x >= 0 && b.x - intersectionPoint.x < 0) return true; - if (a.x - intersectionPoint.x < 0 && b.x - intersectionPoint.x >= 0) return false; - if (a.x - intersectionPoint.x == 0 && b.x - intersectionPoint.x == 0) { - if (a.y - intersectionPoint.y >= 0 || b.y - intersectionPoint.y >= 0) return a.y > b.y; - return b.y > a.y; - } - - // compute the cross product of vectors (center -> a) x (center -> b) - var det = (a.x - intersectionPoint.x) * (b.y - intersectionPoint.y) - (b.x - intersectionPoint.x) * (a.y - intersectionPoint.y); - if (det < 0) return true; - if (det > 0) return false; - - // points a and b are on the same line from the center; check which point is closer to the center - var d1 = (a.x - intersectionPoint.x) * (a.x - intersectionPoint.x) + (a.y - intersectionPoint.y) * (a.y - intersectionPoint.y); - var d2 = (b.x - intersectionPoint.x) * (b.x - intersectionPoint.x) + (b.y - intersectionPoint.y) * (b.y - intersectionPoint.y); - return d1 > d2; - }); // end endpoints sort - - // for each pair of endpoints, construct or modify an angleNode - for (var i = 0; i < endpoints.length; i++) { - var p1 = endpoints[i]; - if (endpoints[i + 1] != null) var p2 = endpoints[i + 1]; - else var p2 = endpoints[0]; - var a1 = intersectionPoint.directionPoint(p1.point); - var a2 = intersectionPoint.directionPoint(p2.point); - var sweep = Math.abs(a2 - a1 + 360) % 360; - var angle = a1; - - /* - construct proper key for angleNode - proper angleNode key syntax is "wallWwallX...wallYangleNodeZ" such that W < Y < Y; angleNodes are sorted clockwise around the intersectionPoint by Z - */ - var keyArray = []; // used to construct proper key - wallsInvolved.iterator.each(function (wall) { keyArray.push(wall); }); - keyArray.sort(function (a, b) { - var aIndex = a.data.key.match(/\d+/g); - var bIndex = b.data.key.match(/\d+/g); - if (isNaN(aIndex)) return true; - if (isNaN(bIndex)) return false; - else return aIndex > bIndex; - }); - - var key = ""; - for (var j = 0; j < keyArray.length; j++) key += keyArray[j].data.key; - key += "angle" + i; - - // check if this angleNode already exists -- if it does, adjust data (instead of deleting/redrawing) - var angleNode = null; - allAngleNodes.iterator.each(function (aNode) { if (aNode.data.key === key) angleNode = aNode; }); - if (angleNode !== null) { - angleNode.data.angle = angle; - angleNode.data.sweep = sweep; - angleNode.data.loc = go.Point.stringify(intersectionPoint); - angleNode.data.maxRadius = maxRadius; - angleNode.updateTargetBindings(); - } - // if this angleNode does not already exist, create it and add it to the diagram - else { - var data = { key: key, category: "AngleNode", loc: go.Point.stringify(intersectionPoint), stroke: "dodgerblue", angle: angle, sweep: sweep, maxRadius: maxRadius }; - var newAngleNode = makeAngleNode(); - newAngleNode.data = data; - myDiagram.add(newAngleNode); - newAngleNode.updateTargetBindings(); - allAngleNodes.add(newAngleNode); - } - } - } - }); - } - // garbage collection (angleNodes that should not exist any more) - var garbage = []; - allAngleNodes.iterator.each(function (node) { - var keyNums = node.data.key.match(/\d+/g); // values X for all wall keys involved, given key "wallX" - var numWalls = (node.data.key.match(/wall/g) || []).length; // # of walls involved in in "node"'s construction - var wallsInvolved = []; - // add all walls involved in angleNode's construction to wallsInvolved - for (var i = 0; i < keyNums.length - 1; i++) wallsInvolved.push("wall" + keyNums[i]); - // edge case: if the numWalls != keyNums.length, that means the wall with key "wall" (no number in key) is involved - if (numWalls !== keyNums.length - 1) wallsInvolved.push("wall"); - - // Case 1: if any wall pairs involved in this angleNode are no longer intersecting, add this angleNode to "garbage" - for (var i = 0; i < wallsInvolved.length - 1; i++) { - var wall1 = myDiagram.findPartForKey(wallsInvolved[i]); - var wall2 = myDiagram.findPartForKey(wallsInvolved[i + 1]); - var intersectionPoint = getWallsIntersection(wall1, wall2); - if (intersectionPoint === null) garbage.push(node); - } - // Case 2: if there are angleNode clusters with the same walls in their keys as "node" but different locations, destroy and rebuild - // collect all angleNodes with same walls in their construction as "node" - var possibleAngleNodes = new go.Set(go.Node); - var allWalls = node.data.key.slice(0, node.data.key.indexOf("angle")); - allAngleNodes.iterator.each(function (other) { if (other.data.key.includes(allWalls)) possibleAngleNodes.add(other); }); - possibleAngleNodes.iterator.each(function (pNode) { - if (pNode.data.loc !== node.data.loc) { - garbage.push(pNode); - } - }); - - // Case 3: put any angleNodes with sweep === 0 in garbage - if (node.data.sweep === 0) garbage.push(node); - }); - - for (var i = 0; i < garbage.length; i++) { - myDiagram.remove(garbage[i]); // remove garbage - allAngleNodes.remove(garbage[i]); - } - } - // hide all angles > 180 if show only acute angles is one - if (myDiagram.model.modelData.preferences.showOnlySmallWallAngles) { - allAngleNodes.iterator.each(function (node) { if (node.data.sweep >= 180) node.visible = false; }); - } - myDiagram.commitTransaction("display angles"); - myDiagram.skipsUndoManager = false; -} - -// update all statistics in Statistics Window - called when the model is changed -var updateStatistics = function () { - var element = document.getElementById('statisticsWindowTextDiv'); - element.innerHTML = "
    Item Types
    Totals
    "; - // fill Item Types table with node type/count of all nodes in diagram - numsTable = document.getElementById('numsTable'); - var allPaletteNodes = myPalette.model.nodeDataArray.concat(myPalette2.model.nodeDataArray); - for (var i = 0; i < allPaletteNodes.length; i++) { - var type = allPaletteNodes[i].type; - var num = myDiagram.findNodesByExample({ type: type }).count; - if (num > 0) // only display data for nodes that exist on the diagram - numsTable.innerHTML += " " + type + " " + num + ""; - } - // fill Totals table with lengths of all walls - totalsTable = document.getElementById('totalsTable'); - var walls = myDiagram.findNodesByExample({ category: "WallGroup" }); - var totalLength = 0; - walls.iterator.each(function (wall) { - var wallLength = Math.sqrt(wall.data.startpoint.distanceSquaredPoint(wall.data.endpoint)); - totalLength += wallLength; - }); - totalLength = convertPixelsToUnits(totalLength).toFixed(2); - var unitsAbbreviation = myDiagram.model.modelData.unitsAbbreviation; - totalsTable.innerHTML += "Wall Lengths" + totalLength + unitsAbbreviation + ""; -} - -//******************************* HTML Interaction code ******************************************************* -// change the "checked" value of checkboxes in the Options Menu, and to have those changes reflected in app behavior -function checkboxChanged(id) { - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("change preference"); - var element = document.getElementById(id); - switch (id) { - case "showGridCheckbox": { - myDiagram.grid.visible = element.checked; - myDiagram.model.modelData.preferences.showGrid = element.checked; - break; - } - case "gridSnapCheckbox": { - myDiagram.toolManager.draggingTool.isGridSnapEnabled = element.checked; - myDiagram.model.modelData.preferences.gridSnap = element.checked; - break; - } - case "wallGuidelinesCheckbox": myDiagram.model.modelData.preferences.showWallGuidelines = element.checked; break; - case "wallLengthsCheckbox": myDiagram.model.modelData.preferences.showWallLengths = element.checked; updateWallDimensions(); break; - case "wallAnglesCheckbox": myDiagram.model.modelData.preferences.showWallAngles = element.checked; updateWallAngles(); break; - case "smallWallAnglesCheckbox": myDiagram.model.modelData.preferences.showOnlySmallWallAngles = element.checked; updateWallAngles(); break; - } - myDiagram.commitTransaction("change preference"); - myDiagram.skipsUndoManager = false; -} - -// changes the edge length of the grid -function changeGridSize() { - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("change grid size"); - var el = document.getElementById('gridSizeInput'); var input; - if (!isNaN(el.value) && el.value != null && el.value != '' && el.value != undefined) input = parseFloat(el.value); - else { - el.value = convertPixelsToUnits(10); // if bad input given, revert to 20cm (10px) or unit equivalent - input = parseFloat(el.value); - } - input = convertUnitsToPixels(input); - myDiagram.grid.gridCellSize = new go.Size(input, input); - myDiagram.toolManager.draggingTool.gridCellSize = new go.Size(input, input); - myDiagram.model.setDataProperty(myDiagram.model.modelData, "gridSize", input); - myDiagram.commitTransaction("change grid size"); - myDiagram.skipsUndoManager = false; -} - -//sets text under Diagram to suggest the most likely function the user wants -function setDiagramHelper(str) { document.getElementById("diagramHelpTextDiv").innerHTML = '

    ' + str + '

    '; } - -// helper function for setSelectionInfo(); displays all nodes in a given set in a given 1 or 2 rows in a given HTML element -// parameter "iterator" may be an iterable collection or array -function fillRowsWithNodes(iterator, element, numRows, selectedKey) { - var arr = []; - if (iterator.constructor !== Array) iterator.each(function (p) { arr.push(p); }); - else arr = iterator; - for (var i = 0; i < arr.length; i += numRows) { - if (arr[i].data === null) { setSelectionInfo('Nothing selected'); return; } - var key1 = arr[i].data.key; // keys used to locate the node if clicked on... - var name1 = (arr[i].data.caption !== "MultiPurposeNode") ? arr[i].data.caption : arr[i].data.text; // ... names are editable, so users can distinguish between nodes - // if there's two nodes for this row... - if (arr[i + 1] != undefined && arr[i + 1] != null) { - var key2 = arr[i + 1].data.key; - var name2 = (arr[i + 1].data.caption !== null) ? arr[i + 1].data.caption : arr[i + 1].data.text; - // if there's a non-null selectedKey, highlight the selected node in the list - if (key1 === selectedKey) element.innerHTML += '

    ' + name1 + '

    ' + name2 + '

    '; - else if (key2 === selectedKey) element.innerHTML += '

    ' + name1 + '

    ' + name2 + '

    '; - else element.innerHTML += '

    ' + name1 + '

    ' + name2 + '

    '; - } // if there's only one node for this row... - else { - if (key1 === selectedKey) element.innerHTML += '

    ' + name1 + '

    '; - else element.innerHTML += '

    ' + name1 + '

    '; - } - } -} - -// displays editable info regarding a selection in the Selection Help window (height/length, width, name, group info) -function setSelectionInfo(node) { - if (node instanceof go.GraphObject) node = node.part; - var element = document.getElementById("selectionInfoTextDiv"); - var infoWindow = document.getElementById('selectionInfoWindow'); - if (element === null || infoWindow === null) return; - if (node === 'Nothing selected' || node.layer === null || node === null) { element.innerHTML = '

    ' + node + '

    '; return; } - - // if there are multiple nodes selected, show all their names, allowing user to click on the node they want - if (node === 'Selection: ') { - var selectionIterator = myDiagram.selection.iterator; var arr = []; - element.innerHTML = '

    Selection (' + selectionIterator.count + ' items selected):

    '; - fillRowsWithNodes(selectionIterator, element, 2, null); - infoWindow.style.height = document.getElementById('selectionInfoTextDiv').offsetHeight + document.getElementById('selectionInfoWindowHandle').offsetHeight + 5 + 'px'; - return; - } - - // if we have one node selected, gather pertinent information for that node.... - myDiagram.select(node); - var name = ''; var length; var width; var nodeGroupCount = 0; var notes = node.data.notes; - // get node name - if (node.category === 'MultiPurposeNode') name = node.data.text; - else name = node.data.caption; - // get node height / width (dependent on node category) - if (node.category === 'WallGroup') { - height = convertPixelsToUnits(Math.sqrt(node.data.startpoint.distanceSquared(node.data.endpoint.x, node.data.endpoint.y))).toFixed(2); // wall length - width = convertPixelsToUnits(node.data.strokeWidth).toFixed(2); - } else if (node.category === 'DoorNode') { - height = convertPixelsToUnits(node.data.width).toFixed(2); - width = convertPixelsToUnits(node.data.width).toFixed(2); - } else if (node.data.isGroup && node.category !== "WallGroup") { - height = convertPixelsToUnits(node.actualBounds.height).toFixed(2); - width = convertPixelsToUnits(node.actualBounds.width).toFixed(2); - } else { - height = convertPixelsToUnits(node.data.height).toFixed(2); - width = convertPixelsToUnits(node.data.width).toFixed(2); - } - // get node group info - if (node.containingGroup != null && node.containingGroup != undefined) { - var nodeGroupParts = node.containingGroup.memberParts; - nodeGroupCount = nodeGroupParts.count; - } - if (node.data.isGroup) { - var nodeGroupParts = node.memberParts; - nodeGroupCount = nodeGroupParts.count; - } - var unitsAbbreviation = myDiagram.model.modelData.unitsAbbreviation; - - //... then display that information in the selection info window - element.innerHTML = '

    Name: ' + '' + '

    '; - // display node notes in a textarea - element.innerHTML += "

    Notes:

    "; - // display color as a color picker element (individual nodes only) - if (!node.data.isGroup && node.data.category !== "DoorNode" && node.data.category !== "WindowNode") { - element.innerHTML += '

    Color:

    '; - var colorPicker = document.getElementById('colorPicker'); - } - - // display "Door Length" input (Door Nodes only) - if (node.category === "DoorNode") element.innerHTML += '

    Door Length:
    ' - + '

    '; - // display the editable properties height and width (non-Door nodes) - else element.innerHTML += '

    Height:

    ' + '

    Width:

    ' + '

    '; - - // for walls "height" is displayed as "length" - if (node.category === 'WallGroup') document.getElementById("heightLabel").innerHTML = 'Length:
    '; - - // do not allow height or width adjustment for group info - if (node.data.isGroup && node.category !== "WallGroup") { - document.getElementById("heightInput").disabled = true; - document.getElementById("widthInput").disabled = true; - } - - // "Apply Changes" button - element.innerHTML += '
    '; - - // display group info for standard groups, wallParts for walls - var groupName = null; var groupKey = null; var selectedKey = ""; - if (node.data.isGroup === true) { - groupName = node.data.caption; - groupKey = node.data.key; - selectedKey = "selectedKey"; // the 'group' node is selected; make it blue to show this - } - if (node.containingGroup !== null) { - groupName = node.containingGroup.data.caption; - groupKey = node.containingGroup.data.key; - } - if (groupName !== null) { - groupKey = "'" + groupKey + "'"; - element.innerHTML += '
    ' + groupName + ' Info (' + nodeGroupCount + ' member(s) in ' + groupName + ')
    '; - if (nodeGroupCount != 0) fillRowsWithNodes(nodeGroupParts, document.getElementById('nodeGroupInfo'), 2, node.data.key); - } - - // dynamically adjust the name of node based on user input - var nameInput = document.getElementById('nameInput'); - if (!myDiagram.isReadOnly) { - nameInput.addEventListener('input', function (e) { - var value = nameInput.value; - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("rename node"); - if (value === null || value === "" || value === undefined) { myDiagram.commitTransaction("rename node"); return; } - myDiagram.model.setDataProperty(node.data, "caption", value); - myDiagram.model.setDataProperty(node.data, "text", value); // if node is a multi purpose node, update the text on it - myDiagram.commitTransaction("rename node"); - myDiagram.skipsUndoManager = false; - }); - - // dynamically adjust the notes of the node based on user input - var notesTextarea = document.getElementById('notesTextarea'); - notesTextarea.addEventListener('input', function (e) { - var value = notesTextarea.value; - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("edit node notes"); - if (value === null || value === undefined) return; - myDiagram.model.setDataProperty(node.data, "notes", value); - myDiagram.commitTransaction("edit node notes"); - myDiagram.skipsUndoManager = false; - }); - infoWindow.style.height = document.getElementById('selectionInfoTextDiv').offsetHeight + document.getElementById('selectionInfoWindowHandle').offsetHeight + 5 + 'px'; - } -} - -// event for color input in Selection Info Window; set model data for fill color of the current selection -function setColor() { - var node = myDiagram.selection.first(); - var colorPicker = document.getElementById("colorPicker"); - if (colorPicker !== null) { - myDiagram.startTransaction("recolor node"); - myDiagram.model.setDataProperty(node.data, "color", colorPicker.value); - myDiagram.model.setDataProperty(node.data, "stroke", invertColor(colorPicker.value)) - myDiagram.commitTransaction("recolor node"); - } -} - -// event for height input in Selection Info Window; set model data for height of the currently selected node (also handles door length for doors, wall length for walls) -function setHeight() { - var node = myDiagram.selection.first(); - var value = parseFloat(convertUnitsToPixels(heightInput.value)); - if (isNaN(value)) { - alert("Please enter a number in the height input"); - setSelectionInfo(node); - return; - } - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("resize node"); - if (!myDiagram.isReadOnly) { - // Case: Standard / Multi-Purpose Nodes; basic height adjustment - if (node.category !== 'WallGroup' && node.category !== "WindowNode" && node.category !== 'DoorNode') { - myDiagram.model.setDataProperty(node.data, "height", value); - } - // Case: Door Nodes / Window Nodes; "Door Length" is node height and width - else if (node.category === 'DoorNode' || node.category === "WindowNode") { - var wall = myDiagram.findPartForKey(node.data.group); - var loc = node.location.copy(); - if (wall !== null) { - var wallLength = Math.sqrt(wall.data.startpoint.distanceSquaredPoint(wall.data.endpoint)); - if (wallLength < value) { - value = wallLength; - loc = new go.Point((wall.data.startpoint.x + wall.data.endpoint.x) / 2, (wall.data.startpoint.y + wall.data.endpoint.y) / 2); - } - } - if (node.category === "DoorNode") myDiagram.model.setDataProperty(node.data, "width", value); // for door nodes, width dictates height as well - node.location = loc; - updateWallDimensions(); - } - // Case: Wall Groups; wall length adjustment; do not allow walls to be shorter than the distance between their fathest apart wallParts - else { - var sPt = node.data.startpoint.copy(); - var ePt = node.data.endpoint.copy(); - var angle = sPt.directionPoint(ePt); - - var midPoint = new go.Point(((sPt.x + ePt.x) / 2), ((sPt.y + ePt.y) / 2)); - var newEpt = new go.Point((midPoint.x + (value / 2)), midPoint.y); - var newSpt = new go.Point((midPoint.x - (value / 2)), midPoint.y); - newEpt.offset(-midPoint.x, -midPoint.y).rotate(angle).offset(midPoint.x, midPoint.y); - newSpt.offset(-midPoint.x, -midPoint.y).rotate(angle).offset(midPoint.x, midPoint.y); - - // Edge Case 1: The user has input a length shorter than the edge wallPart's endpoints allow - // find the endpoints of the wallparts closest to the endpoints of the wall - var closestPtToSpt = null; var farthestPtFromSpt; - var closestDistToSpt = Number.MAX_VALUE; var farthestDistFromSpt = 0; - node.memberParts.iterator.each(function (wallPart) { - var endpoints = getWallPartEndpoints(wallPart); - var endpoint1 = endpoints[0]; - var endpoint2 = endpoints[1]; - var distance1 = Math.sqrt(endpoint1.distanceSquaredPoint(sPt)); - var distance2 = Math.sqrt(endpoint2.distanceSquaredPoint(sPt)); - - if (distance1 < closestDistToSpt) { - closestDistToSpt = distance1; - closestPtToSpt = endpoint1; - } if (distance1 > farthestDistFromSpt) { - farthestDistFromSpt = distance1; - farthestPtFromSpt = endpoint1; - } if (distance2 < closestDistToSpt) { - closestDistToSpt = distance2; - closestPtToSpt = endpoint2; - } if (distance2 > farthestDistFromSpt) { - farthestDistFromSpt = distance2; - farthestPtFromSpt = endpoint2; - } - }); - - if (closestPtToSpt !== null) { - // if the proposed length is smaller than the minDistance, set wall length to minDistance - var proposedDistance = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); - var minDistance = Math.sqrt(closestPtToSpt.distanceSquaredPoint(farthestPtFromSpt)); - if (proposedDistance < minDistance) { - newSpt = closestPtToSpt; - newEpt = farthestPtFromSpt; - } - } - - // Edge Case 2: The new wall endpoints constructed based on user input do not generate a wall too short for the wall's edge wallPart's endpoints; - // however, there is/are a/some wallPart(s) that do not fit along the new wall endpoints (due to midpoint construction) - // if a wallPart endpoint is outside the line created by newSpt and newEpt, adjust the endpoints accordingly - var farthestPtFromWallPt = null; var farthestFromWallPtDist = 0; - node.memberParts.iterator.each(function (part) { - var endpoints = getWallPartEndpoints(part); - // check for endpoints of wallParts not along the line segment made by newSpt and newEpt - for (var i = 0; i < endpoints.length; i++) { - var point = endpoints[i]; - var distanceToStartPoint = parseFloat(Math.sqrt(point.distanceSquaredPoint(newSpt)).toFixed(2)); - var distanceToEndPoint = parseFloat(Math.sqrt(point.distanceSquaredPoint(newEpt)).toFixed(2)); - var wallLength = parseFloat(Math.sqrt(newSpt.distanceSquaredPoint(newEpt)).toFixed(2)); - if ((distanceToStartPoint + distanceToEndPoint).toFixed(2) !== wallLength.toFixed(2)) { - var testDistance = Math.sqrt(point.distanceSquaredPoint(newSpt)); - if (testDistance > farthestFromWallPtDist) { - farthestFromWallPtDist = testDistance; - farthestPtFromWallPt = point; - } - } - } - }); - - // if a wallPart endpoint is outside the wall, adjust the endpoints of the wall to accomodate it - if (farthestPtFromWallPt !== null) { - var distance = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); - if (farthestPtFromWallPt.distanceSquaredPoint(newSpt) < farthestPtFromWallPt.distanceSquaredPoint(newEpt)) { - newSpt = farthestPtFromWallPt; - var totalLength = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); - newEpt = new go.Point(newSpt.x + ((distance / totalLength) * (newEpt.x - newSpt.x)), - newSpt.y + ((distance / totalLength) * (newEpt.y - newSpt.y))); - } else { - newEpt = farthestPtFromWallPt; - var totalLength = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); - newSpt = new go.Point(newEpt.x + ((distance / totalLength) * (newSpt.x - newEpt.x)), - newEpt.y + ((distance / totalLength) * (newSpt.y - newEpt.y))); - } - } - - myDiagram.model.setDataProperty(node.data, "startpoint", newSpt); - myDiagram.model.setDataProperty(node.data, "endpoint", newEpt); - updateWall(node); - } - } - myDiagram.commitTransaction("resize node"); - updateWallDimensions(); - myDiagram.skipsUndoManager = false; -} - -// event for width input in Node Info Window; set model data for width of the currently selected node -function setWidth() { - var node = myDiagram.selection.first(); - if (document.getElementById("widthInput") === null) return; - var value = parseFloat(convertUnitsToPixels(widthInput.value)); - if (isNaN(value)) { - alert("Please enter a number in the width input"); - setSelectionInfo(node); - return; - } - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("resize node"); - if (!myDiagram.isReadOnly) { - // Case: Window nodes, keeps windows within wall boundaries - if (node.category === 'WindowNode') { - var wall = myDiagram.findPartForKey(node.data.group); - var loc = node.location.copy(); - // constrain max width "value" by the free stretch on the wall "node" is in - if (wall !== null) { - var containingStretch = getWallPartStretch(node); - var stretchLength = Math.sqrt(containingStretch.point1.distanceSquaredPoint(containingStretch.point2)); - if (stretchLength < value) { - value = stretchLength; - loc = new go.Point((containingStretch.point1.x + containingStretch.point2.x) / 2, - (containingStretch.point1.y + containingStretch.point2.y) / 2); - } - } - myDiagram.model.setDataProperty(node.data, "width", value); - node.location = loc; - updateWallDimensions(); - } - // Case: Wall Groups; set wall's data.strokeWidth - else if (node.category === 'WallGroup') { - myDiagram.model.setDataProperty(node.data, "strokeWidth", value); - node.memberParts.iterator.each(function (part) { - if (part.category === 'DoorNode') myDiagram.model.setDataProperty(part.data, "doorOpeningHeight", value); - if (part.category === 'WindowNode') myDiagram.model.setDataProperty(part.data, "height", value); - }); - } - // Case: Standard / Multi-Purpose Nodes; basic width ajustment - else myDiagram.model.setDataProperty(node.data, "width", value); - } - myDiagram.commitTransaction("resize node"); - myDiagram.skipsUndoManager = false; -} - -// set the height, width, and color of the selection based on user input in the Selection Info Window -function applySelectionChanges() { - setHeight(); - setWidth(); - setColor(); - setSelectionInfo(myDiagram.selection.first()); -} - -// hide or show specific help/windows -function hideShow(div) { - var diagramHelpDiv = document.getElementById(div); var str; - switch (div) { - case 'diagramHelpDiv': str = 'Diagram Help'; char = 'H'; break; - case 'selectionInfoWindow': str = 'Selection Help'; char = 'I'; break; - case 'myOverviewWindow': str = 'Overview'; char = 'E'; break; - case 'optionsWindow': str = 'Options'; char = 'B'; break; - case 'statisticsWindow': str = 'Statistics'; char = 'G'; break; - case 'myPaletteWindow': str = 'Palettes'; char = 'P'; myPalette.layoutDiagram(true); break; - } - if (diagramHelpDiv.style.visibility === "visible") { - diagramHelpDiv.style.visibility = "hidden"; - document.getElementById(div + 'Button').innerHTML = "Show " + str + "

    (Ctrl + " + char + " )

    "; - } else { - diagramHelpDiv.style.visibility = "visible"; - document.getElementById(div + 'Button').innerHTML = "Hide " + str + "

    (Ctrl + " + char + " )

    "; - } -} - -// increase or decrease the diagram scale to the nearest 10% -function adjustScale(sign) { - var el = document.getElementById('scaleDisplay'); - myDiagram.startTransaction('Change Scale'); - switch (sign) { - case '-': myDiagram.scale -= .1; break; - case '+': myDiagram.scale += .1; break; - } - myDiagram.scale = parseFloat((Math.round(myDiagram.scale / .1) * .1).toFixed(2)); - var scale = (myDiagram.scale * 100).toFixed(2); - el.innerHTML = 'Scale: ' + scale + '%'; - myDiagram.commitTransaction('Change Scale'); -} - -// called on document.onload() -function init() { - if (!checkLocalStorage()) { - var currentFile = document.getElementById("currentFile"); - currentFile.textContent = "Sorry! No web storage support. If you're using Internet Explorer / Microsoft Edge, you must load the page from a server for local storage to work."; - } - - // add event listener to HTML body for hotkey use - var body = document.getElementById('body'); - body.addEventListener("keydown", function (e) { - var keynum = e.which; - if (e.ctrlKey) { - e.preventDefault(); - switch (keynum) { - case 83: saveDocument(); break; // ctrl + s - case 79: openDocument(); break; // ctrl + o - case 68: e.preventDefault(); newDocument(); break; // ctrl + d - case 82: removeDocument(); break; // ctrl + r - case 49: setBehavior('wallBuilding'); break; // ctrl + 1 - case 50: setBehavior('dragging'); break; // ctrl + 2 - case 72: hideShow('diagramHelpDiv'); break; // ctrl + h - case 73: hideShow('selectionInfoWindow'); break; // ctrl + i - case 80: hideShow('myPaletteWindow'); break; // ctrl + p - case 69: hideShow('myOverviewWindow'); break; // ctrl + e - case 66: hideShow('optionsWindow'); break; // ctrl + b - case 71: hideShow('statisticsWindow'); break; // ctrl + g - } - } - }); - - // ********************************************************* DIAGRAM CODE ************************************************************************************** - var $ = go.GraphObject.make; - - // menu if you right click a node - var contextMenu = - $(go.Adornment, "Vertical", - $("ContextMenuButton", - $(go.TextBlock, "Make Group"), - { click: function (e, obj) { makeSelectionGroup(); } }, - // only allow grouping on non-wall / wallPart nodes - new go.Binding("visible", "visible", function (v) { - if (myDiagram.selection.count <= 1) return false; - var flag = true; - myDiagram.selection.iterator.each(function (node) { - if (node.category === "WallGroup" || node.category === "WindowNode" || node.category === "DoorNode") flag = false; - }); - return flag; - }).ofObject() - ), - $("ContextMenuButton", - $(go.TextBlock, "Ungroup"), - { click: function (e, obj) { ungroupSelection(); } }, - new go.Binding("visible", "", function (v) { - var node = myDiagram.selection.first(); - return ((node instanceof go.Node && node.containingGroup != null && node.containingGroup.category != 'WallGroup') || - (node instanceof go.Group && node.category === '')); - }).ofObject() - ), - $("ContextMenuButton", - $(go.TextBlock, "Copy"), - { click: function (e, obj) { myDiagram.commandHandler.copySelection() } }, - new go.Binding("visible", "", function (v) { return myDiagram.selection.count > 0; }) - ), - $("ContextMenuButton", - $(go.TextBlock, "Cut"), - { click: function (e, obj) { myDiagram.commandHandler.cutSelection() } }, - new go.Binding("visible", "", function (v) { return myDiagram.selection.count > 0; }) - ), - $("ContextMenuButton", - $(go.TextBlock, "Delete"), - { click: function (e, obj) { myDiagram.commandHandler.deleteSelection() } }, - new go.Binding("visible", "", function (v) { return myDiagram.selection.count > 0; }) - ), - $("ContextMenuButton", - $(go.TextBlock, "Paste"), - { click: function (e, obj) { myDiagram.commandHandler.pasteSelection(myDiagram.lastInput.documentPoint) } } - ), - $("ContextMenuButton", - $(go.TextBlock, "Show Selection Info"), - { - click: function (e, obj) { - var selectionInfoWindow = document.getElementById('selectionInfoWindow'); - if (selectionInfoWindow.style.visibility !== 'visible') hideShow('selectionInfoWindow'); - } - }, - new go.Binding("visible", "", function (v) { return myDiagram.selection.count > 0; }) - ), - $("ContextMenuButton", - $(go.TextBlock, "Flip Dimension Side"), - { - click: function (e, obj) { - myDiagram.startTransaction("flip dimension link side"); - var walls = []; - myDiagram.selection.iterator.each(function (part) { - if (part.category === "WallGroup") walls.push(part); - }); - for (var i = 0; i < walls.length; i++) { - var wall = walls[i]; - var sPt = wall.data.startpoint.copy(); - var ePt = wall.data.endpoint.copy(); - myDiagram.model.setDataProperty(wall.data, "startpoint", ePt); - myDiagram.model.setDataProperty(wall.data, "endpoint", sPt); - updateWall(wall); - } - myDiagram.commitTransaction("flip dimension link side"); - } - }, - new go.Binding("visible", "", function (v) { - var sel = myDiagram.selection; - if (sel.count === 0) return false; - var flag = false; - sel.iterator.each(function (part) { - if (part.category === "WallGroup") flag = true; - }); - return flag; - }) - ) - ); - - // initialize diagram - myDiagram = $(go.Diagram, "myDiagramDiv", - { - scale: 1, - initialContentAlignment: go.Spot.Center, - allowDrop: true, - allowLink: false, - resizingTool: new go.ResizingTool(), - draggingTool: new go.DraggingTool(), - "undoManager.isEnabled": true, - "layout.isOngoing": false, - "draggingTool.isGridSnapEnabled": true, - "draggingTool.gridSnapCellSpot": go.Spot.TopLeft, - "resizingTool.isGridSnapEnabled": true, - "commandHandler.archetypeGroupData": { isGroup: true }, - "rotatingTool.snapAngleEpsilon": 10, - grid: $(go.Panel, "Grid", - { gridCellSize: new go.Size(5, 5), visible: true }, - $(go.Shape, "LineH", { stroke: "lightgray" }), - $(go.Shape, "LineV", { stroke: "lightgray" })), - contextMenu: contextMenu, - model: $(go.GraphLinksModel, { modelData: DEFAULT_MODELDATA }) - }); - - // when model is changed, update stats in Statistics Window - myDiagram.addModelChangedListener(function (e) { if (e.isTransactionFinished) updateStatistics(); }); - - // when diagram is modified, change document title to include a * - myDiagram.addDiagramListener("Modified", function (e) { - var currentFile = document.getElementById("currentFile"); - var idx = currentFile.textContent.indexOf("*"); - if (myDiagram.isModified) { if (idx < 0) currentFile.textContent = currentFile.textContent + "*"; } - else { if (idx >= 0) currentFile.textContent = currentFile.textContent.substr(0, idx); } - }); - - // check if diagram scale has been changed -- if so, update the 'Scale' item in the View menu - myDiagram.addDiagramListener("ViewportBoundsChanged", function (e) { - var scaleEl = document.getElementById('scaleDisplay'); - scaleEl.innerHTML = "Scale: " + (myDiagram.scale * 100).toFixed(2) + "%"; - }); - - // if a node has been dropped onto the Diagram from the Palette, update the help text - myDiagram.addDiagramListener("ExternalObjectsDropped", function (e) { - var node = myDiagram.selection.first(); - // Event 1: handle a drag / drop of a wall node from the Palette (as opposed to wall construction via WallBuildingTool) - if (node.category === "PaletteWallNode") { - var paletteWallNode = myDiagram.selection.first(); - var endpoints = getWallPartEndpoints(paletteWallNode); - var data = { key: "wall", category: "WallGroup", caption: "Wall", startpoint: endpoints[0], endpoint: endpoints[1], strokeWidth: parseFloat(myDiagram.model.modelData.wallWidth), isGroup: true, notes: "" }; - myDiagram.model.addNodeData(data); - var wall = myDiagram.findPartForKey(data.key); - updateWall(wall); - myDiagram.remove(paletteWallNode); - } - // Event 2: Update the text of the Diagram Helper - if (node.category === "WindowNode" || node.category === "DoorNode") setDiagramHelper("Drag part so the cursor is over a wall to add this part to a wall"); - else setDiagramHelper("Drag, resize, or rotate your selection (hold SHIFT for no grid-snapping)"); - // Event 3: If the select tool is not active, make it active - if (myDiagram.toolManager.mouseDownTools.elt(0).isEnabled) setBehavior('dragging'); - }); - - // set node info window based on selection whenever the selection changes - myDiagram.addDiagramListener("ChangedSelection", function (e) { - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("remove dimension links and angle nodes"); - allPointNodes.iterator.each(function (node) { myDiagram.remove(node) }); - allDimensionLinks.iterator.each(function (link) { myDiagram.remove(link) }); - allPointNodes.clear(); - allDimensionLinks.clear(); - allAngleNodes.iterator.each(function (node) { myDiagram.remove(node); }); - allAngleNodes.clear(); - updateWallDimensions(); - updateWallAngles(); - myDiagram.commitTransaction("remove dimension links and angle nodes"); - myDiagram.skipsUndoManager = false; - - var selection = myDiagram.selection; - if (selection.count === 0) setSelectionInfo('Nothing selected'); - else if (selection.count === 1) setSelectionInfo(myDiagram.selection.first()); - else setSelectionInfo('Selection: '); - }); - - // when a wall is copied / pasted, update the wall geometry, angle, etc - myDiagram.addDiagramListener("ClipboardPasted", function (e) { - myDiagram.selection.iterator.each(function (node) { if (node.category === "WallGroup") updateWall(node); }); - }); - - // define the overview - myOverview = $(go.Overview, "myOverviewDiv", { observed: myDiagram, maxScale: 0.5 }); - - // ************************************************************** STANDARD GROUP FUNCTIONALITY *************************************************************** - function makeSelectionGroup() { - myDiagram.startTransaction("group selection"); - // ungroup all selected nodes; then group them; if one of the selected nodes is a group, ungroup all its nodes - var sel = myDiagram.selection; var nodes = []; - sel.iterator.each(function (n) { - if (n instanceof go.Group) n.memberParts.iterator.each(function (part) { nodes.push(part); }) - else nodes.push(n); - }); - for (var i = 0; i < nodes.length; i++) nodes[i].isSelected = true; - ungroupSelection(); - myDiagram.commandHandler.groupSelection(); - var group = myDiagram.selection.first(); // after grouping, the new group will be the only thing selected - myDiagram.model.setDataProperty(group.data, "caption", "Group"); - myDiagram.model.setDataProperty(group.data, "notes", ""); - clearEmptyGroups(); - // unselect / reselect group so data appears properly in Selection Info Window - myDiagram.clearSelection(); - myDiagram.select(group); - myDiagram.commitTransaction("group selection"); - } - - // ungroup selected nodes; if the selection is a group, ungroup all it's memberParts - function ungroupSelection() { - myDiagram.startTransaction('ungroup selection'); - // helper function to ungroup nodes - function ungroupNode(node) { - var group = node.containingGroup; - node.containingGroup = null; - if (group != null) { - if (group.memberParts.count === 0) myDiagram.remove(group); - else if (group.memberParts.count === 1) group.memberParts.first().containingGroup = null; - } - } - // ungroup any selected nodes; remember groups that are selected - var sel = myDiagram.selection; var groups = []; - sel.iterator.each(function (n) { - if (!(n instanceof go.Group)) ungroupNode(n); - else groups.push(n); - }); - // go through selected groups, and ungroup their memberparts too - var nodes = []; - for (var i = 0; i < groups.length; i++) groups[i].memberParts.iterator.each(function (n) { nodes.push(n); }); - for (var i = 0; i < nodes.length; i++) ungroupNode(nodes[i]); - clearEmptyGroups(); - myDiagram.commitTransaction('ungroup selection'); - } - - // clear all the groups that have no nodes - function clearEmptyGroups() { - var nodes = myDiagram.nodes; var arr = []; - nodes.iterator.each(function (node) { if (node instanceof go.Group && node.memberParts.count === 0 && node.category !== "WallGroup") { arr.push(node); } }); - for (i = 0; i < arr.length; i++) { myDiagram.remove(arr[i]); } - } - - // ******************************************************************* DIAGRAM NODE/ADORNMENT TEMPLATES ***************************************************************** - - // resize adornment for furniture nodes -- fill and stroke bound to furniture node data - var furnitureResizeAdornmentTemplate = - $(go.Adornment, "Spot", { locationSpot: go.Spot.Center }, - $(go.Placeholder), - $(go.Shape, { alignment: go.Spot.Top, cursor: "n-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()), - $(go.Shape, { alignment: go.Spot.TopRight, cursor: "ne-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()), - $(go.Shape, { alignment: go.Spot.Right, cursor: "e-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()), - $(go.Shape, { alignment: go.Spot.BottomRight, cursor: "se-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()), - $(go.Shape, { alignment: go.Spot.Bottom, cursor: "s-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()), - $(go.Shape, { alignment: go.Spot.BottomLeft, cursor: "sw-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()), - $(go.Shape, { alignment: go.Spot.Left, cursor: "w-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()), - $(go.Shape, { alignment: go.Spot.TopLeft, cursor: "nw-resize", figure: "Rectangle", desiredSize: new go.Size(5, 5), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()) - ); - - // rotate adornment for furniture nodes -- fill and stroke bound to furniture node data - var furnitureRotateAdornmentTemplate = - $(go.Adornment, { locationSpot: go.Spot.Center, locationObjectName: "CIRCLE" }, - $(go.Shape, "Circle", { name: "CIRCLE", cursor: "pointer", desiredSize: new go.Size(7, 7), fill: "#ffffff", stroke: "#808080" }, - new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), - new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()) - ); - - var nodeToolTip = - $(go.Adornment, "Auto", - $(go.Shape, { fill: "#FFFFCC" }), - $(go.TextBlock, { margin: 4 }, - new go.Binding("text", "", function (text, obj) { - var data = obj.part.adornedObject.data; - var name = (obj.part.adornedObject.category === "MultiPurposeNode") ? data.text : data.caption; - return "Name: " + name + "\nNotes: " + data.notes; - }).ofObject()) - ); - - // define the default Node template (used for most furniture) - myDiagram.nodeTemplateMap.add("", - $(go.Node, "Spot", - { - resizable: true, - rotatable: true, - toolTip: nodeToolTip, - resizeAdornmentTemplate: furnitureResizeAdornmentTemplate, - rotateAdornmentTemplate: furnitureRotateAdornmentTemplate, - contextMenu: contextMenu, - locationObjectName: "SHAPE", - resizeObjectName: "SHAPE", - minSize: new go.Size(5, 5), - locationSpot: go.Spot.Center, - selectionAdorned: false, // use a Binding on the Shape.stroke to show selection - doubleClick: function () { hideShow('selectionInfoWindow'); } - }, - // remember location of the Node - new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), - // move a selected part into the Foreground layer so it's not obscuerd by non-selected Parts - new go.Binding("layerName", "isSelected", function (s) { return s ? "Foreground" : ""; }).ofObject(), - $(go.Shape, - { strokeWidth: 1, name: "SHAPE", stroke: "#000000", geometryString: "F1 M0 0 L20 0 20 20 0 20 z", fill: "rgba(128, 128, 128, 0.5)" }, - new go.Binding("geometryString", "geo"), - new go.Binding("angle", "angle").makeTwoWay(), - new go.Binding("width", "width").makeTwoWay(), - new go.Binding("height", "height").makeTwoWay(), - // set Palette ID field properly when a node is selected - new go.Binding("stroke", "isSelected", function (s, obj) { return s ? lightenColor(obj.stroke, 70) : invertColor(obj.part.data.color); }).ofObject(), - new go.Binding("figure", "shape"), - new go.Binding("fill", "color")) - )); - - // define Node template for the multi purpose furniture node (rectangle with editable text) - myDiagram.nodeTemplateMap.add("MultiPurposeNode", - $(go.Node, "Spot", - { - contextMenu: contextMenu, - toolTip: nodeToolTip, - locationSpot: go.Spot.Center, - resizeAdornmentTemplate: furnitureResizeAdornmentTemplate, - rotateAdornmentTemplate: furnitureRotateAdornmentTemplate, - locationObjectName: "SHAPE", - resizable: true, - rotatable: true, - resizeObjectName: "SHAPE", - minSize: new go.Size(5, 5), - selectionAdorned: false, // use a Binding on the Shape.stroke to show selection - doubleClick: function () { hideShow('selectionInfoWindow'); } - }, - // remember location, angle, height, and width of the node - new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), - new go.Binding("angle", "angle").makeTwoWay(), - new go.Binding("width", "width").makeTwoWay(), - new go.Binding("height", "height").makeTwoWay(), - // move a selected part into the Foreground layer so it's not obscuerd by non-selected Parts - new go.Binding("layerName", "isSelected", function (s) { return s ? "Foreground" : ""; }).ofObject(), - $(go.Shape, { strokeWidth: 1, name: "SHAPE", fill: "rgba(128, 128, 128, 0.5)", }, - // set Palette ID field properly when a node is selected - new go.Binding("stroke", "isSelected", function (s, obj) { return s ? lightenColor(obj.stroke, 70) : invertColor(obj.part.data.color); }).ofObject(), - new go.Binding("figure", "shape"), - new go.Binding("width", "width").makeTwoWay(), - new go.Binding("height", "height").makeTwoWay(), - new go.Binding("fill", "color")), - $(go.TextBlock, - { - margin: 5, - wrap: go.TextBlock.WrapFit, - textAlign: "center", - editable: true, - isMultiline: false, - stroke: '#454545', - font: "10pt sans-serif" - }, - new go.Binding("text").makeTwoWay(), - new go.Binding("font", "height", function (height) { - if (height > 25) return "10pt sans-serif"; - if (height < 25 && height > 15) return "8pt sans-serif"; - else return "6pt sans-serif"; - }), - new go.Binding("stroke", "color", function (color) { return invertColor(color); }) - ) - )); - - // drag computation function for WindowNodes and DoorNodes; ensure wall parts stay in walls when dragged - var dragWallParts = function (part, pt, gridPt) { - if (part.containingGroup !== null && part.containingGroup.category === 'WallGroup') { - // Edge Case: if part is not on its wall (due to incorrect load) snap part.loc onto its wall immediately hopefully this is never called - var wall = part.containingGroup; - var wStart = wall.data.startpoint; - var wEnd = wall.data.endpoint; - var dist1 = Math.sqrt(wStart.distanceSquaredPoint(part.location)); - var dist2 = Math.sqrt(part.location.distanceSquaredPoint(wEnd)); - var totalDist = Math.sqrt(wStart.distanceSquaredPoint(wEnd)); - if (dist1 + dist2 !== totalDist) part.location = part.location.copy().projectOntoLineSegmentPoint(wStart, wEnd); - - // main behavior - var stretch = getWallPartStretch(part); - var leftOrAbovePt = stretch.point1; - var rightOrBelowPt = stretch.point2; - - // calc points along line created by the endpoints that are half the width of the moving window/door - var totalLength = Math.sqrt(leftOrAbovePt.distanceSquaredPoint(rightOrBelowPt)); - var distance = (part.data.width / 2); - var point1 = new go.Point(leftOrAbovePt.x + ((distance / totalLength) * (rightOrBelowPt.x - leftOrAbovePt.x)), - leftOrAbovePt.y + ((distance / totalLength) * (rightOrBelowPt.y - leftOrAbovePt.y))); - var point2 = new go.Point(rightOrBelowPt.x + ((distance / totalLength) * (leftOrAbovePt.x - rightOrBelowPt.x)), - rightOrBelowPt.y + ((distance / totalLength) * (leftOrAbovePt.y - rightOrBelowPt.y))); - - // calc distance from pt to line (part's wall) - use point to 2pt line segment distance formula - var distFromWall = Math.abs(((wEnd.y - wStart.y) * pt.x) - ((wEnd.x - wStart.x) * pt.y) + (wEnd.x * wStart.y) - (wEnd.y * wStart.x)) / - Math.sqrt(Math.pow((wEnd.y - wStart.y), 2) + Math.pow((wEnd.x - wStart.x), 2)); - var tolerance = (20 * wall.data.strokeWidth < 100) ? (20 * wall.data.strokeWidth) : 100; - - // if distance from pt to line > some tolerance, detach the wallPart from the wall - if (distFromWall > tolerance) { - part.containingGroup = null; - part.angle = 0; - allPointNodes.iterator.each(function (node) { myDiagram.remove(node) }); - allDimensionLinks.iterator.each(function (link) { myDiagram.remove(link) }); - allPointNodes.clear(); - allDimensionLinks.clear(); - updateWallDimensions(); - } - - - // project the proposed location onto the line segment created by the new points (ensures wall parts are constrained properly when dragged) - pt = pt.copy().projectOntoLineSegmentPoint(point1, point2); - myDiagram.skipsUndoManager = true; - myDiagram.startTransaction("set loc"); - myDiagram.model.setDataProperty(part.data, "loc", go.Point.stringify(pt)); - myDiagram.commitTransaction("set loc"); - myDiagram.skipsUndoManager = false; - - updateWallDimensions(); // update the dimension links created by having this wall part selected - } return pt; - } - - // resize adornment for windows and doors - var wallPartResizeAdornment = - $(go.Adornment, "Spot", - { name: "WallPartResizeAdornment", locationSpot: go.Spot.Center }, - $(go.Placeholder), - $(go.Shape, { alignment: go.Spot.Left, cursor: "w-resize", figure: "Diamond", desiredSize: new go.Size(7, 7), fill: "#ffffff", stroke: "#808080" }), - $(go.Shape, { alignment: go.Spot.Right, cursor: "e-resize", figure: "Diamond", desiredSize: new go.Size(7, 7), fill: "#ffffff", stroke: "#808080" }) - ); - - // define Node template for the window nodes - myDiagram.nodeTemplateMap.add("WindowNode", - $(go.Node, "Spot", - { - contextMenu: contextMenu, - selectionObjectName: "SHAPE", - selectionAdorned: false, - locationSpot: go.Spot.Center, - name: "NODE", - toolTip: nodeToolTip, - minSize: new go.Size(5, 5), - resizable: true, - resizeAdornmentTemplate: wallPartResizeAdornment, - rotatable: false, - doubleClick: function () { hideShow('selectionInfoWindow'); }, - dragComputation: dragWallParts, - layerName: 'Foreground' // make sure windows are always in front of walls - }, - new go.Binding("width", "width").makeTwoWay(), - new go.Binding("height", "height").makeTwoWay(), - new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), - new go.Binding("angle", "angle").makeTwoWay(), - $(go.Shape, - { name: "SHAPE", fill: "white", strokeWidth: 0 }, - new go.Binding("width", "width"), - new go.Binding("height", "height"), - new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), - new go.Binding("fill", "isSelected", function (s, obj) { return s ? "lightgray" : "white"; }).ofObject(), - new go.Binding("figure", "shape") - ), - $(go.Shape, - { name: "LINESHAPE", fill: "darkgray", strokeWidth: 0, height: 10 }, - new go.Binding("width", "width", function (width, obj) { return width - 10; }), // 5px padding each side - new go.Binding("height", "height", function (height, obj) { return (height / 5); }), - new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject() - ) - )); - - // define Node template for the palette Wall Node (becomes WallGroup when dropped onto diagram) - myDiagram.nodeTemplateMap.add("PaletteWallNode", - $(go.Node, "Spot", { selectionAdorned: false, locationSpot: go.Spot.Center }, - new go.Binding("width", "width").makeTwoWay(), - new go.Binding("height", "height").makeTwoWay(), - $(go.Shape, { name: "SHAPE", fill: "black", strokeWidth: 0, height: 10, figure: "Rectangle" }, - new go.Binding("width", "width").makeTwoWay(), - new go.Binding("height", "height").makeTwoWay(), - new go.Binding("fill", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), - new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject()) - )); - - // selection adornment for door nodes - var doorSelectionAdornment = - $(go.Adornment, "Vertical", - { name: "DoorSelectionAdornment" }, - $(go.Panel, "Auto", - $(go.Shape, { fill: null, stroke: null }), - $(go.Placeholder)), - $(go.Panel, "Horizontal", { defaultStretch: go.GraphObject.Vertical }, - $("Button", - $(go.Picture, { source: "icons/flipDoorOpeningLeft.png", column: 0, desiredSize: new go.Size(12, 12) }, - new go.Binding("source", "", function (obj) { - if (obj.adornedPart === null) return "icons/flipDoorOpeningRight.png"; - else if (obj.adornedPart.data.swing === "left") return "icons/flipDoorOpeningRight.png"; - else return "icons/flipDoorOpeningLeft.png"; - }).ofObject() - ), - { - click: function (e, obj) { - myDiagram.startTransaction("flip door"); - var door = obj.part.adornedPart; - if (door.data.swing === "left") myDiagram.model.setDataProperty(door.data, "swing", "right"); - else myDiagram.model.setDataProperty(door.data, "swing", "left"); - myDiagram.commitTransaction("flip door"); - }, - toolTip: $(go.Adornment, "Auto", - $(go.Shape, { fill: "#FFFFCC" }), - $(go.TextBlock, { margin: 4, text: "Flip Door Opening" } - )) - }, - new go.Binding("visible", "", function (obj) { return (obj.adornedPart === null) ? false : (obj.adornedPart.containingGroup !== null); }).ofObject() - ), - $("Button", - $(go.Picture, { source: "icons/flipDoorSide.png", column: 0, desiredSize: new go.Size(12, 12) }), - { - click: function (e, obj) { - myDiagram.startTransaction("rotate door"); - var door = obj.part.adornedPart; - door.angle = (door.angle + 180) % 360; - myDiagram.commitTransaction("rotate door"); - }, - toolTip: $(go.Adornment, "Auto", - $(go.Shape, { fill: "#FFFFCC" }), - $(go.TextBlock, { margin: 4, text: "Flip Door Side" } - )) - } - ), - new go.Binding("visible", "", function (obj) { return (obj.adornedPart === null) ? false : (obj.adornedPart.containingGroup !== null); }).ofObject() - ) - ); - - // define Node template for the door nodes - myDiagram.nodeTemplateMap.add("DoorNode", - $(go.Node, "Spot", - { - contextMenu: contextMenu, - selectionObjectName: "SHAPE", - selectionAdornmentTemplate: doorSelectionAdornment, - locationSpot: go.Spot.BottomCenter, - resizable: true, - resizeObjectName: "OPENING_SHAPE", - rotatable: false, - toolTip: nodeToolTip, - minSize: new go.Size(10, 10), - doubleClick: function () { hideShow('selectionInfoWindow'); }, - dragComputation: dragWallParts, - resizeAdornmentTemplate: wallPartResizeAdornment, - layerName: 'Foreground' // make sure windows are always in front of walls - }, - // remember location of the Node - new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), - new go.Binding("angle", "angle").makeTwoWay(), - // the door's locationSpot is affected by it's openingHeight, which is affected by the thickness of its containing wall - new go.Binding("locationSpot", "doorOpeningHeight", function (doh, obj) { return new go.Spot(0.5, 1, 0, -(doh / 2)); }), - // this is the shape that reprents the door itself and its swing - $(go.Shape, { name: "SHAPE", strokeWidth: 1 }, - new go.Binding("width", "width"), - new go.Binding("height", "width").makeTwoWay(), - new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), - new go.Binding("fill", "color"), - new go.Binding("geometryString", "swing", function (swing) { - if (swing === "left") return "F1 M0,0 v-150 a150,150 0 0,1 150,150 "; - else return "F1 M275,175 v-150 a150,150 0 0,0 -150,150 "; - }) - ), - // this is the Shape that represents the door opening - $(go.Shape, - { - name: "OPENING_SHAPE", fill: "white", - strokeWidth: 0, height: 5, width: 40, - alignment: go.Spot.BottomCenter, alignmentFocus: go.Spot.Center - }, - new go.Binding("height", "doorOpeningHeight").makeTwoWay(), - new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), - new go.Binding("fill", "isSelected", function (s, obj) { return s ? "lightgray" : "white"; }).ofObject(), - new go.Binding("width", "width").makeTwoWay() - ) - )); - - // used to construct angles created by walls - myDiagram.nodeTemplateMap.add("AngleNode", $(go.Node, "Spot", - new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), - { locationSpot: go.Spot.Center, locationObjectName: "SHAPE", selectionAdorned: false }, - $(go.Shape, "Circle", // placed where walls intersect, is invisible - { name: "SHAPE", fill: "red", height: 0, width: 0 }), - $(go.Shape, { stroke: "green", strokeWidth: 1.5, fill: null }, // arc - new go.Binding("geometry", "", makeArc).ofObject(), - new go.Binding("stroke", "stroke")), - $(go.Panel, "Auto", { name: "ARCLABEL" }, - // position the label in the center of the arc - new go.Binding("alignment", "sweep", function (sweep, panel) { - var rad = Math.min(30, panel.part.data.maxRadius); - var angle = panel.part.data.angle; - var cntr = new go.Point(rad, 0).rotate(angle + sweep / 2); - return new go.Spot(0.5, 0.5, cntr.x, cntr.y); - }), - $(go.Shape, { stroke: "black", fill: "white" }, - new go.Binding("stroke", "stroke")), - $(go.TextBlock, { font: "7pt sans-serif", margin: new go.Margin(2, 2, 2, 2) }, - new go.Binding("text", "sweep", function (sweep) { return sweep.toFixed(2) + String.fromCharCode(176); }), - new go.Binding("stroke", "color")) - )) - ); - - // ********************************************************** DIAGRAM GROUP TEMPLATES *********************************************************** - // standard group - myDiagram.groupTemplateMap.add("", - $(go.Group, "Vertical", - { - contextMenu: contextMenu, doubleClick: function () { hideShow('selectionInfoWindow'); }, - toolTip: - $(go.Adornment, "Auto", - $(go.Shape, { fill: "#FFFFCC" }), - $(go.TextBlock, { margin: 4, text: "" }, - new go.Binding("text", "", function (text, obj) { - var data = obj.part.adornedObject.data; - return "Name: " + data.caption + "\nNotes: " + data.notes; - }).ofObject()) - ) - }, - new go.Binding("location", "loc"), - $(go.Panel, "Auto", - $(go.Shape, "RoundedRectangle", { fill: "rgba(128,128,128,0.15)", stroke: 'rgba(128, 128, 128, .05)', name: 'SHAPE', strokeCap: 'square' }, - new go.Binding("fill", "isSelected", function (s, obj) { - return s ? "rgba(128, 128, 128, .15)" : "rgba(128, 128, 128, 0.10)"; - }).ofObject() - ), - $(go.Placeholder, { padding: 5 }) // extra padding around members - ) - )); - - // drag computation function to snap walls to the grid properly while dragging - var snapWalls = function (part, pt, gridPt) { - updateWallDimensions(); - updateWallAngles(); - var grid = part.diagram.grid; - var sPt = part.data.startpoint.copy(); - var ePt = part.data.endpoint.copy(); - var dx = pt.x - part.location.x; - var dy = pt.y - part.location.y; - var newSpt = sPt.offset(dx, dy); - var newEpt = ePt.offset(dx, dy); - if (myDiagram.toolManager.draggingTool.isGridSnapEnabled) { - newSpt = newSpt.snapToGridPoint(grid.gridOrigin, grid.gridCellSize); - newEpt = newEpt.snapToGridPoint(grid.gridOrigin, grid.gridCellSize); - } - myDiagram.model.setDataProperty(part.data, "startpoint", newSpt); - myDiagram.model.setDataProperty(part.data, "endpoint", newEpt); - return new go.Point((newSpt.x + newEpt.x) / 2, (newSpt.y + newEpt.y) / 2); - } - - // used in addWallPart; find closest loc (to mousept) on wall a wallPart can be dropped onto without extending beyond wall endpoints or intruding into another wallPart - function findClosestLocOnWall(wall, part) { - var orderedConstrainingPts = []; // wall endpoints and wallPart endpoints - var startpoint = wall.data.startpoint.copy(); - var endpoint = wall.data.endpoint.copy(); - // store all possible constraining endpoints (wall endpoints and wallPart endpoints) in the order in which they appear (left/top to right/bottom) - var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; - var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; - var wallPartEndpoints = []; - wall.memberParts.iterator.each(function (wallPart) { - var endpoints = getWallPartEndpoints(wallPart); - wallPartEndpoints.push(endpoints[0]); - wallPartEndpoints.push(endpoints[1]); - }); - // sort all wallPartEndpoints by x coordinate left to right - wallPartEndpoints.sort(function (a, b) { - if ((a.x + a.y) > (b.x + b.y)) return 1; - if ((a.x + a.y) < (b.x + b.y)) return -1; - else return 0; - }); - orderedConstrainingPts.push(firstWallPt); - orderedConstrainingPts = orderedConstrainingPts.concat(wallPartEndpoints); - orderedConstrainingPts.push(lastWallPt); - - // go through all constraining points; if there's a free stretch along the wall "part" could fit in, remember it - var possibleStretches = []; - for (var i = 0; i < orderedConstrainingPts.length; i += 2) { - var point1 = orderedConstrainingPts[i]; - var point2 = orderedConstrainingPts[i + 1]; - var distanceBetween = Math.sqrt(point1.distanceSquaredPoint(point2)); - if (distanceBetween >= part.data.width) possibleStretches.push({ pt1: point1, pt2: point2 }); - } - - // go through all possible stretches along the wall the part *could* fit in; find the one closest to the part's current location - var closestDist = Number.MAX_VALUE; var closestStretch = null; - for (var i = 0; i < possibleStretches.length; i++) { - var testStretch = possibleStretches[i]; - var testPoint1 = testStretch.pt1; - var testPoint2 = testStretch.pt2; - var testDistance1 = Math.sqrt(testPoint1.distanceSquaredPoint(part.location)); - var testDistance2 = Math.sqrt(testPoint2.distanceSquaredPoint(part.location)); - if (testDistance1 < closestDist) { - closestDist = testDistance1; - closestStretch = testStretch; - } - if (testDistance2 < closestDist) { - closestDist = testDistance2; - closestStretch = testStretch; - } - } - - // Edge Case: If there's no space for the wallPart, return null - if (closestStretch === null) return null; - - // using the closest free stretch along the wall, calculate endpoints that make the stretch's line segment, then project part.location onto the segment - var closestStretchLength = Math.sqrt(closestStretch.pt1.distanceSquaredPoint(closestStretch.pt2)); - var offset = part.data.width / 2; - var point1 = new go.Point(closestStretch.pt1.x + ((offset / closestStretchLength) * (closestStretch.pt2.x - closestStretch.pt1.x)), - closestStretch.pt1.y + ((offset / closestStretchLength) * (closestStretch.pt2.y - closestStretch.pt1.y))); - var point2 = new go.Point(closestStretch.pt2.x + ((offset / closestStretchLength) * (closestStretch.pt1.x - closestStretch.pt2.x)), - closestStretch.pt2.y + ((offset / closestStretchLength) * (closestStretch.pt1.y - closestStretch.pt2.y))); - var newLoc = part.location.copy().projectOntoLineSegmentPoint(point1, point2); - return newLoc; - } - - // mouseDrop event for walls; if a door or window is dropped on a wall, add it to the wall group - // do not allow dropping wallParts that would extend beyond wall endpoints or intrude into another wallPart - var addWallPart = function (e, wall) { - var wallPart = myDiagram.selection.first(); - if ((wallPart.category === "WindowNode" || wallPart.category === "DoorNode") && wallPart.containingGroup === null) { - var newLoc = findClosestLocOnWall(wall, wallPart); - if (newLoc !== null) { - wall.findObject("SHAPE").stroke = "black"; - myDiagram.model.setDataProperty(wallPart.data, "group", wall.data.key); - wallPart.location = newLoc.projectOntoLineSegmentPoint(wall.data.startpoint, wall.data.endpoint); - wallPart.angle = wall.rotateObject.angle; - if (wallPart.category === "WindowNode") myDiagram.model.setDataProperty(wallPart.data, "height", wall.data.strokeWidth); - if (wallPart.category === "DoorNode") myDiagram.model.setDataProperty(wallPart.data, "doorOpeningHeight", wall.data.strokeWidth); - } else { - myDiagram.remove(wallPart); - alert("There's not enough room on the wall!"); - return; - } - } - setSelectionInfo(myDiagram.selection.first()); - updateWallDimensions(); - } - - // mouseDragEnter evemt for walls; if a door or window is dragged over a wall, highlight the wall and change its angle - var wallPartDragOver = function (e, wall) { - var parts = myDiagram.toolManager.draggingTool.draggingParts; - parts.iterator.each(function (part) { - if ((part.category === "WindowNode" || part.category === "DoorNode") && part.containingGroup === null) { - wall.findObject("SHAPE").stroke = "lightblue"; - part.angle = wall.rotateObject.angle; - } - }); - } - - // mouseDragLeave event for walls; if a wall part is dragged past a wall, unhighlight the wall and change back the wall part's angle to 0 - var wallPartDragAway = function (e, wall) { - wall.findObject("SHAPE").stroke = "black"; - var parts = myDiagram.toolManager.draggingTool.draggingParts; - parts.iterator.each(function (part) { - if ((part.category === "WindowNode" || part.category === "DoorNode") && part.containingGroup === null) part.angle = 0 - }); - } - - // wall group (has custom layout for handling window / door placement) - myDiagram.groupTemplateMap.add("WallGroup", $(go.Group, "Spot", - { - contextMenu: contextMenu, - toolTip: nodeToolTip, - selectionObjectName: "SHAPE", - rotateObjectName: "SHAPE", - locationSpot: go.Spot.Center, - reshapable: true, - minSize: new go.Size(1, 1), - dragComputation: snapWalls, - selectionAdorned: false, - mouseDrop: addWallPart, - mouseDragEnter: wallPartDragOver, - mouseDragLeave: wallPartDragAway, - doubleClick: function () { hideShow('selectionInfoWindow'); } - }, - $(go.Shape, - { - strokeWidth: 1, - name: "SHAPE", - fill: "black", - stroke: "red", - geometry: new go.Geometry(go.Geometry.Line), - isGeometryPositioned: true - }, - new go.Binding("strokeWidth", "strokeWidth"), - new go.Binding("stroke", "isSelected", function (s, obj) { - if (obj.part.containingGroup != null) { - var group = obj.part.containingGroup; - if (s) { group.data.isSelected = true; } - } - return s ? "dodgerblue" : "black"; - }).ofObject() - ) - )); - - // ************************************************************************* PALETTE ***************************************************** - - paletteModel = $(go.GraphLinksModel, { nodeDataArray: furnitureNodeDataArray }); - - palette2Model = $(go.GraphLinksModel, - { - nodeDataArray: [ - { - category: "PaletteWallNode", - key: "wall", - caption: "Wall", - type: "Wall", - color: "#000000", - shape: "Rectangle", - height: 10, - width: 60, - notes: "", - }, - { - category: "WindowNode", - key: "window", - color: "white", - caption: "Window", - type: "Window", - shape: "Rectangle", - height: 10, - width: 60, - notes: "" - }, - { - key: "door", - category: "DoorNode", - color: "rgba(0, 0, 0, 0)", - caption: "Door", - type: "Door", - width: 40, - doorOpeningHeight: 5, - swing: "left", - notes: "" - } - ] - }); - - // Furniture Palette - myPalette = $(go.Palette, "myPaletteDiv", - { - contentAlignment: go.Spot.Center, - nodeTemplateMap: myDiagram.nodeTemplateMap, // shared node template with main diagram - "contextMenuTool.isEnabled": false, - model: paletteModel, - scale: 1 - }); - - // Wall Parts Palette - myPalette2 = $(go.Palette, "myPalette2Div", - { - contentAlignment: go.Spot.Center, - nodeTemplateMap: myDiagram.nodeTemplateMap, // shared node template with main diagram - "contextMenuTool.isEnabled": false, - model: palette2Model, - scale: 1 - }); - - // display different help depending on selection context - myDiagram.addDiagramListener("ChangedSelection", function (e) { - var selection = myDiagram.selection; - var node = myDiagram.selection.first(); // only used if selection.count === 1 - if (selection.count === 0) setDiagramHelper("Click to select a part, drag one from a Palette, or draw a wall with the Wall Tool (Ctr + 1)"); - else if (selection.count > 1) { - var ungroupable = false; - selection.iterator.each(function (node) { if (node.category === "WindowNode" || node.category === "DoorNode" || node.category === "WallGroup") ungroupable = true; }); - if (!ungroupable) setDiagramHelper("You may group your selection with the context menu (Right Click anywhere)"); - } - else if (node.category === "WallGroup") setDiagramHelper("Drag wall endpoints or add doors and windows to the wall from the Wall Parts Palette"); - else if (selection.first().category === "WindowNode" || selection.first().category === "DoorNode") { - if (node.containingGroup !== null) setDiagramHelper("Drag and resize wall part along the wall; drag away from wall to detach"); - else setDiagramHelper("Drag part so the cursor is over a wall to add this part to a wall"); - } - else if (selection.first().category === "MultiPurposeNode") setDiagramHelper("Double click on part text to revise it"); - else setDiagramHelper("Drag, resize, or rotate (hold SHIFT for no snap) your selection"); - }); - - // ****************************************************************** OTHER TOOL OVERRIDES ***************************************************************** - - // if a wall was dragged to intersect another wall, update angle displays - myDiagram.toolManager.draggingTool.doMouseUp = function () { - go.DraggingTool.prototype.doMouseUp.call(this); - updateWallAngles(); - this.isGridSnapEnabled = myDiagram.model.modelData.preferences.gridSnap; - } - - // if user is holding shift while dragging, do not use grid snap - myDiagram.toolManager.draggingTool.doMouseMove = function () { - if (myDiagram.lastInput.shift) { - this.isGridSnapEnabled = false; - } else this.isGridSnapEnabled = myDiagram.model.modelData.preferences.gridSnap; - go.DraggingTool.prototype.doMouseMove.call(this); - } - - // when resizing, constantly update the node info box with updated size info; constantly update dimension links - myDiagram.toolManager.resizingTool.doMouseMove = function () { - var node = this.adornedObject; - // if node is the only thing selected, display its info as its resized - if (this.diagram.selection.count === 1) setSelectionInfo(node); - updateWallDimensions(); - go.ResizingTool.prototype.doMouseMove.call(this); - } - - // when resizing a wallPart, do not allow it to be resized past the nearest wallPart / wall endpoints - myDiagram.toolManager.resizingTool.computeMaxSize = function () { - var tool = this; - var obj = tool.adornedObject.part; - var wall = myDiagram.findPartForKey(obj.data.group); - if ((obj.category === 'DoorNode' || obj.category === 'WindowNode') && wall !== null) { - var stationaryPt; var movingPt; - var resizeAdornment = null; - obj.adornments.iterator.each(function (adorn) { if (adorn.name === "WallPartResizeAdornment") resizeAdornment = adorn; }); - resizeAdornment.elements.iterator.each(function (el) { - if (el instanceof go.Shape && el.alignment === tool.handle.alignment) movingPt = el.getDocumentPoint(go.Spot.Center); - if (el instanceof go.Shape && el.alignment !== tool.handle.alignment) stationaryPt = el.getDocumentPoint(go.Spot.Center); - }); - // find the constrainingPt; that is, the endpoint (wallPart endpoint or wall endpoint) that is the one closest to movingPt but still farther from stationaryPt than movingPt - // this loop checks all other wallPart endpoints of the wall that the resizing wallPart is a part of - var constrainingPt; var closestDist = Number.MAX_VALUE; - wall.memberParts.iterator.each(function (part) { - if (part.data.key !== obj.data.key) { - var endpoints = getWallPartEndpoints(part); - for (var i = 0; i < endpoints.length; i++) { - var point = endpoints[i]; - var distanceToMovingPt = Math.sqrt(point.distanceSquaredPoint(movingPt)); - if (distanceToMovingPt < closestDist) { - var distanceToStationaryPt = Math.sqrt(point.distanceSquaredPoint(stationaryPt)); - if (distanceToStationaryPt > distanceToMovingPt) { - closestDist = distanceToMovingPt; - constrainingPt = point; - } - } - } - } - }); - // if we're not constrained by a wallPart endpoint, the constraint will come from a wall endpoint; figure out which one - if (constrainingPt === undefined || constrainingPt === null) { - if (wall.data.startpoint.distanceSquaredPoint(movingPt) > wall.data.startpoint.distanceSquaredPoint(stationaryPt)) constrainingPt = wall.data.endpoint; - else constrainingPt = wall.data.startpoint; - } - // set the new max size of the wallPart according to the constrainingPt - var maxLength = Math.sqrt(stationaryPt.distanceSquaredPoint(constrainingPt)); - return new go.Size(maxLength, wall.data.strokeWidth); - } - return go.ResizingTool.prototype.computeMaxSize.call(tool); - } - - // ---------------------------------------------- INSTALL CUSTOM TOOLS -------------------------------------------------------------- - var wallBuildingTool = new WallBuildingTool(); - myDiagram.toolManager.mouseDownTools.insertAt(0, wallBuildingTool); - - var wallReshapingTool = new WallReshapingTool(); - myDiagram.toolManager.mouseDownTools.insertAt(3, wallReshapingTool); - - // --------------------------------------------- INITIALIZE VARIABLES AND UI ---------------------------------------------------------- - setBehavior('dragging'); // active tool is Move / Select (Ctrl + 2) - // set grid size initially to 20cm boxes (10px by 10px, since 1px = 2cm) - myDiagram.toolManager.draggingTool.gridCellSize = new go.Size(myDiagram.model.modelData.gridSize, myDiagram.model.modelData.gridSize); - myDiagram.grid = $(go.Panel, "Grid", - { gridCellSize: new go.Size(myDiagram.model.modelData.gridSize, myDiagram.model.modelData.gridSize), visible: true }, - $(go.Shape, "LineH", { stroke: "lightgray" }), - $(go.Shape, "LineV", { stroke: "lightgray" })); - setDiagramHelper("Drag a part to the Diagram or select the Wall Tool (Ctrl + 1) to begin"); - document.getElementById('gridSizeInput').value = convertPixelsToUnits(myDiagram.model.modelData.gridSize).toFixed(2); - document.getElementById('wallWidthInput').value = convertPixelsToUnits(myDiagram.model.modelData.wallWidth).toFixed(2); - loadFileToModel(document.getElementById("initialModel").value); - myDiagram.isModified = false; - updateStatistics(); - -} // end init diff --git a/extensions/GuidedDraggingTool.js b/extensions/GuidedDraggingTool.js index 59b06c480..d4f90eff2 100644 --- a/extensions/GuidedDraggingTool.js +++ b/extensions/GuidedDraggingTool.js @@ -93,11 +93,12 @@ GuidedDraggingTool.prototype.doDragOver = function(pt, obj) { // gets the selected part var partItr = (this.copiedParts || this.draggedParts).iterator; - partItr.next(); - var part = partItr.key; + if (partItr.next()) { + var part = partItr.key; - this.showHorizontalMatches(part, this.isGuidelineEnabled, false); - this.showVerticalMatches(part, this.isGuidelineEnabled, false); + this.showHorizontalMatches(part, this.isGuidelineEnabled, false); + this.showVerticalMatches(part, this.isGuidelineEnabled, false); + } } /** @@ -109,15 +110,16 @@ GuidedDraggingTool.prototype.doDragOver = function(pt, obj) { GuidedDraggingTool.prototype.doDropOnto = function(pt, obj) { // gets the selected (perhaps copied) Part var partItr = (this.copiedParts || this.draggedParts).iterator; - partItr.next(); - var part = partItr.key; + if (partItr.next()) { + var part = partItr.key; - // snaps only when the mouse is released without shift modifier - var e = this.diagram.lastInput; - var snap = this.isGuidelineSnapEnabled && !e.shift; + // snaps only when the mouse is released without shift modifier + var e = this.diagram.lastInput; + var snap = this.isGuidelineSnapEnabled && !e.shift; - this.showHorizontalMatches(part, this.isGuidelineEnabled, snap); - this.showVerticalMatches(part, this.isGuidelineEnabled, snap); + this.showHorizontalMatches(part, this.isGuidelineEnabled, snap); + this.showVerticalMatches(part, this.isGuidelineEnabled, snap); + } } /** diff --git a/extensions/LinkLabelDragging.html b/extensions/LinkLabelDragging.html index 230f1bb4d..b53660aee 100644 --- a/extensions/LinkLabelDragging.html +++ b/extensions/LinkLabelDragging.html @@ -183,6 +183,10 @@ That relative position is specified by the GraphObject.segmentOffset property. This sample also saves any changes to that property by means of a TwoWay Binding.

    +

    + See also the similar Link Label On Path Dragging sample, + where the label is constrained to remain on the path of the link. +

    Diagram Model saved in JSON format: diff --git a/extensions/LinkLabelOnPathDragging.html b/extensions/LinkLabelOnPathDragging.html new file mode 100644 index 000000000..6aaa081a4 --- /dev/null +++ b/extensions/LinkLabelOnPathDragging.html @@ -0,0 +1,111 @@ + + + + +Draggable Link Labels That Stay On Path + + + + + + + + +
    +
    +

    + This sample demonstrates a custom Tool, LinkLabelOnPathDraggingTool, that allows the user to drag the label of a Link, + but that keeps the label exactly on the path of the link. + The tool is defined at LinkLabelOnPathDraggingTool.js. +

    +

    + The label on the link can be any arbitrarily complex object. It is positioned by the GraphObject.segmentIndex + and GraphObject.segmentFraction properties, which are set by the LinkLabelOnPathDraggingTool. + TwoWay Bindings on those two properties automatically remember any modified values on the link data object in the model. +

    +

    + The tool is derived from a similar tool, LinkLabelDraggingTool.js, + that allows the user to drag the label in any direction from the mid-point of the Link path. +

    +
    + + diff --git a/extensions/LinkLabelOnPathDraggingTool.js b/extensions/LinkLabelOnPathDraggingTool.js new file mode 100644 index 000000000..c3c5d5933 --- /dev/null +++ b/extensions/LinkLabelOnPathDraggingTool.js @@ -0,0 +1,152 @@ +"use strict"; +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation. All Rights Reserved. +*/ + +// A custom Tool for moving a label on a Link that keeps the label on the link's path. + +/** +* @constructor +* @extends Tool +* @class +* This tool only works when the Link has a label marked by the "_isLinkLabel" property. +*/ +function LinkLabelOnPathDraggingTool() { + go.Tool.call(this); + this.name = "LinkLabelOnPathDragging"; + + /** @type {GraphObject} */ + this.label = null; + /** @type {number} */ + this._originalIndex = null; + /** @type {number} */ + this._originalFraction = null; +} +go.Diagram.inherit(LinkLabelOnPathDraggingTool, go.Tool); + +/** +* This tool can only start if the mouse has moved enough so that it is not a click, +* and if the mouse down point is on a GraphObject "label" in a Link Panel, +* as determined by findLabel(). +* @this {LinkLabelOnPathDraggingTool} +* @return {boolean} +*/ +LinkLabelOnPathDraggingTool.prototype.canStart = function() { + if (!go.Tool.prototype.canStart.call(this)) return false; + var diagram = this.diagram; + if (diagram === null) return false; + // require left button & that it has moved far enough away from the mouse down point, so it isn't a click + var e = diagram.lastInput; + if (!e.left) return false; + if (!this.isBeyondDragSize()) return false; + + return this.findLabel() !== null; +} + +/** +* From the GraphObject at the mouse point, search up the visual tree until we get to +* an object that has the "_isLinkLabel" property set to true and that is an immediate child of a Link Panel. +* @this {LinkLabelOnPathDraggingTool} +* @return {GraphObject} This returns null if no such label is at the mouse down point. +*/ +LinkLabelOnPathDraggingTool.prototype.findLabel = function() { + var diagram = this.diagram; + var e = diagram.lastInput; + var elt = diagram.findObjectAt(e.documentPoint, null, null); + + if (elt === null || !(elt.part instanceof go.Link)) return null; + while (elt.panel !== elt.part) { + elt = elt.panel; + } + // If it's not marked as "_isLinkLabel", don't consider it a label: + if (!elt._isLinkLabel) return null; + return elt; +}; + +/** +* Start a transaction, call findLabel and remember it as the "label" property, +* and remember the original values for the label's segment properties. +* @this {LinkLabelOnPathDraggingTool} +*/ +LinkLabelOnPathDraggingTool.prototype.doActivate = function() { + this.startTransaction("Shifted Label"); + this.label = this.findLabel(); + if (this.label !== null) { + this._originalIndex = this.label.segmentIndex; + this._originalFraction = this.label.segmentFraction; + } + go.Tool.prototype.doActivate.call(this); +} + +/** +* Stop any ongoing transaction. +* @this {LinkLabelOnPathDraggingTool} +*/ +LinkLabelOnPathDraggingTool.prototype.doDeactivate = function() { + go.Tool.prototype.doDeactivate.call(this); + this.stopTransaction(); +} + +/** +* Clear any reference to a label element. +* @this {LinkLabelOnPathDraggingTool} +*/ +LinkLabelOnPathDraggingTool.prototype.doStop = function() { + this.label = null; + go.Tool.prototype.doStop.call(this); +} + +/** +* Restore the label's original value for GraphObject.segment... properties. +* @this {LinkLabelOnPathDraggingTool} +*/ +LinkLabelOnPathDraggingTool.prototype.doCancel = function() { + if (this.label !== null) { + this.label.segmentIndex = this._originalIndex; + this.label.segmentFraction = this._originalFraction; + } + go.Tool.prototype.doCancel.call(this); +} + +/** +* During the drag, call updateSegmentOffset in order to set the segment... properties of the label. +* @this {LinkLabelOnPathDraggingTool} +*/ +LinkLabelOnPathDraggingTool.prototype.doMouseMove = function() { + if (!this.isActive) return; + this.updateSegmentOffset(); +} + +/** +* At the end of the drag, update the segment properties of the label and finish the tool, +* completing a transaction. +* @this {LinkLabelOnPathDraggingTool} +*/ +LinkLabelOnPathDraggingTool.prototype.doMouseUp = function() { + if (!this.isActive) return; + this.updateSegmentOffset(); + this.transactionResult = "Shifted Label"; + this.stopTool(); +} + +/** +* Save the label's GraphObject.segmentIndex and segmentFraction at the closest point to the mouse. +* @this {LinkLabelOnPathDraggingTool} +*/ +LinkLabelOnPathDraggingTool.prototype.updateSegmentOffset = function() { + var lab = this.label; + if (lab === null) return; + var link = lab.part; + if (!(link instanceof go.Link)) return; + + var last = this.diagram.lastInput.documentPoint; + var idx = link.findClosestSegment(last); + idx = Math.min(Math.max(link.firstPickIndex, idx), link.lastPickIndex - 1); + var p1 = link.getPoint(idx); + var p2 = link.getPoint(idx + 1); + var total = Math.sqrt(p1.distanceSquaredPoint(p2)); + var p = last.copy().projectOntoLineSegmentPoint(p1, p2); + var frac = Math.sqrt(p1.distanceSquaredPoint(p)) / total; + lab.segmentIndex = idx; + lab.segmentFraction = frac; +} diff --git a/extensions/ScrollingTable.js b/extensions/ScrollingTable.js index 664f2e814..4b5df6732 100644 --- a/extensions/ScrollingTable.js +++ b/extensions/ScrollingTable.js @@ -60,7 +60,6 @@ go.GraphObject.defineBuilder("ScrollingTable", function(args) { // an internal helper function for actually performing a scrolling operation function incrTableIndex(obj, i) { var diagram = obj.diagram; - if (diagram !== null) diagram.startTransaction("scroll"); var table = obj.panel.panel.panel.findObject(tablename); if (i === +Infinity || i === -Infinity) { // page up or down var tabh = table.actualBounds.height; @@ -74,12 +73,17 @@ go.GraphObject.defineBuilder("ScrollingTable", function(args) { var idx = table.topIndex + i; if (idx < 0) idx = 0; else if (idx >= table.rowCount - 1) idx = table.rowCount - 1; - table.topIndex = idx; - var up = table.panel.findObject("UP"); - if (up) up.visible = (idx > 0); - var down = table.panel.findObject("DOWN"); - if (down) down.visible = (idx < table.rowCount - 1); - if (diagram !== null) diagram.commitTransaction("scroll"); + if (table.topIndex !== idx) { + if (diagram !== null) diagram.startTransaction("scroll"); + table.topIndex = idx; + var node = table.part; // may need to reroute links if the table contains any ports + if (node instanceof go.Node) node.invalidateConnectedLinks(); + var up = table.panel.findObject("UP"); + if (up) up.visible = (idx > 0); + var down = table.panel.findObject("DOWN"); + if (down) down.visible = (idx < table.rowCount - 1); + if (diagram !== null) diagram.commitTransaction("scroll"); + } } return $(go.Panel, "Table", diff --git a/package.json b/package.json index 5236982b5..67d1c7eef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gojs", - "version": "1.7.7", + "version": "1.7.8", "description": "Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams", "keywords": [ "diagram", "chart", "tree", "flowchart", "orgchart", "uml", "bpmn", "graphics", "editor", "inspector", "drawing", "canvas", "shape", "svg", "hierarchy", "node", "link", "group", "vertex", "edge", "connection", "port", "label", "arrowhead", "family-tree", "decision-tree", "mindmap", "tournament", "treeview", "pipe-tree", "genogram", "ivr-tree", "parse-tree", "concept-map", "euler", "visualization", "entity-relationship", "er-diagram", "friend-wheel", "radial", "graph-distances", "graph-paths", "sankey", "pert", "gantt", "timeline", "monitor", "layer", "swimlane", "spreadsheet", "virtualization", "flow", "process", "state", "sequential-function", "grafcet", "sequence", "circuit", "record", "field", "table", "dataflow", "data-flow", "planogram", "seating", "pipes", "overview", "palette", "comment", "layout", "grid-layout", "tree-layout", "force-directed", "layered", "hierarchical", "circular", "fishbone", "ishikawa", "parallel", "serpentine", "treemap", "tree-map", "freehand", "polygon", "polyline", "bezier", "panel", "view", "model", "databinding", "data-binding", "binding", "transaction", "coordinates", "subgraph", "selection", "highlight", "tooltip", "context-menu", "tool", "command", "validation", "button", "template", "legend", "grid", "printing" ], "homepage": "https://gojs.net", diff --git a/projects/floorplanner/FloorPlanner-Templates-Furniture.js b/projects/floorplanner/FloorPlanner-Templates-Furniture.js new file mode 100644 index 000000000..931850eb7 --- /dev/null +++ b/projects/floorplanner/FloorPlanner-Templates-Furniture.js @@ -0,0 +1,200 @@ +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation +* All Rights Reserved. +* +* FLOOR PLANNER CODE: TEMPLATES - FURNITURE +* GraphObject templates for interactional furniture nodes (and their dependecies) used in the Floor Planner sample +* Includes Default Node (Furniture), MultiPurpose Node +*/ + +/* +* Furniture Node Dependencies: +* Node Tool Tip, Furniture Resize Adornment Template, Furniture Rotate Adornment Template, Invert Color +*/ + +// Node Tool Tip +function makeNodeToolTip() { + var $ = go.GraphObject.make; + return $(go.Adornment, "Auto", + $(go.Shape, { fill: "#FFFFCC" }), + $(go.TextBlock, { margin: 4 }, + new go.Binding("text", "", function (text, obj) { + var data = obj.part.adornedObject.data; + var name = (obj.part.adornedObject.category === "MultiPurposeNode") ? data.text : data.caption; + return "Name: " + name + "\nNotes: " + data.notes; + }).ofObject()) + ) +} + +// Furniture Resize Adornment +function makeFurnitureResizeAdornmentTemplate() { + var $ = go.GraphObject.make; + function makeHandle(alignment, cursor) { + return $(go.Shape, { alignment: alignment, cursor: cursor, figure: "Rectangle", desiredSize: new go.Size(7, 7), fill: "#ffffff", stroke: "#808080" }, + new go.Binding("fill", "color"), + new go.Binding("stroke", "stroke")); + } + + return $(go.Adornment, "Spot", { locationSpot: go.Spot.Center }, + $(go.Placeholder), + makeHandle(go.Spot.Top, "n-resize"), + makeHandle(go.Spot.TopRight, "n-resize"), + makeHandle(go.Spot.BottomRight, "se-resize"), + makeHandle(go.Spot.Right, "e-resize"), + makeHandle(go.Spot.Bottom, "s-resize"), + makeHandle(go.Spot.BottomLeft, "sw-resize"), + makeHandle(go.Spot.Left, "w-resize"), + makeHandle(go.Spot.TopLeft, "nw-resize") + ); +} + +// Furniture Rotate Adornment +function makeFurnitureRotateAdornmentTemplate() { + var $ = go.GraphObject.make; + return $(go.Adornment, { locationSpot: go.Spot.Center, locationObjectName: "CIRCLE" }, + $(go.Shape, "Circle", { name: "CIRCLE", cursor: "pointer", desiredSize: new go.Size(7, 7), fill: "#ffffff", stroke: "#808080" }, + new go.Binding("fill", "", function (obj) { return (obj.adornedPart === null) ? "#ffffff" : obj.adornedPart.data.color; }).ofObject(), + new go.Binding("stroke", "", function (obj) { return (obj.adornedPart === null) ? "#000000" : obj.adornedPart.data.stroke; }).ofObject()) + ); +} + +// Return inverted color (in hex) of a given hex code color; used to determine furniture node stroke color +function invertColor(hexnum) { + if (hexnum.includes('#')) hexnum = hexnum.substring(1); + if (hexnum.length != 6) { + console.error("Hex color must be six hex numbers in length."); + return false; + } + + hexnum = hexnum.toUpperCase(); + var splitnum = hexnum.split(""); + var resultnum = ""; + var simplenum = "FEDCBA9876".split(""); + var complexnum = new Array(); + complexnum.A = "5"; + complexnum.B = "4"; + complexnum.C = "3"; + complexnum.D = "2"; + complexnum.E = "1"; + complexnum.F = "0"; + + for (i = 0; i < 6; i++) { + if (!isNaN(splitnum[i])) { + resultnum += simplenum[splitnum[i]]; + } else if (complexnum[splitnum[i]]) { + resultnum += complexnum[splitnum[i]]; + } else { + console.error("Hex colors must only include hex numbers 0-9, and A-F"); + return false; + } + } + return '#' + resultnum; +} + +/* +* Furniture Node Templates: +* Default Node, MultiPurpose Node +*/ + +// Default Node +function makeDefaultNode() { + var $ = go.GraphObject.make; + return $(go.Node, "Spot", + { + resizable: true, + rotatable: true, + toolTip: makeNodeToolTip(), + resizeAdornmentTemplate: makeFurnitureResizeAdornmentTemplate(), + rotateAdornmentTemplate: makeFurnitureRotateAdornmentTemplate(), + contextMenu: makeContextMenu(), + locationObjectName: "SHAPE", + resizeObjectName: "SHAPE", + rotateObjectName: "SHAPE", + minSize: new go.Size(5, 5), + locationSpot: go.Spot.Center, + selectionAdorned: false, // use a Binding on the Shape.stroke to show selection + doubleClick: function (e) { + if (e.diagram.floorplanUI) e.diagram.floorplanUI.hideShow("selectionInfoWindow") + } + }, + // remember Node location + new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), + // move selected Node to Foreground layer so it's not obscuerd by non-selected Parts + new go.Binding("layerName", "isSelected", function (s) { + return s ? "Foreground" : ""; + }).ofObject(), + $(go.Shape, + { + strokeWidth: 1, + name: "SHAPE", + stroke: "#000000", + geometryString: "F1 M0 0 L20 0 20 20 0 20 z", + fill: "rgba(128, 128, 128, 0.5)" + }, + new go.Binding("geometryString", "geo"), + new go.Binding("width", "width").makeTwoWay(), + new go.Binding("height", "height").makeTwoWay(), + new go.Binding("angle", "angle").makeTwoWay(), + new go.Binding("figure", "shape").makeTwoWay(), + new go.Binding("stroke", "isSelected", function (s, obj) { + return s ? go.Brush.lightenBy(obj.stroke, .5) : invertColor(obj.part.data.color); + }).ofObject(), + new go.Binding("fill", "color")) + ) +} + +// MultiPurpose Node +function makeMultiPurposeNode() { + var $ = go.GraphObject.make; + return $(go.Node, "Spot", + { + contextMenu: makeContextMenu(), + toolTip: makeNodeToolTip(), + locationSpot: go.Spot.Center, + resizeAdornmentTemplate: makeFurnitureResizeAdornmentTemplate(), + rotateAdornmentTemplate: makeFurnitureRotateAdornmentTemplate(), + locationObjectName: "SHAPE", + resizable: true, + rotatable: true, + resizeObjectName: "SHAPE", + rotateObjectName: "SHAPE", + minSize: new go.Size(5, 5), + selectionAdorned: false, + doubleClick: function (e) { + if (e.diagram.floorplanUI) e.diagram.floorplanUI.hideShow("selectionInfoWindow") + } + }, + // remember location, angle, height, and width of the node + new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), + // move a selected part into the Foreground layer so it's not obscuerd by non-selected Parts + new go.Binding("layerName", "isSelected", function (s) { return s ? "Foreground" : ""; }).ofObject(), + $(go.Shape, + { strokeWidth: 1, name: "SHAPE", fill: "rgba(128, 128, 128, 0.5)", }, + new go.Binding("angle", "angle").makeTwoWay(), + new go.Binding("width", "width").makeTwoWay(), + new go.Binding("height", "height").makeTwoWay(), + new go.Binding("stroke", "isSelected", function (s, obj) { + return s ? go.Brush.lightenBy(obj.stroke, .5) : invertColor(obj.part.data.color); + }).ofObject(), + new go.Binding("fill", "color")), + $(go.TextBlock, + { + margin: 5, + wrap: go.TextBlock.WrapFit, + textAlign: "center", + editable: true, + isMultiline: false, + stroke: '#454545', + font: "10pt sans-serif" + }, + new go.Binding("text").makeTwoWay(), + new go.Binding("angle", "angle").makeTwoWay(), + new go.Binding("font", "height", function (height) { + if (height > 25) return "10pt sans-serif"; + if (height < 25 && height > 15) return "8pt sans-serif"; + else return "6pt sans-serif"; + }), + new go.Binding("stroke", "color", function (color) { return invertColor(color); }) + ) + ) +} \ No newline at end of file diff --git a/projects/floorplanner/FloorPlanner-Templates-General.js b/projects/floorplanner/FloorPlanner-Templates-General.js new file mode 100644 index 000000000..d9932e3ad --- /dev/null +++ b/projects/floorplanner/FloorPlanner-Templates-General.js @@ -0,0 +1,390 @@ +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation +* All Rights Reserved. +* +* FLOOR PLANNER CODE: TEMPLATES - GENERAL +* General GraphObject templates used in the Floor Planner sample +* Includes Context Menu, Diagram, Default Group, AngleNode, DimensionLink, PointNode +*/ + +/* +* Dependencies for Context Menu: +* Make Selection Group, Ungroup Selection, Clear Empty Groups +*/ + +// Make the selection a group +function makeSelectionGroup(floorplan) { + floorplan.startTransaction("group selection"); + // ungroup all selected nodes; then group them; if one of the selected nodes is a group, ungroup all its nodes + var sel = floorplan.selection; var nodes = []; + sel.iterator.each(function (n) { + if (n instanceof go.Group) n.memberParts.iterator.each(function (part) { nodes.push(part); }) + else nodes.push(n); + }); + for (var i = 0; i < nodes.length; i++) nodes[i].isSelected = true; + ungroupSelection(floorplan); + floorplan.commandHandler.groupSelection(); + var group = floorplan.selection.first(); // after grouping, the new group will be the only thing selected + floorplan.model.setDataProperty(group.data, "caption", "Group"); + floorplan.model.setDataProperty(group.data, "notes", ""); + clearEmptyGroups(floorplan); + // unselect / reselect group so data appears properly in Selection Info Window + floorplan.clearSelection(); + floorplan.select(group); + floorplan.commitTransaction("group selection"); +} + +// Ungroup selected nodes; if the selection is a group, ungroup all it's memberParts +function ungroupSelection(floorplan) { + floorplan.startTransaction('ungroup selection'); + // helper function to ungroup nodes + function ungroupNode(node) { + var group = node.containingGroup; + node.containingGroup = null; + if (group != null) { + if (group.memberParts.count === 0) floorplan.remove(group); + else if (group.memberParts.count === 1) group.memberParts.first().containingGroup = null; + } + } + // ungroup any selected nodes; remember groups that are selected + var sel = floorplan.selection; var groups = []; + sel.iterator.each(function (n) { + if (!(n instanceof go.Group)) ungroupNode(n); + else groups.push(n); + }); + // go through selected groups, and ungroup their memberparts too + var nodes = []; + for (var i = 0; i < groups.length; i++) groups[i].memberParts.iterator.each(function (n) { nodes.push(n); }); + for (var i = 0; i < nodes.length; i++) ungroupNode(nodes[i]); + clearEmptyGroups(floorplan); + floorplan.commitTransaction('ungroup selection'); +} + +// Clear all the groups that have no nodes +function clearEmptyGroups(floorplan) { + var nodes = floorplan.nodes; var arr = []; + nodes.iterator.each(function (node) { if (node instanceof go.Group && node.memberParts.count === 0 && node.category !== "WallGroup") { arr.push(node); } }); + for (i = 0; i < arr.length; i++) { floorplan.remove(arr[i]); } +} + +/* +* General Group Dependencies: +* Group Tool Tip +*/ + +// Group Tool Tip +function makeGroupToolTip() { + var $ = go.GraphObject.make; + return $(go.Adornment, "Auto", + $(go.Shape, { fill: "#FFFFCC" }), + $(go.TextBlock, { margin: 4 }, + new go.Binding("text", "", function (text, obj) { + var data = obj.part.adornedObject.data; + var name = (obj.part.adornedObject.category === "MultiPurposeNode") ? data.text : data.caption; + return "Name: " + name + "\nNotes: " + data.notes + '\nMembers: ' + obj.part.adornedObject.memberParts.count; + }).ofObject()) + ); +} + +/* +* General Templates: +* Context Menu, Default Group +*/ + +// Context Menu -- referenced by Node, Diagram and Group Templates +function makeContextMenu() { + var $ = go.GraphObject.make + return $(go.Adornment, "Vertical", + // Make Selection Group Button + $("ContextMenuButton", + $(go.TextBlock, "Make Group"), + { click: function (e, obj) { makeSelectionGroup(obj.part.diagram); } }, + new go.Binding("visible", "visible", function (v, obj) { + var floorplan = obj.part.diagram; + if (floorplan.selection.count <= 1) return false; + var flag = true; + floorplan.selection.iterator.each(function (node) { + if (node.category === "WallGroup" || node.category === "WindowNode" || node.category === "DoorNode") flag = false; + }); + return flag; + }).ofObject() + ), + // Ungroup Selection Button + $("ContextMenuButton", + $(go.TextBlock, "Ungroup"), + { click: function (e, obj) { ungroupSelection(obj.part.diagram); } }, + new go.Binding("visible", "", function (v, obj) { + var floorplan = obj.part.diagram; + if (floorplan !== null) { + var node = floorplan.selection.first(); + return ((node instanceof go.Node && node.containingGroup != null && node.containingGroup.category != 'WallGroup') || + (node instanceof go.Group && node.category === '')); + } return false; + }).ofObject() + ), + // Copy Button + $("ContextMenuButton", + $(go.TextBlock, "Copy"), + { click: function (e, obj) { obj.part.diagram.commandHandler.copySelection() } }, + new go.Binding("visible", "", function (v, obj) { + if (obj.part.diagram !== null) { + return obj.part.diagram.selection.count > 0; + } return false; + }).ofObject() + ), + // Cut Button + $("ContextMenuButton", + $(go.TextBlock, "Cut"), + { click: function (e, obj) { obj.part.diagram.commandHandler.cutSelection() } }, + new go.Binding("visible", "", function (v, obj) { + if (obj.part.diagram !== null) { + return obj.part.diagram.selection.count > 0; + } return false; + }).ofObject() + ), + // Delete Button + $("ContextMenuButton", + $(go.TextBlock, "Delete"), + { click: function (e, obj) { obj.part.diagram.commandHandler.deleteSelection() } }, + new go.Binding("visible", "", function (v, obj) { + if (obj.part.diagram !== null) { + return obj.part.diagram.selection.count > 0; + } return false; + }).ofObject() + ), + // Paste Button + $("ContextMenuButton", + $(go.TextBlock, "Paste"), + { click: function (e, obj) { obj.part.diagram.commandHandler.pasteSelection(obj.part.diagram.lastInput.documentPoint) } } + ), + // Show Selection Info Button (only available when selection count > 0) + $("ContextMenuButton", + $(go.TextBlock, "Show Selection Info"), + { + click: function (e, obj) { + if (e.diagram.floorplanUI) { + var selectionInfoWindow = document.getElementById(e.diagram.floorplanUI.state.windows.selectionInfoWindow.id); + if (selectionInfoWindow.style.visibility !== 'visible') e.diagram.floorplanUI.hideShow('selectionInfoWindow'); + } + } + }, + new go.Binding("visible", "", function (v, obj) { + if (obj.part.diagram !== null) { + return obj.part.diagram.selection.count > 0; + } return false; + }).ofObject() + ), + // Flip Dimension Side Button (only available when selection contains Wall Group(s)) + $("ContextMenuButton", + $(go.TextBlock, "Flip Dimension Side"), + { + click: function (e, obj) { + var floorplan = obj.part.diagram; + if (floorplan !== null) { + floorplan.startTransaction("flip dimension link side"); + var walls = []; + floorplan.selection.iterator.each(function (part) { + if (part.category === "WallGroup") walls.push(part); + }); + for (var i = 0; i < walls.length; i++) { + var wall = walls[i]; + var sPt = wall.data.startpoint.copy(); + var ePt = wall.data.endpoint.copy(); + floorplan.model.setDataProperty(wall.data, "startpoint", ePt); + floorplan.model.setDataProperty(wall.data, "endpoint", sPt); + floorplan.updateWall(wall); + } + floorplan.commitTransaction("flip dimension link side"); + } + } + }, + new go.Binding("visible", "", function (v, obj) { + if (obj.part.diagram !== null) { + var sel = obj.part.diagram.selection; + if (sel.count === 0) return false; + var flag = false; + sel.iterator.each(function (part) { + if (part.category === "WallGroup") flag = true; + }); + return flag; + } return false; + }).ofObject() + ) + ); +} + +// Default Group +function makeDefaultGroup() { + var $ = go.GraphObject.make; + return $(go.Group, "Vertical", + { + contextMenu: makeContextMenu(), + doubleClick: function (e) { + if (e.diagram.floorplanUI) e.diagram.floorplanUI.hideShow("selectionInfoWindow"); + }, + toolTip: makeGroupToolTip() + }, + new go.Binding("location", "loc"), + $(go.Panel, "Auto", + $(go.Shape, "RoundedRectangle", { fill: "rgba(128,128,128,0.15)", stroke: 'rgba(128, 128, 128, .05)', name: 'SHAPE', strokeCap: 'square' }, + new go.Binding("fill", "isSelected", function (s, obj) { + return s ? "rgba(128, 128, 128, .15)" : "rgba(128, 128, 128, 0.10)"; + }).ofObject() + ), + $(go.Placeholder, { padding: 5 }) // extra padding around group members + ) + ) +} + +/* +* Dependencies for Angle Nodes: +* Make Arc +*/ + +// Return arc geometry for Angle Nodes +function makeArc(node) { + var ang = node.data.angle; + var sweep = node.data.sweep; + var rad = Math.min(30, node.data.maxRadius); + if (typeof sweep === "number" && sweep > 0) { + var start = new go.Point(rad, 0).rotate(ang); + // this is much more efficient than calling go.GraphObject.make: + return new go.Geometry() + .add(new go.PathFigure(start.x + rad, start.y + rad) // start point + .add(new go.PathSegment(go.PathSegment.Arc, + ang, sweep, // angles + rad, rad, // center + rad, rad) // radius + )) + .add(new go.PathFigure(0, 0)) + .add(new go.PathFigure(2 * rad, 2 * rad)); + } else { // make sure this arc always occupies the same circular area of RAD radius + return new go.Geometry() + .add(new go.PathFigure(0, 0)) + .add(new go.PathFigure(2 * rad, 2 * rad)); + } +} + +/* +* Dependencies for Dimension Links +* Make Point Node +*/ + +// Return a Point Node (used for Dimension Links) +function makePointNode() { + var $ = go.GraphObject.make + return $(go.Node, "Position", new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify)); +} + +/* +* Dynamically appearing parts: +* Angle Node, Dimension Link +*/ + +// Return an Angle Node (for each angle ndeeded in the diagram, one angle node is made) +function makeAngleNode() { + var $ = go.GraphObject.make; + return $(go.Node, "Spot", + { locationSpot: go.Spot.Center, locationObjectName: "SHAPE", selectionAdorned: false }, + new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), + $(go.Shape, "Circle", // placed where walls intersect, is invisible + { name: "SHAPE", fill: "red", height: 0, width: 0 }), + $(go.Shape, // arc + { stroke: "green", strokeWidth: 1.5, fill: null }, + new go.Binding("geometry", "", makeArc).ofObject(), + new go.Binding("stroke", "sweep", function (sweep) { + return (sweep % 45 < 1 || sweep % 45 > 44) ? "dodgerblue" : "lightblue"; + })), + // Arc label panel + $(go.Panel, "Auto", + { name: "ARCLABEL" }, + // position the label in the center of the arc + new go.Binding("alignment", "sweep", function (sweep, panel) { + var rad = Math.min(30, panel.part.data.maxRadius); + var angle = panel.part.data.angle; + var cntr = new go.Point(rad, 0).rotate(angle + sweep / 2); + return new go.Spot(0.5, 0.5, cntr.x, cntr.y); + }), + // rectangle containing angle text + $(go.Shape, + { stroke: "black", fill: "white" }, + new go.Binding("stroke", "sweep", function (sweep) { + return (sweep % 45 < 1 || sweep % 45 > 44) ? "dodgerblue" : "lightblue"; + })), + // angle text + $(go.TextBlock, + { font: "7pt sans-serif", margin: new go.Margin(2, 2, 2, 2) }, + new go.Binding("text", "sweep", function (sweep) { + return sweep.toFixed(2) + String.fromCharCode(176); + }), + new go.Binding("stroke", "color")) + ) + ); +} + +// Returns a Dimension Link +function makeDimensionLink() { + var $ = go.GraphObject.make + return $(go.Link, + { locationSpot: go.Spot.TopLeft }, + // link itself + $(go.Shape, + { stroke: "gray", strokeWidth: 2, name: 'SHAPE' }), + // to arrow shape + $(go.Shape, + { toArrow: "OpenTriangle", stroke: "gray", strokeWidth: 2 }), + $(go.Shape, + // from arrow shape + { fromArrow: "BackwardOpenTriangle", stroke: "gray", strokeWidth: 2 }), + // dimension link text + $(go.TextBlock, + { text: 'sometext', segmentOffset: new go.Point(0, -10), font: "13px sans-serif" }, + new go.Binding("text", "", function (link) { + var floorplan = link.diagram; + if (floorplan) { + var fromPtNode = null; var toPtNode = null; + floorplan.pointNodes.iterator.each(function (node) { + if (node.data.key === link.data.from) fromPtNode = node; + if (node.data.key === link.data.to) toPtNode = node; + }); + if (fromPtNode !== null) { + var fromPt = fromPtNode.location; + var toPt = toPtNode.location; + return floorplan.convertPixelsToUnits(Math.sqrt(fromPt.distanceSquaredPoint(toPt))).toFixed(2) + floorplan.model.modelData.unitsAbbreviation; + } return null; + } return null; + }).ofObject(), + // bind angle of textblock to angle of link -- always make text rightside up and readable + new go.Binding("angle", "angle", function (angle, link) { + if (angle > 90 && angle < 270) return (angle + 180) % 360; + return angle; + }), + // default poisiton text above / below dimension link based on angle + new go.Binding("segmentOffset", "angle", function (angle, textblock) { + var floorplan = textblock.part.diagram; + if (floorplan) { + var wall = floorplan.findPartForKey(textblock.part.data.wall); + if (wall.rotateObject.angle > 135 && wall.rotateObject.angle < 315) return new go.Point(0, 10); + return new go.Point(0, -10); + } return new go.Point(0,0); + }).ofObject(), + // scale font size according to the length of the link + new go.Binding("font", "", function (link) { + var floorplan = link.diagram; + var fromPtNode = null; var toPtNode = null; + floorplan.pointNodes.iterator.each(function (node) { + if (node.data.key === link.data.from) fromPtNode = node; + if (node.data.key === link.data.to) toPtNode = node; + }); + if (fromPtNode !== null) { + var fromPt = fromPtNode.location; + var toPt = toPtNode.location; + var distance = Math.sqrt(fromPt.distanceSquaredPoint(toPt)); + if (distance > 40) return "13px sans-serif"; + if (distance <= 40 && distance >= 20) return "11px sans-serif"; + else return "9px sans-serif"; + } return "13px sans-serif"; + }).ofObject() + ) + ) +} \ No newline at end of file diff --git a/projects/floorplanner/FloorPlanner-Templates-Walls.js b/projects/floorplanner/FloorPlanner-Templates-Walls.js new file mode 100644 index 000000000..9b9a870b0 --- /dev/null +++ b/projects/floorplanner/FloorPlanner-Templates-Walls.js @@ -0,0 +1,482 @@ +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation +* All Rights Reserved. +* +* FLOOR PLANNER CODE: TEMPLATES - WALLS +* GraphObject templates for interactional Wall Groups, Wall Part Nodes (and their dependecies) used in the Floor Planner sample +* Includes Wall Group, Palette Wall Node, Window Node, Door Node +*/ + +/* +* Wall Group Dependencies: +* Snap Walls, Find Closest Loc on Wall, Add Wall Part, Wall Part Drag Over, Wall Part Drag Away +*/ + +// Drag computation function to snap walls to the grid properly while dragging +var snapWalls = function (part, pt, gridPt) { + var floorplan = part.diagram; + floorplan.updateWallDimensions(); + floorplan.updateWallAngles(); + var grid = part.diagram.grid; + var sPt = part.data.startpoint.copy(); + var ePt = part.data.endpoint.copy(); + var dx = pt.x - part.location.x; + var dy = pt.y - part.location.y; + var newSpt = sPt.offset(dx, dy); + var newEpt = ePt.offset(dx, dy); + if (floorplan.toolManager.draggingTool.isGridSnapEnabled) { + newSpt = newSpt.snapToGridPoint(grid.gridOrigin, grid.gridCellSize); + newEpt = newEpt.snapToGridPoint(grid.gridOrigin, grid.gridCellSize); + } + floorplan.model.setDataProperty(part.data, "startpoint", newSpt); + floorplan.model.setDataProperty(part.data, "endpoint", newEpt); + return new go.Point((newSpt.x + newEpt.x) / 2, (newSpt.y + newEpt.y) / 2); +} + +// Used in addWallPart; find closest loc (to mousept) on wall a wallPart can be dropped onto without extending beyond wall endpoints or intruding into another wallPart +function findClosestLocOnWall(wall, part) { + var orderedConstrainingPts = []; // wall endpoints and wallPart endpoints + var startpoint = wall.data.startpoint.copy(); + var endpoint = wall.data.endpoint.copy(); + // store all possible constraining endpoints (wall endpoints and wallPart endpoints) in the order in which they appear (left/top to right/bottom) + var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; + var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; + var wallPartEndpoints = []; + wall.memberParts.iterator.each(function (wallPart) { + var endpoints = getWallPartEndpoints(wallPart); + wallPartEndpoints.push(endpoints[0]); + wallPartEndpoints.push(endpoints[1]); + }); + // sort all wallPartEndpoints by x coordinate left to right + wallPartEndpoints.sort(function (a, b) { + if ((a.x + a.y) > (b.x + b.y)) return 1; + if ((a.x + a.y) < (b.x + b.y)) return -1; + else return 0; + }); + orderedConstrainingPts.push(firstWallPt); + orderedConstrainingPts = orderedConstrainingPts.concat(wallPartEndpoints); + orderedConstrainingPts.push(lastWallPt); + + // go through all constraining points; if there's a free stretch along the wall "part" could fit in, remember it + var possibleStretches = []; + for (var i = 0; i < orderedConstrainingPts.length; i += 2) { + var point1 = orderedConstrainingPts[i]; + var point2 = orderedConstrainingPts[i + 1]; + var distanceBetween = Math.sqrt(point1.distanceSquaredPoint(point2)); + if (distanceBetween >= part.data.width) possibleStretches.push({ pt1: point1, pt2: point2 }); + } + + // go through all possible stretches along the wall the part *could* fit in; find the one closest to the part's current location + var closestDist = Number.MAX_VALUE; var closestStretch = null; + for (var i = 0; i < possibleStretches.length; i++) { + var testStretch = possibleStretches[i]; + var testPoint1 = testStretch.pt1; + var testPoint2 = testStretch.pt2; + var testDistance1 = Math.sqrt(testPoint1.distanceSquaredPoint(part.location)); + var testDistance2 = Math.sqrt(testPoint2.distanceSquaredPoint(part.location)); + if (testDistance1 < closestDist) { + closestDist = testDistance1; + closestStretch = testStretch; + } + if (testDistance2 < closestDist) { + closestDist = testDistance2; + closestStretch = testStretch; + } + } + + // Edge Case: If there's no space for the wallPart, return null + if (closestStretch === null) return null; + + // using the closest free stretch along the wall, calculate endpoints that make the stretch's line segment, then project part.location onto the segment + var closestStretchLength = Math.sqrt(closestStretch.pt1.distanceSquaredPoint(closestStretch.pt2)); + var offset = part.data.width / 2; + var point1 = new go.Point(closestStretch.pt1.x + ((offset / closestStretchLength) * (closestStretch.pt2.x - closestStretch.pt1.x)), + closestStretch.pt1.y + ((offset / closestStretchLength) * (closestStretch.pt2.y - closestStretch.pt1.y))); + var point2 = new go.Point(closestStretch.pt2.x + ((offset / closestStretchLength) * (closestStretch.pt1.x - closestStretch.pt2.x)), + closestStretch.pt2.y + ((offset / closestStretchLength) * (closestStretch.pt1.y - closestStretch.pt2.y))); + var newLoc = part.location.copy().projectOntoLineSegmentPoint(point1, point2); + return newLoc; +} + +// MouseDrop event for wall groups; if a door or window is dropped on a wall, add it to the wall group +// Do not allow dropping wallParts that would extend beyond wall endpoints or intrude into another wallPart +var addWallPart = function (e, wall) { + var floorplan = e.diagram; + var wallPart = floorplan.selection.first(); + if ((wallPart && (wallPart.category === "WindowNode" || wallPart.category === "DoorNode") && wallPart.containingGroup === null)) { + var newLoc = findClosestLocOnWall(wall, wallPart); + if (newLoc !== null) { + wall.findObject("SHAPE").stroke = "black"; + floorplan.model.setDataProperty(wallPart.data, "group", wall.data.key); + wallPart.location = newLoc.projectOntoLineSegmentPoint(wall.data.startpoint, wall.data.endpoint); + wallPart.angle = wall.rotateObject.angle; + if (wallPart.category === "WindowNode") floorplan.model.setDataProperty(wallPart.data, "height", wall.data.strokeWidth); + if (wallPart.category === "DoorNode") floorplan.model.setDataProperty(wallPart.data, "doorOpeningHeight", wall.data.strokeWidth); + } else { + floorplan.remove(wallPart); + alert("There's not enough room on the wall!"); + return; + } + } + if (floorplan.floorplanUI) floorplan.floorplanUI.setSelectionInfo(floorplan.selection.first(), floorplan); + floorplan.updateWallDimensions(); +} + +// MouseDragEnter event for walls; if a door or window is dragged over a wall, highlight the wall and change its angle +var wallPartDragOver = function (e, wall) { + var floorplan = e.diagram; + var parts = floorplan.toolManager.draggingTool.draggingParts; + parts.iterator.each(function (part) { + if ((part.category === "WindowNode" || part.category === "DoorNode") && part.containingGroup === null) { + wall.findObject("SHAPE").stroke = "lightblue"; + part.angle = wall.rotateObject.angle; + } + }); +} + +// MouseDragLeave event for walls; if a wall part is dragged past a wall, unhighlight the wall and change back the wall part's angle to 0 +var wallPartDragAway = function (e, wall) { + var floorplan = e.diagram; + wall.findObject("SHAPE").stroke = "black"; + var parts = floorplan.toolManager.draggingTool.draggingParts; + parts.iterator.each(function (part) { + if ((part.category === "WindowNode" || part.category === "DoorNode") && part.containingGroup === null) part.angle = 0 + }); +} + +/* +* Wall Group Template +*/ + +// Wall Group +function makeWallGroup() { + var $ = go.GraphObject.make; + return $(go.Group, "Spot", + { + contextMenu: makeContextMenu(), + toolTip: makeGroupToolTip(), + selectionObjectName: "SHAPE", + rotateObjectName: "SHAPE", + locationSpot: go.Spot.Center, + reshapable: true, + minSize: new go.Size(1, 1), + dragComputation: snapWalls, + selectionAdorned: false, + mouseDrop: addWallPart, + mouseDragEnter: wallPartDragOver, + mouseDragLeave: wallPartDragAway, + doubleClick: function (e) { if (e.diagram.floorplanUI) e.diagram.floorplanUI.hideShow("selectionInfoWindow"); } + }, + $(go.Shape, + { + strokeWidth: 1, + name: "SHAPE", + fill: "black", + stroke: "red", + geometry: new go.Geometry(go.Geometry.Line), + isGeometryPositioned: true + }, + new go.Binding("strokeWidth", "strokeWidth"), + new go.Binding("stroke", "isSelected", function (s, obj) { + if (obj.part.containingGroup != null) { + var group = obj.part.containingGroup; + if (s) { group.data.isSelected = true; } + } + return s ? "dodgerblue" : "black"; + }).ofObject() + )) +} + +/* +* Wall Part Node Dependencies: +* Get Wall Part Endpoints, Get Wall Part Stretch, +* Drag Wall Parts (Drag Comp. Function), Wall Part Resize Adornment, Door Selection Adornment (Door Nodes only) +*/ + +// Find and return an array of the endpoints of a given wallpart (window or door) +function getWallPartEndpoints(wallPart) { + var loc = wallPart.location; + var partLength = wallPart.data.width; + if (wallPart.containingGroup !== null) var angle = wallPart.containingGroup.rotateObject.angle; + else var angle = 180; + var point1 = new go.Point((loc.x + (partLength / 2)), loc.y); + var point2 = new go.Point((loc.x - (partLength / 2)), loc.y); + point1.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y); + point2.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y); + var arr = []; arr.push(point1); arr.push(point2); + return arr; +} + +// Returns a "stretch" (2 Points) that constrains a wallPart (door or window) +// This stretch is comprised of either "part"'s containing wall endpoints or other wallPart endpoints +function getWallPartStretch(part) { + var wall = part.containingGroup; + var startpoint = wall.data.startpoint.copy(); + var endpoint = wall.data.endpoint.copy(); + + // sort all possible endpoints into either left/above or right/below + var leftOrAbove = new go.Set(go.Point); var rightOrBelow = new go.Set(go.Point); + wall.memberParts.iterator.each(function (wallPart) { + if (wallPart.data.key !== part.data.key) { + var endpoints = getWallPartEndpoints(wallPart); + for (var i = 0; i < endpoints.length; i++) { + if (endpoints[i].x < part.location.x || (endpoints[i].y > part.location.y && endpoints[i].x === part.location.x)) leftOrAbove.add(endpoints[i]); + else rightOrBelow.add(endpoints[i]); + } + } + }); + + // do the same with the startpoint and endpoint of the dragging part's wall + if (parseFloat(startpoint.x.toFixed(2)) < parseFloat(part.location.x.toFixed(2)) || (startpoint.y > part.location.y && parseFloat(startpoint.x.toFixed(2)) === parseFloat(part.location.x.toFixed(2)))) leftOrAbove.add(startpoint); + else rightOrBelow.add(startpoint); + if (parseFloat(endpoint.x.toFixed(2)) < parseFloat(part.location.x.toFixed(2)) || (endpoint.y > part.location.y && parseFloat(endpoint.x.toFixed(2)) === parseFloat(part.location.x.toFixed(2)))) leftOrAbove.add(endpoint); + else rightOrBelow.add(endpoint); + + // of each set, find the closest point to the dragging part + var leftOrAbovePt; var closestDistLeftOrAbove = Number.MAX_VALUE; + leftOrAbove.iterator.each(function (point) { + var distance = Math.sqrt(point.distanceSquaredPoint(part.location)); + if (distance < closestDistLeftOrAbove) { + closestDistLeftOrAbove = distance; + leftOrAbovePt = point; + } + }); + var rightOrBelowPt; var closestDistRightOrBelow = Number.MAX_VALUE; + rightOrBelow.iterator.each(function (point) { + var distance = Math.sqrt(point.distanceSquaredPoint(part.location)); + if (distance < closestDistRightOrBelow) { + closestDistRightOrBelow = distance; + rightOrBelowPt = point; + } + }); + + var stretch = { point1: leftOrAbovePt, point2: rightOrBelowPt }; + return stretch; +} + +// Drag computation function for WindowNodes and DoorNodes; ensure wall parts stay in walls when dragged +var dragWallParts = function (part, pt, gridPt) { + if (part.containingGroup !== null && part.containingGroup.category === 'WallGroup') { + var floorplan = part.diagram; + // Edge Case: if part is not on its wall (due to incorrect load) snap part.loc onto its wall immediately; ideally this is never called + var wall = part.containingGroup; + var wStart = wall.data.startpoint; + var wEnd = wall.data.endpoint; + var dist1 = Math.sqrt(wStart.distanceSquaredPoint(part.location)); + var dist2 = Math.sqrt(part.location.distanceSquaredPoint(wEnd)); + var totalDist = Math.sqrt(wStart.distanceSquaredPoint(wEnd)); + if (dist1 + dist2 !== totalDist) part.location = part.location.copy().projectOntoLineSegmentPoint(wStart, wEnd); + + // main behavior + var stretch = getWallPartStretch(part); + var leftOrAbovePt = stretch.point1; + var rightOrBelowPt = stretch.point2; + + // calc points along line created by the endpoints that are half the width of the moving window/door + var totalLength = Math.sqrt(leftOrAbovePt.distanceSquaredPoint(rightOrBelowPt)); + var distance = (part.data.width / 2); + var point1 = new go.Point(leftOrAbovePt.x + ((distance / totalLength) * (rightOrBelowPt.x - leftOrAbovePt.x)), + leftOrAbovePt.y + ((distance / totalLength) * (rightOrBelowPt.y - leftOrAbovePt.y))); + var point2 = new go.Point(rightOrBelowPt.x + ((distance / totalLength) * (leftOrAbovePt.x - rightOrBelowPt.x)), + rightOrBelowPt.y + ((distance / totalLength) * (leftOrAbovePt.y - rightOrBelowPt.y))); + + // calc distance from pt to line (part's wall) - use point to 2pt line segment distance formula + var distFromWall = Math.abs(((wEnd.y - wStart.y) * pt.x) - ((wEnd.x - wStart.x) * pt.y) + (wEnd.x * wStart.y) - (wEnd.y * wStart.x)) / + Math.sqrt(Math.pow((wEnd.y - wStart.y), 2) + Math.pow((wEnd.x - wStart.x), 2)); + var tolerance = (20 * wall.data.strokeWidth < 100) ? (20 * wall.data.strokeWidth) : 100; + + // if distance from pt to line > some tolerance, detach the wallPart from the wall + if (distFromWall > tolerance) { + part.containingGroup = null; + part.angle = 0; + allPointNodes.iterator.each(function (node) { floorplan.remove(node) }); + allDimensionLinks.iterator.each(function (link) { floorplan.remove(link) }); + allPointNodes.clear(); + allDimensionLinks.clear(); + floorplan.updateWallDimensions(); + } + + // project the proposed location onto the line segment created by the new points (ensures wall parts are constrained properly when dragged) + pt = pt.copy().projectOntoLineSegmentPoint(point1, point2); + floorplan.skipsUndoManager = true; + floorplan.startTransaction("set loc"); + floorplan.model.setDataProperty(part.data, "loc", go.Point.stringify(pt)); + floorplan.commitTransaction("set loc"); + floorplan.skipsUndoManager = false; + + floorplan.updateWallDimensions(); // update the dimension links created by having this wall part selected + } return pt; +} + +// Resize Adornment for Wall Part Nodes +function makeWallPartResizeAdornment() { + var $ = go.GraphObject.make; + return $(go.Adornment, "Spot", + { name: "WallPartResizeAdornment", locationSpot: go.Spot.Center }, + $(go.Placeholder), + $(go.Shape, { alignment: go.Spot.Left, cursor: "w-resize", figure: "Diamond", desiredSize: new go.Size(7, 7), fill: "#ffffff", stroke: "#808080" }), + $(go.Shape, { alignment: go.Spot.Right, cursor: "e-resize", figure: "Diamond", desiredSize: new go.Size(7, 7), fill: "#ffffff", stroke: "#808080" }) + ); +} + +// Selection Adornment for Door Nodes +function makeDoorSelectionAdornment() { + var $ = go.GraphObject.make; + return $(go.Adornment, "Vertical", + { name: "DoorSelectionAdornment" }, + $(go.Panel, "Auto", + $(go.Shape, { fill: null, stroke: null }), + $(go.Placeholder)), + $(go.Panel, "Horizontal", { defaultStretch: go.GraphObject.Vertical }, + $("Button", + $(go.Picture, { source: "icons/flipDoorOpeningLeft.png", column: 0, desiredSize: new go.Size(12, 12) }, + new go.Binding("source", "", function (obj) { + if (obj.adornedPart === null) return "icons/flipDoorOpeningRight.png"; + else if (obj.adornedPart.data.swing === "left") return "icons/flipDoorOpeningRight.png"; + else return "icons/flipDoorOpeningLeft.png"; + }).ofObject() + ), + { + click: function (e, obj) { + var floorplan = obj.part.diagram; + floorplan.startTransaction("flip door"); + var door = obj.part.adornedPart; + if (door.data.swing === "left") floorplan.model.setDataProperty(door.data, "swing", "right"); + else floorplan.model.setDataProperty(door.data, "swing", "left"); + floorplan.commitTransaction("flip door"); + }, + toolTip: $(go.Adornment, "Auto", + $(go.Shape, { fill: "#FFFFCC" }), + $(go.TextBlock, { margin: 4, text: "Flip Door Opening" } + )) + }, + new go.Binding("visible", "", function (obj) { return (obj.adornedPart === null) ? false : (obj.adornedPart.containingGroup !== null); }).ofObject() + ), + $("Button", + $(go.Picture, { source: "icons/flipDoorSide.png", column: 0, desiredSize: new go.Size(12, 12) }), + { + click: function (e, obj) { + var floorplan = obj.part.diagram; + floorplan.startTransaction("rotate door"); + var door = obj.part.adornedPart; + door.angle = (door.angle + 180) % 360; + floorplan.commitTransaction("rotate door"); + }, + toolTip: $(go.Adornment, "Auto", + $(go.Shape, { fill: "#FFFFCC" }), + $(go.TextBlock, { margin: 4, text: "Flip Door Side" } + )) + } + ), + new go.Binding("visible", "", function (obj) { return (obj.adornedPart === null) ? false : (obj.adornedPart.containingGroup !== null); }).ofObject() + ) + ); +} + +/* +* Wall Part Nodes: +* Window Node, Door Node, Palette Wall Node +*/ + +// Window Node TODO resizing is bugged, probably using wrong resizeObject +function makeWindowNode() { + var $ = go.GraphObject.make; + return $(go.Node, "Spot", + { + contextMenu: makeContextMenu(), + selectionObjectName: "SHAPE", + selectionAdorned: false, + locationSpot: go.Spot.Center, + name: "NODE", + toolTip: makeNodeToolTip(), + minSize: new go.Size(5, 5), + resizable: true, + resizeAdornmentTemplate: makeWallPartResizeAdornment(), + resizeObjectName: "SHAPE", + rotatable: false, + doubleClick: function (e) { if (e.diagram.floorplanUI) e.diagram.floorplanUI.hideShow("selectionInfoWindow"); }, + dragComputation: dragWallParts, + layerName: 'Foreground' // make sure windows are always in front of walls + }, + new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), + new go.Binding("angle", "angle").makeTwoWay(), + $(go.Shape, + { name: "SHAPE", fill: "white", strokeWidth: 0 }, + new go.Binding("width", "width").makeTwoWay(), + new go.Binding("height", "height").makeTwoWay(), + new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), + new go.Binding("fill", "isSelected", function (s, obj) { return s ? "lightgray" : "white"; }).ofObject() + ), + $(go.Shape, + { name: "LINESHAPE", fill: "darkgray", strokeWidth: 0, height: 10 }, + new go.Binding("width", "width", function (width, obj) { return width - 10; }), // 5px padding each side + new go.Binding("height", "height", function (height, obj) { return (height / 5); }), + new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject() + ) + ); +} + +// Door Node +function makeDoorNode() { + var $ = go.GraphObject.make; + return $(go.Node, "Spot", + { + contextMenu: makeContextMenu(), + selectionObjectName: "SHAPE", + selectionAdornmentTemplate: makeDoorSelectionAdornment(), + locationSpot: go.Spot.BottomCenter, + resizable: true, + resizeObjectName: "OPENING_SHAPE", + rotatable: false, + toolTip: makeNodeToolTip(), + minSize: new go.Size(10, 10), + doubleClick: function (e) { if (e.diagram.floorplanUI) e.diagram.floorplanUI.hideShow("selectionInfoWindow"); }, + dragComputation: dragWallParts, + resizeAdornmentTemplate: makeWallPartResizeAdornment(), + layerName: 'Foreground' // make sure windows are always in front of walls + }, + // remember location of the Node + new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify), + new go.Binding("angle", "angle").makeTwoWay(), + // the door's locationSpot is affected by it's openingHeight, which is affected by the thickness of its containing wall + new go.Binding("locationSpot", "doorOpeningHeight", function (doh, obj) { return new go.Spot(0.5, 1, 0, -(doh / 2)); }), + // this is the shape that reprents the door itself and its swing + $(go.Shape, + { name: "SHAPE", strokeWidth: 1 }, + new go.Binding("width", "width"), + new go.Binding("height", "width").makeTwoWay(), + new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), + new go.Binding("fill", "color"), + new go.Binding("geometryString", "swing", function (swing) { + if (swing === "left") return "F1 M0,0 v-150 a150,150 0 0,1 150,150 "; + else return "F1 M275,175 v-150 a150,150 0 0,0 -150,150 "; + }) + ), + // door opening shape + $(go.Shape, + { + name: "OPENING_SHAPE", fill: "white", + strokeWidth: 0, height: 5, width: 40, + alignment: go.Spot.BottomCenter, alignmentFocus: go.Spot.Center + }, + new go.Binding("height", "doorOpeningHeight").makeTwoWay(), + new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), + new go.Binding("fill", "isSelected", function (s, obj) { return s ? "lightgray" : "white"; }).ofObject(), + new go.Binding("width", "width").makeTwoWay() + ) + ); +} + +// Palette Wall Node (becomes WallGroup when dropped from Palette onto diagram) +function makePaletteWallNode() { + var $ = go.GraphObject.make; + return $(go.Node, "Spot", + { selectionAdorned: false, locationSpot: go.Spot.Center }, + $(go.Shape, + { name: "SHAPE", fill: "black", strokeWidth: 0, height: 10, figure: "Rectangle" }, + new go.Binding("width", "width").makeTwoWay(), + new go.Binding("height", "height").makeTwoWay(), + new go.Binding("fill", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject(), + new go.Binding("stroke", "isSelected", function (s, obj) { return s ? "dodgerblue" : "black"; }).ofObject()) + ); +} \ No newline at end of file diff --git a/extensions/WallBuildingTool.js b/projects/floorplanner/FloorPlanner-WallBuildingTool.js similarity index 73% rename from extensions/WallBuildingTool.js rename to projects/floorplanner/FloorPlanner-WallBuildingTool.js index 28439cc01..6adfa3892 100644 --- a/extensions/WallBuildingTool.js +++ b/projects/floorplanner/FloorPlanner-WallBuildingTool.js @@ -2,11 +2,12 @@ * Copyright (C) 1998-2017 by Northwoods Software Corporation * All Rights Reserved. * -* WALL BUILDING TOOL -* Used to construct new walls with mouse clicking / mouse point +* FLOOR PLANNER - WALL BUILDING TOOL +* Used to construct new Walls in a Floorplan with mouse clicking / mouse point +* Depends on functionality in Floorplan.js */ -// constructor +// Constructor function WallBuildingTool() { go.Tool.call(this); this.name = "WallBuilding"; @@ -15,31 +16,32 @@ function WallBuildingTool() { this._wallReshapingTool = null; } go.Diagram.inherit(WallBuildingTool, go.Tool); -// returns or modifies the current startPoint +// Get / set the current startPoint Object.defineProperty(WallBuildingTool.prototype, "startPoint", { get: function () { return this._startPoint; }, set: function (val) { this._startPoint = val; } }); -// returns or modifies the current endPoint +// Get / set the current endPoint Object.defineProperty(WallBuildingTool.prototype, "endPoint", { get: function () { return this._endPoint; }, set: function (val) { this._endPoint = val; } }); -// returns the diagram's wallReshapingTool +// Get / set the diagram's wallReshapingTool Object.defineProperty(WallBuildingTool.prototype, "wallReshapingTool", { get: function () { return this._wallReshapingTool; }, set: function (val) { this._wallReshapingTool = val; } }); +// Tool can start iff diagram exists, is editable, and tool is enabled WallBuildingTool.prototype.canStart = function () { var diagram = this.diagram; if (diagram !== null && !diagram.isReadOnly && this.isEnabled) return true; return false; } -// start transaction, capture the mouse, use a crosshair cursor +// Start transaction, capture the mouse, use a crosshair cursor WallBuildingTool.prototype.doActivate = function () { this.endPoint = null; this.startTransaction(this.name); @@ -48,8 +50,8 @@ WallBuildingTool.prototype.doActivate = function () { // update wallWidth, based on the current value of the HTML input element var el = document.getElementById('wallWidthInput'); - if (isNaN(el.value) || el.value === null || el.value === '' || el.value === undefined) el.value = convertPixelsToUnits(5); - diagram.model.setDataProperty(diagram.model.modelData, "wallWidth", convertUnitsToPixels(parseFloat(el.value))); + if (isNaN(el.value) || el.value === null || el.value === '' || el.value === undefined) el.value = diagram.convertPixelsToUnits(5); + diagram.model.setDataProperty(diagram.model.modelData, "wallWidth", diagram.convertUnitsToPixels(parseFloat(el.value))); // assign startpoint based on grid var point1 = this.diagram.lastInput.documentPoint; @@ -65,19 +67,20 @@ WallBuildingTool.prototype.doActivate = function () { this.isActive = true; } +// When user clicks, add wall model data to model and initialize a Wall Reshaping Tool to handle the shaping of its construction WallBuildingTool.prototype.doMouseDown = function () { var diagram = this.diagram; this.diagram.currentCursor = 'crosshair'; var data = { key: "wall", category: "WallGroup", caption: "Wall", type: "Wall", startpoint: this.startPoint, endpoint: this.startPoint, strokeWidth: parseFloat(diagram.model.modelData.wallWidth), isGroup: true, notes: "" }; this.diagram.model.addNodeData(data); var wall = diagram.findPartForKey(data.key); - updateWall(wall); + diagram.updateWall(wall); var part = diagram.findPartForData(data); // set the TransactionResult before raising event, in case it changes the result or cancels the tool this.transactionResult = this.name; diagram.raiseDiagramEvent('PartCreated', part); - // start the wallReshapingTool, tell it what wall it's reshaping (more accurately, the shape the will have the reshape handle) + // start the wallReshapingTool, tell it what wall it's reshaping (more accurately, the shape that will have the reshape handle) this.wallReshapingTool.isEnabled = true; diagram.select(part); this.wallReshapingTool.isBuilding = true; @@ -85,39 +88,41 @@ WallBuildingTool.prototype.doMouseDown = function () { this.wallReshapingTool.doActivate(); } +// If user presses Esc key, cancel the wall building WallBuildingTool.prototype.doKeyDown = function () { - var e = this.diagram.lastInput; + var diagram = this.diagram; + var e = diagram.lastInput; if (e.key === "Esc") { - var wall = this.diagram.selection.first(); - var searchPhrase = (wall.data.key === "wall") ? "wallP" : wall.data.key; - var dimensionLinks = this.diagram.findLinksByExample({ category: "dimensionLink" }); - var garbageLinks = []; - dimensionLinks.iterator.each(function (link) { if (link.data.to.includes(searchPhrase)) garbageLinks.push(link); }); - for (var i = 0; i < garbageLinks.length; i++) { this.diagram.remove(garbageLinks[i]); } - this.diagram.remove(wall); + var wall = diagram.selection.first(); + diagram.remove(wall); + diagram.pointNodes.iterator.each(function (node) { diagram.remove(node); }); + diagram.dimensionLinks.iterator.each(function (link) { diagram.remove(link); }); + diagram.pointNodes.clear(); + diagram.dimensionLinks.clear(); this.doDeactivate(); } go.Tool.prototype.doKeyDown.call(this); } -// when the mouse moves, reshape the wall +// When the mouse moves, reshape the wall WallBuildingTool.prototype.doMouseMove = function () { this.wallReshapingTool.doMouseMove(); } -// end transaction +// End transaction WallBuildingTool.prototype.doDeactivate = function () { var diagram = this.diagram; this.diagram.currentCursor = ""; this.diagram.isMouseCaptured = false; this.wallReshapingTool.isEnabled = false; - this.wallReshapingTool.isBuilding = false; this.wallReshapingTool.adornedShape = null; this.wallReshapingTool.doDeactivate(); + this.wallReshapingTool.isBuilding = false; + + diagram.updateWallDimensions(); this.stopTransaction(this.name); + this.isActive = false; // Default functionality -} - -// END OF WALLBUILDINGTOOL CLASS \ No newline at end of file +} \ No newline at end of file diff --git a/extensions/WallReshapingTool.js b/projects/floorplanner/FloorPlanner-WallReshapingTool.js similarity index 82% rename from extensions/WallReshapingTool.js rename to projects/floorplanner/FloorPlanner-WallReshapingTool.js index 5402e3deb..a1fac546f 100644 --- a/extensions/WallReshapingTool.js +++ b/projects/floorplanner/FloorPlanner-WallReshapingTool.js @@ -2,11 +2,12 @@ * Copyright (C) 1998-2017 by Northwoods Software Corporation * All Rights Reserved. * -* WALL RESHAPING TOOL -* Used to reshape walls via their endpoints +* FLOOR PLANNER: WALL RESHAPING TOOL +* Used to reshape walls via their endpoints in a Floorplan +* Depends on functionality in Floorplan.js */ -// constructor +// Constructor function WallReshapingTool() { go.Tool.call(this); this.name = "WallReshaping"; @@ -25,43 +26,66 @@ function WallReshapingTool() { this._angle = 0; this._length; this._isBuilding = false; // only true when a wall is first being constructed, set in WallBuildingTool's doMouseUp function + + this._returnPoint = null; // used if reshape is cancelled; return reshaping wall endpoint to its previous location + this._returnData = null; // used if reshape is cancelled; return all windows/doors of a reshaped wall to their old place } go.Diagram.inherit(WallReshapingTool, go.Tool); +// Get the archetype for the handle (a Shape) Object.defineProperty(WallReshapingTool.prototype, "handleArchetype", { get: function () { return this._handleArchetype; } }); +// Get / set current handle being used to reshape the wall Object.defineProperty(WallReshapingTool.prototype, "handle", { get: function () { return this._handle; }, set: function (val) { this._handle = val; } }); +// Get / set adorned shape (shape of the Wall Group being reshaped) Object.defineProperty(WallReshapingTool.prototype, "adornedShape", { get: function () { return this._adornedShape; }, set: function (val) { this._adornedShape = val;} }); +// Get / set current angle Object.defineProperty(WallReshapingTool.prototype, "angle", { get: function () { return this._angle; }, set: function (val) { this._angle = val; } }); +// Get / set length of the wall being reshaped (used only with SHIFT + drag) Object.defineProperty(WallReshapingTool.prototype, "length", { get: function () { return this._length; }, set: function (val) { this._length = val; } }); +// Get / set the name of the object being reshaped Object.defineProperty(WallReshapingTool.prototype, "reshapeObjectName", { get: function () { return this._reshapeObjectName; }, set: function (val) { this._reshapeObjectName = val; } }); +// Get / set flag telling tool whether it's reshaping a new wall (isBuilding = true) or reshaping an old wall (isBuilding = false) Object.defineProperty(WallReshapingTool.prototype, "isBuilding", { get: function () { return this._isBuilding; }, set: function (val) { this._isBuilding = val; } }); -// places reshape handles on either end of a wall node +// Get set loc data for wallParts to return to if reshape is cancelled +Object.defineProperty(WallReshapingTool.prototype, "returnData", { + get: function () { return this._returnData; }, + set: function (val) { this._returnData = val; } +}); + +// Get / set the point to return the reshaping wall endpoint to if reshape is cancelled +Object.defineProperty(WallReshapingTool.prototype, "returnPoint", { + get: function () { return this._returnPoint; }, + set: function (val) { this._returnPoint = val;} +}); + + +// Places reshape handles on either end of a wall node WallReshapingTool.prototype.updateAdornments = function (part) { if (part === null || part instanceof go.Link) return; if (part.isSelected && !this.diagram.isReadOnly) { @@ -106,7 +130,7 @@ WallReshapingTool.prototype.updateAdornments = function (part) { part.removeAdornment(this.name); } -// if the user has clicked down at a visible handle on a wall node, then the tool may start +// If the user has clicked down at a visible handle on a wall node, then the tool may start WallReshapingTool.prototype.canStart = function () { if (!this.isEnabled) return false; var diagram = this.diagram; @@ -117,7 +141,7 @@ WallReshapingTool.prototype.canStart = function () { return (h !== null || this.isBuilding); } -// start a new transaction for the wall reshaping +// Start a new transaction for the wall reshaping WallReshapingTool.prototype.doActivate = function () { var diagram = this.diagram; if (diagram === null) return; @@ -129,8 +153,22 @@ WallReshapingTool.prototype.doActivate = function () { this.handle = this.findToolHandleAt(diagram.firstInput.documentPoint, this.name); if (this.handle === null) return; var shape = this.handle.part.adornedObject; + var wall = shape.part; if (!shape) return; this.adornedShape = shape; + + // store pre-reshape location of wall's reshaping endpoint + this.returnPoint = this.snapPointToGrid(diagram.firstInput.documentPoint); + + // store pre-reshape locations of all wall's members (windows / doors) + var wallParts = wall.memberParts; + if (wallParts.count != 0) { + var locationsMap = new go.Map("string", go.Point); + wallParts.iterator.each(function (wallPart) { + locationsMap.add(wallPart.data.key, wallPart.location); + }); + this.returnData = locationsMap; + } } diagram.isMouseCaptured = true; @@ -138,7 +176,7 @@ WallReshapingTool.prototype.doActivate = function () { this.isActive = true; } -// adjust the handle's coordinates, along with the wall's points +// Adjust the handle's coordinates, along with the wall's points WallReshapingTool.prototype.doMouseMove = function () { var diagram = this.diagram; var tool = this; @@ -148,13 +186,13 @@ WallReshapingTool.prototype.doMouseMove = function () { var mousePt = diagram.lastInput.documentPoint; tool.calcAngleAndLengthFromHandle(mousePt); // sets this.angle and this.length (useful for when SHIFT is held) var newpt = diagram.lastInput.documentPoint; - setSelectionInfo(this.adornedShape.part); // update selection info window + if (diagram.floorplanUI) diagram.floorplanUI.setSelectionInfo(this.adornedShape.part, diagram); // update selection info window this.reshape(newpt); } - updateWallAngles(); + diagram.updateWallAngles(); } -// does one final reshape, commits the transaction, then stops the tool +// Does one final reshape, commits the transaction, then stops the tool WallReshapingTool.prototype.doMouseUp = function () { var diagram = this.diagram; if (this.isActive && diagram !== null) { @@ -165,9 +203,10 @@ WallReshapingTool.prototype.doMouseUp = function () { this.stopTool(); } -// end the wall reshaping transaction +// End the wall reshaping transaction WallReshapingTool.prototype.doDeactivate = function () { var diagram = this.diagram; + var returnData = this.returnData; // if you reshape a wall down to < 1 px, remove it from the diagram var wall = this.handle.part.adornedPart; var sPt = wall.data.startpoint; @@ -177,30 +216,44 @@ WallReshapingTool.prototype.doDeactivate = function () { diagram.remove(wall); // remove wall wall.memberParts.iterator.each(function (member) { diagram.remove(member); }) // remove wall's parts var wallDimensionLinkPointNodes = []; - allPointNodes.iterator.each(function (node) { if (node.data.key.includes(wall.data.key)) wallDimensionLinkPointNodes.push(node); }); + diagram.pointNodes.iterator.each(function (node) { if (node.data.key.includes(wall.data.key)) wallDimensionLinkPointNodes.push(node); }); diagram.remove(wallDimensionLinkPointNodes[0]); diagram.remove(wallDimensionLinkPointNodes[1]); } // remove wall's dimension links if tool cancelled via esc key - if (diagram.lastInput.key === "Esc") { - var wallDimensionLinkPointNodes = []; - allPointNodes.iterator.each(function (node) { if (node.data.key.includes(wall.data.key)) wallDimensionLinkPointNodes.push(node); }); - diagram.remove(wallDimensionLinkPointNodes[0]); - diagram.remove(wallDimensionLinkPointNodes[1]); + if (diagram.lastInput.key === "Esc" && !this.isBuilding) { + diagram.skipsUndoManager = true; + diagram.startTransaction("reset to old data"); + if (this.handle.name === "sPt") wall.data.startpoint = this.returnPoint; + else wall.data.endpoint = this.returnPoint; + + diagram.updateWall(wall); + + if (this.returnData) { + this.returnData.iterator.each(function (kvp) { + var key = kvp.key; + var loc = kvp.value; + var wallPart = diagram.findPartForKey(key); + wallPart.location = loc; + wallPart.rotateObject.angle = wall.rotateObject.angle; + }); + } + diagram.commitTransaction("reset to old data"); + diagram.skipsUndoManager = false; } // remove guide line points var glPoints = this.diagram.findNodesByExample({ category: 'GLPointNode' }); diagram.removeParts(glPoints, true); + diagram.updateWallDimensions(); // commit transaction, deactivate tool diagram.commitTransaction(this.name); this.isActive = false; - updateWallDimensions(); } -// creates an adornment with 2 handles +// Creates an adornment with 2 handles WallReshapingTool.prototype.makeAdornment = function (selelt) { var adornment = new go.Adornment; adornment.type = go.Panel.Spot; @@ -225,13 +278,13 @@ WallReshapingTool.prototype.makeAdornment = function (selelt) { return adornment; } -// creates a basic handle archetype +// Creates a basic handle archetype WallReshapingTool.prototype.makeHandle = function () { var h = this.handleArchetype; return h.copy(); } -// calculate the angle and length made from the mousepoint and the non-moving handle +// Calculate the angle and length made from the mousepoint and the non-moving handle // used to reshape wall when holding SHIFT WallReshapingTool.prototype.calcAngleAndLengthFromHandle = function (mousePt) { var tool = this; @@ -244,7 +297,7 @@ WallReshapingTool.prototype.calcAngleAndLengthFromHandle = function (mousePt) { adornments.each(function (a) { if (a.category === tool.name) adornment = a; }) adornment.elements.each(function (e) { if (e.name != undefined && e.name != h.name) otherH = e; - }) + }); // calc angle from otherH against the horizontal var otherHandlePt = otherH.getDocumentPoint(go.Spot.Center); @@ -261,7 +314,7 @@ WallReshapingTool.prototype.calcAngleAndLengthFromHandle = function (mousePt) { tool.length = distanceBetween; } -// takes a point -- returns a new point that is closest to the original point that conforms to the grid snap +// Takes a point -- returns a new point that is closest to the original point that conforms to the grid snap WallReshapingTool.prototype.snapPointToGrid = function (point) { var diagram = this.diagram; var newx = diagram.model.modelData.gridSize * Math.round(point.x / diagram.model.modelData.gridSize); @@ -270,14 +323,14 @@ WallReshapingTool.prototype.snapPointToGrid = function (point) { return newPt; } -// reshapes the shape's geometry, updates model data +// Reshapes the shape's geometry, updates model data WallReshapingTool.prototype.reshape = function (newPoint) { var diagram = this.diagram; var tool = this; var shape = this.adornedShape; var node = shape.part; - //if the user is holding shift, make the angle between startPoint / endPoint / the horizontal line a multiple of 45 + // if user holds SHIFT, make angle between startPoint / endPoint and the horizontal line a multiple of 45 if (this.diagram.lastInput.shift) { var sPt; // the stationary point -- the point at the handle that is not being adjusted @@ -367,12 +420,12 @@ WallReshapingTool.prototype.reshape = function (newPoint) { } this.updateAdornments(shape.part); this.showMatches(); - updateWallDimensions(); + diagram.updateWallDimensions(); } -// maintain position of all wallParts as best as possible when a wall is being reshaped +// Maintain position of all wallParts as best as possible when a wall is being reshaped // position is relative to the distance a wallPart's location is from the stationaryPoint of the wall -// this is called during WallReshapingTool's reshape function +// This is called during WallReshapingTool's reshape function function reshapeWall(wall, stationaryPoint, movingPoint, newPoint, diagram, tool) { var wallParts = wall.memberParts; var arr = []; @@ -422,7 +475,7 @@ function reshapeWall(wall, stationaryPoint, movingPoint, newPoint, diagram, tool // reshape the wall if (movingPoint === wall.data.endpoint) diagram.model.setDataProperty(wall.data, "endpoint", newPoint); else diagram.model.setDataProperty(wall.data, "startpoint", newPoint); - updateWall(wall); + diagram.updateWall(wall); // calculate the new angle offset var newAngle = wall.rotateObject.angle; var angleOffset = newAngle - oldAngle; @@ -438,7 +491,7 @@ function reshapeWall(wall, stationaryPoint, movingPoint, newPoint, diagram, tool }); } -// show if the wall (at the adjustment handle being moved) lines up with other wall edges +// Show if the wall (at the adjustment handle being moved) lines up with other wall edges WallReshapingTool.prototype.showMatches = function () { //if (!(document.getElementById('wallGuidelinesCheckbox').checked)) return; var diagram = this.diagram; @@ -473,7 +526,7 @@ WallReshapingTool.prototype.showMatches = function () { }) } -// static function -- checks if there exists a horiontal or vertical line (decided by 'coord' parameter) between pt and compare pt +// Static function -- checks if there exists a horiontal or vertical line (decided by 'coord' parameter) between pt and compare pt // if so, draws a link between the two, letting the user know the wall they're reshaping lines up with another's edge WallReshapingTool.prototype.checkPtLinedUp = function (pt, comparePtCoord, ptCoord, comparePt) { function makeGuideLinePoint() { diff --git a/extensions/FloorPlanner.css b/projects/floorplanner/FloorPlanner.css similarity index 90% rename from extensions/FloorPlanner.css rename to projects/floorplanner/FloorPlanner.css index 99aba2ef4..10d210289 100644 --- a/extensions/FloorPlanner.css +++ b/projects/floorplanner/FloorPlanner.css @@ -39,8 +39,8 @@ label{ font-size: 9pt; color: #757575;} #furnitureSearchBar::-webkit-input-placeholder { color: gray; } #furnitureSearchBar::-moz-placeholder { color: gray; } #furnitureSearchBar:-ms-input-placeholder { color: gray; } -#myPaletteDiv {width: 100%; height: 300px; background: #e2e2e2;} -#myPalette2Div {width: 100%; height: 150px; background: #e2e2e2;} +#furniturePaletteDiv {width: inherit; height: 300px; background: #e2e2e2;} +#wallPartsPaletteDiv {width: inherit; height: 150px; background: #e2e2e2;} #myPaletteWindow{ height: inherit; @@ -49,35 +49,18 @@ label{ font-size: 9pt; color: #757575;} } #palettes { - height: inherit; - width: inherit; + height: 100%; + width: 300px; padding: 0px; } -#paletteIdentifierDiv { - z-index: 2; /*Places this element over overhanging nodes in the palette*/ - position: inherit; - bottom: -38px; - width: 100%; - background-color: #4b545f; - color: white; - font: bold 12px sans-serif; -} - -#myDiagramDiv { +#myFloorplanDiv { width: 100%; background-color: #DAE4E4; border: 1px solid gray; height: 85vh; } -.dockedWindows { - height: 75vh; z-index: 10; position: absolute; -} - -#leftDockedWindows {float: left;} -#rightDockedWindows {float: right;} - #currentFile { background-color: #4b545f; color: white; @@ -264,10 +247,6 @@ nav p { /* grid input area, wall width area, and 'Tools' all wrapped in

    tag* /*Icons*/ -/*.toolIcons { - width: 21px; - height: 21px; -}*/ #wallBuildingButton {background: url(icons/wallBuildingTool.png);} #draggingButton {background: url(icons/selectionTool.png);} #wallWidthBox { visibility: hidden; display: none;} /*box for setting wall width; invisible when Wall Tool not active*/ diff --git a/projects/floorplanner/FloorPlanner.html b/projects/floorplanner/FloorPlanner.html new file mode 100644 index 000000000..a0f125dc5 --- /dev/null +++ b/projects/floorplanner/FloorPlanner.html @@ -0,0 +1,636 @@ + + + + + + Floor Planner + + + + + + + + + + + + + + + + + +

    (Unsaved File)
    + + + + + +
    +
    +
    +

    Drag a node to the Diagram or select the Wall Drawing Tool (Ctrl + 1) to begin

    +
    +
    + + +
    +
    Palettes
    +
    + +

    Furniture

    +
    + +
    +
    +

    Wall Parts

    +
    +
    +
    + + + + + + + + + + + + + + +

    This Floorplanner samples makes use of multiple classes to allow for users to build, edit, save, and load feature-rich Floorplans. To start, build walls with the Wall Building Tool (Ctrl + 1), or drag furniture from Palettes onto the Floorplan area. The help at the bottom of the Floorplan area is context-specific and should aid in providing tips on how to better use this software.

    +

    This sample uses the following files.

    + +

    In addition, three files are used to store Flooplanner-specific Graph Object templates.

    + + + + + + + \ No newline at end of file diff --git a/projects/floorplanner/Floorplan.js b/projects/floorplanner/Floorplan.js new file mode 100644 index 000000000..e71f5ed37 --- /dev/null +++ b/projects/floorplanner/Floorplan.js @@ -0,0 +1,789 @@ +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation +* All Rights Reserved. +* +* Floorplan Class +* A Floorplan is a Diagram with special rules +* Dependencies: Floorplanner-Templates-General.js, Floorplanner-Templates-Furniture.js, Floorplanner-Templates-Walls.js +*/ + +/* +* Floorplan Constructor +* @param {HTMLDivElement|string} div A reference to a div or its ID as a string +*/ +function Floorplan(div) { + + /* + * Floor Plan Setup: + * Initialize Floor Plan, Floor Plan Listeners, Floor Plan Overview + */ + + go.Diagram.call(this, div); + // By default there is no filesystem / UI control for a floorplan, though they can be added + this._floorplanFilesystem = null; + this._floorplanUI = null; + + // When a FloorplanPalette instance is made, it is automatically added to a Floorplan's "palettes" field + this._palettes = []; + + // Point Nodes, Dimension Links, Angle Nodes on the Floorplan (never in model data) + this._pointNodes = new go.Set(go.Node); + this._dimensionLinks = new go.Set(go.Link); + this._angleNodes = new go.Set(go.Node); + + var $ = go.GraphObject.make; + + this.initialContentAlignment = go.Spot.Center; + this.allowDrop = true; + this.allowLink = false; + this.undoManager.isEnabled = true; + this.layout.isOngoing = false; + this.model = $(go.GraphLinksModel, { + modelData: { + "units": "centimeters", + "unitsAbbreviation": "cm", + "gridSize": 10, + "wallWidth": 5, + "preferences": { + showWallGuidelines: true, + showWallLengths: true, + showWallAngles: true, + showOnlySmallWallAngles: true, + showGrid: true, + gridSnap: true + } + } + }); + this.resizingTool = new go.ResizingTool(); + this.resizingTool.isGridSnapEnabled = true; + this.draggingTool = new go.DraggingTool(); + this.draggingTool.isGridSnapEnabled = true; + this.draggingTool.gridSnapCellSpot = go.Spot.TopLeft; + this.draggingTool.gridCellSize = this.model.modelData.gridSize; + this.rotatingTool = new go.RotatingTool(); + this.rotatingTool.snapAngleEpsilon = 10; + this.grid = $(go.Panel, "Grid", + { gridCellSize: new go.Size(this.model.modelData.gridSize, this.model.modelData.gridSize), visible: true }, + $(go.Shape, "LineH", { stroke: "lightgray" }), + $(go.Shape, "LineV", { stroke: "lightgray" })); + this.contextMenu = makeContextMenu(); + this.commandHandler.canGroupSelection = true; + this.commandHandler.canUngroupSelection = true; + this.commandHandler.archetypeGroupData = { isGroup: true }; + + // When floorplan model is changed, update stats in Statistics Window TODO + this.addModelChangedListener(function (e) { + if (e.isTransactionFinished) { + // find floorplan changed + var floorplan = null; + if (e.object !== null) { + e.object.changes.each(function (change) { + if (change.diagram instanceof Floorplan) floorplan = change.diagram; + }); + } + if (floorplan) { + if (floorplan.floorplanUI) floorplan.floorplanUI.updateStatistics(); + } + } + }); + + // When floorplan is modified, change document title to include a * + this.addDiagramListener("Modified", function (e) { + var floorplan = e.diagram; + if (floorplan.floorplanFilesystem) { + var currentFile = document.getElementById(floorplan.floorplanFilesystem.state.currentFileId); + var idx = currentFile.textContent.indexOf("*"); + if (floorplan.isModified) { + if (idx < 0) currentFile.textContent = currentFile.textContent + "*"; + } + else { + if (idx >= 0) currentFile.textContent = currentFile.textContent.substr(0, idx); + } + } + }); + + // If floorplan scale has been changed update the 'Scale' item in the View menu + this.addDiagramListener("ViewportBoundsChanged", function (e) { + var floorplan = e.diagram; + if (floorplan.floorplanUI) { + var scaleEl = document.getElementById(floorplan.floorplanUI.state.scaleDisplayId); + scaleEl.innerHTML = "Scale: " + (e.diagram.scale * 100).toFixed(2) + "%"; + } + }); + + // If a node has been dropped onto the Floorplan from a Palette... + this.addDiagramListener("ExternalObjectsDropped", function (e) { + var node = e.diagram.selection.first(); + // Event 1: handle a drag / drop of a wall node from the Palette (as opposed to wall construction via WallBuildingTool) + if (node.category === "PaletteWallNode") { + var paletteWallNode = e.diagram.selection.first(); + var endpoints = getWallPartEndpoints(paletteWallNode); + var data = { key: "wall", category: "WallGroup", caption: "Wall", startpoint: endpoints[0], endpoint: endpoints[1], strokeWidth: parseFloat(e.diagram.model.modelData.wallWidth), isGroup: true, notes: "" }; + e.diagram.model.addNodeData(data); + var wall = e.diagram.findPartForKey(data.key); + e.diagram.updateWall(wall); + e.diagram.remove(paletteWallNode); + } + if (e.diagram.floorplanUI) { + var floorplanUI = e.diagram.floorplanUI; + // Event 2: Update the text of the Diagram Helper + if (node.category === "WindowNode" || node.category === "DoorNode") floorplanUI.setDiagramHelper("Drag part so the cursor is over a wall to add this part to a wall"); + else floorplanUI.setDiagramHelper("Drag, resize, or rotate your selection (hold SHIFT for no grid-snapping)"); + // Event 3: If the select tool is not active, make it active + if (e.diagram.toolManager.mouseDownTools.elt(0).isEnabled) floorplanUI.setBehavior('dragging', e.diagram); + } + }); + + // When a wall is copied / pasted, update the wall geometry, angle, etc + this.addDiagramListener("ClipboardPasted", function (e) { + e.diagram.selection.iterator.each(function (node) { if (node.category === "WallGroup") e.diagram.updateWall(node); }); + }); + + // Display different help depending on selection context + this.addDiagramListener("ChangedSelection", function (e) { + var floorplan = e.diagram; + floorplan.skipsUndoManager = true; + floorplan.startTransaction("remove dimension links and angle nodes"); + floorplan.pointNodes.iterator.each(function (node) { e.diagram.remove(node) }); + floorplan.dimensionLinks.iterator.each(function (link) { e.diagram.remove(link) }); + + var missedDimensionLinks = []; // used only in undo situations + floorplan.links.iterator.each(function (link) { if (link.data.category == "DimensionLink") missedDimensionLinks.push(link); }); + for (var i = 0; i < missedDimensionLinks.length; i++) { + e.diagram.remove(missedDimensionLinks[i]); + } + + floorplan.pointNodes.clear(); + floorplan.dimensionLinks.clear(); + floorplan.angleNodes.iterator.each(function (node) { e.diagram.remove(node); }); + floorplan.angleNodes.clear(); + + floorplan.commitTransaction("remove dimension links and angle nodes"); + floorplan.skipsUndoManager = false; + floorplan.updateWallDimensions(); + floorplan.updateWallAngles(); + if (floorplan.floorplanUI) { + var floorplanUI = floorplan.floorplanUI; + var selection = floorplan.selection; + var node = floorplan.selection.first(); // only used if selection.count === 1 + + if (selection.count === 0) floorplan.floorplanUI.setSelectionInfo('Nothing selected'); + else if (selection.count === 1) floorplan.floorplanUI.setSelectionInfo(floorplan.selection.first()); + else floorplan.floorplanUI.setSelectionInfo('Selection: '); + + if (selection.count === 0) floorplanUI.setDiagramHelper("Click to select a part, drag one from a Palette, or draw a wall with the Wall Tool (Ctr + 1)"); + else if (selection.count > 1) { + var ungroupable = false; + selection.iterator.each(function (node) { if (node.category === "WindowNode" || node.category === "DoorNode" || node.category === "WallGroup") ungroupable = true; }); + if (!ungroupable) floorplanUI.setDiagramHelper("You may group your selection with the context menu (Right Click anywhere)"); + } + else if (node.category === "WallGroup") floorplanUI.setDiagramHelper("Drag wall endpoints or add doors and windows to the wall from the Wall Parts Palette"); + else if (selection.first().category === "WindowNode" || selection.first().category === "DoorNode") { + if (node.containingGroup !== null) floorplanUI.setDiagramHelper("Drag and resize wall part along the wall; drag away from wall to detach"); + else floorplanUI.setDiagramHelper("Drag part so the cursor is over a wall to add this part to a wall"); + } + else if (selection.first().category === "MultiPurposeNode") floorplanUI.setDiagramHelper("Double click on part text to revise it"); + else floorplanUI.setDiagramHelper("Drag, resize, or rotate (hold SHIFT for no snap) your selection"); + + } + }); + + /* + * Node Templates + * Add Default Node, Multi-Purpose Node, Window Node, Palette Wall Node, and Door Node to the Node Template Map + * Template functions defined in FloorPlanner-Templates-* js files + */ + + this.nodeTemplateMap.add("", makeDefaultNode()); // Default Node (furniture) + this.nodeTemplateMap.add("MultiPurposeNode", makeMultiPurposeNode()); // Multi-Purpose Node + this.nodeTemplateMap.add("WindowNode", makeWindowNode()); // Window Node + this.nodeTemplateMap.add("PaletteWallNode", makePaletteWallNode()); // Palette Wall Node + this.nodeTemplateMap.add("DoorNode", makeDoorNode()); // Door Node + + /* + * Group Templates + * Add Default Group, Wall Group to Group Template Map + * Template functions defined in FloorPlanner-Templates-* js files + */ + + this.groupTemplateMap.add("", makeDefaultGroup()); // Default Group + this.groupTemplateMap.add("WallGroup", makeWallGroup()); // Wall Group + + /* + * Install Custom Tools + * Wall Building Tool, Wall Reshaping Tool + * Tools are defined in their own FloorPlanner-.js files + */ + + var wallBuildingTool = new WallBuildingTool(); + this.toolManager.mouseDownTools.insertAt(0, wallBuildingTool); + + var wallReshapingTool = new WallReshapingTool(); + this.toolManager.mouseDownTools.insertAt(3, wallReshapingTool); + + /* + * Tool Overrides + */ + + // If a wall was dragged to intersect another wall, update angle displays + this.toolManager.draggingTool.doMouseUp = function () { + go.DraggingTool.prototype.doMouseUp.call(this); + this.diagram.updateWallAngles(); + this.isGridSnapEnabled = this.diagram.model.modelData.preferences.gridSnap; + } + + // If user holds SHIFT while dragging, do not use grid snap + this.toolManager.draggingTool.doMouseMove = function () { + if (this.diagram.lastInput.shift) { + this.isGridSnapEnabled = false; + } else this.isGridSnapEnabled = this.diagram.model.modelData.preferences.gridSnap; + go.DraggingTool.prototype.doMouseMove.call(this); + } + + // When resizing, constantly update the node info box with updated size info; constantly update Dimension Links + this.toolManager.resizingTool.doMouseMove = function () { + var node = this.adornedObject; + // if node is the only thing selected, display its info as its resized + if (this.diagram.selection.count === 1 && this.floorplanUI) this.floorplanUI.setSelectionInfo(node); + this.diagram.updateWallDimensions(); + go.ResizingTool.prototype.doMouseMove.call(this); + } + + // When resizing a wallPart, do not allow it to be resized past the nearest wallPart / wall endpoints + this.toolManager.resizingTool.computeMaxSize = function () { + var tool = this; + var obj = tool.adornedObject.part; + var wall = this.diagram.findPartForKey(obj.data.group); + if ((obj.category === 'DoorNode' || obj.category === 'WindowNode') && wall !== null) { + var stationaryPt; var movingPt; + var resizeAdornment = null; + obj.adornments.iterator.each(function (adorn) { if (adorn.name === "WallPartResizeAdornment") resizeAdornment = adorn; }); + resizeAdornment.elements.iterator.each(function (el) { + if (el instanceof go.Shape && el.alignment === tool.handle.alignment) movingPt = el.getDocumentPoint(go.Spot.Center); + if (el instanceof go.Shape && el.alignment !== tool.handle.alignment) stationaryPt = el.getDocumentPoint(go.Spot.Center); + }); + // find the constrainingPt; that is, the endpoint (wallPart endpoint or wall endpoint) that is the one closest to movingPt but still farther from stationaryPt than movingPt + // this loop checks all other wallPart endpoints of the wall that the resizing wallPart is a part of + var constrainingPt; var closestDist = Number.MAX_VALUE; + wall.memberParts.iterator.each(function (part) { + if (part.data.key !== obj.data.key) { + var endpoints = getWallPartEndpoints(part); + for (var i = 0; i < endpoints.length; i++) { + var point = endpoints[i]; + var distanceToMovingPt = Math.sqrt(point.distanceSquaredPoint(movingPt)); + if (distanceToMovingPt < closestDist) { + var distanceToStationaryPt = Math.sqrt(point.distanceSquaredPoint(stationaryPt)); + if (distanceToStationaryPt > distanceToMovingPt) { + closestDist = distanceToMovingPt; + constrainingPt = point; + } + } + } + } + }); + // if we're not constrained by a wallPart endpoint, the constraint will come from a wall endpoint; figure out which one + if (constrainingPt === undefined || constrainingPt === null) { + if (wall.data.startpoint.distanceSquaredPoint(movingPt) > wall.data.startpoint.distanceSquaredPoint(stationaryPt)) constrainingPt = wall.data.endpoint; + else constrainingPt = wall.data.startpoint; + } + // set the new max size of the wallPart according to the constrainingPt + var maxLength = Math.sqrt(stationaryPt.distanceSquaredPoint(constrainingPt)); + return new go.Size(maxLength, wall.data.strokeWidth); + } + return go.ResizingTool.prototype.computeMaxSize.call(tool); + } + + this.toolManager.draggingTool.isGridSnapEnabled = true; +} go.Diagram.inherit(Floorplan, go.Diagram); + +// Get/set the Floorplan Filesystem instance associated with this Floorplan +Object.defineProperty(Floorplan.prototype, "floorplanFilesystem", { + get: function () { return this._floorplanFilesystem; }, + set: function (val) { + val instanceof FloorplanFilesystem ? this._floorplanFilesystem = val : this._floorplanFilesystem = null; + } +}); + +// Get/set the FloorplanUI instance associated with this Floorplan +Object.defineProperty(Floorplan.prototype, "floorplanUI", { + get: function () { return this._floorplanUI; }, + set: function (val) { + val instanceof FloorplanUI ? this._floorplanUI = val : this._floorplanUI = null; + } +}); + +// Get array of all FloorplanPalettes associated with this Floorplan +Object.defineProperty(Floorplan.prototype, "palettes", { + get: function () { return this._palettes; } +}); + +// Get / set Set of all Point Nodes in the Floorplan +Object.defineProperty(Floorplan.prototype, "pointNodes", { + get: function () { return this._pointNodes; }, + set: function (val) { this._pointNodes = val; } +}); + +// Get / set Set of all Dimension Links in the Floorplan +Object.defineProperty(Floorplan.prototype, "dimensionLinks", { + get: function () { return this._dimensionLinks; }, + set: function () { this._dimensionLinks = val; } +}); + +// Get / set Set of all Angle Nodes in the Floorplan +Object.defineProperty(Floorplan.prototype, "angleNodes", { + get: function () { return this._angleNodes; }, + set: function () { this._angleNodes = val; } +}); + + +// Check what units are being used, convert to cm then multiply by 2, (1px = 2cm, change this if you want to use a different paradigm) +Floorplan.prototype.convertPixelsToUnits = function (num) { + var units = this.model.modelData.units; + if (units === 'meters') return (num / 100) * 2; + if (units === 'feet') return (num / 30.48) * 2; + if (units === 'inches') return (num / 2.54) * 2; + return num * 2; +} + +// Take a number of units, convert to cm, then divide by 2, (1px = 2cm, change this if you want to use a different paradigm) +Floorplan.prototype.convertUnitsToPixels = function (num) { + var units = this.model.modelData.units; + if (units === 'meters') return (num * 100) / 2; + if (units === 'feet') return (num * 30.48) / 2; + if (units === 'inches') return (num * 2.54) / 2; + return num / 2; +} + +/* +* Update the geometry, angle, and location of a given wall +* @param {Wall} wall A reference to a valid Wall Group (defined in Templates-Walls) +*/ +Floorplan.prototype.updateWall = function (wall) { + var shape = wall.findObject("SHAPE"); + var geo = new go.Geometry(go.Geometry.Line); + var sPt = wall.data.startpoint; + var ePt = wall.data.endpoint; + var mPt = new go.Point((sPt.x + ePt.x) / 2, (sPt.y + ePt.y) / 2); + // define a wall's geometry as a simple horizontal line, then rotate it + geo.startX = 0; + geo.startY = 0; + geo.endX = Math.sqrt(sPt.distanceSquaredPoint(ePt)); + geo.endY = 0; + shape.geometry = geo; + wall.location = mPt; // a wall's location is the midpoint between it's startpoint and endpoint + var angle = sPt.directionPoint(ePt); + wall.rotateObject.angle = angle; + this.updateWallDimensions(); +} + +/* +* Helper function for Build Dimension Link: get a to/from point for a Dimension Link +* @param {Wall} wall The Wall Group being given a Dimension Link +* @param {Number} angle The angle of "wall" +* @param {Number} wallOffset The distance the Dimension Link will be from wall (in pixels) +*/ +function getAdjustedPoint(point, wall, angle, wallOffset) { + var oldPoint = point.copy(); + point.offset(0, -(wall.data.strokeWidth * .5) - wallOffset); + point.offset(-oldPoint.x, -oldPoint.y).rotate(angle).offset(oldPoint.x, oldPoint.y); + return point; +} + +/* +* Helper function for Update Wall Dimensions; used to build Dimension Links +* @param {Wall} wall The wall the Link runs along (either describing the wall itself or some wallPart on "wall") +* @param {Number} index A number appended to PointNode keys; used for finding PointNodes of Dimension Links later +* @param {Point} point1 The first point of the wallPart being described by the Link +* @param {Point} point2 The second point of the wallPart being described by the Link +* @param {Number} angle The angle of the wallPart +* @param {Number} wallOffset How far from the wall (in px) the Link should be +* @param {Boolean} soloWallFlag If this Link is the only Dimension Link for "wall" (no other wallParts on "wall" selected) this is true; else, false +* @param {Floorplan} floorplan A reference to a valid Floorplan +*/ +function buildDimensionLink(wall, index, point1, point2, angle, wallOffset, soloWallFlag, floorplan) { + point1 = getAdjustedPoint(point1, wall, angle, wallOffset); + point2 = getAdjustedPoint(point2, wall, angle, wallOffset); + var data1 = { key: wall.data.key + "PointNode" + index, category: "PointNode", loc: go.Point.stringify(point1) }; + var data2 = { key: wall.data.key + "PointNode" + (index + 1), category: "PointNode", loc: go.Point.stringify(point2) }; + var data3 = { key: wall.data.key + "DimensionLink", category: 'DimensionLink', from: data1.key, to: data2.key, stroke: 'gray', angle: angle, wall: wall.data.key, soloWallFlag: soloWallFlag }; + var pointNode1 = makePointNode(); + var pointNode2 = makePointNode(); + var link = makeDimensionLink(); + + floorplan.pointNodes.add(pointNode1); + floorplan.pointNodes.add(pointNode2); + floorplan.dimensionLinks.add(link); + floorplan.add(pointNode1); + floorplan.add(pointNode2); + floorplan.add(link); + + pointNode1.data = data1; + pointNode2.data = data2; + link.data = data3; + link.fromNode = pointNode1; + link.toNode = pointNode2; +} + +/* +* Update Dimension Links shown along a wall, based on which wallParts are selected +*/ +Floorplan.prototype.updateWallDimensions = function () { + var floorplan = this; + floorplan.skipsUndoManager = true; + floorplan.startTransaction("update wall dimensions"); + // if showWallLengths === false, remove all pointNodes (used to build wall dimensions) + if (!floorplan.model.modelData.preferences.showWallLengths) { + floorplan.pointNodes.iterator.each(function (node) { floorplan.remove(node); }); + floorplan.dimensionLinks.iterator.each(function (link) { floorplan.remove(link); }); + floorplan.pointNodes.clear(); + floorplan.dimensionLinks.clear(); + floorplan.commitTransaction("update wall dimensions"); + floorplan.skipsUndoManager = false; + return; + } + // make visible all dimension links (zero-length dimension links are set to invisible at the end of the function) + floorplan.dimensionLinks.iterator.each(function (link) { link.visible = true; }); + + var selection = floorplan.selection; + // gather all selected walls, including walls of selected DoorNodes and WindowNodes + var walls = new go.Set(go.Group); + selection.iterator.each(function (part) { + if ((part.category === 'WindowNode' || part.category === 'DoorNode') && part.containingGroup !== null) walls.add(part.containingGroup); + if (part.category === 'WallGroup' && part.data !== null) { + var soloWallLink = null; + floorplan.dimensionLinks.iterator.each(function (link) { if (link.data.soloWallFlag && link.data.wall === part.data.key) soloWallLink = link; }); + // if there's 1 Dimension Link for this wall (link has soloWallFlag), adjust to/from pointNodes of link, rather than deleting / redrawing + if (soloWallLink !== null) { + // since this is the only Dimension Link for this wall, keys of its pointNodes will be (wall.data.key) + 1 / (wall.data.key) + 2 + var linkPoint1 = null; var linkPoint2 = null; + floorplan.pointNodes.iterator.each(function (node) { + if (node.data.key === part.data.key + "PointNode1") linkPoint1 = node; + if (node.data.key === part.data.key + "PointNode2") linkPoint2 = node; + }); + + var startpoint = part.data.startpoint; var endpoint = part.data.endpoint; + // adjust left/top-most / right/bottom-most wall endpoints so link angle is correct (else text appears on wrong side of Link) + var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; + var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; + var newLoc1 = getAdjustedPoint(firstWallPt.copy(), part, part.rotateObject.angle, 10); + var newLoc2 = getAdjustedPoint(lastWallPt.copy(), part, part.rotateObject.angle, 10); + linkPoint1.data.loc = go.Point.stringify(newLoc1); + linkPoint2.data.loc = go.Point.stringify(newLoc2); + soloWallLink.data.angle = part.rotateObject.angle; + linkPoint1.updateTargetBindings(); + linkPoint2.updateTargetBindings(); + soloWallLink.updateTargetBindings(); + } + // else build a Dimension Link for this wall; this is removed / replaced if Dimension Links for wallParts this wall are built + else { + var startpoint = part.data.startpoint; + var endpoint = part.data.endpoint; + var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; + var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; + buildDimensionLink(part, 1, firstWallPt.copy(), lastWallPt.copy(), part.rotateObject.angle, 10, true, floorplan); + } + } + }); + // create array of selected wall endpoints and selected wallPart endpoints along the wall that represent measured stretches + walls.iterator.each(function (wall) { + var startpoint = wall.data.startpoint; + var endpoint = wall.data.endpoint; + var firstWallPt = ((startpoint.x + startpoint.y) <= (endpoint.x + endpoint.y)) ? startpoint : endpoint; + var lastWallPt = ((startpoint.x + startpoint.y) > (endpoint.x + endpoint.y)) ? startpoint : endpoint; + + // store all endpoints along with the part they correspond to (used later to either create DimensionLinks or simply adjust them) + var wallPartEndpoints = []; + wall.memberParts.iterator.each(function (wallPart) { + if (wallPart.isSelected) { + var endpoints = getWallPartEndpoints(wallPart); + wallPartEndpoints.push(endpoints[0]); + wallPartEndpoints.push(endpoints[1]); + } + }); + // sort all wallPartEndpoints by x coordinate left to right/ up to down + wallPartEndpoints.sort(function (a, b) { + if ((a.x + a.y) > (b.x + b.y)) return 1; + if ((a.x + a.y) < (b.x + b.y)) return -1; + else return 0; + }); + wallPartEndpoints.unshift(firstWallPt); + wallPartEndpoints.push(lastWallPt); + + var angle = wall.rotateObject.angle; + var k = 1; // k is a counter for the indices of PointNodes + // build / edit dimension links for each stretch, defined by pairs of points in wallPartEndpoints + for (var j = 0; j < wallPartEndpoints.length - 1; j++) { + var linkPoint1 = null; linkPoint2 = null; + floorplan.pointNodes.iterator.each(function (node) { + if (node.data.key === wall.data.key + "PointNode" + k) linkPoint1 = node; + if (node.data.key === wall.data.key + "PointNode" + (k + 1)) linkPoint2 = node; + }); + if (linkPoint1 !== null) { + var newLoc1 = getAdjustedPoint(wallPartEndpoints[j].copy(), wall, angle, 5); + var newLoc2 = getAdjustedPoint(wallPartEndpoints[j + 1].copy(), wall, angle, 5); + linkPoint1.data.loc = go.Point.stringify(newLoc1); + linkPoint2.data.loc = go.Point.stringify(newLoc2); + linkPoint1.updateTargetBindings(); + linkPoint2.updateTargetBindings(); + } + // only build new links if needed -- normally simply change pointNode locations + else buildDimensionLink(wall, k, wallPartEndpoints[j].copy(), wallPartEndpoints[j + 1].copy(), angle, 5, false, floorplan); + k += 2; + } + // total wall Dimension Link would be constructed of a kth and k+1st pointNode + var totalWallDimensionLink = null; + floorplan.dimensionLinks.iterator.each(function (link) { + if ((link.fromNode.data.key === wall.data.key + "PointNode" + k) && + (link.toNode.data.key === wall.data.key + "PointNode" + (k + 1))) totalWallDimensionLink = link; + }); + // if a total wall Dimension Link already exists, adjust its constituent point nodes + if (totalWallDimensionLink !== null) { + var linkPoint1 = null; var linkPoint2 = null; + floorplan.pointNodes.iterator.each(function (node) { + if (node.data.key === wall.data.key + "PointNode" + k) linkPoint1 = node; + if (node.data.key === wall.data.key + "PointNode" + (k + 1)) linkPoint2 = node; + }); + var newLoc1 = getAdjustedPoint(wallPartEndpoints[0].copy(), wall, angle, 25); + var newLoc2 = getAdjustedPoint(wallPartEndpoints[wallPartEndpoints.length - 1].copy(), wall, angle, 25); + linkPoint1.data.loc = go.Point.stringify(newLoc1); + linkPoint2.data.loc = go.Point.stringify(newLoc2); + linkPoint1.updateTargetBindings(); + linkPoint2.updateTargetBindings(); + } + // only build total wall Dimension Link (far out from wall to accomodate wallPart Dimension Links) if one does not already exist + else buildDimensionLink(wall, k, wallPartEndpoints[0].copy(), wallPartEndpoints[wallPartEndpoints.length - 1].copy(), angle, 25, false, floorplan); + }); + + // Cleanup: hide zero-length Dimension Links, DimensionLInks with null wall points + floorplan.dimensionLinks.iterator.each(function (link) { + var canStay = false; + floorplan.pointNodes.iterator.each(function (node) { + if (node.data.key == link.data.to) canStay = true; + }); + if (!canStay) floorplan.remove(link); + else { + var length = Math.sqrt(link.toNode.location.distanceSquaredPoint(link.fromNode.location)); + if (length < 1 && !link.data.soloWallFlag) link.visible = false; + } + }); + + floorplan.commitTransaction("update wall dimensions"); + floorplan.skipsUndoManager = false; +} + +/* +* Helper function for updateWallAngles(); returns the Point where two walls intersect; if they do not intersect, return null +* @param {Wall} wall1 +* @param {Wall} wall2 +*/ +var getWallsIntersection = function (wall1, wall2) { + if (wall1 === null || wall2 === null) return null; + // treat walls as lines; get lines in formula of ax + by = c + var a1 = wall1.data.endpoint.y - wall1.data.startpoint.y; + var b1 = wall1.data.startpoint.x - wall1.data.endpoint.x; + var c1 = (a1 * wall1.data.startpoint.x) + (b1 * wall1.data.startpoint.y); + var a2 = wall2.data.endpoint.y - wall2.data.startpoint.y; + var b2 = wall2.data.startpoint.x - wall2.data.endpoint.x; + var c2 = (a2 * wall2.data.startpoint.x) + (b2 * wall2.data.startpoint.y); + // Solve the system of equations, finding where the lines (not segments) would intersect + /** Algebra Explanation: + Line 1: a1x + b1y = c1 + Line 2: a2x + b2y = c2 + + Multiply Line1 equation by b2, Line2 equation by b1, get: + a1b1x + b1b2y = b2c1 + a2b1x + b1b2y = b1c2 + + Subtract bottom from top: + a1b2x - a2b1x = b2c1 - b1c2 + + Divide both sides by a1b2 - a2b1, get equation for x. Equation for y is analogous + **/ + var det = a1 * b2 - a2 * b1; + var x = null; var y = null; + // Edge Case: Lines are paralell + if (det === 0) { + // Edge Case: wall1 and wall2 have an endpoint to endpoint intersection (the only instance in which paralell walls could intersect at a specific point) + if (wall1.data.startpoint.equals(wall2.data.startpoint) || wall1.data.startpoint.equals(wall2.data.endpoint)) return wall1.data.startpoint; + if (wall1.data.endpoint.equals(wall2.data.startpoint) || wall1.data.endpoint.equals(wall2.data.endpoint)) return wall1.data.endpoint; + return null; + } + else { + x = (b2 * c1 - b1 * c2) / det; + y = (a1 * c2 - a2 * c1) / det; + } + // ensure proposed intersection is contained in both line segments (walls) + var inWall1 = ((Math.min(wall1.data.startpoint.x, wall1.data.endpoint.x) <= x) && (Math.max(wall1.data.startpoint.x, wall1.data.endpoint.x) >= x) + && (Math.min(wall1.data.startpoint.y, wall1.data.endpoint.y) <= y) && (Math.max(wall1.data.startpoint.y, wall1.data.endpoint.y) >= y)); + var inWall2 = ((Math.min(wall2.data.startpoint.x, wall2.data.endpoint.x) <= x) && (Math.max(wall2.data.startpoint.x, wall2.data.endpoint.x) >= x) + && (Math.min(wall2.data.startpoint.y, wall2.data.endpoint.y) <= y) && (Math.max(wall2.data.startpoint.y, wall2.data.endpoint.y) >= y)); + if (inWall1 && inWall2) return new go.Point(x, y); + else return null; +} + +/* +* Update Angle Nodes shown along a wall, based on which wall(s) is/are selected +*/ +Floorplan.prototype.updateWallAngles = function () { + var floorplan = this; + floorplan.skipsUndoManager = true; // do not store displaying angles as a transaction + floorplan.startTransaction("display angles"); + if (floorplan.model.modelData.preferences.showWallAngles) { + floorplan.angleNodes.iterator.each(function (node) { node.visible = true; }); + var selectedWalls = []; + floorplan.selection.iterator.each(function (part) { if (part.category === "WallGroup") selectedWalls.push(part); }); + for (var i = 0; i < selectedWalls.length; i++) { + var seen = new go.Set("string"); // Set of all walls "seen" thus far for "wall" + var wall = selectedWalls[i]; + var possibleWalls = floorplan.findNodesByExample({ category: "WallGroup" }); + + // go through all other walls; if the other wall intersects this wall, make angles + possibleWalls.iterator.each(function (otherWall) { + if (otherWall.data === null || wall.data === null || seen.contains(otherWall.data.key)) return; + if ((otherWall.data.key !== wall.data.key) && (getWallsIntersection(wall, otherWall) !== null) && (!seen.contains(otherWall.data.key))) { + + seen.add(otherWall.data.key); + // "otherWall" intersects "wall"; make or update angle nodes + var intersectionPoint = getWallsIntersection(wall, otherWall); + var wallsInvolved = floorplan.findObjectsNear(intersectionPoint, + 1, + function (x) { if (x.part !== null) return x.part; }, + function (p) { return p.category === "WallGroup"; }, + false); + + var endpoints = []; // store endpoints and their corresponding walls here + // gather endpoints of each wall in wallsInvolved; discard endpoints within a tolerance distance of intersectionPoint + wallsInvolved.iterator.each(function (w) { + var tolerance = (floorplan.model.modelData.gridSize >= 10) ? floorplan.model.modelData.gridSize : 10; + if (Math.sqrt(w.data.startpoint.distanceSquaredPoint(intersectionPoint)) > tolerance) endpoints.push({ point: w.data.startpoint, wall: w.data.key }); + if (Math.sqrt(w.data.endpoint.distanceSquaredPoint(intersectionPoint)) > tolerance) endpoints.push({ point: w.data.endpoint, wall: w.data.key }); + }); + + // find maxRadius (shortest distance from an involved wall's endpoint to intersectionPoint or 30, whichever is smaller) + var maxRadius = 30; + for (var i = 0; i < endpoints.length; i++) { + var distance = Math.sqrt(endpoints[i].point.distanceSquaredPoint(intersectionPoint)); + if (distance < maxRadius) maxRadius = distance; + } + + // sort endpoints in a clockwise fashion around the intersectionPoint + endpoints.sort(function (a, b) { + a = a.point; b = b.point; + if (a.x - intersectionPoint.x >= 0 && b.x - intersectionPoint.x < 0) return true; + if (a.x - intersectionPoint.x < 0 && b.x - intersectionPoint.x >= 0) return false; + if (a.x - intersectionPoint.x == 0 && b.x - intersectionPoint.x == 0) { + if (a.y - intersectionPoint.y >= 0 || b.y - intersectionPoint.y >= 0) return a.y > b.y; + return b.y > a.y; + } + + // compute the cross product of vectors (center -> a) x (center -> b) + var det = (a.x - intersectionPoint.x) * (b.y - intersectionPoint.y) - (b.x - intersectionPoint.x) * (a.y - intersectionPoint.y); + if (det < 0) return true; + if (det > 0) return false; + + // points a and b are on the same line from the center; check which point is closer to the center + var d1 = (a.x - intersectionPoint.x) * (a.x - intersectionPoint.x) + (a.y - intersectionPoint.y) * (a.y - intersectionPoint.y); + var d2 = (b.x - intersectionPoint.x) * (b.x - intersectionPoint.x) + (b.y - intersectionPoint.y) * (b.y - intersectionPoint.y); + return d1 > d2; + }); // end endpoints sort + + // for each pair of endpoints, construct or modify an angleNode + for (var i = 0; i < endpoints.length; i++) { + var p1 = endpoints[i]; + if (endpoints[i + 1] != null) var p2 = endpoints[i + 1]; + else var p2 = endpoints[0]; + var a1 = intersectionPoint.directionPoint(p1.point); + var a2 = intersectionPoint.directionPoint(p2.point); + var sweep = Math.abs(a2 - a1 + 360) % 360; + var angle = a1; + + /* + construct proper key for angleNode + proper angleNode key syntax is "wallWwallX...wallYangleNodeZ" such that W < Y < Y; angleNodes are sorted clockwise around the intersectionPoint by Z + */ + var keyArray = []; // used to construct proper key + wallsInvolved.iterator.each(function (wall) { keyArray.push(wall); }); + keyArray.sort(function (a, b) { + var aIndex = a.data.key.match(/\d+/g); + var bIndex = b.data.key.match(/\d+/g); + if (isNaN(aIndex)) return true; + if (isNaN(bIndex)) return false; + else return aIndex > bIndex; + }); + + var key = ""; + for (var j = 0; j < keyArray.length; j++) key += keyArray[j].data.key; + key += "angle" + i; + + // check if this angleNode already exists -- if it does, adjust data (instead of deleting/redrawing) + var angleNode = null; + floorplan.angleNodes.iterator.each(function (aNode) { if (aNode.data.key === key) angleNode = aNode; }); + if (angleNode !== null) { + angleNode.data.angle = angle; + angleNode.data.sweep = sweep; + angleNode.data.loc = go.Point.stringify(intersectionPoint); + angleNode.data.maxRadius = maxRadius; + angleNode.updateTargetBindings(); + } + // if this angleNode does not already exist, create it and add it to the diagram + else { + var data = { key: key, category: "AngleNode", loc: go.Point.stringify(intersectionPoint), stroke: "dodgerblue", angle: angle, sweep: sweep, maxRadius: maxRadius }; + var newAngleNode = makeAngleNode(); + newAngleNode.data = data; + floorplan.add(newAngleNode); + newAngleNode.updateTargetBindings(); + floorplan.angleNodes.add(newAngleNode); + } + } + } + }); + } + // garbage collection (angleNodes that should not exist any more) + var garbage = []; + floorplan.angleNodes.iterator.each(function (node) { + var keyNums = node.data.key.match(/\d+/g); // values X for all wall keys involved, given key "wallX" + var numWalls = (node.data.key.match(/wall/g) || []).length; // # of walls involved in in "node"'s construction + var wallsInvolved = []; + // add all walls involved in angleNode's construction to wallsInvolved + for (var i = 0; i < keyNums.length - 1; i++) wallsInvolved.push("wall" + keyNums[i]); + // edge case: if the numWalls != keyNums.length, that means the wall with key "wall" (no number in key) is involved + if (numWalls !== keyNums.length - 1) wallsInvolved.push("wall"); + + // Case 1: if any wall pairs involved in this angleNode are no longer intersecting, add this angleNode to "garbage" + for (var i = 0; i < wallsInvolved.length - 1; i++) { + var wall1 = floorplan.findPartForKey(wallsInvolved[i]); + var wall2 = floorplan.findPartForKey(wallsInvolved[i + 1]); + var intersectionPoint = getWallsIntersection(wall1, wall2); + if (intersectionPoint === null) garbage.push(node); + } + // Case 2: if there are angleNode clusters with the same walls in their keys as "node" but different locations, destroy and rebuild + // collect all angleNodes with same walls in their construction as "node" + var possibleAngleNodes = new go.Set(go.Node); + var allWalls = node.data.key.slice(0, node.data.key.indexOf("angle")); + floorplan.angleNodes.iterator.each(function (other) { if (other.data.key.includes(allWalls)) possibleAngleNodes.add(other); }); + possibleAngleNodes.iterator.each(function (pNode) { + if (pNode.data.loc !== node.data.loc) { + garbage.push(pNode); + } + }); + + // Case 3: put any angleNodes with sweep === 0 in garbage + if (node.data.sweep === 0) garbage.push(node); + }); + + for (var i = 0; i < garbage.length; i++) { + floorplan.remove(garbage[i]); // remove garbage + floorplan.angleNodes.remove(garbage[i]); + } + } + // hide all angles > 180 if show only small angles == true in preferences + if (floorplan.model.modelData.preferences.showOnlySmallWallAngles) { + floorplan.angleNodes.iterator.each(function (node) { if (node.data.sweep >= 180) node.visible = false; }); + } + // hide all angles if show wall angles == false in preferences + if (!floorplan.model.modelData.preferences.showWallAngles) { + floorplan.angleNodes.iterator.each(function (node) { node.visible = false; }); + } + floorplan.commitTransaction("display angles"); + floorplan.skipsUndoManager = false; +} \ No newline at end of file diff --git a/projects/floorplanner/FloorplanFilesystem.js b/projects/floorplanner/FloorplanFilesystem.js new file mode 100644 index 000000000..0bb4a7ee8 --- /dev/null +++ b/projects/floorplanner/FloorplanFilesystem.js @@ -0,0 +1,246 @@ +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation +* All Rights Reserved. +* +* Floorplan Filesystem Class +* Handles Floorplan-specific saving / loading model data events +* Attached to a specific instance of Floorplan (via constructor); can be assigned to Floorplan.floorplanFilesystem +* Currently only supports saving / loading from localstorage +*/ + +/* +* Floorplan Filesystem Constructor +* @param {Floorplan} floorplan A reference to a valid instance of Floorplan +* @param {Object} state A JSON object with string ids for UI objects (windows, listboxes, HTML elements) +* { +* openWindowId: {String} the id of the HTML window to open a file +* removeWindowId: {String} the id of the HTML window to remove files +* currentFileId: {String} the id of the HTML element containing the name of the currently open file +* filesToOpenListId: {String} the id of the HTML listbox in the openWindow +* filesToRemoveListId: {String} the id of the HTML listbox of the removeWindow +* } +*/ +function FloorplanFilesystem(floorplan, state) { + this._floorplan = floorplan; + this._UNSAVED_FILENAME = "(Unsaved File)"; + this._DEFAULT_MODELDATA = { + "units": "centimeters", + "unitsAbbreviation": "cm", + "gridSize": 10, + "wallWidth": 5, + "preferences": { + showWallGuidelines: true, + showWallLengths: true, + showWallAngles: true, + showOnlySmallWallAngles: true, + showGrid: true, + gridSnap: true + } + }; + this._state = state; +} + +// Get the Floorplan associated with this Floorplan Filesystem +Object.defineProperty(FloorplanFilesystem.prototype, "floorplan", { + get: function () { return this._floorplan; } +}); + +// Get constant name for an unsaved Floorplan +Object.defineProperty(FloorplanFilesystem.prototype, "UNSAVED_FILENAME", { + get: function () { return this._UNSAVED_FILENAME; } +}); + +// Get constant default model data (default Floorplan model data for a new Floorplan) +Object.defineProperty(FloorplanFilesystem.prototype, "DEFAULT_MODELDATA", { + get: function () { return this._DEFAULT_MODELDATA; } +}); + +// Get state information about this app's UI +Object.defineProperty(FloorplanFilesystem.prototype, "state", { + get: function () { return this._state; } +}); + +/* +* Helper functions +* Check Local Storage, Update File List, Open Element +*/ + +// Ensure local storage works in browser (not supported by MS IE/Edge) +function checkLocalStorage() { + try { + window.localStorage.setItem('item', 'item'); + window.localStorage.removeItem('item'); + return true; + } catch (e) { + return false; + } +} + +// Update listbox of files in window (for loading / removing files) +function updateFileList(id) { + // displays cached floor plan files in the listboxes + var listbox = document.getElementById(id); + // remove any old listing of files + var last; + while (last = listbox.lastChild) listbox.removeChild(last); + // now add all saved files to the listbox + for (key in window.localStorage) { + var storedFile = window.localStorage.getItem(key); + if (!storedFile) continue; + var option = document.createElement("option"); + option.value = key; + option.text = key; + listbox.add(option, null) + } +} + +// Open a specifed window element -- used for Remove / Open file windows +function openWindow(id, listid) { + var panel = document.getElementById(id); + if (panel.style.visibility === "hidden") { + updateFileList(listid); + panel.style.visibility = "visible"; + } +} + +/* +* Instance methods +* New Floorplan, Save Floorplan, Save Floorplan As, Load Floorplan, Remove Floorplan +* Show Open Window, Show Remove Window +* Set Current File Name, Get Current File Name +*/ + +// Create new floorplan (Ctrl + D or File -> New) +FloorplanFilesystem.prototype.newFloorplan = function() { + var floorplan = this.floorplan; + // checks to see if all changes have been saved + if (floorplan.isModified) { + var save = confirm("Would you like to save changes to " + this.getCurrentFileName() + "?"); + if (save) { + this.saveFloorplan(); + } + } + this.setCurrentFileName(this.UNSAVED_FILENAME); + // loads an empty diagram + var model = new go.GraphLinksModel; + // initialize all modelData + model.modelData = this.DEFAULT_MODELDATA; + floorplan.model = model; + floorplan.undoManager.isEnabled = true; + floorplan.isModified = false; + if (floorplan.floorplanUI) floorplan.floorplanUI.updateUI(); +} + +// Save current floor plan to local storage (Ctrl + S or File -> Save) +FloorplanFilesystem.prototype.saveFloorplan = function () { + if (checkLocalStorage()) { + var saveName = this.getCurrentFileName(); + if (saveName === this.UNSAVED_FILENAME) { + this.saveFloorplanAs(); + } else { + window.localStorage.setItem(saveName, this.floorplan.model.toJson()); + this.floorplan.isModified = false; + } + } +} + +// Save floor plan to local storage with a new name (File -> Save As) +FloorplanFilesystem.prototype.saveFloorplanAs = function () { + if (checkLocalStorage()) { + var saveName = prompt("Save file as...", this.getCurrentFileName()); + // if saveName is already in list of files, ask if overwrite is ok + if (saveName && saveName !== this.UNSAVED_FILENAME) { + var override = true; + if (window.localStorage.getItem(saveName) !== null) { + override = confirm("Do you want to overwrite " + saveName + "?"); + } + if (override) { + this.setCurrentFileName(saveName); + window.localStorage.setItem(saveName, this.floorplan.model.toJson()); + this.floorplan.isModified = false; + } + } + } +} + +// Load floorplan model data in "Open" window (Ctrl + O or File -> Open) +FloorplanFilesystem.prototype.loadFloorplan = function () { + var floorplan = this.floorplan; + var listbox = document.getElementById(this.state.filesToOpenListId); + var fileName = undefined; // get selected filename + for (var i = 0; i < listbox.options.length; i++) { + if (listbox.options[i].selected) fileName = listbox.options[i].text; // selected file + } + if (fileName !== undefined) { + var savedFile = window.localStorage.getItem(fileName); + this.loadFloorplanFromModel(savedFile); + floorplan.isModified = false; + this.setCurrentFileName(fileName); + } + if (floorplan.floorplanUI) floorplan.floorplanUI.closeElement(this.state.openWindowId); +} + +FloorplanFilesystem.prototype.loadFloorplanFromModel = function (str) { + var floorplan = this.floorplan; + floorplan.model = go.Model.fromJson(str); + floorplan.skipsUndoManager = true; + floorplan.startTransaction("generate walls"); + floorplan.nodes.each(function (node) { + if (node.category === "WallGroup") floorplan.updateWall(node); + }); + if (floorplan.floorplanUI) floorplan.floorplanUI.updateUI(); + + floorplan.commitTransaction("generate walls"); + floorplan.undoManager.isEnabled = true; + +} + +// Delete selected floorplan from local storage +FloorplanFilesystem.prototype.removeFloorplan = function () { + var floorplan = this.floorplan; + var listbox = document.getElementById(this.state.filesToRemoveListId); + var fileName = undefined; // get selected filename + for (var i = 0; i < listbox.options.length; i++) { + if (listbox.options[i].selected) fileName = listbox.options[i].text; // selected file + } + if (fileName !== undefined) { + // removes file from local storage + window.localStorage.removeItem(fileName); + } + if (floorplan.floorplanUI) floorplan.floorplanUI.closeElement(this.state.removeWindowId); +} + +// Check to see if all changes have been saved -> show the "Open" window +FloorplanFilesystem.prototype.showOpenWindow = function () { + if (checkLocalStorage()) { + if (this.floorplan.isModified) { + var save = confirm("Would you like to save changes to " + this.getCurrentFileName() + "?"); + if (save) { + this.saveFloorplan(); + } + } + openWindow(this.state.openWindowId, this.state.filesToOpenListId); + } +} + +// Show the Remove File window +FloorplanFilesystem.prototype.showRemoveWindow = function () { + if (checkLocalStorage()) { + openWindow(this.state.removeWindowId, this.state.filesToRemoveListId); + } +} + +// Add * to current file element if diagram has been modified +FloorplanFilesystem.prototype.setCurrentFileName= function(name) { + var currentFile = document.getElementById(this.state.currentFileId); + if (this.floorplan.isModified) name += "*"; + currentFile.textContent = name; +} + +// Get current file name from the current file element +FloorplanFilesystem.prototype.getCurrentFileName = function() { + var currentFile = document.getElementById(this.state.currentFileId); + var name = currentFile.textContent; + if (name[name.length - 1] === "*") return name.substr(0, name.length - 1); + return name; +} \ No newline at end of file diff --git a/projects/floorplanner/FloorplanPalette.js b/projects/floorplanner/FloorplanPalette.js new file mode 100644 index 000000000..26fdfa184 --- /dev/null +++ b/projects/floorplanner/FloorplanPalette.js @@ -0,0 +1,28 @@ +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation +* All Rights Reserved. +* +* Floorplan Palette Class +* A Palette linked to a specified Floorplan +*/ + +/* +* Floorplan Palette Constructor +* @param {HTMLDivElement|string} div A reference to a div or its ID as a string. +* @param {Floorplan} floorplan A valid instance of Floorplan +* @param {Array} nodeDataArray An array for the Palette's model's node data +*/ +function FloorplanPalette(div, floorplan, nodeDataArray) { + go.Palette.call(this, div); + + var $ = go.GraphObject.make; + this.model = $(go.GraphLinksModel, { nodeDataArray: nodeDataArray }); + this.contentAlignment = go.Spot.Center; + this.nodeTemplateMap = floorplan.nodeTemplateMap; + this.toolManager.contextMenuTool.isEnabled = false; + + // add this new FloorplanPalette to the "palettes" field of its associated Floorplan + floorplan.palettes.push(this); + +} go.Diagram.inherit(FloorplanPalette, go.Palette); + diff --git a/projects/floorplanner/FloorplanUI.js b/projects/floorplanner/FloorplanUI.js new file mode 100644 index 000000000..9612f972c --- /dev/null +++ b/projects/floorplanner/FloorplanUI.js @@ -0,0 +1,793 @@ +/* +* Copyright (C) 1998-2017 by Northwoods Software Corporation +* All Rights Reserved. +* +* FLOOR PLANN UI CLASS +* Handle GUI manipulation (showing/changing data, populating windows, etc) for Floorplanner.html +*/ + +/* +* Floorplan UI Constructor +* @param {Floorplan} floorplan A reference to a valid instance of Floorplan +* @param {String} name The name of this FloorplanUI instance known to the DOM +* @param {String} The name of this UI's floorplan known to the DOM +* @param {Object} state A JSON object with string ids for UI HTML elements. Format is as follows: + menuButtons: { + selectionInfoWindowButtonId: + palettesWindowButtonId: + overviewWindowButtonId: + optionsWindowButtonId: + statisticsWindowButtonId: + } + windows: { + diagramHelpDiv: { + id: + } + selectionInfoWindow: { + id: + textDivId: + handleId: + colorPickerId: + heightLabelId: + heightInputId: + widthInputId: + nodeGroupInfoId: + nameInputId: + notesTextareaId: + } + palettesWindow:{ + id: + furnitureSearchInputId: + furniturePaletteId: + } + overviewWindow: { + id: + } + optionsWindow: { + id: + gridSizeInputId: + unitsFormId: + unitsFormName: + checkboxes: { + showGridCheckboxId: + gridSnapCheckboxId: + wallGuidelinesCheckboxId: + wallLengthsCheckboxId: + wallAnglesCheckboxId: + smallWallAnglesCheckboxId: + } + } + statisticsWindow: { + id: + textDivId: + numsTableId: + totalsTableId: + } + } + scaleDisplayId: + setBehaviorClass: + wallWidthInputId: + wallWidthBoxId: + unitsBoxId: + unitsInputId: +*/ +function FloorplanUI(floorplan, name, floorplanName, state) { + this._floorplan = floorplan; + this._name = name; + this._floorplanName = floorplanName; + this._state = state; + this._furnitureNodeData = null; // used for searchFurniture function. set only once +} + +// Get Floorplan associated with this UI +Object.defineProperty(FloorplanUI.prototype, "floorplan", { + get: function () { return this._floorplan; } +}); + +// Get state object containing many ids of various UI elements +Object.defineProperty(FloorplanUI.prototype, "state", { + get: function () { return this._state; } +}); + +// Get name of this FloorplanUI instance known to the DOM +Object.defineProperty(FloorplanUI.prototype, "name", { + get: function () { return this._name; } +}); + +// Get name of the Floorplan associated with this FloorplanUI instance known to the DOM +Object.defineProperty(FloorplanUI.prototype, "floorplanName", { + get: function () { return this._floorplanName; } +}); + +Object.defineProperty(FloorplanUI.prototype, "furnitureData", { + get: function () { return this._furnitureData; }, + set: function (val) { this._furnitureData = val; } +}); + +/* +* UI manipulation: +* Open Element, Close Element, Hide/Show Element, Adjust Scale, ChangeGridSize, +* Search Furniture, Checkbox Changed, Change Units, Set Behavior, Update UI +*/ + +/* +* Open a specifed window element (used with Open / Remove windows) +* @param {String} id The ID of the window to open +* @param {String} listid The ID of the listview element in the window +*/ +FloorplanUI.prototype.openElement = function(id, listId) { + var panel = document.getElementById(id); + if (panel.style.visibility === "hidden") { + updateFileList(listId); + panel.style.visibility = "visible"; + } +} + +/* +* Hide the window elements when the "X" button is pressed +* @param {String} id The ID of the window to close +*/ +FloorplanUI.prototype.closeElement = function(id) { + var windows = this.state.windows; + var menuButtons = this.state.menuButtons; + var panel = document.getElementById(id); + if (id === windows.selectionInfoWindow.id) document.getElementById(menuButtons.selectionInfoWindowButtonId).innerHTML = "Show Node Info Help

    (Ctrl + I)

    "; + if (id === windows.palettesWindow.id) document.getElementById(menuButtons.palettesWindowButtonId).innerHTML = "Show Palettes

    (Ctrl + P)

    "; + if (id === windows.overviewWindow.id) document.getElementById(menuButtons.overviewWindowButtonId).innerHTML = "Show Overview

    (Ctrl + E)

    "; + if (id === windows.optionsWindow.id) document.getElementById(menuButtons.optionsWindowButtonId).innerHTML = "Show Options

    (Ctrl + B)

    "; + if (id === windows.statisticsWindow.id) document.getElementById(menuButtons.statisticsWindowButtonId).innerHTML = "Show Statistics

    (Ctrl + G)

    "; + panel.style.visibility = "hidden"; +} + +/* +* Hide or show specific help/windows (used mainly with hotkeys) +* @param {String} id The ID of the window to show / hide +*/ +FloorplanUI.prototype.hideShow = function(id) { + var element = document.getElementById(id); var str; + var windows = this.state.windows; + switch (id) { + case windows.diagramHelpDiv.id: str = 'Diagram Help'; char = 'H'; break; + case windows.selectionInfoWindow.id: str = 'Selection Help'; char = 'I'; break; + case windows.overviewWindow.id: str = 'Overview'; char = 'E'; break; + case windows.optionsWindow.id: str = 'Options'; char = 'B'; break; + case windows.statisticsWindow.id: str = 'Statistics'; char = 'G'; break; + case windows.palettesWindow.id: str = 'Palettes'; char = 'P'; { + furniturePalette.layoutDiagram(true); + wallPartsPalette.layoutDiagram(true); + break; + } + } + if (element.style.visibility === "visible") { + element.style.visibility = "hidden"; + document.getElementById(id + 'Button').innerHTML = "Show " + str + "

    (Ctrl + " + char + " )

    "; + } else { + element.style.visibility = "visible"; + document.getElementById(id + 'Button').innerHTML = "Hide " + str + "

    (Ctrl + " + char + " )

    "; + } +} + +/* +* Set text under Diagram to suggest most common functions user could perform +* @param {String} str The text to display in the Diagram Help div +*/ +FloorplanUI.prototype.setDiagramHelper = function(str) { + var windows = this.state.windows; + document.getElementById(windows.diagramHelpDiv.id).innerHTML = '

    ' + str + '

    '; +} + +/* +* Increase / decrease diagram scale to the nearest 10% +* @param {String} sign Accepted values are "+" and "-" +*/ +FloorplanUI.prototype.adjustScale = function(sign) { + var floorplan = this.floorplan; + var el = document.getElementById(this.state.scaleDisplayId); + floorplan.startTransaction('Change Scale'); + switch (sign) { + case '-': floorplan.scale -= .1; break; + case '+': floorplan.scale += .1; break; + } + floorplan.scale = parseFloat((Math.round(floorplan.scale / .1) * .1).toFixed(2)); + var scale = (floorplan.scale * 100).toFixed(2); + el.innerHTML = 'Scale: ' + scale + '%'; + floorplan.commitTransaction('Change Scale'); +} + +// Change edge length of the grid based on input +FloorplanUI.prototype.changeGridSize = function () { + var floorplan = this.floorplan; + floorplan.skipsUndoManager = true; + floorplan.startTransaction("change grid size"); + var el = document.getElementById(this.state.windows.optionsWindow.gridSizeInputId); var input; + if (!isNaN(el.value) && el.value != null && el.value != '' && el.value != undefined) input = parseFloat(el.value); + else { + el.value = floorplan.convertPixelsToUnits(10); // if bad input given, revert to 20cm (10px) or unit equivalent + input = parseFloat(el.value); + } + input = floorplan.convertUnitsToPixels(input); + floorplan.grid.gridCellSize = new go.Size(input, input); + floorplan.toolManager.draggingTool.gridCellSize = new go.Size(input, input); + floorplan.model.setDataProperty(floorplan.model.modelData, "gridSize", input); + floorplan.commitTransaction("change grid size"); + floorplan.skipsUndoManager = false; +} + +// Search through all elements in the furniture palette (useful for a palette with many furniture nodes) +FloorplanUI.prototype.searchFurniture = function () { + var ui = this; + var floorplan = this.floorplan; + var furniturePaletteId = ui.state.windows.palettesWindow.furniturePaletteId; + var str = document.getElementById(ui.state.windows.palettesWindow.furnitureSearchInputId).value; + var furniturePalette = null; + for (var i = 0; i < floorplan.palettes.length; i++) { + var palette = floorplan.palettes[i]; + if (palette.div.id == furniturePaletteId) { + furniturePalette = floorplan.palettes[i]; + } + } + if (ui.furnitureData == null) ui.furnitureData = furniturePalette.model.nodeDataArray; + var items = furniturePalette.model.nodeDataArray.slice(); + if (str !== null && str !== undefined && str !== "") { + for (var i = 0; i < items.length; i += 0) { + var item = items[i]; + if (!item.type.toLowerCase().includes(str.toLowerCase())) { + items.splice(i, 1); + } + else i++; + } + furniturePalette.model.nodeDataArray = items; + } + else furniturePalette.model.nodeDataArray = ui.furnitureData; + furniturePalette.updateAllRelationshipsFromData(); +} + +/* +* Change the "checked" value of checkboxes in the Options Menu, and to have those changes reflected in app behavior / model data +* @param {String} id The ID of the changed checkbox +*/ +FloorplanUI.prototype.checkboxChanged = function (id) { + var floorplan = this.floorplan; + var checkboxes = this.state.windows.optionsWindow.checkboxes; + floorplan.skipsUndoManager = true; + floorplan.startTransaction("change preference"); + var element = document.getElementById(id); + switch (id) { + case checkboxes.showGridCheckboxId: { + floorplan.grid.visible = element.checked; + floorplan.model.modelData.preferences.showGrid = element.checked; + break; + } + case checkboxes.gridSnapCheckboxId: { + floorplan.toolManager.draggingTool.isGridSnapEnabled = element.checked; + floorplan.model.modelData.preferences.gridSnap = element.checked; + break; + } + case checkboxes.wallGuidelinesCheckboxId: floorplan.model.modelData.preferences.showWallGuidelines = element.checked; break; + case checkboxes.wallLengthsCheckboxId: floorplan.model.modelData.preferences.showWallLengths = element.checked; floorplan.updateWallDimensions(); break; + case checkboxes.wallAnglesCheckboxId: floorplan.model.modelData.preferences.showWallAngles = element.checked; floorplan.updateWallAngles(); break; + case checkboxes.smallWallAnglesCheckboxId: floorplan.model.modelData.preferences.showOnlySmallWallAngles = element.checked; floorplan.updateWallAngles(); break; + } + floorplan.commitTransaction("change preference"); + floorplan.skipsUndoManager = false; +} + +// Adjust units based on the selected radio button in the Options Menu +FloorplanUI.prototype.changeUnits = function() { + var floorplan = this.floorplan; + floorplan.startTransaction("set units"); + var prevUnits = floorplan.model.modelData.units; + var radios = document.forms[this.state.windows.optionsWindow.unitsFormId].elements[this.state.windows.optionsWindow.unitsFormName]; + for (var i = 0; i < radios.length; i++) { + if (radios[i].checked) { + floorplan.model.setDataProperty(floorplan.model.modelData, "units", radios[i].id); + } + } + var units = floorplan.model.modelData.units; + switch (units) { + case 'centimeters': floorplan.model.setDataProperty(floorplan.model.modelData, "unitsAbbreviation", 'cm'); break; + case 'meters': floorplan.model.setDataProperty(floorplan.model.modelData, "unitsAbbreviation", 'm'); break; + case 'feet': floorplan.model.setDataProperty(floorplan.model.modelData, "unitsAbbreviation", 'ft'); break; + case 'inches': floorplan.model.setDataProperty(floorplan.model.modelData, "unitsAbbreviation", 'in'); break; + } + var unitsAbbreviation = floorplan.model.modelData.unitsAbbreviation; + // update all units boxes with new units + var unitAbbrevInputs = document.getElementsByClassName(this.state.unitsBoxClass); + for (var i = 0; i < unitAbbrevInputs.length; i++) { + unitAbbrevInputs[i].value = unitsAbbreviation; + } + var unitInputs = document.getElementsByClassName(this.state.unitsInputClass); + for (var i = 0; i < unitInputs.length; i++) { + var input = unitInputs[i]; + floorplan.model.setDataProperty(floorplan.model.modelData, "units", prevUnits); + var value = floorplan.convertUnitsToPixels(input.value); + floorplan.model.setDataProperty(floorplan.model.modelData, "units", units) + value = floorplan.convertPixelsToUnits(value); + input.value = value; + } + if (floorplan.selection.count === 1) this.setSelectionInfo(floorplan.selection.first()); // reload node info measurements according to new units + floorplan.commitTransaction("set units"); +} + +/* +* Set current tool (selecting/dragging or wallbuilding/reshaping) +* @param {String} string Informs what behavior to switch to. Accepted values: "dragging", "wallbuilding" +*/ +FloorplanUI.prototype.setBehavior = function (string) { + var floorplan = this.floorplan; + var ui = this; + var wallBuildingTool = floorplan.toolManager.mouseDownTools.elt(0); + var wallReshapingTool = floorplan.toolManager.mouseDownTools.elt(3); + // style the current tool HTML button accordingly + var elements = document.getElementsByClassName(this.state.setBehaviorClass); + for (var i = 0; i < elements.length; i++) { + var el = elements[i]; + if (el.id === string + "Button") el.style.backgroundColor = '#4b545f'; + else el.style.backgroundColor = '#bbbbbb'; + } + var wallWidthBox = document.getElementById(this.state.wallWidthBoxId) + if (string === 'wallBuilding') { + wallBuildingTool.isEnabled = true; + wallReshapingTool.isEnabled = false; + + floorplan.skipsUndoManager = true; + floorplan.startTransaction("change wallWidth"); + // create walls with wallWidth in input box + floorplan.model.setDataProperty(floorplan.model.modelData, 'wallWidth', parseFloat(document.getElementById('wallWidthInput').value)); + var wallWidth = floorplan.model.modelData.wallWidth; + if (isNaN(wallWidth)) floorplan.model.setDataProperty(floorplan.model.modelData, 'wallWidth', 5); + else { + var width = floorplan.convertUnitsToPixels(wallWidth); + floorplan.model.setDataProperty(floorplan.model.modelData, 'wallWidth', width); + } + floorplan.commitTransaction("change wallWidth"); + floorplan.skipsUndoManager = false; + wallWidthBox.style.visibility = 'visible'; + wallWidthBox.style.display = 'inline-block'; + ui.setDiagramHelper("Click and drag on the diagram to draw a wall (hold SHIFT for 45 degree angles)"); + } + if (string === 'dragging') { + wallBuildingTool.isEnabled = false; + wallReshapingTool.isEnabled = true; + wallWidthBox.style.visibility = 'hidden'; + wallWidthBox.style.display = 'none'; + } + // clear resize adornments on walls/windows, if there are any + floorplan.nodes.iterator.each(function (n) { n.clearAdornments(); }) + floorplan.clearSelection(); +} + +/* +* Populating UI Windows from Floorplan data: +* Update UI, Update Statistics, Fill Rows With Nodes, Set Selection Info, Set Color, Set Height, Set Width, Apply Selection Changes +*/ + +// Update the UI properly in accordance with model.modelData (called only when a new floorplan is loaded or created) +FloorplanUI.prototype.updateUI = function () { + var floorplan = this.floorplan; + var modelData = floorplan.model.modelData; + var checkboxes = this.state.windows.optionsWindow.checkboxes; + if (floorplan.floorplanUI) floorplan.floorplanUI.changeUnits(); + document.getElementById(this.state.wallWidthInputId).value = floorplan.convertPixelsToUnits(modelData.wallWidth); + // update options GUI based on floorplan.model.modelData.preferences + var preferences = modelData.preferences; + document.getElementById(checkboxes.showGridCheckboxId).checked = preferences.showGrid; + document.getElementById(checkboxes.gridSnapCheckboxId).checked = preferences.gridSnap; + document.getElementById(checkboxes.wallGuidelinesCheckboxId).checked = preferences.showWallGuidelines; + document.getElementById(checkboxes.wallLengthsCheckboxId).checked = preferences.showWallLengths; + document.getElementById(checkboxes.wallAnglesCheckboxId).checked = preferences.showWallAngles; + document.getElementById(checkboxes.smallWallAnglesCheckboxId).checked = preferences.showOnlySmallWallAngles; +} + +// Update all statistics in Statistics Window - called when a Floorplan's model is changed +FloorplanUI.prototype.updateStatistics = function () { + var floorplan = this.floorplan; + var statsWindow = this.state.windows.statisticsWindow; + var element = document.getElementById(statsWindow.textDivId); + element.innerHTML = "
    Item Types
    Totals
    "; + // fill Item Types table with node type/count of all nodes in diagram + var numsTable = document.getElementById(statsWindow.numsTableId); + + // get all palette nodes associated with this Floorplan + var palettes = floorplan.palettes; + var allPaletteNodes = []; + for (var i = 0; i < palettes.length; i++) { + allPaletteNodes = allPaletteNodes.concat(palettes[i].model.nodeDataArray); + } + + for (var i = 0; i < allPaletteNodes.length; i++) { + var type = allPaletteNodes[i].type; + var num = floorplan.findNodesByExample({ type: type }).count; + if (num > 0) // only display data for nodes that exist on the diagram + numsTable.innerHTML += " " + type + " " + num + ""; + } + // fill Totals table with lengths of all walls + totalsTable = document.getElementById('totalsTable'); + var walls = floorplan.findNodesByExample({ category: "WallGroup" }); + var totalLength = 0; + walls.iterator.each(function (wall) { + var wallLength = Math.sqrt(wall.data.startpoint.distanceSquaredPoint(wall.data.endpoint)); + totalLength += wallLength; + }); + totalLength = floorplan.convertPixelsToUnits(totalLength).toFixed(2); + var unitsAbbreviation = floorplan.model.modelData.unitsAbbreviation; + totalsTable.innerHTML += "Wall Lengths" + totalLength + unitsAbbreviation + ""; +} + +/* Helper function for setSelectionInfo(); displays all nodes in a given set in a given 1 or 2 rows in a given HTML element +* @param {Iterable | Array} iterator A iterable collection of nodes to display in rows +* @param {String} element The ID of the HTML element to fill with this data +* @param {String} selectedKey The key of the currently selected node -- this node's name will be styled differently in the rows +*/ +// TODO some repetitive code here +FloorplanUI.prototype.fillRowsWithNodes = function(iterator, element, selectedKey) { + var floorplan = this.floorplan; + var ui = this; + var arr = []; + if (iterator.constructor !== Array) iterator.each(function (p) { arr.push(p); }); + else arr = iterator; + + // helper + function makeOnClick(key) { + return ui.name + '.setSelectionInfo(' + ui.floorplanName + '.findPartForKey(' + "'" + key + "'" + '))'; + } + + for (var i = 0; i < arr.length; i += 2) { + if (arr[i].data === null) { this.setSelectionInfo('Nothing selected'); return; } + var key1 = arr[i].data.key; // keys used to locate the node if clicked on... + var name1 = (arr[i].data.caption !== "MultiPurposeNode") ? arr[i].data.caption : arr[i].data.text; // ... names are editable, so users can distinguish between nodes + // if there are two nodes for this row... + if (arr[i + 1] != undefined && arr[i + 1] != null) { + var key2 = arr[i + 1].data.key; + var name2 = (arr[i + 1].data.caption !== "MultiPurposeNode") ? arr[i + 1].data.caption : arr[i + 1].data.text; + // if there's a non-null selectedKey, highlight the selected node in the list + if (key1 === selectedKey) element.innerHTML += '

    ' + name1 + + '

    ' + name2 + '

    '; + + else if (key2 === selectedKey) element.innerHTML += '

    ' + name1 + + '

    ' + name2 + '

    '; + + else element.innerHTML += '

    ' + name1 + + '

    ' + name2 + '

    '; + } + // if there's only one node for this row... + else { + if (key1 === selectedKey) element.innerHTML += '

    ' + name1 + '

    '; + else element.innerHTML += '

    ' + name1 + '

    '; + } + } +} + +/* +* Displays dynamic, editable info about selection in Selection Info window (height/length, width, name, group info, color, etc.) +* @param {Node | String} node Can be: Reference to Node / Group, go.Node/go.Group key, "Selection" (indicating multi-selection), "Nothing selected" +*/ +FloorplanUI.prototype.setSelectionInfo = function(node) { + var floorplan = this.floorplan; + var ui = this; + if (node instanceof go.GraphObject) node = node.part; + var selectionInfoWindow = this.state.windows.selectionInfoWindow; + var element = document.getElementById(selectionInfoWindow.textDivId); + var state = this.state; + var infoWindow = document.getElementById(selectionInfoWindow.id); + if (element === null || infoWindow === null) return; + if (node === 'Nothing selected' || node.layer === null || node === null) { element.innerHTML = '

    ' + node + '

    '; return; } + + // if there are multiple nodes selected, show all their names, allowing user to click on the node they want + if (node === 'Selection: ') { + var selectionIterator = floorplan.selection.iterator; var arr = []; + element.innerHTML = '

    Selection (' + selectionIterator.count + ' items selected):

    '; + this.fillRowsWithNodes(selectionIterator, element, null); + infoWindow.style.height = document.getElementById(selectionInfoWindow.textDivId).offsetHeight + document.getElementById(selectionInfoWindow.handleId).offsetHeight + 5 + 'px'; + return; + } + + // TODO clean this to be usable by a more general template scheme + // if we have one node selected, gather pertinent information for that node.... + floorplan.select(node); + var name = ''; var length; var width; var nodeGroupCount = 0; var notes = node.data.notes; + // get node name + if (node.category === 'MultiPurposeNode') name = node.data.text; + else name = node.data.caption; + // get node height / width (dependent on node category) + if (node.category === 'WallGroup') { + height = floorplan.convertPixelsToUnits(Math.sqrt(node.data.startpoint.distanceSquared(node.data.endpoint.x, node.data.endpoint.y))).toFixed(2); // wall length + width = floorplan.convertPixelsToUnits(node.data.strokeWidth).toFixed(2); + } else if (node.category === 'DoorNode') { + height = floorplan.convertPixelsToUnits(node.data.width).toFixed(2); + width = floorplan.convertPixelsToUnits(node.data.width).toFixed(2); + } else if (node.data.isGroup && node.category !== "WallGroup") { + height = floorplan.convertPixelsToUnits(node.actualBounds.height).toFixed(2); + width = floorplan.convertPixelsToUnits(node.actualBounds.width).toFixed(2); + } else { + height = floorplan.convertPixelsToUnits(node.data.height).toFixed(2); + width = floorplan.convertPixelsToUnits(node.data.width).toFixed(2); + } + // get node group info + if (node.containingGroup != null && node.containingGroup != undefined) { + var nodeGroupParts = node.containingGroup.memberParts; + nodeGroupCount = nodeGroupParts.count; + } + if (node.data.isGroup) { + var nodeGroupParts = node.memberParts; + nodeGroupCount = nodeGroupParts.count; + } + var unitsAbbreviation = floorplan.model.modelData.unitsAbbreviation; + + //... then display that information in the selection info window + element.innerHTML = '

    Name: ' + '' + '

    '; + // display node notes in a textarea + element.innerHTML += "

    Notes:

    "; + // display color as a color picker element (individual nodes only) + if (!node.data.isGroup && node.data.category !== "DoorNode" && node.data.category !== "WindowNode") { + element.innerHTML += '

    Color:

    '; + } + + // display "Door Length" input (Door Nodes only) + if (node.category === "DoorNode") element.innerHTML += '

    Door Length:
    ' + + '

    '; + // display the editable properties height and width (non-Door nodes) + else element.innerHTML += '

    Height:

    ' + '

    Width:

    ' + '

    '; + + // for walls "height" is displayed as "length" + if (node.category === 'WallGroup') document.getElementById(selectionInfoWindow.heightLabelId).innerHTML = 'Length:
    '; + + // do not allow height or width adjustment for group info + if (node.data.isGroup && node.category !== "WallGroup") { + document.getElementById(selectionInfoWindow.heightInputId).disabled = true; + document.getElementById(selectionInfoWindow.widthInputId).disabled = true; + } + + // "Apply Changes" button + element.innerHTML += '
    '; + + // display group info for standard groups, wallParts for walls + var groupName = null; var groupKey = null; var selectedKey = ""; + if (node.data.isGroup === true) { + groupName = node.data.caption; + groupKey = node.data.key; + selectedKey = "selectedKey"; // the 'group' node is selected; make it blue to show this + } + if (node.containingGroup !== null) { + groupName = node.containingGroup.data.caption; + groupKey = node.containingGroup.data.key; + } + if (groupName !== null) { + groupKey = "'" + groupKey + "'"; + element.innerHTML += '
    ' + + groupName + ' Info (' + nodeGroupCount + ' member(s) in ' + groupName + ')
    '; + if (nodeGroupCount != 0) ui.fillRowsWithNodes(nodeGroupParts, document.getElementById(selectionInfoWindow.nodeGroupInfoId), node.data.key); + } + + // dynamically adjust the name of node based on user input + var nameInput = document.getElementById(selectionInfoWindow.nameInputId); + if (!floorplan.isReadOnly) { + nameInput.addEventListener('input', function (e) { + var value = nameInput.value; + floorplan.skipsUndoManager = true; + floorplan.startTransaction("rename node"); + if (value === null || value === "" || value === undefined) { floorplan.commitTransaction("rename node"); return; } + floorplan.model.setDataProperty(node.data, "caption", value); + floorplan.model.setDataProperty(node.data, "text", value); // if node is a multi purpose node, update the text on it + floorplan.commitTransaction("rename node"); + floorplan.skipsUndoManager = false; + }); + + // dynamically adjust the notes of the node based on user input + var notesTextarea = document.getElementById(selectionInfoWindow.notesTextareaId); + notesTextarea.addEventListener('input', function (e) { + var value = notesTextarea.value; + floorplan.skipsUndoManager = true; + floorplan.startTransaction("edit node notes"); + if (value === null || value === undefined) return; + floorplan.model.setDataProperty(node.data, "notes", value); + floorplan.commitTransaction("edit node notes"); + floorplan.skipsUndoManager = false; + }); + infoWindow.style.height = document.getElementById(selectionInfoWindow.textDivId).offsetHeight + document.getElementById(selectionInfoWindow.handleId).offsetHeight + 5 + 'px'; + } +} + +// Triggered by "Apply Changes"; set model data for fill color of the current selection +FloorplanUI.prototype.setColor = function () { + var floorplan = this.floorplan; + var node = floorplan.selection.first(); + var colorPicker = document.getElementById(this.state.windows.selectionInfoWindow.colorPickerId); + if (colorPicker !== null) { + floorplan.startTransaction("recolor node"); + floorplan.model.setDataProperty(node.data, "color", colorPicker.value); + floorplan.model.setDataProperty(node.data, "stroke", invertColor(colorPicker.value)) + floorplan.commitTransaction("recolor node"); + } +} + +// Triggered by "Apply Changes"; set model data for height of the currently selected node (also handles door length for doors, wall length for walls) +FloorplanUI.prototype.setHeight = function () { + var floorplan = this.floorplan; + var node = floorplan.selection.first(); + var heightInput = document.getElementById(this.state.windows.selectionInfoWindow.heightInputId); + var value = parseFloat(floorplan.convertUnitsToPixels(heightInput.value)); + if (isNaN(value)) { + alert("Please enter a number in the height input"); + setSelectionInfo(node, floorplan); + return; + } + floorplan.skipsUndoManager = true; + floorplan.startTransaction("resize node"); + if (!floorplan.isReadOnly) { + // Case: Standard / Multi-Purpose Nodes; basic height adjustment + if (node.category !== 'WallGroup' && node.category !== "WindowNode" && node.category !== 'DoorNode') { + floorplan.model.setDataProperty(node.data, "height", value); + } + // Case: Door Nodes / Window Nodes; "Door Length" is node height and width + else if (node.category === 'DoorNode' || node.category === "WindowNode") { + var wall = floorplan.findPartForKey(node.data.group); + var loc = node.location.copy(); + if (wall !== null) { + var wallLength = Math.sqrt(wall.data.startpoint.distanceSquaredPoint(wall.data.endpoint)); + if (wallLength < value) { + value = wallLength; + loc = new go.Point((wall.data.startpoint.x + wall.data.endpoint.x) / 2, (wall.data.startpoint.y + wall.data.endpoint.y) / 2); + } + } + if (node.category === "DoorNode") floorplan.model.setDataProperty(node.data, "width", value); // for door nodes, width dictates height as well + node.location = loc; + floorplan.updateWallDimensions(); + } + // Case: Wall Groups; wall length adjustment; do not allow walls to be shorter than the distance between their fathest apart wallParts + else { + var sPt = node.data.startpoint.copy(); + var ePt = node.data.endpoint.copy(); + var angle = sPt.directionPoint(ePt); + + var midPoint = new go.Point(((sPt.x + ePt.x) / 2), ((sPt.y + ePt.y) / 2)); + var newEpt = new go.Point((midPoint.x + (value / 2)), midPoint.y); + var newSpt = new go.Point((midPoint.x - (value / 2)), midPoint.y); + newEpt.offset(-midPoint.x, -midPoint.y).rotate(angle).offset(midPoint.x, midPoint.y); + newSpt.offset(-midPoint.x, -midPoint.y).rotate(angle).offset(midPoint.x, midPoint.y); + + // Edge Case 1: The user has input a length shorter than the edge wallPart's endpoints allow + // find the endpoints of the wallparts closest to the endpoints of the wall + var closestPtToSpt = null; var farthestPtFromSpt; + var closestDistToSpt = Number.MAX_VALUE; var farthestDistFromSpt = 0; + node.memberParts.iterator.each(function (wallPart) { + var endpoints = getWallPartEndpoints(wallPart); + var endpoint1 = endpoints[0]; + var endpoint2 = endpoints[1]; + var distance1 = Math.sqrt(endpoint1.distanceSquaredPoint(sPt)); + var distance2 = Math.sqrt(endpoint2.distanceSquaredPoint(sPt)); + + if (distance1 < closestDistToSpt) { + closestDistToSpt = distance1; + closestPtToSpt = endpoint1; + } if (distance1 > farthestDistFromSpt) { + farthestDistFromSpt = distance1; + farthestPtFromSpt = endpoint1; + } if (distance2 < closestDistToSpt) { + closestDistToSpt = distance2; + closestPtToSpt = endpoint2; + } if (distance2 > farthestDistFromSpt) { + farthestDistFromSpt = distance2; + farthestPtFromSpt = endpoint2; + } + }); + + if (closestPtToSpt !== null) { + // if the proposed length is smaller than the minDistance, set wall length to minDistance + var proposedDistance = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); + var minDistance = Math.sqrt(closestPtToSpt.distanceSquaredPoint(farthestPtFromSpt)); + if (proposedDistance < minDistance) { + newSpt = closestPtToSpt; + newEpt = farthestPtFromSpt; + } + } + + /* + * Edge Case 2: The new wall endpoints constructed based on user input do not generate a wall too short for the wall's edge wallPart's endpoints; + * however, there is/are a/some wallPart(s) that do not fit along the new wall endpoints (due to midpoint construction) + * if a wallPart endpoint is outside the line created by newSpt and newEpt, adjust the endpoints accordingly + */ + var farthestPtFromWallPt = null; var farthestFromWallPtDist = 0; + node.memberParts.iterator.each(function (part) { + var endpoints = getWallPartEndpoints(part); + // check for endpoints of wallParts not along the line segment made by newSpt and newEpt + for (var i = 0; i < endpoints.length; i++) { + var point = endpoints[i]; + var distanceToStartPoint = parseFloat(Math.sqrt(point.distanceSquaredPoint(newSpt)).toFixed(2)); + var distanceToEndPoint = parseFloat(Math.sqrt(point.distanceSquaredPoint(newEpt)).toFixed(2)); + var wallLength = parseFloat(Math.sqrt(newSpt.distanceSquaredPoint(newEpt)).toFixed(2)); + if ((distanceToStartPoint + distanceToEndPoint).toFixed(2) !== wallLength.toFixed(2)) { + var testDistance = Math.sqrt(point.distanceSquaredPoint(newSpt)); + if (testDistance > farthestFromWallPtDist) { + farthestFromWallPtDist = testDistance; + farthestPtFromWallPt = point; + } + } + } + }); + + // if a wallPart endpoint is outside the wall, adjust the endpoints of the wall to accomodate it + if (farthestPtFromWallPt !== null) { + var distance = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); + if (farthestPtFromWallPt.distanceSquaredPoint(newSpt) < farthestPtFromWallPt.distanceSquaredPoint(newEpt)) { + newSpt = farthestPtFromWallPt; + var totalLength = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); + newEpt = new go.Point(newSpt.x + ((distance / totalLength) * (newEpt.x - newSpt.x)), + newSpt.y + ((distance / totalLength) * (newEpt.y - newSpt.y))); + } else { + newEpt = farthestPtFromWallPt; + var totalLength = Math.sqrt(newSpt.distanceSquaredPoint(newEpt)); + newSpt = new go.Point(newEpt.x + ((distance / totalLength) * (newSpt.x - newEpt.x)), + newEpt.y + ((distance / totalLength) * (newSpt.y - newEpt.y))); + } + } + + floorplan.model.setDataProperty(node.data, "startpoint", newSpt); + floorplan.model.setDataProperty(node.data, "endpoint", newEpt); + floorplan.updateWall(node); + } + } + floorplan.commitTransaction("resize node"); + floorplan.updateWallDimensions(floorplan); + floorplan.skipsUndoManager = false; +} + +// Triggered by "Apply Changes"; set model data for width of the currently selected node +FloorplanUI.prototype.setWidth = function() { + var floorplan = this.floorplan; + var node = floorplan.selection.first(); + var widthInput = document.getElementById(this.state.windows.selectionInfoWindow.widthInputId); + if (widthInput === null) return; + var value = parseFloat(floorplan.convertUnitsToPixels(widthInput.value)); + if (isNaN(value)) { + alert("Please enter a number in the width input"); + setSelectionInfo(node, floorplan); + return; + } + floorplan.skipsUndoManager = true; + floorplan.startTransaction("resize node"); + if (!floorplan.isReadOnly) { + // Case: Window nodes, keeps windows within wall boundaries + if (node.category === 'WindowNode') { + var wall = floorplan.findPartForKey(node.data.group); + var loc = node.location.copy(); + // constrain max width "value" by the free stretch on the wall "node" is in + if (wall !== null) { + var containingStretch = getWallPartStretch(node); + var stretchLength = Math.sqrt(containingStretch.point1.distanceSquaredPoint(containingStretch.point2)); + if (stretchLength < value) { + value = stretchLength; + loc = new go.Point((containingStretch.point1.x + containingStretch.point2.x) / 2, + (containingStretch.point1.y + containingStretch.point2.y) / 2); + } + } + floorplan.model.setDataProperty(node.data, "width", value); + node.location = loc; + floorplan.updateWallDimensions(); + } + // Case: Wall Groups; set wall's data.strokeWidth + else if (node.category === 'WallGroup') { + floorplan.model.setDataProperty(node.data, "strokeWidth", value); + node.memberParts.iterator.each(function (part) { + if (part.category === 'DoorNode') floorplan.model.setDataProperty(part.data, "doorOpeningHeight", value); + if (part.category === 'WindowNode') floorplan.model.setDataProperty(part.data, "height", value); + }); + } + // Case: Standard / Multi-Purpose Nodes; basic width ajustment + else floorplan.model.setDataProperty(node.data, "width", value); + } + floorplan.commitTransaction("resize node"); + floorplan.skipsUndoManager = false; +} + +// Set height, width, and color of the selection based on user input in the Selection Info Window +FloorplanUI.prototype.applySelectionChanges = function() { + var floorplan = this.floorplan; + this.setHeight(); + this.setWidth(); + this.setColor(); + floorplan.floorplanUI.setSelectionInfo(floorplan.selection.first(), floorplan); +} \ No newline at end of file diff --git a/extensions/icons/flipDoorOpeningLeft.png b/projects/floorplanner/icons/flipDoorOpeningLeft.png similarity index 100% rename from extensions/icons/flipDoorOpeningLeft.png rename to projects/floorplanner/icons/flipDoorOpeningLeft.png diff --git a/extensions/icons/flipDoorOpeningRight.png b/projects/floorplanner/icons/flipDoorOpeningRight.png similarity index 100% rename from extensions/icons/flipDoorOpeningRight.png rename to projects/floorplanner/icons/flipDoorOpeningRight.png diff --git a/extensions/icons/flipDoorSide.png b/projects/floorplanner/icons/flipDoorSide.png similarity index 100% rename from extensions/icons/flipDoorSide.png rename to projects/floorplanner/icons/flipDoorSide.png diff --git a/extensions/icons/selectionTool.png b/projects/floorplanner/icons/selectionTool.png similarity index 100% rename from extensions/icons/selectionTool.png rename to projects/floorplanner/icons/selectionTool.png diff --git a/extensions/icons/wallBuildingTool.png b/projects/floorplanner/icons/wallBuildingTool.png similarity index 100% rename from extensions/icons/wallBuildingTool.png rename to projects/floorplanner/icons/wallBuildingTool.png diff --git a/release/go-debug.js b/release/go-debug.js index 90c3238b9..c7d621ca5 100644 --- a/release/go-debug.js +++ b/release/go-debug.js @@ -1,1486 +1,1488 @@ /* - * GoJS v1.7.7 JavaScript Library for HTML Diagrams + * GoJS v1.7.8 JavaScript Library for HTML Diagrams * Northwoods Software, https://www.nwoods.com/ * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation. * Copyright (C) 1998-2017 by Northwoods Software Corporation. All Rights Reserved. - * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.7.7/doc/license.html. + * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.7.8/doc/license.html. */ (function(window) { var f,aa={};if(!window.document||void 0===window.document.createElement("canvas").getContext)throw window.console&&window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."),Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");if(!Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript"); Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return g.apply(a,e.concat(d.call(arguments)))}function c(){}var d=Array.prototype.slice,e=d.call(arguments,1),g=this;c.prototype=this.prototype;b.prototype=new c;return b}); (function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c=d.length)){var e=D.ub(b,d);if(null!==e&&"function"!==typeof e){if(b.hasOwnProperty(d)){var g=Object.getPrototypeOf(b);if(g&&g.Dw&&g.Dw[d])continue}else if(D.Px(b,d))continue;""===c&&(c=b+"\n");c+=' unknown property "'+d+'" has value: '+e+" at "+a+"\n"}}return c},sx:function(a,b){if(null!==b&&void 0!==b&&"number"!==typeof b&&"string"!==typeof b&&"boolean"!==typeof b&& -"function"!==typeof b)if(void 0!==D.Fd(b)){if(!v.Qw.contains(b))if(v.Qw.add(b),v.sw.add(v.LE(a,b)),b instanceof K||b instanceof L||b instanceof ma)for(var c=b.j;c.next();)v.sx(a+"["+c.key+"]",c.value);else for(c in b){var d=D.ub(b,c);if(void 0!==d&&null!==d&&D.Ta(d)&&d!==b.Dw){if(b instanceof na){if(d===b.gi)continue}else if(b instanceof x){if("data"===c||d===b.Nd)continue;if("itemArray"===c||d===b.cj)continue;if(b instanceof F&&d===b.Jl)continue}else if(!(b instanceof E))if(b instanceof oa){if("archetypeGroupData"=== -c||d===b.Zy)continue}else if(b instanceof ra){if("archetypeLinkData"===c||d===b.az)continue;if("archetypeLabelNodeData"===c||d===b.$y)continue}else if(b instanceof ta){if("archetypeNodeData"===c||d===b.ol)continue}else if(b instanceof M){if("nodeDataArray"===c||d===b.we)continue;if("linkDataArray"===c||d===b.bf||d===b.hi)continue;if(d===b.Ec)continue;if(d===b.vg)continue}else if(b instanceof va||b instanceof wa||b instanceof xa)continue;v.sx(a+"."+c,d)}}}else if(Array.isArray(b))for(c=0;c=a.length?a.push(c):a.splice(b,0,c):D.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Sg:function(a, -b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):D.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},Ry:[],P:function(){var a=D.Ry.pop();return void 0===a?new O:a},Fb:function(a,b){var c=D.Ry.pop();if(void 0===c)return new O(a,b);c.x=a;c.y=b;return c},A:function(a){D.Ry.push(a)},hC:[],Cm:function(){var a=D.hC.pop();return void 0===a?new Ca:a},Rk:function(a){D.hC.push(a)},Sy:[],Nf:function(){var a=D.Sy.pop();return void 0===a?new B:a},gh:function(a,b,c,d){var e=D.Sy.pop(); -if(void 0===e)return new B(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},Mb:function(a){D.Sy.push(a)},iC:[],Of:function(){var a=D.iC.pop();return void 0===a?new Da:a},He:function(a){D.iC.push(a)},Ty:null,v:function(){var a=D.Ty;return null!==a?(D.Ty=null,a):new Ea},u:function(a){a.reset();D.Ty=a},gC:[],tb:function(){var a=D.gC.pop();return void 0===a?[]:a},Aa:function(a){a.length=0;D.gC.push(a)},Co:Object.freeze([]),Gm:1,tc:function(a){a.__gohashid=D.Gm++},sq:function(a){var b=a.__gohashid; -void 0===b&&(b=D.Gm++,a.__gohashid=b);return b},Fd:function(a){return a.__gohashid},ja:function(a,b){b.fz=a;aa[a]=b},Sa:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},Ai:function(a){a.BH=!0},defineProperty:function(a,b,c,d,e){D.h(a,"function","Util.defineProperty:classfunc");D.h(b,"object","Util.defineProperty:propobj");D.h(c,"function","Util.defineProperty:getter");D.h(d,"function","Util.defineProperty:setter");for(var g in b){b=b[g];c={get:c,set:d, -enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,g,c);e=Object.getOwnPropertyDescriptor(a.prototype,g);b&&e&&Object.defineProperty(a.prototype,b,e);break}},CK:!1,w:function(a,b,c,d){D.h(a,"function","Util.defineReadOnlyProperty:classfunc");D.h(b,"object","Util.defineReadOnlyProperty:propobj");D.h(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var g=b[e];b={get:c,set:function(a){D.k('The property "'+g+'" is read-only and cannot be set to '+ -a)},enumerable:!0};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);g&&d&&Object.defineProperty(a.prototype,g,d);break}},ke:function(a,b){for(var c in b)b[c]=!0;a.prototype.Dw=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?D.qf(a):null===a?"*":""},qf:function(a){if("function"===typeof a){if(a.fz)return a.fz;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9, -c).trim();if(""!==b)return a.fz=b}else if("object"===typeof a&&a.constructor)return D.qf(a.constructor);return typeof a},s:function(a,b,c){D.h(a,"function","Util.defineEnumValue:classfunc");D.h(b,"string","Util.defineEnumValue:name");D.h(c,"number","Util.defineEnumValue:num");c=new za(a,b,c);Object.freeze(c);a[b]=c;var d=a.lv;d instanceof ma||(d=new ma("string",za),a.lv=d);d.add(b,c);return c},ub:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute? -(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){v&&D.trace("property get error: "+d.toString())}return c},Ua:function(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){v&&D.trace("property set error: "+d.toString())}},Zu:function(a,b){D.h(a,"object","Setting properties requires Objects as arguments");D.h(b,"object","Setting properties requires Objects as arguments");var c=a instanceof x,d=a instanceof E,e;for(e in b){""=== -e&&D.k("Setting properties requires non-empty property names");var g=a,h=e;if(c||d){var k=e.indexOf(".");if(0c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0, -g="",h=0;hc;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);for(var d=[],e=0,c=0;cd;d++)b[D.Tg("7ca11abfd7330390")](D.Tg(c[d-1]),10,15*d+0);b[D.Tg("7ca11abfd022028846")]=D.Tg("39f046ebb36e4b");for(d=1;5>d;d++)b[D.Tg("7ca11abfd7330390")](D.Tg(c[d- -1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])D.s=function(a,b){var c=new za(a,b,2);Object.freeze(c);a[b]=c;var d=a.lv;d instanceof ma||(d=new ma("string",za),a.lv=d);d.add(b,c);return c};return a}();function za(a,b,c){D.tc(this);this.rC=a;this.Xb=b;this.FH=c}D.ja("EnumValue",za);za.prototype.toString=function(){return D.qf(this.rC)+"."+this.Xb};D.w(za,{Ne:"classType"},function(){return this.rC});D.w(za,{name:"name"},function(){return this.Xb});D.w(za,{value:"value"},function(){return this.FH}); -var Ha;za.findName=Ha=function(a,b){if(void 0===b||null===b||""===b)return null;D.h(a,"function","findName:classfunc");D.h(b,"string","EnumValue.findName:name");var c=a.lv;return c instanceof ma?c.oa(b):null};function ya(){this.qC=[]}ya.prototype.toString=function(){return this.qC.join("")};ya.prototype.add=function(a){""!==a&&this.qC.push(a)};function la(){} -function Ia(a){void 0===a&&(a=42);this.seed=a;this.Ny=48271;this.kv=2147483647;this.fC=this.kv/this.Ny;this.nH=this.kv%this.Ny;this.mH=1/this.kv;this.random()}Ia.prototype.random=function(){var a=this.seed%this.fC*this.Ny-this.seed/this.fC*this.nH;this.seed=0=d.length)){var e=D.vb(b,d);if(null!==e&&"function"!==typeof e){if(b.hasOwnProperty(d)){var g=Object.getPrototypeOf(b);if(g&&g.Cw&&g.Cw[d])continue}else if(D.Ox(b,d))continue;""===c&&(c=b+"\n");c+=' unknown property "'+d+'" has value: '+e+" at "+a+"\n"}}return c},qx:function(a,b){if(null!==b&&void 0!==b&&"number"!==typeof b&&"string"!== +typeof b&&"boolean"!==typeof b&&"function"!==typeof b)if(void 0!==D.Gd(b)){if(!v.Pw.contains(b))if(v.Pw.add(b),v.sw.add(v.OE(a,b)),b instanceof K||b instanceof L||b instanceof ma)for(var c=b.j;c.next();)v.qx(a+"["+c.key+"]",c.value);else for(c in b){var d=D.vb(b,c);if(void 0!==d&&null!==d&&D.Ta(d)&&d!==b.Cw){if(b instanceof na){if(d===b.hi)continue}else if(b instanceof x){if("data"===c||d===b.Nd)continue;if("itemArray"===c||d===b.cj)continue;if(b instanceof F&&d===b.Ll)continue}else if(!(b instanceof +E))if(b instanceof oa){if("archetypeGroupData"===c||d===b.Yy)continue}else if(b instanceof ra){if("archetypeLinkData"===c||d===b.$y)continue;if("archetypeLabelNodeData"===c||d===b.Zy)continue}else if(b instanceof ta){if("archetypeNodeData"===c||d===b.ql)continue}else if(b instanceof M){if("nodeDataArray"===c||d===b.we)continue;if("linkDataArray"===c||d===b.bf||d===b.ii)continue;if(d===b.Fc)continue;if(d===b.xg)continue}else if(b instanceof va||b instanceof wa||b instanceof xa)continue;v.qx(a+"."+ +c,d)}}}else if(Array.isArray(b))for(c=0;c=a.length?a.push(c):a.splice(b,0,c):D.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Ug:function(a, +b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):D.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},Qy:[],O:function(){var a=D.Qy.pop();return void 0===a?new O:a},Fb:function(a,b){var c=D.Qy.pop();if(void 0===c)return new O(a,b);c.x=a;c.y=b;return c},A:function(a){D.Qy.push(a)},lC:[],Cm:function(){var a=D.lC.pop();return void 0===a?new Ca:a},Rk:function(a){D.lC.push(a)},Ry:[],Of:function(){var a=D.Ry.pop();return void 0===a?new B:a},sg:function(a,b,c,d){var e=D.Ry.pop(); +if(void 0===e)return new B(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},Kb:function(a){D.Ry.push(a)},mC:[],Pf:function(){var a=D.mC.pop();return void 0===a?new Da:a},He:function(a){D.mC.push(a)},Sy:null,v:function(){var a=D.Sy;return null!==a?(D.Sy=null,a):new Ea},u:function(a){a.reset();D.Sy=a},kC:[],tb:function(){var a=D.kC.pop();return void 0===a?[]:a},Ba:function(a){a.length=0;D.kC.push(a)},Eo:Object.freeze([]),Gm:1,uc:function(a){a.__gohashid=D.Gm++},rq:function(a){var b=a.__gohashid; +void 0===b&&(b=D.Gm++,a.__gohashid=b);return b},Gd:function(a){return a.__gohashid},ja:function(a,b){b.ez=a;aa[a]=b},Sa:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},Bi:function(a){a.EH=!0},defineProperty:function(a,b,c,d,e){D.h(a,"function","Util.defineProperty:classfunc");D.h(b,"object","Util.defineProperty:propobj");D.h(c,"function","Util.defineProperty:getter");D.h(d,"function","Util.defineProperty:setter");for(var g in b){b=b[g];c={get:c,set:d, +enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,g,c);e=Object.getOwnPropertyDescriptor(a.prototype,g);b&&e&&Object.defineProperty(a.prototype,b,e);break}},FK:!1,w:function(a,b,c,d){D.h(a,"function","Util.defineReadOnlyProperty:classfunc");D.h(b,"object","Util.defineReadOnlyProperty:propobj");D.h(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var g=b[e];b={get:c,set:function(a){D.k('The property "'+g+'" is read-only and cannot be set to '+ +a)},enumerable:!0};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);g&&d&&Object.defineProperty(a.prototype,g,d);break}},ke:function(a,b){for(var c in b)b[c]=!0;a.prototype.Cw=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?D.qf(a):null===a?"*":""},qf:function(a){if("function"===typeof a){if(a.ez)return a.ez;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9, +c).trim();if(""!==b)return a.ez=b}else if("object"===typeof a&&a.constructor)return D.qf(a.constructor);return typeof a},s:function(a,b,c){D.h(a,"function","Util.defineEnumValue:classfunc");D.h(b,"string","Util.defineEnumValue:name");D.h(c,"number","Util.defineEnumValue:num");c=new za(a,b,c);Object.freeze(c);a[b]=c;var d=a.kv;d instanceof ma||(d=new ma("string",za),a.kv=d);d.add(b,c);return c},vb:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute? +(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){v&&D.trace("property get error: "+d.toString())}return c},Ua:function(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){v&&D.trace("property set error: "+d.toString())}},Yu:function(a,b){D.h(a,"object","Setting properties requires Objects as arguments");D.h(b,"object","Setting properties requires Objects as arguments");var c=a instanceof x,d=a instanceof E,e;for(e in b){""=== +e&&D.k("Setting properties requires non-empty property names");var g=a,h=e;if(c||d){var k=e.indexOf(".");if(0c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0, +g="",h=0;hc;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);for(var d=[],e=0,c=0;cd;d++)b[D.Vg("7ca11abfd7330390")](D.Vg(c[d-1]),10,15*d+0);b[D.Vg("7ca11abfd022028846")]=D.Vg("39f046ebb36e4b");for(d=1;5>d;d++)b[D.Vg("7ca11abfd7330390")](D.Vg(c[d- +1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])D.s=function(a,b){var c=new za(a,b,2);Object.freeze(c);a[b]=c;var d=a.kv;d instanceof ma||(d=new ma("string",za),a.kv=d);d.add(b,c);return c};return a}();function za(a,b,c){D.uc(this);this.vC=a;this.Xb=b;this.IH=c}D.ja("EnumValue",za);za.prototype.toString=function(){return D.qf(this.vC)+"."+this.Xb};D.w(za,{Ne:"classType"},function(){return this.vC});D.w(za,{name:"name"},function(){return this.Xb});D.w(za,{value:"value"},function(){return this.IH}); +var Ha;za.findName=Ha=function(a,b){if(void 0===b||null===b||""===b)return null;D.h(a,"function","findName:classfunc");D.h(b,"string","EnumValue.findName:name");var c=a.kv;return c instanceof ma?c.na(b):null};function ya(){this.uC=[]}ya.prototype.toString=function(){return this.uC.join("")};ya.prototype.add=function(a){""!==a&&this.uC.push(a)};function la(){} +function Ia(a){void 0===a&&(a=42);this.seed=a;this.My=48271;this.jv=2147483647;this.jC=this.jv/this.My;this.qH=this.jv%this.My;this.pH=1/this.jv;this.random()}Ia.prototype.random=function(){var a=this.seed%this.jC*this.My-this.seed/this.jC*this.qH;this.seed=0this.key)return!1;D.Va(a)}var a=a.o,b=a.length,c=++this.Cc,d=this.mi;if(null!==d)for(;cthis.key)return!1;D.Va(a)}var b=--this.Cc;if(0<=b)return this.key=b,this.value=a.o[b],!0;this.Qf();return!1};Pa.prototype.hasNext=function(){return this.next()}; -Pa.prototype.first=Pa.prototype.first=function(){var a=this.Dc;this.$a=a.G;var b=a.o;this.Cc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Pa.prototype.any=function(a){var b=this.Dc;b.dj=null;var c=b.G,d=b.o,e=d.length;this.Cc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.G!==c&&D.Va(b)}return!1};Pa.prototype.all=function(a){var b=this.Dc;b.dj=null;var c=b.G,d=b.o,e=d.length;this.Cc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.G!==c&&D.Va(b)}return!0}; -Pa.prototype.each=function(a){var b=this.Dc;b.dj=null;var c=b.G,d=b.o,e=d.length;this.Cc=e;for(e-=1;0<=e;e--)a(d[e]),b.G!==c&&D.Va(b);return this};Pa.prototype.map=function(a){var b=this.Dc;b.dj=null;var c=b.G,d=[],e=b.o,g=e.length;this.Cc=g;for(g-=1;0<=g;g--)d.push(a(e[g])),b.G!==c&&D.Va(b);a=new K;a.o=d;a.Qc();return a.j}; -Pa.prototype.filter=function(a){var b=this.Dc;b.dj=null;var c=b.G,d=[],e=b.o,g=e.length;this.Cc=g;for(g-=1;0<=g;g--){var h=e[g];a(h)&&d.push(h);b.G!==c&&D.Va(b)}a=new K(b.ca);a.o=d;a.Qc();return a.j};Pa.prototype.concat=function(a){this.Dc.dj=null;return new Ma(this,a.j)};D.w(Pa,{count:"count"},function(){return this.Dc.o.length});Pa.prototype.Qf=function(){this.key=-1;this.value=null;this.$a=-1;this.Dc.dj=this}; -Pa.prototype.toString=function(){return"ListIteratorBackwards("+this.Cc+"/"+this.Dc.count+")"}; -function K(a){D.tc(this);this.J=!1;this.o=[];this.G=0;this.dj=this.Wb=null;void 0===a||null===a?this.ca=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ca=a:D.ua(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ca=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:D.ua(a,"null, a primitive type name, or a class type", -"List constructor: type")}D.ja("List",K);K.prototype.oh=function(a){null!==this.ca&&("string"===typeof this.ca?typeof a===this.ca&&null!==a||D.gc(a,this.ca):a instanceof this.ca||D.gc(a,this.ca))};K.prototype.Qc=function(){var a=this.G;a++;999999999a||a>=b.length)&&D.ua(a,"0 <= i < length",K,"elt:i");return b[a]};K.prototype.get=K.prototype.get=function(a){return this.ea(a)};K.prototype.setElt=K.prototype.qg=function(a,b){v&&(this.oh(b),D.p(a,K,"setElt:i"));var c=this.o;(0>a||a>=c.length)&&D.ua(a,"0 <= i < length",K,"setElt:i");this.J&&D.pa(this,a);c[a]=b};K.prototype.set=K.prototype.set=function(a,b){this.qg(a,b)}; +La.prototype.each=function(a){this.key=-1;a(this.value);return this};La.prototype.map=function(a){return new La(a(this.value))};La.prototype.filter=function(a){return a(this.value)?new La(this.value):Ka};La.prototype.concat=function(a){return new Ma(this,a.j)};D.w(La,{count:"count"},function(){return 1});La.prototype.Rf=function(){this.value=null};La.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function Ma(a,b){this.Dl=a;this.El=b;this.lv=!1}D.ke(Ma,{key:!0,value:!0}); +D.w(Ma,{j:"iterator"},function(){return this});Ma.prototype.reset=Ma.prototype.reset=function(){this.Dl.reset();this.El.reset();this.lv=!1};Ma.prototype.next=Ma.prototype.next=function(){if(!this.lv){var a=this.Dl;if(a.next())return this.key=a.key,this.value=a.value,!0;this.lv=!0}return this.lv&&(a=this.El,a.next())?(this.key=a.key,this.value=a.value,!0):!1};Ma.prototype.hasNext=function(){return this.next()}; +Ma.prototype.first=Ma.prototype.first=function(){this.reset();return this.next()?this.value:null};Ma.prototype.any=function(a){return this.Dl.any(a)||this.El.any(a)?!0:!1};Ma.prototype.all=function(a){return this.Dl.all(a)&&this.El.all(a)?!0:!1};Ma.prototype.each=function(a){this.Dl.each(a);this.El.each(a);return this};Ma.prototype.map=function(a){return new Ma(this.Dl.map(a),this.El.map(a))};Ma.prototype.filter=function(a){return new Ma(this.Dl.filter(a),this.El.filter(a))}; +Ma.prototype.concat=function(a){return new Ma(this,a.j)};D.w(Ma,{count:"count"},function(){return this.Dl.count+this.El.count});Ma.prototype.Rf=function(){this.value=this.key=null};Ma.prototype.toString=function(){return"ConcatIterator()"};function Na(a){this.Ec=a;this.ni=null;a.Wb=null;this.$a=a.G;this.Dc=-1}D.ke(Na,{key:!0,value:!0});D.w(Na,{j:"iterator"},function(){return this});D.defineProperty(Na,{Eq:"predicate"},function(){return this.ni},function(a){this.ni=a}); +Na.prototype.reset=Na.prototype.reset=function(){var a=this.Ec;a.Wb=null;this.$a=a.G;this.Dc=-1};Na.prototype.next=Na.prototype.next=function(){var a=this.Ec;if(a.G!==this.$a){if(0>this.key)return!1;D.Va(a)}var a=a.o,b=a.length,c=++this.Dc,d=this.ni;if(null!==d)for(;cthis.key)return!1;D.Va(a)}var b=--this.Dc;if(0<=b)return this.key=b,this.value=a.o[b],!0;this.Rf();return!1};Pa.prototype.hasNext=function(){return this.next()}; +Pa.prototype.first=Pa.prototype.first=function(){var a=this.Ec;this.$a=a.G;var b=a.o;this.Dc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Pa.prototype.any=function(a){var b=this.Ec;b.dj=null;var c=b.G,d=b.o,e=d.length;this.Dc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.G!==c&&D.Va(b)}return!1};Pa.prototype.all=function(a){var b=this.Ec;b.dj=null;var c=b.G,d=b.o,e=d.length;this.Dc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.G!==c&&D.Va(b)}return!0}; +Pa.prototype.each=function(a){var b=this.Ec;b.dj=null;var c=b.G,d=b.o,e=d.length;this.Dc=e;for(e-=1;0<=e;e--)a(d[e]),b.G!==c&&D.Va(b);return this};Pa.prototype.map=function(a){var b=this.Ec;b.dj=null;var c=b.G,d=[],e=b.o,g=e.length;this.Dc=g;for(g-=1;0<=g;g--)d.push(a(e[g])),b.G!==c&&D.Va(b);a=new K;a.o=d;a.Rc();return a.j}; +Pa.prototype.filter=function(a){var b=this.Ec;b.dj=null;var c=b.G,d=[],e=b.o,g=e.length;this.Dc=g;for(g-=1;0<=g;g--){var h=e[g];a(h)&&d.push(h);b.G!==c&&D.Va(b)}a=new K(b.ca);a.o=d;a.Rc();return a.j};Pa.prototype.concat=function(a){this.Ec.dj=null;return new Ma(this,a.j)};D.w(Pa,{count:"count"},function(){return this.Ec.o.length});Pa.prototype.Rf=function(){this.key=-1;this.value=null;this.$a=-1;this.Ec.dj=this}; +Pa.prototype.toString=function(){return"ListIteratorBackwards("+this.Dc+"/"+this.Ec.count+")"}; +function K(a){D.uc(this);this.J=!1;this.o=[];this.G=0;this.dj=this.Wb=null;void 0===a||null===a?this.ca=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ca=a:D.ua(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ca=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:D.ua(a,"null, a primitive type name, or a class type", +"List constructor: type")}D.ja("List",K);K.prototype.oh=function(a){null!==this.ca&&("string"===typeof this.ca?typeof a===this.ca&&null!==a||D.hc(a,this.ca):a instanceof this.ca||D.hc(a,this.ca))};K.prototype.Rc=function(){var a=this.G;a++;999999999a||a>=b.length)&&D.ua(a,"0 <= i < length",K,"elt:i");return b[a]};K.prototype.get=K.prototype.get=function(a){return this.ea(a)};K.prototype.setElt=K.prototype.rg=function(a,b){v&&(this.oh(b),D.p(a,K,"setElt:i"));var c=this.o;(0>a||a>=c.length)&&D.ua(a,"0 <= i < length",K,"setElt:i");this.J&&D.pa(this,a);c[a]=b};K.prototype.set=K.prototype.set=function(a,b){this.rg(a,b)}; K.prototype.first=K.prototype.first=function(){var a=this.o;return 0===a.length?null:a[0]};K.prototype.last=K.prototype.pe=function(){var a=this.o,b=a.length;return 0a&&D.ua(a,">= 0",K,"insertAt:i");this.J&&D.pa(this,a);var c=this.o;a>=c.length?c.push(b):c.splice(a,0,b);this.Qc();return!0}; -K.prototype.remove=K.prototype.remove=function(a){if(null===a)return!1;v&&this.oh(a);this.J&&D.pa(this,a);var b=this.o;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Qc();return!0};K.prototype["delete"]=K.prototype.delete=function(a){return this.remove(a)};K.prototype.removeAt=K.prototype.jd=function(a){v&&D.p(a,K,"removeAt:i");var b=this.o;(0>a||a>=b.length)&&D.ua(a,"0 <= i < length",K,"removeAt:i");this.J&&D.pa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Qc()}; -K.prototype.removeRange=K.prototype.removeRange=function(a,b){v&&(D.p(a,K,"removeRange:from"),D.p(b,K,"removeRange:to"));var c=this.o,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.J&&D.pa(this);for(var e=a,g=b+1;g=g)return this;(0>b||b>=e-1)&&D.ua(b,"0 <= from < length",K,"sortRange:from");if(2===g)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(g=d.slice(0,c),g.sort(a),a=0;a=e)for(g=d.slice(b), -g.sort(a),a=b;a=this.o.length)return Ka;var a=this.Wb;return null!==a?(a.reset(),a):new Na(this)}); -D.w(K,{$n:"iteratorBackwards"},function(){if(0>=this.o.length)return Ka;var a=this.dj;return null!==a?(a.reset(),a):new Pa(this)});function Qa(a){this.oi=a;a.Wb=null;this.$a=a.G;this.bb=null}D.ke(Qa,{key:!0,value:!0});D.w(Qa,{j:"iterator"},function(){return this});Qa.prototype.reset=Qa.prototype.reset=function(){var a=this.oi;a.Wb=null;this.$a=a.G;this.bb=null}; -Qa.prototype.next=Qa.prototype.next=function(){var a=this.oi;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.value=b.value,this.key=b.key,!0;this.Qf();return!1};Qa.prototype.hasNext=function(){return this.next()};Qa.prototype.first=Qa.prototype.first=function(){var a=this.oi;this.$a=a.G;a=a.Ka;if(null!==a){this.bb=a;var b=a.value;this.key=a.key;return this.value=b}return null}; -Qa.prototype.any=function(a){var b=this.oi;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(a(d.value))return!0;b.G!==c&&D.Va(b);d=d.fb}return!1};Qa.prototype.all=function(a){var b=this.oi;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(!a(d.value))return!1;b.G!==c&&D.Va(b);d=d.fb}return!0};Qa.prototype.each=function(a){var b=this.oi;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;)a(d.value),b.G!==c&&D.Va(b),d=d.fb;return this}; -Qa.prototype.map=function(a){var b=this.oi;b.Wb=null;for(var c=new K,d=b.G,e=b.Ka;null!==e;)c.add(a(e.value)),b.G!==d&&D.Va(b),e=e.fb;return c.j};Qa.prototype.filter=function(a){var b=this.oi;b.Wb=null;for(var c=new K(b.ca),d=b.G,e=b.Ka;null!==e;){var g=e.value;a(g)&&c.add(g);b.G!==d&&D.Va(b);e=e.fb}return c.j};Qa.prototype.concat=function(a){this.oi.Wb=null;return new Ma(this,a.j)};D.w(Qa,{count:"count"},function(){return this.oi.xd}); -Qa.prototype.Qf=function(){this.value=this.key=null;this.$a=-1;this.oi.Wb=this};Qa.prototype.toString=function(){return null!==this.bb?"SetIterator@"+this.bb.value:"SetIterator"}; -function L(a){D.tc(this);this.J=!1;void 0===a||null===a?this.ca=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.ca=a:D.ua(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.ca=a===Object?"object":a===String?"string":a===Number?"number":a:D.ua(a,"null, a primitive type name, or a class type","Set constructor: type");this.yd={};this.xd=0;this.Wb=null;this.G=0;this.fi=this.Ka=null}D.ja("Set",L); -L.prototype.oh=function(a){null!==this.ca&&("string"===typeof this.ca?typeof a===this.ca&&null!==a||D.gc(a,this.ca):a instanceof this.ca||D.gc(a,this.ca))};L.prototype.Qc=function(){var a=this.G;a++;999999999a&&D.ua(a,">= 0",K,"insertAt:i");this.J&&D.pa(this,a);var c=this.o;a>=c.length?c.push(b):c.splice(a,0,b);this.Rc();return!0}; +K.prototype.remove=K.prototype["delete"]=K.prototype.remove=function(a){if(null===a)return!1;v&&this.oh(a);this.J&&D.pa(this,a);var b=this.o;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Rc();return!0};K.prototype.removeAt=K.prototype.jd=function(a){v&&D.p(a,K,"removeAt:i");var b=this.o;(0>a||a>=b.length)&&D.ua(a,"0 <= i < length",K,"removeAt:i");this.J&&D.pa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Rc()}; +K.prototype.removeRange=K.prototype.removeRange=function(a,b){v&&(D.p(a,K,"removeRange:from"),D.p(b,K,"removeRange:to"));var c=this.o,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.J&&D.pa(this);for(var e=a,g=b+1;g=g)return this;(0>b||b>=e-1)&&D.ua(b,"0 <= from < length",K,"sortRange:from");if(2===g)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(g=d.slice(0,c),g.sort(a),a=0;a=e)for(g=d.slice(b), +g.sort(a),a=b;a=this.o.length)return Ka;var a=this.Wb;return null!==a?(a.reset(),a):new Na(this)}); +D.w(K,{bo:"iteratorBackwards"},function(){if(0>=this.o.length)return Ka;var a=this.dj;return null!==a?(a.reset(),a):new Pa(this)});function Qa(a){this.pi=a;a.Wb=null;this.$a=a.G;this.bb=null}D.ke(Qa,{key:!0,value:!0});D.w(Qa,{j:"iterator"},function(){return this});Qa.prototype.reset=Qa.prototype.reset=function(){var a=this.pi;a.Wb=null;this.$a=a.G;this.bb=null}; +Qa.prototype.next=Qa.prototype.next=function(){var a=this.pi;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.value=b.value,this.key=b.key,!0;this.Rf();return!1};Qa.prototype.hasNext=function(){return this.next()};Qa.prototype.first=Qa.prototype.first=function(){var a=this.pi;this.$a=a.G;a=a.Ka;if(null!==a){this.bb=a;var b=a.value;this.key=a.key;return this.value=b}return null}; +Qa.prototype.any=function(a){var b=this.pi;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(a(d.value))return!0;b.G!==c&&D.Va(b);d=d.fb}return!1};Qa.prototype.all=function(a){var b=this.pi;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(!a(d.value))return!1;b.G!==c&&D.Va(b);d=d.fb}return!0};Qa.prototype.each=function(a){var b=this.pi;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;)a(d.value),b.G!==c&&D.Va(b),d=d.fb;return this}; +Qa.prototype.map=function(a){var b=this.pi;b.Wb=null;for(var c=new K,d=b.G,e=b.Ka;null!==e;)c.add(a(e.value)),b.G!==d&&D.Va(b),e=e.fb;return c.j};Qa.prototype.filter=function(a){var b=this.pi;b.Wb=null;for(var c=new K(b.ca),d=b.G,e=b.Ka;null!==e;){var g=e.value;a(g)&&c.add(g);b.G!==d&&D.Va(b);e=e.fb}return c.j};Qa.prototype.concat=function(a){this.pi.Wb=null;return new Ma(this,a.j)};D.w(Qa,{count:"count"},function(){return this.pi.yd}); +Qa.prototype.Rf=function(){this.value=this.key=null;this.$a=-1;this.pi.Wb=this};Qa.prototype.toString=function(){return null!==this.bb?"SetIterator@"+this.bb.value:"SetIterator"}; +function L(a){D.uc(this);this.J=!1;void 0===a||null===a?this.ca=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.ca=a:D.ua(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.ca=a===Object?"object":a===String?"string":a===Number?"number":a:D.ua(a,"null, a primitive type name, or a class type","Set constructor: type");this.zd={};this.yd=0;this.Wb=null;this.G=0;this.gi=this.Ka=null}D.ja("Set",L); +L.prototype.oh=function(a){null!==this.ca&&("string"===typeof this.ca?typeof a===this.ca&&null!==a||D.hc(a,this.ca):a instanceof this.ca||D.hc(a,this.ca))};L.prototype.Rc=function(){var a=this.G;a++;999999999=this.xd)return Ka;var a=this.Wb;return null!==a?(a.reset(),a):new Qa(this)});function Sa(a){this.Ma=a;this.$a=a.G;this.bb=null}D.ke(Sa,{key:!0,value:!0});D.w(Sa,{j:"iterator"},function(){return this});Sa.prototype.reset=Sa.prototype.reset=function(){this.$a=this.Ma.G;this.bb=null}; -Sa.prototype.next=Sa.prototype.next=function(){var a=this.Ma;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.value=this.key=a=b.key,!0;this.Qf();return!1};Sa.prototype.hasNext=function(){return this.next()};Sa.prototype.first=Sa.prototype.first=function(){var a=this.Ma;this.$a=a.G;a=a.Ka;return null!==a?(this.bb=a,this.value=this.key=a=a.key):null}; +L.prototype.map=function(a){for(var b=new L,c=this.G,d=this.Ka;null!==d;)b.add(a(d.value)),this.G!==c&&D.Va(this),d=d.fb;return b};L.prototype.filter=function(a){for(var b=new L(this.ca),c=this.G,d=this.Ka;null!==d;){var e=d.value;a(e)&&b.add(e);this.G!==c&&D.Va(this);d=d.fb}return b};L.prototype.concat=function(a){return this.copy().Sc(a)}; +L.prototype.remove=L.prototype["delete"]=L.prototype.remove=function(a){if(null===a)return!1;v&&this.oh(a);this.J&&D.pa(this,a);var b=a;if(D.Ta(a)&&(b=D.Gd(a),void 0===b))return!1;a=this.zd[b];if(void 0===a)return!1;var c=a.fb,d=a.Hp;null!==c&&(c.Hp=d);null!==d&&(d.fb=c);this.Ka===a&&(this.Ka=c);this.gi===a&&(this.gi=d);delete this.zd[b];this.yd--;this.Rc();return!0}; +L.prototype.removeAll=L.prototype.vy=function(a){if(null===a)return this;this.J&&D.pa(this);if(D.isArray(a))for(var b=D.cb(a),c=0;c=this.yd)return Ka;var a=this.Wb;return null!==a?(a.reset(),a):new Qa(this)});function Sa(a){this.Ma=a;this.$a=a.G;this.bb=null}D.ke(Sa,{key:!0,value:!0});D.w(Sa,{j:"iterator"},function(){return this});Sa.prototype.reset=Sa.prototype.reset=function(){this.$a=this.Ma.G;this.bb=null}; +Sa.prototype.next=Sa.prototype.next=function(){var a=this.Ma;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.value=this.key=a=b.key,!0;this.Rf();return!1};Sa.prototype.hasNext=function(){return this.next()};Sa.prototype.first=Sa.prototype.first=function(){var a=this.Ma;this.$a=a.G;a=a.Ka;return null!==a?(this.bb=a,this.value=this.key=a=a.key):null}; Sa.prototype.any=function(a){var b=this.Ma,c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(a(d.key))return!0;b.G!==c&&D.Va(b);d=d.fb}return!1};Sa.prototype.all=function(a){var b=this.Ma,c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(!a(d.key))return!1;b.G!==c&&D.Va(b);d=d.fb}return!0};Sa.prototype.each=function(a){var b=this.Ma,c=b.G;this.bb=null;for(var d=b.Ka;null!==d;)a(d.key),b.G!==c&&D.Va(b),d=d.fb;return this}; -Sa.prototype.map=function(a){var b=this.Ma,c=b.G;this.bb=null;for(var d=new K,e=b.Ka;null!==e;)d.add(a(e.key)),b.G!==c&&D.Va(b),e=e.fb;return d.j};Sa.prototype.filter=function(a){var b=this.Ma,c=b.G;this.bb=null;for(var d=new K(b.af),e=b.Ka;null!==e;){var g=e.key;a(g)&&d.add(g);b.G!==c&&D.Va(b);e=e.fb}return d.j};Sa.prototype.concat=function(a){return new Ma(this,a.j)};D.w(Sa,{count:"count"},function(){return this.Ma.xd});Sa.prototype.Qf=function(){this.value=this.key=null;this.$a=-1}; -Sa.prototype.toString=function(){return null!==this.bb?"MapKeySetIterator@"+this.bb.value:"MapKeySetIterator"};function Ta(a){D.tc(this);this.J=!0;this.Ma=a}D.Sa(Ta,L);Ta.prototype.freeze=function(){return this};Ta.prototype.Ya=function(){return this};Ta.prototype.toString=function(){return"MapKeySet("+this.Ma.toString()+")"};Ta.prototype.add=Ta.prototype.add=function(){D.k("This Set is read-only: "+this.toString());return!1}; -Ta.prototype.set=Ta.prototype.set=function(){D.k("This Set is read-only: "+this.toString());return!1};Ta.prototype.contains=Ta.prototype.contains=function(a){return this.Ma.contains(a)};Ta.prototype.has=Ta.prototype.has=function(a){return this.contains(a)};Ta.prototype.remove=Ta.prototype.remove=function(){D.k("This Set is read-only: "+this.toString());return!1};Ta.prototype["delete"]=Ta.prototype.delete=function(){return this.remove()}; -Ta.prototype.clear=Ta.prototype.clear=function(){D.k("This Set is read-only: "+this.toString())};Ta.prototype.first=Ta.prototype.first=function(){var a=this.Ma.Ka;return null!==a?a.key:null};Ta.prototype.any=function(a){for(var b=this.Ma.Ka;null!==b;){if(a(b.key))return!0;b=b.fb}return!1};Ta.prototype.all=function(a){for(var b=this.Ma.Ka;null!==b;){if(!a(b.key))return!1;b=b.fb}return!0};Ta.prototype.each=function(a){for(var b=this.Ma.Ka;null!==b;)a(b.key),b=b.fb;return this}; -Ta.prototype.map=function(a){for(var b=new L,c=this.Ma.Ka;null!==c;)b.add(a(c.key)),c=c.fb;return b};Ta.prototype.filter=function(a){for(var b=new L(this.Ma.af),c=this.Ma.Ka;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.fb}return b};Ta.prototype.concat=function(a){return this.bH().Rc(a)};Ta.prototype.copy=function(){return new Ta(this.Ma)};Ta.prototype.toSet=Ta.prototype.bH=function(){var a=new L(this.Ma.af),b=this.Ma.yd,c;for(c in b)a.add(b[c].key);return a}; -Ta.prototype.toArray=Ta.prototype.lc=function(){var a=this.Ma.yd,b=Array(this.Ma.xd),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Ta.prototype.toList=function(){var a=new K(this.Ma.af),b=this.Ma.yd,c;for(c in b)a.add(b[c].key);return a};D.w(Ta,{count:"count"},function(){return this.Ma.xd});D.w(Ta,{size:"size"},function(){return this.Ma.xd});D.w(Ta,{j:"iterator"},function(){return 0>=this.Ma.xd?Ka:new Sa(this.Ma)});function $a(a){this.Ma=a;a.ej=null;this.$a=a.G;this.bb=null}D.ke($a,{key:!0,value:!0}); -D.w($a,{j:"iterator"},function(){return this});$a.prototype.reset=$a.prototype.reset=function(){var a=this.Ma;a.ej=null;this.$a=a.G;this.bb=null};$a.prototype.next=$a.prototype.next=function(){var a=this.Ma;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.value=b.value,this.key=b.key,!0;this.Qf();return!1};$a.prototype.hasNext=function(){return this.next()}; -$a.prototype.first=$a.prototype.first=function(){var a=this.Ma;this.$a=a.G;a=a.Ka;if(null!==a){this.bb=a;var b=a.value;this.key=a.key;return this.value=b}return null};$a.prototype.any=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(a(d.value))return!0;b.G!==c&&D.Va(b);d=d.fb}return!1};$a.prototype.all=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(!a(d.value))return!1;b.G!==c&&D.Va(b);d=d.fb}return!0}; -$a.prototype.each=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;)a(d.value),b.G!==c&&D.Va(b),d=d.fb;return this};$a.prototype.map=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=new K,e=b.Ka;null!==e;)d.add(a(e.value)),b.G!==c&&D.Va(b),e=e.fb;return d.j};$a.prototype.filter=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=new K(b.af),e=b.Ka;null!==e;){var g=e.value;a(g)&&d.add(g);b.G!==c&&D.Va(b);e=e.fb}return d.j}; -$a.prototype.concat=function(a){this.Ma.ej=null;return new Ma(this,a.j)};D.w($a,{count:"count"},function(){return this.Ma.xd});$a.prototype.Qf=function(){this.value=this.key=null;this.$a=-1;this.Ma.ej=this};$a.prototype.toString=function(){return null!==this.bb?"MapValueSetIterator@"+this.bb.value:"MapValueSetIterator"};function Ra(a,b){this.key=a;this.value=b;this.Fp=this.fb=null}D.ke(Ra,{key:!0,value:!0});Ra.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; -function bb(a){this.Ma=a;a.Wb=null;this.$a=a.G;this.bb=null}D.ke(bb,{key:!0,value:!0});D.w(bb,{j:"iterator"},function(){return this});bb.prototype.reset=bb.prototype.reset=function(){var a=this.Ma;a.Wb=null;this.$a=a.G;this.bb=null};bb.prototype.next=bb.prototype.next=function(){var a=this.Ma;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.key=b.key,this.value=b.value,!0;this.Qf();return!1};bb.prototype.hasNext=function(){return this.next()}; -bb.prototype.first=bb.prototype.first=function(){var a=this.Ma;this.$a=a.G;a=a.Ka;return null!==a?(this.bb=a,this.key=a.key,this.value=a.value,a):null};bb.prototype.any=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(a(d))return!0;b.G!==c&&D.Va(b);d=d.fb}return!1};bb.prototype.all=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(!a(d))return!1;b.G!==c&&D.Va(b);d=d.fb}return!0}; -bb.prototype.each=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;)a(d),b.G!==c&&D.Va(b),d=d.fb;return this};bb.prototype.map=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=new K,e=b.Ka;null!==e;)d.add(a(e)),b.G!==c&&D.Va(b),e=e.fb;return d.j};bb.prototype.filter=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=new K,e=b.Ka;null!==e;)a(e)&&d.add(e),b.G!==c&&D.Va(b),e=e.fb;return d.j}; -bb.prototype.concat=function(a){this.Ma.Wb=null;return new Ma(this,a.j)};D.w(bb,{count:"count"},function(){return this.Ma.xd});bb.prototype.Qf=function(){this.value=this.key=null;this.$a=-1;this.Ma.Wb=this};bb.prototype.toString=function(){return null!==this.bb?"MapIterator@"+this.bb:"MapIterator"}; -function ma(a,b){D.tc(this);this.J=!1;void 0===a||null===a?this.af=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.af=a:D.ua(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.af=a===Object?"object":a===String?"string":a===Number?"number":a:D.ua(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.yi=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"=== -b||"function"===b?this.yi=b:D.ua(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.yi=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:D.ua(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.yd={};this.xd=0;this.ej=this.Wb=null;this.G=0;this.fi=this.Ka=null}D.ja("Map",ma); -function cb(a,b){null!==a.af&&("string"===typeof a.af?typeof b===a.af&&null!==b||D.gc(b,a.af):b instanceof a.af||D.gc(b,a.af))}ma.prototype.Qc=function(){var a=this.G;a++;999999999=this.Ma.yd?Ka:new Sa(this.Ma)});function Ya(a){this.Ma=a;a.ej=null;this.$a=a.G;this.bb=null}D.ke(Ya,{key:!0,value:!0});D.w(Ya,{j:"iterator"},function(){return this}); +Ya.prototype.reset=Ya.prototype.reset=function(){var a=this.Ma;a.ej=null;this.$a=a.G;this.bb=null};Ya.prototype.next=Ya.prototype.next=function(){var a=this.Ma;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.value=b.value,this.key=b.key,!0;this.Rf();return!1};Ya.prototype.hasNext=function(){return this.next()}; +Ya.prototype.first=Ya.prototype.first=function(){var a=this.Ma;this.$a=a.G;a=a.Ka;if(null!==a){this.bb=a;var b=a.value;this.key=a.key;return this.value=b}return null};Ya.prototype.any=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(a(d.value))return!0;b.G!==c&&D.Va(b);d=d.fb}return!1};Ya.prototype.all=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(!a(d.value))return!1;b.G!==c&&D.Va(b);d=d.fb}return!0}; +Ya.prototype.each=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;)a(d.value),b.G!==c&&D.Va(b),d=d.fb;return this};Ya.prototype.map=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=new K,e=b.Ka;null!==e;)d.add(a(e.value)),b.G!==c&&D.Va(b),e=e.fb;return d.j};Ya.prototype.filter=function(a){var b=this.Ma;b.ej=null;var c=b.G;this.bb=null;for(var d=new K(b.af),e=b.Ka;null!==e;){var g=e.value;a(g)&&d.add(g);b.G!==c&&D.Va(b);e=e.fb}return d.j}; +Ya.prototype.concat=function(a){this.Ma.ej=null;return new Ma(this,a.j)};D.w(Ya,{count:"count"},function(){return this.Ma.yd});Ya.prototype.Rf=function(){this.value=this.key=null;this.$a=-1;this.Ma.ej=this};Ya.prototype.toString=function(){return null!==this.bb?"MapValueSetIterator@"+this.bb.value:"MapValueSetIterator"};function Ra(a,b){this.key=a;this.value=b;this.Hp=this.fb=null}D.ke(Ra,{key:!0,value:!0});Ra.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; +function $a(a){this.Ma=a;a.Wb=null;this.$a=a.G;this.bb=null}D.ke($a,{key:!0,value:!0});D.w($a,{j:"iterator"},function(){return this});$a.prototype.reset=$a.prototype.reset=function(){var a=this.Ma;a.Wb=null;this.$a=a.G;this.bb=null};$a.prototype.next=$a.prototype.next=function(){var a=this.Ma;if(a.G!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.bb,b=null===b?a.Ka:b.fb;if(null!==b)return this.bb=b,this.key=b.key,this.value=b.value,!0;this.Rf();return!1};$a.prototype.hasNext=function(){return this.next()}; +$a.prototype.first=$a.prototype.first=function(){var a=this.Ma;this.$a=a.G;a=a.Ka;return null!==a?(this.bb=a,this.key=a.key,this.value=a.value,a):null};$a.prototype.any=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(a(d))return!0;b.G!==c&&D.Va(b);d=d.fb}return!1};$a.prototype.all=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;){if(!a(d))return!1;b.G!==c&&D.Va(b);d=d.fb}return!0}; +$a.prototype.each=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=b.Ka;null!==d;)a(d),b.G!==c&&D.Va(b),d=d.fb;return this};$a.prototype.map=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=new K,e=b.Ka;null!==e;)d.add(a(e)),b.G!==c&&D.Va(b),e=e.fb;return d.j};$a.prototype.filter=function(a){var b=this.Ma;b.Wb=null;var c=b.G;this.bb=null;for(var d=new K,e=b.Ka;null!==e;)a(e)&&d.add(e),b.G!==c&&D.Va(b),e=e.fb;return d.j}; +$a.prototype.concat=function(a){this.Ma.Wb=null;return new Ma(this,a.j)};D.w($a,{count:"count"},function(){return this.Ma.yd});$a.prototype.Rf=function(){this.value=this.key=null;this.$a=-1;this.Ma.Wb=this};$a.prototype.toString=function(){return null!==this.bb?"MapIterator@"+this.bb:"MapIterator"}; +function ma(a,b){D.uc(this);this.J=!1;void 0===a||null===a?this.af=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.af=a:D.ua(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.af=a===Object?"object":a===String?"string":a===Number?"number":a:D.ua(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.zi=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"=== +b||"function"===b?this.zi=b:D.ua(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.zi=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:D.ua(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.zd={};this.yd=0;this.ej=this.Wb=null;this.G=0;this.gi=this.Ka=null}D.ja("Map",ma); +function bb(a,b){null!==a.af&&("string"===typeof a.af?typeof b===a.af&&null!==b||D.hc(b,a.af):b instanceof a.af||D.hc(b,a.af))}ma.prototype.Rc=function(){var a=this.G;a++;999999999=this.count)return Ka;var a=this.Wb;return null!==a?(a.reset(),a):new bb(this)});D.w(ma,{XF:"iteratorKeys"},function(){return 0>=this.count?Ka:new Sa(this)});D.w(ma,{YF:"iteratorValues"},function(){if(0>=this.count)return Ka;var a=this.ej;return null!==a?(a.reset(),a):new $a(this)}); -function O(a,b){void 0===a?this.M=this.L=0:"number"===typeof a&&"number"===typeof b?(this.L=a,this.M=b):D.k("Invalid arguments to Point constructor: "+a+", "+b);this.J=!1}D.ja("Point",O);D.Ai(O);D.ke(O,{x:!0,y:!0});O.prototype.assign=function(a){this.L=a.L;this.M=a.M};O.prototype.setTo=O.prototype.m=function(a,b){v&&(D.h(a,"number",O,"setTo:x"),D.h(b,"number",O,"setTo:y"));this.L=a;this.M=b;return this}; -O.prototype.set=O.prototype.set=function(a){v&&D.l(a,O,O,"set:p");this.Ra();this.L=a.L;this.M=a.M;return this};O.prototype.copy=function(){var a=new O;a.L=this.L;a.M=this.M;return a};f=O.prototype;f.Na=function(){this.J=!0;Object.freeze(this);return this};f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.J=!0;return this};f.Ya=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;return this}; -f.Ra=function(a){if(this.J){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);D.k(b)}};O.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new O(c,e)}return new O};O.stringify=function(a){v&&D.l(a,O);return a.x.toString()+" "+a.y.toString()}; -O.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};O.prototype.equals=O.prototype.O=function(a){return a instanceof O?this.L===a.x&&this.M===a.y:!1};O.prototype.equalTo=O.prototype.Ex=function(a,b){return this.L===a&&this.M===b};O.prototype.equalsApprox=O.prototype.Sc=function(a){return Q(this.L,a.x)&&Q(this.M,a.y)};O.prototype.add=O.prototype.add=function(a){v&&D.l(a,O,O,"add:p");this.Ra();this.L+=a.x;this.M+=a.y;return this}; -O.prototype.subtract=O.prototype.vo=function(a){v&&D.l(a,O,O,"subtract:p");this.Ra();this.L-=a.x;this.M-=a.y;return this};O.prototype.offset=O.prototype.offset=function(a,b){v&&(D.p(a,O,"offset:dx"),D.p(b,O,"offset:dy"));this.Ra();this.L+=a;this.M+=b;return this}; -O.prototype.rotate=O.prototype.rotate=function(a){v&&D.p(a,O,"rotate:angle");this.Ra();if(0===a)return this;var b=this.L,c=this.M;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.L=d*b-e*c;this.M=e*b+d*c;return this};O.prototype.scale=O.prototype.scale=function(a,b){v&&(D.p(a,O,"scale:sx"),D.p(b,O,"scale:sy"));this.L*=a;this.M*=b;return this}; -O.prototype.distanceSquaredPoint=O.prototype.Cf=function(a){v&&D.l(a,O,O,"distanceSquaredPoint:p");var b=a.x-this.L;a=a.y-this.M;return b*b+a*a};O.prototype.distanceSquared=O.prototype.mq=function(a,b){v&&(D.p(a,O,"distanceSquared:px"),D.p(b,O,"distanceSquared:py"));var c=a-this.L,d=b-this.M;return c*c+d*d};O.prototype.normalize=O.prototype.normalize=function(){this.Ra();var a=this.L,b=this.M,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c} -O.prototype.projectOntoLineSegment=function(a,b,c,d){v&&(D.p(a,O,"projectOntoLineSegment:px"),D.p(b,O,"projectOntoLineSegment:py"),D.p(c,O,"projectOntoLineSegment:qx"),D.p(d,O,"projectOntoLineSegment:qy"));fb(a,b,c,d,this.L,this.M,this);return this};O.prototype.projectOntoLineSegmentPoint=function(a,b){v&&(D.l(a,O,O,"projectOntoLineSegmentPoint:p"),D.l(b,O,O,"projectOntoLineSegmentPoint:q"));fb(a.x,a.y,b.x,b.y,this.L,this.M,this);return this}; -O.prototype.snapToGrid=function(a,b,c,d){v&&(D.p(a,O,"snapToGrid:originx"),D.p(b,O,"snapToGrid:originy"),D.p(c,O,"snapToGrid:cellwidth"),D.p(d,O,"snapToGrid:cellheight"));gb(this.L,this.M,a,b,c,d,this);return this};O.prototype.snapToGridPoint=function(a,b){v&&(D.l(a,O,O,"snapToGridPoint:p"),D.l(b,Ca,O,"snapToGridPoint:q"));gb(this.L,this.M,a.x,a.y,b.width,b.height,this);return this}; -O.prototype.setRectSpot=O.prototype.so=function(a,b){v&&(D.l(a,B,O,"setRectSpot:r"),D.l(b,R,O,"setRectSpot:spot"));this.Ra();this.L=a.x+b.x*a.width+b.offsetX;this.M=a.y+b.y*a.height+b.offsetY;return this}; -O.prototype.setSpot=O.prototype.av=function(a,b,c,d,e){v&&(D.p(a,O,"setSpot:x"),D.p(b,O,"setSpot:y"),D.p(c,O,"setSpot:w"),D.p(d,O,"setSpot:h"),(0>c||0>d)&&D.k("Point.setSpot:Width and height cannot be negative"),D.l(e,R,O,"setSpot:spot"));this.Ra();this.L=a+e.x*c+e.offsetX;this.M=b+e.y*d+e.offsetY;return this};O.prototype.transform=function(a){v&&D.l(a,Da,O,"transform:t");a.vb(this);return this};function hb(a,b){v&&D.l(b,Da,O,"transformInverted:t");b.Ci(a);return a}var jb; -O.distanceLineSegmentSquared=jb=function(a,b,c,d,e,g){v&&(D.p(a,O,"distanceLineSegmentSquared:px"),D.p(b,O,"distanceLineSegmentSquared:py"),D.p(c,O,"distanceLineSegmentSquared:ax"),D.p(d,O,"distanceLineSegmentSquared:ay"),D.p(e,O,"distanceLineSegmentSquared:bx"),D.p(g,O,"distanceLineSegmentSquared:by"));var h=e-c,k=g-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=g-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var kb; -O.distanceSquared=kb=function(a,b,c,d){v&&(D.p(a,O,"distanceSquared:px"),D.p(b,O,"distanceSquared:py"),D.p(c,O,"distanceSquared:qx"),D.p(d,O,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b};var sb; -O.direction=sb=function(a,b,c,d){v&&(D.p(a,O,"direction:px"),D.p(b,O,"direction:py"),D.p(c,O,"direction:qx"),D.p(d,O,"direction:qy"));a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};D.defineProperty(O,{x:"x"},function(){return this.L},function(a){this.Ra(a);v&&D.h(a,"number",O,"x");this.L=a}); -D.defineProperty(O,{y:"y"},function(){return this.M},function(a){this.Ra(a);v&&D.h(a,"number",O,"y");this.M=a});O.prototype.isReal=O.prototype.F=function(){return isFinite(this.x)&&isFinite(this.y)};function Ca(a,b){void 0===a?this.Ha=this.Ia=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.Ia=a,this.Ha=b):D.k("Invalid arguments to Size constructor: "+a+", "+b);this.J=!1}D.ja("Size",Ca);D.Ai(Ca);D.ke(Ca,{width:!0,height:!0}); -Ca.prototype.assign=function(a){this.Ia=a.Ia;this.Ha=a.Ha};Ca.prototype.setTo=Ca.prototype.m=function(a,b){v&&(D.h(a,"number",Ca,"setTo:w"),D.h(b,"number",Ca,"setTo:h"),0>a&&D.ua(a,">= 0",Ca,"setTo:w"),0>b&&D.ua(b,">= 0",Ca,"setTo:h"));this.Ia=a;this.Ha=b;return this};Ca.prototype.set=Ca.prototype.set=function(a){v&&D.l(a,Ca,Ca,"set:s");this.Ra();this.Ia=a.Ia;this.Ha=a.Ha;return this};Ca.prototype.copy=function(){var a=new Ca;a.Ia=this.Ia;a.Ha=this.Ha;return a};f=Ca.prototype; +ma.prototype.filter=function(a){for(var b=new ma(this.af,this.zi),c=this.G,d=this.Ka;null!==d;)a(d)&&b.add(d.key,d.value),this.G!==c&&D.Va(this),d=d.fb;return b};ma.prototype.concat=function(a){return this.copy().Sc(a)};ma.prototype.contains=ma.prototype.contains=function(a){v&&bb(this,a);var b=a;return D.Ta(a)&&(b=D.Gd(a),void 0===b)?!1:void 0!==this.zd[b]};ma.prototype.has=ma.prototype.has=function(a){return this.contains(a)}; +ma.prototype.getValue=ma.prototype.na=function(a){v&&bb(this,a);var b=a;if(D.Ta(a)&&(b=D.Gd(a),void 0===b))return null;a=this.zd[b];return void 0===a?null:a.value};ma.prototype.get=ma.prototype.get=function(a){return this.na(a)}; +ma.prototype.remove=ma.prototype["delete"]=ma.prototype.remove=function(a){if(null===a)return!1;v&&bb(this,a);this.J&&D.pa(this,a);var b=a;if(D.Ta(a)&&(b=D.Gd(a),void 0===b))return!1;a=this.zd[b];if(void 0===a)return!1;var c=a.fb,d=a.Hp;null!==c&&(c.Hp=d);null!==d&&(d.fb=c);this.Ka===a&&(this.Ka=c);this.gi===a&&(this.gi=d);delete this.zd[b];this.yd--;this.Rc();return!0};ma.prototype.clear=ma.prototype.clear=function(){this.J&&D.pa(this);this.zd={};this.yd=0;this.gi=this.Ka=null;this.Rc()}; +ma.prototype.copy=function(){var a=new ma(this.af,this.zi),b=this.zd,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};ma.prototype.toArray=ma.prototype.mc=function(){var a=this.zd,b=Array(this.yd),c=0,d;for(d in a){var e=a[d];b[c]=new Ra(e.key,e.value);c++}return b};ma.prototype.toKeySet=ma.prototype.Yj=function(){return new Ta(this)};D.w(ma,{count:"count"},function(){return this.yd});D.w(ma,{size:"size"},function(){return this.yd}); +D.w(ma,{j:"iterator"},function(){if(0>=this.count)return Ka;var a=this.Wb;return null!==a?(a.reset(),a):new $a(this)});D.w(ma,{$F:"iteratorKeys"},function(){return 0>=this.count?Ka:new Sa(this)});D.w(ma,{aG:"iteratorValues"},function(){if(0>=this.count)return Ka;var a=this.ej;return null!==a?(a.reset(),a):new Ya(this)});function O(a,b){void 0===a?this.M=this.L=0:"number"===typeof a&&"number"===typeof b?(this.L=a,this.M=b):D.k("Invalid arguments to Point constructor: "+a+", "+b);this.J=!1} +D.ja("Point",O);D.Bi(O);D.ke(O,{x:!0,y:!0});O.prototype.assign=function(a){this.L=a.L;this.M=a.M};O.prototype.setTo=O.prototype.n=function(a,b){v&&(D.h(a,"number",O,"setTo:x"),D.h(b,"number",O,"setTo:y"));this.L=a;this.M=b;return this};O.prototype.set=O.prototype.set=function(a){v&&D.l(a,O,O,"set:p");this.Ra();this.L=a.L;this.M=a.M;return this};O.prototype.copy=function(){var a=new O;a.L=this.L;a.M=this.M;return a};f=O.prototype;f.Na=function(){this.J=!0;Object.freeze(this);return this}; +f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.J=!0;return this};f.Ya=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;return this};f.Ra=function(a){if(this.J){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);D.k(b)}}; +O.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new O(c,e)}return new O};O.stringify=function(a){v&&D.l(a,O);return a.x.toString()+" "+a.y.toString()};O.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};O.prototype.equals=O.prototype.P=function(a){return a instanceof O?this.L===a.x&&this.M===a.y:!1}; +O.prototype.equalTo=O.prototype.Dx=function(a,b){return this.L===a&&this.M===b};O.prototype.equalsApprox=O.prototype.Tc=function(a){return Q(this.L,a.x)&&Q(this.M,a.y)};O.prototype.add=O.prototype.add=function(a){v&&D.l(a,O,O,"add:p");this.Ra();this.L+=a.x;this.M+=a.y;return this};O.prototype.subtract=O.prototype.xo=function(a){v&&D.l(a,O,O,"subtract:p");this.Ra();this.L-=a.x;this.M-=a.y;return this}; +O.prototype.offset=O.prototype.offset=function(a,b){v&&(D.p(a,O,"offset:dx"),D.p(b,O,"offset:dy"));this.Ra();this.L+=a;this.M+=b;return this};O.prototype.rotate=O.prototype.rotate=function(a){v&&D.p(a,O,"rotate:angle");this.Ra();if(0===a)return this;var b=this.L,c=this.M;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.L=d*b-e*c;this.M=e*b+d*c;return this}; +O.prototype.scale=O.prototype.scale=function(a,b){v&&(D.p(a,O,"scale:sx"),D.p(b,O,"scale:sy"));this.L*=a;this.M*=b;return this};O.prototype.distanceSquaredPoint=O.prototype.Cf=function(a){v&&D.l(a,O,O,"distanceSquaredPoint:p");var b=a.x-this.L;a=a.y-this.M;return b*b+a*a};O.prototype.distanceSquared=O.prototype.lq=function(a,b){v&&(D.p(a,O,"distanceSquared:px"),D.p(b,O,"distanceSquared:py"));var c=a-this.L,d=b-this.M;return c*c+d*d}; +O.prototype.normalize=O.prototype.normalize=function(){this.Ra();var a=this.L,b=this.M,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}O.prototype.projectOntoLineSegment=function(a,b,c,d){v&&(D.p(a,O,"projectOntoLineSegment:px"),D.p(b,O,"projectOntoLineSegment:py"),D.p(c,O,"projectOntoLineSegment:qx"),D.p(d,O,"projectOntoLineSegment:qy"));eb(a,b,c,d,this.L,this.M,this);return this}; +O.prototype.projectOntoLineSegmentPoint=function(a,b){v&&(D.l(a,O,O,"projectOntoLineSegmentPoint:p"),D.l(b,O,O,"projectOntoLineSegmentPoint:q"));eb(a.x,a.y,b.x,b.y,this.L,this.M,this);return this};O.prototype.snapToGrid=function(a,b,c,d){v&&(D.p(a,O,"snapToGrid:originx"),D.p(b,O,"snapToGrid:originy"),D.p(c,O,"snapToGrid:cellwidth"),D.p(d,O,"snapToGrid:cellheight"));fb(this.L,this.M,a,b,c,d,this);return this}; +O.prototype.snapToGridPoint=function(a,b){v&&(D.l(a,O,O,"snapToGridPoint:p"),D.l(b,Ca,O,"snapToGridPoint:q"));fb(this.L,this.M,a.x,a.y,b.width,b.height,this);return this};O.prototype.setRectSpot=O.prototype.uo=function(a,b){v&&(D.l(a,B,O,"setRectSpot:r"),D.l(b,R,O,"setRectSpot:spot"));this.Ra();this.L=a.x+b.x*a.width+b.offsetX;this.M=a.y+b.y*a.height+b.offsetY;return this}; +O.prototype.setSpot=O.prototype.$u=function(a,b,c,d,e){v&&(D.p(a,O,"setSpot:x"),D.p(b,O,"setSpot:y"),D.p(c,O,"setSpot:w"),D.p(d,O,"setSpot:h"),(0>c||0>d)&&D.k("Point.setSpot:Width and height cannot be negative"),D.l(e,R,O,"setSpot:spot"));this.Ra();this.L=a+e.x*c+e.offsetX;this.M=b+e.y*d+e.offsetY;return this};O.prototype.transform=function(a){v&&D.l(a,Da,O,"transform:t");a.wb(this);return this};function gb(a,b){v&&D.l(b,Da,O,"transformInverted:t");b.Di(a);return a}var ib; +O.distanceLineSegmentSquared=ib=function(a,b,c,d,e,g){v&&(D.p(a,O,"distanceLineSegmentSquared:px"),D.p(b,O,"distanceLineSegmentSquared:py"),D.p(c,O,"distanceLineSegmentSquared:ax"),D.p(d,O,"distanceLineSegmentSquared:ay"),D.p(e,O,"distanceLineSegmentSquared:bx"),D.p(g,O,"distanceLineSegmentSquared:by"));var h=e-c,k=g-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=g-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var jb; +O.distanceSquared=jb=function(a,b,c,d){v&&(D.p(a,O,"distanceSquared:px"),D.p(b,O,"distanceSquared:py"),D.p(c,O,"distanceSquared:qx"),D.p(d,O,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b};var rb; +O.direction=rb=function(a,b,c,d){v&&(D.p(a,O,"direction:px"),D.p(b,O,"direction:py"),D.p(c,O,"direction:qx"),D.p(d,O,"direction:qy"));a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};D.defineProperty(O,{x:"x"},function(){return this.L},function(a){this.Ra(a);v&&D.h(a,"number",O,"x");this.L=a}); +D.defineProperty(O,{y:"y"},function(){return this.M},function(a){this.Ra(a);v&&D.h(a,"number",O,"y");this.M=a});O.prototype.isReal=O.prototype.F=function(){return isFinite(this.x)&&isFinite(this.y)};function Ca(a,b){void 0===a?this.Ha=this.Ia=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.Ia=a,this.Ha=b):D.k("Invalid arguments to Size constructor: "+a+", "+b);this.J=!1}D.ja("Size",Ca);D.Bi(Ca);D.ke(Ca,{width:!0,height:!0}); +Ca.prototype.assign=function(a){this.Ia=a.Ia;this.Ha=a.Ha};Ca.prototype.setTo=Ca.prototype.n=function(a,b){v&&(D.h(a,"number",Ca,"setTo:w"),D.h(b,"number",Ca,"setTo:h"),0>a&&D.ua(a,">= 0",Ca,"setTo:w"),0>b&&D.ua(b,">= 0",Ca,"setTo:h"));this.Ia=a;this.Ha=b;return this};Ca.prototype.set=Ca.prototype.set=function(a){v&&D.l(a,Ca,Ca,"set:s");this.Ra();this.Ia=a.Ia;this.Ha=a.Ha;return this};Ca.prototype.copy=function(){var a=new Ca;a.Ia=this.Ia;a.Ha=this.Ha;return a};f=Ca.prototype; f.Na=function(){this.J=!0;Object.freeze(this);return this};f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.J=!0;return this};f.Ya=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;return this};f.Ra=function(a){if(this.J){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);D.k(b)}}; -Ca.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new Ca(c,e)}return new Ca};Ca.stringify=function(a){v&&D.l(a,Ca);return a.width.toString()+" "+a.height.toString()};Ca.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};Ca.prototype.equals=Ca.prototype.O=function(a){return a instanceof Ca?this.Ia===a.width&&this.Ha===a.height:!1}; -Ca.prototype.equalTo=Ca.prototype.Ex=function(a,b){return this.Ia===a&&this.Ha===b};Ca.prototype.equalsApprox=Ca.prototype.Sc=function(a){return Q(this.Ia,a.width)&&Q(this.Ha,a.height)};D.defineProperty(Ca,{width:"width"},function(){return this.Ia},function(a){this.Ra(a);v&&D.h(a,"number",Ca,"width");0>a&&D.ua(a,">= 0",Ca,"width");this.Ia=a}); +Ca.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new Ca(c,e)}return new Ca};Ca.stringify=function(a){v&&D.l(a,Ca);return a.width.toString()+" "+a.height.toString()};Ca.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};Ca.prototype.equals=Ca.prototype.P=function(a){return a instanceof Ca?this.Ia===a.width&&this.Ha===a.height:!1}; +Ca.prototype.equalTo=Ca.prototype.Dx=function(a,b){return this.Ia===a&&this.Ha===b};Ca.prototype.equalsApprox=Ca.prototype.Tc=function(a){return Q(this.Ia,a.width)&&Q(this.Ha,a.height)};D.defineProperty(Ca,{width:"width"},function(){return this.Ia},function(a){this.Ra(a);v&&D.h(a,"number",Ca,"width");0>a&&D.ua(a,">= 0",Ca,"width");this.Ia=a}); D.defineProperty(Ca,{height:"height"},function(){return this.Ha},function(a){this.Ra(a);v&&D.h(a,"number",Ca,"height");0>a&&D.ua(a,">= 0",Ca,"height");this.Ha=a});Ca.prototype.isReal=Ca.prototype.F=function(){return isFinite(this.width)&&isFinite(this.height)}; function B(a,b,c,d){void 0===a?this.Ha=this.Ia=this.M=this.L=0:a instanceof O?b instanceof O?(this.L=Math.min(a.L,b.L),this.M=Math.min(a.M,b.M),this.Ia=Math.abs(a.L-b.L),this.Ha=Math.abs(a.M-b.M)):b instanceof Ca?(this.L=a.L,this.M=a.M,this.Ia=b.Ia,this.Ha=b.Ha):D.k("Incorrect arguments supplied to Rect constructor"):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.L=a,this.M=b,this.Ia=c,this.Ha=d):D.k("Invalid arguments to Rect constructor: "+ -a+", "+b+", "+c+", "+d);this.J=!1}D.ja("Rect",B);D.Ai(B);D.ke(B,{x:!0,y:!0,width:!0,height:!0});B.prototype.assign=function(a){this.L=a.L;this.M=a.M;this.Ia=a.Ia;this.Ha=a.Ha};function wb(a,b,c){a.Ia=b;a.Ha=c}B.prototype.setTo=B.prototype.m=function(a,b,c,d){v&&(D.h(a,"number",B,"setTo:x"),D.h(b,"number",B,"setTo:y"),D.h(c,"number",B,"setTo:w"),D.h(d,"number",B,"setTo:h"),0>c&&D.ua(c,">= 0",B,"setTo:w"),0>d&&D.ua(d,">= 0",B,"setTo:h"));this.L=a;this.M=b;this.Ia=c;this.Ha=d;return this}; -B.prototype.set=B.prototype.set=function(a){v&&D.l(a,B,B,"set:r");this.Ra();this.L=a.L;this.M=a.M;this.Ia=a.Ia;this.Ha=a.Ha;return this};B.prototype.setPoint=B.prototype.eh=function(a){v&&D.l(a,O,B,"setPoint:p");this.Ra();this.L=a.L;this.M=a.M;return this};B.prototype.setSize=function(a){v&&D.l(a,Ca,B,"setSize:s");this.Ra();this.Ia=a.Ia;this.Ha=a.Ha;return this};B.prototype.copy=function(){var a=new B;a.L=this.L;a.M=this.M;a.Ia=this.Ia;a.Ha=this.Ha;return a};f=B.prototype; +a+", "+b+", "+c+", "+d);this.J=!1}D.ja("Rect",B);D.Bi(B);D.ke(B,{x:!0,y:!0,width:!0,height:!0});B.prototype.assign=function(a){this.L=a.L;this.M=a.M;this.Ia=a.Ia;this.Ha=a.Ha};function xb(a,b,c){a.Ia=b;a.Ha=c}B.prototype.setTo=B.prototype.n=function(a,b,c,d){v&&(D.h(a,"number",B,"setTo:x"),D.h(b,"number",B,"setTo:y"),D.h(c,"number",B,"setTo:w"),D.h(d,"number",B,"setTo:h"),0>c&&D.ua(c,">= 0",B,"setTo:w"),0>d&&D.ua(d,">= 0",B,"setTo:h"));this.L=a;this.M=b;this.Ia=c;this.Ha=d;return this}; +B.prototype.set=B.prototype.set=function(a){v&&D.l(a,B,B,"set:r");this.Ra();this.L=a.L;this.M=a.M;this.Ia=a.Ia;this.Ha=a.Ha;return this};B.prototype.setPoint=B.prototype.fh=function(a){v&&D.l(a,O,B,"setPoint:p");this.Ra();this.L=a.L;this.M=a.M;return this};B.prototype.setSize=function(a){v&&D.l(a,Ca,B,"setSize:s");this.Ra();this.Ia=a.Ia;this.Ha=a.Ha;return this};B.prototype.copy=function(){var a=new B;a.L=this.L;a.M=this.M;a.Ia=this.Ia;a.Ha=this.Ha;return a};f=B.prototype; f.Na=function(){this.J=!0;Object.freeze(this);return this};f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.J=!0;return this};f.Ya=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;return this};f.Ra=function(a){if(this.J){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);D.k(b)}}; B.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new B(c,e,g,h)}return new B};B.stringify=function(a){v&&D.l(a,B);return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}; -B.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};B.prototype.equals=B.prototype.O=function(a){return a instanceof B?this.L===a.x&&this.M===a.y&&this.Ia===a.width&&this.Ha===a.height:!1};B.prototype.equalTo=B.prototype.Ex=function(a,b,c,d){return this.L===a&&this.M===b&&this.Ia===c&&this.Ha===d};B.prototype.equalsApprox=B.prototype.Sc=function(a){return Q(this.L,a.x)&&Q(this.M,a.y)&&Q(this.Ia,a.width)&&Q(this.Ha,a.height)}; -function xb(a,b){return yb(a.L,b.x)&&yb(a.M,b.y)&&yb(a.Ia,b.width)&&yb(a.Ha,b.height)}B.prototype.containsPoint=B.prototype.Oa=function(a){v&&D.l(a,O,B,"containsPoint:p");return this.L<=a.x&&this.L+this.Ia>=a.x&&this.M<=a.y&&this.M+this.Ha>=a.y};B.prototype.containsRect=B.prototype.Nk=function(a){v&&D.l(a,B,B,"containsRect:r");return this.L<=a.x&&a.x+a.width<=this.L+this.Ia&&this.M<=a.y&&a.y+a.height<=this.M+this.Ha}; +B.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};B.prototype.equals=B.prototype.P=function(a){return a instanceof B?this.L===a.x&&this.M===a.y&&this.Ia===a.width&&this.Ha===a.height:!1};B.prototype.equalTo=B.prototype.Dx=function(a,b,c,d){return this.L===a&&this.M===b&&this.Ia===c&&this.Ha===d};B.prototype.equalsApprox=B.prototype.Tc=function(a){return Q(this.L,a.x)&&Q(this.M,a.y)&&Q(this.Ia,a.width)&&Q(this.Ha,a.height)}; +function yb(a,b){return zb(a.L,b.x)&&zb(a.M,b.y)&&zb(a.Ia,b.width)&&zb(a.Ha,b.height)}B.prototype.containsPoint=B.prototype.Oa=function(a){v&&D.l(a,O,B,"containsPoint:p");return this.L<=a.x&&this.L+this.Ia>=a.x&&this.M<=a.y&&this.M+this.Ha>=a.y};B.prototype.containsRect=B.prototype.Nk=function(a){v&&D.l(a,B,B,"containsRect:r");return this.L<=a.x&&a.x+a.width<=this.L+this.Ia&&this.M<=a.y&&a.y+a.height<=this.M+this.Ha}; B.prototype.contains=B.prototype.contains=function(a,b,c,d){v?(D.p(a,B,"contains:x"),D.p(b,B,"contains:y"),void 0===c?c=0:D.p(c,B,"contains:w"),void 0===d?d=0:D.p(d,B,"contains:h"),(0>c||0>d)&&D.k("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.L<=a&&a+c<=this.L+this.Ia&&this.M<=b&&b+d<=this.M+this.Ha};B.prototype.reset=function(){this.Ra();this.Ha=this.Ia=this.M=this.L=0}; -B.prototype.offset=B.prototype.offset=function(a,b){v&&(D.p(a,B,"offset:dx"),D.p(b,B,"offset:dy"));this.Ra();this.L+=a;this.M+=b;return this};B.prototype.inflate=B.prototype.eg=function(a,b){v&&(D.p(a,B,"inflate:w"),D.p(b,B,"inflate:h"));return Bb(this,b,a,b,a)};B.prototype.addMargin=B.prototype.ix=function(a){v&&D.l(a,Hb,B,"addMargin:m");return Bb(this,a.top,a.right,a.bottom,a.left)}; -B.prototype.subtractMargin=B.prototype.oK=function(a){v&&D.l(a,Hb,B,"subtractMargin:m");return Bb(this,-a.top,-a.right,-a.bottom,-a.left)};B.prototype.grow=function(a,b,c,d){v&&(D.p(a,B,"grow:t"),D.p(b,B,"grow:r"),D.p(c,B,"grow:b"),D.p(d,B,"grow:l"));return Bb(this,a,b,c,d)};function Bb(a,b,c,d,e){a.Ra();var g=a.Ia;c+e<=-g?(a.L+=g/2,a.Ia=0):(a.L-=e,a.Ia+=c+e);c=a.Ha;b+d<=-c?(a.M+=c/2,a.Ha=0):(a.M-=b,a.Ha+=b+d);return a} -B.prototype.intersectRect=function(a){v&&D.l(a,B,B,"intersectRect:r");return Kb(this,a.x,a.y,a.width,a.height)};B.prototype.intersect=B.prototype.HF=function(a,b,c,d){v&&(D.p(a,B,"intersect:x"),D.p(b,B,"intersect:y"),D.p(c,B,"intersect:w"),D.p(d,B,"intersect:h"),(0>c||0>d)&&D.k("Rect.intersect:Width and height cannot be negative"));return Kb(this,a,b,c,d)}; -function Kb(a,b,c,d,e){a.Ra();var g=Math.max(a.L,b),h=Math.max(a.M,c);b=Math.min(a.L+a.Ia,b+d);c=Math.min(a.M+a.Ha,c+e);a.L=g;a.M=h;a.Ia=Math.max(0,b-g);a.Ha=Math.max(0,c-h);return a}B.prototype.intersectsRect=B.prototype.Wg=function(a){v&&D.l(a,B,B,"intersectsRect:r");return this.IF(a.x,a.y,a.width,a.height)}; -B.prototype.intersects=B.prototype.IF=function(a,b,c,d){v&&(D.p(a,B,"intersects:x"),D.p(b,B,"intersects:y"),D.p(a,B,"intersects:w"),D.p(b,B,"intersects:h"),(0>c||0>d)&&D.k("Rect.intersects:Width and height cannot be negative"));var e=this.Ia,g=this.L;if(Infinity!==e&&Infinity!==c&&(e+=g,c+=a,isNaN(c)||isNaN(e)||g>c||a>e))return!1;a=this.Ha;c=this.M;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; -function Lb(a,b){var c=a.Ia,d=b.width+10+10,e=a.L,g=b.x-10;if(e>d+g||g>c+e)return!1;c=a.Ha;d=b.height+10+10;e=a.M;g=b.y-10;return e>d+g||g>c+e?!1:!0}B.prototype.unionPoint=B.prototype.Ki=function(a){v&&D.l(a,O,B,"unionPoint:p");return Ob(this,a.x,a.y,0,0)};B.prototype.unionRect=B.prototype.Wh=function(a){v&&D.l(a,B,B,"unionRect:r");return Ob(this,a.L,a.M,a.Ia,a.Ha)}; -B.prototype.union=B.prototype.gH=function(a,b,c,d){this.Ra();v?(D.p(a,B,"union:x"),D.p(b,B,"union:y"),void 0===c?c=0:D.p(c,B,"union:w"),void 0===d?d=0:D.p(d,B,"union:h"),(0>c||0>d)&&D.k("Rect.union:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return Ob(this,a,b,c,d)};function Ob(a,b,c,d,e){var g=Math.min(a.L,b),h=Math.min(a.M,c);b=Math.max(a.L+a.Ia,b+d);c=Math.max(a.M+a.Ha,c+e);a.L=g;a.M=h;a.Ia=b-g;a.Ha=c-h;return a} -B.prototype.setSpot=B.prototype.av=function(a,b,c){v&&(D.p(a,B,"setSpot:x"),D.p(b,B,"setSpot:y"),D.l(c,R,B,"setSpot:spot"));this.Ra();this.L=a-c.offsetX-c.x*this.Ia;this.M=b-c.offsetY-c.y*this.Ha;return this};var Pb; -B.contains=Pb=function(a,b,c,d,e,g,h,k){v?(D.p(a,B,"contains:rx"),D.p(b,B,"contains:ry"),D.p(c,B,"contains:rw"),D.p(d,B,"contains:rh"),D.p(e,B,"contains:x"),D.p(g,B,"contains:y"),void 0===h?h=0:D.p(h,B,"contains:w"),void 0===k?k=0:D.p(k,B,"contains:h"),(0>c||0>d||0>h||0>k)&&D.k("Rect.contains:Width and height cannot be negative")):(void 0===h&&(h=0),void 0===k&&(k=0));return a<=e&&e+h<=a+c&&b<=g&&g+k<=b+d}; +B.prototype.offset=B.prototype.offset=function(a,b){v&&(D.p(a,B,"offset:dx"),D.p(b,B,"offset:dy"));this.Ra();this.L+=a;this.M+=b;return this};B.prototype.inflate=B.prototype.Ff=function(a,b){v&&(D.p(a,B,"inflate:w"),D.p(b,B,"inflate:h"));return Db(this,b,a,b,a)};B.prototype.addMargin=B.prototype.hx=function(a){v&&D.l(a,Ib,B,"addMargin:m");return Db(this,a.top,a.right,a.bottom,a.left)}; +B.prototype.subtractMargin=B.prototype.rK=function(a){v&&D.l(a,Ib,B,"subtractMargin:m");return Db(this,-a.top,-a.right,-a.bottom,-a.left)};B.prototype.grow=function(a,b,c,d){v&&(D.p(a,B,"grow:t"),D.p(b,B,"grow:r"),D.p(c,B,"grow:b"),D.p(d,B,"grow:l"));return Db(this,a,b,c,d)};function Db(a,b,c,d,e){a.Ra();var g=a.Ia;c+e<=-g?(a.L+=g/2,a.Ia=0):(a.L-=e,a.Ia+=c+e);c=a.Ha;b+d<=-c?(a.M+=c/2,a.Ha=0):(a.M-=b,a.Ha+=b+d);return a} +B.prototype.intersectRect=function(a){v&&D.l(a,B,B,"intersectRect:r");return Lb(this,a.x,a.y,a.width,a.height)};B.prototype.intersect=B.prototype.KF=function(a,b,c,d){v&&(D.p(a,B,"intersect:x"),D.p(b,B,"intersect:y"),D.p(c,B,"intersect:w"),D.p(d,B,"intersect:h"),(0>c||0>d)&&D.k("Rect.intersect:Width and height cannot be negative"));return Lb(this,a,b,c,d)}; +function Lb(a,b,c,d,e){a.Ra();var g=Math.max(a.L,b),h=Math.max(a.M,c);b=Math.min(a.L+a.Ia,b+d);c=Math.min(a.M+a.Ha,c+e);a.L=g;a.M=h;a.Ia=Math.max(0,b-g);a.Ha=Math.max(0,c-h);return a}B.prototype.intersectsRect=B.prototype.fg=function(a){v&&D.l(a,B,B,"intersectsRect:r");return this.LF(a.x,a.y,a.width,a.height)}; +B.prototype.intersects=B.prototype.LF=function(a,b,c,d){v&&(D.p(a,B,"intersects:x"),D.p(b,B,"intersects:y"),D.p(a,B,"intersects:w"),D.p(b,B,"intersects:h"),(0>c||0>d)&&D.k("Rect.intersects:Width and height cannot be negative"));var e=this.Ia,g=this.L;if(Infinity!==e&&Infinity!==c&&(e+=g,c+=a,isNaN(c)||isNaN(e)||g>c||a>e))return!1;a=this.Ha;c=this.M;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; +function Mb(a,b){var c=a.Ia,d=b.width+10+10,e=a.L,g=b.x-10;if(e>d+g||g>c+e)return!1;c=a.Ha;d=b.height+10+10;e=a.M;g=b.y-10;return e>d+g||g>c+e?!1:!0}B.prototype.unionPoint=B.prototype.Ki=function(a){v&&D.l(a,O,B,"unionPoint:p");return Pb(this,a.x,a.y,0,0)};B.prototype.unionRect=B.prototype.Xh=function(a){v&&D.l(a,B,B,"unionRect:r");return Pb(this,a.L,a.M,a.Ia,a.Ha)}; +B.prototype.union=B.prototype.jH=function(a,b,c,d){this.Ra();v?(D.p(a,B,"union:x"),D.p(b,B,"union:y"),void 0===c?c=0:D.p(c,B,"union:w"),void 0===d?d=0:D.p(d,B,"union:h"),(0>c||0>d)&&D.k("Rect.union:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return Pb(this,a,b,c,d)};function Pb(a,b,c,d,e){var g=Math.min(a.L,b),h=Math.min(a.M,c);b=Math.max(a.L+a.Ia,b+d);c=Math.max(a.M+a.Ha,c+e);a.L=g;a.M=h;a.Ia=b-g;a.Ha=c-h;return a} +B.prototype.setSpot=B.prototype.$u=function(a,b,c){v&&(D.p(a,B,"setSpot:x"),D.p(b,B,"setSpot:y"),D.l(c,R,B,"setSpot:spot"));this.Ra();this.L=a-c.offsetX-c.x*this.Ia;this.M=b-c.offsetY-c.y*this.Ha;return this};var Qb; +B.contains=Qb=function(a,b,c,d,e,g,h,k){v?(D.p(a,B,"contains:rx"),D.p(b,B,"contains:ry"),D.p(c,B,"contains:rw"),D.p(d,B,"contains:rh"),D.p(e,B,"contains:x"),D.p(g,B,"contains:y"),void 0===h?h=0:D.p(h,B,"contains:w"),void 0===k?k=0:D.p(k,B,"contains:h"),(0>c||0>d||0>h||0>k)&&D.k("Rect.contains:Width and height cannot be negative")):(void 0===h&&(h=0),void 0===k&&(k=0));return a<=e&&e+h<=a+c&&b<=g&&g+k<=b+d}; B.intersects=function(a,b,c,d,e,g,h,k){v&&(D.p(a,B,"intersects:rx"),D.p(b,B,"intersects:ry"),D.p(c,B,"intersects:rw"),D.p(d,B,"intersects:rh"),D.p(e,B,"intersects:x"),D.p(g,B,"intersects:y"),D.p(h,B,"intersects:w"),D.p(k,B,"intersects:h"),(0>c||0>d||0>h||0>k)&&D.k("Rect.intersects:Width and height cannot be negative"));c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=g;return b>k||g>a?!1:!0};D.defineProperty(B,{x:"x"},function(){return this.L},function(a){this.Ra(a);v&&D.h(a,"number",B,"x");this.L=a}); D.defineProperty(B,{y:"y"},function(){return this.M},function(a){this.Ra(a);v&&D.h(a,"number",B,"y");this.M=a});D.defineProperty(B,{width:"width"},function(){return this.Ia},function(a){this.Ra(a);v&&D.h(a,"number",B,"width");0>a&&D.ua(a,">= 0",B,"width");this.Ia=a});D.defineProperty(B,{height:"height"},function(){return this.Ha},function(a){this.Ra(a);v&&D.h(a,"number",B,"height");0>a&&D.ua(a,">= 0",B,"height");this.Ha=a}); D.defineProperty(B,{left:"left"},function(){return this.L},function(a){this.Ra(a);v&&D.h(a,"number",B,"left");this.L=a});D.defineProperty(B,{top:"top"},function(){return this.M},function(a){this.Ra(a);v&&D.h(a,"number",B,"top");this.M=a});D.defineProperty(B,{right:"right"},function(){return this.L+this.Ia},function(a){this.Ra(a);v&&D.p(a,B,"right");this.L+=a-(this.L+this.Ia)}); D.defineProperty(B,{bottom:"bottom"},function(){return this.M+this.Ha},function(a){this.Ra(a);v&&D.p(a,B,"top");this.M+=a-(this.M+this.Ha)});D.defineProperty(B,{position:"position"},function(){return new O(this.L,this.M)},function(a){this.Ra(a);v&&D.l(a,O,B,"position");this.L=a.x;this.M=a.y});D.defineProperty(B,{size:"size"},function(){return new Ca(this.Ia,this.Ha)},function(a){this.Ra(a);v&&D.l(a,Ca,B,"size");this.Ia=a.width;this.Ha=a.height}); -D.defineProperty(B,{bm:"center"},function(){return new O(this.L+this.Ia/2,this.M+this.Ha/2)},function(a){this.Ra(a);v&&D.l(a,O,B,"center");this.L=a.x-this.Ia/2;this.M=a.y-this.Ha/2});D.defineProperty(B,{na:"centerX"},function(){return this.L+this.Ia/2},function(a){this.Ra(a);v&&D.p(a,B,"centerX");this.L=a-this.Ia/2});D.defineProperty(B,{va:"centerY"},function(){return this.M+this.Ha/2},function(a){this.Ra(a);v&&D.p(a,B,"centerY");this.M=a-this.Ha/2}); +D.defineProperty(B,{cm:"center"},function(){return new O(this.L+this.Ia/2,this.M+this.Ha/2)},function(a){this.Ra(a);v&&D.l(a,O,B,"center");this.L=a.x-this.Ia/2;this.M=a.y-this.Ha/2});D.defineProperty(B,{oa:"centerX"},function(){return this.L+this.Ia/2},function(a){this.Ra(a);v&&D.p(a,B,"centerX");this.L=a-this.Ia/2});D.defineProperty(B,{va:"centerY"},function(){return this.M+this.Ha/2},function(a){this.Ra(a);v&&D.p(a,B,"centerY");this.M=a-this.Ha/2}); B.prototype.isReal=B.prototype.F=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};B.prototype.isEmpty=function(){return 0===this.width&&0===this.height}; -function Hb(a,b,c,d){void 0===a?this.uh=this.nh=this.Dh=this.Eh=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):D.k("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.J=!1}D.ja("Margin",Hb);D.Ai(Hb);D.ke(Hb,{top:!0,right:!0,bottom:!0,left:!0});Hb.prototype.assign=function(a){this.Eh=a.Eh;this.Dh=a.Dh;this.nh=a.nh;this.uh=a.uh}; -Hb.prototype.setTo=Hb.prototype.m=function(a,b,c,d){v&&(D.h(a,"number",Hb,"setTo:t"),D.h(b,"number",Hb,"setTo:r"),D.h(c,"number",Hb,"setTo:b"),D.h(d,"number",Hb,"setTo:l"));this.Ra();this.Eh=a;this.Dh=b;this.nh=c;this.uh=d;return this};Hb.prototype.set=Hb.prototype.set=function(a){v&&D.l(a,Hb,Hb,"assign:m");this.Ra();this.Eh=a.Eh;this.Dh=a.Dh;this.nh=a.nh;this.uh=a.uh;return this};Hb.prototype.copy=function(){var a=new Hb;a.Eh=this.Eh;a.Dh=this.Dh;a.nh=this.nh;a.uh=this.uh;return a};f=Hb.prototype; +function Ib(a,b,c,d){void 0===a?this.uh=this.nh=this.Dh=this.Eh=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):D.k("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.J=!1}D.ja("Margin",Ib);D.Bi(Ib);D.ke(Ib,{top:!0,right:!0,bottom:!0,left:!0});Ib.prototype.assign=function(a){this.Eh=a.Eh;this.Dh=a.Dh;this.nh=a.nh;this.uh=a.uh}; +Ib.prototype.setTo=Ib.prototype.n=function(a,b,c,d){v&&(D.h(a,"number",Ib,"setTo:t"),D.h(b,"number",Ib,"setTo:r"),D.h(c,"number",Ib,"setTo:b"),D.h(d,"number",Ib,"setTo:l"));this.Ra();this.Eh=a;this.Dh=b;this.nh=c;this.uh=d;return this};Ib.prototype.set=Ib.prototype.set=function(a){v&&D.l(a,Ib,Ib,"assign:m");this.Ra();this.Eh=a.Eh;this.Dh=a.Dh;this.nh=a.nh;this.uh=a.uh;return this};Ib.prototype.copy=function(){var a=new Ib;a.Eh=this.Eh;a.Dh=this.Dh;a.nh=this.nh;a.uh=this.uh;return a};f=Ib.prototype; f.Na=function(){this.J=!0;Object.freeze(this);return this};f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.J=!0;return this};f.Ya=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;return this};f.Ra=function(a){if(this.J){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);D.k(b)}}; -Hb.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new Hb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new Hb(c);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));if(isNaN(g))return new Hb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new Hb(c,e):new Hb(c,e,g,h)}return new Hb}; -Hb.stringify=function(a){v&&D.l(a,Hb);return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()};Hb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};Hb.prototype.equals=Hb.prototype.O=function(a){return a instanceof Hb?this.Eh===a.top&&this.Dh===a.right&&this.nh===a.bottom&&this.uh===a.left:!1};Hb.prototype.equalTo=Hb.prototype.Ex=function(a,b,c,d){return this.Eh===a&&this.Dh===b&&this.nh===c&&this.uh===d}; -Hb.prototype.equalsApprox=Hb.prototype.Sc=function(a){return Q(this.Eh,a.top)&&Q(this.Dh,a.right)&&Q(this.nh,a.bottom)&&Q(this.uh,a.left)};D.defineProperty(Hb,{top:"top"},function(){return this.Eh},function(a){this.Ra(a);v&&D.p(a,Hb,"top");this.Eh=a});D.defineProperty(Hb,{right:"right"},function(){return this.Dh},function(a){this.Ra(a);v&&D.p(a,Hb,"right");this.Dh=a});D.defineProperty(Hb,{bottom:"bottom"},function(){return this.nh},function(a){this.Ra(a);v&&D.p(a,Hb,"bottom");this.nh=a}); -D.defineProperty(Hb,{left:"left"},function(){return this.uh},function(a){this.Ra(a);v&&D.p(a,Hb,"left");this.uh=a});Hb.prototype.isReal=Hb.prototype.F=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function Da(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}D.Ai(Da);D.ke(Da,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0}); +Ib.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new Ib;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new Ib(c);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));if(isNaN(g))return new Ib(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new Ib(c,e):new Ib(c,e,g,h)}return new Ib}; +Ib.stringify=function(a){v&&D.l(a,Ib);return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()};Ib.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};Ib.prototype.equals=Ib.prototype.P=function(a){return a instanceof Ib?this.Eh===a.top&&this.Dh===a.right&&this.nh===a.bottom&&this.uh===a.left:!1};Ib.prototype.equalTo=Ib.prototype.Dx=function(a,b,c,d){return this.Eh===a&&this.Dh===b&&this.nh===c&&this.uh===d}; +Ib.prototype.equalsApprox=Ib.prototype.Tc=function(a){return Q(this.Eh,a.top)&&Q(this.Dh,a.right)&&Q(this.nh,a.bottom)&&Q(this.uh,a.left)};D.defineProperty(Ib,{top:"top"},function(){return this.Eh},function(a){this.Ra(a);v&&D.p(a,Ib,"top");this.Eh=a});D.defineProperty(Ib,{right:"right"},function(){return this.Dh},function(a){this.Ra(a);v&&D.p(a,Ib,"right");this.Dh=a});D.defineProperty(Ib,{bottom:"bottom"},function(){return this.nh},function(a){this.Ra(a);v&&D.p(a,Ib,"bottom");this.nh=a}); +D.defineProperty(Ib,{left:"left"},function(){return this.uh},function(a){this.Ra(a);v&&D.p(a,Ib,"left");this.uh=a});Ib.prototype.isReal=Ib.prototype.F=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function Da(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}D.Bi(Da);D.ke(Da,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0}); Da.prototype.set=Da.prototype.set=function(a){v&&D.l(a,Da,Da,"set:t");this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};Da.prototype.copy=function(){var a=new Da;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};Da.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}; -Da.prototype.equals=Da.prototype.O=function(a){return a instanceof Da?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};Da.prototype.isIdentity=Da.prototype.xu=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};Da.prototype.reset=Da.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; +Da.prototype.equals=Da.prototype.P=function(a){return a instanceof Da?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};Da.prototype.isIdentity=Da.prototype.wu=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};Da.prototype.reset=Da.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; Da.prototype.multiply=Da.prototype.multiply=function(a){v&&D.l(a,Da,Da,"multiply:matrix");var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,g=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=g;return this}; -Da.prototype.multiplyInverted=Da.prototype.lB=function(a){v&&D.l(a,Da,Da,"multiplyInverted:matrix");var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,g=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*g;e=this.m12*e+this.m22*g;g=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=g;this.dy=h;return this}; -Da.prototype.invert=Da.prototype.Qx=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),g=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=g;return this}; +Da.prototype.multiplyInverted=Da.prototype.pB=function(a){v&&D.l(a,Da,Da,"multiplyInverted:matrix");var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,g=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*g;e=this.m12*e+this.m22*g;g=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=g;this.dy=h;return this}; +Da.prototype.invert=Da.prototype.Px=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),g=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=g;return this}; Da.prototype.rotate=Da.prototype.rotate=function(a,b,c){v&&(D.p(a,Da,"rotate:angle"),D.p(b,Da,"rotate:rx"),D.p(c,Da,"rotate:ry"));360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);var d=0,e=0;90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(e=a*Math.PI/180,d=Math.cos(e),e=Math.sin(e));a=this.m12*d+this.m22*e;var g=this.m11*-e+this.m21*d,h=this.m12*-e+this.m22*d;this.m11=this.m11*d+this.m21*e;this.m12=a;this.m21=g;this.m22=h;this.translate(-b,-c);return this}; Da.prototype.translate=Da.prototype.translate=function(a,b){v&&(D.p(a,Da,"translate:x"),D.p(b,Da,"translate:y"));this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};Da.prototype.scale=Da.prototype.scale=function(a,b){void 0===b&&(b=a);v&&(D.p(a,Da,"translate:sx"),D.p(b,Da,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this}; -Da.prototype.transformPoint=Da.prototype.vb=function(a){v&&D.l(a,O,Da,"transformPoint:p");var b=a.L,c=a.M;a.L=b*this.m11+c*this.m21+this.dx;a.M=b*this.m12+c*this.m22+this.dy;return a};Da.prototype.invertedTransformPoint=Da.prototype.Ci=function(a){v&&D.l(a,O,Da,"invertedTransformPoint:p");var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),g=a.L,h=a.M;a.L=g*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.M=g*c+h*d+e;return a}; -Da.prototype.transformRect=Da.prototype.fH=function(a){v&&D.l(a,B,Da,"transformRect:rect");var b=a.L,c=a.M,d=b+a.Ia,e=c+a.Ha,g=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*g+c*k+m,q=b*h+c*l+n,r=d*g+c*k+m,c=d*h+c*l+n,s=b*g+e*k+m,b=b*h+e*l+n,g=d*g+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,g),e=Math.max(e,g),h=Math.min(h,d),q=Math.max(q,d);a.L=p;a.M=h;a.Ia= -e-p;a.Ha=q-h;return a};function R(a,b,c,d){void 0===a?this.Jg=this.Ig=this.M=this.L=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.J=!1}D.ja("Spot",R);D.Ai(R);D.ke(R,{x:!0,y:!0,offsetX:!0,offsetY:!0});R.prototype.assign=function(a){this.L=a.L;this.M=a.M;this.Ig=a.Ig;this.Jg=a.Jg}; -R.prototype.setTo=R.prototype.m=function(a,b,c,d){v&&(Qb(a,"setTo:x"),Qb(b,"setTo:y"),Ub(c,"setTo:offx"),Ub(d,"setTo:offy"));this.Ra();this.L=a;this.M=b;this.Ig=c;this.Jg=d;return this};R.prototype.set=R.prototype.set=function(a){v&&D.l(a,R,R,"set:s");this.Ra();this.L=a.L;this.M=a.M;this.Ig=a.Ig;this.Jg=a.Jg;return this};R.prototype.copy=function(){var a=new R;a.L=this.L;a.M=this.M;a.Ig=this.Ig;a.Jg=this.Jg;return a};f=R.prototype;f.Na=function(){this.J=!0;Object.freeze(this);return this}; -f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.J=!0;return this};f.Ya=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;return this};f.Ra=function(a){if(this.J){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);D.k(b)}};function Xb(a,b){a.L=NaN;a.M=NaN;a.Ig=b;return a}function Qb(a,b){(isNaN(a)||1a)&&D.ua(a,"0 <= "+b+" <= 1",R,b)} -function Ub(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&D.ua(a,"real number, not NaN or Infinity",R,b)}var Yb; -R.parse=Yb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return bc;if("TopLeft"===a)return cc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return dc;if("TopRight"===a)return ec;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return fc;if("Center"===a)return gc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return oc;if("BottomLeft"===a)return pc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return qc;if("BottomRight"===a)return rc;if("TopSide"===a)return sc;if("LeftSide"=== -a)return tc;if("RightSide"===a)return uc;if("BottomSide"===a)return yc;if("TopBottomSides"===a)return zc;if("LeftRightSides"===a)return Gc;if("TopLeftSides"===a)return Hc;if("TopRightSides"===a)return Ic;if("BottomLeftSides"===a)return Jc;if("BottomRightSides"===a)return Kc;if("NotTopSide"===a)return Lc;if("NotLeftSide"===a)return Mc;if("NotRightSide"===a)return Qc;if("NotBottomSide"===a)return Rc;if("AllSides"===a)return Sc;if("Default"===a)return Tc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; +Da.prototype.transformPoint=Da.prototype.wb=function(a){v&&D.l(a,O,Da,"transformPoint:p");var b=a.L,c=a.M;a.L=b*this.m11+c*this.m21+this.dx;a.M=b*this.m12+c*this.m22+this.dy;return a};Da.prototype.invertedTransformPoint=Da.prototype.Di=function(a){v&&D.l(a,O,Da,"invertedTransformPoint:p");var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),g=a.L,h=a.M;a.L=g*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.M=g*c+h*d+e;return a}; +Da.prototype.transformRect=Da.prototype.iH=function(a){v&&D.l(a,B,Da,"transformRect:rect");var b=a.L,c=a.M,d=b+a.Ia,e=c+a.Ha,g=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*g+c*k+m,q=b*h+c*l+n,r=d*g+c*k+m,c=d*h+c*l+n,s=b*g+e*k+m,b=b*h+e*l+n,g=d*g+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,g),e=Math.max(e,g),h=Math.min(h,d),q=Math.max(q,d);a.L=p;a.M=h;a.Ia= +e-p;a.Ha=q-h;return a};function R(a,b,c,d){void 0===a?this.Lg=this.Kg=this.M=this.L=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.J=!1}D.ja("Spot",R);D.Bi(R);D.ke(R,{x:!0,y:!0,offsetX:!0,offsetY:!0});R.prototype.assign=function(a){this.L=a.L;this.M=a.M;this.Kg=a.Kg;this.Lg=a.Lg}; +R.prototype.setTo=R.prototype.n=function(a,b,c,d){v&&(Rb(a,"setTo:x"),Rb(b,"setTo:y"),Vb(c,"setTo:offx"),Vb(d,"setTo:offy"));this.Ra();this.L=a;this.M=b;this.Kg=c;this.Lg=d;return this};R.prototype.set=R.prototype.set=function(a){v&&D.l(a,R,R,"set:s");this.Ra();this.L=a.L;this.M=a.M;this.Kg=a.Kg;this.Lg=a.Lg;return this};R.prototype.copy=function(){var a=new R;a.L=this.L;a.M=this.M;a.Kg=this.Kg;a.Lg=this.Lg;return a};f=R.prototype;f.Na=function(){this.J=!0;Object.freeze(this);return this}; +f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.J=!0;return this};f.Ya=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;return this};f.Ra=function(a){if(this.J){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);D.k(b)}};function Yb(a,b){a.L=NaN;a.M=NaN;a.Kg=b;return a}function Rb(a,b){(isNaN(a)||1a)&&D.ua(a,"0 <= "+b+" <= 1",R,b)} +function Vb(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&D.ua(a,"real number, not NaN or Infinity",R,b)}var Zb; +R.parse=Zb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return cc;if("TopLeft"===a)return dc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return ec;if("TopRight"===a)return fc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return gc;if("Center"===a)return hc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return rc;if("BottomLeft"===a)return sc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return tc;if("BottomRight"===a)return uc;if("TopSide"===a)return vc;if("LeftSide"=== +a)return wc;if("RightSide"===a)return xc;if("BottomSide"===a)return Bc;if("TopBottomSides"===a)return Cc;if("LeftRightSides"===a)return Jc;if("TopLeftSides"===a)return Kc;if("TopRightSides"===a)return Lc;if("BottomLeftSides"===a)return Mc;if("BottomRightSides"===a)return Nc;if("NotTopSide"===a)return Oc;if("NotLeftSide"===a)return Pc;if("NotRightSide"===a)return Sc;if("NotBottomSide"===a)return Tc;if("AllSides"===a)return Uc;if("Default"===a)return Vc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0b.offset?1:-1});for(k=0;kb.offset?1:-1});for(k=0;k=2*Math.PI?(qd(a,b,c,d,e,e+Math.PI,h),qd(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,g])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k===!!h?0:1,0!==a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,g]))}}function pd(a,b,c,d,e,g,h){var k=new hd;k.Yb=[b,c,d,e,g,h];b={};Ad(a,"g",b,k);k=a.addElement("g",b);a.Ef.push(k)} -f.ib=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+D.Gm++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,g,h;c=od(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",vM:this.shadowBlur/2});d=od(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=od(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});g=od(this,"feOffset",{"in":"comp",result:"offsetBlur", -dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=od(this,"feMerge",{});h.appendChild(od(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(od(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(g);b.appendChild(h);0=2*Math.PI?(rd(a,b,c,d,e,e+Math.PI,h),rd(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,g])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k===!!h?0:1,0!==a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,g]))}}function qd(a,b,c,d,e,g,h){var k=new jd;k.Zb=[b,c,d,e,g,h];b={};Ad(a,"g",b,k);k=a.addElement("g",b);a.Ef.push(k)} +f.ib=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+D.Gm++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,g,h;c=pd(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",yM:this.shadowBlur/2});d=pd(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=pd(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});g=pd(this,"feOffset",{"in":"comp",result:"offsetBlur", +dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=pd(this,"feMerge",{});h.appendChild(pd(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(pd(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(g);b.appendChild(h);0b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.pr?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.pr?this.clip():this.fill()}; -f.Vj=function(){this.pr||this.stroke()};D.defineProperty(Dd,{eq:"clipInsteadOfFill"},function(){return this.pr},function(a){this.pr=a});f=Dd.prototype;f.JB=function(a,b,c){this.st=a;this.tt=b;this.Lg=c};f.to=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};f.uo=function(){this.shadowOffsetX=this.st;this.shadowOffsetY=this.tt;this.shadowBlur=this.Lg}; -f.GA=function(a,b){var c=this.Da;if(void 0!==c.setLineDash)c.setLineDash(a),c.lineDashOffset=b;else if(void 0!==c.webkitLineDash)c.webkitLineDash=a,c.webkitLineDashOffset=b;else if(void 0!==c.mozDash)c.mozDash=a,c.mozDashOffset=b;else return!1;return!0};f.BA=function(){var a=this.Da;void 0!==a.setLineDash?(a.setLineDash(D.Co),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=D.Co,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0)}; -f.Be=function(a){a&&(this.cz="");this.bz=this.dz=""}; -var Fd=(Math.sqrt(2)-1)/3*4,Gd=(new O(0,0)).Na(),Hd=(new B(0,0,0,0)).Na(),Ud=(new Hb(0,0,0,0)).Na(),Vd=(new Hb(2,2,2,2)).Na(),Wd=(new O(6,6)).Na(),Xd=(new O(-Infinity,-Infinity)).Na(),Yd=(new O(Infinity,Infinity)).Na(),Zd=(new Ca(0,0)).Na(),$d=(new Ca(1,1)).Na(),ae=(new Ca(6,6)).Na(),be=(new Ca(8,8)).Na(),ce=(new Ca(10,10)).Na(),ke=(new Ca(Infinity,Infinity)).Na(),le=(new O(NaN,NaN)).Na(),me=(new Ca(NaN,NaN)).Na(),ne=(new B(NaN,NaN,NaN,NaN)).Na(),oe=(new R(.156,.156)).Na(),pe=(new R(.844,.844)).Na(), -qe=new la,re=new la,se=null;function te(a){if(0>=a)return 0;var b=se;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);se=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)}function Q(a,b){var c=a-b;return.5>c&&-.5c&&-5E-8=e&&(e=1E-6);var k=0,l=0,m=0,n=0;am-n)if(a-c>e||c-a>e){if(g=(d-b)/(c-a)*(g-a)+b,g-e<=h&&h<=g+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=g&&g<=h+e)return!0}else return!0;return!1} -function De(a,b,c,d,e,g,h,k,l,m,n,p){if(ue(a,b,h,k,p,c,d)&&ue(a,b,h,k,p,e,g))return ue(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+g)/2,t=(d+s)/2,y=(c+u)/2;return De(a,b,q,r,d,c,t,y,l,m,n,p)||De(t,y,s,u,e,g,h,k,l,m,n,p)} -function Ee(a,b,c,d,e,g,h,k,l,m){if(ue(a,b,h,k,l,c,d)&&ue(a,b,h,k,l,e,g))Ob(m,a,b,0,0),Ob(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,u=(c+r)/2;Ee(a,b,n,p,d,c,s,u,l,m);Ee(s,u,q,r,e,g,h,k,l,m)}} -function Fe(a,b,c,d,e,g,h,k,l,m){if(ue(a,b,h,k,l,c,d)&&ue(a,b,h,k,l,e,g))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,u=(c+r)/2;Fe(a,b,n,p,d,c,s,u,l,m);Fe(s,u,q,r,e,g,h,k,l,m)}} -function Ge(a,b,c,d,e,g,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+g*l;e=e*s+h*l;g=g*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+g*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=g}function He(a,b,c,d,e,g,h,k,l,m){if(ue(a,b,e,g,m,c,d))return ue(a,b,e,g,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var q=(n+c)/2,r=(p+d)/2;return He(a,b,n,p,q,r,h,k,l,m)||He(q,r,c,d,e,g,h,k,l,m)} -function Ie(a,b,c,d,e,g,h,k){if(ue(a,b,e,g,h,c,d))Ob(k,a,b,0,0),Ob(k,e,g,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;Ie(a,b,l,m,n,p,h,k);Ie(n,p,c,d,e,g,h,k)}}function Je(a,b,c,d,e,g,h,k){if(ue(a,b,e,g,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(g);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;Je(a,b,l,m,n,p,h,k);Je(n,p,c,d,e,g,h,k)}} -function Ke(a,b,c,d,e,g,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(ue(a,b,h,k,q,c,d)&&ue(a,b,h,k,q,e,g)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,bh)return!1}else if(ah)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,u=(b+d)/2;c=(c+e)/2;d=(d+g)/2;e=(e+h)/2;g=(g+k)/2;var t=(s+c)/2,y=(u+d)/2;c=(c+e)/2;d=(d+g)/2;var w=(t+c)/2,C=(y+d)/2, -A=(n-l)*(n-l)+(p-m)*(p-m),N=!1;Ke(a,b,s,u,t,y,w,C,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b=q&&(q=1E-6);if(ue(a,b,h,k,q,c,d)&&ue(a,b,h,k,q,e,g)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,u=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(a=l=0,ba)return r}else if(aa)return r;0q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,y=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+t)/2;c=(u+y)/2;var t=(t+e)/2,y=(y+g)/2, -w=(d+t)/2,C=(c+y)/2,r=r+Le(a,b,s,u,d,c,w,C,l,m,n,p,q),r=r+Le(w,C,t,y,e,g,h,k,l,m,n,p,q)}return r} -function fb(a,b,c,d,e,g,h){if(yb(a,c)){var k=0;c=0;bc)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(yb(b,d)){ac)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-g)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005c)return l.x=a,l.y=c,!1;l.x=a;l.y=g;return!0}h=(d-b)/(c-a);if(yb(k,h))return fb(a,b,c,d,e,g,l),!1;e=(h*a-k*e+g-b)/(h-k);if(yb(h,0)){ac)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}g= -h*(e-a)+b;return fb(a,b,c,d,e,g,l)}function Ne(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(Me(a,b,a,d,e,g,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g);qm} -function Ue(a,b,c,d,e,g,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(g-k)/m,h=a,n=k*h+(g-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(g-k)/m,a=b-d*a,h=(g-k*e-a)/(d-k),n=d*h+a);l.m(h,n);return l} -function Ve(a,b,c){var d=b.x,e=b.y,g=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===g?(g=a=0,e=m):e===h?(d=k):a.Oa(b)||a.Oa(c)||We(k,m,l,m,d,e,g,h)||We(l,m,l,n,d,e,g,h)||We(l,n,k,n,d,e,g,h)||We(k,n,k,m,d,e,g,h)?!0:!1}function We(a,b,c,d,e,g,h,k){return 0>=Xe(a,b,c,d,e,g)*Xe(a,b,c,d,h,k)&&0>=Xe(e,g,h,k,a,b)*Xe(e,g,h,k,c,d)} -function Xe(a,b,c,d,e,g){c-=a;d-=b;a=e-a;b=g-b;g=a*d-b*c;0===g&&(g=a*c+b*d,0g&&(g=0)));return 0>g?-1:0a&&(a+=360);360<=a&&(a-=360);return a} -function Ze(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);d=bc,g=0>d,h=0,k=h=0;ag;++g){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,aa?"M"+this.ma.toString()+" "+this.ka.toString()+"L"+this.H.toString()+" "+this.I.toString():"M"+this.ma.toFixed(a)+" "+this.ka.toFixed(a)+"L"+this.H.toFixed(a)+" "+this.I.toFixed(a);case tf:var b=new B(this.ma,this.ka,0,0);b.gH(this.H,this.I,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+ -"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case uf:b=new B(this.ma,this.ka,0,0);b.gH(this.H,this.I,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ -2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case cf:for(var b="",c=this.kc.o,d=c.length,e=0;e=u-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new O(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function g(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new O(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&D.gc(a,"string",bf,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, +function Dd(a){a.getContext&&a.getContext("2d")||D.k("Browser does not support HTML Canvas Element");this.xa=a.getContext("2d");this.az=this.cz=this.bz="";this.or=!1;this.Ng=this.tt=this.st=0;Object.seal(this)}Dd.prototype.Ey=function(a){this.xa.XA=a;this.xa.aM=a};D.defineProperty(Dd,{fillStyle:"fillStyle"},function(){return this.xa.fillStyle},function(a){this.az!==a&&(this.az=this.xa.fillStyle=a)}); +D.defineProperty(Dd,{font:"font"},function(){return this.xa.font},function(a){this.bz!==a&&(this.bz=this.xa.font=a)});D.defineProperty(Dd,{globalAlpha:"globalAlpha"},function(){return this.xa.globalAlpha},function(a){this.xa.globalAlpha=a});D.defineProperty(Dd,{lineCap:"lineCap"},function(){return this.xa.lineCap},function(a){this.xa.lineCap=a});D.defineProperty(Dd,{eo:"lineDashOffset"},function(){return this.xa.eo},function(a){this.xa.eo=a}); +D.defineProperty(Dd,{lineJoin:"lineJoin"},function(){return this.xa.lineJoin},function(a){this.xa.lineJoin=a});D.defineProperty(Dd,{lineWidth:"lineWidth"},function(){return this.xa.lineWidth},function(a){this.xa.lineWidth=a});D.defineProperty(Dd,{miterLimit:"miterLimit"},function(){return this.xa.miterLimit},function(a){this.xa.miterLimit=a});D.defineProperty(Dd,{shadowBlur:"shadowBlur"},function(){return this.xa.shadowBlur},function(a){this.xa.shadowBlur=a}); +D.defineProperty(Dd,{shadowColor:"shadowColor"},function(){return this.xa.shadowColor},function(a){this.xa.shadowColor=a});D.defineProperty(Dd,{shadowOffsetX:"shadowOffsetX"},function(){return this.xa.shadowOffsetX},function(a){this.xa.shadowOffsetX=a});D.defineProperty(Dd,{shadowOffsetY:"shadowOffsetY"},function(){return this.xa.shadowOffsetY},function(a){this.xa.shadowOffsetY=a}); +D.defineProperty(Dd,{strokeStyle:"strokeStyle"},function(){return this.xa.strokeStyle},function(a){this.cz!==a&&(this.cz=this.xa.strokeStyle=a)});D.defineProperty(Dd,{textAlign:"textAlign"},function(){return this.xa.textAlign},function(a){this.xa.textAlign=a});D.defineProperty(Dd,{XA:"imageSmoothingEnabled"},function(){return this.xa.XA},function(a){this.xa.XA=a});f=Dd.prototype;f.arc=function(a,b,c,d,e,g){this.xa.arc(a,b,c,d,e,g)};f.beginPath=function(){this.xa.beginPath()}; +f.bezierCurveTo=function(a,b,c,d,e,g){this.xa.bezierCurveTo(a,b,c,d,e,g)};f.clearRect=function(a,b,c,d){this.xa.clearRect(a,b,c,d)};f.clip=function(){this.xa.clip()};f.closePath=function(){this.xa.closePath()};f.createLinearGradient=function(a,b,c,d){return this.xa.createLinearGradient(a,b,c,d)};f.createPattern=function(a,b){return this.xa.createPattern(a,b)};f.createRadialGradient=function(a,b,c,d,e,g){return this.xa.createRadialGradient(a,b,c,d,e,g)}; +f.drawImage=function(a,b,c,d,e,g,h,k,l){void 0===d?this.xa.drawImage(a,b,c):this.xa.drawImage(a,b,c,d,e,g,h,k,l)};f.fill=function(){this.xa.fill()};f.fillRect=function(a,b,c,d){this.xa.fillRect(a,b,c,d)};f.fillText=function(a,b,c){this.xa.fillText(a,b,c)};f.getImageData=function(a,b,c,d){return this.xa.getImageData(a,b,c,d)};f.lineTo=function(a,b){this.xa.lineTo(a,b)};f.measureText=function(a){return this.xa.measureText(a)};f.moveTo=function(a,b){this.xa.moveTo(a,b)}; +f.quadraticCurveTo=function(a,b,c,d){this.xa.quadraticCurveTo(a,b,c,d)};f.rect=function(a,b,c,d){this.xa.rect(a,b,c,d)};f.restore=function(){this.xa.restore()};Dd.prototype.rotate=function(a){this.xa.rotate(a)};f=Dd.prototype;f.save=function(){this.xa.save()};f.setTransform=function(a,b,c,d,e,g){this.xa.setTransform(a,b,c,d,e,g)};f.scale=function(a,b){this.xa.scale(a,b)};f.stroke=function(){this.xa.stroke()}; +f.transform=function(a,b,c,d,e,g){1===a&&0===b&&0===c&&1===d&&0===e&&0===g||this.xa.transform(a,b,c,d,e,g)};f.translate=function(a,b){this.xa.translate(a,b)};f.Wg=function(a){if(a instanceof Ba&&a.type===Ed){var b=a.Oo;a=a.gz;a>b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.or?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.or?this.clip():this.fill()}; +f.Wj=function(){this.or||this.stroke()};D.defineProperty(Dd,{dq:"clipInsteadOfFill"},function(){return this.or},function(a){this.or=a});f=Dd.prototype;f.NB=function(a,b,c){this.st=a;this.tt=b;this.Ng=c};f.vo=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};f.wo=function(){this.shadowOffsetX=this.st;this.shadowOffsetY=this.tt;this.shadowBlur=this.Ng}; +f.IA=function(a,b){var c=this.xa;if(void 0!==c.setLineDash)c.setLineDash(a),c.lineDashOffset=b;else if(void 0!==c.webkitLineDash)c.webkitLineDash=a,c.webkitLineDashOffset=b;else if(void 0!==c.mozDash)c.mozDash=a,c.mozDashOffset=b;else return!1;return!0};f.DA=function(){var a=this.xa;void 0!==a.setLineDash?(a.setLineDash(D.Eo),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=D.Eo,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0)}; +f.Be=function(a){a&&(this.bz="");this.az=this.cz=""}; +var Fd=(Math.sqrt(2)-1)/3*4,Gd=(new O(0,0)).Na(),Hd=(new B(0,0,0,0)).Na(),Sd=(new Ib(0,0,0,0)).Na(),Td=(new Ib(2,2,2,2)).Na(),Ud=(new O(6,6)).Na(),Vd=(new O(-Infinity,-Infinity)).Na(),Wd=(new O(Infinity,Infinity)).Na(),Xd=(new Ca(0,0)).Na(),Yd=(new Ca(1,1)).Na(),Zd=(new Ca(6,6)).Na(),$d=(new Ca(8,8)).Na(),ae=(new Ca(10,10)).Na(),he=(new Ca(Infinity,Infinity)).Na(),ie=(new O(NaN,NaN)).Na(),je=(new Ca(NaN,NaN)).Na(),ke=(new B(NaN,NaN,NaN,NaN)).Na(),le=(new R(.156,.156)).Na(),me=(new R(.844,.844)).Na(), +ne=new la,oe=new la,pe=null;function qe(a){if(0>=a)return 0;var b=pe;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);pe=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)}function Q(a,b){var c=a-b;return.5>c&&-.5c&&-5E-8=e&&(e=1E-6);var k=0,l=0,m=0,n=0;am-n)if(a-c>e||c-a>e){if(g=(d-b)/(c-a)*(g-a)+b,g-e<=h&&h<=g+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=g&&g<=h+e)return!0}else return!0;return!1} +function ze(a,b,c,d,e,g,h,k,l,m,n,p){if(re(a,b,h,k,p,c,d)&&re(a,b,h,k,p,e,g))return re(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+g)/2,t=(d+s)/2,y=(c+u)/2;return ze(a,b,q,r,d,c,t,y,l,m,n,p)||ze(t,y,s,u,e,g,h,k,l,m,n,p)} +function Ae(a,b,c,d,e,g,h,k,l,m){if(re(a,b,h,k,l,c,d)&&re(a,b,h,k,l,e,g))Pb(m,a,b,0,0),Pb(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,u=(c+r)/2;Ae(a,b,n,p,d,c,s,u,l,m);Ae(s,u,q,r,e,g,h,k,l,m)}} +function Be(a,b,c,d,e,g,h,k,l,m){if(re(a,b,h,k,l,c,d)&&re(a,b,h,k,l,e,g))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,u=(c+r)/2;Be(a,b,n,p,d,c,s,u,l,m);Be(s,u,q,r,e,g,h,k,l,m)}} +function Ce(a,b,c,d,e,g,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+g*l;e=e*s+h*l;g=g*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+g*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=g}function De(a,b,c,d,e,g,h,k,l,m){if(re(a,b,e,g,m,c,d))return re(a,b,e,g,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var q=(n+c)/2,r=(p+d)/2;return De(a,b,n,p,q,r,h,k,l,m)||De(q,r,c,d,e,g,h,k,l,m)} +function Ee(a,b,c,d,e,g,h,k){if(re(a,b,e,g,h,c,d))Pb(k,a,b,0,0),Pb(k,e,g,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;Ee(a,b,l,m,n,p,h,k);Ee(n,p,c,d,e,g,h,k)}}function Fe(a,b,c,d,e,g,h,k){if(re(a,b,e,g,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(g);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;Fe(a,b,l,m,n,p,h,k);Fe(n,p,c,d,e,g,h,k)}} +function Ge(a,b,c,d,e,g,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(re(a,b,h,k,q,c,d)&&re(a,b,h,k,q,e,g)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,bh)return!1}else if(ah)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,u=(b+d)/2;c=(c+e)/2;d=(d+g)/2;e=(e+h)/2;g=(g+k)/2;var t=(s+c)/2,y=(u+d)/2;c=(c+e)/2;d=(d+g)/2;var w=(t+c)/2,C=(y+d)/2, +A=(n-l)*(n-l)+(p-m)*(p-m),N=!1;Ge(a,b,s,u,t,y,w,C,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b=q&&(q=1E-6);if(re(a,b,h,k,q,c,d)&&re(a,b,h,k,q,e,g)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,u=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(a=l=0,ba)return r}else if(aa)return r;0q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,y=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+t)/2;c=(u+y)/2;var t=(t+e)/2,y=(y+g)/2, +w=(d+t)/2,C=(c+y)/2,r=r+He(a,b,s,u,d,c,w,C,l,m,n,p,q),r=r+He(w,C,t,y,e,g,h,k,l,m,n,p,q)}return r} +function eb(a,b,c,d,e,g,h){if(zb(a,c)){var k=0;c=0;bc)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(zb(b,d)){ac)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-g)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005c)return l.x=a,l.y=c,!1;l.x=a;l.y=g;return!0}h=(d-b)/(c-a);if(zb(k,h))return eb(a,b,c,d,e,g,l),!1;e=(h*a-k*e+g-b)/(h-k);if(zb(h,0)){ac)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}g= +h*(e-a)+b;return eb(a,b,c,d,e,g,l)}function Je(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(Ie(a,b,a,d,e,g,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g);qm} +function Qe(a,b,c,d,e,g,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(g-k)/m,h=a,n=k*h+(g-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(g-k)/m,a=b-d*a,h=(g-k*e-a)/(d-k),n=d*h+a);l.n(h,n);return l} +function Re(a,b,c){var d=b.x,e=b.y,g=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===g?(g=a=0,e=m):e===h?(d=k):a.Oa(b)||a.Oa(c)||Se(k,m,l,m,d,e,g,h)||Se(l,m,l,n,d,e,g,h)||Se(l,n,k,n,d,e,g,h)||Se(k,n,k,m,d,e,g,h)?!0:!1}function Se(a,b,c,d,e,g,h,k){return 0>=Te(a,b,c,d,e,g)*Te(a,b,c,d,h,k)&&0>=Te(e,g,h,k,a,b)*Te(e,g,h,k,c,d)} +function Te(a,b,c,d,e,g){c-=a;d-=b;a=e-a;b=g-b;g=a*d-b*c;0===g&&(g=a*c+b*d,0g&&(g=0)));return 0>g?-1:0a&&(a+=360);360<=a&&(a-=360);return a} +function Ve(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);d=bc,g=0>d,h=0,k=h=0;ag;++g){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,aa?"M"+this.ma.toString()+" "+this.ka.toString()+"L"+this.H.toString()+" "+this.I.toString():"M"+this.ma.toFixed(a)+" "+this.ka.toFixed(a)+"L"+this.H.toFixed(a)+" "+this.I.toFixed(a);case rf:var b=new B(this.ma,this.ka,0,0);b.jH(this.H,this.I,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+ +"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case sf:b=new B(this.ma,this.ka,0,0);b.jH(this.H,this.I,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ +2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case Ze:for(var b="",c=this.lc.o,d=c.length,e=0;e=u-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new O(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function g(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new O(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&D.hc(a,"string",Ye,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var l=a.split(" "),m=-1,n="",p="",q=new O(0,0),r=new O(0,0),s=new O(0, -0),u=l.length,t=D.v(),y=!1,w=!1,C=!0,A=null;!(m>=u-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":C=!0;w=y=!1;break;case "M":A=g();null===t.cc||!0===C?(T(t,A.x,A.y,y,!1,!w),C=!1):t.moveTo(A.x,A.y);for(q=s;!c();)A=g(),t.lineTo(A.x,A.y);break;case "L":for(;!c();)A=g(),t.lineTo(A.x,A.y);break;case "H":for(;!c();)s=A=new O((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),t.lineTo(s.x,s.y);break;case "V":for(;!c();)s=A=new O(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),t.lineTo(s.x,s.y); -break;case "C":for(;!c();){var N=e(),H=h(),A=g();V(t,N.x,N.y,H.x,H.y,A.x,A.y)}break;case "S":for(;!c();)N=k(),H=h(),A=g(),V(t,N.x,N.y,H.x,H.y,A.x,A.y);break;case "Q":for(;!c();)H=h(),A=g(),zf(t,H.x,H.y,A.x,A.y);break;case "T":for(;!c();)r=H=k(),A=g(),zf(t,H.x,H.y,A.x,A.y);break;case "B":for(;!c();){var A=parseFloat(d()),N=parseFloat(d()),H=parseFloat(d()),W=parseFloat(d()),fa=parseFloat(d()),S=fa,ba=!1;c()||(S=parseFloat(d()),c()||(ba=0!==parseFloat(d())));n===n.toLowerCase()&&(H+=s.x,W+=s.y);t.arcTo(A, -N,H,W,fa,S,ba)}break;case "A":for(;!c();)N=Math.abs(parseFloat(d())),H=Math.abs(parseFloat(d())),W=parseFloat(d()),fa=!!parseFloat(d()),S=!!parseFloat(d()),A=g(),Af(t,N,H,W,fa,S,A.x,A.y);break;case "Z":A=t.q.kc.o[t.q.kc.length-1];X(t);s=q;break;case "F":A="";for(N=1;l[m+N];)if(null!==l[m+N].match(/[Uu]/))N++;else if(null===l[m+N].match(/[A-Za-z]/))N++;else{A=l[m+N];break}A.match(/[Mm]/)?y=!0:Bf(t);break;case "U":A="";for(N=1;l[m+N];)if(null!==l[m+N].match(/[Ff]/))N++;else if(null===l[m+N].match(/[A-Za-z]/))N++; -else{A=l[m+N];break}A.match(/[Mm]/)?w=!0:t.ib(!1)}q=t.q;D.u(t);if(b)for(t=q.kc.j;t.next();)A=t.value,A.wu=!0;return q};function Cf(a,b){for(var c=a.length,d=D.P(),e=0;eh&&(h+=360),s.Le+=h);0>a&&(s.Le=180-s.Le,s.xf=-s.xf);0>d&&(s.Le=-s.Le,s.xf=-s.xf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case Rf:h=s.H;k=s.I;s.H=h* +0),u=l.length,t=D.v(),y=!1,w=!1,C=!0,A=null;!(m>=u-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":C=!0;w=y=!1;break;case "M":A=g();null===t.dc||!0===C?(T(t,A.x,A.y,y,!1,!w),C=!1):t.moveTo(A.x,A.y);for(q=s;!c();)A=g(),t.lineTo(A.x,A.y);break;case "L":for(;!c();)A=g(),t.lineTo(A.x,A.y);break;case "H":for(;!c();)s=A=new O((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),t.lineTo(s.x,s.y);break;case "V":for(;!c();)s=A=new O(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),t.lineTo(s.x,s.y); +break;case "C":for(;!c();){var N=e(),H=h(),A=g();V(t,N.x,N.y,H.x,H.y,A.x,A.y)}break;case "S":for(;!c();)N=k(),H=h(),A=g(),V(t,N.x,N.y,H.x,H.y,A.x,A.y);break;case "Q":for(;!c();)H=h(),A=g(),xf(t,H.x,H.y,A.x,A.y);break;case "T":for(;!c();)r=H=k(),A=g(),xf(t,H.x,H.y,A.x,A.y);break;case "B":for(;!c();){var A=parseFloat(d()),N=parseFloat(d()),H=parseFloat(d()),W=parseFloat(d()),fa=parseFloat(d()),S=fa,ba=!1;c()||(S=parseFloat(d()),c()||(ba=0!==parseFloat(d())));n===n.toLowerCase()&&(H+=s.x,W+=s.y);t.arcTo(A, +N,H,W,fa,S,ba)}break;case "A":for(;!c();)N=Math.abs(parseFloat(d())),H=Math.abs(parseFloat(d())),W=parseFloat(d()),fa=!!parseFloat(d()),S=!!parseFloat(d()),A=g(),yf(t,N,H,W,fa,S,A.x,A.y);break;case "Z":A=t.q.lc.o[t.q.lc.length-1];X(t);s=q;break;case "F":A="";for(N=1;l[m+N];)if(null!==l[m+N].match(/[Uu]/))N++;else if(null===l[m+N].match(/[A-Za-z]/))N++;else{A=l[m+N];break}A.match(/[Mm]/)?y=!0:zf(t);break;case "U":A="";for(N=1;l[m+N];)if(null!==l[m+N].match(/[Ff]/))N++;else if(null===l[m+N].match(/[A-Za-z]/))N++; +else{A=l[m+N];break}A.match(/[Mm]/)?w=!0:t.ib(!1)}q=t.q;D.u(t);if(b)for(t=q.lc.j;t.next();)A=t.value,A.vu=!0;return q};function Af(a,b){for(var c=a.length,d=D.O(),e=0;eh&&(h+=360),s.Le+=h);0>a&&(s.Le=180-s.Le,s.xf=-s.xf);0>d&&(s.Le=-s.Le,s.xf=-s.xf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case Qf:h=s.H;k=s.I;s.H=h* a+k*c+e;s.I=h*b+k*d+g;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Zj+=h);0>a&&(s.Zj=180-s.Zj,s.sm=!s.sm);0>d&&(s.Zj=-s.Zj,s.sm=!s.sm);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:D.k("Unknown Segment type: "+s.type)}}}}this.lb=!0;return this}; -bf.prototype.Oa=function(a,b,c,d){var e=a.x,g=a.y,h=this.sb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.kc.o,s=r.length,u=0;u=a)return 0;if((e>h?e-h:h-e)<(g>k?g-k:k-g)){if(e=a=0,ge)return 0}else if(ee)return 0;return 0a?a=0:1=g)return d=(g-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.m(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.m(NaN,NaN);return b}; -bf.prototype.getFractionForPoint=bf.prototype.JI=function(a){if(this.type===sf){var b=this.ma,c=this.ka,d=this.H,e=this.I;if(b!==d||c!==e){var g=a.x;a=a.y;var h=0,k=0;return b===d?(c=k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b=k?k===b?0:1:Math.abs(g-b)/(k-h)):((g-b)*(g-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===tf){if(b=this.ma,c=this.ka,d=this.H,e=this.I,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,g=a.x; -a=a.y;g=Math.min(Math.max(g,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(g-b),d=Math.abs(g-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return g/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-g)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.JA,h=this.Kx,k=this.KA,l=D.P(),c=Infinity,b=d=0,g=e.length,n=m=0,p=0;pa?0:1=a)return 0;if((e>h?e-h:h-e)<(g>k?g-k:k-g)){if(e=a=0,ge)return 0}else if(ee)return 0;return 0a?a=0:1=g)return d=(g-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.n(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.n(NaN,NaN);return b}; +Ye.prototype.getFractionForPoint=Ye.prototype.MI=function(a){if(this.type===qf){var b=this.ma,c=this.ka,d=this.H,e=this.I;if(b!==d||c!==e){var g=a.x;a=a.y;var h=0,k=0;return b===d?(c=k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b=k?k===b?0:1:Math.abs(g-b)/(k-h)):((g-b)*(g-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===rf){if(b=this.ma,c=this.ka,d=this.H,e=this.I,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,g=a.x; +a=a.y;g=Math.min(Math.max(g,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(g-b),d=Math.abs(g-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return g/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-g)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.LA,h=this.Jx,k=this.MA,l=D.O(),c=Infinity,b=d=0,g=e.length,n=m=0,p=0;pa?0:1a?"M"+this.ma.toString()+" "+this.ka.toString():"M"+this.ma.toFixed(a)+" "+this.ka.toFixed(a),c=this.Db.o,d=c.length,e=0;ea&&(a+=360),this.Pd=a,this.df=0,v&&D.p(d,Xf,"x1"),this.Ch=Math.max(d,0),v&&D.p(e,Xf,"y1"),this.Kg=Math.max(e,0),this.sp="boolean"===typeof h?!!h:!1,this.Ko=!!k):(v&&D.p(d,Xf,"x1"),this.Pd=d,v&&D.p(e, -Xf,"y1"),this.df=e,v&&D.p(g,Xf,"x2"),a===Qf&&(g=Math.max(g,0)),this.Ch=g,"number"===typeof h?(a===Qf&&(h=Math.max(h,0)),this.Kg=h):this.Kg=0,this.Ko=this.sp=!1);this.ei=!1;this.lb=!0;this.tg=null}D.ja("PathSegment",Xf);D.Ai(Xf);Xf.prototype.copy=function(){var a=new Xf;a.ca=this.ca;a.Ab=this.Ab;a.Ib=this.Ib;a.Pd=this.Pd;a.df=this.df;a.Ch=this.Ch;a.Kg=this.Kg;a.sp=this.sp;a.Ko=this.Ko;a.ei=this.ei;a.lb=this.lb;return a}; -Xf.prototype.equalsApprox=Xf.prototype.Sc=function(a){if(!(a instanceof Xf)||this.type!==a.type||this.Rx!==a.Rx)return!1;switch(this.type){case Ef:case wf:return Q(this.H,a.H)&&Q(this.I,a.I);case Of:return Q(this.H,a.H)&&Q(this.I,a.I)&&Q(this.Ac,a.Ac)&&Q(this.Wc,a.Wc)&&Q(this.Rh,a.Rh)&&Q(this.Sh,a.Sh);case Pf:return Q(this.H,a.H)&&Q(this.I,a.I)&&Q(this.Ac,a.Ac)&&Q(this.Wc,a.Wc);case Qf:return Q(this.Le,a.Le)&&Q(this.xf,a.xf)&&Q(this.na,a.na)&&Q(this.va,a.va)&&Q(this.radiusX,a.radiusX)&&Q(this.radiusY, -a.radiusY);case Rf:return this.sm===a.sm&&this.Wx===a.Wx&&Q(this.Zj,a.Zj)&&Q(this.H,a.H)&&Q(this.I,a.I)&&Q(this.radiusX,a.radiusX)&&Q(this.radiusY,a.radiusY);default:return!1}};Xf.prototype.nc=function(a){a.Ne===Xf?this.type=a:D.Xj(this,a)}; -Xf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Ef:b=0>a?"M"+this.H.toString()+" "+this.I.toString():"M"+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case wf:b=0>a?"L"+this.H.toString()+" "+this.I.toString():"L"+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case Of:b=0>a?"C"+this.Ac.toString()+" "+this.Wc.toString()+" "+this.Rh.toString()+" "+this.Sh.toString()+" "+this.H.toString()+" "+this.I.toString():"C"+this.Ac.toFixed(a)+" "+this.Wc.toFixed(a)+" "+this.Rh.toFixed(a)+ -" "+this.Sh.toFixed(a)+" "+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case Pf:b=0>a?"Q"+this.Ac.toString()+" "+this.Wc.toString()+" "+this.H.toString()+" "+this.I.toString():"Q"+this.Ac.toFixed(a)+" "+this.Wc.toFixed(a)+" "+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case Qf:b=0>a?"B"+this.Le.toString()+" "+this.xf.toString()+" "+this.na.toString()+" "+this.va.toString()+" "+this.radiusX:"B"+this.Le.toFixed(a)+" "+this.xf.toFixed(a)+" "+this.na.toFixed(a)+" "+this.va.toFixed(a)+" "+this.radiusX; -break;case Rf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Zj.toString()+" "+(this.Wx?1:0)+" "+(this.sm?1:0)+" "+this.H.toString()+" "+this.I.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Zj.toFixed(a)+" "+(this.Wx?1:0)+" "+(this.sm?1:0)+" "+this.H.toFixed(a)+" "+this.I.toFixed(a);break;default:b=this.type.toString()}return b+(this.ei?"z":"")};var Ef;Xf.Move=Ef=D.s(Xf,"Move",0);var wf;Xf.Line=wf=D.s(Xf,"Line",1);var Of; -Xf.Bezier=Of=D.s(Xf,"Bezier",2);var Pf;Xf.QuadraticBezier=Pf=D.s(Xf,"QuadraticBezier",3);var Qf;Xf.Arc=Qf=D.s(Xf,"Arc",4);var Rf;Xf.SvgArc=Rf=D.s(Xf,"SvgArc",4);Xf.prototype.freeze=function(){this.J=!0;return this};Xf.prototype.Ya=function(){this.J=!1;return this};Xf.prototype.close=Xf.prototype.close=function(){this.ei=!0;return this}; -function Sf(a,b){if(null!==a.tg&&!1===b.lb)return a.tg;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.tg=[],a.tg;var e=a.Pd,g=a.df,h=Ze(c=r?h=Math.PI:1<=r&&(h=0);!l&&0h&&(h+=2*Math.PI);l=b>g?1:b/g;r=b>g?g/b:1;b=Ze(b>g?b:g,n,n+h,!0);g=D.Of();g.reset();g.translate(c,d);g.rotate(a.Pd,0,0);g.scale(l,r);Cf(b,g);D.He(g);a.tg=b;return a.tg} -D.defineProperty(Xf,{Rx:"isClosed"},function(){return this.ei},function(a){this.ei!==a&&(this.ei=a,this.lb=!0)});D.defineProperty(Xf,{type:"type"},function(){return this.ca},function(a){v&&D.Ca(a,Xf,Xf,"type");this.J&&D.pa(this,a);this.ca=a;this.lb=!0});D.defineProperty(Xf,{H:"endX"},function(){return this.Ab},function(a){v&&D.p(a,Xf,"endX");this.J&&D.pa(this,a);this.Ab=a;this.lb=!0}); -D.defineProperty(Xf,{I:"endY"},function(){return this.Ib},function(a){v&&D.p(a,Xf,"endY");this.J&&D.pa(this,a);this.Ib=a;this.lb=!0});D.defineProperty(Xf,{Ac:"point1X"},function(){return this.Pd},function(a){v&&D.p(a,Xf,"point1X");this.J&&D.pa(this,a);this.Pd=a;this.lb=!0});D.defineProperty(Xf,{Wc:"point1Y"},function(){return this.df},function(a){v&&D.p(a,Xf,"point1Y");this.J&&D.pa(this,a);this.df=a;this.lb=!0}); -D.defineProperty(Xf,{Rh:"point2X"},function(){return this.Ch},function(a){v&&D.p(a,Xf,"point2X");this.J&&D.pa(this,a);this.Ch=a;this.lb=!0});D.defineProperty(Xf,{Sh:"point2Y"},function(){return this.Kg},function(a){v&&D.p(a,Xf,"point2Y");this.J&&D.pa(this,a);this.Kg=a;this.lb=!0});D.defineProperty(Xf,{na:"centerX"},function(){return this.Pd},function(a){v&&D.p(a,Xf,"centerX");this.J&&D.pa(this,a);this.Pd=a;this.lb=!0}); -D.defineProperty(Xf,{va:"centerY"},function(){return this.df},function(a){v&&D.p(a,Xf,"centerY");this.J&&D.pa(this,a);this.df=a;this.lb=!0});D.defineProperty(Xf,{radiusX:"radiusX"},function(){return this.Ch},function(a){v&&D.p(a,Xf,"radiusX");0>a&&D.ua(a,">= zero",Xf,"radiusX");this.J&&D.pa(this,a);this.Ch=a;this.lb=!0});D.defineProperty(Xf,{radiusY:"radiusY"},function(){return this.Kg},function(a){v&&D.p(a,Xf,"radiusY");0>a&&D.ua(a,">= zero",Xf,"radiusY");this.J&&D.pa(this,a);this.Kg=a;this.lb=!0}); -D.defineProperty(Xf,{Le:"startAngle"},function(){return this.Ab},function(a){this.Ab!==a&&(this.J&&D.pa(this,a),v&&D.p(a,Xf,"startAngle"),a%=360,0>a&&(a+=360),this.Ab=a,this.lb=!0)});D.defineProperty(Xf,{xf:"sweepAngle"},function(){return this.Ib},function(a){v&&D.p(a,Xf,"sweepAngle");this.J&&D.pa(this,a);360a&&(a=-360);this.Ib=a;this.lb=!0});D.defineProperty(Xf,{sm:"isClockwiseArc"},function(){return this.Ko},function(a){this.J&&D.pa(this,a);this.Ko=a;this.lb=!0}); -D.defineProperty(Xf,{Wx:"isLargeArc"},function(){return this.sp},function(a){this.J&&D.pa(this,a);this.sp=a;this.lb=!0});D.defineProperty(Xf,{Zj:"xAxisRotation"},function(){return this.Pd},function(a){v&&D.p(a,Xf,"xAxisRotation");a%=360;0>a&&(a+=360);this.J&&D.pa(this,a);this.Pd=a;this.lb=!0}); -function Zf(){this.ba=null;this.iA=(new O(0,0)).freeze();this.qz=(new O(0,0)).freeze();this.zv=this.vw=0;this.Av=1;this.jw="";this.ax=this.Ov=!1;this.Lv=this.Bv=0;this.ak=this.Wv=this.gw=!1;this.Sr=null;this.Zw=0;this.Og=this.Yw=null}D.ja("InputEvent",Zf); -Zf.prototype.copy=function(){var a=new Zf;a.ba=this.ba;a.iA.assign(this.qe);a.qz.assign(this.ha);a.vw=this.vw;a.zv=this.zv;a.Av=this.Av;a.jw=this.jw;a.Ov=this.Ov;a.ax=this.ax;a.Bv=this.Bv;a.Lv=this.Lv;a.gw=this.gw;a.Wv=this.Wv;a.ak=this.ak;a.Sr=this.Sr;a.Zw=this.Zw;a.Yw=this.Yw;a.Og=this.Og;return a}; -Zf.prototype.toString=function(){var a="^";0!==this.Jd&&(a+="M:"+this.Jd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Oe&&(a+="C:"+this.Oe);0!==this.hm&&(a+="D:"+this.hm);this.Lc&&(a+="h");this.bubbles&&(a+="b");null!==this.ha&&(a+="@"+this.ha.toString());return a};D.defineProperty(Zf,{g:"diagram"},function(){return this.ba},function(a){this.ba=a});D.defineProperty(Zf,{qe:"viewPoint"},function(){return this.iA},function(a){D.l(a,O,Zf,"viewPoint");this.iA.assign(a)}); -D.defineProperty(Zf,{ha:"documentPoint"},function(){return this.qz},function(a){D.l(a,O,Zf,"documentPoint");this.qz.assign(a)});Zf.prototype.getMultiTouchViewPoint=Zf.prototype.Mx=function(a,b){var c=this.g;if(null===c)return b;$f(c,this.event,a,b);return b};Zf.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;$f(c,this.event,a,b);b.assign(c.UB(b));return b};D.defineProperty(Zf,{Jd:"modifiers"},function(){return this.vw},function(a){this.vw=a}); -D.defineProperty(Zf,{button:"button"},function(){return this.zv},function(a){this.zv=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});D.defineProperty(Zf,{buttons:"buttons"},function(){return this.Av},function(a){this.Av=a});D.defineProperty(Zf,{key:"key"},function(){return this.jw},function(a){this.jw=a});D.defineProperty(Zf,{im:"down"},function(){return this.Ov},function(a){this.Ov=a}); -D.defineProperty(Zf,{up:"up"},function(){return this.ax},function(a){this.ax=a});D.defineProperty(Zf,{Oe:"clickCount"},function(){return this.Bv},function(a){this.Bv=a});D.defineProperty(Zf,{hm:"delta"},function(){return this.Lv},function(a){this.Lv=a});D.defineProperty(Zf,{yu:"isMultiTouch"},function(){return this.gw},function(a){this.gw=a});D.defineProperty(Zf,{Lc:"handled"},function(){return this.Wv},function(a){this.Wv=a}); -D.defineProperty(Zf,{bubbles:"bubbles"},function(){return this.ak},function(a){this.ak=a});D.defineProperty(Zf,{event:"event"},function(){return this.Sr},function(a){this.Sr=a});D.w(Zf,{Lj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});D.w(Zf,{Vk:"isMac"},function(){return D.Vk});D.defineProperty(Zf,{timestamp:"timestamp"},function(){return this.Zw},function(a){this.Zw=a}); -D.defineProperty(Zf,{fh:"targetDiagram"},function(){return this.Yw},function(a){this.Yw=a});D.defineProperty(Zf,{We:"targetObject"},function(){return this.Og},function(a){this.Og=a});D.defineProperty(Zf,{control:"control"},function(){return 0!==(this.Jd&1)},function(a){this.Jd=a?this.Jd|1:this.Jd&-2});D.defineProperty(Zf,{shift:"shift"},function(){return 0!==(this.Jd&4)},function(a){this.Jd=a?this.Jd|4:this.Jd&-5}); -D.defineProperty(Zf,{alt:"alt"},function(){return 0!==(this.Jd&2)},function(a){this.Jd=a?this.Jd|2:this.Jd&-3});D.defineProperty(Zf,{Hu:"meta"},function(){return 0!==(this.Jd&8)},function(a){this.Jd=a?this.Jd|8:this.Jd&-9});D.defineProperty(Zf,{left:"left"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?0===this.button:0!==(this.buttons&1)},function(a){this.buttons=a?this.buttons|1:this.buttons&-2}); -D.defineProperty(Zf,{right:"right"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?2===this.button:0!==(this.buttons&2)},function(a){this.buttons=a?this.buttons|2:this.buttons&-3});D.defineProperty(Zf,{VL:"middle"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?1===this.button:0!==(this.buttons&4)},function(a){this.buttons=a?this.buttons|4:this.buttons&-5}); -function ag(){this.ba=null;this.Xb="";this.Ew=this.Ww=null;this.mr=!1}D.ja("DiagramEvent",ag);ag.prototype.copy=function(){var a=new ag;a.ba=this.ba;a.Xb=this.Xb;a.Ww=this.Ww;a.Ew=this.Ew;a.mr=this.mr;return a};ag.prototype.toString=function(){var a="*"+this.name;null!==this.LB&&(a+=":"+this.LB.toString());null!==this.qB&&(a+="("+this.qB.toString()+")");return a};D.defineProperty(ag,{g:"diagram"},function(){return this.ba},function(a){this.ba=a}); -D.defineProperty(ag,{name:"name"},function(){return this.Xb},function(a){this.Xb=a});D.defineProperty(ag,{LB:"subject"},function(){return this.Ww},function(a){this.Ww=a});D.defineProperty(ag,{qB:"parameter"},function(){return this.Ew},function(a){this.Ew=a});D.defineProperty(ag,{cancel:"cancel"},function(){return this.mr},function(a){this.mr!==a&&D.Nn("DiagramEvent.cancel","2.0");this.mr=a});function bg(){this.nr=cg;this.ln=this.uw="";this.Ms=this.Ns=this.Qs=this.Rs=this.Ps=this.ba=this.ve=null} -D.ja("ChangedEvent",bg);var dg;bg.Transaction=dg=D.s(bg,"Transaction",-1);var cg;bg.Property=cg=D.s(bg,"Property",0);var mg;bg.Insert=mg=D.s(bg,"Insert",1);var ng;bg.Remove=ng=D.s(bg,"Remove",2);bg.prototype.clear=bg.prototype.clear=function(){this.Ms=this.Ns=this.Qs=this.Rs=this.Ps=this.ba=this.ve=null}; -bg.prototype.copy=function(){var a=new bg;a.nr=this.nr;a.uw=this.uw;a.ln=this.ln;a.ve=this.ve;a.ba=this.ba;a.Ps=this.Ps;var b=this.Rs;a.Rs=D.Ta(b)&&"function"===typeof b.V?b.V():b;b=this.Qs;a.Qs=D.Ta(b)&&"function"===typeof b.V?b.V():b;b=this.Ns;a.Ns=D.Ta(b)&&"function"===typeof b.V?b.V():b;b=this.Ms;a.Ms=D.Ta(b)&&"function"===typeof b.V?b.V():b;return a};bg.prototype.nc=function(a){a.Ne===bg?this.Ic=a:D.Xj(this,a)}; -bg.prototype.toString=function(){var a="",a=this.Ic===dg?a+"* ":this.Ic===cg?a+(null!==this.ga?"!m":"!d"):a+((null!==this.ga?"!m":"!d")+this.Ic);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.wf&&this.wf!==this.propertyName&&(a+=" "+this.wf);a+=": ";this.Ic===dg?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=ja(this.object)),null!==this.oldValue&&(a+=" old: "+ja(this.oldValue)),null!==this.Sj&&(a+=" "+this.Sj),null!==this.newValue&& -(a+=" new: "+ja(this.newValue)),null!==this.Qj&&(a+=" "+this.Qj));return a};bg.prototype.getValue=bg.prototype.oa=function(a){return a?this.oldValue:this.newValue};bg.prototype.getParam=function(a){return a?this.Sj:this.Qj};bg.prototype.canUndo=bg.prototype.canUndo=function(){return null!==this.ga||null!==this.g?!0:!1};bg.prototype.undo=bg.prototype.undo=function(){this.canUndo()&&(null!==this.ga?this.ga.En(this,!0):null!==this.g&&this.g.En(this,!0))}; -bg.prototype.canRedo=bg.prototype.canRedo=function(){return null!==this.ga||null!==this.g?!0:!1};bg.prototype.redo=bg.prototype.redo=function(){this.canRedo()&&(null!==this.ga?this.ga.En(this,!1):null!==this.g&&this.g.En(this,!1))};D.defineProperty(bg,{ga:"model"},function(){return this.ve},function(a){this.ve=a});D.defineProperty(bg,{g:"diagram"},function(){return this.ba},function(a){this.ba=a}); -D.defineProperty(bg,{Ic:"change"},function(){return this.nr},function(a){v&&D.Ca(a,bg,bg,"change");this.nr=a});D.defineProperty(bg,{wf:"modelChange"},function(){return this.uw},function(a){v&&D.h(a,"string",bg,"modelChange");this.uw=a});D.defineProperty(bg,{propertyName:"propertyName"},function(){return this.ln},function(a){v&&"string"!==typeof a&&D.h(a,"function",bg,"propertyName");this.ln=a}); -D.w(bg,{VF:"isTransactionFinished"},function(){return this.nr===dg&&("CommittedTransaction"===this.ln||"FinishedUndo"===this.ln||"FinishedRedo"===this.ln)});D.defineProperty(bg,{object:"object"},function(){return this.Ps},function(a){this.Ps=a});D.defineProperty(bg,{oldValue:"oldValue"},function(){return this.Rs},function(a){this.Rs=a});D.defineProperty(bg,{Sj:"oldParam"},function(){return this.Qs},function(a){this.Qs=a}); -D.defineProperty(bg,{newValue:"newValue"},function(){return this.Ns},function(a){this.Ns=a});D.defineProperty(bg,{Qj:"newParam"},function(){return this.Ms},function(a){this.Ms=a}); -function M(a){1a&&(a+=360),this.Pd=a,this.df=0,v&&D.p(d,Wf,"x1"),this.Ch=Math.max(d,0),v&&D.p(e,Wf,"y1"),this.Mg=Math.max(e,0),this.vp="boolean"===typeof h?!!h:!1,this.Mo=!!k):(v&&D.p(d,Wf,"x1"),this.Pd=d,v&&D.p(e, +Wf,"y1"),this.df=e,v&&D.p(g,Wf,"x2"),a===Pf&&(g=Math.max(g,0)),this.Ch=g,"number"===typeof h?(a===Pf&&(h=Math.max(h,0)),this.Mg=h):this.Mg=0,this.Mo=this.vp=!1);this.fi=!1;this.lb=!0;this.vg=null}D.ja("PathSegment",Wf);D.Bi(Wf);Wf.prototype.copy=function(){var a=new Wf;a.ca=this.ca;a.Ab=this.Ab;a.Ib=this.Ib;a.Pd=this.Pd;a.df=this.df;a.Ch=this.Ch;a.Mg=this.Mg;a.vp=this.vp;a.Mo=this.Mo;a.fi=this.fi;a.lb=this.lb;return a}; +Wf.prototype.equalsApprox=Wf.prototype.Tc=function(a){if(!(a instanceof Wf)||this.type!==a.type||this.Qx!==a.Qx)return!1;switch(this.type){case Cf:case uf:return Q(this.H,a.H)&&Q(this.I,a.I);case Df:return Q(this.H,a.H)&&Q(this.I,a.I)&&Q(this.Bc,a.Bc)&&Q(this.Xc,a.Xc)&&Q(this.Sh,a.Sh)&&Q(this.Th,a.Th);case Of:return Q(this.H,a.H)&&Q(this.I,a.I)&&Q(this.Bc,a.Bc)&&Q(this.Xc,a.Xc);case Pf:return Q(this.Le,a.Le)&&Q(this.xf,a.xf)&&Q(this.oa,a.oa)&&Q(this.va,a.va)&&Q(this.radiusX,a.radiusX)&&Q(this.radiusY, +a.radiusY);case Qf:return this.sm===a.sm&&this.Vx===a.Vx&&Q(this.Zj,a.Zj)&&Q(this.H,a.H)&&Q(this.I,a.I)&&Q(this.radiusX,a.radiusX)&&Q(this.radiusY,a.radiusY);default:return!1}};Wf.prototype.oc=function(a){a.Ne===Wf?this.type=a:D.Xj(this,a)}; +Wf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Cf:b=0>a?"M"+this.H.toString()+" "+this.I.toString():"M"+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case uf:b=0>a?"L"+this.H.toString()+" "+this.I.toString():"L"+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case Df:b=0>a?"C"+this.Bc.toString()+" "+this.Xc.toString()+" "+this.Sh.toString()+" "+this.Th.toString()+" "+this.H.toString()+" "+this.I.toString():"C"+this.Bc.toFixed(a)+" "+this.Xc.toFixed(a)+" "+this.Sh.toFixed(a)+ +" "+this.Th.toFixed(a)+" "+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case Of:b=0>a?"Q"+this.Bc.toString()+" "+this.Xc.toString()+" "+this.H.toString()+" "+this.I.toString():"Q"+this.Bc.toFixed(a)+" "+this.Xc.toFixed(a)+" "+this.H.toFixed(a)+" "+this.I.toFixed(a);break;case Pf:b=0>a?"B"+this.Le.toString()+" "+this.xf.toString()+" "+this.oa.toString()+" "+this.va.toString()+" "+this.radiusX:"B"+this.Le.toFixed(a)+" "+this.xf.toFixed(a)+" "+this.oa.toFixed(a)+" "+this.va.toFixed(a)+" "+this.radiusX; +break;case Qf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Zj.toString()+" "+(this.Vx?1:0)+" "+(this.sm?1:0)+" "+this.H.toString()+" "+this.I.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Zj.toFixed(a)+" "+(this.Vx?1:0)+" "+(this.sm?1:0)+" "+this.H.toFixed(a)+" "+this.I.toFixed(a);break;default:b=this.type.toString()}return b+(this.fi?"z":"")};var Cf;Wf.Move=Cf=D.s(Wf,"Move",0);var uf;Wf.Line=uf=D.s(Wf,"Line",1);var Df; +Wf.Bezier=Df=D.s(Wf,"Bezier",2);var Of;Wf.QuadraticBezier=Of=D.s(Wf,"QuadraticBezier",3);var Pf;Wf.Arc=Pf=D.s(Wf,"Arc",4);var Qf;Wf.SvgArc=Qf=D.s(Wf,"SvgArc",4);Wf.prototype.freeze=function(){this.J=!0;return this};Wf.prototype.Ya=function(){this.J=!1;return this};Wf.prototype.close=Wf.prototype.close=function(){this.fi=!0;return this}; +function Rf(a,b){if(null!==a.vg&&!1===b.lb)return a.vg;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.vg=[],a.vg;var e=a.Pd,g=a.df,h=Ve(c=r?h=Math.PI:1<=r&&(h=0);!l&&0h&&(h+=2*Math.PI);l=b>g?1:b/g;r=b>g?g/b:1;b=Ve(b>g?b:g,n,n+h,!0);g=D.Pf();g.reset();g.translate(c,d);g.rotate(a.Pd,0,0);g.scale(l,r);Af(b,g);D.He(g);a.vg=b;return a.vg} +D.defineProperty(Wf,{Qx:"isClosed"},function(){return this.fi},function(a){this.fi!==a&&(this.fi=a,this.lb=!0)});D.defineProperty(Wf,{type:"type"},function(){return this.ca},function(a){v&&D.Da(a,Wf,Wf,"type");this.J&&D.pa(this,a);this.ca=a;this.lb=!0});D.defineProperty(Wf,{H:"endX"},function(){return this.Ab},function(a){v&&D.p(a,Wf,"endX");this.J&&D.pa(this,a);this.Ab=a;this.lb=!0}); +D.defineProperty(Wf,{I:"endY"},function(){return this.Ib},function(a){v&&D.p(a,Wf,"endY");this.J&&D.pa(this,a);this.Ib=a;this.lb=!0});D.defineProperty(Wf,{Bc:"point1X"},function(){return this.Pd},function(a){v&&D.p(a,Wf,"point1X");this.J&&D.pa(this,a);this.Pd=a;this.lb=!0});D.defineProperty(Wf,{Xc:"point1Y"},function(){return this.df},function(a){v&&D.p(a,Wf,"point1Y");this.J&&D.pa(this,a);this.df=a;this.lb=!0}); +D.defineProperty(Wf,{Sh:"point2X"},function(){return this.Ch},function(a){v&&D.p(a,Wf,"point2X");this.J&&D.pa(this,a);this.Ch=a;this.lb=!0});D.defineProperty(Wf,{Th:"point2Y"},function(){return this.Mg},function(a){v&&D.p(a,Wf,"point2Y");this.J&&D.pa(this,a);this.Mg=a;this.lb=!0});D.defineProperty(Wf,{oa:"centerX"},function(){return this.Pd},function(a){v&&D.p(a,Wf,"centerX");this.J&&D.pa(this,a);this.Pd=a;this.lb=!0}); +D.defineProperty(Wf,{va:"centerY"},function(){return this.df},function(a){v&&D.p(a,Wf,"centerY");this.J&&D.pa(this,a);this.df=a;this.lb=!0});D.defineProperty(Wf,{radiusX:"radiusX"},function(){return this.Ch},function(a){v&&D.p(a,Wf,"radiusX");0>a&&D.ua(a,">= zero",Wf,"radiusX");this.J&&D.pa(this,a);this.Ch=a;this.lb=!0});D.defineProperty(Wf,{radiusY:"radiusY"},function(){return this.Mg},function(a){v&&D.p(a,Wf,"radiusY");0>a&&D.ua(a,">= zero",Wf,"radiusY");this.J&&D.pa(this,a);this.Mg=a;this.lb=!0}); +D.defineProperty(Wf,{Le:"startAngle"},function(){return this.Ab},function(a){this.Ab!==a&&(this.J&&D.pa(this,a),v&&D.p(a,Wf,"startAngle"),a%=360,0>a&&(a+=360),this.Ab=a,this.lb=!0)});D.defineProperty(Wf,{xf:"sweepAngle"},function(){return this.Ib},function(a){v&&D.p(a,Wf,"sweepAngle");this.J&&D.pa(this,a);360a&&(a=-360);this.Ib=a;this.lb=!0});D.defineProperty(Wf,{sm:"isClockwiseArc"},function(){return this.Mo},function(a){this.J&&D.pa(this,a);this.Mo=a;this.lb=!0}); +D.defineProperty(Wf,{Vx:"isLargeArc"},function(){return this.vp},function(a){this.J&&D.pa(this,a);this.vp=a;this.lb=!0});D.defineProperty(Wf,{Zj:"xAxisRotation"},function(){return this.Pd},function(a){v&&D.p(a,Wf,"xAxisRotation");a%=360;0>a&&(a+=360);this.J&&D.pa(this,a);this.Pd=a;this.lb=!0}); +function Yf(){this.ba=null;this.kA=(new O(0,0)).freeze();this.pz=(new O(0,0)).freeze();this.yv=this.vw=0;this.zv=1;this.jw="";this.$w=this.Nv=!1;this.Kv=this.Av=0;this.ak=this.Vv=this.fw=!1;this.Rr=null;this.Yw=0;this.Qg=this.Xw=null}D.ja("InputEvent",Yf); +Yf.prototype.copy=function(){var a=new Yf;a.ba=this.ba;a.kA.assign(this.qe);a.pz.assign(this.ha);a.vw=this.vw;a.yv=this.yv;a.zv=this.zv;a.jw=this.jw;a.Nv=this.Nv;a.$w=this.$w;a.Av=this.Av;a.Kv=this.Kv;a.fw=this.fw;a.Vv=this.Vv;a.ak=this.ak;a.Rr=this.Rr;a.Yw=this.Yw;a.Xw=this.Xw;a.Qg=this.Qg;return a}; +Yf.prototype.toString=function(){var a="^";0!==this.Kd&&(a+="M:"+this.Kd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Oe&&(a+="C:"+this.Oe);0!==this.im&&(a+="D:"+this.im);this.Mc&&(a+="h");this.bubbles&&(a+="b");null!==this.ha&&(a+="@"+this.ha.toString());return a};D.defineProperty(Yf,{g:"diagram"},function(){return this.ba},function(a){this.ba=a});D.defineProperty(Yf,{qe:"viewPoint"},function(){return this.kA},function(a){D.l(a,O,Yf,"viewPoint");this.kA.assign(a)}); +D.defineProperty(Yf,{ha:"documentPoint"},function(){return this.pz},function(a){D.l(a,O,Yf,"documentPoint");this.pz.assign(a)});Yf.prototype.getMultiTouchViewPoint=Yf.prototype.Lx=function(a,b){var c=this.g;if(null===c)return b;Zf(c,this.event,a,b);return b};Yf.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;Zf(c,this.event,a,b);b.assign(c.YB(b));return b};D.defineProperty(Yf,{Kd:"modifiers"},function(){return this.vw},function(a){this.vw=a}); +D.defineProperty(Yf,{button:"button"},function(){return this.yv},function(a){this.yv=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});D.defineProperty(Yf,{buttons:"buttons"},function(){return this.zv},function(a){this.zv=a});D.defineProperty(Yf,{key:"key"},function(){return this.jw},function(a){this.jw=a});D.defineProperty(Yf,{jm:"down"},function(){return this.Nv},function(a){this.Nv=a}); +D.defineProperty(Yf,{up:"up"},function(){return this.$w},function(a){this.$w=a});D.defineProperty(Yf,{Oe:"clickCount"},function(){return this.Av},function(a){this.Av=a});D.defineProperty(Yf,{im:"delta"},function(){return this.Kv},function(a){this.Kv=a});D.defineProperty(Yf,{xu:"isMultiTouch"},function(){return this.fw},function(a){this.fw=a});D.defineProperty(Yf,{Mc:"handled"},function(){return this.Vv},function(a){this.Vv=a}); +D.defineProperty(Yf,{bubbles:"bubbles"},function(){return this.ak},function(a){this.ak=a});D.defineProperty(Yf,{event:"event"},function(){return this.Rr},function(a){this.Rr=a});D.w(Yf,{Mj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});D.w(Yf,{Wk:"isMac"},function(){return D.Wk});D.defineProperty(Yf,{timestamp:"timestamp"},function(){return this.Yw},function(a){this.Yw=a}); +D.defineProperty(Yf,{gh:"targetDiagram"},function(){return this.Xw},function(a){this.Xw=a});D.defineProperty(Yf,{We:"targetObject"},function(){return this.Qg},function(a){this.Qg=a});D.defineProperty(Yf,{control:"control"},function(){return 0!==(this.Kd&1)},function(a){this.Kd=a?this.Kd|1:this.Kd&-2});D.defineProperty(Yf,{shift:"shift"},function(){return 0!==(this.Kd&4)},function(a){this.Kd=a?this.Kd|4:this.Kd&-5}); +D.defineProperty(Yf,{alt:"alt"},function(){return 0!==(this.Kd&2)},function(a){this.Kd=a?this.Kd|2:this.Kd&-3});D.defineProperty(Yf,{Gu:"meta"},function(){return 0!==(this.Kd&8)},function(a){this.Kd=a?this.Kd|8:this.Kd&-9});D.defineProperty(Yf,{left:"left"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?0===this.button:0!==(this.buttons&1)},function(a){this.buttons=a?this.buttons|1:this.buttons&-2}); +D.defineProperty(Yf,{right:"right"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?2===this.button:0!==(this.buttons&2)},function(a){this.buttons=a?this.buttons|2:this.buttons&-3});D.defineProperty(Yf,{YL:"middle"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?1===this.button:0!==(this.buttons&4)},function(a){this.buttons=a?this.buttons|4:this.buttons&-5}); +function $f(){this.ba=null;this.Xb="";this.Dw=this.Vw=null;this.lr=!1}D.ja("DiagramEvent",$f);$f.prototype.copy=function(){var a=new $f;a.ba=this.ba;a.Xb=this.Xb;a.Vw=this.Vw;a.Dw=this.Dw;a.lr=this.lr;return a};$f.prototype.toString=function(){var a="*"+this.name;null!==this.PB&&(a+=":"+this.PB.toString());null!==this.uB&&(a+="("+this.uB.toString()+")");return a};D.defineProperty($f,{g:"diagram"},function(){return this.ba},function(a){this.ba=a}); +D.defineProperty($f,{name:"name"},function(){return this.Xb},function(a){this.Xb=a});D.defineProperty($f,{PB:"subject"},function(){return this.Vw},function(a){this.Vw=a});D.defineProperty($f,{uB:"parameter"},function(){return this.Dw},function(a){this.Dw=a});D.defineProperty($f,{cancel:"cancel"},function(){return this.lr},function(a){this.lr!==a&&D.Pn("DiagramEvent.cancel","2.0");this.lr=a});function ag(){this.mr=bg;this.ln=this.uw="";this.Ls=this.Ms=this.Qs=this.Rs=this.Ps=this.ba=this.ve=null} +D.ja("ChangedEvent",ag);var cg;ag.Transaction=cg=D.s(ag,"Transaction",-1);var bg;ag.Property=bg=D.s(ag,"Property",0);var dg;ag.Insert=dg=D.s(ag,"Insert",1);var og;ag.Remove=og=D.s(ag,"Remove",2);ag.prototype.clear=ag.prototype.clear=function(){this.Ls=this.Ms=this.Qs=this.Rs=this.Ps=this.ba=this.ve=null}; +ag.prototype.copy=function(){var a=new ag;a.mr=this.mr;a.uw=this.uw;a.ln=this.ln;a.ve=this.ve;a.ba=this.ba;a.Ps=this.Ps;var b=this.Rs;a.Rs=D.Ta(b)&&"function"===typeof b.V?b.V():b;b=this.Qs;a.Qs=D.Ta(b)&&"function"===typeof b.V?b.V():b;b=this.Ms;a.Ms=D.Ta(b)&&"function"===typeof b.V?b.V():b;b=this.Ls;a.Ls=D.Ta(b)&&"function"===typeof b.V?b.V():b;return a};ag.prototype.oc=function(a){a.Ne===ag?this.Jc=a:D.Xj(this,a)}; +ag.prototype.toString=function(){var a="",a=this.Jc===cg?a+"* ":this.Jc===bg?a+(null!==this.ga?"!m":"!d"):a+((null!==this.ga?"!m":"!d")+this.Jc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.wf&&this.wf!==this.propertyName&&(a+=" "+this.wf);a+=": ";this.Jc===cg?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=ja(this.object)),null!==this.oldValue&&(a+=" old: "+ja(this.oldValue)),null!==this.Tj&&(a+=" "+this.Tj),null!==this.newValue&& +(a+=" new: "+ja(this.newValue)),null!==this.Rj&&(a+=" "+this.Rj));return a};ag.prototype.getValue=ag.prototype.na=function(a){return a?this.oldValue:this.newValue};ag.prototype.getParam=function(a){return a?this.Tj:this.Rj};ag.prototype.canUndo=ag.prototype.canUndo=function(){return null!==this.ga||null!==this.g?!0:!1};ag.prototype.undo=ag.prototype.undo=function(){this.canUndo()&&(null!==this.ga?this.ga.Gn(this,!0):null!==this.g&&this.g.Gn(this,!0))}; +ag.prototype.canRedo=ag.prototype.canRedo=function(){return null!==this.ga||null!==this.g?!0:!1};ag.prototype.redo=ag.prototype.redo=function(){this.canRedo()&&(null!==this.ga?this.ga.Gn(this,!1):null!==this.g&&this.g.Gn(this,!1))};D.defineProperty(ag,{ga:"model"},function(){return this.ve},function(a){this.ve=a});D.defineProperty(ag,{g:"diagram"},function(){return this.ba},function(a){this.ba=a}); +D.defineProperty(ag,{Jc:"change"},function(){return this.mr},function(a){v&&D.Da(a,ag,ag,"change");this.mr=a});D.defineProperty(ag,{wf:"modelChange"},function(){return this.uw},function(a){v&&D.h(a,"string",ag,"modelChange");this.uw=a});D.defineProperty(ag,{propertyName:"propertyName"},function(){return this.ln},function(a){v&&"string"!==typeof a&&D.h(a,"function",ag,"propertyName");this.ln=a}); +D.w(ag,{YF:"isTransactionFinished"},function(){return this.mr===cg&&("CommittedTransaction"===this.ln||"FinishedUndo"===this.ln||"FinishedRedo"===this.ln)});D.defineProperty(ag,{object:"object"},function(){return this.Ps},function(a){this.Ps=a});D.defineProperty(ag,{oldValue:"oldValue"},function(){return this.Rs},function(a){this.Rs=a});D.defineProperty(ag,{Tj:"oldParam"},function(){return this.Qs},function(a){this.Qs=a}); +D.defineProperty(ag,{newValue:"newValue"},function(){return this.Ms},function(a){this.Ms=a});D.defineProperty(ag,{Rj:"newParam"},function(){return this.Ls},function(a){this.Ls=a}); +function M(a){1g?b+("\\u000"+a.charCodeAt(d).toString(16)):32>g?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===g?b+"\\u2028":8233===g?b+"\\u2029":b+e}return'"'+b+'"'}; -M.prototype.writeJsonValue=M.prototype.jv=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.jv(a.valueOf()):D.isArray(a)?tg(this,a):D.Ta(a)?qg(this,a):"function"===typeof a?"null":a.toString()}; -function tg(a,b,c){void 0===c&&(c=!1);var d=D.cb(b);if(0>=d)return"[]";var e=new ya;e.add("[ ");c&&1d)return;D.Sg(a.we,d)}Ug(a,"nodeDataArray",ng,"nodeDataArray",a,b,null,d,null);a.hv(b)} -M.prototype.removeNodeDataCollection=function(a){if(D.isArray(a))for(var b=D.cb(a),c=0;cb&&(b=D.cb(a));D.Ih(a,b,c);Ug(this,"",mg,"",a,null,c,null,b)}; -M.prototype.removeArrayItem=M.prototype.sG=function(a,b){void 0===b&&(b=-1);v&&(D.Xt(a,M,"removeArrayItem:arr"),D.p(b,M,"removeArrayItem:idx"));a===this.we&&D.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=D.cb(a)-1);var c=D.La(a,b);D.Sg(a,b);Ug(this,"",ng,"",a,c,null,b,null)};D.defineProperty(M,{no:"nodeCategoryProperty"},function(){return this.fn},function(a){var b=this.fn;b!==a&&(Vg(a,M,"nodeCategoryProperty"),this.fn=a,this.i("nodeCategoryProperty",b,a))}); -M.prototype.getCategoryForNodeData=M.prototype.OA=function(a){if(null===a)return"";var b=this.fn;if(""===b)return"";b=D.ub(a,b);if(void 0===b)return"";if("string"===typeof b)return b;D.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""}; -M.prototype.setCategoryForNodeData=M.prototype.Ey=function(a,b){D.h(b,"string",M,"setCategoryForNodeData:cat");if(null!==a){var c=this.fn;if(""!==c)if(this.ie(a)){var d=D.ub(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),Ug(this,"nodeCategory",cg,c,a,d,b))}else D.Ua(a,c,b)}}; -function Y(a,b){M.call(this);2D.$l(d,a.newValue)&&D.Ih(d,c,a.newValue));return}}else if(a.Ic=== -ng){c=a.Sj;if("linkDataArray"===a.wf){d=a.oldValue;D.Ta(d)&&"number"===typeof c&&(e=this.dg(d),b?(this.hi.add(d),D.La(this.bf,c)!==d&&D.Ih(this.bf,c,d),void 0!==e&&this.nd.add(e,d)):(this.hi.remove(d),D.La(this.bf,c)===d&&D.Sg(this.bf,c),void 0!==e&&this.nd.remove(e)));return}if("linkLabelKeys"===a.wf){d=this.Sk(a.object);D.isArray(d)&&"number"===typeof c&&(b?0>D.$l(d,a.newValue)&&D.Ih(d,c,a.newValue):(c=D.$l(d,a.newValue),0<=c&&D.Sg(d,c)));return}}M.prototype.En.call(this,a,b)}; -D.defineProperty(Y,{pA:"archetypeNodeData"},function(){return this.ol},function(a){var b=this.ol;b!==a&&(null!==a&&D.l(a,Object,Y,"archetypeNodeData"),this.ol=a,this.i("archetypeNodeData",b,a))});Y.prototype.fo=function(a){if(void 0!==a){var b=this.ol;if(null!==b){var c=this.Fe(a);null===c&&(c=this.copyNodeData(b),D.Ua(c,this.wk,a),this.Vl(c))}return a}}; -D.defineProperty(Y,{co:"linkFromKeyProperty"},function(){return this.ii},function(a){var b=this.ii;b!==a&&(Vg(a,Y,"linkFromKeyProperty"),this.ii=a,this.i("linkFromKeyProperty",b,a))});Y.prototype.getFromKeyForLinkData=Y.prototype.om=function(a){if(null!==a){var b=this.ii;if(""!==b&&(b=D.ub(a,b),void 0!==b)){if(Wg(b))return b;D.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}}; -Y.prototype.setFromKeyForLinkData=Y.prototype.BB=function(a,b){null===b&&(b=void 0);void 0===b||Wg(b)||D.gc(b,"number or string",Y,"setFromKeyForLinkData:key");if(null!==a){var c=this.ii;if(""!==c)if(b=this.fo(b),this.Lh(a)){var d=D.ub(a,c);d!==b&&(ah(this,d,a),D.Ua(a,c,b),null===this.Fe(b)&&$g(this,b,a),Ug(this,"linkFromKey",cg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}}; -D.defineProperty(Y,{eo:"linkToKeyProperty"},function(){return this.ji},function(a){var b=this.ji;b!==a&&(Vg(a,Y,"linkToKeyProperty"),this.ji=a,this.i("linkToKeyProperty",b,a))});Y.prototype.getToKeyForLinkData=Y.prototype.pm=function(a){if(null!==a){var b=this.ji;if(""!==b&&(b=D.ub(a,b),void 0!==b)){if(Wg(b))return b;D.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}}; -Y.prototype.setToKeyForLinkData=Y.prototype.HB=function(a,b){null===b&&(b=void 0);void 0===b||Wg(b)||D.gc(b,"number or string",Y,"setToKeyForLinkData:key");if(null!==a){var c=this.ji;if(""!==c)if(b=this.fo(b),this.Lh(a)){var d=D.ub(a,c);d!==b&&(ah(this,d,a),D.Ua(a,c,b),null===this.Fe(b)&&$g(this,b,a),Ug(this,"linkToKey",cg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}}; -D.defineProperty(Y,{Du:"linkFromPortIdProperty"},function(){return this.an},function(a){var b=this.an;b!==a&&(Vg(a,Y,"linkFromPortIdProperty"),a!==this.co&&a!==this.eo||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.an=a,this.i("linkFromPortIdProperty",b,a))});Y.prototype.getFromPortIdForLinkData=Y.prototype.KI=function(a){if(null===a)return"";var b=this.an;if(""===b)return"";a=D.ub(a,b);return void 0===a?"":a}; -Y.prototype.setFromPortIdForLinkData=Y.prototype.CB=function(a,b){D.h(b,"string",Y,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.an;if(""!==c)if(this.Lh(a)){var d=D.ub(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),Ug(this,"linkFromPortId",cg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}}; -D.defineProperty(Y,{Fu:"linkToPortIdProperty"},function(){return this.bn},function(a){var b=this.bn;b!==a&&(Vg(a,Y,"linkToPortIdProperty"),a!==this.co&&a!==this.eo||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.bn=a,this.i("linkToPortIdProperty",b,a))});Y.prototype.getToPortIdForLinkData=Y.prototype.OI=function(a){if(null===a)return"";var b=this.bn;if(""===b)return"";a=D.ub(a,b);return void 0===a?"":a}; -Y.prototype.setToPortIdForLinkData=Y.prototype.IB=function(a,b){D.h(b,"string",Y,"setToPortIdForLinkData:portname");if(null!==a){var c=this.bn;if(""!==c)if(this.Lh(a)){var d=D.ub(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),Ug(this,"linkToPortId",cg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}};D.defineProperty(Y,{Eu:"linkLabelKeysProperty"},function(){return this.Gg},function(a){var b=this.Gg;b!==a&&(Vg(a,Y,"linkLabelKeysProperty"),this.Gg=a,this.i("linkLabelKeysProperty",b,a))}); -Y.prototype.getLabelKeysForLinkData=Y.prototype.Sk=function(a){if(null===a)return D.Co;var b=this.Gg;if(""===b)return D.Co;a=D.ub(a,b);return void 0===a?D.Co:a}; -Y.prototype.setLabelKeysForLinkData=Y.prototype.QG=function(a,b){D.Xt(b,Y,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Gg;if(""!==c)if(this.Lh(a)){var d=D.ub(a,c);void 0===d&&(d=D.Co);if(d!==b){for(var e=D.cb(d),g=0;ge||(D.Sg(d,e),this.Lh(a)&&(ah(this,b,a),Ug(this,"linkLabelKeys",ng,c,a,b,null,e,null)))}else void 0!==d&&D.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; -D.defineProperty(Y,{Yg:"linkDataArray"},function(){return this.bf},function(a){var b=this.bf;if(b!==a){D.Xt(a,Y,"linkDataArray");this.nd.clear();for(var c=D.cb(a),d=0;dd)return;D.Sg(a.bf,d)}Ug(a,"linkDataArray",ng,"linkDataArray",a,b,null,d,null);c=a.om(b);ah(a,c,b);c=a.pm(b);ah(a,c,b);d=a.Sk(b);if(D.isArray(d))for(var e=D.cb(d),g=0;ga.Vh&&D.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Vh;d&&b&&a.pd("CommittingTransaction",c,a.Cj);var e=0;if(0a.Hj;e--)g=d.ea(e),null!==g&&g.clear(), -d.jd(e),a.Kz=!0;e=a.cG;0===e&&(e=1);0=e&&(g=d.ea(0),null!==g&&g.clear(),d.jd(0),a.sh--);d.add(b);a.sh++;d.freeze();g=b}a.pd("CommittedTransaction",c,g)}else{a.bj=!0;try{a.isEnabled&&null!==g&&(g.uu=!0,g.undo())}finally{a.pd("RolledBackTransaction",c,g),a.bj=!1}null!==g&&g.clear()}a.Kv=null;return!0}if(a.isEnabled&&!b&&null!==g){a=e;c=g.ag;for(b=c.count-1;b>=a;b--)d=c.ea(b),null!==d&&d.undo(),c.Ya(),c.jd(b);c.freeze()}return!1} -og.prototype.canUndo=og.prototype.canUndo=function(){if(!this.isEnabled||0=this.Vh&&!this.Az&&(a=a.g,null!==a&&!1===a.Zn||D.trace("Change not within a transaction: "+c.toString()))}}; -og.prototype.skipsEvent=function(a){if(null===a||0>a.Ic.value)return!0;a=a.object;if(a instanceof P){if(a=a.layer,null!==a&&a.Tc)return!0}else if(a instanceof Rg&&a.Tc)return!0;return!1};D.w(og,{HJ:"models"},function(){return this.Pz.j});D.defineProperty(og,{isEnabled:"isEnabled"},function(){return this.mf},function(a){this.mf=a});D.w(og,{eH:"transactionToUndo"},function(){return 0<=this.Hj&&this.Hj<=this.history.count-1?this.history.ea(this.Hj):null}); -D.w(og,{dH:"transactionToRedo"},function(){return this.Hj=d)return"[]";var e=new ya;e.add("[ ");c&&1d)return;D.Ug(a.we,d)}Xg(a,"nodeDataArray",og,"nodeDataArray",a,b,null,d,null);a.gv(b)} +M.prototype.removeNodeDataCollection=function(a){if(D.isArray(a))for(var b=D.cb(a),c=0;cb&&(b=D.cb(a));D.Ih(a,b,c);Xg(this,"",dg,"",a,null,c,null,b)}; +M.prototype.removeArrayItem=M.prototype.vG=function(a,b){void 0===b&&(b=-1);v&&(D.Wt(a,M,"removeArrayItem:arr"),D.p(b,M,"removeArrayItem:idx"));a===this.we&&D.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=D.cb(a)-1);var c=D.La(a,b);D.Ug(a,b);Xg(this,"",og,"",a,c,null,b,null)};D.defineProperty(M,{po:"nodeCategoryProperty"},function(){return this.fn},function(a){var b=this.fn;b!==a&&(Yg(a,M,"nodeCategoryProperty"),this.fn=a,this.i("nodeCategoryProperty",b,a))}); +M.prototype.getCategoryForNodeData=M.prototype.QA=function(a){if(null===a)return"";var b=this.fn;if(""===b)return"";b=D.vb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;D.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""}; +M.prototype.setCategoryForNodeData=M.prototype.Dy=function(a,b){D.h(b,"string",M,"setCategoryForNodeData:cat");if(null!==a){var c=this.fn;if(""!==c)if(this.ie(a)){var d=D.vb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),Xg(this,"nodeCategory",bg,c,a,d,b))}else D.Ua(a,c,b)}}; +function Y(a,b){M.call(this);2D.am(d,a.newValue)&&D.Ih(d,c,a.newValue));return}}else if(a.Jc=== +og){c=a.Tj;if("linkDataArray"===a.wf){d=a.oldValue;D.Ta(d)&&"number"===typeof c&&(e=this.eg(d),b?(this.ii.add(d),D.La(this.bf,c)!==d&&D.Ih(this.bf,c,d),void 0!==e&&this.pd.add(e,d)):(this.ii.remove(d),D.La(this.bf,c)===d&&D.Ug(this.bf,c),void 0!==e&&this.pd.remove(e)));return}if("linkLabelKeys"===a.wf){d=this.Sk(a.object);D.isArray(d)&&"number"===typeof c&&(b?0>D.am(d,a.newValue)&&D.Ih(d,c,a.newValue):(c=D.am(d,a.newValue),0<=c&&D.Ug(d,c)));return}}M.prototype.Gn.call(this,a,b)}; +D.defineProperty(Y,{rA:"archetypeNodeData"},function(){return this.ql},function(a){var b=this.ql;b!==a&&(null!==a&&D.l(a,Object,Y,"archetypeNodeData"),this.ql=a,this.i("archetypeNodeData",b,a))});Y.prototype.io=function(a){if(void 0!==a){var b=this.ql;if(null!==b){var c=this.Fe(a);null===c&&(c=this.copyNodeData(b),D.Ua(c,this.wk,a),this.Xl(c))}return a}}; +D.defineProperty(Y,{fo:"linkFromKeyProperty"},function(){return this.ji},function(a){var b=this.ji;b!==a&&(Yg(a,Y,"linkFromKeyProperty"),this.ji=a,this.i("linkFromKeyProperty",b,a))});Y.prototype.getFromKeyForLinkData=Y.prototype.pm=function(a){if(null!==a){var b=this.ji;if(""!==b&&(b=D.vb(a,b),void 0!==b)){if(Zg(b))return b;D.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}}; +Y.prototype.setFromKeyForLinkData=Y.prototype.FB=function(a,b){null===b&&(b=void 0);void 0===b||Zg(b)||D.hc(b,"number or string",Y,"setFromKeyForLinkData:key");if(null!==a){var c=this.ji;if(""!==c)if(b=this.io(b),this.Lh(a)){var d=D.vb(a,c);d!==b&&(dh(this,d,a),D.Ua(a,c,b),null===this.Fe(b)&&ch(this,b,a),Xg(this,"linkFromKey",bg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}}; +D.defineProperty(Y,{ho:"linkToKeyProperty"},function(){return this.ki},function(a){var b=this.ki;b!==a&&(Yg(a,Y,"linkToKeyProperty"),this.ki=a,this.i("linkToKeyProperty",b,a))});Y.prototype.getToKeyForLinkData=Y.prototype.qm=function(a){if(null!==a){var b=this.ki;if(""!==b&&(b=D.vb(a,b),void 0!==b)){if(Zg(b))return b;D.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}}; +Y.prototype.setToKeyForLinkData=Y.prototype.LB=function(a,b){null===b&&(b=void 0);void 0===b||Zg(b)||D.hc(b,"number or string",Y,"setToKeyForLinkData:key");if(null!==a){var c=this.ki;if(""!==c)if(b=this.io(b),this.Lh(a)){var d=D.vb(a,c);d!==b&&(dh(this,d,a),D.Ua(a,c,b),null===this.Fe(b)&&ch(this,b,a),Xg(this,"linkToKey",bg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}}; +D.defineProperty(Y,{Cu:"linkFromPortIdProperty"},function(){return this.an},function(a){var b=this.an;b!==a&&(Yg(a,Y,"linkFromPortIdProperty"),a!==this.fo&&a!==this.ho||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.an=a,this.i("linkFromPortIdProperty",b,a))});Y.prototype.getFromPortIdForLinkData=Y.prototype.NI=function(a){if(null===a)return"";var b=this.an;if(""===b)return"";a=D.vb(a,b);return void 0===a?"":a}; +Y.prototype.setFromPortIdForLinkData=Y.prototype.GB=function(a,b){D.h(b,"string",Y,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.an;if(""!==c)if(this.Lh(a)){var d=D.vb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),Xg(this,"linkFromPortId",bg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}}; +D.defineProperty(Y,{Eu:"linkToPortIdProperty"},function(){return this.bn},function(a){var b=this.bn;b!==a&&(Yg(a,Y,"linkToPortIdProperty"),a!==this.fo&&a!==this.ho||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.bn=a,this.i("linkToPortIdProperty",b,a))});Y.prototype.getToPortIdForLinkData=Y.prototype.SI=function(a){if(null===a)return"";var b=this.bn;if(""===b)return"";a=D.vb(a,b);return void 0===a?"":a}; +Y.prototype.setToPortIdForLinkData=Y.prototype.MB=function(a,b){D.h(b,"string",Y,"setToPortIdForLinkData:portname");if(null!==a){var c=this.bn;if(""!==c)if(this.Lh(a)){var d=D.vb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),Xg(this,"linkToPortId",bg,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else D.Ua(a,c,b)}};D.defineProperty(Y,{Du:"linkLabelKeysProperty"},function(){return this.Ig},function(a){var b=this.Ig;b!==a&&(Yg(a,Y,"linkLabelKeysProperty"),this.Ig=a,this.i("linkLabelKeysProperty",b,a))}); +Y.prototype.getLabelKeysForLinkData=Y.prototype.Sk=function(a){if(null===a)return D.Eo;var b=this.Ig;if(""===b)return D.Eo;a=D.vb(a,b);return void 0===a?D.Eo:a}; +Y.prototype.setLabelKeysForLinkData=Y.prototype.TG=function(a,b){D.Wt(b,Y,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Ig;if(""!==c)if(this.Lh(a)){var d=D.vb(a,c);void 0===d&&(d=D.Eo);if(d!==b){for(var e=D.cb(d),g=0;ge||(D.Ug(d,e),this.Lh(a)&&(dh(this,b,a),Xg(this,"linkLabelKeys",og,c,a,b,null,e,null)))}else void 0!==d&&D.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; +D.defineProperty(Y,{Zg:"linkDataArray"},function(){return this.bf},function(a){var b=this.bf;if(b!==a){D.Wt(a,Y,"linkDataArray");this.pd.clear();for(var c=D.cb(a),d=0;dd)return;D.Ug(a.bf,d)}Xg(a,"linkDataArray",og,"linkDataArray",a,b,null,d,null);c=a.pm(b);dh(a,c,b);c=a.qm(b);dh(a,c,b);d=a.Sk(b);if(D.isArray(d))for(var e=D.cb(d),g=0;ga.Wh&&D.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Wh;d&&b&&a.rd("CommittingTransaction",c,a.Dj);var e=0;if(0a.Ij;e--)g=d.ea(e),null!==g&&g.clear(), +d.jd(e),a.Kz=!0;e=a.fG;0===e&&(e=1);0=e&&(g=d.ea(0),null!==g&&g.clear(),d.jd(0),a.sh--);d.add(b);a.sh++;d.freeze();g=b}a.rd("CommittedTransaction",c,g)}else{a.bj=!0;try{a.isEnabled&&null!==g&&(g.tu=!0,g.undo())}finally{a.rd("RolledBackTransaction",c,g),a.bj=!1}null!==g&&g.clear()}a.Jv=null;return!0}if(a.isEnabled&&!b&&null!==g){a=e;c=g.bg;for(b=c.count-1;b>=a;b--)d=c.ea(b),null!==d&&d.undo(),c.Ya(),c.jd(b);c.freeze()}return!1} +pg.prototype.canUndo=pg.prototype.canUndo=function(){if(!this.isEnabled||0=this.Wh&&!this.Az&&(a=a.g,null!==a&&!1===a.ao||D.trace("Change not within a transaction: "+c.toString()))}}; +pg.prototype.skipsEvent=function(a){if(null===a||0>a.Jc.value)return!0;a=a.object;if(a instanceof P){if(a=a.layer,null!==a&&a.Uc)return!0}else if(a instanceof Ug&&a.Uc)return!0;return!1};D.w(pg,{KJ:"models"},function(){return this.Pz.j});D.defineProperty(pg,{isEnabled:"isEnabled"},function(){return this.mf},function(a){this.mf=a});D.w(pg,{hH:"transactionToUndo"},function(){return 0<=this.Ij&&this.Ij<=this.history.count-1?this.history.ea(this.Ij):null}); +D.w(pg,{gH:"transactionToRedo"},function(){return this.Ijb.Ph||(b.scale=a))};oa.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.My);D.p(a,oa,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.am!==Nh)return!1;a*=b.scale;return ab.Ph?!1:b.px}; -oa.prototype.increaseZoom=function(a){void 0===a&&(a=this.My);D.p(a,oa,"increaseZoom:factor");var b=this.g;null!==b&&b.am===Nh&&(a*=b.scale,ab.Ph||(b.scale=a))};oa.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.My);D.p(a,oa,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.am!==Nh)return!1;a*=b.scale;return ab.Ph?!1:b.px};oa.prototype.resetZoom=function(a){void 0===a&&(a=this.zx);D.p(a,oa,"resetZoom:newscale");var b=this.g;null===b||ab.Ph||(b.scale=a)}; -oa.prototype.canResetZoom=function(a){void 0===a&&(a=this.zx);D.p(a,oa,"canResetZoom:newscale");var b=this.g;return null===b||ab.Ph?!1:b.px};oa.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.lA&&!isNaN(this.Lz)&&a.cd.O(this.kA)?(a.scale=this.Lz,a.position=this.sD,this.lA=NaN,this.kA=Hd):(this.Lz=b,this.sD=c.copy(),a.zoomToFit(),this.lA=a.scale,this.kA=a.cd.copy())}};oa.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.px}; -oa.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&D.l(a,F,oa,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.sj&&(this.sj.next()?a=this.sj.value:this.sj=null)}catch(c){this.sj=null}null===a&&(0e||Math.abs(b.y-a.y)>d};D.w(Sg,{g:"diagram"},function(){return this.ba});D.defineProperty(Sg,{name:"name"},function(){return this.Xb},function(a){D.h(a,"string",Sg,"name");this.Xb=a}); -D.defineProperty(Sg,{isEnabled:"isEnabled"},function(){return this.mf},function(a){D.h(a,"boolean",Sg,"isEnabled");this.mf=a});D.defineProperty(Sg,{wa:"isActive"},function(){return this.fD},function(a){D.h(a,"boolean",Sg,"isActive");this.fD=a});D.defineProperty(Sg,{Pf:"transactionResult"},function(){return this.qE},function(a){null!==a&&D.h(a,"string",Sg,"transactionResult");this.qE=a}); -function Mh(){Sg.call(this);0e&&(e=k),l>g&&(g=l))}}Infinity===c?b.m(0,0,0,0):b.m(c,d,e-c,g-d)} -function Hi(a,b){if(null===a.ic){var c=a.g;if(!(null===c||b&&(c.mb||c.Ff))&&null!==a.ec){var d=c.ra;d.isEnabled&&d.RF?null!==d.Cj&&0c.ta)){var d=a.g;if(null!==d&&!d.mb&&(d=a.qj,null!==d)){var e=null,g=null;null===c.aa&&(e=Ri(a,c.n(0),!1),null!==e&&(g=e.Y));var h=null,k=null;null===c.da&&(h=Ri(a,c.n(c.ta-1),!0),null!==h&&(k=h.Y));d.isValidLink(g,e,k,h)?b?(c.iq=c.n(0),c.jq=c.n(c.ta-1),c.Wj=!1,c.aa=g,null!==e&&(c.cg=e.sd),c.da=k,null!==h&&(c.jh=h.sd)):Si(d,g,e,k,h):Si(d,null,null,null,null)}}}Mh.prototype.doDragOver=function(){}; -function Ti(a,b){var c=a.g;if(null!==c){a.Ej&&Oi(a,!0);zi(a);var d=Pi(c,b,null,function(b){return!Mi(a,b)}),e=c.U;e.We=d;if(null!==d){e.Lc=!1;for(var g=d;null!==g;){var h=g.hB;if(null!==h&&(h(e,g),e.Lc))break;g=Qi(g)}}else g=c.hB,null!==g&&g(e);if(a.wa||null!==Vh){for(e=(a.ic||a.ec).j;e.next();)g=e.key,g instanceof G&&g.Gd.each(function(a){a.Wj=!1});a.doDropOnto(b,d);if(a.wa||null!==Vh){d=D.Nf();for(e=c.selection.j;e.next();)g=e.value,g instanceof G&&Ui(c,g.getAvoidableRect(d));D.Mb(d)}}}} -Mh.prototype.doDropOnto=function(){};Mh.prototype.doMouseMove=function(){if(this.wa){var a=this.g;if(null!==a&&null!==this.Ln&&null!==this.ec){var b=!1,c=!1;this.mayCopy()?(b=!0,a.jc="copy",Hi(this,!1),this.Bt(this.ic),Ii(this,this.ic,!1),this.Hp(this.ic)):this.mayMove()?(c=!0,a.jc="default",Ci(this),Ii(this,this.ec,!0)):this.mayDragOut()?(a.jc="no-drop",Hi(this,!1),Ii(this,this.ic,!1)):Ci(this);Ni(this,a.U.ha,c,b)}}}; -Mh.prototype.doMouseUp=function(){if(this.wa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.ic?(Ci(this),Hi(this,!0),this.Bt(this.ic),Ii(this,this.ic,!1),this.Hp(this.ic),null!==this.ic&&a.LG(this.ic.Yj())):(b=!0,Ci(this),this.mayMove()&&(Ii(this,this.ec,!0),Ni(this,a.U.ha,!0,!1)));this.Mr=!0;Ti(this,a.U.ha);if(this.wa){this.ic=null;if(b&&null!==this.ec)for(b=this.ec.j;b.next();){var d=b.key;d instanceof G&&(d=d.Pa,null===d||null===d.placeholder||this.ec.contains(d)||d.placeholder.K())}a.yc(); -this.Hp(this.ec);this.Pf=c?"Copy":"Move";a.Ja(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};Mh.prototype.mayCopy=function(){if(!this.MF)return!1;var a=this.g;if(null===a||a.mb||a.Ff||!a.Zp||!a.Kk||(D.Vk?!a.U.alt:!a.U.control))return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.oe()&&b.canCopy())return!0}return null!==this.qd&&this.Ej&&this.qd.canCopy()?!0:!1}; -Mh.prototype.mayDragOut=function(){if(!this.MF)return!1;var a=this.g;if(null===a||!a.Ut||!a.Kk||a.Yl)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.oe()&&b.canCopy())return!0}return null!==this.qd&&this.Ej&&this.qd.canCopy()?!0:!1};Mh.prototype.mayMove=function(){var a=this.g;if(null===a||a.mb||!a.Yl)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.oe()&&b.canMove())return!0}return null!==this.qd&&this.Ej&&this.qd.canMove()?!0:!1};var Ai=new K(Mh),Vh=null,Wh=null; -Mh.prototype.getDraggingSource=function(){return Vh};Mh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.EE||a.mb||a.Ff||!a.Zp)return!1;var b=Vh;return null===b||null===b.g||b.g.ga.fm!==a.ga.fm?!1:!0};Mh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Xa.Ii();Vi(a);a=Vh;null!==a&&null!==a.g&&(a.g.jc="copy")}};Mh.prototype.doSimulatedDragLeave=function(){var a=Vh;null!==a&&a.doSimulatedDragOut();this.doCancel()}; -Mh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Vh;null!==b&&null!==b.ec&&this.mayDragIn()&&(a.jc="copy",Wi(this,b.ec.Yj(),!1),Ii(this,this.ic,!1),Ni(this,a.U.ha,!1,!0))}}; -Mh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Vh;if(null!==b){var c=b.g;b.Mr=!0;Ci(this);this.mayDragIn()&&(this.$b("Drop"),Wi(this,b.ec.Yj(),!0),Ii(this,this.ic,!1),null!==this.ic&&a.LG(this.ic.Yj()),Ti(this,a.U.ha),a.yc(),b=a.selection,null!==this.ic?this.Pf="ExternalCopy":b=new L(F),this.ic=null,a.doFocus(),a.Ja("ExternalObjectsDropped",b,c),this.bl())}}}; -function Wi(a,b,c){if(null===a.ic){var d=a.g;if(null!==d&&!d.mb&&!d.Ff){d.Eb=!c;d.br=!c;a.al=d.U.ha;d=d.hq(b,d,!0);c=D.Nf();Gi(b,c);var e=c.x+c.width/2,g=c.y+c.height/2;D.Mb(c);var h=a.Uw;c=new ma(F);var k=D.P();for(b=b.j;b.next();){var l=b.value;if(l.oe()&&l.canCopy()){var m=l.location,l=d.oa(l);k.m(h.x-(e-m.x),h.y-(g-m.y));l.location=k;l.hf();c.add(l,ki(k))}}D.A(k);for(d=d.j;d.next();)e=d.value,e instanceof J&&e.canCopy()&&c.add(e,ki());a.ic=c;Uh(a,c.Yj());null!==a.qd&&(c=a.qd,d=c.qo,c.wm(a.al.x- -(d.x+d.width/2),a.al.y-(d.y+d.height/2)))}}}Mh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.jc="":a.jc="no-drop")};function xi(a){this.point=a;this.RG=Gd}D.ja("DraggingInfo",xi);function Ji(a,b,c){this.Vc=a;this.info=b;this.SI=c} -function Xi(){0=d&&(d=.1);for(var e=this,g=b.On(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,g=g.j;g.next();){var h=g.value,k=h.Y;if(k instanceof G){var l=h.eb(gc,D.P()),m=c.x-l.x,n=c.y-l.y;D.A(l);l=m*m+n*n;lc){if(null!==this.rc&&a===this.$g&&b===this.ah)return!0;var d=b.sd;null===d&&(d="");if(a.Hx(d).count>=c)return!1}return!0}; -Xi.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Aq;if(null!==this.g&&this.g.gb===this&&(null!==a.layer&&!a.layer.Vt||!0!==b.$G))return!1;var c=b.tK;if(Infinity>c){if(null!==this.rc&&a===this.bh&&b===this.dh)return!0;var d=b.sd;null===d&&(d="");if(a.Vg(d).count>=c)return!1}return!0};Xi.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.Y,d=b.Y;return null!==c&&c===d}; -Xi.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.Y;if(!(c instanceof G))return!1;var d=a.sd;null===d&&(d="");var e=b.Y;if(!(e instanceof G))return!1;var g=b.sd;null===g&&(g="");for(e=e.Vg(g);e.next();)if(g=e.value,g.aa===c&&g.cg===d)return!0;return!1}; -Xi.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.HI&&d.sK||!this.isInSameNode(b,d))&&(b.GI&&d.rK||!this.isLinked(b,d)))||null!==this.rc&&(null!==a&&this.isLabelDependentOnLink(a,this.rc)||null!==c&&this.isLabelDependentOnLink(c,this.rc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.rc))return!1;if(null!==a){var e=a.gy;if(null!==e&&!e(a,b,c,d,this.rc))return!1}if(null!== -c&&(e=c.gy,null!==e&&!e(a,b,c,d,this.rc)))return!1;e=this.gy;return null!==e?e(a,b,c,d,this.rc):!0};Xi.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.zc;if(null===c)return!1;if(c===b)return!0;var d=new L(G);d.add(a);return Yi(this,c,b,d)};function Yi(a,b,c,d){if(b===c)return!0;var e=b.aa;if(null!==e&&e.tf&&(d.add(e),Yi(a,e.zc,c,d)))return!0;b=b.da;return null!==b&&b.tf&&(d.add(b),Yi(a,b.zc,c,d))?!0:!1} -Xi.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.Aq;var d=null!==this.g?this.g.zK:Zi;if(d!==Zi){if(d===$i){if(null!==c&&!c.Uc)return!0;for(d=b.Gd;d.next();){var e=d.value;if(e!==c&&e.Uc&&e.da===b)return!1}return!aj(this,a,b,c,!0)}if(d===bj){if(null!==c&&!c.Uc)return!0;for(d=a.Gd;d.next();)if(e=d.value,e!==c&&e.Uc&&e.aa===a)return!1;return!aj(this,a,b,c,!0)}if(d===cj)return a===b?a=!0:(d=new L(G),d.add(b),a=dj(this,d,a,b,c)),!a;if(d===ej)return!aj(this, -a,b,c,!1);if(d===fj)return a===b?a=!0:(d=new L(G),d.add(b),a=gj(this,d,a,b,c)),!a}return!0};function aj(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.Gd;g.next();){var h=g.value;if(h!==d&&(!e||h.Uc)&&h.da===b&&(h=h.aa,h!==b&&aj(a,h,c,d,e)))return!0}return!1}function dj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Gd;g.next();){var h=g.value;if(h!==e&&h.da===c&&(h=h.aa,h!==c&&dj(a,b,h,d,e)))return!0}return!1} -function gj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Gd;g.next();){var h=g.value;if(h!==e){var k=h.aa,h=h.da,k=k===c?h:k;if(k!==c&&gj(a,b,k,d,e))return!0}}return!1}D.defineProperty(Xi,{gy:"linkValidation"},function(){return this.Gl},function(a){null!==a&&D.h(a,"function",Xi,"linkValidation");this.Gl=a});D.defineProperty(Xi,{sy:"portTargeted"},function(){return this.SD},function(a){null!==a&&D.h(a,"function",Xi,"portTargeted");this.SD=a}); -function ra(){0b.ju+1&&c=c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d? -"ne-resize":"e-resize"}else if(a instanceof x)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};D.defineProperty(Pj,{qu:"handleArchetype"},function(){return this.vl},function(a){null!==a&&D.l(a,P,Pj,"handleArchetype");this.vl=a});D.w(Pj,{handle:"handle"},function(){return this.mc});D.defineProperty(Pj,{zb:"adornedObject"},function(){return this.Pc},function(a){null!==a&&D.l(a,P,Pj,"adornedObject");this.Pc=a}); -Pj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.mb&&a.Wt&&a.U.left?null!==this.findToolHandleAt(a.Kc.ha,this.name):!1}; -Pj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.mc=this.findToolHandleAt(a.Kc.ha,this.name),null!==this.mc&&(this.Pc=this.mc.Y.zb,this.Dp.set(this.zb.eb(this.handle.alignment.kG())),this.ND.set(this.Pc.Y.location),this.HD.set(this.Pc.Ea),this.wz=this.computeCellSize(),this.yz=this.computeMinSize(),this.xz=this.computeMaxSize(),a.jf=!0,this.ED=a.Xa.isEnabled,a.Xa.isEnabled=!1,this.$b(this.name),this.wa=!0))}; -Pj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.bl(),this.Pc=this.mc=null,this.wa=a.jf=!1,a.Xa.isEnabled=this.ED)};Pj.prototype.doCancel=function(){null!==this.zb&&(this.zb.Ea=this.lG,this.zb.Y.location=this.OJ);this.stopTool()};Pj.prototype.doMouseMove=function(){var a=this.g;if(this.wa&&null!==a){var b=this.yz,c=this.xz,d=this.wz,e=this.zb.uF(a.U.ha,D.P()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);a.gg();D.A(e)}}; -Pj.prototype.doMouseUp=function(){var a=this.g;if(this.wa&&null!==a){var b=this.yz,c=this.xz,d=this.wz,e=this.zb.uF(a.U.ha,D.P()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);D.A(e);a.yc();this.Pf=this.name;a.Ja("PartResized",this.zb,this.lG)}this.stopTool()}; -Pj.prototype.resize=function(a){if(null!==this.g){var b=this.zb,c=b.Y;b.Ea=a.size;c.hf();a=this.zb.eb(this.handle.alignment.kG());c instanceof I?(a=c.position.copy().vo(a).add(this.Dp),c.move(a)):c.location=c.location.copy().vo(a).add(this.Dp)}}; -Pj.prototype.computeResize=function(a,b,c,d,e,g){b.Zd()&&(b=gc);var h=this.zb.Ga,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!g){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=D.P();gb(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),g||(b=a.height/a.width,pb.Qh||(b.scale=a))};oa.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.Ly);D.p(a,oa,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.bm!==Rh)return!1;a*=b.scale;return ab.Qh?!1:b.ox}; +oa.prototype.increaseZoom=function(a){void 0===a&&(a=this.Ly);D.p(a,oa,"increaseZoom:factor");var b=this.g;null!==b&&b.bm===Rh&&(a*=b.scale,ab.Qh||(b.scale=a))};oa.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.Ly);D.p(a,oa,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.bm!==Rh)return!1;a*=b.scale;return ab.Qh?!1:b.ox};oa.prototype.resetZoom=function(a){void 0===a&&(a=this.yx);D.p(a,oa,"resetZoom:newscale");var b=this.g;null===b||ab.Qh||(b.scale=a)}; +oa.prototype.canResetZoom=function(a){void 0===a&&(a=this.yx);D.p(a,oa,"canResetZoom:newscale");var b=this.g;return null===b||ab.Qh?!1:b.ox};oa.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.nA&&!isNaN(this.Lz)&&a.dd.P(this.mA)?(a.scale=this.Lz,a.position=this.vD,this.nA=NaN,this.mA=Hd):(this.Lz=b,this.vD=c.copy(),a.zoomToFit(),this.nA=a.scale,this.mA=a.dd.copy())}};oa.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.ox}; +oa.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&D.l(a,F,oa,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.sj&&(this.sj.next()?a=this.sj.value:this.sj=null)}catch(c){this.sj=null}null===a&&(0e||Math.abs(b.y-a.y)>d};D.w(Vg,{g:"diagram"},function(){return this.ba});D.defineProperty(Vg,{name:"name"},function(){return this.Xb},function(a){D.h(a,"string",Vg,"name");this.Xb=a}); +D.defineProperty(Vg,{isEnabled:"isEnabled"},function(){return this.mf},function(a){D.h(a,"boolean",Vg,"isEnabled");this.mf=a});D.defineProperty(Vg,{wa:"isActive"},function(){return this.iD},function(a){D.h(a,"boolean",Vg,"isActive");this.iD=a});D.defineProperty(Vg,{Qf:"transactionResult"},function(){return this.tE},function(a){null!==a&&D.h(a,"string",Vg,"transactionResult");this.tE=a}); +function Qh(){Vg.call(this);0e&&(e=k),l>g&&(g=l))}}Infinity===c?b.n(0,0,0,0):b.n(c,d,e-c,g-d)} +function Oi(a,b){if(null===a.jc){var c=a.g;if(!(null===c||b&&(c.nb||c.Gf))&&null!==a.fc){var d=c.ra;d.isEnabled&&d.UF?null!==d.Dj&&0c.ta)){var d=a.g;if(null!==d&&!d.nb){var e=a.qj;if(null!==e){var g=null,h=null;null===c.aa&&(g=Yi(a,c.m(0),!1),null!==g&&(h=g.Y));var k=null,l=null;null===c.da&&(k=Yi(a,c.m(c.ta-1),!0),null!==k&&(l=k.Y));e.isValidLink(h,g,l,k)?b?(c.hq=c.m(0),c.iq=c.m(c.ta-1),c.zm=!1,c.aa=h,null!==g&&(c.dg=g.ud),c.da=l,null!==k&&(c.jh=k.ud),c.Lc!==a.Sz&&d.Ja("LinkRelinked",c,a.Sz),c.kd!==a.Tz&&d.Ja("LinkRelinked",c,a.Tz)):Zi(e,h,g,l,k):Zi(e,null,null,null,null)}}}} +Qh.prototype.doDragOver=function(){}; +function $i(a,b){var c=a.g;if(null!==c){a.Fj&&Vi(a,!0);Ei(a);var d=Wi(c,b,null,function(b){return!Ti(a,b)}),e=c.U;e.We=d;if(null!==d){e.Mc=!1;for(var g=d;null!==g;){var h=g.lB;if(null!==h&&(h(e,g),e.Mc))break;g=Xi(g)}}else g=c.lB,null!==g&&g(e);if(a.wa||null!==Zh){for(e=(a.jc||a.fc).j;e.next();)g=e.key,g instanceof G&&g.Hd.each(function(a){a.zm=!1});a.doDropOnto(b,d);if(a.wa||null!==Zh){d=D.Of();for(e=c.selection.j;e.next();)g=e.value,g instanceof G&&aj(c,g.getAvoidableRect(d));D.Kb(d)}}}} +Qh.prototype.doDropOnto=function(){};Qh.prototype.doMouseMove=function(){if(this.wa){var a=this.g;if(null!==a&&null!==this.Nn&&null!==this.fc){var b=!1,c=!1;this.mayCopy()?(b=!0,a.kc="copy",Oi(this,!1),Yh(this,this.jc),Pi(this,this.jc,!1),Fi(this,this.jc)):this.mayMove()?(c=!0,a.kc="default",Ii(this),Pi(this,this.fc,!0)):this.mayDragOut()?(a.kc="no-drop",Oi(this,!1),Pi(this,this.jc,!1)):Ii(this);Ui(this,a.U.ha,c,b)}}}; +Qh.prototype.doMouseUp=function(){if(this.wa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.jc?(Ii(this),Oi(this,!0),Yh(this,this.jc),Pi(this,this.jc,!1),Fi(this,this.jc),null!==this.jc&&a.OG(this.jc.Yj())):(b=!0,Ii(this),this.mayMove()&&(Pi(this,this.fc,!0),Ui(this,a.U.ha,!0,!1)));this.Lr=!0;$i(this,a.U.ha);if(this.wa){this.jc=null;if(b&&null!==this.fc)for(b=this.fc.j;b.next();){var d=b.key;d instanceof G&&(d=d.Pa,null===d||null===d.placeholder||this.fc.contains(d)||d.placeholder.K())}a.zc(); +Fi(this,this.fc);this.Qf=c?"Copy":"Move";a.Ja(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};Qh.prototype.mayCopy=function(){if(!this.PF)return!1;var a=this.g;if(null===a||a.nb||a.Gf||!a.$p||!a.Kk||(D.Wk?!a.U.alt:!a.U.control))return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.oe()&&b.canCopy())return!0}return null!==this.sd&&this.Fj&&this.sd.canCopy()?!0:!1}; +Qh.prototype.mayDragOut=function(){if(!this.PF)return!1;var a=this.g;if(null===a||!a.Tt||!a.Kk||a.Zl)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.oe()&&b.canCopy())return!0}return null!==this.sd&&this.Fj&&this.sd.canCopy()?!0:!1};Qh.prototype.mayMove=function(){var a=this.g;if(null===a||a.nb||!a.Zl)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.oe()&&b.canMove())return!0}return null!==this.sd&&this.Fj&&this.sd.canMove()?!0:!1};var Gi=new K(Qh),Zh=null,$h=null; +Qh.prototype.getDraggingSource=function(){return Zh};Qh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.HE||a.nb||a.Gf||!a.$p)return!1;var b=Zh;return null===b||null===b.g||b.g.ga.gm!==a.ga.gm?!1:!0};Qh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Xa.Ii();bj(a);a=Zh;null!==a&&null!==a.g&&(a.g.kc="copy")}};Qh.prototype.doSimulatedDragLeave=function(){var a=Zh;null!==a&&a.doSimulatedDragOut();this.doCancel()}; +Qh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Zh;null!==b&&null!==b.fc&&this.mayDragIn()&&(a.kc="copy",cj(this,b.fc.Yj(),!1),Pi(this,this.jc,!1),Ui(this,a.U.ha,!1,!0))}}; +Qh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Zh;if(null!==b){var c=b.g;b.Lr=!0;Ii(this);this.mayDragIn()&&(this.ac("Drop"),cj(this,b.fc.Yj(),!0),Pi(this,this.jc,!1),null!==this.jc&&a.OG(this.jc.Yj()),$i(this,a.U.ha),a.zc(),b=a.selection,null!==this.jc?this.Qf="ExternalCopy":b=new L(F),this.jc=null,a.doFocus(),a.Ja("ExternalObjectsDropped",b,c),this.dl())}}}; +function cj(a,b,c){if(null===a.jc){var d=a.g;if(null!==d&&!d.nb&&!d.Gf){d.Eb=!c;d.ar=!c;a.cl=d.U.ha;d=d.gq(b,d,!0);c=D.Of();Ni(b,c);var e=c.x+c.width/2,g=c.y+c.height/2;D.Kb(c);var h=a.Tw;c=new ma(F);var k=D.O();for(b=b.j;b.next();){var l=b.value,m=d.na(l);l.oe()&&l.canCopy()?(l=l.location,k.n(h.x-(e-l.x),h.y-(g-l.y)),m.location=k,m.hf(),c.add(m,ci(k))):l instanceof J&&l.canCopy()&&m.$k(h.x-e,h.y-g)}D.A(k);for(d=d.j;d.next();)e=d.value,e instanceof J&&e.canCopy()&&c.add(e,ci());a.jc=c;Xh(a,c.Yj()); +null!==a.sd&&(c=a.sd,d=c.so,c.$k(a.cl.x-(d.x+d.width/2),a.cl.y-(d.y+d.height/2)))}}}Qh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.kc="":a.kc="no-drop")};function qi(a){this.point=a;this.UG=Gd}D.ja("DraggingInfo",qi);function Qi(a,b,c){this.Wc=a;this.info=b;this.VI=c} +function dj(){0=d&&(d=.1);for(var e=this,g=b.Qn(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,g=g.j;g.next();){var h=g.value,k=h.Y;if(k instanceof G){var l=h.eb(hc,D.O()),m=c.x-l.x,n=c.y-l.y;D.A(l);l=m*m+n*n;lc){if(null!==this.sc&&a===this.ah&&b===this.bh)return!0;var d=b.ud;null===d&&(d="");if(a.Gx(d).count>=c)return!1}return!0}; +dj.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.zq;if(null!==this.g&&this.g.gb===this&&(null!==a.layer&&!a.layer.Ut||!0!==b.cH))return!1;var c=b.wK;if(Infinity>c){if(null!==this.sc&&a===this.dh&&b===this.eh)return!0;var d=b.ud;null===d&&(d="");if(a.Xg(d).count>=c)return!1}return!0};dj.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.Y,d=b.Y;return null!==c&&c===d}; +dj.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.Y;if(!(c instanceof G))return!1;var d=a.ud;null===d&&(d="");var e=b.Y;if(!(e instanceof G))return!1;var g=b.ud;null===g&&(g="");for(e=e.Xg(g);e.next();)if(g=e.value,g.aa===c&&g.dg===d)return!0;return!1}; +dj.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.KI&&d.vK||!this.isInSameNode(b,d))&&(b.JI&&d.uK||!this.isLinked(b,d)))||null!==this.sc&&(null!==a&&this.isLabelDependentOnLink(a,this.sc)||null!==c&&this.isLabelDependentOnLink(c,this.sc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.sc))return!1;if(null!==a){var e=a.ey;if(null!==e&&!e(a,b,c,d,this.sc))return!1}if(null!== +c&&(e=c.ey,null!==e&&!e(a,b,c,d,this.sc)))return!1;e=this.ey;return null!==e?e(a,b,c,d,this.sc):!0};dj.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Ac;if(null===c)return!1;if(c===b)return!0;var d=new L(G);d.add(a);return ej(this,c,b,d)};function ej(a,b,c,d){if(b===c)return!0;var e=b.aa;if(null!==e&&e.tf&&(d.add(e),ej(a,e.Ac,c,d)))return!0;b=b.da;return null!==b&&b.tf&&(d.add(b),ej(a,b.Ac,c,d))?!0:!1} +dj.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.zq;var d=null!==this.g?this.g.CK:fj;if(d!==fj){if(d===gj){if(null!==c&&!c.Vc)return!0;for(d=b.Hd;d.next();){var e=d.value;if(e!==c&&e.Vc&&e.da===b)return!1}return!hj(this,a,b,c,!0)}if(d===ij){if(null!==c&&!c.Vc)return!0;for(d=a.Hd;d.next();)if(e=d.value,e!==c&&e.Vc&&e.aa===a)return!1;return!hj(this,a,b,c,!0)}if(d===jj)return a===b?a=!0:(d=new L(G),d.add(b),a=kj(this,d,a,b,c)),!a;if(d===lj)return!hj(this, +a,b,c,!1);if(d===mj)return a===b?a=!0:(d=new L(G),d.add(b),a=nj(this,d,a,b,c)),!a}return!0};function hj(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.Hd;g.next();){var h=g.value;if(h!==d&&(!e||h.Vc)&&h.da===b&&(h=h.aa,h!==b&&hj(a,h,c,d,e)))return!0}return!1}function kj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Hd;g.next();){var h=g.value;if(h!==e&&h.da===c&&(h=h.aa,h!==c&&kj(a,b,h,d,e)))return!0}return!1} +function nj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Hd;g.next();){var h=g.value;if(h!==e){var k=h.aa,h=h.da,k=k===c?h:k;if(k!==c&&nj(a,b,k,d,e))return!0}}return!1}D.defineProperty(dj,{ey:"linkValidation"},function(){return this.Il},function(a){null!==a&&D.h(a,"function",dj,"linkValidation");this.Il=a});D.defineProperty(dj,{qy:"portTargeted"},function(){return this.VD},function(a){null!==a&&D.h(a,"function",dj,"portTargeted");this.VD=a}); +function ra(){0b.iu+1&&c=c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d? +"ne-resize":"e-resize"}else if(a instanceof x)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};D.defineProperty(Uj,{pu:"handleArchetype"},function(){return this.xl},function(a){null!==a&&D.l(a,P,Uj,"handleArchetype");this.xl=a});D.w(Uj,{handle:"handle"},function(){return this.nc});D.defineProperty(Uj,{zb:"adornedObject"},function(){return this.Qc},function(a){null!==a&&D.l(a,P,Uj,"adornedObject");this.Qc=a}); +Uj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.nb&&a.Vt&&a.U.left?null!==this.findToolHandleAt(a.Kc.ha,this.name):!1}; +Uj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.nc=this.findToolHandleAt(a.Kc.ha,this.name),null!==this.nc&&(this.Qc=this.nc.Y.zb,this.Fp.set(this.zb.eb(this.handle.alignment.nG())),this.QD.set(this.Qc.Y.location),this.LD.set(this.Qc.Ea),this.wz=this.computeCellSize(),this.yz=this.computeMinSize(),this.xz=this.computeMaxSize(),a.jf=!0,this.HD=a.Xa.isEnabled,a.Xa.isEnabled=!1,this.ac(this.name),this.wa=!0))}; +Uj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.dl(),this.Qc=this.nc=null,this.wa=a.jf=!1,a.Xa.isEnabled=this.HD)};Uj.prototype.doCancel=function(){null!==this.zb&&(this.zb.Ea=this.oG,this.zb.Y.location=this.RJ);this.stopTool()};Uj.prototype.doMouseMove=function(){var a=this.g;if(this.wa&&null!==a){var b=this.yz,c=this.xz,d=this.wz,e=this.zb.xF(a.U.ha,D.O()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);a.hg();D.A(e)}}; +Uj.prototype.doMouseUp=function(){var a=this.g;if(this.wa&&null!==a){var b=this.yz,c=this.xz,d=this.wz,e=this.zb.xF(a.U.ha,D.O()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);D.A(e);a.zc();this.Qf=this.name;a.Ja("PartResized",this.zb,this.oG)}this.stopTool()}; +Uj.prototype.resize=function(a){if(null!==this.g){var b=this.zb,c=b.Y;b.Ea=a.size;c.hf();a=this.zb.eb(this.handle.alignment.nG());c instanceof I?(a=c.position.copy().xo(a).add(this.Fp),c.move(a)):c.location=c.location.copy().xo(a).add(this.Fp)}}; +Uj.prototype.computeResize=function(a,b,c,d,e,g){b.Zd()&&(b=hc);var h=this.zb.Ga,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!g){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=D.O();fb(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),g||(b=a.height/a.width,p=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height), a.height=Math.max(n-a.y,c.height),g||(b=a.height/a.width,p=b.y?(a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=n-a.y,g||(a.width=a.height/p,a.x= -k+.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),g||(a.width=a.height/p,a.x=k+.5*(m-k-a.width)));D.A(q);return a};Pj.prototype.computeReshape=function(){var a=Sj;this.zb instanceof z&&(a=Tj(this.zb));return!(a===Uj||a===Vj||null!==this.g&&this.g.U.shift)};Pj.prototype.computeMinSize=function(){var a=this.zb.hg.copy(),b=this.hg;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a}; -Pj.prototype.computeMaxSize=function(){var a=this.zb.kf.copy(),b=this.kf;!isNaN(b.width)&&b.widtha&&(a+=360));var b=Math.min(Math.abs(this.kK),180),c=Math.min(Math.abs(this.jK),b/2);(null===this.g||!this.g.U.shift)&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};D.defineProperty(Wj,{kK:"snapAngleMultiple"},function(){return this.YD},function(a){D.h(a,"number",Wj,"snapAngleMultiple");this.YD=a}); -D.defineProperty(Wj,{jK:"snapAngleEpsilon"},function(){return this.XD},function(a){D.h(a,"number",Wj,"snapAngleEpsilon");this.XD=a});D.w(Wj,{cM:"originalAngle"},function(){return this.zw});function Yj(){Sg.call(this);0e.right&&(c.x-=d.width+5);c.xe.bottom&&(c.y-=d.height+5);c.ya.U.Oe?!1:!0};jk.prototype.doStart=function(){this.wa||null===this.ih||this.doActivate()}; -jk.prototype.doActivate=function(){if(!this.wa){var a=this.g;if(null!==a){var b=this.ih;null===b&&(b=a.Ge(a.U.ha,function(a){return a instanceof na?a:null}));if(null!==b&&(this.ih=b,null!==b.Y)){this.wa=!0;this.$a=sk;var c=this.oI;null!==b.ZG&&(c=b.ZG);this.Ck=this.ih.copy();var d=new B(this.ih.eb(cc),this.ih.eb(rc));a.dK(d);if(c instanceof ak)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex="100";c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();"function"=== -typeof c.focus&&c.focus();"function"===typeof c.select&&this.Dy&&(c.select(),c.setSelectionRange(0,9999));a.Dj.appendChild(c)}this.Bj=c}}}};jk.prototype.doCancel=function(){null!==this.Ll&&this.Bj instanceof HTMLElement&&(this.Bj.style.border=this.Ll,this.Ll=null);this.stopTool()};jk.prototype.doMouseUp=function(){!this.wa&&this.canStart()&&this.doActivate()};jk.prototype.doMouseDown=function(){this.wa&&this.acceptText(ok)}; -jk.prototype.acceptText=function(a){switch(a){case ok:if(this.$a===wk)this.Bj instanceof HTMLElement&&this.Bj.focus();else if(this.$a===sk||this.$a===vk||this.$a===tk)this.$a=uk,zk(this);break;case nk:case qk:case pk:if(qk===a&&!0===this.eA.Xx)break;if(this.$a===sk||this.$a===vk||this.$a===tk)this.$a=uk,zk(this)}}; -function zk(a){var b=a.ih,c=a.g,d=a.Bj;if(null!==b&&null!==d){var e=b.text,g="";d instanceof ak?null!==d.YB&&(g=d.YB()):(g=d.value,g="function"===typeof g?g():g);a.isValidText(b,e,g)?(a.$b(a.name),a.$a=wk,d instanceof ak?d.show(b,c,a):null!==a.Ll&&(d.style.border=a.Ll,a.Ll=null),a.Pf=a.name,b.text=g,null!==b.YG&&b.YG(b,e,g),null!==c&&c.Ja("TextEdited",b,e),a.bl(),a.stopTool(),null!==c&&c.doFocus()):(a.$a=vk,null!==b.HA&&b.HA(a,e,g),d instanceof ak?d.show(b,c,a):(null===a.Ll&&(a.Ll=d.style.border, -d.style.border="3px solid red"),"function"===typeof d.focus&&d.focus()))}}jk.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.$a=lk;this.ih=null;if(null!==this.Bj){var b=this.Bj;if(b instanceof ak)b.Wn(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.Dj.removeChild(b)}}this.wa=!1}};jk.prototype.doFocus=function(){v&&D.Nn("TextEditingTool.doFocus","2.0");xk(this)};jk.prototype.doBlur=function(){v&&D.Nn("TextEditingTool.doBlur","2.0");yk(this)}; -function xk(a){if(null!==a.Bj){var b=a.lz;a.$a===sk&&(a.$a=tk);"function"===typeof b.select&&a.Dy&&(b.select(),b.setSelectionRange(0,9999))}}function yk(a){if(null!==a.Bj){var b=a.lz;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.Dy&&(b.select(),b.setSelectionRange(0,9999))}}jk.prototype.isValidText=function(a,b,c){D.l(a,na,jk,"isValidText:textblock");var d=this.NB;if(null!==d&&!d(a,b,c))return!1;d=a.NB;return null===d||d(a,b,c)?!0:!1}; -D.defineProperty(jk,{NB:"textValidation"},function(){return this.Ql},function(a){null!==a&&D.h(a,"function",jk,"textValidation");this.Ql=a});D.defineProperty(jk,{fG:"minimumEditorScale"},function(){return this.yD},function(a){null!==a&&D.h(a,"number",jk,"minimumEditorScale");this.yD=a});D.defineProperty(jk,{Dy:"selectsTextOnActivate"},function(){return this.VD},function(a){null!==a&&D.h(a,"boolean",jk,"selectsTextOnActivate");this.VD=a}); -D.defineProperty(jk,{state:"state"},function(){return this.$a},function(a){this.$a!==a&&(D.Ca(a,jk,jk,"starting"),this.$a=a)});jk.prototype.measureTemporaryTextBlock=jk.prototype.CJ=function(a){var b=this.Ck;b.text=a;Ak(b,this.ih.tp,Infinity);return b};function Hh(){Sg.call(this);this.name="ToolManager";this.uH=new K(Sg);this.vH=new K(Sg);this.wH=new K(Sg);this.cD=this.dD=850;this.RC=(new Ca(2,2)).Na();this.nE=5E3;this.CD=Th;this.aD=Bk;this.Jv=this.FC=null;this.xn=-1}D.Sa(Hh,Sg); -D.ja("ToolManager",Hh);var Th;Hh.WheelScroll=Th=D.s(Hh,"WheelScroll",0);var Sh;Hh.WheelZoom=Sh=D.s(Hh,"WheelZoom",1);Hh.WheelNone=D.s(Hh,"WheelNone",2);var Bk;Hh.GestureZoom=Bk=D.s(Hh,"GestureZoom",3);var Ck;Hh.GestureCancel=Ck=D.s(Hh,"GestureCancel",4);var Dk;Hh.GestureNone=Dk=D.s(Hh,"GestureNone",5);D.defineProperty(Hh,{Ku:"mouseWheelBehavior"},function(){return this.CD},function(a){D.Ca(a,Hh,Hh,"mouseWheelBehavior");this.CD=a}); -D.defineProperty(Hh,{rq:"gestureBehavior"},function(){return this.aD},function(a){D.Ca(a,Hh,Hh,"gestureBehavior");this.aD=a});Hh.prototype.initializeStandardTools=function(){this.GH=new Zj;this.rG=new Xh;this.uJ=new xj;this.EG=new Pj;this.aK=new Wj;this.bG=new ra;this.De=new Mh;this.sI=new hk;this.PJ=new ik;this.vA=new ck;this.MB=new jk;this.XH=new ta;this.YH=new Yj}; -Hh.prototype.updateAdornments=function(a){var b=this.em;if(b instanceof da&&this.Jv===a){var c=b.zb;(null!==a?c.Y===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; -Hh.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.U;b.Lj&&this.rq===Ck&&(b.bubbles=!1);if(b.yu){this.cancelWaitAfter();if(this.rq===Dk){b.bubbles=!0;return}if(this.rq===Ck)return;if(a.gb.canStartMultiTouch()){a.gb.standardPinchZoomStart();return}}var c=a.ra;c.rA&&0!==c.Vh&&D.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.lf.length,d=0;de.right&&(c.x-=d.width+5);c.xe.bottom?c.y-(d.height+5):c.y+20;c.ya?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}D.w(dh,{ZK:"animationReasons"},function(){return this.vv}); -dh.prototype.canStart=function(){return!0};dh.prototype.prepareAutomaticAnimation=dh.prototype.oo=function(a){this.mf&&(this.ok||this.ba.Zn)&&(this.vv.add(a),this.canStart(a)&&(this.nk&&this.Ii(),this.vc=!0))};function $k(a){if(a.mf&&(a.vv.clear(),a.vc))if(!a.Ho)a.vc=!1;else if(0===a.Go){var b=+new Date;a.Go=b;requestAnimationFrame(function(){if(!1!==a.vc&&!a.nk&&a.Go===b){var c=a.ba;c.Gj("temporaryPixelRatio")&&(c.Bk=1);al(c);a.vc=!1;c.Ja("AnimationStarting");bl(a,b)}})}} -function cl(a,b,c,d,e,g){if(a.vc&&(v&&D.l(b,P,dh,"addPropToAnimation:obj"),!("position"===c&&d.O(e)||b instanceof F&&!b.KF))){var h=a.gn;if(h.contains(b)){var h=h.oa(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=dl(d));h.wx&&void 0!==l[c]?h.fu[c]=dl(e):(g||(h.fu[c]=dl(e)),l[c]=dl(e));g&&0===c.indexOf("position:")&&b instanceof F&&(h.fu.location=dl(b.location))}else k=new la,l=new la,k[c]=dl(d),l[c]=dl(e),d=l,e=k.position,e instanceof O&&!e.F()&&a.vv.contains("Expand SubGraph")&&e.assign(d.position),k= -new Zk(k,l,g),g&&0===c.indexOf("position:")&&b instanceof F&&(k.fu.location=dl(b.location)),h.add(b,k);a.Ho=!0}}function dl(a){return a instanceof O?a.copy():a instanceof Ca?a.copy():a} -function bl(a,b){var c;function d(){if(!1!==g.nk&&g.Go===b){var a=+new Date,c=a>s?m:a-r;el(g);fl(g,e,q,h,c,m);g.Gv&&g.Gv();Vi(e);gl(g);a>s?hl(g):requestAnimationFrame(d)}}void 0===c&&(c=new la);var e=a.ba;if(null!==e){a.nk=!0;var g=a,h=c.BL||a.GC,k=c.aM||null,l=c.bM||null,m=c.duration||a.sz,n=a.xH;for(c=a.gn.j;c.next();){var p=c.value.start.position;p instanceof O&&(p.F()||p.assign(n))}a.BC=h;a.Gv=k;a.Hv=l;a.AC=m;a.Iv=a.gn;var q=a.Iv;for(c=q.j;c.next();)k=c.value.end,k["position:placeholder"]&&(l= -k["position:placeholder"],n=l.eb(cc),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n);el(a);fl(a,e,q,h,0,m);Vi(a.ba);gl(a);var r=+new Date,s=r+m;g.Go===b&&requestAnimationFrame(function(){d()})}}function el(a){if(!a.op){var b=a.ba;a.rE=b.Eb;a.oC=b.Ue;a.pC=b.cv;b.Eb=!0;b.Ue=!0;b.cv=!0;a.op=!0}}function gl(a){var b=a.ba;b.Eb=a.rE;b.Ue=a.oC;b.cv=a.pC;a.op=!1} -function fl(a,b,c,d,e,g){for(c=c.j;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==il[m])il[m](h,l[m],k[m],d,e,g)}d=b.YA;b.YA=!0;m=a.GC;0!==a.Kr&&0!==a.Jr&&(c=a.Kr,b.Bb=m(e,c,a.Jr-c,g));null!==a.Ir&&null!==a.Hr&&(c=a.Ir,a=a.Hr,b.qb=new O(m(e,c.x,a.x-c.x,g),m(e,c.y,a.y-c.y,g)));b.YA=d} -dh.prototype.stopAnimation=dh.prototype.Ii=function(){!0===this.vc&&(this.vc=!1,this.Ho&&this.ba.Se());this.nk&&this.mf&&hl(this)}; -function hl(a){a.nk=!1;a.Ho=!1;el(a);for(var b=a.ba,c=a.BC,d=a.AC,e=a.Iv.j;e.next();){var g=e.key,h=e.value,k=h.start,l=h.end,m=h.fu,n;for(n in l)if(void 0!==il[n]){var p=n;!h.wx||"position:node"!==p&&"position:placeholder"!==p||(p="position");il[p](g,k[n],void 0!==m[n]?m[n]:h.wx?k[n]:l[n],c,d,d)}h.wx&&void 0!==m.location&&g instanceof F&&(g.location=m.location);h.vy&&g instanceof F&&g.Hd(!1)}for(c=a.ba.links;c.next();)d=c.value,null!==d.Jp&&(d.points=d.Jp,d.Jp=null);b.hy.clear();b.Bk=null;b.yc(); -b.qa();b.gg();jl(b);gl(a);a.Hv&&a.Hv();a.Go=0;a.Iv=null;a.Hv=null;a.Gv=null;a.Ir=null;a.Hr=null;a.Kr=0;a.Jr=0;a.gn=new ma(P,Zk);b.Ja("AnimationFinished");b.Se()} -function kl(a,b,c){var d=b.$,e=c.$,g=null;c instanceof I&&(g=c.placeholder);null!==g?(d=g.eb(cc),d.x+=g.padding.left,d.y+=g.padding.top,cl(a,b,"position",d,b.position,!1)):cl(a,b,"position",new O(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);cl(a,b,"scale",.01,b.scale,!1);if(b instanceof I)for(b=b.Mc;b.next();)g=b.value,g instanceof G&&kl(a,g,c)} -function ll(a,b,c){if(b.isVisible()){var d=null;c instanceof I&&(d=c.placeholder);null!==d?cl(a,b,"position:placeholder",b.position,d,!0):cl(a,b,"position:node",b.position,c,!0);cl(a,b,"scale",b.scale,.01,!0);a.vc&&(d=a.gn,d.contains(b)&&(d.oa(b).vy=!0));if(b instanceof I)for(b=b.Mc;b.next();)d=b.value,d instanceof G&&ll(a,d,c)}}function ml(a,b,c){a.vc&&(null===a.Ir&&b.F()&&null===a.Hr&&(a.Ir=b.copy()),a.Hr=c.copy(),a.Ho=!0)} -function nl(a,b,c){a.vc&&a.ba.Zn&&(0===a.Kr&&0===a.Jr&&(a.Kr=b),a.Jr=c,a.Ho=!0)}D.defineProperty(dh,{isEnabled:"isEnabled"},function(){return this.mf},function(a){D.h(a,"boolean",dh,"isEnabled");this.mf=a});D.defineProperty(dh,{duration:"duration"},function(){return this.sz},function(a){D.h(a,"number",dh,"duration");1>a&&D.ua(a,">= 1",dh,"duration");this.sz=a});D.w(dh,{sf:"isAnimating"},function(){return this.nk});D.w(dh,{lJ:"isTicking"},function(){return this.op}); -D.defineProperty(dh,{SF:"isInitial"},function(){return this.ok},function(a){D.h(a,"boolean",dh,"isInitial");this.ok=a});function Zk(a,b,c){this.start=a;this.end=b;this.fu=new la;this.wx=c;this.vy=!1} -var il={opacity:function(a,b,c,d,e,g){a.opacity=d(e,b,c-b,g)},position:function(a,b,c,d,e,g){e!==g?a.Hy(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):a.position=new O(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},"position:node":function(a,b,c,d,e,g){var h=a.$,k=c.$;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==g?a.Hy(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g)):a.position=new O(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g))},"position:placeholder":function(a,b,c,d,e,g){e!==g?a.Hy(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)): -a.position=new O(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},scale:function(a,b,c,d,e,g){a.scale=d(e,b,c-b,g)},visible:function(a,b,c,d,e,g){a.visible=e!==g?b:c}};function Rg(){0=a)return b;for(var c=0,d=0,e=0,g=0,h=0,k=this.pb.j;k.next();){var l=k.value;l instanceof I?e++:l instanceof G?d++:l instanceof J?g++:l instanceof da?h++:c++}k="";0a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a}; +Uj.prototype.computeMaxSize=function(){var a=this.zb.kf.copy(),b=this.kf;!isNaN(b.width)&&b.widtha&&(a+=360));var b=Math.min(Math.abs(this.nK),180),c=Math.min(Math.abs(this.mK),b/2);(null===this.g||!this.g.U.shift)&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};D.defineProperty(bk,{nK:"snapAngleMultiple"},function(){return this.aE},function(a){D.h(a,"number",bk,"snapAngleMultiple");this.aE=a}); +D.defineProperty(bk,{mK:"snapAngleEpsilon"},function(){return this.$D},function(a){D.h(a,"number",bk,"snapAngleEpsilon");this.$D=a});D.w(bk,{fM:"originalAngle"},function(){return this.yw});function dk(){Vg.call(this);0e.right&&(c.x-=d.width+5);c.xe.bottom&&(c.y-=d.height+5);c.ya.U.Oe?!1:!0};ok.prototype.doStart=function(){this.wa||null===this.ih||this.doActivate()}; +ok.prototype.doActivate=function(){if(!this.wa){var a=this.g;if(null!==a){var b=this.ih;null===b&&(b=a.Ge(a.U.ha,function(a){return a instanceof na?a:null}));if(null!==b&&(this.ih=b,null!==b.Y)){this.wa=!0;this.$a=xk;var c=this.rI;null!==b.bH&&(c=b.bH);this.Ck=this.ih.copy();var d=new B(this.ih.eb(dc),this.ih.eb(uc));a.gK(d);if(c instanceof fk)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex="100";c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();"function"=== +typeof c.focus&&c.focus();"function"===typeof c.select&&this.Cy&&(c.select(),c.setSelectionRange(0,9999));a.Ej.appendChild(c)}this.Cj=c}}}};ok.prototype.doCancel=function(){null!==this.Nl&&this.Cj instanceof HTMLElement&&(this.Cj.style.border=this.Nl,this.Nl=null);this.stopTool()};ok.prototype.doMouseUp=function(){!this.wa&&this.canStart()&&this.doActivate()};ok.prototype.doMouseDown=function(){this.wa&&this.acceptText(tk)}; +ok.prototype.acceptText=function(a){switch(a){case tk:if(this.$a===Bk)this.Cj instanceof HTMLElement&&this.Cj.focus();else if(this.$a===xk||this.$a===Ak||this.$a===yk)this.$a=zk,Ek(this);break;case sk:case vk:case uk:if(vk===a&&!0===this.gA.Wx)break;if(this.$a===xk||this.$a===Ak||this.$a===yk)this.$a=zk,Ek(this)}}; +function Ek(a){var b=a.ih,c=a.g,d=a.Cj;if(null!==b&&null!==d){var e=b.text,g="";d instanceof fk?null!==d.bC&&(g=d.bC()):(g=d.value,g="function"===typeof g?g():g);a.isValidText(b,e,g)?(a.ac(a.name),a.$a=Bk,d instanceof fk?d.show(b,c,a):null!==a.Nl&&(d.style.border=a.Nl,a.Nl=null),a.Qf=a.name,b.text=g,null!==b.aH&&b.aH(b,e,g),null!==c&&c.Ja("TextEdited",b,e),a.dl(),a.stopTool(),null!==c&&c.doFocus()):(a.$a=Ak,null!==b.JA&&b.JA(a,e,g),d instanceof fk?d.show(b,c,a):(null===a.Nl&&(a.Nl=d.style.border, +d.style.border="3px solid red"),"function"===typeof d.focus&&d.focus()))}}ok.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.$a=qk;this.ih=null;if(null!==this.Cj){var b=this.Cj;if(b instanceof fk)b.Yn(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.Ej.removeChild(b)}}this.wa=!1}};ok.prototype.doFocus=function(){v&&D.Pn("TextEditingTool.doFocus","2.0");Ck(this)};ok.prototype.doBlur=function(){v&&D.Pn("TextEditingTool.doBlur","2.0");Dk(this)}; +function Ck(a){if(null!==a.Cj){var b=a.kz;a.$a===xk&&(a.$a=yk);"function"===typeof b.select&&a.Cy&&(b.select(),b.setSelectionRange(0,9999))}}function Dk(a){if(null!==a.Cj){var b=a.kz;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.Cy&&(b.select(),b.setSelectionRange(0,9999))}}ok.prototype.isValidText=function(a,b,c){D.l(a,na,ok,"isValidText:textblock");var d=this.RB;if(null!==d&&!d(a,b,c))return!1;d=a.RB;return null===d||d(a,b,c)?!0:!1}; +D.defineProperty(ok,{RB:"textValidation"},function(){return this.Sl},function(a){null!==a&&D.h(a,"function",ok,"textValidation");this.Sl=a});D.defineProperty(ok,{iG:"minimumEditorScale"},function(){return this.BD},function(a){null!==a&&D.h(a,"number",ok,"minimumEditorScale");this.BD=a});D.defineProperty(ok,{Cy:"selectsTextOnActivate"},function(){return this.YD},function(a){null!==a&&D.h(a,"boolean",ok,"selectsTextOnActivate");this.YD=a}); +D.defineProperty(ok,{state:"state"},function(){return this.$a},function(a){this.$a!==a&&(D.Da(a,ok,ok,"starting"),this.$a=a)});ok.prototype.measureTemporaryTextBlock=ok.prototype.FJ=function(a){var b=this.Ck;b.text=a;Fk(b,this.ih.wp,Infinity);return b};function Lh(){Vg.call(this);this.name="ToolManager";this.xH=new K(Vg);this.yH=new K(Vg);this.zH=new K(Vg);this.fD=this.gD=850;this.VC=(new Ca(2,2)).Na();this.qE=5E3;this.FD=Wh;this.dD=Gk;this.Iv=this.JC=null;this.xn=-1}D.Sa(Lh,Vg); +D.ja("ToolManager",Lh);var Wh;Lh.WheelScroll=Wh=D.s(Lh,"WheelScroll",0);var Vh;Lh.WheelZoom=Vh=D.s(Lh,"WheelZoom",1);Lh.WheelNone=D.s(Lh,"WheelNone",2);var Gk;Lh.GestureZoom=Gk=D.s(Lh,"GestureZoom",3);var Hk;Lh.GestureCancel=Hk=D.s(Lh,"GestureCancel",4);var Ik;Lh.GestureNone=Ik=D.s(Lh,"GestureNone",5);D.defineProperty(Lh,{Ju:"mouseWheelBehavior"},function(){return this.FD},function(a){D.Da(a,Lh,Lh,"mouseWheelBehavior");this.FD=a}); +D.defineProperty(Lh,{qq:"gestureBehavior"},function(){return this.dD},function(a){D.Da(a,Lh,Lh,"gestureBehavior");this.dD=a});Lh.prototype.initializeStandardTools=function(){this.JH=new ek;this.uG=new ai;this.xJ=new Cj;this.HG=new Uj;this.dK=new bk;this.eG=new ra;this.De=new Qh;this.vI=new mk;this.SJ=new nk;this.xA=new hk;this.QB=new ok;this.$H=new ta;this.aI=new dk}; +Lh.prototype.updateAdornments=function(a){var b=this.fm;if(b instanceof da&&this.Iv===a){var c=b.zb;(null!==a?c.Y===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; +Lh.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.U;b.Mj&&this.qq===Hk&&(b.bubbles=!1);if(b.xu){this.cancelWaitAfter();if(this.qq===Ik){b.bubbles=!0;return}if(this.qq===Hk)return;if(a.gb.canStartMultiTouch()){a.gb.standardPinchZoomStart();return}}var c=a.ra;c.tA&&0!==c.Wh&&D.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.lf.length,d=0;de.right&&(c.x-=d.width+5);c.xe.bottom?c.y-(d.height+5):c.y+20;c.ya?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}D.w(gh,{bL:"animationReasons"},function(){return this.uv}); +gh.prototype.canStart=function(){return!0};gh.prototype.prepareAutomaticAnimation=gh.prototype.qo=function(a){this.mf&&(this.ok||this.ba.ao)&&(this.uv.add(a),this.canStart(a)&&(this.nk&&this.Ii(),this.wc=!0))};function cl(a){if(a.mf&&(a.uv.clear(),a.wc))if(!a.Jo)a.wc=!1;else if(0===a.Io){var b=+new Date;a.Io=b;requestAnimationFrame(function(){if(!1!==a.wc&&!a.nk&&a.Io===b){var c=a.ba;c.Hj("temporaryPixelRatio")&&(c.Bk=1);dl(c);a.wc=!1;c.Ja("AnimationStarting");el(a,b)}})}} +function fl(a,b,c,d,e,g){if(a.wc&&(v&&D.l(b,P,gh,"addPropToAnimation:obj"),!("position"===c&&d.P(e)||b instanceof F&&!b.NF))){var h=a.gn;if(h.contains(b)){var h=h.na(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=gl(d));h.vx&&void 0!==l[c]?h.eu[c]=gl(e):(g||(h.eu[c]=gl(e)),l[c]=gl(e));g&&0===c.indexOf("position:")&&b instanceof F&&(h.eu.location=gl(b.location))}else k=new la,l=new la,k[c]=gl(d),l[c]=gl(e),d=l,e=k.position,e instanceof O&&!e.F()&&a.uv.contains("Expand SubGraph")&&e.assign(d.position),k= +new bl(k,l,g),g&&0===c.indexOf("position:")&&b instanceof F&&(k.eu.location=gl(b.location)),h.add(b,k);a.Jo=!0}}function gl(a){return a instanceof O?a.copy():a instanceof Ca?a.copy():a} +function el(a,b){var c;function d(){if(!1!==g.nk&&g.Io===b){var a=+new Date,c=a>s?m:a-r;hl(g);il(g,e,q,h,c,m);g.Fv&&g.Fv();bj(e);jl(g);a>s?kl(g):requestAnimationFrame(d)}}void 0===c&&(c=new la);var e=a.ba;if(null!==e){a.nk=!0;var g=a,h=c.EL||a.KC,k=c.dM||null,l=c.eM||null,m=c.duration||a.sz,n=a.AH;for(c=a.gn.j;c.next();){var p=c.value.start.position;p instanceof O&&(p.F()||p.assign(n))}a.FC=h;a.Fv=k;a.Gv=l;a.EC=m;a.Hv=a.gn;var q=a.Hv;for(c=q.j;c.next();)k=c.value.end,k["position:placeholder"]&&(l= +k["position:placeholder"],n=l.eb(dc),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n);hl(a);il(a,e,q,h,0,m);bj(a.ba);jl(a);var r=+new Date,s=r+m;g.Io===b&&requestAnimationFrame(function(){d()})}}function hl(a){if(!a.qp){var b=a.ba;a.uE=b.Eb;a.sC=b.Ue;a.tC=b.bv;b.Eb=!0;b.Ue=!0;b.bv=!0;a.qp=!0}}function jl(a){var b=a.ba;b.Eb=a.uE;b.Ue=a.sC;b.bv=a.tC;a.qp=!1} +function il(a,b,c,d,e,g){for(c=c.j;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==ll[m])ll[m](h,l[m],k[m],d,e,g)}d=b.aB;b.aB=!0;m=a.KC;0!==a.Jr&&0!==a.Ir&&(c=a.Jr,b.Bb=m(e,c,a.Ir-c,g));null!==a.Hr&&null!==a.Gr&&(c=a.Hr,a=a.Gr,b.rb=new O(m(e,c.x,a.x-c.x,g),m(e,c.y,a.y-c.y,g)));b.aB=d} +gh.prototype.stopAnimation=gh.prototype.Ii=function(){!0===this.wc&&(this.wc=!1,this.Jo&&this.ba.Se());this.nk&&this.mf&&kl(this)}; +function kl(a){a.nk=!1;a.Jo=!1;hl(a);for(var b=a.ba,c=a.FC,d=a.EC,e=a.Hv.j;e.next();){var g=e.key,h=e.value,k=h.start,l=h.end,m=h.eu,n;for(n in l)if(void 0!==ll[n]){var p=n;!h.vx||"position:node"!==p&&"position:placeholder"!==p||(p="position");ll[p](g,k[n],void 0!==m[n]?m[n]:h.vx?k[n]:l[n],c,d,d)}h.vx&&void 0!==m.location&&g instanceof F&&(g.location=m.location);h.uy&&g instanceof F&&g.Jd(!1)}for(c=a.ba.links;c.next();)d=c.value,null!==d.Kp&&(d.points=d.Kp,d.Kp=null);b.gy.clear();b.Bk=null;b.zc(); +b.qa();b.hg();ml(b);jl(a);a.Gv&&a.Gv();a.Io=0;a.Hv=null;a.Gv=null;a.Fv=null;a.Hr=null;a.Gr=null;a.Jr=0;a.Ir=0;a.gn=new ma(P,bl);b.Ja("AnimationFinished");b.Se()} +function nl(a,b,c){var d=b.$,e=c.$,g=null;c instanceof I&&(g=c.placeholder);null!==g?(d=g.eb(dc),d.x+=g.padding.left,d.y+=g.padding.top,fl(a,b,"position",d,b.position,!1)):fl(a,b,"position",new O(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);fl(a,b,"scale",.01,b.scale,!1);if(b instanceof I)for(b=b.Nc;b.next();)g=b.value,g instanceof G&&nl(a,g,c)} +function ol(a,b,c){if(b.isVisible()){var d=null;c instanceof I&&(d=c.placeholder);null!==d?fl(a,b,"position:placeholder",b.position,d,!0):fl(a,b,"position:node",b.position,c,!0);fl(a,b,"scale",b.scale,.01,!0);a.wc&&(d=a.gn,d.contains(b)&&(d.na(b).uy=!0));if(b instanceof I)for(b=b.Nc;b.next();)d=b.value,d instanceof G&&ol(a,d,c)}}function pl(a,b,c){a.wc&&(null===a.Hr&&b.F()&&null===a.Gr&&(a.Hr=b.copy()),a.Gr=c.copy(),a.Jo=!0)} +function ql(a,b,c){a.wc&&a.ba.ao&&(0===a.Jr&&0===a.Ir&&(a.Jr=b),a.Ir=c,a.Jo=!0)}D.defineProperty(gh,{isEnabled:"isEnabled"},function(){return this.mf},function(a){D.h(a,"boolean",gh,"isEnabled");this.mf=a});D.defineProperty(gh,{duration:"duration"},function(){return this.sz},function(a){D.h(a,"number",gh,"duration");1>a&&D.ua(a,">= 1",gh,"duration");this.sz=a});D.w(gh,{sf:"isAnimating"},function(){return this.nk});D.w(gh,{oJ:"isTicking"},function(){return this.qp}); +D.defineProperty(gh,{VF:"isInitial"},function(){return this.ok},function(a){D.h(a,"boolean",gh,"isInitial");this.ok=a});function bl(a,b,c){this.start=a;this.end=b;this.eu=new la;this.vx=c;this.uy=!1} +var ll={opacity:function(a,b,c,d,e,g){a.opacity=d(e,b,c-b,g)},position:function(a,b,c,d,e,g){e!==g?a.Gy(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):a.position=new O(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},"position:node":function(a,b,c,d,e,g){var h=a.$,k=c.$;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==g?a.Gy(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g)):a.position=new O(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g))},"position:placeholder":function(a,b,c,d,e,g){e!==g?a.Gy(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)): +a.position=new O(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},scale:function(a,b,c,d,e,g){a.scale=d(e,b,c-b,g)},visible:function(a,b,c,d,e,g){a.visible=e!==g?b:c}};function Ug(){0=a)return b;for(var c=0,d=0,e=0,g=0,h=0,k=this.qb.j;k.next();){var l=k.value;l instanceof I?e++:l instanceof G?d++:l instanceof J?g++:l instanceof da?h++:c++}k="";0=d.count)a=d.count;else if(d.ea(a)===b)return-1;d.Xd(a,b);b.ru(c);d=this.g;null!==d&&(c?d.qa():d.uq(b));tl(this,a,b);return a}; -f.rf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.rf(a,b,c);var d=this.pb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.ea(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.su(c);d.jd(a);d=this.g;null!==d&&(c?d.qa():d.rf(b));b.kw=null;return a}; -function tl(a,b,c){b=ul(a,b,c);if(c instanceof I&&null!==c&&isNaN(c.Bo)){if(0!==c.Mc.count){for(var d=-1,e=a.pb.o,g=e.length,h=0;hd&&k.Pa===c&&(d=h,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var g=b-1,h=NaN;0<=g;){h=a.ea(g).Bo;if(!isNaN(h))break;g--}for(var k=b+1,l=NaN;kd)for(;;){if(-1===g||h<=d){g++;if(g===b)break;a.jd(b);a.Xd(g,c);return g}for(h=NaN;0<=--g&&(h=a.ea(g).Bo,isNaN(h)););}else if(!isNaN(l)&&l=d){k--;if(k===b)break;a.jd(b);a.Xd(k,c);return k}for(l=NaN;++ka||1parseInt(e[1],10)&&(D.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+ -D.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),D.Bx.licenseKey=!0);this.Dl=1;this.Ym=0;this.tD=new O;this.pE=500;this.xv=new O;this.ut=null;this.Al=!1;this.preventDefault=this.uy=this.nG=this.oG=this.mG=this.ko=this.Zg=this.lo=this.io=this.jo=this.$B=this.QB=this.RB=this.SB=this.Ol=this.ht=this.Nl=this.gt=null;this.xl=new Hl;void 0!==a&&Il(this,a);this.fw=!1;this.DD=1;this.Zc=!1}D.ja("Diagram",E); -E.prototype.clear=E.prototype.clear=function(){var a=null;null!==this.zd&&(a=this.zd.Y);this.ga.clear();for(var b=this.bc.length,c=0;c=d.count)a=d.count;else if(d.ea(a)===b)return-1;d.Xd(a,b);b.qu(c);d=this.g;null!==d&&(c?d.qa():d.tq(b));wl(this,a,b);return a}; +f.rf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.rf(a,b,c);var d=this.qb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.ea(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.ru(c);d.jd(a);d=this.g;null!==d&&(c?d.qa():d.rf(b));b.kw=null;return a}; +function wl(a,b,c){b=xl(a,b,c);if(c instanceof I&&null!==c&&isNaN(c.Do)){if(0!==c.Nc.count){for(var d=-1,e=a.qb.o,g=e.length,h=0;hd&&k.Pa===c&&(d=h,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var g=b-1,h=NaN;0<=g;){h=a.ea(g).Do;if(!isNaN(h))break;g--}for(var k=b+1,l=NaN;kd)for(;;){if(-1===g||h<=d){g++;if(g===b)break;a.jd(b);a.Xd(g,c);return g}for(h=NaN;0<=--g&&(h=a.ea(g).Do,isNaN(h)););}else if(!isNaN(l)&&l=d){k--;if(k===b)break;a.jd(b);a.Xd(k,c);return k}for(l=NaN;++ka||1parseInt(e[1],10)&&(D.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+ +D.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),D.Ax.licenseKey=!0);this.Fl=1;this.Ym=0;this.wD=new O;this.sE=500;this.wv=new O;this.ut=null;this.Cl=!1;this.preventDefault=this.ty=this.qG=this.rG=this.pG=this.mo=this.$g=this.no=this.ko=this.lo=this.dC=this.UB=this.VB=this.WB=this.Ql=this.ht=this.Pl=this.gt=null;this.zl=new Kl;void 0!==a&&Ll(this,a);this.ew=!1;this.GD=1;this.$c=!1}D.ja("Diagram",E); +E.prototype.clear=E.prototype.clear=function(){var a=null;null!==this.Ad&&(a=this.Ad.Y);this.ga.clear();for(var b=this.cc.length,c=0;c=a)return b;for(var c=this.bc.j;c.next();)b+="\n "+c.value.toString(a-1);return b};E.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.ba instanceof E?b.ba:null}; -D.defineProperty(E,{Dj:"div"},function(){return this.Sb},function(a){null!==a&&D.l(a,HTMLDivElement,E,"div");if(this.Sb!==a){wl=[];var b=this.Sb;null!==b?(b.ba=void 0,b.innerHTML="",null!==this.Lb&&(this.Lb.removeEventListener("touchstart",this.SB,!1),this.Lb.removeEventListener("touchmove",this.RB,!1),this.Lb.removeEventListener("touchend",this.QB,!1),this.Lb.Ud.ba=null),b=this.kb,null!==b&&(b.lf.each(function(a){a.cancelWaitAfter()}),b.ig.each(function(a){a.cancelWaitAfter()}),b.jg.each(function(a){a.cancelWaitAfter()})), -b.cancelWaitAfter(),this.gb.doCancel(),this.md=this.Lb=null,window.removeEventListener("resize",this.$B,!1),window.removeEventListener("mousemove",this.jo,!0),window.removeEventListener("mousedown",this.io,!0),window.removeEventListener("mouseup",this.lo,!0),window.removeEventListener("mousewheel",this.Zg,!0),window.removeEventListener("DOMMouseScroll",this.Zg,!0),window.removeEventListener("mouseout",this.ko,!0)):this.th=!1;this.Sb=null;if(null!==a){if(b=a.ba)b.Dj=null;Il(this,a);this.Hq()}}}); -function Ll(a){var b=a.Lb;b.addEventListener("touchstart",a.SB,!1);b.addEventListener("touchmove",a.RB,!1);b.addEventListener("touchend",a.QB,!1);b.addEventListener("mousemove",a.jo,!1);b.addEventListener("mousedown",a.io,!1);b.addEventListener("mouseup",a.lo,!1);b.addEventListener("mousewheel",a.Zg,!1);b.addEventListener("DOMMouseScroll",a.Zg,!1);b.addEventListener("mouseout",a.ko,!1);b.addEventListener("keydown",a.nJ,!1);b.addEventListener("keyup",a.oJ,!1);b.addEventListener("selectstart",function(a){a.preventDefault(); -return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.kb.rq===Ck&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.mG,!1);b.addEventListener("pointermove",a.oG,!1);b.addEventListener("pointerleave",a.nG,!1);window.addEventListener("resize",a.$B,!1)}E.prototype.computePixelRatio=function(){return null!==this.Bk?this.Bk:this.DD};E.prototype.doMouseMove=function(){this.gb.doMouseMove()}; -E.prototype.doMouseDown=function(){this.gb.doMouseDown()};E.prototype.doMouseUp=function(){this.gb.doMouseUp()};E.prototype.doMouseWheel=function(){this.gb.doMouseWheel()};E.prototype.doKeyDown=function(){this.gb.doKeyDown()};E.prototype.doKeyUp=function(){this.gb.doKeyUp()};E.prototype.doFocus=function(){this.focus()};E.prototype.focus=E.prototype.focus=function(){this.Lb&&this.Lb.focus()}; -function al(a){if(null!==a.Lb){var b=a.Sb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.wl?a.Rd:0,d=a.lk?a.Rd:0,e=a.od;a.od=a.computePixelRatio();a.od!==e&&(a.ds=!0,a.Se());if(b.clientWidth!==a.Ob+c||b.clientHeight!==a.Rb+d)a.Sm=!0,a.Me=!0,b=a.Vb,null!==b&&b.Zx&&a.am===Nh&&b.N(),a.ge||a.Se()}}} -function Fl(a){var b=new Rg;b.name="Background";a.Pt(b);b=new Rg;b.name="";a.Pt(b);b=new Rg;b.name="Foreground";a.Pt(b);b=new Rg;b.name="Adornment";b.Tc=!0;a.Pt(b);b=new Rg;b.name="Tool";b.Tc=!0;b.LF=!0;a.Pt(b);b=new Rg;b.name="Grid";b.Bf=!1;b.pg=!1;b.Tc=!0;a.LH(b,a.jm("Background"))} -function Ml(a){a.zd=new x(Nl);a.zd.name="GRID";var b=new z;b.Jb="LineH";b.stroke="lightgray";b.jb=.5;b.interval=1;a.zd.add(b);b=new z;b.Jb="LineH";b.stroke="gray";b.jb=.5;b.interval=5;a.zd.add(b);b=new z;b.Jb="LineH";b.stroke="gray";b.jb=1;b.interval=10;a.zd.add(b);b=new z;b.Jb="LineV";b.stroke="lightgray";b.jb=.5;b.interval=1;a.zd.add(b);b=new z;b.Jb="LineV";b.stroke="gray";b.jb=.5;b.interval=5;a.zd.add(b);b=new z;b.Jb="LineV";b.stroke="gray";b.jb=1;b.interval=10;a.zd.add(b);b=new F;b.add(a.zd); -b.Jf="Grid";b.Bo=0;b.Ux=!1;b.KF=!1;b.pg=!1;b.iy="GRID";a.add(b);a.pb.remove(b);a.zd.visible=!1}function Ol(){this.ba.isEnabled?this.ba.rI(this):Pl(this.ba)}function Ql(a){this.ba.isEnabled?(this.ba.Xz=!0,this.ba.Zz=a.target.scrollTop,this.ba.Yz=a.target.scrollLeft):Pl(this.ba)} -E.prototype.diagramScroll=E.prototype.rI=function(a){if(this.Xz&&null!==this.Lb){this.Kw=!0;var b=this.cd,c=this.xb,d=b.width,e=c.width,g=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=this.scale,s;s=a.scrollLeft;if(this.hs)switch(this.Vz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;el&&(this.position=s.m(-(this.Ow.scrollWidth-this.Ob)+u-this.Ob/r+k,this.position.y))),a.AH&&this.ze&&(bn&&(this.position=s.m(this.position.x,-(this.Ow.scrollHeight-this.Rb)+a.scrollTop-this.Rb/r+m))),D.A(s),Rl(this),this.Sm=this.Kw=!1,b=this.cd,c=this.xb,k=b.right,l=c.right, -m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(this.lt.style.width="1px"),h>=g&&b>=c&&m<=n&&(this.lt.style.height="1px"))}};E.prototype.computeBounds=E.prototype.Kh=function(){0c&&(e=c),ea.Ph&&(e=a.Ph),e):b===Yl?(e=l>k?(h-a.Rd)/d:(g-a.Rd)/e,e>c&&(e=c),ea.Ph&&(e=a.Ph),e):a.scale}E.prototype.zoomToFit=E.prototype.zoomToFit=function(){this.scale=Ul(this,Xl)}; -E.prototype.zoomToRect=function(a,b){void 0===b&&(b=Xl);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Xl||b===Yl)if(isNaN(c))e=this.xb.height*this.scale/d;else if(isNaN(d))e=this.xb.width*this.scale/c;else var e=this.Ob,g=this.Rb,e=b===Yl?g/d>e/c?(g-(this.lk?this.Rd:0))/d:(e-(this.wl?this.Rd:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new O(a.x,a.y)}};D.defineProperty(E,{YA:null},function(){return this.Zc},function(a){this.Zc=a}); -E.prototype.alignDocument=function(a,b){this.mk&&Wl(this,this.Kh());var c=this.cd,d=this.xb;this.position=new O(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))}; -function Vl(a,b,c,d,e,g,h){var k=b.x,l=b.y;if(h||a.yB===xl)g.fd()&&(d>c.width&&(k=c.x+(g.x*c.width+g.offsetX)-(g.x*d-g.offsetX)),e>c.height&&(l=c.y+(g.y*c.height+g.offsetY)-(g.y*e-g.offsetY))),g=a.IG,h=d-c.width,dc.left?k=c.left:kc.top?l=c.top:lc.touches.length)&&c.preventDefault();c.cancelBubble=!0;return!1} -E.prototype.nJ=function(a){if(!this.ba.isEnabled)return!1;var b=this.ba.Tb;Zl(this.ba,this.ba,a,b,!1);b.key=String.fromCharCode(a.which);b.im=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:case 61:case 107:b.key= +E.prototype.reset=E.prototype.reset=function(){this.$c=!0;this.clear();this.cc=new K(Ug);this.BG();this.AG();this.rb=(new O(NaN,NaN)).freeze();this.Bb=1;this.$v=(new O(NaN,NaN)).freeze();this.aw=NaN;this.tw=1E-4;this.qw=100;this.gx=(new O(NaN,NaN)).freeze();this.Sv=(new B(NaN,NaN,NaN,NaN)).freeze();this.Lw=(new Ib(0,0,0,0)).freeze();this.Mw=Al;this.Iw=this.Gw=null;this.Im=Rh;this.Po=Vc;this.Al=Rh;this.kp=Vc;this.bw=this.Zv=dc;this.ir=250;this.xv=(new Ib(16,16,16,16)).freeze();this.hw=!0;this.Zw=Cl; +this.ax=fj;this.Fr="auto";this.Si=this.uj=this.ij=this.ww=this.jj=this.kj=this.lj=this.Ri=this.Wi=this.Pi=null;this.aj=!1;this.fl=this.el=this.mv=this.mf=!0;this.ov=this.nv=!1;this.sv=this.pv=this.Xv=this.Wv=this.tv=this.rv=this.nl=this.ml=this.ll=this.kl=this.il=this.jl=this.hl=this.qv=this.pl=this.gl=this.ol=!0;this.Ow=this.Kw=16;this.of=(new Ib(5)).freeze();this.rw=999999999;this.te=null;this.iw=!1;Jl(this);this.Ad=null;this.kb=new Lh;this.kb.initializeStandardTools();this.gb=this.bu=this.kb;this.xb= +new oa;this.tj=!0;Il(this);this.Vb=new Wg;this.tj=!1;this.ga=new Y;this.th=!1;this.ep=!0;this.$c=this.Zf=!1;this.qa();this.wh=this.Oi=null;Bl(this);this.Ev=""}; +function Jl(a){a.mj=new ma("string",F);var b=new G,c=new na;c.bind(new lh("text","",ja));b.add(c);a.OC=b;a.mj.add("",b);b=new G;c=new na;c.stroke="brown";c.bind(new lh("text","",ja));b.add(c);a.mj.add("Comment",b);b=new G;b.bl=!1;b.sA=!1;c=new z;c.Jb="Ellipse";c.fill="black";c.stroke=null;c.Ea=(new Ca(3,3)).Na();b.add(c);a.mj.add("LinkLabel",b);a.wl=new ma("string",I);b=new I;b.By="GROUPPANEL";b.type=Ml;c=new na;c.font="bold 12pt sans-serif";c.bind(new lh("text","",ja));b.add(c);c=new x(Nl);c.name= +"GROUPPANEL";var d=new z;d.Jb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new Wj;d.padding=(new Ib(5,5,5,5)).Na();c.add(d);b.add(c);a.MC=b;a.wl.add("",b);a.rk=new ma("string",J);b=new J;c=new z;c.Hf=!0;b.add(c);c=new z;c.Vq="Standard";c.fill="black";c.stroke=null;c.jb=0;b.add(c);a.NC=b;a.rk.add("",b);b=new J;c=new z;c.Hf=!0;c.stroke="brown";b.add(c);a.rk.add("Comment",b);b=new da;b.type=Nl;c=new z;c.fill=null;c.stroke="dodgerblue";c.jb=3;b.add(c);c=new Wj;c.margin=(new Ib(1.5, +1.5,1.5,1.5)).Na();b.add(c);a.xw=b;a.Uv=b;b=new da;b.type=rj;c=new z;c.Hf=!0;c.fill=null;c.stroke="dodgerblue";c.jb=3;b.add(c);a.mw=b} +function yl(a){var b=D.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=D.createElement("div");c.style.position="absolute";c.style.visibility="hidden";c.style.width="200px";c.style.height="150px";c.style.overflow="hidden";c.style.boxSizing="content-box";c.appendChild(b);window.document.body.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);window.document.body.removeChild(c);c=d-b;0!==c||D.TF|| +(c=11);a.Rd=c;c=D.createElement("div");c.dir="rtl";c.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";c.textContent="A";window.document.body.appendChild(c);d="reverse";0=a)return b;for(var c=this.cc.j;c.next();)b+="\n "+c.value.toString(a-1);return b};E.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.ba instanceof E?b.ba:null}; +D.defineProperty(E,{Ej:"div"},function(){return this.Sb},function(a){null!==a&&D.l(a,HTMLDivElement,E,"div");if(this.Sb!==a){zl=[];var b=this.Sb;null!==b?(b.ba=void 0,b.innerHTML="",null!==this.Mb&&(this.Mb.removeEventListener("touchstart",this.WB,!1),this.Mb.removeEventListener("touchmove",this.VB,!1),this.Mb.removeEventListener("touchend",this.UB,!1),this.Mb.Ud.ba=null),b=this.kb,null!==b&&(b.lf.each(function(a){a.cancelWaitAfter()}),b.jg.each(function(a){a.cancelWaitAfter()}),b.kg.each(function(a){a.cancelWaitAfter()})), +b.cancelWaitAfter(),this.gb.doCancel(),this.od=this.Mb=null,window.removeEventListener("resize",this.dC,!1),window.removeEventListener("mousemove",this.lo,!0),window.removeEventListener("mousedown",this.ko,!0),window.removeEventListener("mouseup",this.no,!0),window.removeEventListener("mousewheel",this.$g,!0),window.removeEventListener("DOMMouseScroll",this.$g,!0),window.removeEventListener("mouseout",this.mo,!0)):this.th=!1;this.Sb=null;if(null!==a){if(b=a.ba)b.Ej=null;Ll(this,a);this.Gq()}}}); +function Ol(a){var b=a.Mb;b.addEventListener("touchstart",a.WB,!1);b.addEventListener("touchmove",a.VB,!1);b.addEventListener("touchend",a.UB,!1);b.addEventListener("mousemove",a.lo,!1);b.addEventListener("mousedown",a.ko,!1);b.addEventListener("mouseup",a.no,!1);b.addEventListener("mousewheel",a.$g,!1);b.addEventListener("DOMMouseScroll",a.$g,!1);b.addEventListener("mouseout",a.mo,!1);b.addEventListener("keydown",a.qJ,!1);b.addEventListener("keyup",a.rJ,!1);b.addEventListener("selectstart",function(a){a.preventDefault(); +return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.kb.qq===Hk&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.pG,!1);b.addEventListener("pointermove",a.rG,!1);b.addEventListener("pointerleave",a.qG,!1);window.addEventListener("resize",a.dC,!1)}E.prototype.computePixelRatio=function(){return null!==this.Bk?this.Bk:this.GD};E.prototype.doMouseMove=function(){this.gb.doMouseMove()}; +E.prototype.doMouseDown=function(){this.gb.doMouseDown()};E.prototype.doMouseUp=function(){this.gb.doMouseUp()};E.prototype.doMouseWheel=function(){this.gb.doMouseWheel()};E.prototype.doKeyDown=function(){this.gb.doKeyDown()};E.prototype.doKeyUp=function(){this.gb.doKeyUp()};E.prototype.doFocus=function(){this.focus()};E.prototype.focus=E.prototype.focus=function(){this.Mb&&this.Mb.focus()}; +function dl(a){if(null!==a.Mb){var b=a.Sb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.yl?a.Rd:0,d=a.lk?a.Rd:0,e=a.qd;a.qd=a.computePixelRatio();a.qd!==e&&(a.cs=!0,a.Se());if(b.clientWidth!==a.Ob+c||b.clientHeight!==a.Rb+d)a.Sm=!0,a.Me=!0,b=a.Vb,null!==b&&b.Yx&&a.bm===Rh&&b.N(),a.ge||a.Se()}}} +function Il(a){var b=new Ug;b.name="Background";a.Ot(b);b=new Ug;b.name="";a.Ot(b);b=new Ug;b.name="Foreground";a.Ot(b);b=new Ug;b.name="Adornment";b.Uc=!0;a.Ot(b);b=new Ug;b.name="Tool";b.Uc=!0;b.OF=!0;a.Ot(b);b=new Ug;b.name="Grid";b.Bf=!1;b.qg=!1;b.Uc=!0;a.OH(b,a.km("Background"))} +function Pl(a){a.Ad=new x(Ql);a.Ad.name="GRID";var b=new z;b.Jb="LineH";b.stroke="lightgray";b.jb=.5;b.interval=1;a.Ad.add(b);b=new z;b.Jb="LineH";b.stroke="gray";b.jb=.5;b.interval=5;a.Ad.add(b);b=new z;b.Jb="LineH";b.stroke="gray";b.jb=1;b.interval=10;a.Ad.add(b);b=new z;b.Jb="LineV";b.stroke="lightgray";b.jb=.5;b.interval=1;a.Ad.add(b);b=new z;b.Jb="LineV";b.stroke="gray";b.jb=.5;b.interval=5;a.Ad.add(b);b=new z;b.Jb="LineV";b.stroke="gray";b.jb=1;b.interval=10;a.Ad.add(b);b=new F;b.add(a.Ad); +b.Kf="Grid";b.Do=0;b.Tx=!1;b.NF=!1;b.qg=!1;b.hy="GRID";a.add(b);a.qb.remove(b);a.Ad.visible=!1}function Rl(){this.ba.isEnabled?this.ba.uI(this):Sl(this.ba)}function Tl(a){this.ba.isEnabled?(this.ba.Zz=!0,this.ba.aA=a.target.scrollTop,this.ba.$z=a.target.scrollLeft):Sl(this.ba)} +E.prototype.diagramScroll=E.prototype.uI=function(a){if(this.Zz&&null!==this.Mb){this.Jw=!0;var b=this.dd,c=this.ub,d=b.width,e=c.width,g=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=this.scale,s;s=a.scrollLeft;if(this.gs)switch(this.Xz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;el&&(this.position=s.n(-(this.Nw.scrollWidth-this.Ob)+u-this.Ob/r+k,this.position.y))),a.DH&&this.ze&&(bn&&(this.position=s.n(this.position.x,-(this.Nw.scrollHeight-this.Rb)+a.scrollTop-this.Rb/r+m))),D.A(s),Ul(this),this.Sm=this.Jw=!1,b=this.dd,c=this.ub,k=b.right,l=c.right, +m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(this.lt.style.width="1px"),h>=g&&b>=c&&m<=n&&(this.lt.style.height="1px"))}};E.prototype.computeBounds=E.prototype.Kh=function(){0c&&(e=c),ea.Qh&&(e=a.Qh),e):b===am?(e=l>k?(h-a.Rd)/d:(g-a.Rd)/e,e>c&&(e=c),ea.Qh&&(e=a.Qh),e):a.scale}E.prototype.zoomToFit=E.prototype.zoomToFit=function(){this.scale=Xl(this,$l)}; +E.prototype.zoomToRect=function(a,b){void 0===b&&(b=$l);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===$l||b===am)if(isNaN(c))e=this.ub.height*this.scale/d;else if(isNaN(d))e=this.ub.width*this.scale/c;else var e=this.Ob,g=this.Rb,e=b===am?g/d>e/c?(g-(this.lk?this.Rd:0))/d:(e-(this.yl?this.Rd:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new O(a.x,a.y)}};D.defineProperty(E,{aB:null},function(){return this.$c},function(a){this.$c=a}); +E.prototype.alignDocument=function(a,b){this.mk&&Zl(this,this.Kh());var c=this.dd,d=this.ub;this.position=new O(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))}; +function Yl(a,b,c,d,e,g,h){var k=b.x,l=b.y;if(h||a.CB===Al)g.fd()&&(d>c.width&&(k=c.x+(g.x*c.width+g.offsetX)-(g.x*d-g.offsetX)),e>c.height&&(l=c.y+(g.y*c.height+g.offsetY)-(g.y*e-g.offsetY))),g=a.LG,h=d-c.width,dc.left?k=c.left:kc.top?l=c.top:lc.touches.length)&&c.preventDefault();c.cancelBubble=!0;return!1} +E.prototype.qJ=function(a){if(!this.ba.isEnabled)return!1;var b=this.ba.Tb;bm(this.ba,this.ba,a,b,!1);b.key=String.fromCharCode(a.which);b.jm=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:case 61:case 107:b.key= "Add";break;case 189:case 173:case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.ba.doKeyDown();return 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which&&61!==a.which&&173!==a.which||!0!==a.ctrlKey?ga(this.ba,b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)}; -E.prototype.oJ=function(a){if(!this.ba.isEnabled)return!1;var b=this.ba.Tb;Zl(this.ba,this.ba,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 93:a.preventDefault()}this.ba.doKeyUp(); -return ga(this.ba,b,a)};E.prototype.ep=function(a){var b=this.Lb;if(null===b)return new O(0,0);var c=this.Ob,d=this.Rb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.Hc?(a=new O(c,a),hb(a,this.Hc),a):new O(c,a)}; -function $l(a,b,c){var d=a.Lb,e=a.Ob,g=a.Rb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-g/d.height*d.top);c.qe.m(h,k);null!==a.Hc?(b=D.Fb(h,k),a.Hc.Ci(b),c.ha.assign(b),D.A(b)):c.ha.m(h,k)} -function $f(a,b,c,d){var e=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.pj[0])e=a.pj[c];else return;c=a.Lb;b=a.Ob;a=a.Rb;var g=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),g=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.m(g,h)}E.prototype.invalidateDocumentBounds=E.prototype.yc=function(){this.mk||(this.mk=!0,this.Se(!0))};function jl(a){a.ge||Li(a);a.mk&&Wl(a,a.Kh())} -E.prototype.redraw=E.prototype.Hq=function(){this.Zc||this.ge||(this.qa(),cm(this),Rl(this),this.yc(),this.gg())};E.prototype.isUpdateRequested=function(){return this.Yf};E.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Xa,c=b.isEnabled;b.Ii();b.isEnabled=!1;Vi(this);this.th=!1;b.isEnabled=c;null!==a&&D.setTimeout(a,1)}; -E.prototype.requestUpdate=E.prototype.Se=function(a){void 0===a&&(a=!1);if(!0!==this.Yf&&!(this.Zc||!1===a&&this.ge)){this.Yf=!0;var b=this;requestAnimationFrame(function(){b.Yf&&b.gg()})}};E.prototype.maybeUpdate=E.prototype.gg=function(){if(!this.cp||this.Yf)this.cp&&(this.cp=!1),Vi(this)};function dm(a,b){a.Xa.sf||a.Zc||!a.Sm||Pl(a)||(b&&Li(a),Tl(a,!1))} -function Vi(a){if(!a.ge&&(a.Yf=!1,null!==a.Sb)){a.ge=!0;var b=a.Xa,c=a.Tz;if(!b.op&&0!==c.length){for(var d=c.o,e=d.length,g=0;gb;b++){var c=a.Cg.j;if(null===c||0===a.Cg.count)break;a.Cg=new L(F);a.XB(c,a.Cg);v&&22===b&&D.trace("failure to validate parts")}a.ng.each(function(a){a instanceof I&&0!==(a.Ba&65536)!==!1&&(a.Ba^=65536)})}} -E.prototype.XB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.oe()||c instanceof I||(c.um()?(Ak(c,Infinity,Infinity),c.oc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof I&&c.isVisible()&&Gm(this,c);for(a.reset();a.next();)c=a.value,c instanceof J&&c.isVisible()&&(c.um()?(Ak(c,Infinity,Infinity),c.oc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof da&&c.isVisible()&&(c.um()?(Ak(c,Infinity,Infinity),c.oc()):b.add(c))}; -function Gm(a,b){for(var c=D.tb(),d=D.tb(),e=b.Mc;e.next();){var g=e.value;g.isVisible()&&(g instanceof I?(Hm(g)||Im(g)||Jm(g))&&Gm(a,g):g instanceof J?g.aa===b||g.da===b?d.push(g):c.push(g):(Ak(g,Infinity,Infinity),g.oc()))}for(var e=c.length,h=0;hy+1&& -(N=Math.max((t-y)*c+a.Ob,N)),q+k+1p+1&&(k=Math.max((A-p)*c+a.Rb,k)),r+l+1y+1&&(N=Math.max((t-y)*c+a.Ob,N)),q+1p+1&&(k=Math.max((A-p)*c+W,k)),r+1y+1&&(l=a.position.x*c));if(a.hs)switch(a.Vz){case "negative":l=-(b.scrollWidth-l-b.clientWidth);break;case "reverse":l=b.scrollWidth-l-b.clientWidth}b.scrollLeft=l;a.UA&&a.ze&&(r+1p+1&&(b.scrollTop=a.position.y*c));h&&(a.ds=!0);m=a.Ob;n=a.Rb;b.style.width=m+(a.wl?a.Rd:0)+ -"px";b.style.height=n+(a.lk?a.Rd:0)+"px";a.Xz=!1;return d!==m||e!==n||a.Xa.vc?(p=a.xb,a.Pu(g,p,c,a.scale,h),!1):!0} -E.prototype.add=E.prototype.add=function(a){D.l(a,F,E,"add:part");var b=a.g;if(b!==this){null!==b&&D.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.br&&(a.El="Tool");var c=a.Jf,b=this.jm(c);null===b&&(b=this.jm(""));null===b&&D.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.uq(99999999,a,a.g===this),0<=c&&this.hd(mg,"parts",b,null,a,null,c),b.Tc||this.yc(),a.N(Qm),c=a.by,null!== +E.prototype.rJ=function(a){if(!this.ba.isEnabled)return!1;var b=this.ba.Tb;bm(this.ba,this.ba,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 93:a.preventDefault()}this.ba.doKeyUp(); +return ga(this.ba,b,a)};E.prototype.gp=function(a){var b=this.Mb;if(null===b)return new O(0,0);var c=this.Ob,d=this.Rb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.Ic?(a=new O(c,a),gb(a,this.Ic),a):new O(c,a)}; +function cm(a,b,c){var d=a.Mb,e=a.Ob,g=a.Rb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-g/d.height*d.top);c.qe.n(h,k);null!==a.Ic?(b=D.Fb(h,k),a.Ic.Di(b),c.ha.assign(b),D.A(b)):c.ha.n(h,k)} +function Zf(a,b,c,d){var e=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.pj[0])e=a.pj[c];else return;c=a.Mb;b=a.Ob;a=a.Rb;var g=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),g=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.n(g,h)}E.prototype.invalidateDocumentBounds=E.prototype.zc=function(){this.mk||(this.mk=!0,this.Se(!0))};function ml(a){a.ge||Si(a);a.mk&&Zl(a,a.Kh())} +E.prototype.redraw=E.prototype.Gq=function(){this.$c||this.ge||(this.qa(),fm(this),Ul(this),this.zc(),this.hg())};E.prototype.isUpdateRequested=function(){return this.Zf};E.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Xa,c=b.isEnabled;b.Ii();b.isEnabled=!1;bj(this);this.th=!1;b.isEnabled=c;null!==a&&D.setTimeout(a,1)}; +E.prototype.requestUpdate=E.prototype.Se=function(a){void 0===a&&(a=!1);if(!0!==this.Zf&&!(this.$c||!1===a&&this.ge)){this.Zf=!0;var b=this;requestAnimationFrame(function(){b.Zf&&b.hg()})}};E.prototype.maybeUpdate=E.prototype.hg=function(){if(!this.ep||this.Zf)this.ep&&(this.ep=!1),bj(this)};function gm(a,b){a.Xa.sf||a.$c||!a.Sm||Sl(a)||(b&&Si(a),Wl(a,!1))} +function bj(a){if(!a.ge&&(a.Zf=!1,null!==a.Sb)){a.ge=!0;var b=a.Xa,c=a.Vz;if(!b.qp&&0!==c.length){for(var d=c.o,e=d.length,g=0;gb;b++){var c=a.Eg.j;if(null===c||0===a.Eg.count)break;a.Eg=new L(F);a.aC(c,a.Eg);v&&22===b&&D.trace("failure to validate parts")}a.og.each(function(a){a instanceof I&&0!==(a.Ca&65536)!==!1&&(a.Ca^=65536)})}} +E.prototype.aC=function(a,b){for(a.reset();a.next();){var c=a.value;!c.oe()||c instanceof I||(c.um()?(Fk(c,Infinity,Infinity),c.pc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof I&&c.isVisible()&&Im(this,c);for(a.reset();a.next();)c=a.value,c instanceof J&&c.isVisible()&&(c.um()?(Fk(c,Infinity,Infinity),c.pc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof da&&c.isVisible()&&(c.um()?(Fk(c,Infinity,Infinity),c.pc()):b.add(c))}; +function Im(a,b){for(var c=D.tb(),d=D.tb(),e=b.Nc;e.next();){var g=e.value;g.isVisible()&&(g instanceof I?(Jm(g)||Km(g)||Lm(g))&&Im(a,g):g instanceof J?g.aa===b||g.da===b?d.push(g):c.push(g):(Fk(g,Infinity,Infinity),g.pc()))}for(var e=c.length,h=0;hy+1&& +(N=Math.max((t-y)*c+a.Ob,N)),q+k+1p+1&&(k=Math.max((A-p)*c+a.Rb,k)),r+l+1y+1&&(N=Math.max((t-y)*c+a.Ob,N)),q+1p+1&&(k=Math.max((A-p)*c+W,k)),r+1y+1&&(l=a.position.x*c));if(a.gs)switch(a.Xz){case "negative":l=-(b.scrollWidth-l-b.clientWidth);break;case "reverse":l=b.scrollWidth-l-b.clientWidth}b.scrollLeft=l;a.WA&&a.ze&&(r+1p+1&&(b.scrollTop=a.position.y*c));h&&(a.cs=!0);m=a.Ob;n=a.Rb;b.style.width=m+(a.yl?a.Rd:0)+ +"px";b.style.height=n+(a.lk?a.Rd:0)+"px";a.Zz=!1;return d!==m||e!==n||a.Xa.wc?(p=a.ub,a.Ou(g,p,c,a.scale,h),!1):!0} +E.prototype.add=E.prototype.add=function(a){D.l(a,F,E,"add:part");var b=a.g;if(b!==this){null!==b&&D.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.ar&&(a.Gl="Tool");var c=a.Kf,b=this.km(c);null===b&&(b=this.km(""));null===b&&D.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.tq(99999999,a,a.g===this),0<=c&&this.hd(dg,"parts",b,null,a,null,c),b.Uc||this.zc(),a.N(Sm),c=a.ay,null!== c&&c(a,null,b))}}; -E.prototype.uq=function(a){if(a instanceof G){if(this.Cp.add(a),a instanceof I){var b=a.Pa;null===b?this.Rl.add(a):b.en.add(a);b=a.Vb;null!==b&&(b.g=this)}}else a instanceof J?this.wp.add(a):a instanceof da||this.pb.add(a);var c=this;Rm(a,function(a){Sm(c,a)});(a instanceof da||a instanceof I&&null!==a.Qb)&&a.K();b=a.data;null!==b&&(a instanceof da||(a instanceof J?this.ck.add(b,a):this.Ti.add(b,a)),Rm(a,function(a){Tm(c,a)}));!0!==Im(a)&&!0!==Jm(a)||this.Cg.add(a);Um(a,!0,this);Vm(a)?(a.$.F()&&this.qa(sl(a, -a.$)),this.yc()):a.isVisible()&&a.$.F()&&this.qa(sl(a,a.$));this.Se()}; -E.prototype.rf=function(a){a.Zt();if(a instanceof G){if(this.Cp.remove(a),a instanceof I){var b=a.Pa;null===b?this.Rl.remove(a):b.en.remove(a);b=a.Vb;null!==b&&(b.g=null)}}else a instanceof J?this.wp.remove(a):a instanceof da||this.pb.remove(a);var c=this;Rm(a,function(a){Wm(c,a)});b=a.data;null!==b&&(a instanceof da||(a instanceof J?this.ck.remove(b):this.Ti.remove(b)),Rm(a,function(a){Xm(c,a)}));this.Cg.remove(a);Vm(a)?(a.$.F()&&this.qa(sl(a,a.$)),this.yc()):a.isVisible()&&a.$.F()&&this.qa(sl(a, -a.$));this.Se()};E.prototype.remove=E.prototype.remove=function(a){D.l(a,F,E,"remove:part");Ym(this,a,!0)};function Ym(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.hb=!1,b.Xg=!1,b.N(Zm),c&&b.Mn(),c=d.rf(-1,b,!1),0<=c&&a.hd(ng,"parts",d,b,null,c,null),a=b.by,null!==a&&a(b,d,null))} -E.prototype.removeParts=E.prototype.vB=function(a,b){if(D.isArray(a))for(var c=D.cb(a),d=0;dd&&this.yc()}; -E.prototype.addLayerAfter=function(a,b){$m(this,a,b);a.Xc(this);var c=this.bc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ve&&this.hd(ng,"layers",this,a,null,d,null));for(var e=c.count,g=0;gd&&this.yc()}; -E.prototype.removeLayer=function(a){D.l(a,Rg,E,"removeLayer:layer");a.g!==this&&D.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.bc,c=b.indexOf(a);if(b.remove(a)){for(b=a.pb.copy().j;b.next();){var d=b.value,e=d.Jf;d.Jf=e!==a.name?e:""}null!==this.ve&&this.hd(ng,"layers",this,a,null,c,null);this.qa();this.yc()}}};E.prototype.findLayer=E.prototype.jm=function(a){for(var b=this.ao;b.next();){var c=b.value;if(c.name===a)return c}return null}; -E.prototype.addModelChangedListener=E.prototype.NH=function(a){D.h(a,"function",E,"addModelChangedListener:listener");null===this.wh&&(this.wh=new K("function"));this.wh.add(a);this.ga.An(a)};E.prototype.removeModelChangedListener=function(a){D.h(a,"function",E,"removeModelChangedListener:listener");null!==this.wh&&(this.wh.remove(a),0===this.wh.count&&(this.wh=null));this.ga.Su(a)}; -E.prototype.addChangedListener=E.prototype.An=function(a){D.h(a,"function",E,"addChangedListener:listener");null===this.Oi&&(this.Oi=new K("function"));this.Oi.add(a)};E.prototype.removeChangedListener=E.prototype.Su=function(a){D.h(a,"function",E,"removeChangedListener:listener");null!==this.Oi&&(this.Oi.remove(a),0===this.Oi.count&&(this.Oi=null))}; -E.prototype.qx=function(a){this.Eb||this.ra.EF(a);a.Ic!==dg&&(this.Fi=!0);if(null!==this.Oi){var b=this.Oi,c=b.length;if(1===c)b=b.ea(0),b(a);else if(0!==c)for(var d=b.lc(),e=0;ea.Ph&&(c=a.Ph);e=D.Fb(a.qb.x+h/b-h/c,a.qb.y+k/b-k/c);a.position=e;D.A(e);a.Bb=c;a.Pu(d,a.xb,b,c,!1);a.Zc=!1;Tl(a, -!1);c=a.Xa;c.vc&&nl(c,b,a.Bb);a.qa();cm(a)}}E.prototype.Pu=function(a,b,c,d,e){a.O(b)||(void 0===e&&(e=!1),e||cm(this),Rl(this),d=this.Vb,null===d||!d.Zx||this.am!==Nh||e||a.width===b.width&&a.height===b.height||d.N(),d=this.gb,!0===this.Um&&d instanceof Hh&&(this.U.ha=this.UB(this.U.qe),Ek(d,this)),this.Zc||this.JF(a,b),fm(this),this.Fh.scale=c,this.Fh.position.x=a.x,this.Fh.position.y=a.y,this.Fh.bounds.set(a),this.Fh.isScroll=e,this.Ja("ViewportBoundsChanged",this.Fh,a))}; -function fm(a,b){void 0===b&&(b=null);var c=a.zd;if(null!==c&&c.visible){for(var d=D.Cm(),e=1,g=1,h=c.xa.o,k=h.length,l=0;ln||(bn(m.Jb)?g=g*n/$e(g,n):e=e*n/$e(e,n))}h=c.Ox;d.m(g*h.width,e*h.height);h=g=l=k=0;if(null!==b)k=b.width,l=b.height,g=b.x,h=b.y;else{e=D.Nf();g=a.xb;e.m(g.x,g.y,g.width,g.height);for(h=a.Cw.j;h.next();)g=h.value.xb,g.F()&&Ob(e,g.x,g.y,g.width,g.height);if(!e.F()){D.Mb(e);return}k=e.width;l=e.height;g=e.x;h=e.y;D.Mb(e)}c.width=k+2*d.width;c.height= -l+2*d.height;e=D.P();gb(g,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);D.Rk(d);c.Y.location=e;D.A(e)}}E.prototype.clearSelection=E.prototype.tx=function(){var a=0a&&D.ua(a,">= 0",E,"scrollHorizontalLineChange"),this.Lw=a,this.i("scrollHorizontalLineChange",b,a))}); -D.defineProperty(E,{Yu:"scrollVerticalLineChange"},function(){return this.Pw},function(a){var b=this.Pw;b!==a&&(D.h(a,"number",E,"scrollVerticalLineChange"),0>a&&D.ua(a,">= 0",E,"scrollVerticalLineChange"),this.Pw=a,this.i("scrollVerticalLineChange",b,a))});D.defineProperty(E,{U:"lastInput"},function(){return this.Tb},function(a){v&&D.l(a,Zf,E,"lastInput");this.Tb=a});D.defineProperty(E,{Kc:"firstInput"},function(){return this.Zi},function(a){v&&D.l(a,Zf,E,"firstInput");this.Zi=a}); -D.defineProperty(E,{jc:"currentCursor"},function(){return this.Fv},function(a){""===a&&(a=this.Gr);var b=this.Fv;if(b!==a){D.h(a,"string",E,"currentCursor");var c=this.Lb,d=this.Sb;null!==c&&(this.Fv=a,c.style.cursor=a,d.style.cursor=a,c.style.cursor===b&&(c.style.cursor="-webkit-"+a,d.style.cursor="-webkit-"+a,c.style.cursor===b&&(c.style.cursor="-moz-"+a,d.style.cursor="-moz-"+a,c.style.cursor===b&&(c.style.cursor=a,d.style.cursor=a))))}}); -D.defineProperty(E,{kL:"defaultCursor"},function(){return this.Gr},function(a){""===a&&(a="auto");var b=this.Gr;b!==a&&(D.h(a,"string",E,"defaultCursor"),this.Gr=a,this.i("defaultCursor",b,a))});D.defineProperty(E,{click:"click"},function(){return this.Pi},function(a){var b=this.Pi;b!==a&&(null!==a&&D.h(a,"function",E,"click"),this.Pi=a,this.i("click",b,a))}); -D.defineProperty(E,{du:"doubleClick"},function(){return this.Wi},function(a){var b=this.Wi;b!==a&&(null!==a&&D.h(a,"function",E,"doubleClick"),this.Wi=a,this.i("doubleClick",b,a))});D.defineProperty(E,{uA:"contextClick"},function(){return this.Ri},function(a){var b=this.Ri;b!==a&&(null!==a&&D.h(a,"function",E,"contextClick"),this.Ri=a,this.i("contextClick",b,a))}); -D.defineProperty(E,{kB:"mouseOver"},function(){return this.lj},function(a){var b=this.lj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseOver"),this.lj=a,this.i("mouseOver",b,a))});D.defineProperty(E,{jB:"mouseHover"},function(){return this.kj},function(a){var b=this.kj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHover"),this.kj=a,this.i("mouseHover",b,a))}); -D.defineProperty(E,{iB:"mouseHold"},function(){return this.jj},function(a){var b=this.jj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHold"),this.jj=a,this.i("mouseHold",b,a))});D.defineProperty(E,{KJ:"mouseDragOver"},function(){return this.ww},function(a){var b=this.ww;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDragOver"),this.ww=a,this.i("mouseDragOver",b,a))}); -D.defineProperty(E,{hB:"mouseDrop"},function(){return this.ij},function(a){var b=this.ij;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDrop"),this.ij=a,this.i("mouseDrop",b,a))});D.defineProperty(E,{PB:"toolTip"},function(){return this.uj},function(a){var b=this.uj;b!==a&&(!v||null===a||a instanceof da||a instanceof ak||D.k("Diagram.toolTip must be an Adornment or HTMLInfo."),this.uj=a,this.i("toolTip",b,a))}); -D.defineProperty(E,{contextMenu:"contextMenu"},function(){return this.Si},function(a){var b=this.Si;b!==a&&(!v||a instanceof da||a instanceof ak||D.k("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Si=a,this.i("contextMenu",b,a))});D.defineProperty(E,{wb:"commandHandler"},function(){return this.gz},function(a){var b=this.gz;b!==a&&(D.l(a,oa,E,"commandHandler"),null!==a.g&&D.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Xc(null),this.gz=a,a.Xc(this))}); -D.defineProperty(E,{kb:"toolManager"},function(){return this.fA},function(a){var b=this.fA;b!==a&&(D.l(a,Hh,E,"toolManager"),null!==a.g&&D.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Xc(null),this.fA=a,a.Xc(this))});D.defineProperty(E,{cu:"defaultTool"},function(){return this.mz},function(a){var b=this.mz;b!==a&&(D.l(a,Sg,E,"defaultTool"),this.mz=a,this.gb===b&&(this.gb=a))}); -D.defineProperty(E,{gb:"currentTool"},function(){return this.jz},function(a){var b=this.jz;null!==b&&(b.wa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.cu);null!==a&&(D.l(a,Sg,E,"currentTool"),this.jz=a,a.Xc(this),a.doStart())});D.w(E,{selection:"selection"},function(){return this.Sw}); -D.defineProperty(E,{BJ:"maxSelectionCount"},function(){return this.rw},function(a){var b=this.rw;if(b!==a)if(D.h(a,"number",E,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.rw=a,this.i("maxSelectionCount",b,a),!this.ra.nb&&(a=this.selection.count-a,0= 0",E,"maxSelectionCount")}); -D.defineProperty(E,{MJ:"nodeSelectionAdornmentTemplate"},function(){return this.xw},function(a){var b=this.xw;b!==a&&(D.l(a,da,E,"nodeSelectionAdornmentTemplate"),this.xw=a,this.i("nodeSelectionAdornmentTemplate",b,a))});D.defineProperty(E,{TI:"groupSelectionAdornmentTemplate"},function(){return this.Vv},function(a){var b=this.Vv;b!==a&&(D.l(a,da,E,"groupSelectionAdornmentTemplate"),this.Vv=a,this.i("groupSelectionAdornmentTemplate",b,a))}); -D.defineProperty(E,{vJ:"linkSelectionAdornmentTemplate"},function(){return this.mw},function(a){var b=this.mw;b!==a&&(D.l(a,da,E,"linkSelectionAdornmentTemplate"),this.mw=a,this.i("linkSelectionAdornmentTemplate",b,a))});D.w(E,{qm:"highlighteds"},function(){return this.Zv}); -D.defineProperty(E,{Fi:"isModified"},function(){var a=this.ra;return a.isEnabled?null!==a.Cj?!0:this.fw&&this.sh!==a.Hj:this.fw},function(a){if(this.fw!==a){D.h(a,"boolean",E,"isModified");this.fw=a;var b=this.ra;!a&&b.isEnabled&&(this.sh=b.Hj);a||en(this)}});function en(a){var b=a.Fi;a.uE!==b&&(a.uE=b,a.Ja("Modified"))} -D.defineProperty(E,{ga:"model"},function(){return this.ve},function(a){var b=this.ve;if(b!==a){D.l(a,M,E,"model");this.gb.doCancel();null!==b&&b.ra!==a.ra&&b.ra.RF&&D.k("Do not replace a Diagram.model while a transaction is in progress.");this.Xa.Ii();this.tx();this.th=!1;this.cp=!0;this.sh=-2;this.Yf=!1;var c=this.ge;this.ge=!0;this.Xa.oo("Model");null!==b&&(null!==this.wh&&this.wh.each(function(a){b.Su(a)}),b.Su(this.AD),b instanceof Y&&fn(this,b.Yg),fn(this,b.mg));this.ve=a;a.An(this.zD);gn(this, -a.mg);a instanceof Y&&hn(this,a.Yg);a.Su(this.zD);a.An(this.AD);null!==this.wh&&this.wh.each(function(b){a.An(b)});this.ge=c;this.Zc||this.qa();null!==b&&(a.ra.isEnabled=b.ra.isEnabled)}});D.defineProperty(E,{ab:null},function(){return this.rD},function(a){this.rD=a});D.w(E,{hy:null},function(){return this.tH}); -function Bl(a,b){if(b.ga===a.ga){var c=b.Ic,d=b.propertyName;if(c===dg&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.kb,c.lf.each(function(b){b.Xc(a)}),c.ig.each(function(b){b.Xc(a)}),c.jg.each(function(b){b.Xc(a)}),a.ge||a.th||(a.Mv=!0,a.cp&&(a.Yf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Xa;e.sf&&!a.Eb&&e.Ii();a.Ja("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Xa,e.sf&&!a.Eb&&e.Ii());else if(a.ab){a.ab=!1;try{var g=b.wf;if(""!==g)if(c===cg){if("linkFromKey"===g){var h= -b.object,k=a.bg(h);if(null!==k){var l=b.newValue,m=a.Qe(l);k.aa=m}}else if("linkToKey"===g)h=b.object,k=a.bg(h),null!==k&&(l=b.newValue,m=a.Qe(l),k.da=m);else if("linkFromPortId"===g){if(h=b.object,k=a.bg(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.cg=n)}}else if("linkToPortId"===g)h=b.object,k=a.bg(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.jh=n));else if("nodeGroupKey"===g){var h=b.object,p=a.Nh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Qe(q);p.Pa=r instanceof I? -r:null}else p.Pa=null}}else if("linkLabelKeys"===g){if(h=b.object,k=a.bg(h),null!==k){var s=b.oldValue,u=b.newValue;if(D.isArray(s))for(var t=D.cb(s),y=0;yl)){var m=l;pn(k)&&m++;k.rf(m);qn(k,m,l)}}}}function Tm(a,b){var c=b.cj;if(D.isArray(c)){var d=a.Wm.oa(c);if(null===d)d=[],d.push(b),a.Wm.add(c,d);else{for(c=0;cthis.scale&&(this.scale=a)):D.ua(a,"> 0",E,"minScale"))}); -D.defineProperty(E,{Ph:"maxScale"},function(){return this.qw},function(a){D.p(a,E,"maxScale");var b=this.qw;b!==a&&(0 0",E,"maxScale"))});D.defineProperty(E,{Fm:"zoomPoint"},function(){return this.hx},function(a){this.hx.O(a)||(D.l(a,O,E,"zoomPoint"),this.hx=a=a.V())}); -D.defineProperty(E,{RE:"contentAlignment"},function(){return this.No},function(a){var b=this.No;b.O(a)||(D.l(a,R,E,"contentAlignment"),this.No=a=a.V(),this.i("contentAlignment",b,a),Tl(this,!1))});D.defineProperty(E,{GL:"initialContentAlignment"},function(){return this.ip},function(a){var b=this.ip;b.O(a)||(D.l(a,R,E,"initialContentAlignment"),this.ip=a=a.V(),this.i("initialContentAlignment",b,a))}); -D.defineProperty(E,{padding:"padding"},function(){return this.of},function(a){"number"===typeof a?a=new Hb(a):D.l(a,Hb,E,"padding");var b=this.of;b.O(a)||(this.of=a=a.V(),this.yc(),this.i("padding",b,a))});D.w(E,{ng:"nodes"},function(){return this.Cp.j});D.w(E,{links:"links"},function(){return this.wp.j});D.w(E,{Gi:"parts"},function(){return this.pb.j}); -E.prototype.findTopLevelNodesAndLinks=function(){for(var a=new L(F),b=this.Cp.j;b.next();){var c=b.value;c.zq&&a.add(c)}for(b=this.wp.j;b.next();)c=b.value,c.zq&&a.add(c);return a.j};E.prototype.findTopLevelGroups=function(){return this.Rl.j};D.defineProperty(E,{Vb:"layout"},function(){return this.te},function(a){var b=this.te;b!==a&&(D.l(a,Tg,E,"layout"),null!==b&&(b.g=null,b.group=null),this.te=a,a.g=this,a.group=null,this.wv=!0,this.i("layout",b,a),this.Se())}); -E.prototype.layoutDiagram=function(a){Li(this);a&&vn(this,!0);gm(this,!1)};function vn(a,b){for(var c=a.Rl.j;c.next();)Dn(a,c.value,b);null!==a.Vb&&(b?a.Vb.Hf=!1:a.Vb.N())}function Dn(a,b,c){if(null!==b){for(var d=b.en.j;d.next();)Dn(a,d.value,c);null!==b.Vb&&(c?b.Vb.Hf=!1:b.Vb.N())}} -function gm(a,b){if(!a.nz){var c=a.Vb,d=a.ab;a.ab=!0;try{var e=a.ra.Vh;0===e&&a.$b("Layout");var g=a.Xa;1!==a.ra.Vh||g.sf||g.vc||b||g.oo("Layout");for(var h=a.Rl.j;h.next();)En(a,h.value,b);c.Hf||b&&!c.UF&&0!==e||(c.doLayout(a),Li(a),c.Hf=!0)}finally{0===e&&a.Td("Layout"),a.wv=!c.Hf,a.ab=d}}}function En(a,b,c){if(null!==b){for(var d=b.en.j;d.next();)En(a,d.value,c);d=b.Vb;null===d||d.Hf||c&&!d.UF||(b.mo=!b.location.F(),d.doLayout(b),b.N(Fn),d.Hf=!0,Gm(a,b))}} -D.defineProperty(E,{$d:"isTreePathToChildren"},function(){return this.iw},function(a){var b=this.iw;if(b!==a&&(D.h(a,"boolean",E,"isTreePathToChildren"),this.iw=a,this.i("isTreePathToChildren",b,a),!this.ra.nb))for(a=this.ng;a.next();)Gn(a.value)});E.prototype.findTreeRoots=function(){for(var a=new K(G),b=this.ng;b.next();){var c=b.value;c.zq&&null===c.Pn()&&a.add(c)}return a.j}; -D.defineProperty(E,{VB:"treeCollapsePolicy"},function(){return this.$w},function(a){var b=this.$w;b!==a&&(a!==zl&&a!==cn&&a!==dn&&D.k("Unknown Diagram.treeCollapsePolicy: "+a),this.$w=a,this.i("treeCollapsePolicy",b,a))});D.defineProperty(E,{Oh:null},function(){return this.gD},function(a){this.gD=a}); -function yl(a){function b(a){var b=a.toLowerCase(),h=new K("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ma("string",K),d=new ma("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified"); -b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.pz=c;a.oz=d} -function Ga(a,b){var c=a.oz.oa(b);return null!==c?c:a.oz.oa(b.toLowerCase())}function Hn(a,b){var c=a.pz.oa(b);if(null!==c)return c;c=a.pz.oa(b.toLowerCase());if(null!==c)return c;D.k("Unknown DiagramEvent name: "+b);return null}E.prototype.addDiagramListener=E.prototype.mA=function(a,b){D.h(a,"string",E,"addDiagramListener:name");D.h(b,"function",E,"addDiagramListener:listener");var c=Hn(this,a);null!==c&&c.add(b)}; -E.prototype.removeDiagramListener=E.prototype.uG=function(a,b){D.h(a,"string",E,"removeDiagramListener:name");D.h(b,"function",E,"addDiagramListener:listener");var c=Hn(this,a);null!==c&&c.remove(b)}; -E.prototype.raiseDiagramEvent=E.prototype.Ja=function(a,b,c){v&&D.h(a,"string",E,"raiseDiagramEvent:name");var d=Hn(this,a),e=new ag;e.g=this;a=Ga(this,a);null!==a&&(e.name=a);void 0!==b&&(e.LB=b);void 0!==c&&(e.qB=c);b=d.length;if(1===b)d=d.ea(0),d(e);else if(0!==b)for(c=d.lc(),a=0;a=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.xb,g=a.scale,e=D.gh(0,0,e.width*g,e.height*g),h=D.Fb(0,0);if(b.x>=e.x&&b.xe.x+e.width-d.right&&(k=Math.max(a.Xu,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.ye.y+e.height-d.bottom&&(k=Math.max(a.Yu,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Sc(Gd)||(c=new O(c.x+h.x/g,c.y+h.y/g));D.Mb(e);D.A(h);return c}E.prototype.makeSvg=E.prototype.makeSVG=function(a){void 0===a&&(a=new la);a.context="svg";a=Pn(this,a);return null!==a?a.Am:null}; -E.prototype.makeImage=function(a){void 0===a&&(a=new la);var b=(a.document||document).createElement("img");b.src=this.wJ(a);return b}; -E.prototype.makeImageData=E.prototype.wJ=function(a){void 0===a&&(a=new la);var b=Pn(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.Ok.getImageData(0,0,b.width,b.height);case "blob":b=b.Ud;c=a.callback;if("function"!==typeof c){D.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.toBlob)return b.toBlob(c,a.type,a.details),"toBlob";if("function"=== -typeof b.msToBlob)return c(b.msToBlob()),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var Qn=!1; -function Pn(a,b){a.Xa.Ii();a.gg();if(null===a.Lb)return null;"object"!==typeof b&&D.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var g=b.maxSize;void 0===b.maxSize&&(c=!0,g="svg"===b.context?new Ca(Infinity,Infinity):new Ca(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r= -b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new Hb(l):l instanceof Hb||(l=new Hb(0));l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.Yo=!1;a.md.Be(!0);var s=new ka(null,p),u=s.Ok;if(!(d||e||k||h)){s.width=a.Ob+Math.ceil(l.left+l.right);s.height=a.Rb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return u=new nd(s.Ud,p,q),Nm(a,u,l,new Ca(s.width, -s.height),a.Bb,a.qb,k,m,r,n),a.Yo=!0,u;Nm(a,u,l,new Ca(s.width,s.height),a.Bb,a.qb,k,m,r,n);a.Yo=!0;return s}var t=a.wb.zx,y=new O(0,0),w=a.cd.copy();w.oK(a.padding);if(r)for(var C=!0,C=a.bc.o,A=C.length,N=0;Nt?(e=t,h=w.width,ba=w.height):(h=g.width,ba=g.height)):(h=w.width*e,ba=w.height*e):(e=t,h=w.width,ba=w.height);null!==l?(h+=S,ba+=C):l=new Hb(0);null!==g&&(d=g.width,g=g.height,"svg"!==b.context&&c&&!Qn&&(h>d||ba>g)&&(D.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(ba)+" vs 2000x2000) Consider increasing the max size."), -Qn=!0),isNaN(d)&&(d=2E3),isNaN(g)&&(g=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(g)&&(ba=Math.min(ba,g)));s.width=Math.ceil(h);s.height=Math.ceil(ba);if("svg"===b.context)return u=new nd(s.Ud,p,q),Nm(a,u,l,new Ca(Math.ceil(h),Math.ceil(ba)),e,y,k,m,r,n),a.Yo=!0,u;Nm(a,u,l,new Ca(Math.ceil(h),Math.ceil(ba)),e,y,k,m,r,n);a.Yo=!0;return s}E.inherit=function(a,b){D.h(a,"function",E,"inherit");D.h(b,"function",E,"inherit");b.BH&&D.k("Cannot inherit from "+D.qf(b));D.Sa(a,b)}; -function Hl(){this.cE=null;this.DH="63ad05bbe23a1786468a4c741b6d2";this.Xi=this.DH===this._tk?!0:null} -function Rn(a){var b="f",c=window[D.Tg("76a715b2f73f148a")][D.Tg("72ba13b5")],d=D.Tg;if(window[d("7da7")]&&window[d("7da7")][d("76a115b6ed251eaf4692")]){a.Xi=!0;var e=window[d("7da7")][d("76a115b6ed251eaf4692")],e=d(e).split(d("39e9"));if(6>e.length)return;var g=d(e[1]).split(".");if("7da71ca0"!==e[4])return;var h=d(D[d("6cae19")]).split(".");if(g[0]>h[0]||g[0]===h[0]&&g[1]>=h[1]){g=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h +E.prototype.tq=function(a){if(a instanceof G){if(this.Ep.add(a),a instanceof I){var b=a.Pa;null===b?this.Tl.add(a):b.en.add(a);b=a.Vb;null!==b&&(b.g=this)}}else a instanceof J?this.yp.add(a):a instanceof da||this.qb.add(a);var c=this;Tm(a,function(a){Um(c,a)});(a instanceof da||a instanceof I&&null!==a.Qb)&&a.K();b=a.data;null!==b&&(a instanceof da||(a instanceof J?this.ck.add(b,a):this.Ti.add(b,a)),Tm(a,function(a){Vm(c,a)}));!0!==Km(a)&&!0!==Lm(a)||this.Eg.add(a);Wm(a,!0,this);Xm(a)?(a.$.F()&&this.qa(vl(a, +a.$)),this.zc()):a.isVisible()&&a.$.F()&&this.qa(vl(a,a.$));this.Se()}; +E.prototype.rf=function(a){a.Yt();if(a instanceof G){if(this.Ep.remove(a),a instanceof I){var b=a.Pa;null===b?this.Tl.remove(a):b.en.remove(a);b=a.Vb;null!==b&&(b.g=null)}}else a instanceof J?this.yp.remove(a):a instanceof da||this.qb.remove(a);var c=this;Tm(a,function(a){Ym(c,a)});b=a.data;null!==b&&(a instanceof da||(a instanceof J?this.ck.remove(b):this.Ti.remove(b)),Tm(a,function(a){Zm(c,a)}));this.Eg.remove(a);Xm(a)?(a.$.F()&&this.qa(vl(a,a.$)),this.zc()):a.isVisible()&&a.$.F()&&this.qa(vl(a, +a.$));this.Se()};E.prototype.remove=E.prototype.remove=function(a){D.l(a,F,E,"remove:part");$m(this,a,!0)};function $m(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.hb=!1,b.Yg=!1,b.N(an),c&&b.On(),c=d.rf(-1,b,!1),0<=c&&a.hd(og,"parts",d,b,null,c,null),a=b.ay,null!==a&&a(b,d,null))} +E.prototype.removeParts=E.prototype.zB=function(a,b){if(D.isArray(a))for(var c=D.cb(a),d=0;dd&&this.zc()}; +E.prototype.addLayerAfter=function(a,b){bn(this,a,b);a.Yc(this);var c=this.cc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ve&&this.hd(og,"layers",this,a,null,d,null));for(var e=c.count,g=0;gd&&this.zc()}; +E.prototype.removeLayer=function(a){D.l(a,Ug,E,"removeLayer:layer");a.g!==this&&D.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.cc,c=b.indexOf(a);if(b.remove(a)){for(b=a.qb.copy().j;b.next();){var d=b.value,e=d.Kf;d.Kf=e!==a.name?e:""}null!==this.ve&&this.hd(og,"layers",this,a,null,c,null);this.qa();this.zc()}}};E.prototype.findLayer=E.prototype.km=function(a){for(var b=this.co;b.next();){var c=b.value;if(c.name===a)return c}return null}; +E.prototype.addModelChangedListener=E.prototype.QH=function(a){D.h(a,"function",E,"addModelChangedListener:listener");null===this.wh&&(this.wh=new K("function"));this.wh.add(a);this.ga.An(a)};E.prototype.removeModelChangedListener=function(a){D.h(a,"function",E,"removeModelChangedListener:listener");null!==this.wh&&(this.wh.remove(a),0===this.wh.count&&(this.wh=null));this.ga.Ru(a)}; +E.prototype.addChangedListener=E.prototype.An=function(a){D.h(a,"function",E,"addChangedListener:listener");null===this.Oi&&(this.Oi=new K("function"));this.Oi.add(a)};E.prototype.removeChangedListener=E.prototype.Ru=function(a){D.h(a,"function",E,"removeChangedListener:listener");null!==this.Oi&&(this.Oi.remove(a),0===this.Oi.count&&(this.Oi=null))}; +E.prototype.px=function(a){this.Eb||this.ra.HF(a);a.Jc!==cg&&(this.Fi=!0);if(null!==this.Oi){var b=this.Oi,c=b.length;if(1===c)b=b.ea(0),b(a);else if(0!==c)for(var d=b.mc(),e=0;ea.Qh&&(c=a.Qh);e=D.Fb(a.rb.x+h/b-h/c,a.rb.y+k/b-k/c);a.position=e;D.A(e);a.Bb=c;a.Ou(d,a.ub,b,c,!1);a.$c=!1;Wl(a, +!1);c=a.Xa;c.wc&&ql(c,b,a.Bb);a.qa();fm(a)}} +E.prototype.Ou=function(a,b,c,d,e){a.P(b)||(void 0===e&&(e=!1),e||fm(this),Ul(this),d=this.Vb,null===d||!d.Yx||this.bm!==Rh||e||a.width===b.width&&a.height===b.height||d.N(),d=this.gb,!0===this.Um&&d instanceof Lh&&(this.U.ha=this.YB(this.U.qe),Jk(d,this)),this.$c||this.MF(a,b),im(this),this.Fh.scale=c,this.Fh.position.x=a.x,this.Fh.position.y=a.y,this.Fh.bounds.set(a),this.Fh.isScroll=e,this.Ja("ViewportBoundsChanged",this.Fh,a),this.dB&&this.links.each(function(a){a.Oh&&a.$.fg(b)&&a.gc()}))}; +function im(a,b){void 0===b&&(b=null);var c=a.Ad;if(null!==c&&c.visible){for(var d=D.Cm(),e=1,g=1,h=c.ya.o,k=h.length,l=0;ln||(dn(m.Jb)?g=g*n/We(g,n):e=e*n/We(e,n))}h=c.Nx;d.n(g*h.width,e*h.height);h=g=l=k=0;if(null!==b)k=b.width,l=b.height,g=b.x,h=b.y;else{e=D.Of();g=a.ub;e.n(g.x,g.y,g.width,g.height);for(h=a.Bw.j;h.next();)g=h.value.ub,g.F()&&Pb(e,g.x,g.y,g.width,g.height);if(!e.F()){D.Kb(e);return}k=e.width;l=e.height;g=e.x;h=e.y;D.Kb(e)}c.width=k+2*d.width;c.height= +l+2*d.height;e=D.O();fb(g,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);D.Rk(d);c.Y.location=e;D.A(e)}}E.prototype.clearSelection=E.prototype.sx=function(){var a=0a&&D.ua(a,">= 0",E,"scrollHorizontalLineChange"),this.Kw=a,this.i("scrollHorizontalLineChange",b,a))}); +D.defineProperty(E,{Xu:"scrollVerticalLineChange"},function(){return this.Ow},function(a){var b=this.Ow;b!==a&&(D.h(a,"number",E,"scrollVerticalLineChange"),0>a&&D.ua(a,">= 0",E,"scrollVerticalLineChange"),this.Ow=a,this.i("scrollVerticalLineChange",b,a))});D.defineProperty(E,{U:"lastInput"},function(){return this.Tb},function(a){v&&D.l(a,Yf,E,"lastInput");this.Tb=a});D.defineProperty(E,{Kc:"firstInput"},function(){return this.Zi},function(a){v&&D.l(a,Yf,E,"firstInput");this.Zi=a}); +D.defineProperty(E,{kc:"currentCursor"},function(){return this.Ev},function(a){""===a&&(a=this.Fr);var b=this.Ev;if(b!==a){D.h(a,"string",E,"currentCursor");var c=this.Mb,d=this.Sb;null!==c&&(this.Ev=a,c.style.cursor=a,d.style.cursor=a,c.style.cursor===b&&(c.style.cursor="-webkit-"+a,d.style.cursor="-webkit-"+a,c.style.cursor===b&&(c.style.cursor="-moz-"+a,d.style.cursor="-moz-"+a,c.style.cursor===b&&(c.style.cursor=a,d.style.cursor=a))))}}); +D.defineProperty(E,{nL:"defaultCursor"},function(){return this.Fr},function(a){""===a&&(a="auto");var b=this.Fr;b!==a&&(D.h(a,"string",E,"defaultCursor"),this.Fr=a,this.i("defaultCursor",b,a))});D.defineProperty(E,{click:"click"},function(){return this.Pi},function(a){var b=this.Pi;b!==a&&(null!==a&&D.h(a,"function",E,"click"),this.Pi=a,this.i("click",b,a))}); +D.defineProperty(E,{cu:"doubleClick"},function(){return this.Wi},function(a){var b=this.Wi;b!==a&&(null!==a&&D.h(a,"function",E,"doubleClick"),this.Wi=a,this.i("doubleClick",b,a))});D.defineProperty(E,{wA:"contextClick"},function(){return this.Ri},function(a){var b=this.Ri;b!==a&&(null!==a&&D.h(a,"function",E,"contextClick"),this.Ri=a,this.i("contextClick",b,a))}); +D.defineProperty(E,{oB:"mouseOver"},function(){return this.lj},function(a){var b=this.lj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseOver"),this.lj=a,this.i("mouseOver",b,a))});D.defineProperty(E,{nB:"mouseHover"},function(){return this.kj},function(a){var b=this.kj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHover"),this.kj=a,this.i("mouseHover",b,a))}); +D.defineProperty(E,{mB:"mouseHold"},function(){return this.jj},function(a){var b=this.jj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHold"),this.jj=a,this.i("mouseHold",b,a))});D.defineProperty(E,{NJ:"mouseDragOver"},function(){return this.ww},function(a){var b=this.ww;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDragOver"),this.ww=a,this.i("mouseDragOver",b,a))}); +D.defineProperty(E,{lB:"mouseDrop"},function(){return this.ij},function(a){var b=this.ij;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDrop"),this.ij=a,this.i("mouseDrop",b,a))});D.defineProperty(E,{TB:"toolTip"},function(){return this.uj},function(a){var b=this.uj;b!==a&&(!v||null===a||a instanceof da||a instanceof fk||D.k("Diagram.toolTip must be an Adornment or HTMLInfo."),this.uj=a,this.i("toolTip",b,a))}); +D.defineProperty(E,{contextMenu:"contextMenu"},function(){return this.Si},function(a){var b=this.Si;b!==a&&(!v||a instanceof da||a instanceof fk||D.k("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Si=a,this.i("contextMenu",b,a))});D.defineProperty(E,{xb:"commandHandler"},function(){return this.fz},function(a){var b=this.fz;b!==a&&(D.l(a,oa,E,"commandHandler"),null!==a.g&&D.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Yc(null),this.fz=a,a.Yc(this))}); +D.defineProperty(E,{kb:"toolManager"},function(){return this.hA},function(a){var b=this.hA;b!==a&&(D.l(a,Lh,E,"toolManager"),null!==a.g&&D.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Yc(null),this.hA=a,a.Yc(this))});D.defineProperty(E,{bu:"defaultTool"},function(){return this.lz},function(a){var b=this.lz;b!==a&&(D.l(a,Vg,E,"defaultTool"),this.lz=a,this.gb===b&&(this.gb=a))}); +D.defineProperty(E,{gb:"currentTool"},function(){return this.iz},function(a){var b=this.iz;null!==b&&(b.wa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.bu);null!==a&&(D.l(a,Vg,E,"currentTool"),this.iz=a,a.Yc(this),a.doStart())});D.w(E,{selection:"selection"},function(){return this.Rw}); +D.defineProperty(E,{EJ:"maxSelectionCount"},function(){return this.rw},function(a){var b=this.rw;if(b!==a)if(D.h(a,"number",E,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.rw=a,this.i("maxSelectionCount",b,a),!this.ra.ob&&(a=this.selection.count-a,0= 0",E,"maxSelectionCount")}); +D.defineProperty(E,{PJ:"nodeSelectionAdornmentTemplate"},function(){return this.xw},function(a){var b=this.xw;b!==a&&(D.l(a,da,E,"nodeSelectionAdornmentTemplate"),this.xw=a,this.i("nodeSelectionAdornmentTemplate",b,a))});D.defineProperty(E,{WI:"groupSelectionAdornmentTemplate"},function(){return this.Uv},function(a){var b=this.Uv;b!==a&&(D.l(a,da,E,"groupSelectionAdornmentTemplate"),this.Uv=a,this.i("groupSelectionAdornmentTemplate",b,a))}); +D.defineProperty(E,{yJ:"linkSelectionAdornmentTemplate"},function(){return this.mw},function(a){var b=this.mw;b!==a&&(D.l(a,da,E,"linkSelectionAdornmentTemplate"),this.mw=a,this.i("linkSelectionAdornmentTemplate",b,a))});D.w(E,{rm:"highlighteds"},function(){return this.Yv}); +D.defineProperty(E,{Fi:"isModified"},function(){var a=this.ra;return a.isEnabled?null!==a.Dj?!0:this.ew&&this.sh!==a.Ij:this.ew},function(a){if(this.ew!==a){D.h(a,"boolean",E,"isModified");this.ew=a;var b=this.ra;!a&&b.isEnabled&&(this.sh=b.Ij);a||gn(this)}});function gn(a){var b=a.Fi;a.xE!==b&&(a.xE=b,a.Ja("Modified"))} +D.defineProperty(E,{ga:"model"},function(){return this.ve},function(a){var b=this.ve;if(b!==a){D.l(a,M,E,"model");this.gb.doCancel();null!==b&&b.ra!==a.ra&&b.ra.UF&&D.k("Do not replace a Diagram.model while a transaction is in progress.");this.Xa.Ii();this.sx();this.th=!1;this.ep=!0;this.sh=-2;this.Zf=!1;var c=this.ge;this.ge=!0;this.Xa.qo("Model");null!==b&&(null!==this.wh&&this.wh.each(function(a){b.Ru(a)}),b.Ru(this.DD),b instanceof Y&&hn(this,b.Zg),hn(this,b.ng));this.ve=a;a.An(this.CD);jn(this, +a.ng);a instanceof Y&&kn(this,a.Zg);a.Ru(this.CD);a.An(this.DD);null!==this.wh&&this.wh.each(function(b){a.An(b)});this.ge=c;this.$c||this.qa();null!==b&&(a.ra.isEnabled=b.ra.isEnabled)}});D.defineProperty(E,{ab:null},function(){return this.uD},function(a){this.uD=a});D.w(E,{gy:null},function(){return this.wH}); +function El(a,b){if(b.ga===a.ga){var c=b.Jc,d=b.propertyName;if(c===cg&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.kb,c.lf.each(function(b){b.Yc(a)}),c.jg.each(function(b){b.Yc(a)}),c.kg.each(function(b){b.Yc(a)}),a.ge||a.th||(a.Lv=!0,a.ep&&(a.Zf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Xa;e.sf&&!a.Eb&&e.Ii();a.Ja("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Xa,e.sf&&!a.Eb&&e.Ii());else if(a.ab){a.ab=!1;try{var g=b.wf;if(""!==g)if(c===bg){if("linkFromKey"===g){var h= +b.object,k=a.cg(h);if(null!==k){var l=b.newValue,m=a.Qe(l);k.aa=m}}else if("linkToKey"===g)h=b.object,k=a.cg(h),null!==k&&(l=b.newValue,m=a.Qe(l),k.da=m);else if("linkFromPortId"===g){if(h=b.object,k=a.cg(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.dg=n)}}else if("linkToPortId"===g)h=b.object,k=a.cg(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.jh=n));else if("nodeGroupKey"===g){var h=b.object,p=a.Nh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Qe(q);p.Pa=r instanceof I? +r:null}else p.Pa=null}}else if("linkLabelKeys"===g){if(h=b.object,k=a.cg(h),null!==k){var s=b.oldValue,u=b.newValue;if(D.isArray(s))for(var t=D.cb(s),y=0;yl)){var m=l;rn(k)&&m++;k.rf(m);sn(k,m,l)}}}}function Vm(a,b){var c=b.cj;if(D.isArray(c)){var d=a.Wm.na(c);if(null===d)d=[],d.push(b),a.Wm.add(c,d);else{for(c=0;cthis.scale&&(this.scale=a)):D.ua(a,"> 0",E,"minScale"))});D.defineProperty(E,{Qh:"maxScale"},function(){return this.qw},function(a){D.p(a,E,"maxScale");var b=this.qw;b!==a&&(0 0",E,"maxScale"))}); +D.defineProperty(E,{Fm:"zoomPoint"},function(){return this.gx},function(a){this.gx.P(a)||(D.l(a,O,E,"zoomPoint"),this.gx=a=a.V())});D.defineProperty(E,{UE:"contentAlignment"},function(){return this.Po},function(a){var b=this.Po;b.P(a)||(D.l(a,R,E,"contentAlignment"),this.Po=a=a.V(),this.i("contentAlignment",b,a),Wl(this,!1))}); +D.defineProperty(E,{JL:"initialContentAlignment"},function(){return this.kp},function(a){var b=this.kp;b.P(a)||(D.l(a,R,E,"initialContentAlignment"),this.kp=a=a.V(),this.i("initialContentAlignment",b,a))});D.defineProperty(E,{padding:"padding"},function(){return this.of},function(a){"number"===typeof a?a=new Ib(a):D.l(a,Ib,E,"padding");var b=this.of;b.P(a)||(this.of=a=a.V(),this.zc(),this.i("padding",b,a))});D.w(E,{og:"nodes"},function(){return this.Ep.j});D.w(E,{links:"links"},function(){return this.yp.j}); +D.w(E,{Gi:"parts"},function(){return this.qb.j});E.prototype.findTopLevelNodesAndLinks=function(){for(var a=new L(F),b=this.Ep.j;b.next();){var c=b.value;c.yq&&a.add(c)}for(b=this.yp.j;b.next();)c=b.value,c.yq&&a.add(c);return a.j};E.prototype.findTopLevelGroups=function(){return this.Tl.j}; +D.defineProperty(E,{Vb:"layout"},function(){return this.te},function(a){var b=this.te;b!==a&&(D.l(a,Wg,E,"layout"),null!==b&&(b.g=null,b.group=null),this.te=a,a.g=this,a.group=null,this.vv=!0,this.i("layout",b,a),this.Se())});E.prototype.layoutDiagram=function(a){Si(this);a&&xn(this,!0);jm(this,!1)};function xn(a,b){for(var c=a.Tl.j;c.next();)Fn(a,c.value,b);null!==a.Vb&&(b?a.Vb.If=!1:a.Vb.N())} +function Fn(a,b,c){if(null!==b){for(var d=b.en.j;d.next();)Fn(a,d.value,c);null!==b.Vb&&(c?b.Vb.If=!1:b.Vb.N())}}function jm(a,b){if(!a.mz){var c=a.Vb,d=a.ab;a.ab=!0;try{var e=a.ra.Wh;0===e&&a.ac("Layout");var g=a.Xa;1!==a.ra.Wh||g.sf||g.wc||b||g.qo("Layout");for(var h=a.Tl.j;h.next();)Gn(a,h.value,b);c.If||b&&!c.XF&&0!==e||(c.doLayout(a),Si(a),c.If=!0)}finally{0===e&&a.Td("Layout"),a.vv=!c.If,a.ab=d}}} +function Gn(a,b,c){if(null!==b){for(var d=b.en.j;d.next();)Gn(a,d.value,c);d=b.Vb;null===d||d.If||c&&!d.XF||(b.oo=!b.location.F(),d.doLayout(b),b.N(Hn),d.If=!0,Im(a,b))}}D.defineProperty(E,{$d:"isTreePathToChildren"},function(){return this.hw},function(a){var b=this.hw;if(b!==a&&(D.h(a,"boolean",E,"isTreePathToChildren"),this.hw=a,this.i("isTreePathToChildren",b,a),!this.ra.ob))for(a=this.og;a.next();)In(a.value)}); +E.prototype.findTreeRoots=function(){for(var a=new K(G),b=this.og;b.next();){var c=b.value;c.yq&&null===c.Rn()&&a.add(c)}return a.j};D.defineProperty(E,{ZB:"treeCollapsePolicy"},function(){return this.Zw},function(a){var b=this.Zw;b!==a&&(a!==Cl&&a!==en&&a!==fn&&D.k("Unknown Diagram.treeCollapsePolicy: "+a),this.Zw=a,this.i("treeCollapsePolicy",b,a))});D.defineProperty(E,{Ph:null},function(){return this.jD},function(a){this.jD=a}); +function Bl(a){function b(a){var b=a.toLowerCase(),h=new K("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ma("string",K),d=new ma("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified"); +b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.oz=c;a.nz=d} +function Ga(a,b){var c=a.nz.na(b);return null!==c?c:a.nz.na(b.toLowerCase())}function Jn(a,b){var c=a.oz.na(b);if(null!==c)return c;c=a.oz.na(b.toLowerCase());if(null!==c)return c;D.k("Unknown DiagramEvent name: "+b);return null}E.prototype.addDiagramListener=E.prototype.oA=function(a,b){D.h(a,"string",E,"addDiagramListener:name");D.h(b,"function",E,"addDiagramListener:listener");var c=Jn(this,a);null!==c&&c.add(b)}; +E.prototype.removeDiagramListener=E.prototype.xG=function(a,b){D.h(a,"string",E,"removeDiagramListener:name");D.h(b,"function",E,"addDiagramListener:listener");var c=Jn(this,a);null!==c&&c.remove(b)}; +E.prototype.raiseDiagramEvent=E.prototype.Ja=function(a,b,c){v&&D.h(a,"string",E,"raiseDiagramEvent:name");var d=Jn(this,a),e=new $f;e.g=this;a=Ga(this,a);null!==a&&(e.name=a);void 0!==b&&(e.PB=b);void 0!==c&&(e.uB=c);b=d.length;if(1===b)d=d.ea(0),d(e);else if(0!==b)for(c=d.mc(),a=0;a=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.ub,g=a.scale,e=D.sg(0,0,e.width*g,e.height*g),h=D.Fb(0,0);if(b.x>=e.x&&b.xe.x+e.width-d.right&&(k=Math.max(a.Wu,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.ye.y+e.height-d.bottom&&(k=Math.max(a.Xu,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Tc(Gd)||(c=new O(c.x+h.x/g,c.y+h.y/g));D.Kb(e);D.A(h);return c}E.prototype.makeSvg=E.prototype.makeSVG=function(a){void 0===a&&(a=new la);a.context="svg";a=Qn(this,a);return null!==a?a.Am:null}; +E.prototype.makeImage=function(a){void 0===a&&(a=new la);var b=(a.document||document).createElement("img");b.src=this.zJ(a);return b}; +E.prototype.makeImageData=E.prototype.zJ=function(a){void 0===a&&(a=new la);var b=Qn(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.Ok.getImageData(0,0,b.width,b.height);case "blob":b=b.Ud;c=a.callback;if("function"!==typeof c){D.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.toBlob)return b.toBlob(c,a.type,a.details),"toBlob";if("function"=== +typeof b.msToBlob)return c(b.msToBlob()),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var Rn=!1; +function Qn(a,b){a.Xa.Ii();a.hg();if(null===a.Mb)return null;"object"!==typeof b&&D.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var g=b.maxSize;void 0===b.maxSize&&(c=!0,g="svg"===b.context?new Ca(Infinity,Infinity):new Ca(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r= +b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new Ib(l):l instanceof Ib||(l=new Ib(0));l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.$o=!1;a.od.Be(!0);var s=new ka(null,p),u=s.Ok;if(!(d||e||k||h)){s.width=a.Ob+Math.ceil(l.left+l.right);s.height=a.Rb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return u=new od(s.Ud,p,q),Pm(a,u,l,new Ca(s.width, +s.height),a.Bb,a.rb,k,m,r,n),a.$o=!0,u;Pm(a,u,l,new Ca(s.width,s.height),a.Bb,a.rb,k,m,r,n);a.$o=!0;return s}var t=a.xb.yx,y=new O(0,0),w=a.dd.copy();w.rK(a.padding);if(r)for(var C=!0,C=a.cc.o,A=C.length,N=0;Nt?(e=t,h=w.width,ba=w.height):(h=g.width,ba=g.height)):(h=w.width*e,ba=w.height*e):(e=t,h=w.width,ba=w.height);null!==l?(h+=S,ba+=C):l=new Ib(0);null!==g&&(d=g.width,g=g.height,"svg"!==b.context&&c&&!Rn&&(h>d||ba>g)&&(D.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(ba)+" vs 2000x2000) Consider increasing the max size."), +Rn=!0),isNaN(d)&&(d=2E3),isNaN(g)&&(g=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(g)&&(ba=Math.min(ba,g)));s.width=Math.ceil(h);s.height=Math.ceil(ba);if("svg"===b.context)return u=new od(s.Ud,p,q),Pm(a,u,l,new Ca(Math.ceil(h),Math.ceil(ba)),e,y,k,m,r,n),a.$o=!0,u;Pm(a,u,l,new Ca(Math.ceil(h),Math.ceil(ba)),e,y,k,m,r,n);a.$o=!0;return s}E.inherit=function(a,b){D.h(a,"function",E,"inherit");D.h(b,"function",E,"inherit");b.EH&&D.k("Cannot inherit from "+D.qf(b));D.Sa(a,b)}; +function Kl(){this.fE=null;this.GH="63ad05bbe23a1786468a4c741b6d2";this.Xi=this.GH===this._tk?!0:null} +function Sn(a){var b="f",c=window[D.Vg("76a715b2f73f148a")][D.Vg("72ba13b5")],d=D.Vg;if(window[d("7da7")]&&window[d("7da7")][d("76a115b6ed251eaf4692")]){a.Xi=!0;var e=window[d("7da7")][d("76a115b6ed251eaf4692")],e=d(e).split(d("39e9"));if(6>e.length)return;var g=d(e[1]).split(".");if("7da71ca0"!==e[4])return;var h=d(D[d("6cae19")]).split(".");if(g[0]>h[0]||g[0]===h[0]&&g[1]>=h[1]){g=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h g&&d(e[2])!==d("7da71ca0ad381e90")&&(g=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));0>g&&(g=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Xi=!(0<=g&&gg&&d(D.adym)!==d("7da71ca0ad381e90")&&(g=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Xi=!(0<=g&&gb.timeStamp-a.Ym)b.preventDefault();else if(a.Al)b.preventDefault();else{a.bd=a.Tb;a.Tb=c;Zl(a,a,b,c,!0);c.im=!0;c.Oe=b.detail;if(D.OF||D.PF)b.timeStamp-a.Ymb.timeStamp-a.Ym){b.preventDefault();return}a.Ym=b.timeStamp}if(D.Xn&&null!==a.ut)a.ut=null,b.preventDefault();else{a.bd=a.Tb;a.Tb=c;Zl(a,a,b, -c,!0);c.up=!0;c.Oe=b.detail;if(D.OF||D.PF)c.Oe=a.Dl;c.bubbles=b.bubbles;b.target.ba&&(c.fh=b.target.ba);a.simulatedMouseUp(b,null,new O,c.fh)||(a.doMouseUp(),yi(a),ga(a,c,b))}}};a.Zg=function(b){if(a.isEnabled){var c=a.bd;a.bd=a.Tb;a.Tb=c;Zl(a,a,b,c,!0);c.bubbles=!0;c.hm=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();ga(a,c,b)}};a.ko=function(){if(a.isEnabled){a.Um=!1;var b=a.gb;b.cancelWaitAfter();b instanceof Hh&&b.hideToolTip()}};a.SB=function(b){if(a.isEnabled){a.Dt=!1;a.Al= -!0;var c=a.bd;a.bd=a.Tb;a.Tb=c;am(a,b,b.targetTouches[0],c,1a.Gw)){var c=a.pj;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.bd,a.bd=a.Tb,a.Tb=c,bm(a,b,b,c,!0),a.simulatedMouseMove(b,null,c.fh)||(a.doMouseMove(),ga(a,c,b)))}};a.nG=function(b){if("touch"===b.pointerType){var c=a.QD;void 0!==c[b.pointerId]&&(a.Gw--,delete c[b.pointerId],c=a.pj,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};d.Be(!0);Ll(a)} -function Sn(a){1a)&&D.ua(a,"0 <= loc <= 1",Ba,"addColorStop:loc");D.h(b,"string",Ba,"addColorStop:color");v&&!Aa(b)&&D.k('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.qh&&(this.qh=new ma("number","string"));this.qh.add(a,b);this.ca===Ag&&(this.type=Qg);this.rh=null}; -D.defineProperty(Ba,{type:"type"},function(){return this.ca},function(a){this.J&&D.pa(this,a);D.Ca(a,Ba,Ba,"type");this.ca=a;this.start.Zd()&&(a===Qg?this.start=dc:a===Ed&&(this.start=gc));this.end.Zd()&&(a===Qg?this.end=qc:a===Ed&&(this.end=gc));this.rh=null});D.defineProperty(Ba,{color:"color"},function(){return this.Lo},function(a){this.J&&D.pa(this,a);v&&!Aa(a)&&D.k('Color "'+a+'" is not a valid color string for Brush.color');this.Lo=a;this.rh=null}); -D.defineProperty(Ba,{start:"start"},function(){return this.Op},function(a){this.J&&D.pa(this,a);D.l(a,R,Ba,"start");this.Op=a.V();this.rh=null});D.defineProperty(Ba,{end:"end"},function(){return this.$o},function(a){this.J&&D.pa(this,a);D.l(a,R,Ba,"end");this.$o=a.V();this.rh=null});D.defineProperty(Ba,{dv:"startRadius"},function(){return this.Vw},function(a){this.J&&D.pa(this,a);D.p(a,Ba,"startRadius");0>a&&D.ua(a,">= zero",Ba,"startRadius");this.Vw=a;this.rh=null}); -D.defineProperty(Ba,{eu:"endRadius"},function(){return this.Rv},function(a){this.J&&D.pa(this,a);D.p(a,Ba,"endRadius");0>a&&D.ua(a,">= zero",Ba,"endRadius");this.Rv=a;this.rh=null});D.defineProperty(Ba,{Lk:"colorStops"},function(){return this.qh},function(a){this.J&&D.pa(this,a);v&&D.l(a,ma,Ba,"colorStops");this.qh=a;this.rh=null});D.defineProperty(Ba,{pattern:"pattern"},function(){return this.Fw},function(a){this.J&&D.pa(this,a);this.Fw=a;this.rh=null}); +c=d("02cncncn"),"."===c[0]&&(c=c[d("69bd14a0f724128a44")](1)),b[d("79a417a0f0181a8946")]=c,window.document[d("78a712aa")]?(window.document[d("78a712aa")][d("7bb806b6ed32388c4a875b")](b),c=window[d("7dad0290ec3b0b91578e5b40007031bf")](b)[d("7dad0283f1390b81519f4645156528bf")](d("78a704b7e62456904c9b12701b6532a8")),window.document[d("78a712aa")][d("68ad1bbcf533388c4a875b")](b),c&&-1!==c.indexOf(d(D.cI))&&-1!==c.indexOf(d(D.dI))&&(a.Xi=!1)):(a.Xi=null,a.Xi=!1))} +Kl.prototype.Em=function(a){a.od.setTransform(a.qd,0,0,a.qd,0,0);null===this.Xi&&Sn(this);return 0b.timeStamp-a.Ym)b.preventDefault();else if(a.Cl)b.preventDefault();else{a.cd=a.Tb;a.Tb=c;bm(a,a,b,c,!0);c.jm=!0;c.Oe=b.detail;if(D.RF||D.SF)b.timeStamp-a.Ymb.timeStamp-a.Ym){b.preventDefault();return}a.Ym=b.timeStamp}if(D.Zn&&null!==a.ut)a.ut=null,b.preventDefault();else{a.cd=a.Tb;a.Tb=c;bm(a, +a,b,c,!0);c.up=!0;c.Oe=b.detail;if(D.RF||D.SF)c.Oe=a.Fl;c.bubbles=b.bubbles;b.target.ba&&(c.gh=b.target.ba);a.simulatedMouseUp(b,null,new O,c.gh)||(a.doMouseUp(),Di(a),ga(a,c,b))}}};a.$g=function(b){if(a.isEnabled){var c=a.cd;a.cd=a.Tb;a.Tb=c;bm(a,a,b,c,!0);c.bubbles=!0;c.im=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();ga(a,c,b)}};a.mo=function(){if(a.isEnabled){a.Um=!1;var b=a.gb;b.cancelWaitAfter();b instanceof Lh&&b.hideToolTip()}};a.WB=function(b){if(a.isEnabled){a.Ct=!1;a.Cl= +!0;var c=a.cd;a.cd=a.Tb;a.Tb=c;dm(a,b,b.targetTouches[0],c,1a.Fw)){var c=a.pj;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.cd,a.cd=a.Tb,a.Tb=c,em(a,b,b,c,!0),a.simulatedMouseMove(b,null,c.gh)||(a.doMouseMove(),ga(a,c,b)))}};a.qG=function(b){if("touch"===b.pointerType){var c=a.TD;void 0!==c[b.pointerId]&&(a.Fw--,delete c[b.pointerId],c=a.pj,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};d.Be(!0);Ol(a)} +function Tn(a){1a)&&D.ua(a,"0 <= loc <= 1",Ba,"addColorStop:loc");D.h(b,"string",Ba,"addColorStop:color");v&&!Aa(b)&&D.k('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.qh&&(this.qh=new ma("number","string"));this.qh.add(a,b);this.ca===Bg&&(this.type=Cg);this.rh=null}; +D.defineProperty(Ba,{type:"type"},function(){return this.ca},function(a){this.J&&D.pa(this,a);D.Da(a,Ba,Ba,"type");this.ca=a;this.start.Zd()&&(a===Cg?this.start=ec:a===Ed&&(this.start=hc));this.end.Zd()&&(a===Cg?this.end=tc:a===Ed&&(this.end=hc));this.rh=null});D.defineProperty(Ba,{color:"color"},function(){return this.No},function(a){this.J&&D.pa(this,a);v&&!Aa(a)&&D.k('Color "'+a+'" is not a valid color string for Brush.color');this.No=a;this.rh=null}); +D.defineProperty(Ba,{start:"start"},function(){return this.Pp},function(a){this.J&&D.pa(this,a);D.l(a,R,Ba,"start");this.Pp=a.V();this.rh=null});D.defineProperty(Ba,{end:"end"},function(){return this.bp},function(a){this.J&&D.pa(this,a);D.l(a,R,Ba,"end");this.bp=a.V();this.rh=null});D.defineProperty(Ba,{cv:"startRadius"},function(){return this.Uw},function(a){this.J&&D.pa(this,a);D.p(a,Ba,"startRadius");0>a&&D.ua(a,">= zero",Ba,"startRadius");this.Uw=a;this.rh=null}); +D.defineProperty(Ba,{du:"endRadius"},function(){return this.Qv},function(a){this.J&&D.pa(this,a);D.p(a,Ba,"endRadius");0>a&&D.ua(a,">= zero",Ba,"endRadius");this.Qv=a;this.rh=null});D.defineProperty(Ba,{Lk:"colorStops"},function(){return this.qh},function(a){this.J&&D.pa(this,a);v&&D.l(a,ma,Ba,"colorStops");this.qh=a;this.rh=null});D.defineProperty(Ba,{pattern:"pattern"},function(){return this.Ew},function(a){this.J&&D.pa(this,a);this.Ew=a;this.rh=null}); Ba.randomColor=function(a,b){void 0===a&&(a=128);v&&(D.p(a,Ba,"randomColor:min"),(0>a||255d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+ -d+e+c};var bo=(new ka(null)).Ok,Aa;Ba.isValidColor=Aa=function(a){if("black"===a)return!0;if(""===a)return!1;v&&D.h(a,"string",Ba,"isValidColor");bo.fillStyle="#000000";var b=bo.fillStyle;bo.fillStyle=a;if(bo.fillStyle!==b)return!0;bo.fillStyle="#FFFFFF";b=bo.fillStyle;bo.fillStyle=a;return bo.fillStyle!==b};var co=new Yn,eo=new Yn,fo=new Yn,ho=new Yn;Ba.lighten=function(a){return io(a)}; -Ba.prototype.lightenBy=function(a,b){this.J&&D.pa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?$n:b;if(this.type===Ag)jo(this.color),this.color=ko(c,d);else if((this.type===Qg||this.type===Ed)&&null!==this.Lk)for(var e=this.Lk.j;e.next();)jo(e.value),this.addColorStop(e.key,ko(c,d));return this};var io;Ba.lightenBy=io=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?$n:c;jo(a);return ko(b,c)};Ba.darken=function(a){return lo(a)}; -Ba.prototype.darkenBy=function(a,b){this.J&&D.pa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?$n:b;if(this.type===Ag)jo(this.color),this.color=ko(-c,d);else if((this.type===Qg||this.type===Ed)&&null!==this.Lk)for(var e=this.Lk.j;e.next();)jo(e.value),this.addColorStop(e.key,ko(-c,d));return this};var lo;Ba.darkenBy=lo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?$n:c;jo(a);return ko(-b,c)}; -function ko(a,b){switch(b){case $n:var c=100*mo(co.Nc),d=100*mo(co.Kd),e=100*mo(co.gd);fo.Nc=.4124564*c+.3575761*d+.1804375*e;fo.Kd=.2126729*c+.7151522*d+.072175*e;fo.gd=.0193339*c+.119192*d+.9503041*e;fo.lg=co.lg;c=no(fo.Nc/oo[0]);d=no(fo.Kd/oo[1]);e=no(fo.gd/oo[2]);ho.Nc=116*d-16;ho.Kd=500*(c-d);ho.gd=200*(d-e);ho.lg=fo.lg;ho.Nc=Math.min(100,Math.max(0,ho.Nc+100*a));c=(ho.Nc+16)/116;d=c-ho.gd/200;fo.Nc=oo[0]*po(ho.Kd/500+c);fo.Kd=oo[1]*(ho.Nc>qo*ro?Math.pow(c,3):ho.Nc/qo);fo.gd=oo[2]*po(d);fo.lg= -ho.lg;c=-.969266*fo.Nc+1.8760108*fo.Kd+.041556*fo.gd;d=.0556434*fo.Nc+-.2040259*fo.Kd+1.0572252*fo.gd;co.Nc=255*so((3.2404542*fo.Nc+-1.5371385*fo.Kd+-.4985314*fo.gd)/100);co.Kd=255*so(c/100);co.gd=255*so(d/100);co.lg=fo.lg;co.Nc=Math.round(co.Nc);255co.Nc&&(co.Nc=0);co.Kd=Math.round(co.Kd);255co.Kd&&(co.Kd=0);co.gd=Math.round(co.gd);255co.gd&&(co.gd=0);return"rgba("+co.Nc+", "+co.Kd+", "+co.gd+", "+co.lg+")";case ao:var e=co.Nc/255,g=co.Kd/ -255,h=co.gd/255,k=Math.max(e,g,h),d=Math.min(e,g,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(g-h)/l%6;break;case g:c=(h-e)/l+2;break;case h:c=(e-g)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}eo.Nc=Math.round(c);eo.Kd=Math.round(100*e);eo.gd=Math.round(100*d);eo.lg=co.lg;eo.gd=Math.min(100,Math.max(0,eo.gd+100*a));return"hsla("+eo.Nc+", "+eo.Kd+"%, "+eo.gd+"%, "+eo.lg+")";default:return D.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}} -function jo(a){bo.clearRect(0,0,1,1);bo.fillStyle="#000000";var b=bo.fillStyle;bo.fillStyle=a;bo.fillStyle!==b?(bo.fillRect(0,0,1,1),a=bo.getImageData(0,0,1,1).data,co.Nc=a[0],co.Kd=a[1],co.gd=a[2],co.lg=a[3]/255):(bo.fillStyle="#FFFFFF",b=bo.fillStyle,bo.fillStyle=a,bo.fillStyle===b&&v&&D.k('Color "'+a+'" is not a valid color string for RGBA color conversion'),co.Nc=0,co.Kd=0,co.gd=0,co.lg=1)}function mo(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)} -function so(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var ro=216/24389,qo=24389/27,oo=[95.047,100,108.883];function no(a){return a>ro?Math.pow(a,1/3):(qo*a+16)/116}function po(a){var b=a*a*a;return b>ro?b:(116*a-16)/qo} -function P(){D.tc(this);this.T=4225027;this.Fc=1;this.Bh=null;this.Xb="";this.hc=this.Kb=null;this.qb=(new O(NaN,NaN)).freeze();this.Ye=me;this.li=Zd;this.ki=ke;this.Hc=new Da;this.Li=new Da;this.gj=new Da;this.Bb=this.Xo=1;this.rg=0;this.Mg=to;this.cn=Ud;this.Ad=(new B(NaN,NaN,NaN,NaN)).freeze();this.ac=(new B(NaN,NaN,NaN,NaN)).freeze();this.$c=(new B(0,0,NaN,NaN)).freeze();this.Z=this.Ws=this.Xs=null;this.Hm=this.re=Tc;this.it=0;this.rj=1;this.qr=0;this.Qi=1;this.yt=null;this.mt=-Infinity;this.on= -0;this.pn=Gd;this.qn=nj;this.zr="";this.Bc=this.la=null;this.Jo=-1;this.un=this.ug=this.rl=this.Np=null;this.Uz=yj;this.kn=null}D.Ai(P);D.ja("GraphObject",P); -P.prototype.cloneProtected=function(a){a.T=this.T|6144;a.Fc=this.Fc;a.Xb=this.Xb;a.Kb=this.Kb;a.hc=this.hc;a.qb.assign(this.qb);a.Ye=this.Ye.V();a.li=this.li.V();a.ki=this.ki.V();a.gj=this.gj.copy();a.Bb=this.Bb;a.rg=this.rg;a.Mg=this.Mg;a.cn=this.cn.V();a.Ad.assign(this.Ad);a.ac.assign(this.ac);a.$c.assign(this.$c);a.Ws=this.Ws;null!==this.Z&&(a.Z=this.Z.copy());a.re=this.re.V();a.Hm=this.Hm.V();a.it=this.it;a.rj=this.rj;a.qr=this.qr;a.Qi=this.Qi;a.yt=this.yt;a.mt=this.mt;a.on=this.on;a.pn=this.pn.V(); -a.qn=this.qn;a.zr=this.zr;null!==this.la&&(a.la=this.la.copy());a.Bc=this.Bc;a.Jo=this.Jo;null!==this.rl&&(a.rl=D.cm(this.rl));null!==this.ug&&(a.ug=this.ug.copy());a.un=this.un};P.prototype.addCopyProperty=P.prototype.KH=function(a){var b=this.rl;if(D.isArray(b))for(var c=0;ck;)k+=g[n++%l],p=!p;q=!1}else k=g[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}} -P.prototype.raiseChangedEvent=P.prototype.hd=function(a,b,c,d,e,g,h){var k=this.Y;if(null!==k&&(k.po(a,b,c,d,e,g,h),Eo(this)&&c===this&&a===cg&&Fo(this,k,b),c===k&&0!==(k.T&16777216)&&null!==k.data))for(a=this.xa.o,c=a.length,d=0;da&&(a+=360));return a};P.prototype.getDocumentScale=P.prototype.Fj=function(){if(0!==(this.T&4096)===!1)return this.Xo;var a=this.Bb;return null!==this.Q?a*this.Q.Fj():a};P.prototype.getLocalPoint=P.prototype.uF=function(a,b){void 0===b&&(b=new O);b.assign(a);this.Hh.Ci(b);return b}; -P.prototype.getNearestIntersectionPoint=P.prototype.vF=function(a,b,c){return this.Tn(a.x,a.y,b.x,b.y,c)};f=P.prototype;f.Tn=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.Zl)return g=this.$,Ne(g.left,g.top,g.right,g.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.m(0,0);d=this.Ga;c=Ne(0,0,d.width,d.height,h,a,b,c,e);e.transform(g);return c}; -function Ak(a,b,c,d,e){if(!1!==Hm(a)){var g=a.margin,h=g.right+g.left,g=g.top+g.bottom;b=Math.max(b-h,0);c=Math.max(c-g,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-g,0);var h=a.angle,g=0,g=a.Ea,k=0;a instanceof z&&(k=a.jb);90===h||270===h?(b=isFinite(g.height)?g.height+k:b,c=isFinite(g.width)?g.width+k:c):(b=isFinite(g.width)?g.width+k:b,c=isFinite(g.height)?g.height+k:c);var g=d||0,k=e||0,l=a instanceof x;switch(Jo(a,!0)){case Sj:k=g=0;l&&(c=b=Infinity);break;case rf:isFinite(b)&&b>d&&(g=b);isFinite(c)&& -c>e&&(k=c);break;case vo:isFinite(b)&&b>d&&(g=b);k=0;l&&(c=Infinity);break;case uo:isFinite(c)&&c>e&&(k=c),g=0,l&&(b=Infinity)}var l=a.kf,m=a.hg;g>l.width&&m.widthl.height&&m.heighta.height||this.gi.nf>a.width))&&(c=!0);this.T=c?this.T|256:this.T&-257;this.ac.F()|| -D.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.ac.toString());this.my(g,this.ac);Ko(this,!1);D.Mb(g)};f.yj=function(){}; -function Lo(a,b,c,d,e){var g=a.$;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.Ea.F()){g=a.Ad;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=g.width+b;g=g.height+h;d+=b;e+=h;b=Jo(a,!0);c===d&&g===e&&(b=Sj);switch(b){case Sj:if(c>d||g>e)em(a,!0),Ak(a,c>d?d:c,g>e?e:g);break;case rf:em(a,!0);Ak(a,d,e,0,0);break;case vo:em(a,!0);Ak(a,d,g,0,0);break;case uo:em(a,!0),Ak(a,c,e,0,0)}}} -f.my=function(a,b){var c=this.Y;null!==c&&null!==c.g&&(c.ro!==this&&c.CG!==this&&c.GG!==this||Mo(c,!0),this.qa(),xb(a,b)||(c.rm(),this.yw(c)))};f.yw=function(a){null!==this.sd&&(Mo(a,!0),a instanceof G&&No(a,this))};D.defineProperty(P,{Sq:"shadowVisible"},function(){return this.un},function(a){var b=this.un;b!==a&&(v&&null!==a&&D.h(a,"boolean",P,"shadowVisible"),this.un=a,this.qa(),this.i("shadowVisible",b,a))}); -P.prototype.Ee=function(a,b){if(this.visible){var c=this.ac;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.opacity,e=1;if(1!==d){if(0===d)return;e=a.globalAlpha;a.globalAlpha=e*d}if(a instanceof nd)a:{if(this.visible){var g=null,h=a.$x;if(this instanceof x&&(this.type===Oo||this.type===Po))Qo(this,a,b);else{var k=this.ac;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.Q;0!==(this.T&4096)===!0&&Ro(this);var c=0!==(this.T&256),n=!1;this instanceof -na&&(a.font=this.font);if(c){n=m.kh()?m.Ga:m.$;if(null!==this.ug)var p=this.ug,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(k.x,n.x),r=Math.max(k.y,n.y),s=Math.min(k.right,n.right)-q,p=Math.min(k.bottom,n.bottom)-r;if(q>k.width+k.x||k.x>n.width+n.x||r>k.height+k.y||k.y>n.height+n.y)break a;n=!0;pd(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.Jj()){var u=this;if(!u.isVisible())break a}a.Mh.Yb=[1,0,0,1,0,0];q=!1;this.Jj()&&this.Wk&&b.Gj("drawShadows")&&(r=this.tn,a.JB(r.x* -b.scale*b.od,r.y*b.scale*b.od,u.Lg),a.uo(),a.shadowColor=u.sn);u=!1;this.Y&&b.Gj("drawShadows")&&(u=this.Y.Wk);!0===this.Sq?(a.uo(),!1===q&&u&&(pd(a,1,0,0,1,0,0),a.ib(),q=!0)):!1===this.Sq&&a.to();null!==this.hc&&(So(this,a,this.hc,!0,!0),!1===q&&u&&(pd(a,1,0,0,1,0,0),a.ib(),q=!0),this.hc instanceof Ba&&this.hc.type===Ed?(a.beginPath(),a.rect(k.x,k.y,k.width,k.height),a.Ug(this.hc)):a.fillRect(k.x,k.y,k.width,k.height));this instanceof x?pd(a,l.m11,l.m12,l.m21,l.m22,l.dx,l.dy):a.Mh.Yb=[l.m11,l.m12, -l.m21,l.m22,l.dx,l.dy];null!==this.Kb&&(!1===q&&u&&(pd(a,1,0,0,1,0,0),a.ib(),q=!0),s=this.Ga,l=k=0,r=s.width,s=s.height,p=0,this instanceof z&&(s=this.ob.sb,k=s.x,l=s.y,r=s.width,s=s.height,p=this.Ng),So(this,a,this.Kb,!0,!1),this.Kb instanceof Ba&&this.Kb.type===Ed?(a.beginPath(),a.rect(k-p/2,l-p/2,r+p,s+p),a.Ug(this.Kb)):a.fillRect(k-p/2,l-p/2,r+p,s+p));u&&(null!==this.Kb||null!==this.hc||null!==m&&0!==(m.T&512)||null!==m&&(m.type===Kl||m.type===Qj)&&m.Vd()!==this)?(To(this,!0),null===this.Sq&& -a.to()):To(this,!1);this.Pk(a,b);u&&0!==(this.T&512)===!0&&a.uo();this.Jj()&&u&&a.to();c&&(a.restore(),n&&a.Ef.pop());this instanceof x&&(g=a.Ef.pop());!0===q&&a.Ef.pop();null!==a.hF&&(null===g&&(h===a.$x?(pd(a,1,0,0,1,0,0),g=a.Ef.pop()):g=a.$x),a.hF(this,g))}}}}else{if(this instanceof x&&(this.type===Oo||this.type===Po)){Qo(this,a,b);1!==d&&(a.globalAlpha=e);return}this instanceof J&&this.Gu(!1);v&&v.zj&&v.wI(a,this);g=this.transform;h=this.Q;0!==(this.T&4096)===!0&&Ro(this);m=0!==(this.T&256);a.eq&& -(m=!1);this instanceof na&&(a.font=this.font);if(m){v&&v.gF&&D.trace("clip"+this.toString());n=h.kh()?h.Ga:h.$;null!==this.ug?(q=this.ug,k=q.x,l=q.y,u=q.width,q=q.height):(k=Math.max(c.x,n.x),l=Math.max(c.y,n.y),u=Math.min(c.right,n.right)-k,q=Math.min(c.bottom,n.bottom)-l);if(k>c.width+c.x||c.x>n.width+n.x||l>c.height+c.y||c.y>n.height+n.y){1!==d&&(a.globalAlpha=e);return}v&&v.gF&&v.yI(a,k,l,u,q);a.save();a.beginPath();a.rect(k,l,u,q);a.clip()}if(this.Jj()){if(!this.isVisible()){1!==d&&(a.globalAlpha= -e);return}this.Wk&&b.Gj("drawShadows")&&(n=this.tn,a.JB(n.x*b.scale*b.od,n.y*b.scale*b.od,this.Lg),a.uo(),a.shadowColor=this.sn)}n=!1;this.Y&&b.Gj("drawShadows")&&(n=this.Y.Wk);!0===this.Sq?a.uo():!1===this.Sq&&a.to();null!==this.hc&&(So(this,a,this.hc,!0,!0),this.hc instanceof Ba&&this.hc.type===Ed?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Ug(this.hc)):a.fillRect(c.x,c.y,c.width,c.height));g.xu()||a.transform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);null!==this.Kb&&(u=this.Ga,k=c=0,l=u.width,u= -u.height,q=0,this instanceof z&&(u=this.ob.sb,c=u.x,k=u.y,l=u.width,u=u.height,q=this.Ng),So(this,a,this.Kb,!0,!1),this.Kb instanceof Ba&&this.Kb.type===Ed?(a.beginPath(),a.rect(c-q/2,k-q/2,l+q,u+q),a.Ug(this.Kb)):a.fillRect(c-q/2,k-q/2,l+q,u+q));v&&v.zj&&v.xI(a,this);n&&(null!==this.Kb||null!==this.hc||null!==h&&0!==(h.T&512)||null!==h&&(h.type===Kl||h.type===Qj)&&h.Vd()!==this)?(To(this,!0),null===this.Sq&&a.to()):To(this,!1);this.Pk(a,b);n&&0!==(this.T&512)===!0&&a.uo();this.Jj()&&n&&a.to();m? -(a.restore(),this instanceof x?a.Be(!0):a.Be(!1)):g.xu()||(h=1/(g.m11*g.m22-g.m12*g.m21),a.transform(g.m22*h,-g.m12*h,-g.m21*h,g.m11*h,h*(g.m21*g.dy-g.m22*g.dx),h*(g.m12*g.dx-g.m11*g.dy)))}1!==d&&(a.globalAlpha=e)}}}; -function Qo(a,b,c){var d=a.ac;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.hc&&(So(a,b,a.hc,!0,!0),a.hc instanceof Ba&&a.hc.type===Ed?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Ug(a.hc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Kb&&(So(a,b,a.Kb,!0,!1),a.Kb instanceof Ba&&a.Kb.type===Ed?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Ug(a.Kb)):b.fillRect(d.x,d.y,d.width,d.height)),a.Pk(b,c))}P.prototype.Pk=function(){}; -function So(a,b,c,d,e){if(null!==c){var g=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===Ag)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Ga,g=h.width,h=h.height;if(e)var l=a.$,g=l.width,h=l.height;var m=b instanceof Dd;if(m&&c.rh&&(c.type===Zn||c.Mo===g&&c.hz===h))k=c.rh;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.$,g=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*g+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*g+c.end.offsetX;q=c.end.y*h+c.end.offsetY; -l+=r;p+=r;n+=s;q+=s;if(c.type===Qg)k=b.createLinearGradient(l,n,p,q);else if(c.type===Ed)s=isNaN(c.eu)?Math.max(g,h)/2:c.eu,isNaN(c.dv)?(r=0,s=Math.max(g,h)/2):r=c.dv,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===Zn)try{k=b.createPattern(c.pattern,"repeat")}catch(u){k=null}else D.gc(c.type,"Brush type");if(c.type!==Zn&&(e=c.Lk,null!==e))for(e=e.j;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.rh=k,null!==k&&(c.Mo=g,c.hz=h),null===k&&c.type===Zn&&-1!==c.Mo)){c.Mo=-1;var t=a.g;null!==t&& --1===c.Mo&&D.setTimeout(function(){t.Hq()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}P.prototype.isContainedBy=P.prototype.tm=function(a){if(a instanceof x)a:{if(this!==a&&null!==a)for(var b=this.Q;null!==b;){if(b===a){a=!0;break a}b=b.Q}a=!1}else a=!1;return a};P.prototype.isVisibleObject=P.prototype.Nj=function(){if(!this.visible)return!1;var a=this.Q;return null!==a?a.Nj():!0}; -P.prototype.isEnabledObject=P.prototype.vu=function(){for(var a=this instanceof x?this:this.Q;null!==a&&a.isEnabled;)a=a.Q;return null===a};D.defineProperty(P,{iF:"enabledChanged"},function(){return null!==this.la?this.la.Qr:null},function(a){zo(this);var b=this.la.Qr;b!==a&&(null!==a&&D.h(a,"function",P,"enabledChanged"),this.la.Qr=a,this.i("enabledChanged",b,a))}); -function Ro(a){if(0!==(a.T&2048)===!0){var b=a.Hc;b.reset();if(!a.ac.F()||!a.Ad.F()){Uo(a,!1);return}b.translate(a.ac.x,a.ac.y);b.translate(-a.Fa.x,-a.Fa.y);var c=a.Ga;Ho(a,b,c.x,c.y,c.width,c.height);Uo(a,!1);Vo(a,!0)}0!==(a.T&4096)===!0&&(b=a.Q,null===b?(a.Li.set(a.Hc),a.Xo=a.scale,Vo(a,!1)):null!==b.Hh&&(c=a.Li,c.reset(),b.kh()?c.multiply(b.Li):null!==b.Q&&c.multiply(b.Q.Li),c.multiply(a.Hc),a.Xo=a.scale*b.Xo,Vo(a,!1)))} -function Ho(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=gc;a.Jj()&&a.Kf.fd()&&(h=a.Kf);var k=D.P();if(a instanceof F&&a.uf!==a)for(c=a.uf,d=c.Ga,k.av(d.x,d.y,d.width,d.height,h),c.gj.vb(k),k.offset(-c.Fa.x,-c.Fa.y),h=c.Q;null!==h&&h!==a;)h.gj.vb(k),k.offset(-h.Fa.x,-h.Fa.y),h=h.Q;else k.av(c,d,e,g,h);b.rotate(a.angle,k.x,k.y);D.A(k)}}f=P.prototype;f.K=function(a){void 0===a&&(a=!1);if(!0!==Hm(this)){em(this,!0);Ko(this,!0);var b=this.Q;null===b||a||b.K()}}; -f.xq=function(){!0!==Hm(this)&&(em(this,!0),Ko(this,!0))};function Wo(a){if(!1===Im(a)){var b=a.Q;null!==b?b.K():a.Jj()&&(b=a.g,null!==b&&(b.Cg.add(a),a instanceof G&&a.fg(),b.Se()));Ko(a,!0)}}f.$i=function(){0!==(this.T&2048)===!1&&(Uo(this,!0),Vo(this,!0))};f.XA=function(){Vo(this,!0)};f.qa=function(){var a=this.Y;null!==a&&a.qa()}; -function Jo(a,b){var c=a.stretch,d=a.Q;if(null!==d&&d.ca===ea)return Xo(a,d.me(a.Zb),d.le(a.column),b);if(null!==d&&d.ca===Kl&&d.Vd()===a)return Yo(a,rf,b);if(c===to){if(null!==d){if(d.ca===Qj&&d.Vd()===a)return Yo(a,rf,b);c=d.je;return c===to?Yo(a,Sj,b):Yo(a,c,b)}return Yo(a,Sj,b)}return Yo(a,c,b)} -function Xo(a,b,c,d){var e=a.stretch;if(e!==to)return Yo(a,e,d);var g=e=null;switch(b.stretch){case uo:g=!0;break;case rf:g=!0}switch(c.stretch){case vo:e=!0;break;case rf:e=!0}b=a.Q.je;null===e&&(e=b===vo||b===rf);null===g&&(g=b===uo||b===rf);return!0===e&&!0===g?Yo(a,rf,d):!0===e?Yo(a,vo,d):!0===g?Yo(a,uo,d):Yo(a,Sj,d)} -function Yo(a,b,c){if(c)return b;if(b===Sj)return Sj;c=a.Ea;if(c.F())return Sj;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===vo)return Sj;if(b===rf)return uo}else{if(b===uo)return Sj;if(b===rf)return vo}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===uo)return Sj;if(b===rf)return vo}else{if(b===vo)return Sj;if(b===rf)return uo}return b} -D.defineProperty(P,{Oq:"segmentOrientation"},function(){return this.qn},function(a){var b=this.qn;b!==a&&(v&&D.Ca(a,J,P,"segmentOrientation"),this.qn=a,this.K(),this.i("segmentOrientation",b,a),a===nj&&(this.angle=0))});D.defineProperty(P,{Te:"segmentIndex"},function(){return this.mt},function(a){v&&D.h(a,"number",P,"segmentIndex");a=Math.round(a);var b=this.mt;b!==a&&(this.mt=a,this.K(),this.i("segmentIndex",b,a))}); -D.defineProperty(P,{zB:"segmentFraction"},function(){return this.on},function(a){v&&D.h(a,"number",P,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1a||1=a&&D.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Bb=a,this.$i(),this.K(),this.i("scale",b,a))});D.defineProperty(P,{angle:"angle"},function(){return this.rg},function(a){var b=this.rg;b!==a&&(v&&D.p(a,P,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.rg=a,this.K(),this.$i(),this.i("angle",b,a)))}); -D.defineProperty(P,{Ea:"desiredSize"},function(){return this.Ye},function(a){v&&D.l(a,Ca,P,"desiredSize");var b=a.width,c=a.height,d=this.Ye,e=d.width,g=d.height;(e===b||isNaN(e)&&isNaN(b))&&(g===c||isNaN(g)&&isNaN(c))||(this.Ye=a=a.V(),this.K(),this instanceof z&&this.Re(),this.i("desiredSize",d,a),Eo(this)&&(a=this.Y,null!==a&&(Fo(this,a,"width"),Fo(this,a,"height"))))}); -D.defineProperty(P,{width:"width"},function(){return this.Ye.width},function(a){var b=this.Ye.width;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",P,"width"),b=this.Ye,this.Ye=a=(new Ca(a,this.Ye.height)).freeze(),this.K(),this instanceof z&&this.Re(),this.i("desiredSize",b,a),Eo(this)&&(a=this.Y,null!==a&&Fo(this,a,"width")))}); -D.defineProperty(P,{height:"height"},function(){return this.Ye.height},function(a){var b=this.Ye.height;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",P,"height"),b=this.Ye,this.Ye=a=(new Ca(this.Ye.width,a)).freeze(),this.K(),this instanceof z&&this.Re(),this.i("desiredSize",b,a),Eo(this)&&(a=this.Y,null!==a&&Fo(this,a,"height")))}); -D.defineProperty(P,{hg:"minSize"},function(){return this.li},function(a){var b=this.li;b.O(a)||(v&&D.l(a,Ca,P,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.li=a,this.K(),this.i("minSize",b,a))});D.defineProperty(P,{kf:"maxSize"},function(){return this.ki},function(a){var b=this.ki;b.O(a)||(v&&D.l(a,Ca,P,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.ki=a,this.K(),this.i("maxSize",b,a))}); -D.w(P,{Fa:"measuredBounds"},function(){return this.Ad});D.w(P,{Ga:"naturalBounds"},function(){return this.$c},{configurable:!0});D.defineProperty(P,{margin:"margin"},function(){return this.cn},function(a){"number"===typeof a?a=new Hb(a):v&&D.l(a,Hb,P,"margin");var b=this.cn;b.O(a)||(this.cn=a=a.V(),this.K(),this.i("margin",b,a))});D.w(P,{transform:null},function(){0!==(this.T&2048)===!0&&Ro(this);return this.Hc});D.w(P,{Hh:null},function(){0!==(this.T&4096)===!0&&Ro(this);return this.Li}); -D.defineProperty(P,{alignment:"alignment"},function(){return this.re},function(a){var b=this.re;b.O(a)||(v&&D.l(a,R,P,"alignment"),a.Zd()&&!a.ed()&&D.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.re=a=a.V(),Wo(this),this.i("alignment",b,a))});D.defineProperty(P,{column:"column"},function(){return this.qr},function(a){v&&D.p(a,P,"column");a=Math.round(a);var b=this.qr;b!==a&&(0>a&&D.ua(a,">= 0",P,"column"),this.qr=a,this.K(),this.i("column",b,a))}); -D.defineProperty(P,{cI:"columnSpan"},function(){return this.Qi},function(a){v&&D.h(a,"number",P,"columnSpan");a=Math.round(a);var b=this.Qi;b!==a&&(1>a&&D.ua(a,">= 1",P,"columnSpan"),this.Qi=a,this.K(),this.i("columnSpan",b,a))});D.defineProperty(P,{Zb:"row"},function(){return this.it},function(a){v&&D.p(a,P,"row");a=Math.round(a);var b=this.it;b!==a&&(0>a&&D.ua(a,">= 0",P,"row"),this.it=a,this.K(),this.i("row",b,a))}); -D.defineProperty(P,{rowSpan:"rowSpan"},function(){return this.rj},function(a){v&&D.h(a,"number",P,"rowSpan");a=Math.round(a);var b=this.rj;b!==a&&(1>a&&D.ua(a,">= 1",P,"rowSpan"),this.rj=a,this.K(),this.i("rowSpan",b,a))});D.defineProperty(P,{Iy:"spanAllocation"},function(){return this.yt},function(a){var b=this.yt;b!==a&&(null!==a&&D.h(a,"function",P,"spanAllocation"),this.yt=a,this.K(),this.i("spanAllocation",b,a))}); -D.defineProperty(P,{Gh:"alignmentFocus"},function(){return this.Hm},function(a){var b=this.Hm;b.O(a)||(v&&D.l(a,R,P,"alignmentFocus"),!a.Zd()||a.ed()||a.O(bc)&&this instanceof G||D.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Hm=a=a.V(),this.K(),this.i("alignmentFocus",b,a))}); -D.defineProperty(P,{sd:"portId"},function(){return this.Ws},function(a){var b=this.Ws;if(b!==a){v&&null!==a&&D.h(a,"string",P,"portId");var c=this.Y;null===c||c instanceof G||(D.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&ap(c,this);this.Ws=a;if(null!==a&&c){c.Uk=!0;null===c.xe&&bp(c);var d=this.sd;null!==d&&c.xe.add(d,this)}this.i("portId",b,a)}});function cp(a){var b=a.Y;if(b instanceof G&&(null!==a.sd||a===b.port)){var c=b.g;null===c||c.ra.nb||No(b,a)}} -function Zo(a){var b=a.g;null===b||b.ra.nb||(a instanceof x?a instanceof G?a.fg():dp(a,a,function(a){cp(a)}):cp(a))}D.defineProperty(P,{Hb:"toSpot"},function(){return null!==this.Z?this.Z.Gk:bc},function(a){this.Wd();var b=this.Z.Gk;b.O(a)||(v&&D.l(a,R,P,"toSpot"),a=a.V(),this.Z.Gk=a,this.i("toSpot",b,a),cp(this))}); -D.defineProperty(P,{Dm:"toEndSegmentLength"},function(){return null!==this.Z?this.Z.Ek:10},function(a){this.Wd();var b=this.Z.Ek;b!==a&&(v&&D.h(a,"number",P,"toEndSegmentLength"),0>a&&D.ua(a,">= 0",P,"toEndSegmentLength"),this.Z.Ek=a,this.i("toEndSegmentLength",b,a),cp(this))}); -D.defineProperty(P,{fv:"toEndSegmentDirection"},function(){return null!==this.Z?this.Z.Dk:Co},function(a){this.Wd();var b=this.Z.Dk;b!==a&&(D.Nn("GraphObject.toEndSegmentDirection","2.0"),v&&D.Ca(a,G,P,"toEndSegmentDirection"),this.Z.Dk=a,this.i("toEndSegmentDirection",b,a),cp(this))});D.defineProperty(P,{gv:"toShortLength"},function(){return null!==this.Z?this.Z.Fk:0},function(a){this.Wd();var b=this.Z.Fk;b!==a&&(v&&D.h(a,"number",P,"toShortLength"),this.Z.Fk=a,this.i("toShortLength",b,a),cp(this))}); -D.defineProperty(P,{$G:"toLinkable"},function(){return null!==this.Z?this.Z.Ht:null},function(a){this.Wd();var b=this.Z.Ht;b!==a&&(v&&null!==a&&D.h(a,"boolean",P,"toLinkable"),this.Z.Ht=a,this.i("toLinkable",b,a))});D.defineProperty(P,{tK:"toMaxLinks"},function(){return null!==this.Z?this.Z.It:Infinity},function(a){this.Wd();var b=this.Z.It;b!==a&&(v&&D.h(a,"number",P,"toMaxLinks"),0>a&&D.ua(a,">= 0",P,"toMaxLinks"),this.Z.It=a,this.i("toMaxLinks",b,a))}); -D.defineProperty(P,{Gb:"fromSpot"},function(){return null!==this.Z?this.Z.jk:bc},function(a){this.Wd();var b=this.Z.jk;b.O(a)||(v&&D.l(a,R,P,"fromSpot"),a=a.V(),this.Z.jk=a,this.i("fromSpot",b,a),cp(this))});D.defineProperty(P,{nm:"fromEndSegmentLength"},function(){return null!==this.Z?this.Z.hk:10},function(a){this.Wd();var b=this.Z.hk;b!==a&&(v&&D.h(a,"number",P,"fromEndSegmentLength"),0>a&&D.ua(a,">= 0",P,"fromEndSegmentLength"),this.Z.hk=a,this.i("fromEndSegmentLength",b,a),cp(this))}); -D.defineProperty(P,{nu:"fromEndSegmentDirection"},function(){return null!==this.Z?this.Z.gk:Co},function(a){this.Wd();var b=this.Z.gk;b!==a&&(D.Nn("GraphObject.fromEndSegmentDirection","2.0"),v&&D.Ca(a,G,P,"fromEndSegmentDirection"),this.Z.gk=a,this.i("fromEndSegmentDirection",b,a),cp(this))}); -D.defineProperty(P,{ou:"fromShortLength"},function(){return null!==this.Z?this.Z.ik:0},function(a){this.Wd();var b=this.Z.ik;b!==a&&(v&&D.h(a,"number",P,"fromShortLength"),this.Z.ik=a,this.i("fromShortLength",b,a),cp(this))});D.defineProperty(P,{sF:"fromLinkable"},function(){return null!==this.Z?this.Z.Tr:null},function(a){this.Wd();var b=this.Z.Tr;b!==a&&(v&&null!==a&&D.h(a,"boolean",P,"fromLinkable"),this.Z.Tr=a,this.i("fromLinkable",b,a))}); -D.defineProperty(P,{MA:"fromMaxLinks"},function(){return null!==this.Z?this.Z.Ur:Infinity},function(a){this.Wd();var b=this.Z.Ur;b!==a&&(v&&D.h(a,"number",P,"fromMaxLinks"),0>a&&D.ua(a,">= 0",P,"fromMaxLinks"),this.Z.Ur=a,this.i("fromMaxLinks",b,a))});D.defineProperty(P,{cursor:"cursor"},function(){return this.zr},function(a){var b=this.zr;b!==a&&(D.h(a,"string",P,"cursor"),this.zr=a,this.i("cursor",b,a))}); -D.defineProperty(P,{click:"click"},function(){return null!==this.la?this.la.Pi:null},function(a){zo(this);var b=this.la.Pi;b!==a&&(null!==a&&D.h(a,"function",P,"click"),this.la.Pi=a,this.i("click",b,a))});D.defineProperty(P,{du:"doubleClick"},function(){return null!==this.la?this.la.Wi:null},function(a){zo(this);var b=this.la.Wi;b!==a&&(null!==a&&D.h(a,"function",P,"doubleClick"),this.la.Wi=a,this.i("doubleClick",b,a))}); -D.defineProperty(P,{uA:"contextClick"},function(){return null!==this.la?this.la.Ri:null},function(a){zo(this);var b=this.la.Ri;b!==a&&(null!==a&&D.h(a,"function",P,"contextClick"),this.la.Ri=a,this.i("contextClick",b,a))});D.defineProperty(P,{Iu:"mouseEnter"},function(){return null!==this.la?this.la.Hs:null},function(a){zo(this);var b=this.la.Hs;b!==a&&(null!==a&&D.h(a,"function",P,"mouseEnter"),this.la.Hs=a,this.i("mouseEnter",b,a))}); -D.defineProperty(P,{Ju:"mouseLeave"},function(){return null!==this.la?this.la.Is:null},function(a){zo(this);var b=this.la.Is;b!==a&&(null!==a&&D.h(a,"function",P,"mouseLeave"),this.la.Is=a,this.i("mouseLeave",b,a))});D.defineProperty(P,{kB:"mouseOver"},function(){return null!==this.la?this.la.lj:null},function(a){zo(this);var b=this.la.lj;b!==a&&(null!==a&&D.h(a,"function",P,"mouseOver"),this.la.lj=a,this.i("mouseOver",b,a))}); -D.defineProperty(P,{jB:"mouseHover"},function(){return null!==this.la?this.la.kj:null},function(a){zo(this);var b=this.la.kj;b!==a&&(null!==a&&D.h(a,"function",P,"mouseHover"),this.la.kj=a,this.i("mouseHover",b,a))});D.defineProperty(P,{iB:"mouseHold"},function(){return null!==this.la?this.la.jj:null},function(a){zo(this);var b=this.la.jj;b!==a&&(null!==a&&D.h(a,"function",P,"mouseHold"),this.la.jj=a,this.i("mouseHold",b,a))}); -D.defineProperty(P,{IJ:"mouseDragEnter"},function(){return null!==this.la?this.la.Fs:null},function(a){zo(this);var b=this.la.Fs;b!==a&&(null!==a&&D.h(a,"function",P,"mouseDragEnter"),this.la.Fs=a,this.i("mouseDragEnter",b,a))});D.defineProperty(P,{JJ:"mouseDragLeave"},function(){return null!==this.la?this.la.Gs:null},function(a){zo(this);var b=this.la.Gs;b!==a&&(null!==a&&D.h(a,"function",P,"mouseDragLeave"),this.la.Gs=a,this.i("mouseDragLeave",b,a))}); -D.defineProperty(P,{hB:"mouseDrop"},function(){return null!==this.la?this.la.ij:null},function(a){zo(this);var b=this.la.ij;b!==a&&(null!==a&&D.h(a,"function",P,"mouseDrop"),this.la.ij=a,this.i("mouseDrop",b,a))});D.defineProperty(P,{yE:"actionDown"},function(){return null!==this.la?this.la.Zq:null},function(a){zo(this);var b=this.la.Zq;b!==a&&(null!==a&&D.h(a,"function",P,"actionDown"),this.la.Zq=a,this.i("actionDown",b,a))}); -D.defineProperty(P,{zE:"actionMove"},function(){return null!==this.la?this.la.$q:null},function(a){zo(this);var b=this.la.$q;b!==a&&(null!==a&&D.h(a,"function",P,"actionMove"),this.la.$q=a,this.i("actionMove",b,a))});D.defineProperty(P,{AE:"actionUp"},function(){return null!==this.la?this.la.ar:null},function(a){zo(this);var b=this.la.ar;b!==a&&(null!==a&&D.h(a,"function",P,"actionUp"),this.la.ar=a,this.i("actionUp",b,a))}); -D.defineProperty(P,{xE:"actionCancel"},function(){return null!==this.la?this.la.Yq:null},function(a){zo(this);var b=this.la.Yq;b!==a&&(null!==a&&D.h(a,"function",P,"actionCancel"),this.la.Yq=a,this.i("actionCancel",b,a))});D.defineProperty(P,{PB:"toolTip"},function(){return null!==this.la?this.la.uj:null},function(a){zo(this);var b=this.la.uj;b!==a&&(!v||null===a||a instanceof da||a instanceof ak||D.k("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.la.uj=a,this.i("toolTip",b,a))}); -D.defineProperty(P,{contextMenu:"contextMenu"},function(){return null!==this.la?this.la.Si:null},function(a){zo(this);var b=this.la.Si;b!==a&&(!v||a instanceof da||a instanceof ak||D.k("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.la.Si=a,this.i("contextMenu",b,a))});P.prototype.bind=P.prototype.bind=function(a){a.Og=this;var b=this.lm();null!==b&&ep(b)&&D.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.Bc&&(this.Bc=new K(ih));this.Bc.add(a)}; -P.prototype.findTemplateBinder=P.prototype.lm=function(){for(var a=this instanceof x?this:this.Q;null!==a;){if(null!==a.pl)return a;a=a.Q}return null};P.prototype.setProperties=function(a){D.Zu(this,a)};var fp; -P.make=fp=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=gp.oa(a);"function"===typeof g?(c=D.cm(arguments),d=g(c),D.Ta(d)||D.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=aa[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||D.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);g=1;if(d instanceof E&&1e)&&D.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.Ie=!0, -a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&D.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.Ie=!1,a.index=e);e=new la;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);D.Zu(a,e)}else D.Zu(a,b);else D.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var gp=new ma("string","function"); -P.getBuilders=function(){var a=new ma("string","function"),b;for(b in gp)if(b!==b.toLowerCase()){var c=gp[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};var ip;P.defineBuilder=ip=function(a,b){D.h(a,"string",P,"defineBuilder:name");D.h(b,"function",P,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);gp.add(a,b)};var jp; -P.takeBuilderArgument=jp=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b}; -ip("Button",function(){var a=new Ba(Qg);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new Ba(Qg);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=fp(x,Kl,{tu:!0,iF:function(a,b){var e=a.Ed("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},fp(z,{name:"ButtonBorder",Jb:"Rectangle",C:new R(0,0,2.761423749153968,2.761423749153968), -D:new R(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.Iu=function(a,b){if(b.vu()){var e=b.Ed("ButtonBorder");if(e instanceof z){var g=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=g;g=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=g}}};a.Ju=function(a,b){if(b.vu()){var e=b.Ed("ButtonBorder");e instanceof z&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a}); -ip("TreeExpanderButton",function(){var a=fp("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},fp(z,{name:"ButtonIcon",Jb:"MinusLine",Ea:ae},(new ih("figure","isTreeExpanded",function(a,c){var d=c.Q;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).ly()),{visible:!1},(new ih("visible","isTreeLeaf",function(a){return!a})).ly());a.click=function(a,c){var d=c.Y;d instanceof da&&(d=d.Zf);if(d instanceof G){var e=d.g;if(null!==e){e=e.wb;if(d.rd){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return; -a.Lc=!0;d.rd?e.collapseTree(d):e.expandTree(d)}}};return a}); -ip("SubGraphExpanderButton",function(){var a=fp("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},fp(z,{name:"ButtonIcon",Jb:"MinusLine",Ea:ae},(new ih("figure","isSubGraphExpanded",function(a,c){var d=c.Q;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).ly()));a.click=function(a,c){var d=c.Y;d instanceof da&&(d=d.Zf);if(d instanceof I){var e=d.g;if(null!==e){e=e.wb;if(d.Je){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Lc= -!0;d.Je?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});ip("ContextMenuButton",function(){var a=fp("Button");a.stretch=vo;var b=a.Ed("ButtonBorder");b instanceof z&&(b.Jb="Rectangle",b.C=new R(0,0,2,3),b.D=new R(1,1,-2,-2));return a}); -ip("PanelExpanderButton",function(a){var b=jp(a,"COLLAPSIBLE"),c=fp("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},fp(z,"TriangleUp",{name:"ButtonIcon",Ea:new Ca(6,4)},(new ih("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).ly(b)));a=c.Ed("ButtonBorder");a instanceof z&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var g=c.g;if(null!==g&&!g.mb){var h=c.lm();null===h&&(h=c.Y);null!==h&&(h=h.Ed(b),null!==h&& -(g.$b("Collapse/Expand Panel"),h.visible=!h.visible,g.Td("Collapse/Expand Panel")))}};return c}); -ip("CheckBoxButton",function(a){var b=jp(a);a=fp("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},fp(z,{name:"ButtonIcon",II:"M0 4 L3 9 9 0",jb:2,stretch:rf,NA:Uj,visible:!1},""!==b?(new ih("visible",b)).xJ():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.mb||""!==b&&e.ga.mb)){a.Lc=!0;var g=d.Ed("ButtonIcon");e.$b("checkbox");g.visible=!g.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.Td("checkbox")}};return a}); -ip("CheckBox",function(a){a=jp(a);a=fp("CheckBoxButton",a,{name:"Button",margin:new Hb(0,1,0,0)});var b=fp(x,"Horizontal",a,{tu:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,Iu:a.Iu,Ju:a.Ju,click:a.click,_buttonClick:a.click});a.Iu=null;a.Ju=null;a.click=null;return b}); -function Ao(){this.Qr=this.Si=this.uj=this.Yq=this.ar=this.$q=this.Zq=this.ij=this.Gs=this.Fs=this.jj=this.kj=this.lj=this.Is=this.Hs=this.Ri=this.Wi=this.Pi=null}Ao.prototype.copy=function(){var a=new Ao;a.Pi=this.Pi;a.Wi=this.Wi;a.Ri=this.Ri;a.Hs=this.Hs;a.Is=this.Is;a.lj=this.lj;a.kj=this.kj;a.jj=this.jj;a.Fs=this.Fs;a.Gs=this.Gs;a.ij=this.ij;a.Zq=this.Zq;a.$q=this.$q;a.ar=this.ar;a.Yq=this.Yq;a.uj=this.uj;a.Si=this.Si;a.Qr=this.Qr;return a}; -function x(a){P.call(this);void 0===a?this.ca=Xj:(D.Ca(a,x,x,"type"),this.ca=a);this.xa=new K(P);this.of=Ud;this.ca===Nl&&(this.Yn=!0);this.Dr=Tc;this.Vi=to;this.ca===ea&&kp(this);this.Xp=Uj;this.as=ce;this.bs=Gd;this.Yr=0;this.Xr=100;this.$r=10;this.Zr=0;this.pl=this.Nd=this.kk=this.Pm=this.Rm=null;this.ns=NaN;this.Eg=this.cj=null;this.qp="category";this.Dg=null;this.wj=new B(NaN,NaN,NaN,NaN);this.Ck=this.jt=this.wn=null;this.$j=""}D.Sa(x,P);D.Ai(x);D.ja("Panel",x); -function kp(a){a.dk=Ud;a.bi=1;a.Ui=null;a.Mm=null;a.ai=1;a.$h=null;a.Lm=null;a.he=[];a.de=[];a.nn=lp;a.Km=lp;a.vj=0;a.fj=0} -x.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.ca=this.ca;a.of=this.of.V();a.Dr=this.Dr.V();a.Vi=this.Vi;if(a.ca===ea){a.dk=this.dk.V();a.bi=this.bi;a.Ui=this.Ui;a.Mm=this.Mm;a.ai=this.ai;a.$h=this.$h;a.Lm=this.Lm;var b=[];if(0a&&D.ua(a,">= 0",x,"padding"),a=new Hb(a)):(D.l(a,Hb,x,"padding"),0>a.left&&D.ua(a.left,">= 0",x,"padding:value.left"),0>a.right&&D.ua(a.right,">= 0",x,"padding:value.right"),0>a.top&&D.ua(a.top,">= 0",x,"padding:value.top"),0>a.bottom&&D.ua(a.bottom,">= 0",x,"padding:value.bottom"));var b=this.of;b.O(a)||(this.of=a=a.V(),this.K(),this.i("padding",b,a))}); -D.defineProperty(x,{gm:"defaultAlignment"},function(){return this.Dr},function(a){var b=this.Dr;b.O(a)||(v&&D.l(a,R,x,"defaultAlignment"),this.Dr=a=a.V(),this.K(),this.i("defaultAlignment",b,a))});D.defineProperty(x,{je:"defaultStretch"},function(){return this.Vi},function(a){var b=this.Vi;b!==a&&(D.Ca(a,P,x,"defaultStretch"),this.Vi=a,this.K(),this.i("defaultStretch",b,a))}); -D.defineProperty(x,{qL:"defaultSeparatorPadding"},function(){return void 0===this.dk?Ud:this.dk},function(a){if(void 0!==this.dk){"number"===typeof a?a=new Hb(a):v&&D.l(a,Hb,x,"defaultSeparatorPadding");var b=this.dk;b.O(a)||(this.dk=a=a.V(),this.K(),this.i("defaultSeparatorPadding",b,a))}}); -D.defineProperty(x,{oL:"defaultRowSeparatorStroke"},function(){return void 0===this.Ui?null:this.Ui},function(a){var b=this.Ui;b!==a&&(null===a||"string"===typeof a||a instanceof Ba)&&(a instanceof Ba&&a.freeze(),this.Ui=a,this.qa(),this.i("defaultRowSeparatorStroke",b,a))}); -D.defineProperty(x,{pL:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.bi?1:this.bi},function(a){if(void 0!==this.bi){var b=this.bi;b!==a&&isFinite(a)&&0<=a&&(this.bi=a,this.K(),this.i("defaultRowSeparatorStrokeWidth",b,a))}}); -D.defineProperty(x,{nL:"defaultRowSeparatorDashArray"},function(){return void 0===this.Mm?null:this.Mm},function(a){if(void 0!==this.Mm){var b=this.Mm;if(b!==a){null===a||Array.isArray(a)||D.gc(a,"Array",x,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e=c&&(c=1);var d=this.Ox,e=d.width,d=d.height,g=this.Ga,h=g.width,g=g.height,k=Math.ceil(h/e),l=Math.ceil(g/d),m=this.BF;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.xa.o,q=p.length,r=0;r -e*u*c))){var s=n[r],t=!1,C=!0,A=w.WG;null!==A&&(t=!0,C=a.GA(A,w.Af));if("LineV"===w.Jb){a.lineWidth=w.jb;So(this,a,w.stroke,!1,!1);a.beginPath();for(var N=y=Math.floor(-m.x/e);N<=y+k;N++){var H=N*e+m.x;0<=H&&H=e&&(e=1);d=c.$;h=this.xa.o;g=this.Rm;k=h.length;for(l=0;lthis.RA*q.interval*e))for(r=q.Fa,u=q.jb*q.scale,s=q.Gh,s.Zd()&&(s=dc),p=0;pg.height)continue}else if(l.position>g.width)continue;var m=l.Qq;isNaN(m)&&(m=c?a.bi:a.ai);var n=l.Pq;null===n&&(n=c?a.Ui:a.$h);0!==m&&null!==n&&(So(a,b,n,!1,!1),b.beginPath(),n=l.position+m,c?n>g.height&&(m-=n-g.height):n>g.width&&(m-=n-g.width),l=l.position+m/2,b.lineWidth=m,n=a.padding,c?(l+=n.top,m=n.left,n=g.width-n.right,b.moveTo(m,l),b.lineTo(n,l)):(l+= +d+e+c};var co=(new ka(null)).Ok,Aa;Ba.isValidColor=Aa=function(a){if("black"===a)return!0;if(""===a)return!1;v&&D.h(a,"string",Ba,"isValidColor");co.fillStyle="#000000";var b=co.fillStyle;co.fillStyle=a;if(co.fillStyle!==b)return!0;co.fillStyle="#FFFFFF";b=co.fillStyle;co.fillStyle=a;return co.fillStyle!==b};var eo=new Zn,fo=new Zn,ho=new Zn,io=new Zn;Ba.lighten=function(a){return jo(a)}; +Ba.prototype.lightenBy=function(a,b){this.J&&D.pa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?ao:b;if(this.type===Bg)ko(this.color),this.color=lo(c,d);else if((this.type===Cg||this.type===Ed)&&null!==this.Lk)for(var e=this.Lk.j;e.next();)ko(e.value),this.addColorStop(e.key,lo(c,d));return this};var jo;Ba.lightenBy=jo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?ao:c;ko(a);return lo(b,c)};Ba.darken=function(a){return mo(a)}; +Ba.prototype.darkenBy=function(a,b){this.J&&D.pa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?ao:b;if(this.type===Bg)ko(this.color),this.color=lo(-c,d);else if((this.type===Cg||this.type===Ed)&&null!==this.Lk)for(var e=this.Lk.j;e.next();)ko(e.value),this.addColorStop(e.key,lo(-c,d));return this};var mo;Ba.darkenBy=mo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?ao:c;ko(a);return lo(-b,c)}; +function lo(a,b){switch(b){case ao:var c=100*no(eo.Oc),d=100*no(eo.Ld),e=100*no(eo.gd);ho.Oc=.4124564*c+.3575761*d+.1804375*e;ho.Ld=.2126729*c+.7151522*d+.072175*e;ho.gd=.0193339*c+.119192*d+.9503041*e;ho.mg=eo.mg;c=oo(ho.Oc/po[0]);d=oo(ho.Ld/po[1]);e=oo(ho.gd/po[2]);io.Oc=116*d-16;io.Ld=500*(c-d);io.gd=200*(d-e);io.mg=ho.mg;io.Oc=Math.min(100,Math.max(0,io.Oc+100*a));c=(io.Oc+16)/116;d=c-io.gd/200;ho.Oc=po[0]*qo(io.Ld/500+c);ho.Ld=po[1]*(io.Oc>ro*so?Math.pow(c,3):io.Oc/ro);ho.gd=po[2]*qo(d);ho.mg= +io.mg;c=-.969266*ho.Oc+1.8760108*ho.Ld+.041556*ho.gd;d=.0556434*ho.Oc+-.2040259*ho.Ld+1.0572252*ho.gd;eo.Oc=255*to((3.2404542*ho.Oc+-1.5371385*ho.Ld+-.4985314*ho.gd)/100);eo.Ld=255*to(c/100);eo.gd=255*to(d/100);eo.mg=ho.mg;eo.Oc=Math.round(eo.Oc);255eo.Oc&&(eo.Oc=0);eo.Ld=Math.round(eo.Ld);255eo.Ld&&(eo.Ld=0);eo.gd=Math.round(eo.gd);255eo.gd&&(eo.gd=0);return"rgba("+eo.Oc+", "+eo.Ld+", "+eo.gd+", "+eo.mg+")";case bo:var e=eo.Oc/255,g=eo.Ld/ +255,h=eo.gd/255,k=Math.max(e,g,h),d=Math.min(e,g,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(g-h)/l%6;break;case g:c=(h-e)/l+2;break;case h:c=(e-g)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}fo.Oc=Math.round(c);fo.Ld=Math.round(100*e);fo.gd=Math.round(100*d);fo.mg=eo.mg;fo.gd=Math.min(100,Math.max(0,fo.gd+100*a));return"hsla("+fo.Oc+", "+fo.Ld+"%, "+fo.gd+"%, "+fo.mg+")";default:return D.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}} +function ko(a){co.clearRect(0,0,1,1);co.fillStyle="#000000";var b=co.fillStyle;co.fillStyle=a;co.fillStyle!==b?(co.fillRect(0,0,1,1),a=co.getImageData(0,0,1,1).data,eo.Oc=a[0],eo.Ld=a[1],eo.gd=a[2],eo.mg=a[3]/255):(co.fillStyle="#FFFFFF",b=co.fillStyle,co.fillStyle=a,co.fillStyle===b&&v&&D.k('Color "'+a+'" is not a valid color string for RGBA color conversion'),eo.Oc=0,eo.Ld=0,eo.gd=0,eo.mg=1)}function no(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)} +function to(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var so=216/24389,ro=24389/27,po=[95.047,100,108.883];function oo(a){return a>so?Math.pow(a,1/3):(ro*a+16)/116}function qo(a){var b=a*a*a;return b>so?b:(116*a-16)/ro} +function P(){D.uc(this);this.T=4225027;this.Gc=1;this.Bh=null;this.Xb="";this.ic=this.Lb=null;this.rb=(new O(NaN,NaN)).freeze();this.Ye=je;this.mi=Xd;this.li=he;this.Ic=new Da;this.Li=new Da;this.gj=new Da;this.Bb=this.Zo=1;this.tg=0;this.Og=uo;this.cn=Sd;this.Bd=(new B(NaN,NaN,NaN,NaN)).freeze();this.bc=(new B(NaN,NaN,NaN,NaN)).freeze();this.ad=(new B(0,0,NaN,NaN)).freeze();this.Z=this.Ws=this.Xs=null;this.Hm=this.re=Vc;this.it=0;this.rj=1;this.pr=0;this.Qi=1;this.yt=null;this.mt=-Infinity;this.on= +0;this.pn=Gd;this.qn=uj;this.yr="";this.Cc=this.la=null;this.Lo=-1;this.un=this.wg=this.tl=this.Op=null;this.Wz=Dj;this.kn=null}D.Bi(P);D.ja("GraphObject",P); +P.prototype.cloneProtected=function(a){a.T=this.T|6144;a.Gc=this.Gc;a.Xb=this.Xb;a.Lb=this.Lb;a.ic=this.ic;a.rb.assign(this.rb);a.Ye=this.Ye.V();a.mi=this.mi.V();a.li=this.li.V();a.gj=this.gj.copy();a.Bb=this.Bb;a.tg=this.tg;a.Og=this.Og;a.cn=this.cn.V();a.Bd.assign(this.Bd);a.bc.assign(this.bc);a.ad.assign(this.ad);a.Ws=this.Ws;null!==this.Z&&(a.Z=this.Z.copy());a.re=this.re.V();a.Hm=this.Hm.V();a.it=this.it;a.rj=this.rj;a.pr=this.pr;a.Qi=this.Qi;a.yt=this.yt;a.mt=this.mt;a.on=this.on;a.pn=this.pn.V(); +a.qn=this.qn;a.yr=this.yr;null!==this.la&&(a.la=this.la.copy());a.Cc=this.Cc;a.Lo=this.Lo;null!==this.tl&&(a.tl=D.dm(this.tl));null!==this.wg&&(a.wg=this.wg.copy());a.un=this.un};P.prototype.addCopyProperty=P.prototype.NH=function(a){var b=this.tl;if(D.isArray(b))for(var c=0;ck;)k+=g[n++%l],p=!p;q=!1}else k=g[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}} +P.prototype.raiseChangedEvent=P.prototype.hd=function(a,b,c,d,e,g,h){var k=this.Y;if(null!==k&&(k.ro(a,b,c,d,e,g,h),Fo(this)&&c===this&&a===bg&&Go(this,k,b),c===k&&0!==(k.T&16777216)&&null!==k.data))for(a=this.ya.o,c=a.length,d=0;da&&(a+=360));return a};P.prototype.getDocumentScale=P.prototype.Gj=function(){if(0!==(this.T&4096)===!1)return this.Zo;var a=this.Bb;return null!==this.Q?a*this.Q.Gj():a};P.prototype.getLocalPoint=P.prototype.xF=function(a,b){void 0===b&&(b=new O);b.assign(a);this.Hh.Di(b);return b}; +P.prototype.getNearestIntersectionPoint=P.prototype.yF=function(a,b,c){return this.Vn(a.x,a.y,b.x,b.y,c)};f=P.prototype;f.Vn=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.$l)return g=this.$,Je(g.left,g.top,g.right,g.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.n(0,0);d=this.Ga;c=Je(0,0,d.width,d.height,h,a,b,c,e);e.transform(g);return c}; +function Fk(a,b,c,d,e){if(!1!==Jm(a)){var g=a.margin,h=g.right+g.left,g=g.top+g.bottom;b=Math.max(b-h,0);c=Math.max(c-g,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-g,0);var h=a.angle,g=0,g=a.Ea,k=0;a instanceof z&&(k=a.jb);90===h||270===h?(b=isFinite(g.height)?g.height+k:b,c=isFinite(g.width)?g.width+k:c):(b=isFinite(g.width)?g.width+k:b,c=isFinite(g.height)?g.height+k:c);var g=d||0,k=e||0,l=a instanceof x;switch(Ko(a,!0)){case Xj:k=g=0;l&&(c=b=Infinity);break;case pf:isFinite(b)&&b>d&&(g=b);isFinite(c)&& +c>e&&(k=c);break;case wo:isFinite(b)&&b>d&&(g=b);k=0;l&&(c=Infinity);break;case vo:isFinite(c)&&c>e&&(k=c),g=0,l&&(b=Infinity)}var l=a.kf,m=a.ig;g>l.width&&m.widthl.height&&m.heighta.height||this.hi.nf>a.width))&&(c=!0);this.T=c?this.T|256:this.T&-257;this.bc.F()|| +D.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.bc.toString());this.ly(g,this.bc);Lo(this,!1);D.Kb(g)};f.zj=function(){}; +function Mo(a,b,c,d,e){var g=a.$;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.Ea.F()){g=a.Bd;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=g.width+b;g=g.height+h;d+=b;e+=h;b=Ko(a,!0);c===d&&g===e&&(b=Xj);switch(b){case Xj:if(c>d||g>e)hm(a,!0),Fk(a,c>d?d:c,g>e?e:g);break;case pf:hm(a,!0);Fk(a,d,e,0,0);break;case wo:hm(a,!0);Fk(a,d,g,0,0);break;case vo:hm(a,!0),Fk(a,c,e,0,0)}}} +f.ly=function(a,b){var c=this.Y;null!==c&&null!==c.g&&(c.to!==this&&c.FG!==this&&c.JG!==this||No(c,!0),this.qa(),yb(a,b)||(c.Vk(),this.Os(c)))};f.Os=function(a){null!==this.ud&&(No(a,!0),a instanceof G&&Oo(a,this))};D.defineProperty(P,{Rq:"shadowVisible"},function(){return this.un},function(a){var b=this.un;b!==a&&(v&&null!==a&&D.h(a,"boolean",P,"shadowVisible"),this.un=a,this.qa(),this.i("shadowVisible",b,a))}); +P.prototype.Ee=function(a,b){if(this.visible){var c=this.bc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.opacity,e=1;if(1!==d){if(0===d)return;e=a.globalAlpha;a.globalAlpha=e*d}if(a instanceof od)a:{if(this.visible){var g=null,h=a.Zx;if(this instanceof x&&(this.type===Po||this.type===Qo))Ro(this,a,b);else{var k=this.bc;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.Q;0!==(this.T&4096)===!0&&So(this);var c=0!==(this.T&256),n=!1;this instanceof +na&&(a.font=this.font);if(c){n=m.kh()?m.Ga:m.$;if(null!==this.wg)var p=this.wg,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(k.x,n.x),r=Math.max(k.y,n.y),s=Math.min(k.right,n.right)-q,p=Math.min(k.bottom,n.bottom)-r;if(q>k.width+k.x||k.x>n.width+n.x||r>k.height+k.y||k.y>n.height+n.y)break a;n=!0;qd(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.Kj()){var u=this;if(!u.isVisible())break a}a.Mh.Zb=[1,0,0,1,0,0];q=!1;this.Kj()&&this.Xk&&b.Hj("drawShadows")&&(r=this.tn,a.NB(r.x* +b.scale*b.qd,r.y*b.scale*b.qd,u.Ng),a.wo(),a.shadowColor=u.sn);u=!1;this.Y&&b.Hj("drawShadows")&&(u=this.Y.Xk);!0===this.Rq?(a.wo(),!1===q&&u&&(qd(a,1,0,0,1,0,0),a.ib(),q=!0)):!1===this.Rq&&a.vo();null!==this.ic&&(To(this,a,this.ic,!0,!0),!1===q&&u&&(qd(a,1,0,0,1,0,0),a.ib(),q=!0),this.ic instanceof Ba&&this.ic.type===Ed?(a.beginPath(),a.rect(k.x,k.y,k.width,k.height),a.Wg(this.ic)):a.fillRect(k.x,k.y,k.width,k.height));this instanceof x?qd(a,l.m11,l.m12,l.m21,l.m22,l.dx,l.dy):a.Mh.Zb=[l.m11,l.m12, +l.m21,l.m22,l.dx,l.dy];null!==this.Lb&&(!1===q&&u&&(qd(a,1,0,0,1,0,0),a.ib(),q=!0),s=this.Ga,l=k=0,r=s.width,s=s.height,p=0,this instanceof z&&(s=this.pb.mb,k=s.x,l=s.y,r=s.width,s=s.height,p=this.Pg),To(this,a,this.Lb,!0,!1),this.Lb instanceof Ba&&this.Lb.type===Ed?(a.beginPath(),a.rect(k-p/2,l-p/2,r+p,s+p),a.Wg(this.Lb)):a.fillRect(k-p/2,l-p/2,r+p,s+p));u&&(null!==this.Lb||null!==this.ic||null!==m&&0!==(m.T&512)||null!==m&&(m.type===Nl||m.type===Vj)&&m.Vd()!==this)?(Uo(this,!0),null===this.Rq&& +a.vo()):Uo(this,!1);this.Pk(a,b);u&&0!==(this.T&512)===!0&&a.wo();this.Kj()&&u&&a.vo();c&&(a.restore(),n&&a.Ef.pop());this instanceof x&&(g=a.Ef.pop());!0===q&&a.Ef.pop();null!==a.kF&&(null===g&&(h===a.Zx?(qd(a,1,0,0,1,0,0),g=a.Ef.pop()):g=a.Zx),a.kF(this,g))}}}}else{if(this instanceof x&&(this.type===Po||this.type===Qo)){Ro(this,a,b);1!==d&&(a.globalAlpha=e);return}this instanceof J&&this.Fu(!1);v&&v.Aj&&v.zI(a,this);g=this.transform;h=this.Q;0!==(this.T&4096)===!0&&So(this);m=0!==(this.T&256);a.dq&& +(m=!1);this instanceof na&&(a.font=this.font);if(m){v&&v.jF&&D.trace("clip"+this.toString());n=h.kh()?h.Ga:h.$;null!==this.wg?(q=this.wg,k=q.x,l=q.y,u=q.width,q=q.height):(k=Math.max(c.x,n.x),l=Math.max(c.y,n.y),u=Math.min(c.right,n.right)-k,q=Math.min(c.bottom,n.bottom)-l);if(k>c.width+c.x||c.x>n.width+n.x||l>c.height+c.y||c.y>n.height+n.y){1!==d&&(a.globalAlpha=e);return}v&&v.jF&&v.BI(a,k,l,u,q);a.save();a.beginPath();a.rect(k,l,u,q);a.clip()}if(this.Kj()){if(!this.isVisible()){1!==d&&(a.globalAlpha= +e);return}this.Xk&&b.Hj("drawShadows")&&(n=this.tn,a.NB(n.x*b.scale*b.qd,n.y*b.scale*b.qd,this.Ng),a.wo(),a.shadowColor=this.sn)}n=!1;this.Y&&b.Hj("drawShadows")&&(n=this.Y.Xk);!0===this.Rq?a.wo():!1===this.Rq&&a.vo();null!==this.ic&&(To(this,a,this.ic,!0,!0),this.ic instanceof Ba&&this.ic.type===Ed?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Wg(this.ic)):a.fillRect(c.x,c.y,c.width,c.height));g.wu()||a.transform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);null!==this.Lb&&(u=this.Ga,k=c=0,l=u.width,u= +u.height,q=0,this instanceof z&&(u=this.pb.mb,c=u.x,k=u.y,l=u.width,u=u.height,q=this.Pg),To(this,a,this.Lb,!0,!1),this.Lb instanceof Ba&&this.Lb.type===Ed?(a.beginPath(),a.rect(c-q/2,k-q/2,l+q,u+q),a.Wg(this.Lb)):a.fillRect(c-q/2,k-q/2,l+q,u+q));v&&v.Aj&&v.AI(a,this);n&&(null!==this.Lb||null!==this.ic||null!==h&&0!==(h.T&512)||null!==h&&(h.type===Nl||h.type===Vj)&&h.Vd()!==this)?(Uo(this,!0),null===this.Rq&&a.vo()):Uo(this,!1);this.Pk(a,b);n&&0!==(this.T&512)===!0&&a.wo();this.Kj()&&n&&a.vo();m? +(a.restore(),this instanceof x?a.Be(!0):a.Be(!1)):g.wu()||(h=1/(g.m11*g.m22-g.m12*g.m21),a.transform(g.m22*h,-g.m12*h,-g.m21*h,g.m11*h,h*(g.m21*g.dy-g.m22*g.dx),h*(g.m12*g.dx-g.m11*g.dy)))}1!==d&&(a.globalAlpha=e)}}}; +function Ro(a,b,c){var d=a.bc;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.ic&&(To(a,b,a.ic,!0,!0),a.ic instanceof Ba&&a.ic.type===Ed?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Wg(a.ic)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Lb&&(To(a,b,a.Lb,!0,!1),a.Lb instanceof Ba&&a.Lb.type===Ed?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Wg(a.Lb)):b.fillRect(d.x,d.y,d.width,d.height)),a.Pk(b,c))}P.prototype.Pk=function(){}; +function To(a,b,c,d,e){if(null!==c){var g=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===Bg)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Ga,g=h.width,h=h.height;if(e)var l=a.$,g=l.width,h=l.height;var m=b instanceof Dd;if(m&&c.rh&&(c.type===$n||c.Oo===g&&c.gz===h))k=c.rh;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.$,g=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*g+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*g+c.end.offsetX;q=c.end.y*h+c.end.offsetY; +l+=r;p+=r;n+=s;q+=s;if(c.type===Cg)k=b.createLinearGradient(l,n,p,q);else if(c.type===Ed)s=isNaN(c.du)?Math.max(g,h)/2:c.du,isNaN(c.cv)?(r=0,s=Math.max(g,h)/2):r=c.cv,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===$n)try{k=b.createPattern(c.pattern,"repeat")}catch(u){k=null}else D.hc(c.type,"Brush type");if(c.type!==$n&&(e=c.Lk,null!==e))for(e=e.j;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.rh=k,null!==k&&(c.Oo=g,c.gz=h),null===k&&c.type===$n&&-1!==c.Oo)){c.Oo=-1;var t=a.g;null!==t&& +-1===c.Oo&&D.setTimeout(function(){t.Gq()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}P.prototype.isContainedBy=P.prototype.tm=function(a){if(a instanceof x)a:{if(this!==a&&null!==a)for(var b=this.Q;null!==b;){if(b===a){a=!0;break a}b=b.Q}a=!1}else a=!1;return a};P.prototype.isVisibleObject=P.prototype.Oj=function(){if(!this.visible)return!1;var a=this.Q;return null!==a?a.Oj():!0}; +P.prototype.isEnabledObject=P.prototype.uu=function(){for(var a=this instanceof x?this:this.Q;null!==a&&a.isEnabled;)a=a.Q;return null===a};D.defineProperty(P,{lF:"enabledChanged"},function(){return null!==this.la?this.la.Pr:null},function(a){Ao(this);var b=this.la.Pr;b!==a&&(null!==a&&D.h(a,"function",P,"enabledChanged"),this.la.Pr=a,this.i("enabledChanged",b,a))}); +function So(a){if(0!==(a.T&2048)===!0){var b=a.Ic;b.reset();if(!a.bc.F()||!a.Bd.F()){Vo(a,!1);return}b.translate(a.bc.x,a.bc.y);b.translate(-a.Fa.x,-a.Fa.y);var c=a.Ga;Io(a,b,c.x,c.y,c.width,c.height);Vo(a,!1);Wo(a,!0)}0!==(a.T&4096)===!0&&(b=a.Q,null===b?(a.Li.set(a.Ic),a.Zo=a.scale,Wo(a,!1)):null!==b.Hh&&(c=a.Li,c.reset(),b.kh()?c.multiply(b.Li):null!==b.Q&&c.multiply(b.Q.Li),c.multiply(a.Ic),a.Zo=a.scale*b.Zo,Wo(a,!1)))} +function Io(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=hc;a.Kj()&&a.Lf.fd()&&(h=a.Lf);var k=D.O();if(a instanceof F&&a.uf!==a)for(c=a.uf,d=c.Ga,k.$u(d.x,d.y,d.width,d.height,h),c.gj.wb(k),k.offset(-c.Fa.x,-c.Fa.y),h=c.Q;null!==h&&h!==a;)h.gj.wb(k),k.offset(-h.Fa.x,-h.Fa.y),h=h.Q;else k.$u(c,d,e,g,h);b.rotate(a.angle,k.x,k.y);D.A(k)}}f=P.prototype;f.K=function(a){void 0===a&&(a=!1);if(!0!==Jm(this)){hm(this,!0);Lo(this,!0);var b=this.Q;null===b||a||b.K()}}; +f.wq=function(){!0!==Jm(this)&&(hm(this,!0),Lo(this,!0))};function Xo(a){if(!1===Km(a)){var b=a.Q;null!==b?b.K():a.Kj()&&(b=a.g,null!==b&&(b.Eg.add(a),a instanceof G&&a.gg(),b.Se()));Lo(a,!0)}}f.$i=function(){0!==(this.T&2048)===!1&&(Vo(this,!0),Wo(this,!0))};f.ZA=function(){Wo(this,!0)};f.qa=function(){var a=this.Y;null!==a&&a.qa()}; +function Ko(a,b){var c=a.stretch,d=a.Q;if(null!==d&&d.ca===ea)return Yo(a,d.me(a.$b),d.le(a.column),b);if(null!==d&&d.ca===Nl&&d.Vd()===a)return Zo(a,pf,b);if(c===uo){if(null!==d){if(d.ca===Vj&&d.Vd()===a)return Zo(a,pf,b);c=d.je;return c===uo?Zo(a,Xj,b):Zo(a,c,b)}return Zo(a,Xj,b)}return Zo(a,c,b)} +function Yo(a,b,c,d){var e=a.stretch;if(e!==uo)return Zo(a,e,d);var g=e=null;switch(b.stretch){case vo:g=!0;break;case pf:g=!0}switch(c.stretch){case wo:e=!0;break;case pf:e=!0}b=a.Q.je;null===e&&(e=b===wo||b===pf);null===g&&(g=b===vo||b===pf);return!0===e&&!0===g?Zo(a,pf,d):!0===e?Zo(a,wo,d):!0===g?Zo(a,vo,d):Zo(a,Xj,d)} +function Zo(a,b,c){if(c)return b;if(b===Xj)return Xj;c=a.Ea;if(c.F())return Xj;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===wo)return Xj;if(b===pf)return vo}else{if(b===vo)return Xj;if(b===pf)return wo}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===vo)return Xj;if(b===pf)return wo}else{if(b===wo)return Xj;if(b===pf)return vo}return b} +D.defineProperty(P,{Nq:"segmentOrientation"},function(){return this.qn},function(a){var b=this.qn;b!==a&&(v&&D.Da(a,J,P,"segmentOrientation"),this.qn=a,this.K(),this.i("segmentOrientation",b,a),a===uj&&(this.angle=0))});D.defineProperty(P,{Te:"segmentIndex"},function(){return this.mt},function(a){v&&D.h(a,"number",P,"segmentIndex");a=Math.round(a);var b=this.mt;b!==a&&(this.mt=a,this.K(),this.i("segmentIndex",b,a))}); +D.defineProperty(P,{DB:"segmentFraction"},function(){return this.on},function(a){v&&D.h(a,"number",P,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1a||1=a&&D.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Bb=a,this.$i(),this.K(),this.i("scale",b,a))});D.defineProperty(P,{angle:"angle"},function(){return this.tg},function(a){var b=this.tg;b!==a&&(v&&D.p(a,P,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.tg=a,this.K(),this.$i(),this.i("angle",b,a)))}); +D.defineProperty(P,{Ea:"desiredSize"},function(){return this.Ye},function(a){v&&D.l(a,Ca,P,"desiredSize");var b=a.width,c=a.height,d=this.Ye,e=d.width,g=d.height;(e===b||isNaN(e)&&isNaN(b))&&(g===c||isNaN(g)&&isNaN(c))||(this.Ye=a=a.V(),this.K(),this instanceof z&&this.Re(),this.i("desiredSize",d,a),Fo(this)&&(a=this.Y,null!==a&&(Go(this,a,"width"),Go(this,a,"height"))))}); +D.defineProperty(P,{width:"width"},function(){return this.Ye.width},function(a){var b=this.Ye.width;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",P,"width"),b=this.Ye,this.Ye=a=(new Ca(a,this.Ye.height)).freeze(),this.K(),this instanceof z&&this.Re(),this.i("desiredSize",b,a),Fo(this)&&(a=this.Y,null!==a&&Go(this,a,"width")))}); +D.defineProperty(P,{height:"height"},function(){return this.Ye.height},function(a){var b=this.Ye.height;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",P,"height"),b=this.Ye,this.Ye=a=(new Ca(this.Ye.width,a)).freeze(),this.K(),this instanceof z&&this.Re(),this.i("desiredSize",b,a),Fo(this)&&(a=this.Y,null!==a&&Go(this,a,"height")))}); +D.defineProperty(P,{ig:"minSize"},function(){return this.mi},function(a){var b=this.mi;b.P(a)||(v&&D.l(a,Ca,P,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.mi=a,this.K(),this.i("minSize",b,a))});D.defineProperty(P,{kf:"maxSize"},function(){return this.li},function(a){var b=this.li;b.P(a)||(v&&D.l(a,Ca,P,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.li=a,this.K(),this.i("maxSize",b,a))}); +D.w(P,{Fa:"measuredBounds"},function(){return this.Bd});D.w(P,{Ga:"naturalBounds"},function(){return this.ad},{configurable:!0});D.defineProperty(P,{margin:"margin"},function(){return this.cn},function(a){"number"===typeof a?a=new Ib(a):v&&D.l(a,Ib,P,"margin");var b=this.cn;b.P(a)||(this.cn=a=a.V(),this.K(),this.i("margin",b,a))});D.w(P,{transform:null},function(){0!==(this.T&2048)===!0&&So(this);return this.Ic});D.w(P,{Hh:null},function(){0!==(this.T&4096)===!0&&So(this);return this.Li}); +D.defineProperty(P,{alignment:"alignment"},function(){return this.re},function(a){var b=this.re;b.P(a)||(v&&D.l(a,R,P,"alignment"),a.Zd()&&!a.ed()&&D.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.re=a=a.V(),Xo(this),this.i("alignment",b,a))});D.defineProperty(P,{column:"column"},function(){return this.pr},function(a){v&&D.p(a,P,"column");a=Math.round(a);var b=this.pr;b!==a&&(0>a&&D.ua(a,">= 0",P,"column"),this.pr=a,this.K(),this.i("column",b,a))}); +D.defineProperty(P,{fI:"columnSpan"},function(){return this.Qi},function(a){v&&D.h(a,"number",P,"columnSpan");a=Math.round(a);var b=this.Qi;b!==a&&(1>a&&D.ua(a,">= 1",P,"columnSpan"),this.Qi=a,this.K(),this.i("columnSpan",b,a))});D.defineProperty(P,{$b:"row"},function(){return this.it},function(a){v&&D.p(a,P,"row");a=Math.round(a);var b=this.it;b!==a&&(0>a&&D.ua(a,">= 0",P,"row"),this.it=a,this.K(),this.i("row",b,a))}); +D.defineProperty(P,{rowSpan:"rowSpan"},function(){return this.rj},function(a){v&&D.h(a,"number",P,"rowSpan");a=Math.round(a);var b=this.rj;b!==a&&(1>a&&D.ua(a,">= 1",P,"rowSpan"),this.rj=a,this.K(),this.i("rowSpan",b,a))});D.defineProperty(P,{Hy:"spanAllocation"},function(){return this.yt},function(a){var b=this.yt;b!==a&&(null!==a&&D.h(a,"function",P,"spanAllocation"),this.yt=a,this.K(),this.i("spanAllocation",b,a))}); +D.defineProperty(P,{Gh:"alignmentFocus"},function(){return this.Hm},function(a){var b=this.Hm;b.P(a)||(v&&D.l(a,R,P,"alignmentFocus"),!a.Zd()||a.ed()||a.P(cc)&&this instanceof G||D.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Hm=a=a.V(),this.K(),this.i("alignmentFocus",b,a))}); +D.defineProperty(P,{ud:"portId"},function(){return this.Ws},function(a){var b=this.Ws;if(b!==a){v&&null!==a&&D.h(a,"string",P,"portId");var c=this.Y;null===c||c instanceof G||(D.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&bp(c,this);this.Ws=a;if(null!==a&&c){c.Uk=!0;null===c.xe&&cp(c);var d=this.ud;null!==d&&c.xe.add(d,this)}this.i("portId",b,a)}});function dp(a){var b=a.Y;if(b instanceof G&&(null!==a.ud||a===b.port)){var c=b.g;null===c||c.ra.ob||Oo(b,a)}} +function $o(a){var b=a.g;null===b||b.ra.ob||(a instanceof x?a instanceof G?a.gg():ep(a,a,function(a){dp(a)}):dp(a))}D.defineProperty(P,{Hb:"toSpot"},function(){return null!==this.Z?this.Z.Gk:cc},function(a){this.Wd();var b=this.Z.Gk;b.P(a)||(v&&D.l(a,R,P,"toSpot"),a=a.V(),this.Z.Gk=a,this.i("toSpot",b,a),dp(this))}); +D.defineProperty(P,{Dm:"toEndSegmentLength"},function(){return null!==this.Z?this.Z.Ek:10},function(a){this.Wd();var b=this.Z.Ek;b!==a&&(v&&D.h(a,"number",P,"toEndSegmentLength"),0>a&&D.ua(a,">= 0",P,"toEndSegmentLength"),this.Z.Ek=a,this.i("toEndSegmentLength",b,a),dp(this))}); +D.defineProperty(P,{ev:"toEndSegmentDirection"},function(){return null!==this.Z?this.Z.Dk:Do},function(a){this.Wd();var b=this.Z.Dk;b!==a&&(D.Pn("GraphObject.toEndSegmentDirection","2.0"),v&&D.Da(a,G,P,"toEndSegmentDirection"),this.Z.Dk=a,this.i("toEndSegmentDirection",b,a),dp(this))});D.defineProperty(P,{fv:"toShortLength"},function(){return null!==this.Z?this.Z.Fk:0},function(a){this.Wd();var b=this.Z.Fk;b!==a&&(v&&D.h(a,"number",P,"toShortLength"),this.Z.Fk=a,this.i("toShortLength",b,a),dp(this))}); +D.defineProperty(P,{cH:"toLinkable"},function(){return null!==this.Z?this.Z.Gt:null},function(a){this.Wd();var b=this.Z.Gt;b!==a&&(v&&null!==a&&D.h(a,"boolean",P,"toLinkable"),this.Z.Gt=a,this.i("toLinkable",b,a))});D.defineProperty(P,{wK:"toMaxLinks"},function(){return null!==this.Z?this.Z.Ht:Infinity},function(a){this.Wd();var b=this.Z.Ht;b!==a&&(v&&D.h(a,"number",P,"toMaxLinks"),0>a&&D.ua(a,">= 0",P,"toMaxLinks"),this.Z.Ht=a,this.i("toMaxLinks",b,a))}); +D.defineProperty(P,{Gb:"fromSpot"},function(){return null!==this.Z?this.Z.jk:cc},function(a){this.Wd();var b=this.Z.jk;b.P(a)||(v&&D.l(a,R,P,"fromSpot"),a=a.V(),this.Z.jk=a,this.i("fromSpot",b,a),dp(this))});D.defineProperty(P,{om:"fromEndSegmentLength"},function(){return null!==this.Z?this.Z.hk:10},function(a){this.Wd();var b=this.Z.hk;b!==a&&(v&&D.h(a,"number",P,"fromEndSegmentLength"),0>a&&D.ua(a,">= 0",P,"fromEndSegmentLength"),this.Z.hk=a,this.i("fromEndSegmentLength",b,a),dp(this))}); +D.defineProperty(P,{mu:"fromEndSegmentDirection"},function(){return null!==this.Z?this.Z.gk:Do},function(a){this.Wd();var b=this.Z.gk;b!==a&&(D.Pn("GraphObject.fromEndSegmentDirection","2.0"),v&&D.Da(a,G,P,"fromEndSegmentDirection"),this.Z.gk=a,this.i("fromEndSegmentDirection",b,a),dp(this))}); +D.defineProperty(P,{nu:"fromShortLength"},function(){return null!==this.Z?this.Z.ik:0},function(a){this.Wd();var b=this.Z.ik;b!==a&&(v&&D.h(a,"number",P,"fromShortLength"),this.Z.ik=a,this.i("fromShortLength",b,a),dp(this))});D.defineProperty(P,{vF:"fromLinkable"},function(){return null!==this.Z?this.Z.Sr:null},function(a){this.Wd();var b=this.Z.Sr;b!==a&&(v&&null!==a&&D.h(a,"boolean",P,"fromLinkable"),this.Z.Sr=a,this.i("fromLinkable",b,a))}); +D.defineProperty(P,{OA:"fromMaxLinks"},function(){return null!==this.Z?this.Z.Tr:Infinity},function(a){this.Wd();var b=this.Z.Tr;b!==a&&(v&&D.h(a,"number",P,"fromMaxLinks"),0>a&&D.ua(a,">= 0",P,"fromMaxLinks"),this.Z.Tr=a,this.i("fromMaxLinks",b,a))});D.defineProperty(P,{cursor:"cursor"},function(){return this.yr},function(a){var b=this.yr;b!==a&&(D.h(a,"string",P,"cursor"),this.yr=a,this.i("cursor",b,a))}); +D.defineProperty(P,{click:"click"},function(){return null!==this.la?this.la.Pi:null},function(a){Ao(this);var b=this.la.Pi;b!==a&&(null!==a&&D.h(a,"function",P,"click"),this.la.Pi=a,this.i("click",b,a))});D.defineProperty(P,{cu:"doubleClick"},function(){return null!==this.la?this.la.Wi:null},function(a){Ao(this);var b=this.la.Wi;b!==a&&(null!==a&&D.h(a,"function",P,"doubleClick"),this.la.Wi=a,this.i("doubleClick",b,a))}); +D.defineProperty(P,{wA:"contextClick"},function(){return null!==this.la?this.la.Ri:null},function(a){Ao(this);var b=this.la.Ri;b!==a&&(null!==a&&D.h(a,"function",P,"contextClick"),this.la.Ri=a,this.i("contextClick",b,a))});D.defineProperty(P,{Hu:"mouseEnter"},function(){return null!==this.la?this.la.Gs:null},function(a){Ao(this);var b=this.la.Gs;b!==a&&(null!==a&&D.h(a,"function",P,"mouseEnter"),this.la.Gs=a,this.i("mouseEnter",b,a))}); +D.defineProperty(P,{Iu:"mouseLeave"},function(){return null!==this.la?this.la.Hs:null},function(a){Ao(this);var b=this.la.Hs;b!==a&&(null!==a&&D.h(a,"function",P,"mouseLeave"),this.la.Hs=a,this.i("mouseLeave",b,a))});D.defineProperty(P,{oB:"mouseOver"},function(){return null!==this.la?this.la.lj:null},function(a){Ao(this);var b=this.la.lj;b!==a&&(null!==a&&D.h(a,"function",P,"mouseOver"),this.la.lj=a,this.i("mouseOver",b,a))}); +D.defineProperty(P,{nB:"mouseHover"},function(){return null!==this.la?this.la.kj:null},function(a){Ao(this);var b=this.la.kj;b!==a&&(null!==a&&D.h(a,"function",P,"mouseHover"),this.la.kj=a,this.i("mouseHover",b,a))});D.defineProperty(P,{mB:"mouseHold"},function(){return null!==this.la?this.la.jj:null},function(a){Ao(this);var b=this.la.jj;b!==a&&(null!==a&&D.h(a,"function",P,"mouseHold"),this.la.jj=a,this.i("mouseHold",b,a))}); +D.defineProperty(P,{LJ:"mouseDragEnter"},function(){return null!==this.la?this.la.Es:null},function(a){Ao(this);var b=this.la.Es;b!==a&&(null!==a&&D.h(a,"function",P,"mouseDragEnter"),this.la.Es=a,this.i("mouseDragEnter",b,a))});D.defineProperty(P,{MJ:"mouseDragLeave"},function(){return null!==this.la?this.la.Fs:null},function(a){Ao(this);var b=this.la.Fs;b!==a&&(null!==a&&D.h(a,"function",P,"mouseDragLeave"),this.la.Fs=a,this.i("mouseDragLeave",b,a))}); +D.defineProperty(P,{lB:"mouseDrop"},function(){return null!==this.la?this.la.ij:null},function(a){Ao(this);var b=this.la.ij;b!==a&&(null!==a&&D.h(a,"function",P,"mouseDrop"),this.la.ij=a,this.i("mouseDrop",b,a))});D.defineProperty(P,{BE:"actionDown"},function(){return null!==this.la?this.la.Yq:null},function(a){Ao(this);var b=this.la.Yq;b!==a&&(null!==a&&D.h(a,"function",P,"actionDown"),this.la.Yq=a,this.i("actionDown",b,a))}); +D.defineProperty(P,{CE:"actionMove"},function(){return null!==this.la?this.la.Zq:null},function(a){Ao(this);var b=this.la.Zq;b!==a&&(null!==a&&D.h(a,"function",P,"actionMove"),this.la.Zq=a,this.i("actionMove",b,a))});D.defineProperty(P,{DE:"actionUp"},function(){return null!==this.la?this.la.$q:null},function(a){Ao(this);var b=this.la.$q;b!==a&&(null!==a&&D.h(a,"function",P,"actionUp"),this.la.$q=a,this.i("actionUp",b,a))}); +D.defineProperty(P,{AE:"actionCancel"},function(){return null!==this.la?this.la.Xq:null},function(a){Ao(this);var b=this.la.Xq;b!==a&&(null!==a&&D.h(a,"function",P,"actionCancel"),this.la.Xq=a,this.i("actionCancel",b,a))});D.defineProperty(P,{TB:"toolTip"},function(){return null!==this.la?this.la.uj:null},function(a){Ao(this);var b=this.la.uj;b!==a&&(!v||null===a||a instanceof da||a instanceof fk||D.k("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.la.uj=a,this.i("toolTip",b,a))}); +D.defineProperty(P,{contextMenu:"contextMenu"},function(){return null!==this.la?this.la.Si:null},function(a){Ao(this);var b=this.la.Si;b!==a&&(!v||a instanceof da||a instanceof fk||D.k("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.la.Si=a,this.i("contextMenu",b,a))});P.prototype.bind=P.prototype.bind=function(a){a.Qg=this;var b=this.mm();null!==b&&fp(b)&&D.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.Cc&&(this.Cc=new K(lh));this.Cc.add(a)}; +P.prototype.findTemplateBinder=P.prototype.mm=function(){for(var a=this instanceof x?this:this.Q;null!==a;){if(null!==a.rl)return a;a=a.Q}return null};P.prototype.setProperties=function(a){D.Yu(this,a)};var gp; +P.make=gp=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=hp.na(a);"function"===typeof g?(c=D.dm(arguments),d=g(c),D.Ta(d)||D.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=aa[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||D.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);g=1;if(d instanceof E&&1e)&&D.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.Ie=!0, +a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&D.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.Ie=!1,a.index=e);e=new la;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);D.Yu(a,e)}else D.Yu(a,b);else D.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var hp=new ma("string","function"); +P.getBuilders=function(){var a=new ma("string","function"),b;for(b in hp)if(b!==b.toLowerCase()){var c=hp.na(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};var jp;P.defineBuilder=jp=function(a,b){D.h(a,"string",P,"defineBuilder:name");D.h(b,"function",P,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);hp.add(a,b)};var kp; +P.takeBuilderArgument=kp=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b}; +jp("Button",function(){var a=new Ba(Cg);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new Ba(Cg);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=gp(x,Nl,{su:!0,lF:function(a,b){var e=a.Fd("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},gp(z,{name:"ButtonBorder",Jb:"Rectangle",C:new R(0,0,2.761423749153968,2.761423749153968), +D:new R(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.Hu=function(a,b){if(b.uu()){var e=b.Fd("ButtonBorder");if(e instanceof z){var g=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=g;g=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=g}}};a.Iu=function(a,b){if(b.uu()){var e=b.Fd("ButtonBorder");e instanceof z&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a}); +jp("TreeExpanderButton",function(){var a=gp("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},gp(z,{name:"ButtonIcon",Jb:"MinusLine",Ea:Zd},(new lh("figure","isTreeExpanded",function(a,c){var d=c.Q;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).ky()),{visible:!1},(new lh("visible","isTreeLeaf",function(a){return!a})).ky());a.click=function(a,c){var d=c.Y;d instanceof da&&(d=d.$f);if(d instanceof G){var e=d.g;if(null!==e){e=e.xb;if(d.td){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return; +a.Mc=!0;d.td?e.collapseTree(d):e.expandTree(d)}}};return a}); +jp("SubGraphExpanderButton",function(){var a=gp("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},gp(z,{name:"ButtonIcon",Jb:"MinusLine",Ea:Zd},(new lh("figure","isSubGraphExpanded",function(a,c){var d=c.Q;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).ky()));a.click=function(a,c){var d=c.Y;d instanceof da&&(d=d.$f);if(d instanceof I){var e=d.g;if(null!==e){e=e.xb;if(d.Je){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Mc= +!0;d.Je?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});jp("ContextMenuButton",function(){var a=gp("Button");a.stretch=wo;var b=a.Fd("ButtonBorder");b instanceof z&&(b.Jb="Rectangle",b.C=new R(0,0,2,3),b.D=new R(1,1,-2,-2));return a}); +jp("PanelExpanderButton",function(a){var b=kp(a,"COLLAPSIBLE"),c=gp("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},gp(z,"TriangleUp",{name:"ButtonIcon",Ea:new Ca(6,4)},(new lh("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).ky(b)));a=c.Fd("ButtonBorder");a instanceof z&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var g=c.g;if(null!==g&&!g.nb){var h=c.mm();null===h&&(h=c.Y);null!==h&&(h=h.Fd(b),null!==h&& +(g.ac("Collapse/Expand Panel"),h.visible=!h.visible,g.Td("Collapse/Expand Panel")))}};return c}); +jp("CheckBoxButton",function(a){var b=kp(a);a=gp("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},gp(z,{name:"ButtonIcon",LI:"M0 4 L3 9 9 0",jb:2,stretch:pf,PA:Zj,visible:!1},""!==b?(new lh("visible",b)).AJ():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.nb||""!==b&&e.ga.nb)){a.Mc=!0;var g=d.Fd("ButtonIcon");e.ac("checkbox");g.visible=!g.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.Td("checkbox")}};return a}); +jp("CheckBox",function(a){a=kp(a);a=gp("CheckBoxButton",a,{name:"Button",margin:new Ib(0,1,0,0)});var b=gp(x,"Horizontal",a,{su:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,Hu:a.Hu,Iu:a.Iu,click:a.click,_buttonClick:a.click});a.Hu=null;a.Iu=null;a.click=null;return b}); +function Bo(){this.Pr=this.Si=this.uj=this.Xq=this.$q=this.Zq=this.Yq=this.ij=this.Fs=this.Es=this.jj=this.kj=this.lj=this.Hs=this.Gs=this.Ri=this.Wi=this.Pi=null}Bo.prototype.copy=function(){var a=new Bo;a.Pi=this.Pi;a.Wi=this.Wi;a.Ri=this.Ri;a.Gs=this.Gs;a.Hs=this.Hs;a.lj=this.lj;a.kj=this.kj;a.jj=this.jj;a.Es=this.Es;a.Fs=this.Fs;a.ij=this.ij;a.Yq=this.Yq;a.Zq=this.Zq;a.$q=this.$q;a.Xq=this.Xq;a.uj=this.uj;a.Si=this.Si;a.Pr=this.Pr;return a}; +function x(a){P.call(this);void 0===a?this.ca=ck:(D.Da(a,x,x,"type"),this.ca=a);this.ya=new K(P);this.of=Sd;this.ca===Ql&&(this.$n=!0);this.Cr=Vc;this.Vi=uo;this.ca===ea&&lp(this);this.Yp=Zj;this.$r=ae;this.as=Gd;this.Xr=0;this.Wr=100;this.Zr=10;this.Yr=0;this.rl=this.Nd=this.kk=this.Pm=this.Rm=null;this.ms=NaN;this.Gg=this.cj=null;this.sp="category";this.Fg=null;this.wj=new B(NaN,NaN,NaN,NaN);this.Ck=this.jt=this.wn=null;this.$j=""}D.Sa(x,P);D.Bi(x);D.ja("Panel",x); +function lp(a){a.dk=Sd;a.ci=1;a.Ui=null;a.Mm=null;a.bi=1;a.ai=null;a.Lm=null;a.he=[];a.de=[];a.nn=mp;a.Km=mp;a.vj=0;a.fj=0} +x.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.ca=this.ca;a.of=this.of.V();a.Cr=this.Cr.V();a.Vi=this.Vi;if(a.ca===ea){a.dk=this.dk.V();a.ci=this.ci;a.Ui=this.Ui;a.Mm=this.Mm;a.bi=this.bi;a.ai=this.ai;a.Lm=this.Lm;var b=[];if(0a&&D.ua(a,">= 0",x,"padding"),a=new Ib(a)):(D.l(a,Ib,x,"padding"),0>a.left&&D.ua(a.left,">= 0",x,"padding:value.left"),0>a.right&&D.ua(a.right,">= 0",x,"padding:value.right"),0>a.top&&D.ua(a.top,">= 0",x,"padding:value.top"),0>a.bottom&&D.ua(a.bottom,">= 0",x,"padding:value.bottom"));var b=this.of;b.P(a)||(this.of=a=a.V(),this.K(),this.i("padding",b,a))}); +D.defineProperty(x,{hm:"defaultAlignment"},function(){return this.Cr},function(a){var b=this.Cr;b.P(a)||(v&&D.l(a,R,x,"defaultAlignment"),this.Cr=a=a.V(),this.K(),this.i("defaultAlignment",b,a))});D.defineProperty(x,{je:"defaultStretch"},function(){return this.Vi},function(a){var b=this.Vi;b!==a&&(D.Da(a,P,x,"defaultStretch"),this.Vi=a,this.K(),this.i("defaultStretch",b,a))}); +D.defineProperty(x,{tL:"defaultSeparatorPadding"},function(){return void 0===this.dk?Sd:this.dk},function(a){if(void 0!==this.dk){"number"===typeof a?a=new Ib(a):v&&D.l(a,Ib,x,"defaultSeparatorPadding");var b=this.dk;b.P(a)||(this.dk=a=a.V(),this.K(),this.i("defaultSeparatorPadding",b,a))}}); +D.defineProperty(x,{rL:"defaultRowSeparatorStroke"},function(){return void 0===this.Ui?null:this.Ui},function(a){var b=this.Ui;b!==a&&(null===a||"string"===typeof a||a instanceof Ba)&&(a instanceof Ba&&a.freeze(),this.Ui=a,this.qa(),this.i("defaultRowSeparatorStroke",b,a))}); +D.defineProperty(x,{sL:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.ci?1:this.ci},function(a){if(void 0!==this.ci){var b=this.ci;b!==a&&isFinite(a)&&0<=a&&(this.ci=a,this.K(),this.i("defaultRowSeparatorStrokeWidth",b,a))}}); +D.defineProperty(x,{qL:"defaultRowSeparatorDashArray"},function(){return void 0===this.Mm?null:this.Mm},function(a){if(void 0!==this.Mm){var b=this.Mm;if(b!==a){null===a||Array.isArray(a)||D.hc(a,"Array",x,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e=c&&(c=1);var d=this.Nx,e=d.width,d=d.height,g=this.Ga,h=g.width,g=g.height,k=Math.ceil(h/e),l=Math.ceil(g/d),m=this.EF;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.ya.o,q=p.length,r=0;r +e*u*c))){var s=n[r],t=!1,C=!0,A=w.ZG;null!==A&&(t=!0,C=a.IA(A,w.Af));if("LineV"===w.Jb){a.lineWidth=w.jb;To(this,a,w.stroke,!1,!1);a.beginPath();for(var N=y=Math.floor(-m.x/e);N<=y+k;N++){var H=N*e+m.x;0<=H&&H=e&&(e=1);d=c.$;h=this.ya.o;g=this.Rm;k=h.length;for(l=0;lthis.TA*q.interval*e))for(r=q.Fa,u=q.jb*q.scale,s=q.Gh,s.Zd()&&(s=ec),p=0;pg.height)continue}else if(l.position>g.width)continue;var m=l.Pq;isNaN(m)&&(m=c?a.ci:a.bi);var n=l.Oq;null===n&&(n=c?a.Ui:a.ai);0!==m&&null!==n&&(To(a,b,n,!1,!1),b.beginPath(),n=l.position+m,c?n>g.height&&(m-=n-g.height):n>g.width&&(m-=n-g.width),l=l.position+m/2,b.lineWidth=m,n=a.padding,c?(l+=n.top,m=n.left,n=g.width-n.right,b.moveTo(m,l),b.lineTo(n,l)):(l+= n.left,m=n.top,n=g.height-n.bottom,b.moveTo(l,m),b.lineTo(l,n)),b.stroke())}}} -function Lp(a,b,c,d,e){for(var g=d.length,h=a.$,k=0;km)){var n=l.ff(),p=l.Qq;isNaN(p)&&(p=c?a.bi:a.ai);var q=l.Pq;null===q&&(q=c?a.Ui:a.$h);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Qa;p+n>m&&(n=m-p);0>=n||(m=a.padding,So(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}} -function Jp(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;dm&&e.set(s),D.A(s));D.A(n);g&&e.transform(h)}return c}; -f.K=function(a){P.prototype.K.call(this,a);if(this.ca===Kl||this.ca===kj)a=this.Vd(),null!==a&&a.K(!0);a=this.xa.o;for(var b=a.length,c=0;cMd&&(Nd=Math.max(Md-Pd,0));var Ec=0===$.Qa;$.Qa+=Nd;Md=Math.max(Md-(Nd+(Ec?Pd:0)),0)}1!==ca.Qi||Pc!==Sj&&Pc!==uo||($=this.le(lc),Pd=$.ff(),Nd=Math.max(Wb-$.Qa,0),Nd+Pd>cd&&(Nd=Math.max(cd-Pd,0)),Ec=0===$.Qa,$.Qa+=Nd,cd=Math.max(cd-(Nd+(Ec?Pd:0)),0));hi&&ca.xq()}}}D.Aa(ff);for(var he=0,wd=0,Jb=this.fq,qa=0;qa=this.Nq);rb++)$=this.me(ca.Zb+rb),Jf.height+=Math.max($.Pj,isNaN($.pf)?$.vf:Math.min($.pf,$.vf));for(rb=1;rb=this.fq);rb++)$=this.le(ca.column+rb),Jf.width+=Math.max($.Pj,isNaN($.pf)?$.vf:Math.min($.pf,$.vf));Ya.width+=Jf.width;Ya.height+=Jf.height;xc=ca.margin;Ae=xc.right+xc.left;vd=xc.top+xc.bottom;Ak(ca,Ya.width,Ya.height,qj,rj);for(var If=ca.Fa,Wb=Math.max(If.width+Ae,0),Od=Math.max(If.height+vd,0),kf=0,rb=0;rb=this.Nq);rb++)$=this.me(ca.Zb+rb),kf+=$.total||0;if(kf=ld)&&!(ca.Zb+rb>=this.Nq);rb++){var $=this.me(ca.Zb+rb),Fc=$.Za||0,Kf=lf(ca,$,Gg);v&&"number"!==typeof Kf&&D.k(ca+" spanAllocation does not return a number: "+Kf);$.Qa=Math.min($.vf,Fc+Kf);$.Za!==Fc&&(ld-=$.Za-Fc)}for(;0Fc&&($.Qa=Math.min($.vf,Fc+ld),$.Za!==Fc&&(ld-=$.Za-Fc));if(0===$.index)break;$=this.me($.index-1)}}for(var Te= -0,rb=0;rb=this.fq);rb++)$=this.le(ca.column+rb),Te+=$.total||0;if(Te=ld)&&!(ca.column+rb>=this.fq);rb++)$=this.le(ca.column+rb),Fc=$.Za||0,Kf=lf(ca,$,Gg),v&&"number"!==typeof Kf&&D.k(ca+" spanAllocation does not return a number: "+Kf),$.Qa=Math.min($.vf,Fc+Kf),$.Za!==Fc&&(ld-=$.Za-Fc);for(;0Fc&&($.Qa=Math.min($.vf,Fc+ld),$.Za!==Fc&&(ld-=$.Za-Fc));if(0===$.index)break; -$=this.le($.index-1)}}}D.Aa(Se);D.Rk(Jf);D.Rk(Ya);for(var Hg=0,Ig=0,Pc=Jo(this,!0),uj=this.Ea,Kk=this.kf,Be=wd=he=0,dd=0,Jb=this.fq,qa=0;qami)Ak(ac,Infinity,Infinity),Ce=ac.Fa,nf.Wh(Ce),this.ph.add(Ce);else{var xd=ac.Te,wt=ac.zB,op=ac.Gh;op.Zd()&&(op=gc);var jg=ac.Oq,iw=ac.AB,Qk=0,Rk=0,rm=0;if(xd<-mi||xd>=mi){var xt=Ok.eG, -Lf=Ok.dG;jg!==nj&&(rm=Ok.computeAngle(ac,jg,Lf),ac.rg=rm);Qk=xt.x-Jg.x;Rk=xt.y-Jg.y}else{var Sd,of;if(0<=xd)Sd=Ah.ea(xd),of=xdzt+10?0<=xd?oi.Jc(Sd):Sd.Jc(oi):zt>yt+10?0<=xd?of.Jc(pi):pi.Jc(of):0<=xd?oi.Jc(pi):pi.Jc(oi)}else Lf=0<=xd?Sd.Jc(of):of.Jc(Sd);jg!== -nj&&(rm=Ok.computeAngle(ac,jg,Lf),ac.rg=rm);Qk=Sd.x+(of.x-Sd.x)*wt-Jg.x;Rk=Sd.y+(of.y-Sd.y)*wt-Jg.y}Ak(ac,Infinity,Infinity);var Ce=ac.Fa,pm=ac.Ga,Sk=0;ac instanceof z&&(Sk=ac.jb);var qi=pm.width+Sk,wj=pm.height+Sk;Kg.reset();Kg.translate(-Ce.x,-Ce.y);Kg.scale(ac.scale,ac.scale);Kg.rotate(jg===nj?ac.angle:Lf,qi/2,wj/2);jg!==Tp&&jg!==Up||Kg.rotate(90,qi/2,wj/2);jg!==Vp&&jg!==Wp||Kg.rotate(-90,qi/2,wj/2);jg===Xp&&(45Lf||225Lf)&&Kg.rotate(-Lf,qi/2,wj/2);var Bj=new B(0,0,qi,wj);Pk.so(Bj, -op);Kg.vb(Pk);var jw=-Pk.x+Sk/2,kw=-Pk.y+Sk/2;Lg.assign(iw);isNaN(Lg.x)&&(Lg.x=0<=xd?qi/2+3:-(qi/2+3));isNaN(Lg.y)&&(Lg.y=-(wj/2+3));Lg.rotate(Lf);Qk+=Lg.x;Rk+=Lg.y;Bj.set(Ce);Bj.x=Qk+jw;Bj.y=Rk+kw;this.ph.add(Bj);nf.Wh(Bj)}}if(this instanceof J)for(var At=this.If;At.next();)Ak(At.value,Infinity,Infinity);this.wj=nf;var pp=this.hj;pp.m(pp.x+nf.x,pp.y+nf.y);wb(e,nf.width||0,nf.height||0);D.He(Kg);D.A(Pk);D.A(Lg)}}}break;case "Grid":break;case "Graduated":var lw=a,mw=b,nw=c,ow=d,Mg=this.Vd();this.Pm= -[];var Cj=Mg.margin,pw=Cj.right+Cj.left,qw=Cj.top+Cj.bottom;Ak(Mg,lw,mw,nw,ow);var Bt=Mg.Fa,rw=Bt.height,sw=Math.max(Bt.width+pw,0),tw=Math.max(rw+qw,0),Ct=new B(-Cj.left,-Cj.top,sw,tw);this.Pm.push(Ct);e.assign(Ct);for(var Uk=Mg.Df,Dt=Mg.jb,qp=Uk.JA,Dj=Uk.Kx,ri=Uk.KA,uw=qp.length,rp=0,sp=0,Ej=D.tb(),tp=0;tpyd&&(yd+=360);Et.push(yd)}rp=Ft;sp=Gt}Ej.push(Et)}var Ht; -if(null===this.kk){for(var It=[],vp=this.xa.o,Jt=vp.length,wp=0;wpww&&Kt.push(Lt)}}}this.kk=It}Ht=this.kk;var Mt=this.xa.o,xw=Mt.length,Bh=0,Nt=0,Ot=ri;this.Rm=[];for(var sm=[],tm=0;tmQt*Pt*ri/this.Nx)){var ie=this.AF,Rt=Ht[tm],si=Dj[0][0],Mf=0,zd=0,Nt=ri*Ch.zF-1E-4,Ot=ri*Ch.xF+1E-4,Gj=Qt*Pt;if(iethis.Tk+Gj&&(ti=Math.floor((ie-this.Tk)/Gj),ie-=ti*Gj);for(;ie<=this.QA;){var yp;a:{for(var yw=Rt.length,zp=0;zpri&&(Bh=ri),Nt<=Bh&&Bh<=Ot)){for(var yd=Ej[Mf][zd],Hj=Dj[Mf][zd];Mf -si&&zdum?0Am;Am++){switch(Am){case 0:je.m(xm,ym);break;case 1:je.m(xm+Dp,ym);break;case 2:je.m(xm,ym+Ep);break;case 3:je.m(xm+Dp,ym+Ep)}je.rotate(Zt+Dh.angle);je.offset(Xt,Yt);0===zm&&0===Am?vi.m(je.x,je.y,0,0):vi.Ki(je);je.offset(-Xt,-Yt);je.rotate(-Zt-Dh.angle)}D.A(je);this.Pm.push(vi);Ob(Bw, -vi.x,vi.y,vi.width,vi.height)}else if(ui instanceof na){var Xk=ui,$t=Bp,Ew=e;null===this.Ck&&(this.Ck=new na);var Nf=this.Ck;Kp(Xk,Nf);var Gp=Xk.Gh;Gp.Zd()&&(Gp=dc);for(var Eh=Xk.Oq,Fw=Xk.AB,wi=null,Bm=0,Cm=0,Ng=0,Hp=0,Gw=$t.length,Dm=0;DmNg||225Ng)&&Og.rotate(-Ng,Kj/2,Lj/2);var au=D.gh(0,0,Kj,Lj),Yk=D.P();Yk.so(au,Gp);Og.vb(Yk);var Hw=-Yk.x,Iw=-Yk.y,Pg=D.P();Pg.assign(Fw);isNaN(Pg.x)&&(Pg.x=Kj/2+3);isNaN(Pg.y)&&(Pg.y=-(Lj/2+3));Pg.rotate(Ng);var Bm=Bm+(Pg.x+Hw),Cm=Cm+(Pg.y+Iw),Ip=new B(Bm,Cm,Fh.width,Fh.height),Jw=new B(Fh.x,Fh.y,Fh.width,Fh.height),Kw=new B(Jj.x,Jj.y,Jj.width, -Jj.height),bu=new Yp;bu.gq(Nf.gi);lg.push(Hp);lg.push(Nf.ue);lg.push(bu);lg.push(Ip);lg.push(Jw);lg.push(Kw);0===Dm?wi=Ip.copy():wi.Wh(Ip);D.A(Pg);D.A(Yk);D.Mb(au);D.He(Og)}this.Pm.push(wi);Ob(Ew,wi.x,wi.y,wi.width,wi.height)}em(ui,!1)}}break;case "TableRow":case "TableColumn":D.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:D.k("Unknown panel type: "+n)}}var pf=e.width,qf=e.height,Em=this.padding,Lw=Em.top+ -Em.bottom,pf=pf+(Em.left+Em.right),qf=qf+Lw;isFinite(g.width)&&(pf=g.width);isFinite(g.height)&&(qf=g.height);pf=Math.min(k.width,pf);qf=Math.min(k.height,qf);pf=Math.max(h.width,pf);qf=Math.max(h.height,qf);pf=Math.max(c,pf);qf=Math.max(d,qf);e.width=pf;e.height=qf;wb(this.$c,pf,qf);Go(this,0,0,pf,qf)};x.prototype.findMainElement=x.prototype.Vd=function(){if(null===this.wn){var a=this.xa.o,b=a.length;if(0===b)return null;for(var c=0;cc||p>d)this.K(),Ak(this,n>c?c:n,p>d?d:p);break;case rf:this.K(!0);Ak(this,c+r,d+s,0,0);break;case vo:this.K(!0);Ak(this,c+r,p+s,0,0);break;case uo:this.K(!0),Ak(this,n+r,d+s,0,0)}}k=this.$;k.x=a;k.y=b; -k.width=c;k.height=d;var u=this.ca.Xb;switch(u){case "Position":for(var t=g.length,y=e.x-this.padding.left,w=e.y-this.padding.top,C=0;C=this.Nq);Re++){var di=this.me(Wa+Re);fe.height+=di.total}for(Re=1;Re=this.fq);Re++){var ei=this.le(Ld+Re);fe.width+=ei.total}var qj=qh.Za+fe.width,rj=ph.Za+fe.height;h.x=Zb;h.y=Dc;h.width=qj;h.height=rj;var Jb=Zb,sh=Dc,th=qj,qa=rj;Zb+qj>e.width&&(th=Math.max(e.width-Zb,0));Dc+rj>e.height&&(qa=Math.max(e.height-Dc,0));var ca=Gb.alignment,$b=0,gg=0,fi=0,lc=0;if(ca.ed()){ca=this.gm;ca.fd()||(ca=gc);var $b=ca.x,gg=ca.y,fi=ca.offsetX,lc=ca.offsetY,gi=qh.alignment, -mc=ph.alignment;gi.fd()&&($b=gi.x,fi=gi.offsetX);mc.fd()&&(gg=mc.y,lc=mc.offsetY)}else $b=ca.x,gg=ca.y,fi=ca.offsetX,lc=ca.offsetY;if(isNaN($b)||isNaN(gg))gg=$b=.5,lc=fi=0;var ff=ge.width,Se=ge.height,gf=Gb.margin,ye=gf.left+gf.right,ze=gf.top+gf.bottom,cd=Xo(Gb,ph,qh,!1);!isNaN(Gb.Ea.width)||cd!==rf&&cd!==vo||(ff=Math.max(qj-ye,0));!isNaN(Gb.Ea.height)||cd!==rf&&cd!==uo||(Se=Math.max(rj-ze,0));var Md=Gb.kf,uh=Gb.hg,ff=Math.min(Md.width,ff),Se=Math.min(Md.height,Se),ff=Math.max(uh.width,ff),Se=Math.max(uh.height, -Se),$=Se+ze;h.x+=h.width*$b-(ff+ye)*$b+fi+gf.left;h.y+=h.height*gg-$*gg+lc+gf.top;Gb.visible&&(Pb(Jb,sh,th,qa,h.x,h.y,ge.width,ge.height)?Gb.oc(h.x,h.y,ff,Se):Gb.oc(h.x,h.y,ff,Se,new B(Jb,sh,th,qa)))}else{Gb.$i();Gb.ac.Ya();var hf=Gb.ac;hf.x=kd.type===Oo?Qe:Zb;hf.y=kd.type===Po?ic:Dc;hf.width=ge.width;hf.height=ge.height;Gb.ac.freeze();Ko(Gb,!1)}}}}D.Rk(fe);for(Wa=0;Wa=Od){var ji=this.eG,ig=this.dG;Fg!==nj&&(ii=this.computeAngle(Wb,Fg,ig),Wb.angle=ii);xh=ji.x;yh=ji.y}else{var nc=void 0,Ya=void 0;if(0<=Ec)nc=Pd.o[Ec],Ya=Ecrb+10?0<=Ec?Rd.Jc(nc):nc.Jc(Rd):rb>Jf+10?0<=Ec?Ya.Jc(jf):jf.Jc(Ya):0<=Ec?Rd.Jc(jf): -jf.Jc(Rd)}else ig=0<=Ec?nc.Jc(Ya):Ya.Jc(nc);Fg!==nj&&(ii=this.computeAngle(Wb,Fg,ig),Wb.angle=ii);xh=nc.x+(Ya.x-nc.x)*he;yh=nc.y+(Ya.y-nc.y)*he}if(wd.O(bc))Wb.location=new O(xh,yh);else{wd.Zd()&&(wd=gc);var kf=D.Of();kf.reset();kf.scale(Wb.scale,Wb.scale);kf.rotate(Wb.angle,0,0);var ld=Wb.Ga,Gg=D.gh(0,0,ld.width,ld.height),lf=D.P();lf.so(Gg,wd);kf.vb(lf);var Fc=-lf.x,Kf=-lf.y,Te=tj.copy();isNaN(Te.x)&&(Te.x=0<=Ec?lf.x+3:-(lf.x+3));isNaN(Te.y)&&(Te.y=-(lf.y+3));Te.rotate(ig);xh+=Te.x;yh+=Te.y;kf.fH(Gg); -var Fc=Fc+Gg.x,Kf=Kf+Gg.y,Hg=D.Fb(xh+Fc,yh+Kf);Wb.move(Hg);D.A(Hg);D.A(lf);D.Mb(Gg);D.He(kf)}}this.Gu(!1)}break;case "Grid":break;case "Graduated":if(null!==this.Pm){var Ig=this.Vd(),uj=this.Rm,Kk=this.Pm,Be=0,dd=Kk[Be];Be++;Ig.oc(dd.x-e.x,dd.y-e.y,dd.width,dd.height);for(var Lk=g.length,zh=0;zhq.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof x?n:null;q=D.Of();q.set(h);if(null!==n?n.Qk(a,b,c,d,e,q):Io(p,a,d, -q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);D.He(q)}}}void 0===g&&D.He(h);return d}void 0===g&&D.He(h);return!1};function cq(a,b,c,d){for(var e=a.xa.o,g=e.length;g--;){var h=e[g];if(h.visible){var k=h.$,l=a.Ga;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof x&&cq(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}} -f.On=function(a,b,c,d,e,g){if(!1===this.pg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ga,k=this.kh(),l=k?a:hb(D.Fb(a.x,a.y),this.transform),m=k?b:hb(D.Fb(b.x,b.y),this.transform),n=l.Cf(m),p=0u.width||s.y>u.height||0>s.x+s.width||0>s.y+s.height||(r.kh()?(s=r.transform,hb(k.set(a),s),hb(l.set(b),s)):(k.set(a),l.set(b)),s=r,r=r instanceof x?r:null,null!==r?!r.On(k,l,c,d,e,g):!s.pF(k,l,e))||(null!==c&&(s=c(s)),null===s||null!==d&&!d(s)||g.add(s))}}D.A(k);D.A(l)}return e? -p:h}return!1};function Op(a){var b=null;a instanceof z&&(b=a.C,b===Tc&&(b=null),a=a.Df,null!==a&&null===b&&(b=a.C));null===b&&(b=cc);return b}function Pp(a){var b=null;a instanceof z&&(b=a.D,b===Tc&&(b=null),a=a.Df,null!==a&&null===b&&(b=a.D));null===b&&(b=rc);return b}x.prototype.add=x.prototype.add=function(a){D.l(a,P,x,"add:element");this.Xd(this.xa.count,a)};x.prototype.elt=x.prototype.ea=function(a){return this.xa.ea(a)}; +function qp(a,b,c,d,e){for(var g=d.length,h=a.$,k=0;km)){var n=l.ff(),p=l.Pq;isNaN(p)&&(p=c?a.ci:a.bi);var q=l.Oq;null===q&&(q=c?a.Ui:a.ai);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Qa;p+n>m&&(n=m-p);0>=n||(m=a.padding,To(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}} +function op(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;dm&&e.set(s),D.A(s));D.A(n);g&&e.transform(h)}return c}; +f.K=function(a){P.prototype.K.call(this,a);if(this.ca===Nl||this.ca===rj)a=this.Vd(),null!==a&&a.K(!0);a=this.ya.o;for(var b=a.length,c=0;cMd&&(fd=Math.max(Md-pc,0));var ig=0===$.Qa;$.Qa+=fd;Md=Math.max(Md-(fd+(ig?pc:0)),0)}1!==ca.Qi||oc!==Xj&&oc!==vo||($=this.le(mc),pc=$.ff(),fd=Math.max(ff-$.Qa,0),fd+pc>ed&&(fd=Math.max(ed-pc,0)),ig=0===$.Qa,$.Qa+=fd,ed=Math.max(ed-(fd+(ig?pc:0)),0));ni&&ca.wq()}}}D.Ba(bf);for(var Hc=0,Cb=0,Kb=this.eq,qa=0;qa=this.Mq);ab++)$=this.me(ca.$b+ab),Nd.height+=Math.max($.Qj,isNaN($.pf)?$.vf:Math.min($.pf,$.vf));for(ab=1;ab=this.eq);ab++)$=this.le(ca.column+ab),Nd.width+=Math.max($.Qj,isNaN($.pf)?$.vf:Math.min($.pf,$.vf));ob.width+=Nd.width;ob.height+=Nd.height;Ac=ca.margin;Hf=Ac.right+Ac.left;hg=Ac.top+Ac.bottom;Fk(ca,ob.width,ob.height,wj,xj);for(var If=ca.Fa,ff=Math.max(If.width+Hf,0),gf=Math.max(If.height+hg,0),Ch=0,ab=0;ab=this.Mq);ab++)$=this.me(ca.$b+ab),Ch+=$.total||0;if(Ch=nd)&&!(ca.$b+ab>=this.Mq);ab++){var $=this.me(ca.$b+ab),qc=$.Za||0,Od=zj(ca,$,jg);v&&"number"!==typeof Od&&D.k(ca+" spanAllocation does not return a number: "+Od);$.Qa=Math.min($.vf,qc+Od);$.Za!==qc&&(nd-=$.Za-qc)}for(;0qc&&($.Qa=Math.min($.vf,qc+nd),$.Za!==qc&&(nd-=$.Za-qc));if(0===$.index)break;$=this.me($.index-1)}}for(var Lg= +0,ab=0;ab=this.eq);ab++)$=this.le(ca.column+ab),Lg+=$.total||0;if(Lg=nd)&&!(ca.column+ab>=this.eq);ab++)$=this.le(ca.column+ab),qc=$.Za||0,Od=zj(ca,$,jg),v&&"number"!==typeof Od&&D.k(ca+" spanAllocation does not return a number: "+Od),$.Qa=Math.min($.vf,qc+Od),$.Za!==qc&&(nd-=$.Za-qc);for(;0qc&&($.Qa=Math.min($.vf,qc+nd),$.Za!==qc&&(nd-=$.Za-qc));if(0===$.index)break; +$=this.le($.index-1)}}}D.Ba(Oe);D.Rk(Nd);D.Rk(ob);for(var kg=0,xe=0,oc=Ko(this,!0),pi=this.Ea,Ok=this.kf,Kf=Cb=Hc=0,jf=0,Kb=this.eq,qa=0;qasi)Fk(bc,Infinity,Infinity),ye=bc.Fa,lf.Xh(ye),this.ph.add(ye);else{var xd=bc.Te,wt=bc.DB,tp=bc.Gh;tp.Zd()&&(tp=hc);var lg=bc.Nq,jw=bc.EB,Tk=0,Uk=0,um=0;if(xd<-si||xd>=si){var xt=Rk.hG, +Lf=Rk.gG;lg!==uj&&(um=Rk.computeAngle(bc,lg,Lf),bc.tg=um);Tk=xt.x-Ng.x;Uk=xt.y-Ng.y}else{var Qd,mf;if(0<=xd)Qd=Fh.ea(xd),mf=xdzt+10?0<=xd?ui.Yb(Qd):Qd.Yb(ui):zt>yt+10?0<=xd?mf.Yb(vi):vi.Yb(mf):0<=xd?ui.Yb(vi):vi.Yb(ui)}else Lf=0<=xd?Qd.Yb(mf):mf.Yb(Qd);lg!== +uj&&(um=Rk.computeAngle(bc,lg,Lf),bc.tg=um);Tk=Qd.x+(mf.x-Qd.x)*wt-Ng.x;Uk=Qd.y+(mf.y-Qd.y)*wt-Ng.y}Fk(bc,Infinity,Infinity);var ye=bc.Fa,sm=bc.Ga,Vk=0;bc instanceof z&&(Vk=bc.jb);var wi=sm.width+Vk,Aj=sm.height+Vk;Og.reset();Og.translate(-ye.x,-ye.y);Og.scale(bc.scale,bc.scale);Og.rotate(lg===uj?bc.angle:Lf,wi/2,Aj/2);lg!==Vp&&lg!==Wp||Og.rotate(90,wi/2,Aj/2);lg!==Xp&&lg!==Yp||Og.rotate(-90,wi/2,Aj/2);lg===Zp&&(45Lf||225Lf)&&Og.rotate(-Lf,wi/2,Aj/2);var Fj=new B(0,0,wi,Aj);Sk.uo(Fj, +tp);Og.wb(Sk);var kw=-Sk.x+Vk/2,lw=-Sk.y+Vk/2;Pg.assign(jw);isNaN(Pg.x)&&(Pg.x=0<=xd?wi/2+3:-(wi/2+3));isNaN(Pg.y)&&(Pg.y=-(Aj/2+3));Pg.rotate(Lf);Tk+=Pg.x;Uk+=Pg.y;Fj.set(ye);Fj.x=Tk+kw;Fj.y=Uk+lw;this.ph.add(Fj);lf.Xh(Fj)}}if(this instanceof J)for(var At=this.Jf;At.next();)Fk(At.value,Infinity,Infinity);this.wj=lf;var up=this.hj;up.n(up.x+lf.x,up.y+lf.y);xb(e,lf.width||0,lf.height||0);D.He(Og);D.A(Sk);D.A(Pg)}}}break;case "Grid":break;case "Graduated":var mw=a,nw=b,ow=c,pw=d,Qg=this.Vd();this.Pm= +[];var Gj=Qg.margin,qw=Gj.right+Gj.left,rw=Gj.top+Gj.bottom;Fk(Qg,mw,nw,ow,pw);var Bt=Qg.Fa,sw=Bt.height,tw=Math.max(Bt.width+qw,0),uw=Math.max(sw+rw,0),Ct=new B(-Gj.left,-Gj.top,tw,uw);this.Pm.push(Ct);e.assign(Ct);for(var Xk=Qg.Df,Dt=Qg.jb,vp=Xk.LA,Hj=Xk.Jx,xi=Xk.MA,vw=vp.length,wp=0,xp=0,Ij=D.tb(),yp=0;ypyd&&(yd+=360);Et.push(yd)}wp=Ft;xp=Gt}Ij.push(Et)}var Ht; +if(null===this.kk){for(var It=[],Ap=this.ya.o,Jt=Ap.length,Bp=0;Bpxw&&Kt.push(Lt)}}}this.kk=It}Ht=this.kk;var Mt=this.ya.o,yw=Mt.length,Gh=0,Nt=0,Ot=xi;this.Rm=[];for(var vm=[],wm=0;wmQt*Pt*xi/this.Mx)){var fe=this.DF,Rt=Ht[wm],yi=Hj[0][0],Mf=0,zd=0,Nt=xi*Hh.CF-1E-4,Ot=xi*Hh.AF+1E-4,Kj=Qt*Pt;if(fethis.Tk+Kj&&(zi=Math.floor((fe-this.Tk)/Kj),fe-=zi*Kj);for(;fe<=this.SA;){var Dp;a:{for(var zw=Rt.length,Ep=0;Epxi&&(Gh=xi),Nt<=Gh&&Gh<=Ot)){for(var yd=Ij[Mf][zd],Lj=Hj[Mf][zd];Mf +yi&&zdxm?0Dm;Dm++){switch(Dm){case 0:ge.n(Am,Bm);break;case 1:ge.n(Am+Ip,Bm);break;case 2:ge.n(Am,Bm+Jp);break;case 3:ge.n(Am+Ip,Bm+Jp)}ge.rotate(Zt+Ih.angle);ge.offset(Xt,Yt);0===Cm&&0===Dm?Bi.n(ge.x,ge.y,0,0):Bi.Ki(ge);ge.offset(-Xt,-Yt);ge.rotate(-Zt-Ih.angle)}D.A(ge);this.Pm.push(Bi);Pb(Cw, +Bi.x,Bi.y,Bi.width,Bi.height)}else if(Ai instanceof na){var $k=Ai,$t=Gp,Fw=e;null===this.Ck&&(this.Ck=new na);var Nf=this.Ck;pp($k,Nf);var Lp=$k.Gh;Lp.Zd()&&(Lp=ec);for(var Jh=$k.Nq,Gw=$k.EB,Ci=null,Em=0,Fm=0,Rg=0,Mp=0,Hw=$t.length,Gm=0;GmRg||225Rg)&&Sg.rotate(-Rg,Oj/2,Pj/2);var au=D.sg(0,0,Oj,Pj),al=D.O();al.uo(au,Lp);Sg.wb(al);var Iw=-al.x,Jw=-al.y,Tg=D.O();Tg.assign(Gw);isNaN(Tg.x)&&(Tg.x=Oj/2+3);isNaN(Tg.y)&&(Tg.y=-(Pj/2+3));Tg.rotate(Rg);var Em=Em+(Tg.x+Iw),Fm=Fm+(Tg.y+Jw),Np=new B(Em,Fm,Kh.width,Kh.height),Kw=new B(Kh.x,Kh.y,Kh.width,Kh.height),Lw=new B(Nj.x,Nj.y,Nj.width, +Nj.height),bu=new $p;bu.fq(Nf.hi);ng.push(Mp);ng.push(Nf.ue);ng.push(bu);ng.push(Np);ng.push(Kw);ng.push(Lw);0===Gm?Ci=Np.copy():Ci.Xh(Np);D.A(Tg);D.A(al);D.Kb(au);D.He(Sg)}this.Pm.push(Ci);Pb(Fw,Ci.x,Ci.y,Ci.width,Ci.height)}hm(Ai,!1)}}break;case "TableRow":case "TableColumn":D.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:D.k("Unknown panel type: "+n)}}var nf=e.width,of=e.height,Hm=this.padding,Mw=Hm.top+ +Hm.bottom,nf=nf+(Hm.left+Hm.right),of=of+Mw;isFinite(g.width)&&(nf=g.width);isFinite(g.height)&&(of=g.height);nf=Math.min(k.width,nf);of=Math.min(k.height,of);nf=Math.max(h.width,nf);of=Math.max(h.height,of);nf=Math.max(c,nf);of=Math.max(d,of);e.width=nf;e.height=of;xb(this.ad,nf,of);Ho(this,0,0,nf,of)};x.prototype.findMainElement=x.prototype.Vd=function(){if(null===this.wn){var a=this.ya.o,b=a.length;if(0===b)return null;for(var c=0;cc||p>d)this.K(),Fk(this,n>c?c:n,p>d?d:p);break;case pf:this.K(!0);Fk(this,c+r,d+s,0,0);break;case wo:this.K(!0);Fk(this,c+r,p+s,0,0);break;case vo:this.K(!0),Fk(this,n+r,d+s,0,0)}}k=this.$;k.x=a;k.y=b; +k.width=c;k.height=d;var u=this.ca.Xb;switch(u){case "Position":for(var t=g.length,y=e.x-this.padding.left,w=e.y-this.padding.top,C=0;C=this.Mq);Ne++){var ii=this.me(Wa+Ne);de.height+=ii.total}for(Ne=1;Ne=this.eq);Ne++){var ji=this.le(Ld+Ne);de.width+=ji.total}var wj=uh.Za+de.width,xj=th.Za+de.height;h.x=$b;h.y=Gc;h.width=wj;h.height=xj;var Kb=$b,wh=Gc,xh=wj,qa=xj;$b+wj>e.width&&(xh=Math.max(e.width-$b,0));Gc+xj>e.height&&(qa=Math.max(e.height-Gc,0));var ca=ub.alignment,ac=0,gg=0,ki=0,mc=0;if(ca.ed()){ca=this.hm;ca.fd()||(ca=hc);var ac=ca.x,gg=ca.y,ki=ca.offsetX,mc=ca.offsetY,li=uh.alignment, +nc=th.alignment;li.fd()&&(ac=li.x,ki=li.offsetX);nc.fd()&&(gg=nc.y,mc=nc.offsetY)}else ac=ca.x,gg=ca.y,ki=ca.offsetX,mc=ca.offsetY;if(isNaN(ac)||isNaN(gg))gg=ac=.5,mc=ki=0;var bf=ee.width,Oe=ee.height,cf=ub.margin,ve=cf.left+cf.right,we=cf.top+cf.bottom,ed=Yo(ub,th,uh,!1);!isNaN(ub.Ea.width)||ed!==pf&&ed!==wo||(bf=Math.max(wj-ve,0));!isNaN(ub.Ea.height)||ed!==pf&&ed!==vo||(Oe=Math.max(xj-we,0));var Md=ub.kf,yh=ub.ig,bf=Math.min(Md.width,bf),Oe=Math.min(Md.height,Oe),bf=Math.max(yh.width,bf),Oe=Math.max(yh.height, +Oe),$=Oe+we;h.x+=h.width*ac-(bf+ve)*ac+ki+cf.left;h.y+=h.height*gg-$*gg+mc+cf.top;ub.visible&&(Qb(Kb,wh,xh,qa,h.x,h.y,ee.width,ee.height)?ub.pc(h.x,h.y,bf,Oe):ub.pc(h.x,h.y,bf,Oe,new B(Kb,wh,xh,qa)))}else{ub.$i();ub.bc.Ya();var wd=ub.bc,zh=D.sg(wd.x,wd.y,wd.width,wd.height);wd.x=md.type===Po?Me:$b;wd.y=md.type===Qo?jc:Gc;wd.width=ee.width;wd.height=ee.height;ub.bc.freeze();Lo(ub,!1);if(!yb(zh,wd)){var mi=ub.Y;null!==mi&&(mi.Vk(),ub.Os(mi))}D.Kb(zh)}}}}D.Rk(de);for(Wa=0;Wa=ig){var Kg=this.hG,ob=this.gG;yj!==uj&&(Jg=this.computeAngle(pc,yj,ob),pc.angle=Jg);Ig=Kg.x;Jf=Kg.y}else{var Xb=void 0,Ic=void 0;if(0<=Cb)Xb=Hc.o[Cb],Ic=Cb +nd+10?0<=Cb?Nd.Yb(Xb):Xb.Yb(Nd):nd>Ch+10?0<=Cb?Ic.Yb(ab):ab.Yb(Ic):0<=Cb?Nd.Yb(ab):ab.Yb(Nd)}else ob=0<=Cb?Xb.Yb(Ic):Ic.Yb(Xb);yj!==uj&&(Jg=this.computeAngle(pc,yj,ob),pc.angle=Jg);Ig=Xb.x+(Ic.x-Xb.x)*oi;Jf=Xb.y+(Ic.y-Xb.y)*oi}if(Hg.P(cc))pc.location=new O(Ig,Jf);else{Hg.Zd()&&(Hg=hc);var jg=D.Pf();jg.reset();jg.scale(pc.scale,pc.scale);jg.rotate(pc.angle,0,0);var zj=pc.Ga,qc=D.sg(0,0,zj.width,zj.height),Od=D.O();Od.uo(qc,Hg);jg.wb(Od);var Lg=-Od.x,kg=-Od.y,xe=rp.copy();isNaN(xe.x)&&(xe.x=0<=Cb?Od.x+ +3:-(Od.x+3));isNaN(xe.y)&&(xe.y=-(Od.y+3));xe.rotate(ob);Ig+=xe.x;Jf+=xe.y;jg.iH(qc);var Lg=Lg+qc.x,kg=kg+qc.y,pi=D.Fb(Ig+Lg,Jf+kg);pc.move(pi);D.A(pi);D.A(Od);D.Kb(qc);D.He(jg)}}this.Fu(!1)}break;case "Grid":break;case "Graduated":if(null!==this.Pm){var Ok=this.Vd(),Kf=this.Rm,jf=this.Pm,Dh=0,Pe=jf[Dh];Dh++;Ok.pc(Pe.x-e.x,Pe.y-e.y,Pe.width,Pe.height);for(var Pd=g.length,Mg=0;Mgq.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof x?n:null;q=D.Pf();q.set(h);if(null!==n?n.Qk(a,b,c,d,e,q):Jo(p,a,d, +q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);D.He(q)}}}void 0===g&&D.He(h);return d}void 0===g&&D.He(h);return!1};function eq(a,b,c,d){for(var e=a.ya.o,g=e.length;g--;){var h=e[g];if(h.visible){var k=h.$,l=a.Ga;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof x&&eq(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}} +f.Qn=function(a,b,c,d,e,g){if(!1===this.qg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ga,k=this.kh(),l=k?a:gb(D.Fb(a.x,a.y),this.transform),m=k?b:gb(D.Fb(b.x,b.y),this.transform),n=l.Cf(m),p=0u.width||s.y>u.height||0>s.x+s.width||0>s.y+s.height||(r.kh()?(s=r.transform,gb(k.set(a),s),gb(l.set(b),s)):(k.set(a),l.set(b)),s=r,r=r instanceof x?r:null,null!==r?!r.Qn(k,l,c,d,e,g):!s.sF(k,l,e))||(null!==c&&(s=c(s)),null===s||null!==d&&!d(s)||g.add(s))}}D.A(k);D.A(l)}return e? +p:h}return!1};function Qp(a){var b=null;a instanceof z&&(b=a.C,b===Vc&&(b=null),a=a.Df,null!==a&&null===b&&(b=a.C));null===b&&(b=dc);return b}function Rp(a){var b=null;a instanceof z&&(b=a.D,b===Vc&&(b=null),a=a.Df,null!==a&&null===b&&(b=a.D));null===b&&(b=uc);return b}x.prototype.add=x.prototype.add=function(a){D.l(a,P,x,"add:element");this.Xd(this.ya.count,a)};x.prototype.elt=x.prototype.ea=function(a){return this.ya.ea(a)}; x.prototype.insertAt=x.prototype.Xd=function(a,b){b instanceof F&&D.k("Cannot add a Part to a Panel: "+b);if(this===b||this.tm(b))this===b&&D.k("Cannot make a Panel contain itself: "+this.toString()),D.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.Q;null!==c&&c!==this&&D.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+ -this.toString());this.ca!==Nl||b instanceof z||D.k("Can only add Shapes to a Grid Panel, not: "+b);this.ca!==mp||b instanceof z||b instanceof na||D.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.ym(this);b.kn=null;if(null!==this.Xk){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Dg&&(this.Dg=new ma(Object,x)),this.Dg.add(d,b))}var e=this.xa,d=-1;if(c===this){for(var g=-1,h=this.xa.o,k=h.length,l=0;l=e.count&& -a>=e.count)return;e.jd(g);d=g}else D.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Xd(a,b);this.K();b.K();null!==b.sd?this.Uk=!0:b instanceof x&&!0===b.Uk&&(this.Uk=!0);this.kk=null;c=this.Y;null!==c&&(c.Jl=null,c.tk=NaN,this.Uk&&c instanceof G&&(c.Uk=!0),c.Uk&&c instanceof G&&(c.xe=null),e=this.g,null!==e&&e.ra.nb||(-1!==d&&c.hd(ng,"elements",this,b,null,d,null),c.hd(mg,"elements",this,null,b,null,a),this.vu()||dq(this,b,!1)))}; -D.defineProperty(x,{Uk:null},function(){return 0!==(this.T&8388608)},function(a){0!==(this.T&8388608)!==a&&(this.T^=8388608)});function eq(a,b){a.T=b?a.T|16777216:a.T&-16777217}x.prototype.remove=x.prototype.remove=function(a){D.l(a,P,x,"remove:element");for(var b=this.xa.o,c=b.length,d=-1,e=0;ea&&D.ua(a,">= 0",x,"getRowDefinition:idx");a=Math.round(a);var b=this.he;if(void 0===b[a]){var c=new ch;c.ym(this);c.Ie=!0;c.index=a;b[a]=c}return b[a]};x.prototype.removeRowDefinition=x.prototype.wG=function(a){v&&D.p(a,x,"removeRowDefinition:idx");0>a&&D.ua(a,">= 0",x,"removeRowDefinition:idx");a=Math.round(a);var b=this.he;this.hd(ng,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()}; -D.w(x,{fq:"columnCount"},function(){return void 0===this.de?0:this.de.length});x.prototype.getColumnDefinition=x.prototype.le=function(a){v&&D.p(a,x,"getColumnDefinition:idx");0>a&&D.ua(a,">= 0",x,"getColumnDefinition:idx");a=Math.round(a);var b=this.de;if(void 0===b[a]){var c=new ch;c.ym(this);c.Ie=!1;c.index=a;b[a]=c}return b[a]}; -x.prototype.removeColumnDefinition=x.prototype.tG=function(a){v&&D.p(a,x,"removeColumnDefinition:idx");0>a&&D.ua(a,">= 0",x,"removeColumnDefinition:idx");a=Math.round(a);var b=this.de;this.hd(ng,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()}; -D.defineProperty(x,{cK:"rowSizing"},function(){return void 0===this.nn?lp:this.nn},function(a){if(void 0!==this.nn){var b=this.nn;b!==a&&(a!==lp&&a!==Rp&&D.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.nn=a,this.K(),this.i("rowSizing",b,a))}}); -D.defineProperty(x,{bI:"columnSizing"},function(){return void 0===this.Km?lp:this.Km},function(a){if(void 0!==this.Km){var b=this.Km;b!==a&&(a!==lp&&a!==Rp&&D.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Km=a,this.K(),this.i("columnSizing",b,a))}}); -D.defineProperty(x,{cH:"topIndex"},function(){return void 0===this.vj?0:this.vj},function(a){if(void 0!==this.vj){var b=this.vj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.vj=a,this.K(),this.i("topIndex",b,a))}}); -D.defineProperty(x,{$F:"leftIndex"},function(){return void 0===this.fj?0:this.fj},function(a){if(void 0!==this.fj){var b=this.fj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.fj=a,this.K(),this.i("leftIndex",b,a))}});x.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==ea)return NaN;for(var b=0,c=this.he,d=c.length,e=this.vj;ea)return-1;if(this.type!==ea)return NaN;for(var b=0,c=this.de,d=c.length,e=this.fj;e=c.elements.count&&!(c instanceof F)){if(1===c.elements.count){var d=null!==c.Xk;if(!d)for(var e=b.j;e.next();)if("itemArray"=== -e.value.ev){d=!0;break}}d||(D.trace("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),fq=!0)}}))}var fq=!1;x.prototype.copyTemplate=function(){var a=this.copy();a.AK(function(a){a instanceof x&&(a.pl=null,a.Nd=null);var c=a.Bc;null!==c&&(a.Bc=null,c.each(function(c){a.bind(c.copy())}))});return a}; -x.prototype.updateTargetBindings=x.prototype.Nb=function(a){var b=this.pl;if(null!==b)for(void 0===a&&(a=""),b=b.j;b.next();){var c=b.value,d=c.TG;if(""===a||""===d||d===a)if(d=c.ev,null!==c.gI||""!==d){var d=this.data,e=c.Vq;if(null!==e)d=""===e?this:"/"===e?this:"."===e?this:".."===e?this:this.Ed(e);else{var g=this.g;null!==g&&c.Yx&&(d=g.ga.Yk)}if(null===d)v&&D.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var g=this,h=c.Bm;if(-1!==h){if(g=this.Gx(h),null===g)continue}else null!== -c.Og&&(g=c.Og);"/"===e?d=g.Y:"."===e?d=g:".."===e&&(d=g.Q);e=c.Et;if(0!==e){if(!(g instanceof x))continue;h=g;1===e?g=h.le(c.Up):2===e&&(g=h.me(c.Up))}void 0!==g&&c.iH(g,d)}}}}; -D.defineProperty(x,{Xk:"itemArray"},function(){return this.cj},function(a){var b=this.cj;if(b!==a){v&&null!==a&&!D.isArray(a)&&D.k("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.g;null!==c&&null!==b&&Xm(c,this);this.cj=a;null!==c&&null!==a&&Tm(c,this);this.i("itemArray",b,a);null!==c&&c.ra.nb||this.uB()}});function pn(a){return a.type===Qj||a.type===Kl||a.type===kj||a.type===ea&&0a;)this.rf(this.xa.length-1);a=this.Xk;if(null!==a)for(var b=D.cb(a),c=0;cc)){var d;d=gq(a,b);var e=a.mJ,g=null;null!==e&&(g=e.oa(d));null===g&&(hq||(hq=!0,D.trace('No item template Panel found for category "'+d+'" on '+a),D.trace(" Using default item template."),d=new x,e=new na,e.bind(new ih("text","",ja)),d.add(e),iq=d),g=iq);d=g;null!==d&&(Kh(d),d=d.copy(),0!==(d.T&16777216)&&(e=a.lm(),null!==e&&eq(e,!0)),"object"===typeof b&&(null===a.Dg&&(a.Dg=new ma(Object,x)),a.Dg.add(b,d)),e=c,pn(a)&&e++,a.Xd(e,d),d.Nd=b,qn(a,e, -c),d.Nd=null,d.data=b)}}function qn(a,b,c){for(a=a.xa;ba&&D.ua(a,">= 0",ch,"height"),this.pf=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.pd("height",b,a))});D.defineProperty(ch,{width:"width"},function(){return this.pf},function(a){var b=this.pf;b!==a&&(v&&D.h(a,"number",ch,"width"),0>a&&D.ua(a,">= 0",ch,"width"),this.pf=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.pd("width",b,a))}); -D.defineProperty(ch,{Pj:"minimum"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(v&&D.h(a,"number",ch,"minimum"),(0>a||!isFinite(a))&&D.ua(a,">= 0",ch,"minimum"),this.vk=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.pd("minimum",b,a))});D.defineProperty(ch,{vf:"maximum"},function(){return this.uk},function(a){var b=this.uk;b!==a&&(v&&D.h(a,"number",ch,"maximum"),0>a&&D.ua(a,">= 0",ch,"maximum"),this.uk=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.pd("maximum",b,a))}); -D.defineProperty(ch,{alignment:"alignment"},function(){return this.re},function(a){var b=this.re;b.O(a)||(v&&D.l(a,R,ch,"alignment"),this.re=a.V(),null!==this.Q&&this.Q.K(),this.pd("alignment",b,a))});D.defineProperty(ch,{stretch:"stretch"},function(){return this.Mg},function(a){var b=this.Mg;b!==a&&(v&&D.Ca(a,P,ch,"stretch"),this.Mg=a,null!==this.Q&&this.Q.K(),this.pd("stretch",b,a))}); -D.defineProperty(ch,{NG:"separatorPadding"},function(){return this.zk},function(a){"number"===typeof a?a=new Hb(a):null!==a&&v&&D.l(a,Hb,ch,"separatorPadding");var b=this.zk;null!==a&&null!==b&&b.O(a)||(null!==a&&(a=a.V()),this.zk=a,null!==this.Q&&this.Q.K(),this.pd("separatorPadding",b,a))}); -D.defineProperty(ch,{Pq:"separatorStroke"},function(){return this.qt},function(a){var b=this.qt;b!==a&&(null===a||"string"===typeof a||a instanceof Ba)&&(a instanceof Ba&&a.freeze(),this.qt=a,null!==this.Q&&this.Q.K(),this.pd("separatorStroke",b,a))});D.defineProperty(ch,{Qq:"separatorStrokeWidth"},function(){return this.rt},function(a){var b=this.rt;b!==a&&(this.rt=a,null!==this.Q&&this.Q.K(),this.pd("separatorStrokeWidth",b,a))}); -D.defineProperty(ch,{rM:"separatorDashArray"},function(){return this.ni},function(a){var b=this.ni;if(b!==a){null===a||Array.isArray(a)||D.gc(a,"Array",ch,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ee)){for(var g=d.Fa,h=Math.max(1,g.width),g=g.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,u=q=0,t=D.tb(),y=2;yp&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,y=0,q=t[y],p=q[0],s=q[1],r=q[2],q=q[3],w=0;.1<=u;){0===w&&(n?(e=c,e-=m,u-=m,n=!1):e=c,0===e&&(e=1));if(e>u){D.Aa(t);return}e> -q?(w=e-q,e=q):w=0;var C=Math.sqrt(e*e/(1+r*r));0>p&&(C=-C);k+=C;l+=r*C;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(g/2));0===w&&d.Pk(a,b);a.translate(h/2,g/2);a.rotate(-s);a.translate(-k,-l);u-=e;q-=e;if(0!==w){y++;if(y===t.length){D.Aa(t);return}q=t[y];p=q[0];s=q[1];r=q[2];q=q[3];e=w}}D.Aa(t)}} -z.prototype.Pk=function(a,b){if(null!==this.xc||null!==this.Od){null!==this.Od&&So(this,a,this.Od,!0,!1);null!==this.xc&&So(this,a,this.xc,!1,!1);var c=this.Ng;if(0===c){var d=this.Y;d instanceof da&&d.type===kj&&"Selection"===d.Dd&&d.zb instanceof z&&d.Zf.Vd()===d.zb&&(c=d.zb.jb)}a.lineWidth=c;a.lineJoin=this.Sp;a.lineCap=this.Qp;a.miterLimit=this.vn;var e=!1;this.Y&&b.Gj("drawShadows")&&(e=this.Y.Wk);var g=!0;null!==this.xc&&null===this.Od&&(g=!1);var d=!1,h=!0,k=this.WG;null!==k&&(d=!0,h=a.GA(k, -this.Af));var l=this.ob;if(null!==l){if(l.ca===sf)a.beginPath(),d&&!h?Do(a,l.wc,l.Gc,l.Ab,l.Ib,k,this.Af):(a.moveTo(l.wc,l.Gc),a.lineTo(l.Ab,l.Ib)),null!==this.Od&&a.Ug(this.Od),0!==c&&null!==this.xc&&a.Vj();else if(l.ca===tf){var m=l.wc,n=l.Gc,p=l.Ab,q=l.Ib,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.Od&&(a.beginPath(),a.rect(l,r,m,n),a.Ug(this.Od));if(null!==this.xc){var s=p=0,u=0;g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= -0,a.shadowBlur=0);d&&!h?(h=D.tb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),lq(a,h,k,this.Af),a.Vj(),D.Aa(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.Vj());g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.ca===uf)m=l.wc,n=l.Gc,p=l.Ab,q=l.Ib,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+Fd*l,n-r,m+l,n-Fd*r,m+l,n),a.bezierCurveTo(m+ -l,n+Fd*r,m+Fd*l,n+r,m,n+r),a.bezierCurveTo(m-Fd*l,n+r,m-l,n+Fd*r,m-l,n),a.bezierCurveTo(m-l,n-Fd*r,m-Fd*l,n-r,m,n-r),a.closePath(),null!==this.Od&&a.Ug(this.Od),d&&!h&&(h=D.tb(),Fe(m,n-r,m+Fd*l,n-r,m+l,n-Fd*r,m+l,n,.5,h),Fe(m+l,n,m+l,n+Fd*r,m+Fd*l,n+r,m,n+r,.5,h),Fe(m,n+r,m-Fd*l,n+r,m-l,n+Fd*r,m-l,n,.5,h),Fe(m-l,n,m-l,n-Fd*r,m-Fd*l,n-r,m,n-r,.5,h),a.beginPath(),lq(a,h,k,this.Af),D.Aa(h)),0!==c&&null!==this.xc&&(g&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= -0,a.shadowBlur=0,a.Vj(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u):a.Vj());else if(l.ca===cf){r=l.fk;n=r.length;for(q=0;qy.xf);else{var t=Sf(y,m),w=t.length;if(0===w){a.lineTo(y.na,y.va);break}for(var C=0;Ce)){var g=.001,h=c.length,k=b[0],l=b[1];if(4===e)Do(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=g=0,n=0,p=0,q=0,r=p=0,s=D.tb(),u=2;ur&&(g=r);g>p?(t=g-p,g=p):t=0;var y=Math.sqrt(g*g/(1+q*q));0>n&&(y=-y);k+=y;l+= -q*y;e?a.lineTo(k,l):a.moveTo(k,l);r-=g;p-=g;if(0!==t){u++;if(u===s.length){D.Aa(s);return}p=s[u];n=p[0];q=p[1];p=p[2];g=t}else e=!e}D.Aa(s)}}}z.prototype.getDocumentPoint=z.prototype.eb=function(a,b){void 0===b&&(b=new O);if(a instanceof R){a.Zd()&&D.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ga,d=this.jb;b.m(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.Hh.vb(b);return b}; -z.prototype.Mk=function(a,b){var c=this.Df;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.sb,e=this.jb/2;c.type!==sf||b||(e+=2);var g=D.Nf();g.assign(d);g.eg(e+2,e+2);if(!g.Oa(a))return D.Mb(g),!1;d=e+1E-4;if(c.type===sf){if(null===this.stroke)return!1;d=(c.H-c.ma)*(a.x-c.ma)+(c.I-c.ka)*(a.y-c.ka);if(0>(c.ma-c.H)*(a.x-c.H)+(c.ka-c.I)*(a.y-c.I)||0>d)return!1;D.Mb(g);return ue(c.ma,c.ka,c.H,c.I,e,a.x,a.y)}if(c.type===tf){var h=c.ma,k=c.ka,l=c.H,m=c.I;g.x=Math.min(h,l);g.y=Math.min(k, -m);g.width=Math.abs(l-h);g.height=Math.abs(m-k);if(null===this.fill){g.eg(-d,-d);if(g.Oa(a))return D.Mb(g),!1;g.eg(d,d)}null!==this.stroke&&g.eg(e,e);e=g.Oa(a);D.Mb(g);return e}if(c.type===uf){var h=c.ma,k=c.ka,l=c.H,m=c.I,c=Math.min(h,l),n=Math.min(k,m),h=Math.abs(l-h)/2,k=Math.abs(m-k)/2,c=a.x-(c+h),n=a.y-(n+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=c*c/(h*h)+n*n/(k*k))return D.Mb(g),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);D.Mb(g);return 0>=h||0>=k?!1:1>=c*c/(h*h)+n*n/(k*k)}if(c.type=== -cf)return D.Mb(g),null===this.fill?Vf(c,a.x,a.y,e):c.Oa(a,e,1=this.jb)n=Me(p.wc,p.Gc,p.Ab,p.Ib,g,h,k,l,e);else{var r=0,s=0;p.wc===p.Ab?(r=m,s=0):(b=(p.Ib-p.Gc)/(p.Ab-p.wc),s=m/Math.sqrt(1+b*b),r=s*b);d=D.tb();b=new O;Me(p.wc+ -r,p.Gc+s,p.Ab+r,p.Ib+s,g,h,k,l,b)&&d.push(b);b=new O;Me(p.wc-r,p.Gc-s,p.Ab-r,p.Ib-s,g,h,k,l,b)&&d.push(b);b=new O;Me(p.wc+r,p.Gc+s,p.wc-r,p.Gc-s,g,h,k,l,b)&&d.push(b);b=new O;Me(p.Ab+r,p.Ib+s,p.Ab-r,p.Ib-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return D.Aa(d),!1;n=!0;s=Infinity;for(r=0;rMath.abs(c)){n=h-b-c*(g-d);if(0>a*a*c*c+t*t-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+t*t-n*n);k=(-(a*a*c*n)+a*t*m)/(t*t+a*a*c*c)+d;a=(-(a*a*c*n)-a*t*m)/(t*t+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((g-k)*(g-k))+Math.abs((h-l)*(h-l));h=Math.abs((g-a)*(g-a))+Math.abs((h-b)*(h- -b));dk){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);dc?a-c:c-a)<(b>d?b-d:d-b)?(e=be||yb(l.y,e))&&(l.ye||yb(l.x,e))&&(l.x=h&&d<=a}a=h&&g<=a} -z.prototype.pF=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.Mk(a,!0))return!0;var e=a.Cf(b);b=e;1.5=e||kb(b,g,0,-p)>=e||kb(b,g,0,p)>=e||kb(b,g,n,0)>= -e?!1:!0}else if(g.type===cf){h=g.sb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.xh&&a.ye&&jb(a.x,a.y,k,l,m,l)>e&&jb(a.x,a.y,m,h,k,h)>e&&jb(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?Vf(g,a.x,a.y,b):g.Oa(a,b,!0))return!0}else{c=g.kc;for(b=0;be)return!1;l=k.Db.o;m=l.length;for(h=0;he)return!1;break;case Of:g=D.tb(); -Fe(n,p,q.Ac,q.Wc,q.Rh,q.Sh,q.H,q.I,.8,g);n=d(g,a);D.Aa(g);if(n)return!1;n=q.H;p=q.I;if(a.mq(n,p)>e)return!1;break;case Pf:g=D.tb();Je(n,p,q.Ac,q.Wc,q.H,q.I,.8,g);n=d(g,a);D.Aa(g);if(n)return!1;n=q.H;p=q.I;if(a.mq(n,p)>e)return!1;break;case Qf:case Rf:var r=q.type===Qf?Sf(q,k):Tf(q,k,n,p),s=r.length;if(0===s){n=q.na;p=q.va;if(a.mq(n,p)>e)return!1;break}q=null;g=D.tb();for(b=0;b= 0",z,"strokeWidth:value")}); -D.defineProperty(z,{wM:"strokeCap"},function(){return this.Qp},function(a){var b=this.Qp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?D.ua(a,'"butt", "round", or "square"',z,"strokeCap"):(this.Qp=a,this.qa(),this.i("strokeCap",b,a)))}); -D.defineProperty(z,{yM:"strokeJoin"},function(){return this.Sp},function(a){var b=this.Sp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?D.ua(a,'"miter", "bevel", or "round"',z,"strokeJoin"):(this.Sp=a,this.qa(),this.i("strokeJoin",b,a)))}); -D.defineProperty(z,{zM:"strokeMiterLimit"},function(){return this.vn},function(a){var b=this.vn;if(b!==a)if(v&&D.p(a,z,"strokeMiterLimit"),1<=a){this.vn=a;this.qa();var c=this.Y;null!==c&&(c.tk=NaN);this.i("strokeMiterLimit",b,a)}else D.ua(a,"value >= 1",z,"strokeWidth:value")}); -D.defineProperty(z,{WG:"strokeDashArray"},function(){return this.Rp},function(a){var b=this.Rp;if(b!==a){null===a||Array.isArray(a)||D.gc(a,"Array",z,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1a?a=0:1a?a=0:1n*l*l&&(h=!0);b.md!==a&&(h=!1);!1===b.Gj("textGreeking")&&(h=!1);n=this.si;l=this.ti;switch(this.ku){case xo:a.translate(c, -0);a.scale(-1,1);break;case wo:a.translate(0,d);a.scale(1,-1);break;case yo:a.translate(c,d),a.scale(-1,-1)}var m=this.ue,p=(n+e+l)*m;d>p&&(k=this.Tl,k=k.y*d-k.y*p+k.offsetY);for(var p=this.gi,q=0;qc&&(r=c);var k=k+n,u=s,s=a,t=k,y=c,w=e,C=g,A=0;h?("left"===C?A=0:"right"===C?A=y-r:"center"===C&&(A=(y-r)/2),s.fillRect(0+A,t+.25*w,r,1)):("left"===C?A=0:"right"===C?A=y:"center"===C&&(A=y/2),s.fillText(u,0+A,t+w-.25*w),u=w/20|0,0===u&&(u=1),"right"===C?A-=r:"center"=== -C&&(A-=r/2),this.qk&&(s.beginPath(),s.lineWidth=u,s.moveTo(0+A,t+w-.2*w),s.lineTo(0+A+r,t+w-.2*w),s.stroke()),this.pk&&(s.beginPath(),s.lineWidth=u,t=t+w-w/2.2|0,0!==u%2&&(t+=.5),s.moveTo(0+A,t),s.lineTo(0+A+r,t),s.stroke()));k+=e+l}switch(this.ku){case xo:a.scale(-1,1);a.translate(-c,0);break;case wo:a.scale(1,-1);a.translate(0,-d);break;case yo:a.scale(-1,-1),a.translate(-c,-d)}}}; -na.prototype.computeAngle=function(a,b){var c=0;switch(a){default:case nj:c=0;break;case sq:c=b;break;case Tp:c=b+90;break;case Vp:c=b-90;break;case Lq:c=b+180;break;case Mq:c=Ye(b);90c&&(c-=180);break;case Up:c=Ye(b+90);90c&&(c-=180);break;case Wp:c=Ye(b-90);90c&&(c-=180);break;case Xp:c=Ye(b);if(45c||225c)return 0;90c&&(c-=180)}return Ye(c)}; -na.prototype.ho=function(a,b,c,d){this.tp=a;var e=this.gi;e.reset();var g=0,h=0;if(isNaN(this.Ea.width)){g=this.Sd.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.Xx){for(var k=h=0,l=!1;!l;){var m=g.indexOf("\n",k);-1===m&&(m=g.length,l=!0);k=Nq(g.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.xg);k>h&&(h=k);k=m+1}g=h}else h=g.indexOf("\n",0),0<=h&&(g=g.substr(0,h)),g=k=Nq(g,this.xg);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.Ea.width;null!==this.Q&&(g=Math.min(g, -this.Q.kf.width),g=Math.max(g,this.Q.hg.width));h=Jq(this,g,e);m=h=isNaN(this.Ea.height)?Math.min(h,b/this.scale):this.Ea.height;if(0!==e.nf&&1!==e.Xe.length&&this.nj===Gq&&(b=this.xg,l=this.nj===Gq?Oq(b):0,k=this.si+this.ti,k=Math.max(0,Kq(this)+k),m=Math.min(this.zJ-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Xe.length))){k=e.Xe[m];for(a=Math.max(1,a-l);Nq(k,b)>a&&1=a.vh)return new Ca(0,l);if(a.Ik===Eq){c.xj=1;g=Nq(b,k);if(0===h||g<=d)return c.nf=g,c.yf.push(c.nf),c.Xe.push(b),new Ca(g,l);var m=Pq(b);b=b.substr(m.length);for(var n=Pq(b),g=Nq(m+n,k);0d&&1d;){n=1;g=Nq(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=Nq(m.substr(0,n),k);1===n?(c.yf[a.ue+p]=g,e=Math.max(e,g)):(c.yf[a.ue+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Xe[a.ue+p]=m.substr(0,n);p++;m=m.substr(n);if(a.ue+p>a.vh)break}n=Pq(b);for(g=Nq(m+n,k);0a.vh))break}c.xj=Math.min(a.vh,p);c.nf=Math.max(c.nf,e);return new Ca(c.nf,l*c.xj)}function Pq(a){for(var b=a.length,c=0;c=b?a:a.substr(0,c)} -function Nq(a,b){Cq!==b&&(Cq=Dq.font=b);return Dq.measureText(a).width}function Kq(a){if(null!==a.Om)return a.Om;var b=a.xg;Cq!==b&&(Cq=Dq.font=b);var c=0;void 0!==xq[b]&&5E3>yq?c=xq[b]:(c=1.3*Dq.measureText("M").width,xq[b]=c,yq++);return a.Om=c}function Oq(a){Cq!==a&&(Cq=Dq.font=a);var b=0;void 0!==zq[a]&&5E3>Aq?b=zq[a]:(b=Dq.measureText(Bq).width,zq[a]=b,Aq++);return b} -function Jq(a,b,c){var d=a.Sd.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.si+a.ti,e=Math.max(0,Kq(a)+e);if(0===d.length)return c.nf=0,a.ue=1,e;if(!a.Xx){var g=d.indexOf("\n",0);0<=g&&(d=d.substr(0,g))}for(var g=0,h=a.ue=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.Ik!==Eq?(c.xj=0,h=Iq(a,h,c,b),g+=h.height,a.ue+=c.xj):(Iq(a,h,c,b),g+=e,a.ue++),a.ue===a.vh&&(l=!0)),h=k+1;return a.pw=g} -D.defineProperty(na,{NB:"textValidation"},function(){return this.Ql},function(a){var b=this.Ql;b!==a&&(null!==a&&D.h(a,"function",na,"textValidation"),this.Ql=a,this.i("textValidation",b,a))});D.defineProperty(na,{YG:"textEdited"},function(){return this.Ft},function(a){var b=this.Ft;b!==a&&(null!==a&&D.h(a,"function",na,"textEdited"),this.Ft=a,this.i("textEdited",b,a))}); -D.defineProperty(na,{tM:"spacingAbove"},function(){return this.si},function(a){var b=this.si;b!==a&&(v&&D.h(a,"number",na,"spacingAbove"),this.si=a,this.i("spacingAbove",b,a))});D.defineProperty(na,{uM:"spacingBelow"},function(){return this.ti},function(a){var b=this.ti;b!==a&&(v&&D.h(a,"number",na,"spacingBelow"),this.ti=a,this.i("spacingBelow",b,a))}); -D.defineProperty(na,{zJ:"maxLines"},function(){return this.vh},function(a){var b=this.vh;b!==a&&(v&&D.h(a,"number",na,"maxLines"),a=Math.floor(a),0>=a&&D.ua(a,"> 0",na,"maxLines"),this.vh=a,this.i("maxLines",b,a),this.K())});D.w(na,{UL:"metrics"},function(){return this.gi});D.defineProperty(na,{cL:"choices"},function(){return this.or},function(a){var b=this.or;b!==a&&(null===a||Array.isArray(a)||D.gc(a,"Array",na,"choices:value"),this.or=a,this.i("choices",b,a))}); -function Yp(){this.nf=this.xj=0;this.yf=[];this.Xe=[]}Yp.prototype.reset=function(){this.nf=this.xj=0;this.yf=[];this.Xe=[]};Yp.prototype.gq=function(a){this.xj=a.xj;this.nf=a.nf;this.yf=D.cm(a.yf);this.Xe=D.cm(a.Xe)};D.w(Yp,{$K:"arrSize"},function(){return this.yf});D.w(Yp,{aL:"arrText"},function(){return this.Xe});D.w(Yp,{TL:"maxLineWidth"},function(){return this.nf}); -function Cl(){P.call(this);this.Ze=null;this.xt="";this.Ak=ne;this.hp=rf;this.wi=this.$e=null;this.gp=gc;this.wg=Sj;this.Tp=null;this.Hz=!1;this.bp=!0;this.nw=!1;this.Lp=null}D.Sa(Cl,P);D.ja("Picture",Cl);Cl.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.element=this.Ze;a.xt=this.xt;a.Ak=this.Ak.V();a.hp=this.hp;a.wg=this.wg;a.$e=this.$e;a.wi=this.wi;a.gp=this.gp.V();a.bp=this.bp;a.Lp=this.Lp}; -Cl.prototype.nc=function(a){a===Sj||a===Uj||a===Vj?this.YI=a:P.prototype.nc.call(this,a)};Cl.prototype.toString=function(){return"Picture("+this.source+")#"+D.Fd(this)};var Qq=new la,Rq=0,wl=[];function Sq(){var a=wl;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d=d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(g=g+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case rf:n=d.width;p=d.height;break;case Uj:case Vj:var s=0;q===Uj?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===Vj&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(g=(g+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height), -n=d.width,p=d.height)}var q=this.Fj()*b.scale,u=k*h/(n*q*p*q),s=Qq[this.source],q=null;if(void 0!==s&&16s.$p.length&&(Xq(s,4,l,m),Xq(s,16,l,m));for(var l=s.$p,m=l.length,q=l[0],t=0;te;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.2,.22);b.D=new R(.8, -.9);D.u(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=ar(6);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.07,.25);b.D=new R(.93,.75);D.u(a);return b},Heptagon:function(a,b,c){var d=ar(7);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.2,.15);b.D=new R(.8,.85);D.u(a);return b},Octagon:function(a,b,c){var d=ar(8);a=D.v();T(a,d[0].x*b,d[0].y*c,!0); -for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.85);D.u(a);return b},Nonagon:function(a,b,c){var d=ar(9);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.17,.13);b.D=new R(.82,.82);D.u(a);return b},Decagon:function(a,b,c){var d=ar(10);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b}, -Dodecagon:function(a,b,c){var d=ar(12);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b},FivePointedStar:function(a,b,c){var d=$q(5);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.312,.383);b.D=new R(.693,.765);D.u(a);return b},SixPointedStar:function(a,b,c){var d=$q(6);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x* -b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.17,.251);b.D=new R(.833,.755);D.u(a);return b},SevenPointedStar:function(a,b,c){var d=$q(7);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.363,.361);b.D=new R(.641,.709);D.u(a);return b},EightPointedStar:function(a,b,c){var d=$q(8);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.252,.255);b.D=new R(.75,.75);D.u(a);return b},NinePointedStar:function(a, -b,c){var d=$q(9);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.355,.361);b.D=new R(.645,.651);D.u(a);return b},TenPointedStar:function(a,b,c){var d=$q(10);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Aa(d);X(a);b=a.q;b.C=new R(.281,.261);b.D=new R(.723,.748);D.u(a);return b},FivePointedBurst:function(a,b,c){var d=Zq(5);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e=e.count&& +a>=e.count)return;e.jd(g);d=g}else D.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Xd(a,b);this.K();b.K();null!==b.ud?this.Uk=!0:b instanceof x&&!0===b.Uk&&(this.Uk=!0);this.kk=null;c=this.Y;null!==c&&(c.Ll=null,c.tk=NaN,this.Uk&&c instanceof G&&(c.Uk=!0),c.Uk&&c instanceof G&&(c.xe=null),e=this.g,null!==e&&e.ra.ob||(-1!==d&&c.hd(og,"elements",this,b,null,d,null),c.hd(dg,"elements",this,null,b,null,a),this.uu()||fq(this,b,!1)))}; +D.defineProperty(x,{Uk:null},function(){return 0!==(this.T&8388608)},function(a){0!==(this.T&8388608)!==a&&(this.T^=8388608)});function gq(a,b){a.T=b?a.T|16777216:a.T&-16777217}x.prototype.remove=x.prototype.remove=function(a){D.l(a,P,x,"remove:element");for(var b=this.ya.o,c=b.length,d=-1,e=0;ea&&D.ua(a,">= 0",x,"getRowDefinition:idx");a=Math.round(a);var b=this.he;if(void 0===b[a]){var c=new fh;c.xm(this);c.Ie=!0;c.index=a;b[a]=c}return b[a]};x.prototype.removeRowDefinition=x.prototype.zG=function(a){v&&D.p(a,x,"removeRowDefinition:idx");0>a&&D.ua(a,">= 0",x,"removeRowDefinition:idx");a=Math.round(a);var b=this.he;this.hd(og,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()}; +D.w(x,{eq:"columnCount"},function(){return void 0===this.de?0:this.de.length});x.prototype.getColumnDefinition=x.prototype.le=function(a){v&&D.p(a,x,"getColumnDefinition:idx");0>a&&D.ua(a,">= 0",x,"getColumnDefinition:idx");a=Math.round(a);var b=this.de;if(void 0===b[a]){var c=new fh;c.xm(this);c.Ie=!1;c.index=a;b[a]=c}return b[a]}; +x.prototype.removeColumnDefinition=x.prototype.wG=function(a){v&&D.p(a,x,"removeColumnDefinition:idx");0>a&&D.ua(a,">= 0",x,"removeColumnDefinition:idx");a=Math.round(a);var b=this.de;this.hd(og,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()}; +D.defineProperty(x,{fK:"rowSizing"},function(){return void 0===this.nn?mp:this.nn},function(a){if(void 0!==this.nn){var b=this.nn;b!==a&&(a!==mp&&a!==Tp&&D.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.nn=a,this.K(),this.i("rowSizing",b,a))}}); +D.defineProperty(x,{eI:"columnSizing"},function(){return void 0===this.Km?mp:this.Km},function(a){if(void 0!==this.Km){var b=this.Km;b!==a&&(a!==mp&&a!==Tp&&D.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Km=a,this.K(),this.i("columnSizing",b,a))}}); +D.defineProperty(x,{fH:"topIndex"},function(){return void 0===this.vj?0:this.vj},function(a){if(void 0!==this.vj){var b=this.vj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.vj=a,this.K(),this.i("topIndex",b,a))}}); +D.defineProperty(x,{cG:"leftIndex"},function(){return void 0===this.fj?0:this.fj},function(a){if(void 0!==this.fj){var b=this.fj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.fj=a,this.K(),this.i("leftIndex",b,a))}});x.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==ea)return NaN;for(var b=0,c=this.he,d=c.length,e=this.vj;ea)return-1;if(this.type!==ea)return NaN;for(var b=0,c=this.de,d=c.length,e=this.fj;e=c.elements.count&&!(c instanceof F)){if(1===c.elements.count){var d=null!==c.Yk;if(!d)for(var e=b.j;e.next();)if("itemArray"=== +e.value.dv){d=!0;break}}d||(D.trace("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),hq=!0)}}))}var hq=!1;x.prototype.copyTemplate=function(){var a=this.copy();a.DK(function(a){a instanceof x&&(a.rl=null,a.Nd=null);var c=a.Cc;null!==c&&(a.Cc=null,c.each(function(c){a.bind(c.copy())}))});return a}; +x.prototype.updateTargetBindings=x.prototype.Nb=function(a){var b=this.rl;if(null!==b)for(void 0===a&&(a=""),b=b.j;b.next();){var c=b.value,d=c.WG;if(""===a||""===d||d===a)if(d=c.dv,null!==c.jI||""!==d){var d=this.data,e=c.Uq;if(null!==e)d=""===e?this:"/"===e?this:"."===e?this:".."===e?this:this.Fd(e);else{var g=this.g;null!==g&&c.Xx&&(d=g.ga.Zk)}if(null===d)v&&D.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var g=this,h=c.Bm;if(-1!==h){if(g=this.Fx(h),null===g)continue}else null!== +c.Qg&&(g=c.Qg);"/"===e?d=g.Y:"."===e?d=g:".."===e&&(d=g.Q);e=c.Dt;if(0!==e){if(!(g instanceof x))continue;h=g;1===e?g=h.le(c.Vp):2===e&&(g=h.me(c.Vp))}void 0!==g&&c.lH(g,d)}}}}; +D.defineProperty(x,{Yk:"itemArray"},function(){return this.cj},function(a){var b=this.cj;if(b!==a){v&&null!==a&&!D.isArray(a)&&D.k("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.g;null!==c&&null!==b&&Zm(c,this);this.cj=a;null!==c&&null!==a&&Vm(c,this);this.i("itemArray",b,a);null!==c&&c.ra.ob||this.yB()}});function rn(a){return a.type===Vj||a.type===Nl||a.type===rj||a.type===ea&&0a;)this.rf(this.ya.length-1);a=this.Yk;if(null!==a)for(var b=D.cb(a),c=0;cc)){var d;d=iq(a,b);var e=a.pJ,g=null;null!==e&&(g=e.na(d));null===g&&(jq||(jq=!0,D.trace('No item template Panel found for category "'+d+'" on '+a),D.trace(" Using default item template."),d=new x,e=new na,e.bind(new lh("text","",ja)),d.add(e),kq=d),g=kq);d=g;null!==d&&(Oh(d),d=d.copy(),0!==(d.T&16777216)&&(e=a.mm(),null!==e&&gq(e,!0)),"object"===typeof b&&(null===a.Fg&&(a.Fg=new ma(Object,x)),a.Fg.add(b,d)),e=c,rn(a)&&e++,a.Xd(e,d),d.Nd=b,sn(a,e, +c),d.Nd=null,d.data=b)}}function sn(a,b,c){for(a=a.ya;ba&&D.ua(a,">= 0",fh,"height"),this.pf=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.rd("height",b,a))});D.defineProperty(fh,{width:"width"},function(){return this.pf},function(a){var b=this.pf;b!==a&&(v&&D.h(a,"number",fh,"width"),0>a&&D.ua(a,">= 0",fh,"width"),this.pf=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.rd("width",b,a))}); +D.defineProperty(fh,{Qj:"minimum"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(v&&D.h(a,"number",fh,"minimum"),(0>a||!isFinite(a))&&D.ua(a,">= 0",fh,"minimum"),this.vk=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.rd("minimum",b,a))});D.defineProperty(fh,{vf:"maximum"},function(){return this.uk},function(a){var b=this.uk;b!==a&&(v&&D.h(a,"number",fh,"maximum"),0>a&&D.ua(a,">= 0",fh,"maximum"),this.uk=a,this.Qa=this.Za,null!==this.Q&&this.Q.K(),this.rd("maximum",b,a))}); +D.defineProperty(fh,{alignment:"alignment"},function(){return this.re},function(a){var b=this.re;b.P(a)||(v&&D.l(a,R,fh,"alignment"),this.re=a.V(),null!==this.Q&&this.Q.K(),this.rd("alignment",b,a))});D.defineProperty(fh,{stretch:"stretch"},function(){return this.Og},function(a){var b=this.Og;b!==a&&(v&&D.Da(a,P,fh,"stretch"),this.Og=a,null!==this.Q&&this.Q.K(),this.rd("stretch",b,a))}); +D.defineProperty(fh,{QG:"separatorPadding"},function(){return this.zk},function(a){"number"===typeof a?a=new Ib(a):null!==a&&v&&D.l(a,Ib,fh,"separatorPadding");var b=this.zk;null!==a&&null!==b&&b.P(a)||(null!==a&&(a=a.V()),this.zk=a,null!==this.Q&&this.Q.K(),this.rd("separatorPadding",b,a))}); +D.defineProperty(fh,{Oq:"separatorStroke"},function(){return this.qt},function(a){var b=this.qt;b!==a&&(null===a||"string"===typeof a||a instanceof Ba)&&(a instanceof Ba&&a.freeze(),this.qt=a,null!==this.Q&&this.Q.K(),this.rd("separatorStroke",b,a))});D.defineProperty(fh,{Pq:"separatorStrokeWidth"},function(){return this.rt},function(a){var b=this.rt;b!==a&&(this.rt=a,null!==this.Q&&this.Q.K(),this.rd("separatorStrokeWidth",b,a))}); +D.defineProperty(fh,{uM:"separatorDashArray"},function(){return this.oi},function(a){var b=this.oi;if(b!==a){null===a||Array.isArray(a)||D.hc(a,"Array",fh,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ee)){for(var g=d.Fa,h=Math.max(1,g.width),g=g.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,u=q=0,t=D.tb(),y=2;yp&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,y=0,q=t[y],p=q[0],s=q[1],r=q[2],q=q[3],w=0;.1<=u;){0===w&&(n?(e=c,e-=m,u-=m,n=!1):e=c,0===e&&(e=1));if(e>u){D.Ba(t);return}e> +q?(w=e-q,e=q):w=0;var C=Math.sqrt(e*e/(1+r*r));0>p&&(C=-C);k+=C;l+=r*C;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(g/2));0===w&&d.Pk(a,b);a.translate(h/2,g/2);a.rotate(-s);a.translate(-k,-l);u-=e;q-=e;if(0!==w){y++;if(y===t.length){D.Ba(t);return}q=t[y];p=q[0];s=q[1];r=q[2];q=q[3];e=w}}D.Ba(t)}} +z.prototype.Pk=function(a,b){if(null!==this.yc||null!==this.Od){null!==this.Od&&To(this,a,this.Od,!0,!1);null!==this.yc&&To(this,a,this.yc,!1,!1);var c=this.Pg;if(0===c){var d=this.Y;d instanceof da&&d.type===rj&&"Selection"===d.Ed&&d.zb instanceof z&&d.$f.Vd()===d.zb&&(c=d.zb.jb)}a.lineWidth=c;a.lineJoin=this.Tp;a.lineCap=this.Rp;a.miterLimit=this.vn;var e=!1;this.Y&&b.Hj("drawShadows")&&(e=this.Y.Xk);var g=!0;null!==this.yc&&null===this.Od&&(g=!1);var d=!1,h=!0,k=this.ZG;null!==k&&(d=!0,h=a.IA(k, +this.Af));var l=this.pb;if(null!==l){if(l.ca===qf)a.beginPath(),d&&!h?Eo(a,l.xc,l.Hc,l.Ab,l.Ib,k,this.Af):(a.moveTo(l.xc,l.Hc),a.lineTo(l.Ab,l.Ib)),null!==this.Od&&a.Wg(this.Od),0!==c&&null!==this.yc&&a.Wj();else if(l.ca===rf){var m=l.xc,n=l.Hc,p=l.Ab,q=l.Ib,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.Od&&(a.beginPath(),a.rect(l,r,m,n),a.Wg(this.Od));if(null!==this.yc){var s=p=0,u=0;g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= +0,a.shadowBlur=0);d&&!h?(h=D.tb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),nq(a,h,k,this.Af),a.Wj(),D.Ba(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.Wj());g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.ca===sf)m=l.xc,n=l.Hc,p=l.Ab,q=l.Ib,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+Fd*l,n-r,m+l,n-Fd*r,m+l,n),a.bezierCurveTo(m+ +l,n+Fd*r,m+Fd*l,n+r,m,n+r),a.bezierCurveTo(m-Fd*l,n+r,m-l,n+Fd*r,m-l,n),a.bezierCurveTo(m-l,n-Fd*r,m-Fd*l,n-r,m,n-r),a.closePath(),null!==this.Od&&a.Wg(this.Od),d&&!h&&(h=D.tb(),Be(m,n-r,m+Fd*l,n-r,m+l,n-Fd*r,m+l,n,.5,h),Be(m+l,n,m+l,n+Fd*r,m+Fd*l,n+r,m,n+r,.5,h),Be(m,n+r,m-Fd*l,n+r,m-l,n+Fd*r,m-l,n,.5,h),Be(m-l,n,m-l,n-Fd*r,m-Fd*l,n-r,m,n-r,.5,h),a.beginPath(),nq(a,h,k,this.Af),D.Ba(h)),0!==c&&null!==this.yc&&(g&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= +0,a.shadowBlur=0,a.Wj(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u):a.Wj());else if(l.ca===Ze){r=l.fk;n=r.length;for(q=0;qy.xf);else{var t=Rf(y,m),w=t.length;if(0===w){a.lineTo(y.oa,y.va);break}for(var C=0;Ce)){var g=.001,h=c.length,k=b[0],l=b[1];if(4===e)Eo(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=g=0,n=0,p=0,q=0,r=p=0,s=D.tb(),u=2;ur&&(g=r);g>p?(t=g-p,g=p):t=0;var y=Math.sqrt(g*g/(1+q*q));0>n&&(y=-y);k+=y;l+= +q*y;e?a.lineTo(k,l):a.moveTo(k,l);r-=g;p-=g;if(0!==t){u++;if(u===s.length){D.Ba(s);return}p=s[u];n=p[0];q=p[1];p=p[2];g=t}else e=!e}D.Ba(s)}}}z.prototype.getDocumentPoint=z.prototype.eb=function(a,b){void 0===b&&(b=new O);if(a instanceof R){a.Zd()&&D.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ga,d=this.jb;b.n(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.Hh.wb(b);return b}; +z.prototype.Mk=function(a,b){var c=this.Df;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.mb,e=this.jb/2;c.type!==qf||b||(e+=2);var g=D.Of();g.assign(d);g.Ff(e+2,e+2);if(!g.Oa(a))return D.Kb(g),!1;d=e+1E-4;if(c.type===qf){if(null===this.stroke)return!1;d=(c.H-c.ma)*(a.x-c.ma)+(c.I-c.ka)*(a.y-c.ka);if(0>(c.ma-c.H)*(a.x-c.H)+(c.ka-c.I)*(a.y-c.I)||0>d)return!1;D.Kb(g);return re(c.ma,c.ka,c.H,c.I,e,a.x,a.y)}if(c.type===rf){var h=c.ma,k=c.ka,l=c.H,m=c.I;g.x=Math.min(h,l);g.y=Math.min(k, +m);g.width=Math.abs(l-h);g.height=Math.abs(m-k);if(null===this.fill){g.Ff(-d,-d);if(g.Oa(a))return D.Kb(g),!1;g.Ff(d,d)}null!==this.stroke&&g.Ff(e,e);e=g.Oa(a);D.Kb(g);return e}if(c.type===sf){var h=c.ma,k=c.ka,l=c.H,m=c.I,c=Math.min(h,l),n=Math.min(k,m),h=Math.abs(l-h)/2,k=Math.abs(m-k)/2,c=a.x-(c+h),n=a.y-(n+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=c*c/(h*h)+n*n/(k*k))return D.Kb(g),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);D.Kb(g);return 0>=h||0>=k?!1:1>=c*c/(h*h)+n*n/(k*k)}if(c.type=== +Ze)return D.Kb(g),null===this.fill?Uf(c,a.x,a.y,e):c.Oa(a,e,1=this.jb)n=Ie(p.xc,p.Hc,p.Ab,p.Ib,g,h,k,l,e);else{var r=0,s=0;p.xc===p.Ab?(r=m,s=0):(b=(p.Ib-p.Hc)/(p.Ab-p.xc),s=m/Math.sqrt(1+b*b),r=s*b);d=D.tb();b=new O;Ie(p.xc+ +r,p.Hc+s,p.Ab+r,p.Ib+s,g,h,k,l,b)&&d.push(b);b=new O;Ie(p.xc-r,p.Hc-s,p.Ab-r,p.Ib-s,g,h,k,l,b)&&d.push(b);b=new O;Ie(p.xc+r,p.Hc+s,p.xc-r,p.Hc-s,g,h,k,l,b)&&d.push(b);b=new O;Ie(p.Ab+r,p.Ib+s,p.Ab-r,p.Ib-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return D.Ba(d),!1;n=!0;s=Infinity;for(r=0;rMath.abs(c)){n=h-b-c*(g-d);if(0>a*a*c*c+t*t-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+t*t-n*n);k=(-(a*a*c*n)+a*t*m)/(t*t+a*a*c*c)+d;a=(-(a*a*c*n)-a*t*m)/(t*t+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((g-k)*(g-k))+Math.abs((h-l)*(h-l));h=Math.abs((g-a)*(g-a))+Math.abs((h-b)*(h- +b));dk){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);dc?a-c:c-a)<(b>d?b-d:d-b)?(e=be||zb(l.y,e))&&(l.ye||zb(l.x,e))&&(l.x=h&&d<=a}a=h&&g<=a} +z.prototype.sF=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.Mk(a,!0))return!0;var e=a.Cf(b);b=e;1.5=e||jb(b,g,0,-p)>=e||jb(b,g,0,p)>=e||jb(b,g,n,0)>= +e?!1:!0}else if(g.type===Ze){h=g.mb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.xh&&a.ye&&ib(a.x,a.y,k,l,m,l)>e&&ib(a.x,a.y,m,h,k,h)>e&&ib(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?Uf(g,a.x,a.y,b):g.Oa(a,b,!0))return!0}else{c=g.lc;for(b=0;be)return!1;l=k.Db.o;m=l.length;for(h=0;he)return!1;break;case Df:g=D.tb(); +Be(n,p,q.Bc,q.Xc,q.Sh,q.Th,q.H,q.I,.8,g);n=d(g,a);D.Ba(g);if(n)return!1;n=q.H;p=q.I;if(a.lq(n,p)>e)return!1;break;case Of:g=D.tb();Fe(n,p,q.Bc,q.Xc,q.H,q.I,.8,g);n=d(g,a);D.Ba(g);if(n)return!1;n=q.H;p=q.I;if(a.lq(n,p)>e)return!1;break;case Pf:case Qf:var r=q.type===Pf?Rf(q,k):Sf(q,k,n,p),s=r.length;if(0===s){n=q.oa;p=q.va;if(a.lq(n,p)>e)return!1;break}q=null;g=D.tb();for(b=0;b= 0",z,"strokeWidth:value")}); +D.defineProperty(z,{zM:"strokeCap"},function(){return this.Rp},function(a){var b=this.Rp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?D.ua(a,'"butt", "round", or "square"',z,"strokeCap"):(this.Rp=a,this.qa(),this.i("strokeCap",b,a)))}); +D.defineProperty(z,{BM:"strokeJoin"},function(){return this.Tp},function(a){var b=this.Tp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?D.ua(a,'"miter", "bevel", or "round"',z,"strokeJoin"):(this.Tp=a,this.qa(),this.i("strokeJoin",b,a)))}); +D.defineProperty(z,{CM:"strokeMiterLimit"},function(){return this.vn},function(a){var b=this.vn;if(b!==a)if(v&&D.p(a,z,"strokeMiterLimit"),1<=a){this.vn=a;this.qa();var c=this.Y;null!==c&&(c.tk=NaN);this.i("strokeMiterLimit",b,a)}else D.ua(a,"value >= 1",z,"strokeWidth:value")}); +D.defineProperty(z,{ZG:"strokeDashArray"},function(){return this.Sp},function(a){var b=this.Sp;if(b!==a){null===a||Array.isArray(a)||D.hc(a,"Array",z,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1a?a=0:1a?a=0:1n*l*l&&(h=!0);b.od!==a&&(h=!1);!1===b.Hj("textGreeking")&&(h=!1);n=this.ti;l=this.ui;switch(this.ju){case yo:a.translate(c, +0);a.scale(-1,1);break;case xo:a.translate(0,d);a.scale(1,-1);break;case zo:a.translate(c,d),a.scale(-1,-1)}var m=this.ue,p=(n+e+l)*m;d>p&&(k=this.Vl,k=k.y*d-k.y*p+k.offsetY);for(var p=this.hi,q=0;qc&&(r=c);var k=k+n,u=s,s=a,t=k,y=c,w=e,C=g,A=0;h?("left"===C?A=0:"right"===C?A=y-r:"center"===C&&(A=(y-r)/2),s.fillRect(0+A,t+.25*w,r,1)):("left"===C?A=0:"right"===C?A=y:"center"===C&&(A=y/2),s.fillText(u,0+A,t+w-.25*w),u=w/20|0,0===u&&(u=1),"right"===C?A-=r:"center"=== +C&&(A-=r/2),this.qk&&(s.beginPath(),s.lineWidth=u,s.moveTo(0+A,t+w-.2*w),s.lineTo(0+A+r,t+w-.2*w),s.stroke()),this.pk&&(s.beginPath(),s.lineWidth=u,t=t+w-w/2.2|0,0!==u%2&&(t+=.5),s.moveTo(0+A,t),s.lineTo(0+A+r,t),s.stroke()));k+=e+l}switch(this.ju){case yo:a.scale(-1,1);a.translate(-c,0);break;case xo:a.scale(1,-1);a.translate(0,-d);break;case zo:a.scale(-1,-1),a.translate(-c,-d)}}}; +na.prototype.computeAngle=function(a,b){var c=0;switch(a){default:case uj:c=0;break;case uq:c=b;break;case Vp:c=b+90;break;case Xp:c=b-90;break;case Nq:c=b+180;break;case Oq:c=Ue(b);90c&&(c-=180);break;case Wp:c=Ue(b+90);90c&&(c-=180);break;case Yp:c=Ue(b-90);90c&&(c-=180);break;case Zp:c=Ue(b);if(45c||225c)return 0;90c&&(c-=180)}return Ue(c)}; +na.prototype.jo=function(a,b,c,d){this.wp=a;var e=this.hi;e.reset();var g=0,h=0;if(isNaN(this.Ea.width)){g=this.Sd.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.Wx){for(var k=h=0,l=!1;!l;){var m=g.indexOf("\n",k);-1===m&&(m=g.length,l=!0);k=Pq(g.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.zg);k>h&&(h=k);k=m+1}g=h}else h=g.indexOf("\n",0),0<=h&&(g=g.substr(0,h)),g=k=Pq(g,this.zg);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.Ea.width;null!==this.Q&&(g=Math.min(g, +this.Q.kf.width),g=Math.max(g,this.Q.ig.width));h=Lq(this,g,e);m=h=isNaN(this.Ea.height)?Math.min(h,b/this.scale):this.Ea.height;if(0!==e.nf&&1!==e.Xe.length&&this.nj===Iq&&(b=this.zg,l=this.nj===Iq?Qq(b):0,k=this.ti+this.ui,k=Math.max(0,Mq(this)+k),m=Math.min(this.CJ-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Xe.length))){k=e.Xe[m];for(a=Math.max(1,a-l);Pq(k,b)>a&&1=a.vh)return new Ca(0,l);if(a.Ik===Gq){c.xj=1;g=Pq(b,k);if(0===h||g<=d)return c.nf=g,c.yf.push(c.nf),c.Xe.push(b),new Ca(g,l);var m=Rq(b);b=b.substr(m.length);for(var n=Rq(b),g=Pq(m+n,k);0d&&1d;){n=1;g=Pq(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=Pq(m.substr(0,n),k);1===n?(c.yf[a.ue+p]=g,e=Math.max(e,g)):(c.yf[a.ue+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Xe[a.ue+p]=m.substr(0,n);p++;m=m.substr(n);if(a.ue+p>a.vh)break}n=Rq(b);for(g=Pq(m+n,k);0a.vh))break}c.xj=Math.min(a.vh,p);c.nf=Math.max(c.nf,e);return new Ca(c.nf,l*c.xj)}function Rq(a){for(var b=a.length,c=0;c=b?a:a.substr(0,c)} +function Pq(a,b){Eq!==b&&(Eq=Fq.font=b);return Fq.measureText(a).width}function Mq(a){if(null!==a.Om)return a.Om;var b=a.zg;Eq!==b&&(Eq=Fq.font=b);var c=0;void 0!==zq[b]&&5E3>Aq?c=zq[b]:(c=1.3*Fq.measureText("M").width,zq[b]=c,Aq++);return a.Om=c}function Qq(a){Eq!==a&&(Eq=Fq.font=a);var b=0;void 0!==Bq[a]&&5E3>Cq?b=Bq[a]:(b=Fq.measureText(Dq).width,Bq[a]=b,Cq++);return b} +function Lq(a,b,c){var d=a.Sd.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.ti+a.ui,e=Math.max(0,Mq(a)+e);if(0===d.length)return c.nf=0,a.ue=1,e;if(!a.Wx){var g=d.indexOf("\n",0);0<=g&&(d=d.substr(0,g))}for(var g=0,h=a.ue=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.Ik!==Gq?(c.xj=0,h=Kq(a,h,c,b),g+=h.height,a.ue+=c.xj):(Kq(a,h,c,b),g+=e,a.ue++),a.ue===a.vh&&(l=!0)),h=k+1;return a.pw=g} +D.defineProperty(na,{RB:"textValidation"},function(){return this.Sl},function(a){var b=this.Sl;b!==a&&(null!==a&&D.h(a,"function",na,"textValidation"),this.Sl=a,this.i("textValidation",b,a))});D.defineProperty(na,{aH:"textEdited"},function(){return this.Et},function(a){var b=this.Et;b!==a&&(null!==a&&D.h(a,"function",na,"textEdited"),this.Et=a,this.i("textEdited",b,a))}); +D.defineProperty(na,{wM:"spacingAbove"},function(){return this.ti},function(a){var b=this.ti;b!==a&&(v&&D.h(a,"number",na,"spacingAbove"),this.ti=a,this.i("spacingAbove",b,a))});D.defineProperty(na,{xM:"spacingBelow"},function(){return this.ui},function(a){var b=this.ui;b!==a&&(v&&D.h(a,"number",na,"spacingBelow"),this.ui=a,this.i("spacingBelow",b,a))}); +D.defineProperty(na,{CJ:"maxLines"},function(){return this.vh},function(a){var b=this.vh;b!==a&&(v&&D.h(a,"number",na,"maxLines"),a=Math.floor(a),0>=a&&D.ua(a,"> 0",na,"maxLines"),this.vh=a,this.i("maxLines",b,a),this.K())});D.w(na,{XL:"metrics"},function(){return this.hi});D.defineProperty(na,{fL:"choices"},function(){return this.nr},function(a){var b=this.nr;b!==a&&(null===a||Array.isArray(a)||D.hc(a,"Array",na,"choices:value"),this.nr=a,this.i("choices",b,a))}); +function $p(){this.nf=this.xj=0;this.yf=[];this.Xe=[]}$p.prototype.reset=function(){this.nf=this.xj=0;this.yf=[];this.Xe=[]};$p.prototype.fq=function(a){this.xj=a.xj;this.nf=a.nf;this.yf=D.dm(a.yf);this.Xe=D.dm(a.Xe)};D.w($p,{cL:"arrSize"},function(){return this.yf});D.w($p,{dL:"arrText"},function(){return this.Xe});D.w($p,{WL:"maxLineWidth"},function(){return this.nf}); +function Fl(){P.call(this);this.Ze=null;this.xt="";this.Ak=ke;this.jp=pf;this.xi=this.$e=null;this.ip=hc;this.yg=Xj;this.Up=null;this.Hz=!1;this.dp=!0;this.nw=!1;this.Mp=null}D.Sa(Fl,P);D.ja("Picture",Fl);Fl.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.element=this.Ze;a.xt=this.xt;a.Ak=this.Ak.V();a.jp=this.jp;a.yg=this.yg;a.$e=this.$e;a.xi=this.xi;a.ip=this.ip.V();a.dp=this.dp;a.Mp=this.Mp}; +Fl.prototype.oc=function(a){a===Xj||a===Zj||a===ak?this.aJ=a:P.prototype.oc.call(this,a)};Fl.prototype.toString=function(){return"Picture("+this.source+")#"+D.Gd(this)};var Sq=new la,Tq=0,zl=[];function Uq(){var a=zl;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d=d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(g=g+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case pf:n=d.width;p=d.height;break;case Zj:case ak:var s=0;q===Zj?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===ak&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(g=(g+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height), +n=d.width,p=d.height)}var q=this.Gj()*b.scale,u=k*h/(n*q*p*q),s=Sq[this.source],q=null;if(void 0!==s&&16s.aq.length&&(Zq(s,4,l,m),Zq(s,16,l,m));for(var l=s.aq,m=l.length,q=l[0],t=0;te;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.2,.22);b.D=new R(.8, +.9);D.u(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=cr(6);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.07,.25);b.D=new R(.93,.75);D.u(a);return b},Heptagon:function(a,b,c){var d=cr(7);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.2,.15);b.D=new R(.8,.85);D.u(a);return b},Octagon:function(a,b,c){var d=cr(8);a=D.v();T(a,d[0].x*b,d[0].y*c,!0); +for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.85);D.u(a);return b},Nonagon:function(a,b,c){var d=cr(9);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.17,.13);b.D=new R(.82,.82);D.u(a);return b},Decagon:function(a,b,c){var d=cr(10);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b}, +Dodecagon:function(a,b,c){var d=cr(12);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b},FivePointedStar:function(a,b,c){var d=br(5);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.312,.383);b.D=new R(.693,.765);D.u(a);return b},SixPointedStar:function(a,b,c){var d=br(6);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x* +b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.17,.251);b.D=new R(.833,.755);D.u(a);return b},SevenPointedStar:function(a,b,c){var d=br(7);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.363,.361);b.D=new R(.641,.709);D.u(a);return b},EightPointedStar:function(a,b,c){var d=br(8);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.252,.255);b.D=new R(.75,.75);D.u(a);return b},NinePointedStar:function(a, +b,c){var d=br(9);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.355,.361);b.D=new R(.645,.651);D.u(a);return b},TenPointedStar:function(a,b,c){var d=br(10);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.Ba(d);X(a);b=a.q;b.C=new R(.281,.261);b.D=new R(.723,.748);D.u(a);return b},FivePointedBurst:function(a,b,c){var d=ar(5);a=D.v();T(a,d[0].x*b,d[0].y*c,!0);for(var e=1;ea&&(a=.15);var d=D.v(),e=.2*Fd;T(d,0,.2*c,!0);V(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);V(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);V(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);V(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c); -T(d,0,a*c,!1);d.lineTo(1*b,a*c);d.ib(!1);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},DividedProcess:function(a,b,c){a=a?a.Oc:NaN;if(isNaN(a)||.1>a)a=.1;var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);T(d,0,a*c,!1);d.lineTo(1*b,a*c);d.ib(!1);b=d.q;b.C=new R(0,a);b.D=rc;D.u(d);return b},Document:function(a,b,c){c/=.8;a=D.v();T(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);V(a,.5*b,.4*c,.5*b,1*c,0,.7*c);X(a);b=a.q;b.C=cc;b.D=new R(1,.6);D.u(a); -return b},ExternalOrganization:function(a,b,c){a=a?a.Oc:NaN;if(isNaN(a)||.2>a)a=.2;var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);T(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.ib(!1);b=d.q;b.C=new R(a/2,a/2);b.D=new R(1-a/2,1-a/2);D.u(d);return b},ExternalProcess:function(a,b,c){a=D.v();T(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);X(a); -T(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.ib(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.75);D.u(a);return b},File:function(a,b,c){a=D.v();T(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);X(a);T(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.ib(!1);b=a.q;b.C=new R(0,.25);b.D=rc;D.u(a);return b},Interrupt:function(a,b,c){a=D.v();T(a,1*b, -.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);T(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);T(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},InternalStorage:function(a,b,c){var d=a?a.Oc:NaN;a=a?a.Qu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=D.v();T(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);X(e);T(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.ib(!1);b=e.q;b.C=new R(d,a);b.D=rc;D.u(e);return b},Junction:function(a,b, -c){a=D.v();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=.5*Fd;T(a,1*b,.5*c,!0);V(a,1*b,(.5+g)*c,(.5+g)*b,1*c,.5*b,1*c);V(a,(.5-g)*b,1*c,0,(.5+g)*c,0,.5*c);V(a,0,(.5-g)*c,(.5-g)*b,0,.5*b,0);V(a,(.5+g)*b,0,1*b,(.5-g)*c,1*b,.5*c);T(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.ib(!1);b=a.q;b.je=Uj;D.u(a);return b},LinedDocument:function(a,b,c){c/=.8;a=D.v();T(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);V(a,.5*b,.4*c,.5*b,1*c,0,.7*c);X(a);T(a,.1* -b,0,!1);a.lineTo(.1*b,.75*c);a.ib(!1);b=a.q;b.C=new R(.1,0);b.D=new R(1,.6);D.u(a);return b},LoopLimit:function(a,b,c){a=D.v();T(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);X(a);b=a.q;b.C=new R(0,.25);b.D=rc;D.u(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=D.v();var d=.5*Fd;T(a,.5*b,1*c,!0);V(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);V(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);V(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);V(a,1*b,(.5+ -d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.8);D.u(a);return b},ManualInput:function(a,b,c){a=D.v();T(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);X(a);b=a.q;b.C=new R(0,.25);b.D=rc;D.u(a);return b},MessageFromUser:function(a,b,c){a=a?a.Oc:NaN;isNaN(a)&&(a=.7);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);b=d.q;b.C=cc;b.D=new R(a,1);D.u(d);return b}, -MicroformProcessing:function(a,b,c){a=a?a.Oc:NaN;isNaN(a)&&(a=.25);var d=D.v();T(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);X(d);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},MicroformRecording:function(a,b,c){a=D.v();T(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);X(a);b=a.q;b.C=new R(0,.25);b.D=new R(1,.75);D.u(a);return b},MultiDocument:function(a,b,c){c/=.8;a=D.v(); +b,c){a=D.v();T(a,.25*b,0,!0);a.lineTo(.75*b,0);V(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);X(a);b=a.q;b.C=new R(.25,0);b.D=new R(.75,1);D.u(a);return b},DividedEvent:function(a,b,c){a=a?a.Pc:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=D.v(),e=.2*Fd;T(d,0,.2*c,!0);V(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);V(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);V(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);V(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c); +T(d,0,a*c,!1);d.lineTo(1*b,a*c);d.ib(!1);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},DividedProcess:function(a,b,c){a=a?a.Pc:NaN;if(isNaN(a)||.1>a)a=.1;var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);T(d,0,a*c,!1);d.lineTo(1*b,a*c);d.ib(!1);b=d.q;b.C=new R(0,a);b.D=uc;D.u(d);return b},Document:function(a,b,c){c/=.8;a=D.v();T(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);V(a,.5*b,.4*c,.5*b,1*c,0,.7*c);X(a);b=a.q;b.C=dc;b.D=new R(1,.6);D.u(a); +return b},ExternalOrganization:function(a,b,c){a=a?a.Pc:NaN;if(isNaN(a)||.2>a)a=.2;var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);T(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.ib(!1);b=d.q;b.C=new R(a/2,a/2);b.D=new R(1-a/2,1-a/2);D.u(d);return b},ExternalProcess:function(a,b,c){a=D.v();T(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);X(a); +T(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.ib(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.75);D.u(a);return b},File:function(a,b,c){a=D.v();T(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);X(a);T(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.ib(!1);b=a.q;b.C=new R(0,.25);b.D=uc;D.u(a);return b},Interrupt:function(a,b,c){a=D.v();T(a,1*b, +.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);T(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);T(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},InternalStorage:function(a,b,c){var d=a?a.Pc:NaN;a=a?a.Pu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=D.v();T(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);X(e);T(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.ib(!1);b=e.q;b.C=new R(d,a);b.D=uc;D.u(e);return b},Junction:function(a,b, +c){a=D.v();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=.5*Fd;T(a,1*b,.5*c,!0);V(a,1*b,(.5+g)*c,(.5+g)*b,1*c,.5*b,1*c);V(a,(.5-g)*b,1*c,0,(.5+g)*c,0,.5*c);V(a,0,(.5-g)*c,(.5-g)*b,0,.5*b,0);V(a,(.5+g)*b,0,1*b,(.5-g)*c,1*b,.5*c);T(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.ib(!1);b=a.q;b.je=Zj;D.u(a);return b},LinedDocument:function(a,b,c){c/=.8;a=D.v();T(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);V(a,.5*b,.4*c,.5*b,1*c,0,.7*c);X(a);T(a,.1* +b,0,!1);a.lineTo(.1*b,.75*c);a.ib(!1);b=a.q;b.C=new R(.1,0);b.D=new R(1,.6);D.u(a);return b},LoopLimit:function(a,b,c){a=D.v();T(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);X(a);b=a.q;b.C=new R(0,.25);b.D=uc;D.u(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=D.v();var d=.5*Fd;T(a,.5*b,1*c,!0);V(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);V(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);V(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);V(a,1*b,(.5+ +d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.8);D.u(a);return b},ManualInput:function(a,b,c){a=D.v();T(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);X(a);b=a.q;b.C=new R(0,.25);b.D=uc;D.u(a);return b},MessageFromUser:function(a,b,c){a=a?a.Pc:NaN;isNaN(a)&&(a=.7);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);b=d.q;b.C=dc;b.D=new R(a,1);D.u(d);return b}, +MicroformProcessing:function(a,b,c){a=a?a.Pc:NaN;isNaN(a)&&(a=.25);var d=D.v();T(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);X(d);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},MicroformRecording:function(a,b,c){a=D.v();T(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);X(a);b=a.q;b.C=new R(0,.25);b.D=new R(1,.75);D.u(a);return b},MultiDocument:function(a,b,c){c/=.8;a=D.v(); T(a,b,0,!0);a.lineTo(b,.5*c);V(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);V(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);V(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);X(a);T(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.ib(!1);b=a.q;b.C=new R(0,.25);b.D=new R(.8,.77);D.u(a);return b},MultiProcess:function(a,b,c){a=D.v(); -T(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);X(a);T(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.9*c);a.ib(!1);b=a.q;b.C=new R(0,.2);b.D=new R(.8,1);D.u(a);return b},OfflineStorage:function(a,b,c){a=a?a.Oc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=D.v();T(e,0,0,!0);e.lineTo(1* -b,0);e.lineTo(.5*b,1*c);X(e);T(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.ib(!1);b=e.q;b.C=new R(d/4+.5*a,a);b.D=new R(3*d/4+.5*a,a+.5*d);D.u(e);return b},OffPageConnector:function(a,b,c){a=D.v();T(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);X(a);b=a.q;b.C=cc;b.D=new R(.75,1);D.u(a);return b},Or:function(a,b,c){a=D.v();var d=.5*Fd;T(a,1*b,.5*c,!0);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);V(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);V(a, -(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.ib(!1);b=a.q;b.je=Uj;D.u(a);return b},PaperTape:function(a,b,c){c/=.8;a=D.v();T(a,0,.7*c,!0);a.lineTo(0,.3*c);V(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);V(a,.5*b,.4*c,.5*b,1*c,0,.7*c);X(a);b=a.q;b.C=new R(0,.49);b.D=new R(1,.75);D.u(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Oc:NaN;a=a?a.Qu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();T(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1- -a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);X(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Oc:NaN;a=a?a.Qu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();T(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);X(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Oc:NaN;isNaN(a)&&(a=.1);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0, -1*c);X(d);T(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.ib(!1);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);D.u(d);return b},Process:function(a,b,c){a=a?a.Oc:NaN;isNaN(a)&&(a=.1);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);T(d,a*b,0,!1);d.lineTo(a*b,1*c);d.ib(!1);b=d.q;b.C=new R(a,0);b.D=rc;D.u(d);return b},Sort:function(a,b,c){a=D.v();T(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);X(a);T(a,0,.5*c,!1);a.lineTo(1*b,.5* +T(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);X(a);T(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.9*c);a.ib(!1);b=a.q;b.C=new R(0,.2);b.D=new R(.8,1);D.u(a);return b},OfflineStorage:function(a,b,c){a=a?a.Pc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=D.v();T(e,0,0,!0);e.lineTo(1* +b,0);e.lineTo(.5*b,1*c);X(e);T(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.ib(!1);b=e.q;b.C=new R(d/4+.5*a,a);b.D=new R(3*d/4+.5*a,a+.5*d);D.u(e);return b},OffPageConnector:function(a,b,c){a=D.v();T(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);X(a);b=a.q;b.C=dc;b.D=new R(.75,1);D.u(a);return b},Or:function(a,b,c){a=D.v();var d=.5*Fd;T(a,1*b,.5*c,!0);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);V(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);V(a, +(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.ib(!1);b=a.q;b.je=Zj;D.u(a);return b},PaperTape:function(a,b,c){c/=.8;a=D.v();T(a,0,.7*c,!0);a.lineTo(0,.3*c);V(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);V(a,.5*b,.4*c,.5*b,1*c,0,.7*c);X(a);b=a.q;b.C=new R(0,.49);b.D=new R(1,.75);D.u(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Pc:NaN;a=a?a.Pu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();T(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1- +a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);X(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Pc:NaN;a=a?a.Pu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();T(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);X(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Pc:NaN;isNaN(a)&&(a=.1);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0, +1*c);X(d);T(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.ib(!1);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);D.u(d);return b},Process:function(a,b,c){a=a?a.Pc:NaN;isNaN(a)&&(a=.1);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);X(d);T(d,a*b,0,!1);d.lineTo(a*b,1*c);d.ib(!1);b=d.q;b.C=new R(a,0);b.D=uc;D.u(d);return b},Sort:function(a,b,c){a=D.v();T(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);X(a);T(a,0,.5*c,!1);a.lineTo(1*b,.5* c);a.ib(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.5);D.u(a);return b},Start:function(a,b,c){a=D.v();T(a,.25*b,0,!0);T(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);T(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.ib(!1);b=a.q;b.C=new R(.25,0);b.D=new R(.75,1);D.u(a);return b},Terminator:function(a,b,c){a=D.v();T(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.q;b.C=new R(.23,0); -b.D=new R(.77,1);D.u(a);return b},TransmittalTape:function(a,b,c){a=a?a.Oc:NaN;isNaN(a)&&(a=.1);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);X(d);b=d.q;b.C=cc;b.D=new R(1,1-a);D.u(d);return b},AndGate:function(a,b,c){a=D.v();var d=.5*Fd;T(a,0,0,!0);a.lineTo(.5*b,0);V(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);X(a);b=a.q;b.C=cc;b.D=new R(.55,1);D.u(a);return b},Buffer:function(a,b,c){a=D.v();T(a, +b.D=new R(.77,1);D.u(a);return b},TransmittalTape:function(a,b,c){a=a?a.Pc:NaN;isNaN(a)&&(a=.1);var d=D.v();T(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);X(d);b=d.q;b.C=dc;b.D=new R(1,1-a);D.u(d);return b},AndGate:function(a,b,c){a=D.v();var d=.5*Fd;T(a,0,0,!0);a.lineTo(.5*b,0);V(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);X(a);b=a.q;b.C=dc;b.D=new R(.55,1);D.u(a);return b},Buffer:function(a,b,c){a=D.v();T(a, 0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);X(a);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},Clock:function(a,b,c){a=D.v();var d=.5*Fd;T(a,1*b,.5*c,!0);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);V(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);V(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);T(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2* -b,.75*c);a.ib(!1);b=a.q;b.je=Uj;D.u(a);return b},Ground:function(a,b,c){a=D.v();T(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.q;D.u(a);return b},Inverter:function(a,b,c){a=D.v();var d=.1*Fd;T(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);T(a,1*b,.5*c,!0);V(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);V(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);V(a,.8*b,(.5-d)*c,(.9-d)*b,.4* +b,.75*c);a.ib(!1);b=a.q;b.je=Zj;D.u(a);return b},Ground:function(a,b,c){a=D.v();T(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.q;D.u(a);return b},Inverter:function(a,b,c){a=D.v();var d=.1*Fd;T(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);T(a,1*b,.5*c,!0);V(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);V(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);V(a,.8*b,(.5-d)*c,(.9-d)*b,.4* c,.9*b,.4*c);V(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new R(0,.25);b.D=new R(.4,.75);D.u(a);return b},NandGate:function(a,b,c){a=D.v();var d=.5*Fd,e=.4*Fd,g=.1*Fd;T(a,.8*b,.5*c,!0);V(a,.8*b,(.5+e)*c,(.4+d)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);V(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);T(a,1*b,.5*c,!0);V(a,1*b,(.5+g)*c,(.9+g)*b,.6*c,.9*b,.6*c);V(a,(.9-g)*b,.6*c,.8*b,(.5+g)*c,.8*b,.5*c);V(a,.8*b,(.5-g)*c,(.9-g)*b,.4*c,.9*b,.4*c);V(a,(.9+g)*b,.4*c,1*b,(.5-g)*c,1*b,.5* c);b=a.q;b.C=new R(0,.05);b.D=new R(.55,.95);D.u(a);return b},NorGate:function(a,b,c){a=D.v();var d=.5,e=Fd*d,g=0,h=.5;T(a,.8*b,.5*c,!0);V(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,0,1*c);V(a,.25*b,.75*c,.25*b,.25*c,0,0);V(a,(g+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Fd;g=.9;h=.5;T(a,(g-d)*b,h*c,!0);V(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);V(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);V(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);V(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C= new R(.2,.25);b.D=new R(.6,.75);D.u(a);return b},OrGate:function(a,b,c){a=D.v();var d=.5*Fd;T(a,0,0,!0);V(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);V(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);V(a,.25*b,.75*c,.25*b,.25*c,0,0);X(a);b=a.q;b.C=new R(.2,.25);b.D=new R(.75,.75);D.u(a);return b},XnorGate:function(a,b,c){a=D.v();var d=.5,e=Fd*d,g=.2,h=.5;T(a,.1*b,0,!1);V(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);T(a,.8*b,.5*c,!0);V(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,.2*b,1*c);V(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);V(a,(g+e)* b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Fd;g=.9;h=.5;T(a,(g-d)*b,h*c,!0);V(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);V(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);V(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);V(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C=new R(.4,.25);b.D=new R(.65,.75);D.u(a);return b},XorGate:function(a,b,c){a=D.v();var d=.5*Fd;T(a,.1*b,0,!1);V(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);T(a,.2*b,0,!0);V(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);V(a,.9*b,(.5+d)* c,(.2+d)*b,1*c,.2*b,1*c);V(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);X(a);b=a.q;b.C=new R(.4,.25);b.D=new R(.8,.75);D.u(a);return b},Capacitor:function(a,b,c){a=D.v();T(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},Resistor:function(a,b,c){a=D.v();T(a,0,.5*c,!1);a.lineTo(.1*b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.q;D.u(a);return b},Inductor:function(a,b,c){a=D.v();var d=.1*Fd,e=.1;T(a,(e-.5* d)*b,c,!1);V(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;V(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);V(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;V(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);V(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;V(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);V(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;V(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.q;D.u(a);return b},ACvoltageSource:function(a,b,c){a=D.v();var d=.5*Fd;T(a,0*b,.5*c,!1);V(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);V(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);V(a,1*b,(.5+d)* -c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);V(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.q;b.je=Uj;D.u(a);return b},DCvoltageSource:function(a,b,c){a=D.v();T(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},Diode:function(a,b,c){a=D.v();T(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},Wifi:function(a,b,c){var d=b,e=c; +c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);V(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.q;b.je=Zj;D.u(a);return b},DCvoltageSource:function(a,b,c){a=D.v();T(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},Diode:function(a,b,c){a=D.v();T(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},Wifi:function(a,b,c){var d=b,e=c; b*=.38;c*=.6;a=D.v();var g=.8*Fd,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;T(a,k*b+d,(l+h)*c+e,!0);V(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);V(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);V(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);V(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);X(a);g=.4*Fd;h=.4;k=.2;l=.5;T(a,k*b+d,(l+h)*c+e,!0);V(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);V(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k* b+d,(l-h)*c+e);V(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);V(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);X(a);g=.2*Fd;h=.2;l=k=.5;T(a,(k-h)*b+d,l*c+e,!0);V(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);V(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);V(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);V(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);g=.4*Fd;h=.4;k=.8;l=.5;T(a,k*b+d,(l-h)*c+e,!0);V(a,(k+g)*b+d,(l- h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);V(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);V(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);V(a,(k+h-.5*g)*b+d,(l-g)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);X(a);g=.8*Fd;h=.8;k=1;l=.5;T(a,k*b+d,(l-h)*c+e,!0);V(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);V(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);V(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);V(a,(k+h-.5*g)*b+d,(l-g)*c+ e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);X(a);b=a.q;D.u(a);return b},Email:function(a,b,c){a=D.v();T(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);X(a);T(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.ib(!1);b=a.q;D.u(a);return b},Ethernet:function(a,b,c){a=D.v();T(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);X(a);T(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c); -a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);X(a);T(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);X(a);T(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.ib(!1);b=a.q;D.u(a);return b},Power:function(a,b,c){a=D.v();var d=.4*Fd,e=.4,g=D.P(),h=D.P(),k=D.P(),l=D.P();Ge(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);var m=D.Fb(h.x, -h.y);T(a,h.x*b,h.y*c,!0);V(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);V(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);V(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);Ge(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);V(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*Fd;e=.3;Ge(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);a.lineTo(h.x*b,h.y*c);V(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);V(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);V(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+ -e)*b,.5*c);Ge(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);V(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);X(a);T(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);X(a);D.A(g);D.A(h);D.A(k);D.A(l);D.A(m);b=a.q;b.C=new R(.25,.55);b.D=new R(.75,.8);D.u(a);return b},Fallout:function(a,b,c){a=D.v();var d=.5*Fd;T(a,0*b,.5*c,!0);V(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);V(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b, -.5*c);var e=d=0;T(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;X(a);T(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;X(a);T(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);X(a);b=a.q;b.je=Uj;D.u(a);return b},IrritationHazard:function(a,b,c){a=D.v();T(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8* +a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);X(a);T(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);X(a);T(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.ib(!1);b=a.q;D.u(a);return b},Power:function(a,b,c){a=D.v();var d=.4*Fd,e=.4,g=D.O(),h=D.O(),k=D.O(),l=D.O();Ce(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);var m=D.Fb(h.x, +h.y);T(a,h.x*b,h.y*c,!0);V(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);V(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);V(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);Ce(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);V(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*Fd;e=.3;Ce(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);a.lineTo(h.x*b,h.y*c);V(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);V(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);V(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+ +e)*b,.5*c);Ce(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);V(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);X(a);T(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);X(a);D.A(g);D.A(h);D.A(k);D.A(l);D.A(m);b=a.q;b.C=new R(.25,.55);b.D=new R(.75,.8);D.u(a);return b},Fallout:function(a,b,c){a=D.v();var d=.5*Fd;T(a,0*b,.5*c,!0);V(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);V(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b, +.5*c);var e=d=0;T(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;X(a);T(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;X(a);T(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);X(a);b=a.q;b.je=Zj;D.u(a);return b},IrritationHazard:function(a,b,c){a=D.v();T(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8* b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);X(a);b=a.q;b.C=new R(.3,.3);b.D=new R(.7,.7);D.u(a);return b},ElectricalHazard:function(a,b,c){a=D.v();T(a,.37*b,0*c,!0);a.lineTo(.5*b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65* b,.56*c);a.lineTo(0*b,.68*c);X(a);b=a.q;D.u(a);return b},FireHazard:function(a,b,c){a=D.v();T(a,.1*b,1*c,!0);V(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);V(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);V(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);V(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);V(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);V(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);X(a);b=a.q;b.C=new R(.05,.645);b.D=new R(.884,.908);D.u(a);return b},BpmnActivityLoop:function(a,b,c){a=D.v();var d=4*(Math.SQRT2-1)/3*.5;T(a,.65*b,1*c, !1);V(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);V(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);V(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);V(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.q;D.u(a);return b},BpmnActivityParallel:function(a,b,c){a=D.v();T(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},BpmnActivitySequential:function(a,b,c){a=D.v();T(a,0,0,!1);a.lineTo(1* @@ -1537,8 +1539,8 @@ b,c){a=D.v();T(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8* BpmnTaskUser:function(a,b,c){a=D.v();T(a,0,0,!1);T(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);V(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);V(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*b,.405*c);var d=.5-.285,e=Math.PI/4,g=4*(1-Math.cos(e))/(3*Math.sin(e)),e=g*d,g=g*d;V(a,(.5-(e+d)/2)*b,(d+(d+g)/2)*c,(.5-d)*b,(d+g)*c,(.5-d)*b,d*c);V(a,(.5-d)*b,(d-g)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c); V(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-g)*c,(.5+d)*b,d*c);V(a,(.5+d)*b,(d+g)*c,(.5+(e+d)/2)*b,(d+(d+g)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);T(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);T(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.q;D.u(a);return b},BpmnEventConditional:function(a,b,c){a=D.v();T(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);X(a);T(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8* b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.ib(!1);b=a.q;D.u(a);return b},BpmnEventError:function(a,b,c){a=D.v();T(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);X(a);b=a.q;D.u(a);return b},BpmnEventEscalation:function(a,b,c){a=D.v();T(a,0,0,!1);T(a,1*b,1*c,!1);T(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);X(a);b=a.q;D.u(a);return b},BpmnEventTimer:function(a,b,c){a= -D.v();var d=.5*Fd;T(a,1*b,.5*c,!0);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);V(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);V(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.ib(!1);b=a.q;b.je=Uj;D.u(a);return b}},br;for(br in mq)mq[br.toLowerCase()]=br; -var tq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", +D.v();var d=.5*Fd;T(a,1*b,.5*c,!0);V(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);V(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);V(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);V(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.ib(!1);b=a.q;b.je=Zj;D.u(a);return b}},dr;for(dr in oq)oq[dr.toLowerCase()]=dr; +var vq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4", BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", @@ -1547,185 +1549,185 @@ DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z", OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"}; -function qq(a){var b=re[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=re[c];if(void 0===b){var d=null,e;for(e in tq)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=yf(tq[d],!1),re[d]=a,c!==d&&(re[c]=d),d}}return"string"===typeof b?b:b instanceof bf?a:null} -function F(a){x.call(this,a);this.S=2408959;this.El=this.Ni="";this.et=this.bt=this.nt=this.ps=null;this.pt="";this.mh=this.cs=this.ot=this.rn=null;this.dt="";this.Gp=null;this.ct=me;this.ft="";this.Ip=null;this.Sd="";this.kw=this.rr=this.ql=null;this.hj=(new O(NaN,NaN)).freeze();this.us="";this.Hl=null;this.vs=cc;this.Ds=Xd;this.ws=Yd;this.Lr=null;this.qs=cr;this.tn=Wd;this.sn="gray";this.Lg=4;this.uD=-1;this.Ot=NaN;this.qH=new B;this.Jl=null;this.tk=NaN}D.Sa(F,x);D.ja("Part",F); -F.prototype.cloneProtected=function(a){x.prototype.cloneProtected.call(this,a);a.S=this.S&-4097|49152;a.Ni=this.Ni;a.El=this.El;a.ps=this.ps;a.nt=this.nt;a.bt=this.bt;a.et=this.et;a.pt=this.pt;a.ot=this.ot;a.cs=this.cs;a.mh=null;a.dt=this.dt;a.ct=this.ct.V();a.ft=this.ft;a.Sd=this.Sd;a.rr=this.rr;a.hj.assign(this.hj);a.us=this.us;a.vs=this.vs.V();a.Ds=this.Ds.V();a.ws=this.ws.V();a.Lr=this.Lr;a.qs=this.qs;a.tn=this.tn.V();a.sn=this.sn;a.Lg=this.Lg;a.Ot=this.Ot}; -F.prototype.Bi=function(a){x.prototype.Bi.call(this,a);a.rm();a.rn=null;a.Gp=null;a.Ip=null;a.Hl=null;a.Jl=null};F.prototype.toString=function(){var a=D.qf(Object.getPrototypeOf(this))+"#"+D.Fd(this);null!==this.data&&(a+="("+ja(this.data)+")");return a};F.LayoutNone=0;var Qm;F.LayoutAdded=Qm=1;var Zm;F.LayoutRemoved=Zm=2;F.LayoutShown=4;F.LayoutHidden=8;F.LayoutNodeSized=16;var Fn;F.LayoutGroupLayout=Fn=32;F.LayoutNodeReplaced=64;var cr;F.LayoutStandard=cr=Qm|Zm|28|Fn|64;F.LayoutAll=16777215; -F.prototype.po=function(a,b,c,d,e,g,h){var k=this.g;null!==k&&(a===mg&&"elements"===b?e instanceof x?Rm(e,function(a){Tm(k,a);Sm(k,a)}):e instanceof Cl&&rn(k,e):a===ng&&"elements"===b&&(e instanceof x?Rm(e,function(a){Xm(k,a);Wm(k,a)}):e instanceof Cl&&sn(k,e)),k.hd(a,b,c,d,e,g,h))};F.prototype.updateTargetBindings=F.prototype.Nb=function(a){x.prototype.Nb.call(this,a);if(null!==this.data){a=this.xa.o;for(var b=a.length,c=0;ch&&a.y>k&&a.righth&&b.y>k&&b.right=c.BJ)){this.S^=4096;var d=!1;if(null!==c){d=c.Eb;c.Eb=!0;var e=c.selection;e.Ya();a?e.add(this):e.remove(this);e.freeze()}this.i("isSelected",b,a);this.ne();a=this.fK;null!==a&&a(this);null!==c&&(c.Se(),c.Eb=d)}}}); -D.defineProperty(F,{Xg:"isHighlighted"},function(){return 0!==(this.S&524288)},function(a){var b=0!==(this.S&524288);if(b!==a){v&&D.h(a,"boolean",F,"isHighlighted");this.S^=524288;var c=this.g;null!==c&&(c=c.qm,c.Ya(),a?c.add(this):c.remove(this),c.freeze());this.i("isHighlighted",b,a);this.qa();a=this.WI;null!==a&&a(this)}}); -D.defineProperty(F,{Wk:"isShadowed"},function(){return 0!==(this.S&8192)},function(a){var b=0!==(this.S&8192);b!==a&&(v&&D.h(a,"boolean",F,"isShadowed"),this.S^=8192,this.i("isShadowed",b,a),this.qa())});function Jm(a){return 0!==(a.S&32768)}function fr(a,b){a.S=b?a.S|32768:a.S&-32769}function Mo(a,b){a.S=b?a.S|65536:a.S&-65537}function ol(a){return 0!==(a.S&131072)}F.prototype.Lf=function(a){this.S=a?this.S|131072:this.S&-131073};function or(a,b){a.S=b?a.S|1048576:a.S&-1048577} -D.defineProperty(F,{KF:"isAnimated"},function(){return 0!==(this.S&262144)},function(a){var b=0!==(this.S&262144);b!==a&&(v&&D.h(a,"boolean",F,"isAnimated"),this.S^=262144,this.i("isAnimated",b,a))});D.defineProperty(F,{WI:"highlightedChanged"},function(){return this.cs},function(a){var b=this.cs;b!==a&&(null!==a&&D.h(a,"function",F,"highlightedChanged"),this.cs=a,this.i("highlightedChanged",b,a))}); -D.defineProperty(F,{Cy:"selectionObjectName"},function(){return this.pt},function(a){var b=this.pt;b!==a&&(v&&D.h(a,"string",F,"selectionObjectName"),this.pt=a,this.rn=null,this.i("selectionObjectName",b,a))});D.defineProperty(F,{eK:"selectionAdornmentTemplate"},function(){return this.nt},function(a){var b=this.nt;b!==a&&(v&&D.l(a,da,F,"selectionAdornmentTemplate"),this instanceof J&&(a.type=kj),this.nt=a,this.i("selectionAdornmentTemplate",b,a))}); -D.w(F,{ro:"selectionObject"},function(){if(null===this.rn){var a=this.Cy;null!==a&&""!==a?(a=this.Ed(a),this.rn=null!==a?a:this):this instanceof J?(a=this.path,this.rn=null!==a?a:this):this.rn=this}return this.rn});D.defineProperty(F,{fK:"selectionChanged"},function(){return this.ot},function(a){var b=this.ot;b!==a&&(null!==a&&D.h(a,"function",F,"selectionChanged"),this.ot=a,this.i("selectionChanged",b,a))}); -D.defineProperty(F,{BG:"resizeAdornmentTemplate"},function(){return this.bt},function(a){var b=this.bt;b!==a&&(v&&D.l(a,da,F,"resizeAdornmentTemplate"),this.bt=a,this.i("resizeAdornmentTemplate",b,a))});D.defineProperty(F,{DG:"resizeObjectName"},function(){return this.dt},function(a){var b=this.dt;b!==a&&(v&&D.h(a,"string",F,"resizeObjectName"),this.dt=a,this.Gp=null,this.i("resizeObjectName",b,a))}); -D.w(F,{CG:"resizeObject"},function(){if(null===this.Gp){var a=this.DG;null!==a&&""!==a?(a=this.Ed(a),this.Gp=null!==a?a:this):this.Gp=this}return this.Gp});D.defineProperty(F,{XJ:"resizeCellSize"},function(){return this.ct},function(a){var b=this.ct;b.O(a)||(v&&D.l(a,Ca,F,"resizeCellSize"),this.ct=a=a.V(),this.i("resizeCellSize",b,a))}); -D.defineProperty(F,{ZJ:"rotateAdornmentTemplate"},function(){return this.et},function(a){var b=this.et;b!==a&&(v&&D.l(a,da,F,"rotateAdornmentTemplate"),this.et=a,this.i("rotateAdornmentTemplate",b,a))});D.defineProperty(F,{$J:"rotateObjectName"},function(){return this.ft},function(a){var b=this.ft;b!==a&&(v&&D.h(a,"string",F,"rotateObjectName"),this.ft=a,this.Ip=null,this.i("rotateObjectName",b,a))}); -D.w(F,{GG:"rotateObject"},function(){if(null===this.Ip){var a=this.$J;null!==a&&""!==a?(a=this.Ed(a),this.Ip=null!==a?a:this):this.Ip=this}return this.Ip});D.defineProperty(F,{text:"text"},function(){return this.Sd},function(a){var b=this.Sd;b!==a&&(v&&D.h(a,"string",F,"text"),this.Sd=a,this.i("text",b,a))}); -D.defineProperty(F,{Pa:"containingGroup"},function(){return this.ql},function(a){if(this.oe()){var b=this.ql;if(b!==a){v&&null!==a&&D.l(a,I,F,"containingGroup");null===a||this!==a&&!a.Ei(this)||(this===a&&D.k("Cannot make a Group a member of itself: "+this.toString()),D.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.N(Zm);var c=this.g;null!==b?pr(b,this):this instanceof I&&null!==c&&c.Rl.remove(this);this.ql=a;null!==a?qr(a,this):this instanceof -I&&null!==c&&c.Rl.add(this);this.N(Qm);if(null!==c){var d=this.data,e=c.ga;null!==d&&e instanceof Y&&e.DB(d,e.Cb(null!==a?a.data:null))}d=this.QE;null!==d&&(e=!0,null!==c&&(e=c.ab,c.ab=!0),d(this,b,a),null!==c&&(c.ab=e));if(this instanceof I)for(c=new L(F),Ih(c,this,!0,0,!0),c=c.j;c.next();)if(d=c.value,d instanceof G)for(d=d.Gd;d.next();)un(d.value);if(this instanceof G)for(d=this.Gd;d.next();)un(d.value);this.i("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&tl(b,-1,a))}}else D.k("cannot set the Part.containingGroup of a Link or Adornment")}); -f=F.prototype;f.rm=function(){var a=this.Pa;null!==a&&(a.K(),null!==a.Qb&&a.Qb.K(),a.fg())};f.qa=function(){var a=this.g;null!==a&&!Im(this)&&!Jm(this)&&this.isVisible()&&this.ac.F()&&a.qa(sl(this,this.ac))};f.K=function(){x.prototype.K.call(this);var a=this.g;null!==a&&(a.Cg.add(this),this instanceof G&&null!==this.zc&&Wo(this.zc),a.Se(!0))};f.ru=function(a){a||(a=this.ql,null!==a&&qr(a,this))};f.su=function(a){a||(a=this.ql,null!==a&&pr(a,this))}; -f.Mn=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.ga,null!==b&&b.yy(a))}};D.defineProperty(F,{QE:"containingGroupChanged"},function(){return this.rr},function(a){var b=this.rr;b!==a&&(null!==a&&D.h(a,"function",F,"containingGroupChanged"),this.rr=a,this.i("containingGroupChanged",b,a))});F.prototype.findSubGraphLevel=function(){return rr(this,this)};function rr(a,b){var c=b.Pa;return null!==c?1+rr(a,c):b instanceof G&&(c=b.zc,null!==c)?rr(a,c):0} -F.prototype.findTopLevelPart=function(){return sr(this,this)};function sr(a,b){var c=b.Pa;return null!==c?sr(a,c):b instanceof G&&(c=b.zc,null!==c)?sr(a,c):b}D.w(F,{zq:"isTopLevel"},function(){return null!==this.Pa||this instanceof G&&this.tf?!1:!0});F.prototype.isMemberOf=F.prototype.Ei=function(a){return a instanceof I?tr(this,this,a):!1};function tr(a,b,c){if(b===c||null===c)return!1;var d=b.Pa;return null===d||d!==c&&!tr(a,d,c)?b instanceof G&&(b=b.zc,null!==b)?tr(a,b,c):!1:!0} -F.prototype.findCommonContainingGroup=F.prototype.CI=function(a){if(null===a)return null;v&&D.l(a,F,F,"findCommonContainingGroup:other");if(this===a)return this.Pa;for(var b=this;null!==b;)b instanceof I&&or(b,!0),b=b.Pa;for(var c=null,b=a;null!==b;){if(0!==(b.S&1048576)){c=b;break}b=b.Pa}for(b=this;null!==b;)b instanceof I&&or(b,!1),b=b.Pa;return c}; -D.defineProperty(F,{qJ:"layoutConditions"},function(){return this.qs},function(a){var b=this.qs;b!==a&&(v&&D.h(a,"number",F,"layoutConditions"),this.qs=a,this.i("layoutConditions",b,a))});F.prototype.canLayout=function(){if(!this.$A||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Tc||this instanceof G&&this.tf?!1:!0}; -F.prototype.invalidateLayout=F.prototype.N=function(a){void 0===a&&(a=16777215);var b;this.$A&&0!==(a&this.qJ)?(b=this.layer,null!==b&&b.Tc||this instanceof G&&this.tf?b=!1:(b=this.g,b=null!==b&&b.ra.nb?!1:!0)):b=!1;if(b)if(b=this.ql,null!==b){var c=b.Vb;null!==c?c.N():b.N(a)}else a=this.g,null!==a&&(c=a.Vb,null!==c&&c.N())};function Vm(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Tc?!1:!0} -D.defineProperty(F,{cF:"dragComputation"},function(){return this.Lr},function(a){var b=this.Lr;b!==a&&(null!==a&&D.h(a,"function",F,"dragComputation"),this.Lr=a,this.i("dragComputation",b,a))});D.defineProperty(F,{iK:"shadowOffset"},function(){return this.tn},function(a){var b=this.tn;b.O(a)||(v&&D.l(a,O,F,"shadowOffset"),this.tn=a=a.V(),this.qa(),this.i("shadowOffset",b,a))}); -D.defineProperty(F,{shadowColor:"shadowColor"},function(){return this.sn},function(a){var b=this.sn;b!==a&&(v&&D.h(a,"string",F,"shadowColor"),this.sn=a,this.qa(),this.i("shadowColor",b,a))});D.defineProperty(F,{shadowBlur:"shadowBlur"},function(){return this.Lg},function(a){var b=this.Lg;b!==a&&(v&&D.h(a,"number",F,"shadowBlur"),this.Lg=a,this.qa(),this.i("shadowBlur",b,a))}); -function da(a){0===arguments.length?F.call(this,Xj):F.call(this,a);this.S&=-257;this.El="Adornment";this.Pc=null;this.FD=0;this.vE=!1;this.Qb=this.ph=null}D.Sa(da,F);D.ja("Adornment",da);da.prototype.toString=function(){var a=this.Zf;return"Adornment("+this.Dd+")"+(null!==a?a.toString():"")};da.prototype.updateRelationshipsFromData=function(){}; -da.prototype.Gu=function(a){var b=this.zb.Y,c=this.zb;if(b instanceof J&&c instanceof z){var d=b.path,c=d.Df;b.Gu(a);c=d.Df;a=this.xa.o;b=a.length;for(d=0;da&&(a=1);var b=this.g;if(null!==b&&!b.Oh){b.Oh=!0;var c=new L(G);c.add(this);Fr(this,c,b.$d,a,b.Xa,this,b.VB===zl);b.Oh=!1}}; -function Fr(a,b,c,d,e,g,h){if(1a&&(a=2);var b=this.g;if(null!==b&&!b.Oh){b.Oh=!0;var c=new L(G);c.add(this);Hr(this,c,b.$d,a,b.Xa,this,b.VB===zl);b.Oh=!1}};function Hr(a,b,c,d,e,g,h){for(var k=g===a?!1:a.rd,l=c?a.Hx():a.Vg();l.next();){var m=l.value;m.Uc&&(k||m.lh||m.fc(),m=m.PA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.Hd(!0),m.rm(),h&&kl(e,m,g)),2a&&(a-=180);break;case Up:a=Ye(c+90);90a&&(a-=180);break;case Wp:a=Ye(c-90);90a&&(a-=180);break;case Xp:a=Ye(c);if(45a||225a)return 0;90a&&(a-=180)}return Ye(a)}; -D.defineProperty(J,{aa:"fromNode"},function(){return this.yg},function(a){var b=this.yg;if(b!==a){v&&null!==a&&D.l(a,G,J,"fromNode");var c=this.dd;null!==b&&(this.Pg!==b&&Cr(b,this,c),Nr(this),this.N(Zm));this.yg=a;null!==a&&this.Hd(a.isVisible());this.Yi=null;this.fc();var d=this.g;if(null!==d){var e=this.data,g=d.ga;if(null!==e)if(g instanceof Y){var h=null!==a?a.data:null;g.BB(e,g.Cb(h))}else g instanceof wg&&(h=null!==a?a.data:null,d.$d?g.Hi(e,g.Cb(h)):(null!==b&&g.Hi(b.data,void 0),g.Hi(h,g.Cb(null!== -this.Pg?this.Pg.data:null))))}e=this.dd;g=this.tF;null!==g&&(h=!0,null!==d&&(h=d.ab,d.ab=!0),g(this,c,e),null!==d&&(d.ab=h));null!==a&&(this.Pg!==a&&Br(a,this,e),Or(this),this.N(Qm));this.i("fromNode",b,a);un(this)}}); -D.defineProperty(J,{cg:"fromPortId"},function(){return this.ci},function(a){var b=this.ci;if(b!==a){v&&D.h(a,"string",J,"fromPortId");var c=this.dd;null!==c&&Ar(this.aa,c);Nr(this);this.ci=a;var d=this.dd;null!==d&&Ar(this.aa,d);var e=this.g;if(null!==e){var g=this.data,h=e.ga;null!==g&&h instanceof Y&&h.CB(g,a)}c!==d&&(this.Yi=null,this.fc(),g=this.tF,null!==g&&(h=!0,null!==e&&(h=e.ab,e.ab=!0),g(this,c,d),null!==e&&(e.ab=h)));Or(this);this.i("fromPortId",b,a)}}); -D.w(J,{dd:"fromPort"},function(){var a=this.yg;return null===a?null:a.km(this.ci)});D.defineProperty(J,{tF:"fromPortChanged"},function(){return this.Vr},function(a){var b=this.Vr;b!==a&&(null!==a&&D.h(a,"function",J,"fromPortChanged"),this.Vr=a,this.i("fromPortChanged",b,a))}); -D.defineProperty(J,{da:"toNode"},function(){return this.Pg},function(a){var b=this.Pg;if(b!==a){v&&null!==a&&D.l(a,G,J,"toNode");var c=this.Ld;null!==b&&(this.yg!==b&&Cr(b,this,c),Nr(this),this.N(Zm));this.Pg=a;null!==a&&this.Hd(a.isVisible());this.Yi=null;this.fc();var d=this.g;if(null!==d){var e=this.data,g=d.ga;if(null!==e)if(g instanceof Y){var h=null!==a?a.data:null;g.HB(e,g.Cb(h))}else g instanceof wg&&(h=null!==a?a.data:null,d.$d?(null!==b&&g.Hi(b.data,void 0),g.Hi(h,g.Cb(null!==this.yg?this.yg.data: -null))):g.Hi(e,g.Cb(h)))}e=this.Ld;g=this.aH;null!==g&&(h=!0,null!==d&&(h=d.ab,d.ab=!0),g(this,c,e),null!==d&&(d.ab=h));null!==a&&(this.yg!==a&&Br(a,this,e),Or(this),this.N(Qm));this.i("toNode",b,a);un(this)}}); -D.defineProperty(J,{jh:"toPortId"},function(){return this.xi},function(a){var b=this.xi;if(b!==a){v&&D.h(a,"string",J,"toPortId");var c=this.Ld;null!==c&&Ar(this.da,c);Nr(this);this.xi=a;var d=this.Ld;null!==d&&Ar(this.da,d);var e=this.g;if(null!==e){var g=this.data,h=e.ga;null!==g&&h instanceof Y&&h.IB(g,a)}c!==d&&(this.Yi=null,this.fc(),g=this.aH,null!==g&&(h=!0,null!==e&&(h=e.ab,e.ab=!0),g(this,c,d),null!==e&&(e.ab=h)));Or(this);this.i("toPortId",b,a)}}); -D.w(J,{Ld:"toPort"},function(){var a=this.Pg;return null===a?null:a.km(this.xi)});D.defineProperty(J,{aH:"toPortChanged"},function(){return this.Jt},function(a){var b=this.Jt;b!==a&&(null!==a&&D.h(a,"function",J,"toPortChanged"),this.Jt=a,this.i("toPortChanged",b,a))});D.defineProperty(J,{Gb:"fromSpot"},function(){return null!==this.Z?this.Z.jk:Tc},function(a){this.Wd();var b=this.Z.jk;b.O(a)||(v&&D.l(a,R,J,"fromSpot"),a=a.V(),this.Z.jk=a,this.i("fromSpot",b,a),this.fc())}); -D.defineProperty(J,{nm:"fromEndSegmentLength"},function(){return null!==this.Z?this.Z.hk:NaN},function(a){this.Wd();var b=this.Z.hk;b!==a&&(v&&D.h(a,"number",J,"fromEndSegmentLength"),0>a&&D.ua(a,">= 0",J,"fromEndSegmentLength"),this.Z.hk=a,this.i("fromEndSegmentLength",b,a),this.fc())}); -D.defineProperty(J,{nu:"fromEndSegmentDirection"},function(){return null!==this.Z?this.Z.gk:vr},function(a){this.Wd();var b=this.Z.gk;b!==a&&(D.Nn("Link.fromEndSegmentDirection","2.0"),v&&D.Ca(a,G,J,"fromEndSegmentDirection"),this.Z.gk=a,this.i("fromEndSegmentDirection",b,a),this.fc())}); -D.defineProperty(J,{ou:"fromShortLength"},function(){return null!==this.Z?this.Z.ik:NaN},function(a){this.Wd();var b=this.Z.ik;b!==a&&(v&&D.h(a,"number",J,"fromShortLength"),this.Z.ik=a,this.i("fromShortLength",b,a),this.fc())});D.defineProperty(J,{Hb:"toSpot"},function(){return null!==this.Z?this.Z.Gk:Tc},function(a){this.Wd();var b=this.Z.Gk;b.O(a)||(v&&D.l(a,R,J,"toSpot"),a=a.V(),this.Z.Gk=a,this.i("toSpot",b,a),this.fc())}); -D.defineProperty(J,{Dm:"toEndSegmentLength"},function(){return null!==this.Z?this.Z.Ek:NaN},function(a){this.Wd();var b=this.Z.Ek;b!==a&&(v&&D.h(a,"number",J,"toEndSegmentLength"),0>a&&D.ua(a,">= 0",J,"toEndSegmentLength"),this.Z.Ek=a,this.i("toEndSegmentLength",b,a),this.fc())}); -D.defineProperty(J,{fv:"toEndSegmentDirection"},function(){return null!==this.Z?this.Z.Dk:vr},function(a){this.Wd();var b=this.Z.Dk;b!==a&&(D.Nn("Link.toEndSegmentDirection","2.0"),v&&D.Ca(a,G,J,"toEndSegmentDirection"),this.Z.Dk=a,this.i("toEndSegmentDirection",b,a),this.fc())});D.defineProperty(J,{gv:"toShortLength"},function(){return null!==this.Z?this.Z.Fk:NaN},function(a){this.Wd();var b=this.Z.Fk;b!==a&&(v&&D.h(a,"number",J,"toShortLength"),this.Z.Fk=a,this.i("toShortLength",b,a),this.fc())}); -function un(a){var b=a.aa,c=a.da;null!==b?null!==c?Pr(a,b.CI(c)):Pr(a,null):Pr(a,null)}function Pr(a,b){var c=a.ql;if(c!==b){null!==c&&pr(c,a);a.ql=b;null!==b&&qr(b,a);var d=a.QE;if(null!==d){var e=!0,g=a.g;null!==g&&(e=g.ab,g.ab=!0);d(a,c,b);null!==g&&(g.ab=e)}!a.lh||a.fE!==c&&a.gE!==c||a.fc()}}J.prototype.rm=function(){var a=this.Pa;null!==a&&this.aa!==a&&this.da!==a&&a.ux&&F.prototype.rm.call(this)}; -J.prototype.getOtherNode=J.prototype.PA=function(a){v&&D.l(a,G,J,"getOtherNode:node");var b=this.aa;return a===b?this.da:b};J.prototype.getOtherPort=function(a){v&&D.l(a,P,J,"getOtherPort:port");var b=this.dd;return a===b?this.Ld:b};D.w(J,{IL:"isLabeledLink"},function(){return null===this.zf?!1:0=d&&(h=d-1);var l=this.n(h-1),g=this.n(h);Ee(e.x,e.y,k.x,k.y,l.x,l.y,g.x,g.y,.5,a);b=Math.min(g.x,b);c=Math.min(g.y,c);e=g}else for(e=this.n(0),g=this.n(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.m(e.x,e.y,0,0),a.Ki(g),h=2;hc&&(c=-c)):yb(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Cf(d)),g.push(c),e+=c;for(d=h=c=0;ce/2)break;c+=d;h++}D.Aa(g);b=this.n(h);g=this.n(h+1);b.x===g.x?b.y>g.y?a.m(b.x,b.y-(e/2-c)):a.m(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.m(b.x-(e/2-c),b.y):a.m(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.m(b.x+c*(g.x-b.x),b.y+c*(g.y-b.y)));return a};D.w(J,{dG:"midAngle"},function(){this.yo();return this.computeMidAngle()}); -J.prototype.computeMidAngle=function(){var a=this.ta;if(2>a)return NaN;if(this.computeCurve()===Nj&&4<=a&&!this.qc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.n(c),d=this.n(c+1),a=this.n(c+2),c=this.n(c+3),e=d.x,d=d.y,g=a.x,a=a.y,h=(e+g)/2,k=(d+a)/2;return sb(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(g+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0e+10))?e>c+10?d.Jc(a):b.Jc(a):b.Jc(d);b=this.n(c-1);d=this.n(c);a=this.n(c+1);c=b.Cf(d);e=d.Cf(a);return c>e+10?b.Jc(d):e>c+10?d.Jc(a):b.Jc(a)}; -D.defineProperty(J,{points:"points"},function(){return this.ad},function(a){var b=this.ad;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;em&&(p=-p),u=(0>l?-1:1)*p+r,t=n*(u- -r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,y=r,w=s;Q(l,0)?w=0l?-1:1)*p+r,w=n*(y-r)+s);this.dq();this.zi(h);this.Wl(u,t);this.Wl(y,w);this.zi(q);this.eh(0,this.getLinkPoint(b,c,d,!0,!1,e,g));this.eh(3,this.getLinkPoint(e,g,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,g),a=this.getLinkPoint(e,g,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,g=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,Q(e,0)?k=0g&&(h=-h),h=(0>e?-1:1)*h+b, -k=q*(h-b)+c),this.zi(d),this.Wl(h,k)):this.zi(d),this.zi(a)}else{p=this.Di;q&&(n&&p||m)&&this.dq();var C=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,g),r=u=s=0;if(n||!k||m)if(t=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,g),m&&(k||d.O(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>C&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(t+=Math.abs(C)*(n?1:2)),0===r?s=t:90===r?u=t:180===r?s=-t:270===r?u=-t:(s=t*Math.cos(r*Math.PI/180),u=t*Math.sin(r*Math.PI/ -180)),d.Zd()&&m){var A=c.eb(gc,D.P()),N=D.Fb(A.x+1E3*s,A.y+1E3*u);this.getLinkPointFromPoint(b,c,A,N,!0,p);D.A(A);D.A(N)}var t=this.getLinkPoint(e,g,a,!1,n,b,c),H=w=y=0;if(n||!l||m)A=this.computeEndSegmentLength(e,g,a,!1),H=this.getLinkDirection(e,g,t,a,!1,n,b,c),m&&(l||d.O(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(H+=n?0:30,0>C&&(H+=180)),0>H?H+=360:360<=H&&(H-=360),m&&(A+=Math.abs(C)*(n?1:2)),0===H?y=A:90===H?w=A:180===H?y=-A:270===H?w=-A:(y=A*Math.cos(H*Math.PI/180),w=A*Math.sin(H*Math.PI/180)),a.Zd()&& -m&&(A=g.eb(gc,D.P()),N=D.Fb(A.x+1E3*y,A.y+1E3*w),this.getLinkPointFromPoint(e,g,A,N,!1,t),D.A(A),D.A(N));a=p;if(n||!k||m)a=new O(p.x+s,p.y+u);d=t;if(n||!l||m)d=new O(t.x+y,t.y+w);!q&&!n&&k&&3Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b} -J.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new O);if(null===a||null===b)return g.assign(c),g;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.Q;null===e||e.kh()||(e=e.Q);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.Hh;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Tn(e,h,k,l, -g);null!==a&&g.transform(a);return g};function Wr(a,b){var c=b.Xs;null===c&&(c=new Xr,c.port=b,c.Vc=b.Y,b.Xs=c);return Yr(c,a)} -J.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new O);if(c.fd())return b.eb(c,k),k;if(c.Kj()){var l=Wr(this,b);if(null!==l){k.assign(l.Bq);if(e&&this.Ay===Mr){var m=Wr(this,h);if(null!==m&&l.Kn=n.y&&a.y<=n.y+n.height?k.y=a.y:(c.Ij(sc)||c.Ij(yc))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);D.A(l);D.A(m)}}return k}}c=b.eb(gc,D.P());l=g=null;this.ta> -(e?6:2)?(l=d?this.n(1):this.n(this.ta-2),e&&(l=Vr(c,l.copy()))):(g=D.P(),l=h.eb(gc,g),e&&(l=Vr(c,l)),D.A(g));this.getLinkPointFromPoint(a,b,c,l,d,k);D.A(c);return k}; -J.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.fd())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(g?6:2)?(n=e?this.n(1):this.n(this.ta-2),n=g?Vr(l,n.copy()):c):(m=D.P(),n=k.eb(gc,m),D.A(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y- -l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;D.A(l)}d.Zd()&&h.Ei(a)&&(c+=180,360<=c&&(c-=360));a=vr;a=e?this.nu:this.fv;a===vr&&(a=e?b.nu:b.fv);switch(a){case wr:b=b.Rn();c+=b;360<=c&&(c-=360);break;case vr:case Co:b=b.Rn();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c}; -J.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.Kj()&&(a=Wr(this,b),null!==a))return a.Dx;a=NaN;a=d?this.nm:this.Dm;null!==b&&isNaN(a)&&(a=d?b.nm:b.Dm);isNaN(a)&&(a=10);return a};J.prototype.computeSpot=function(a){return a?Tr(this,this.dd):Ur(this,this.Ld)};function Tr(a,b){if(null===b)return gc;var c=a.Gb;c.ed()&&null!==b&&(c=b.Gb);return c===Tc?bc:c}function Ur(a,b){if(null===b)return gc;var c=a.Hb;c.ed()&&null!==b&&(c=b.Hb);return c===Tc?bc:c} -J.prototype.computeOtherPoint=function(a,b){var c=b.eb(gc),d;d=b.Xs;d=null!==d?Yr(d,this):null;null!==d&&(c=d.Bq);return c};J.prototype.computeShortLength=function(a){if(a){if(a=this.ou,isNaN(a)){var b=this.dd;null!==b&&(a=b.ou)}}else a=this.gv,isNaN(a)&&(b=this.Ld,null!==b&&(a=b.gv));return isNaN(a)?0:a}; -J.prototype.Qk=function(a,b,c,d,e,g){if(!1===this.pg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=D.Of(),h.reset());h.multiply(this.transform);if(this.Hn(a,h))return cq(this,b,c,e),void 0===g&&D.He(h),!0;if(this.Wg(a,h)){var k=!1;if(!this.Yn)for(var l=this.xa.o,m=l.length;m--;){var n=l[m];if(n.visible||n===this.uf){var p=n.$,q=this.Ga;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=D.Of();p.set(h);if(n instanceof x)k=n.Qk(a,b,c,d,e,p);else if(this.path=== -n){if(n instanceof z){var k=n,r=a,s=d,q=p;if(!1===k.pg)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,t=q;if(k.Hn(u,t))k=!0;else{if(void 0===t&&(t=k.transform,u.Nk(k.$))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,y=D.P(),w=D.P(),C=D.P(),A=D.Of();A.set(t);A.lB(k.transform);A.Qx();w.x=r;w.y=s;w.transform(A);y.x=q;y.y=s;y.transform(A);t=!1;pq(k,y,w,C)?t=!0:(y.x=r,y.y=u,y.transform(A),pq(k,y,w,C)?t=!0:(w.x=q,w.y=u,w.transform(A),pq(k,y,w,C)?t=!0:(y.x=q,y.y=s,y.transform(A),pq(k,y,w,C)&& -(t=!0))));D.He(A);D.A(y);D.A(w);D.A(C);k=t}}else k=k.Hn(r,q)}}else k=Io(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof L&&e.add(n),e instanceof K&&e.add(n)));D.He(p)}}}void 0===g&&D.He(h);return k||null!==this.background||null!==this.Zl}void 0===g&&D.He(h);return!1};D.w(J,{qc:"isOrthogonal"},function(){return 2===(this.mn.value&2)});D.w(J,{Di:"isAvoiding"},function(){return 4===(this.mn.value&4)}); -J.prototype.computeCurve=function(){if(null===this.Yi){var a=this.dd,b=this.qc;this.Yi=null!==a&&a===this.Ld&&!b}return this.Yi?Nj:this.gf};J.prototype.computeCorner=function(){if(this.gf===Nj)return 0;var a=this.yA;if(isNaN(a)||0>a)a=10;return a};J.prototype.findMidLabel=function(){for(var a=this.path,b=this.xa.o,c=b.length,d=0;dl?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;yb(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.eh(a,b);for(a+= -1;al?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ia(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.eh(c,d)}}return!0;case Lr:g=this.n(a);p=this.n(c);if(!g.Sc(b)||!p.Sc(d)){var e=g.x,g=g.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-g)*(p-g),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.eh(a,b);for(a+=1;ab?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.$.copy(),k=g.$.copy();if(h.F()&&k.F()){h.eg(8,8);k.eg(8,8);h.Ki(a);k.Ki(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l=new O(c.x,a.y),m=new O(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xh&&a.y>k&&a.righth&&b.y>k&&b.right=c.EJ)){this.S^=4096;var d=!1;if(null!==c){d=c.Eb;c.Eb=!0;var e=c.selection;e.Ya();a?e.add(this):e.remove(this);e.freeze()}this.i("isSelected",b,a);this.ne();a=this.iK;null!==a&&a(this);null!==c&&(c.Se(),c.Eb=d)}}}); +D.defineProperty(F,{Yg:"isHighlighted"},function(){return 0!==(this.S&524288)},function(a){var b=0!==(this.S&524288);if(b!==a){v&&D.h(a,"boolean",F,"isHighlighted");this.S^=524288;var c=this.g;null!==c&&(c=c.rm,c.Ya(),a?c.add(this):c.remove(this),c.freeze());this.i("isHighlighted",b,a);this.qa();a=this.ZI;null!==a&&a(this)}}); +D.defineProperty(F,{Xk:"isShadowed"},function(){return 0!==(this.S&8192)},function(a){var b=0!==(this.S&8192);b!==a&&(v&&D.h(a,"boolean",F,"isShadowed"),this.S^=8192,this.i("isShadowed",b,a),this.qa())});function Lm(a){return 0!==(a.S&32768)}function hr(a,b){a.S=b?a.S|32768:a.S&-32769}function No(a,b){a.S=b?a.S|65536:a.S&-65537}function rl(a){return 0!==(a.S&131072)}F.prototype.Mf=function(a){this.S=a?this.S|131072:this.S&-131073};function qr(a,b){a.S=b?a.S|1048576:a.S&-1048577} +D.defineProperty(F,{NF:"isAnimated"},function(){return 0!==(this.S&262144)},function(a){var b=0!==(this.S&262144);b!==a&&(v&&D.h(a,"boolean",F,"isAnimated"),this.S^=262144,this.i("isAnimated",b,a))});D.defineProperty(F,{ZI:"highlightedChanged"},function(){return this.bs},function(a){var b=this.bs;b!==a&&(null!==a&&D.h(a,"function",F,"highlightedChanged"),this.bs=a,this.i("highlightedChanged",b,a))}); +D.defineProperty(F,{By:"selectionObjectName"},function(){return this.pt},function(a){var b=this.pt;b!==a&&(v&&D.h(a,"string",F,"selectionObjectName"),this.pt=a,this.rn=null,this.i("selectionObjectName",b,a))});D.defineProperty(F,{hK:"selectionAdornmentTemplate"},function(){return this.nt},function(a){var b=this.nt;b!==a&&(v&&D.l(a,da,F,"selectionAdornmentTemplate"),this instanceof J&&(a.type=rj),this.nt=a,this.i("selectionAdornmentTemplate",b,a))}); +D.w(F,{to:"selectionObject"},function(){if(null===this.rn){var a=this.By;null!==a&&""!==a?(a=this.Fd(a),this.rn=null!==a?a:this):this instanceof J?(a=this.path,this.rn=null!==a?a:this):this.rn=this}return this.rn});D.defineProperty(F,{iK:"selectionChanged"},function(){return this.ot},function(a){var b=this.ot;b!==a&&(null!==a&&D.h(a,"function",F,"selectionChanged"),this.ot=a,this.i("selectionChanged",b,a))}); +D.defineProperty(F,{EG:"resizeAdornmentTemplate"},function(){return this.bt},function(a){var b=this.bt;b!==a&&(v&&D.l(a,da,F,"resizeAdornmentTemplate"),this.bt=a,this.i("resizeAdornmentTemplate",b,a))});D.defineProperty(F,{GG:"resizeObjectName"},function(){return this.dt},function(a){var b=this.dt;b!==a&&(v&&D.h(a,"string",F,"resizeObjectName"),this.dt=a,this.Ip=null,this.i("resizeObjectName",b,a))}); +D.w(F,{FG:"resizeObject"},function(){if(null===this.Ip){var a=this.GG;null!==a&&""!==a?(a=this.Fd(a),this.Ip=null!==a?a:this):this.Ip=this}return this.Ip});D.defineProperty(F,{$J:"resizeCellSize"},function(){return this.ct},function(a){var b=this.ct;b.P(a)||(v&&D.l(a,Ca,F,"resizeCellSize"),this.ct=a=a.V(),this.i("resizeCellSize",b,a))}); +D.defineProperty(F,{bK:"rotateAdornmentTemplate"},function(){return this.et},function(a){var b=this.et;b!==a&&(v&&D.l(a,da,F,"rotateAdornmentTemplate"),this.et=a,this.i("rotateAdornmentTemplate",b,a))});D.defineProperty(F,{cK:"rotateObjectName"},function(){return this.ft},function(a){var b=this.ft;b!==a&&(v&&D.h(a,"string",F,"rotateObjectName"),this.ft=a,this.Jp=null,this.i("rotateObjectName",b,a))}); +D.w(F,{JG:"rotateObject"},function(){if(null===this.Jp){var a=this.cK;null!==a&&""!==a?(a=this.Fd(a),this.Jp=null!==a?a:this):this.Jp=this}return this.Jp});D.defineProperty(F,{text:"text"},function(){return this.Sd},function(a){var b=this.Sd;b!==a&&(v&&D.h(a,"string",F,"text"),this.Sd=a,this.i("text",b,a))}); +D.defineProperty(F,{Pa:"containingGroup"},function(){return this.sl},function(a){if(this.oe()){var b=this.sl;if(b!==a){v&&null!==a&&D.l(a,I,F,"containingGroup");null===a||this!==a&&!a.Ei(this)||(this===a&&D.k("Cannot make a Group a member of itself: "+this.toString()),D.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.N(an);var c=this.g;null!==b?rr(b,this):this instanceof I&&null!==c&&c.Tl.remove(this);this.sl=a;null!==a?sr(a,this):this instanceof +I&&null!==c&&c.Tl.add(this);this.N(Sm);if(null!==c){var d=this.data,e=c.ga;null!==d&&e instanceof Y&&e.HB(d,e.Cb(null!==a?a.data:null))}d=this.TE;null!==d&&(e=!0,null!==c&&(e=c.ab,c.ab=!0),d(this,b,a),null!==c&&(c.ab=e));if(this instanceof I)for(c=new L(F),Mh(c,this,!0,0,!0),c=c.j;c.next();)if(d=c.value,d instanceof G)for(d=d.Hd;d.next();)wn(d.value);if(this instanceof G)for(d=this.Hd;d.next();)wn(d.value);this.i("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&wl(b,-1,a))}}else D.k("cannot set the Part.containingGroup of a Link or Adornment")}); +f=F.prototype;f.Vk=function(){var a=this.Pa;null!==a&&(a.K(),null!==a.Qb&&a.Qb.K(),a.gg())};f.qa=function(){var a=this.g;null!==a&&!Km(this)&&!Lm(this)&&this.isVisible()&&this.bc.F()&&a.qa(vl(this,this.bc))};f.K=function(){x.prototype.K.call(this);var a=this.g;null!==a&&(a.Eg.add(this),this instanceof G&&null!==this.Ac&&Xo(this.Ac),a.Se(!0))};f.qu=function(a){a||(a=this.sl,null!==a&&sr(a,this))};f.ru=function(a){a||(a=this.sl,null!==a&&rr(a,this))}; +f.On=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.ga,null!==b&&b.xy(a))}};D.defineProperty(F,{TE:"containingGroupChanged"},function(){return this.qr},function(a){var b=this.qr;b!==a&&(null!==a&&D.h(a,"function",F,"containingGroupChanged"),this.qr=a,this.i("containingGroupChanged",b,a))});F.prototype.findSubGraphLevel=function(){return tr(this,this)};function tr(a,b){var c=b.Pa;return null!==c?1+tr(a,c):b instanceof G&&(c=b.Ac,null!==c)?tr(a,c):0} +F.prototype.findTopLevelPart=function(){return ur(this,this)};function ur(a,b){var c=b.Pa;return null!==c?ur(a,c):b instanceof G&&(c=b.Ac,null!==c)?ur(a,c):b}D.w(F,{yq:"isTopLevel"},function(){return null!==this.Pa||this instanceof G&&this.tf?!1:!0});F.prototype.isMemberOf=F.prototype.Ei=function(a){return a instanceof I?vr(this,this,a):!1};function vr(a,b,c){if(b===c||null===c)return!1;var d=b.Pa;return null===d||d!==c&&!vr(a,d,c)?b instanceof G&&(b=b.Ac,null!==b)?vr(a,b,c):!1:!0} +F.prototype.findCommonContainingGroup=F.prototype.FI=function(a){if(null===a)return null;v&&D.l(a,F,F,"findCommonContainingGroup:other");if(this===a)return this.Pa;for(var b=this;null!==b;)b instanceof I&&qr(b,!0),b=b.Pa;for(var c=null,b=a;null!==b;){if(0!==(b.S&1048576)){c=b;break}b=b.Pa}for(b=this;null!==b;)b instanceof I&&qr(b,!1),b=b.Pa;return c}; +D.defineProperty(F,{tJ:"layoutConditions"},function(){return this.ps},function(a){var b=this.ps;b!==a&&(v&&D.h(a,"number",F,"layoutConditions"),this.ps=a,this.i("layoutConditions",b,a))});F.prototype.canLayout=function(){if(!this.cB||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Uc||this instanceof G&&this.tf?!1:!0}; +F.prototype.invalidateLayout=F.prototype.N=function(a){void 0===a&&(a=16777215);var b;this.cB&&0!==(a&this.tJ)?(b=this.layer,null!==b&&b.Uc||this instanceof G&&this.tf?b=!1:(b=this.g,b=null!==b&&b.ra.ob?!1:!0)):b=!1;if(b)if(b=this.sl,null!==b){var c=b.Vb;null!==c?c.N():b.N(a)}else a=this.g,null!==a&&(c=a.Vb,null!==c&&c.N())};function Xm(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Uc?!1:!0} +D.defineProperty(F,{fF:"dragComputation"},function(){return this.Kr},function(a){var b=this.Kr;b!==a&&(null!==a&&D.h(a,"function",F,"dragComputation"),this.Kr=a,this.i("dragComputation",b,a))});D.defineProperty(F,{lK:"shadowOffset"},function(){return this.tn},function(a){var b=this.tn;b.P(a)||(v&&D.l(a,O,F,"shadowOffset"),this.tn=a=a.V(),this.qa(),this.i("shadowOffset",b,a))}); +D.defineProperty(F,{shadowColor:"shadowColor"},function(){return this.sn},function(a){var b=this.sn;b!==a&&(v&&D.h(a,"string",F,"shadowColor"),this.sn=a,this.qa(),this.i("shadowColor",b,a))});D.defineProperty(F,{shadowBlur:"shadowBlur"},function(){return this.Ng},function(a){var b=this.Ng;b!==a&&(v&&D.h(a,"number",F,"shadowBlur"),this.Ng=a,this.qa(),this.i("shadowBlur",b,a))}); +function da(a){0===arguments.length?F.call(this,ck):F.call(this,a);this.S&=-257;this.Gl="Adornment";this.Qc=null;this.JD=0;this.yE=!1;this.Qb=this.ph=null}D.Sa(da,F);D.ja("Adornment",da);da.prototype.toString=function(){var a=this.$f;return"Adornment("+this.Ed+")"+(null!==a?a.toString():"")};da.prototype.updateRelationshipsFromData=function(){}; +da.prototype.Fu=function(a){var b=this.zb.Y,c=this.zb;if(b instanceof J&&c instanceof z){var d=b.path,c=d.Df;b.Fu(a);c=d.Df;a=this.ya.o;b=a.length;for(d=0;da&&(a=1);var b=this.g;if(null!==b&&!b.Ph){b.Ph=!0;var c=new L(G);c.add(this);Hr(this,c,b.$d,a,b.Xa,this,b.ZB===Cl);b.Ph=!1}}; +function Hr(a,b,c,d,e,g,h){if(1a&&(a=2);var b=this.g;if(null!==b&&!b.Ph){b.Ph=!0;var c=new L(G);c.add(this);Jr(this,c,b.$d,a,b.Xa,this,b.ZB===Cl);b.Ph=!1}};function Jr(a,b,c,d,e,g,h){for(var k=g===a?!1:a.td,l=c?a.Gx():a.Xg();l.next();){var m=l.value;m.Vc&&(k||m.lh||m.gc(),m=m.RA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.Jd(!0),m.Vk(),h&&nl(e,m,g)),2a&&(a-=180);break;case Wp:a=Ue(c+90);90a&&(a-=180);break;case Yp:a=Ue(c-90);90a&&(a-=180);break;case Zp:a=Ue(c);if(45a||225a)return 0;90a&&(a-=180)}return Ue(a)}; +D.defineProperty(J,{aa:"fromNode"},function(){return this.Ag},function(a){var b=this.Ag;if(b!==a){v&&null!==a&&D.l(a,G,J,"fromNode");var c=this.Lc;null!==b&&(this.Rg!==b&&Er(b,this,c),Pr(this),this.N(an));this.Ag=a;null!==a&&this.Jd(a.isVisible());this.Yi=null;this.gc();var d=this.g;if(null!==d){var e=this.data,g=d.ga;if(null!==e)if(g instanceof Y){var h=null!==a?a.data:null;g.FB(e,g.Cb(h))}else g instanceof xg&&(h=null!==a?a.data:null,d.$d?g.Hi(e,g.Cb(h)):(null!==b&&g.Hi(b.data,void 0),g.Hi(h,g.Cb(null!== +this.Rg?this.Rg.data:null))))}e=this.Lc;g=this.wF;null!==g&&(h=!0,null!==d&&(h=d.ab,d.ab=!0),g(this,c,e),null!==d&&(d.ab=h));null!==a&&(this.Rg!==a&&Dr(a,this,e),Qr(this),this.N(Sm));this.i("fromNode",b,a);wn(this)}}); +D.defineProperty(J,{dg:"fromPortId"},function(){return this.di},function(a){var b=this.di;if(b!==a){v&&D.h(a,"string",J,"fromPortId");var c=this.Lc;null!==c&&Cr(this.aa,c);Pr(this);this.di=a;var d=this.Lc;null!==d&&Cr(this.aa,d);var e=this.g;if(null!==e){var g=this.data,h=e.ga;null!==g&&h instanceof Y&&h.GB(g,a)}c!==d&&(this.Yi=null,this.gc(),g=this.wF,null!==g&&(h=!0,null!==e&&(h=e.ab,e.ab=!0),g(this,c,d),null!==e&&(e.ab=h)));Qr(this);this.i("fromPortId",b,a)}}); +D.w(J,{Lc:"fromPort"},function(){var a=this.Ag;return null===a?null:a.lm(this.di)});D.defineProperty(J,{wF:"fromPortChanged"},function(){return this.Ur},function(a){var b=this.Ur;b!==a&&(null!==a&&D.h(a,"function",J,"fromPortChanged"),this.Ur=a,this.i("fromPortChanged",b,a))}); +D.defineProperty(J,{da:"toNode"},function(){return this.Rg},function(a){var b=this.Rg;if(b!==a){v&&null!==a&&D.l(a,G,J,"toNode");var c=this.kd;null!==b&&(this.Ag!==b&&Er(b,this,c),Pr(this),this.N(an));this.Rg=a;null!==a&&this.Jd(a.isVisible());this.Yi=null;this.gc();var d=this.g;if(null!==d){var e=this.data,g=d.ga;if(null!==e)if(g instanceof Y){var h=null!==a?a.data:null;g.LB(e,g.Cb(h))}else g instanceof xg&&(h=null!==a?a.data:null,d.$d?(null!==b&&g.Hi(b.data,void 0),g.Hi(h,g.Cb(null!==this.Ag?this.Ag.data: +null))):g.Hi(e,g.Cb(h)))}e=this.kd;g=this.dH;null!==g&&(h=!0,null!==d&&(h=d.ab,d.ab=!0),g(this,c,e),null!==d&&(d.ab=h));null!==a&&(this.Ag!==a&&Dr(a,this,e),Qr(this),this.N(Sm));this.i("toNode",b,a);wn(this)}}); +D.defineProperty(J,{jh:"toPortId"},function(){return this.yi},function(a){var b=this.yi;if(b!==a){v&&D.h(a,"string",J,"toPortId");var c=this.kd;null!==c&&Cr(this.da,c);Pr(this);this.yi=a;var d=this.kd;null!==d&&Cr(this.da,d);var e=this.g;if(null!==e){var g=this.data,h=e.ga;null!==g&&h instanceof Y&&h.MB(g,a)}c!==d&&(this.Yi=null,this.gc(),g=this.dH,null!==g&&(h=!0,null!==e&&(h=e.ab,e.ab=!0),g(this,c,d),null!==e&&(e.ab=h)));Qr(this);this.i("toPortId",b,a)}}); +D.w(J,{kd:"toPort"},function(){var a=this.Rg;return null===a?null:a.lm(this.yi)});D.defineProperty(J,{dH:"toPortChanged"},function(){return this.It},function(a){var b=this.It;b!==a&&(null!==a&&D.h(a,"function",J,"toPortChanged"),this.It=a,this.i("toPortChanged",b,a))});D.defineProperty(J,{Gb:"fromSpot"},function(){return null!==this.Z?this.Z.jk:Vc},function(a){this.Wd();var b=this.Z.jk;b.P(a)||(v&&D.l(a,R,J,"fromSpot"),a=a.V(),this.Z.jk=a,this.i("fromSpot",b,a),this.gc())}); +D.defineProperty(J,{om:"fromEndSegmentLength"},function(){return null!==this.Z?this.Z.hk:NaN},function(a){this.Wd();var b=this.Z.hk;b!==a&&(v&&D.h(a,"number",J,"fromEndSegmentLength"),0>a&&D.ua(a,">= 0",J,"fromEndSegmentLength"),this.Z.hk=a,this.i("fromEndSegmentLength",b,a),this.gc())}); +D.defineProperty(J,{mu:"fromEndSegmentDirection"},function(){return null!==this.Z?this.Z.gk:xr},function(a){this.Wd();var b=this.Z.gk;b!==a&&(D.Pn("Link.fromEndSegmentDirection","2.0"),v&&D.Da(a,G,J,"fromEndSegmentDirection"),this.Z.gk=a,this.i("fromEndSegmentDirection",b,a),this.gc())}); +D.defineProperty(J,{nu:"fromShortLength"},function(){return null!==this.Z?this.Z.ik:NaN},function(a){this.Wd();var b=this.Z.ik;b!==a&&(v&&D.h(a,"number",J,"fromShortLength"),this.Z.ik=a,this.i("fromShortLength",b,a),this.gc())});D.defineProperty(J,{Hb:"toSpot"},function(){return null!==this.Z?this.Z.Gk:Vc},function(a){this.Wd();var b=this.Z.Gk;b.P(a)||(v&&D.l(a,R,J,"toSpot"),a=a.V(),this.Z.Gk=a,this.i("toSpot",b,a),this.gc())}); +D.defineProperty(J,{Dm:"toEndSegmentLength"},function(){return null!==this.Z?this.Z.Ek:NaN},function(a){this.Wd();var b=this.Z.Ek;b!==a&&(v&&D.h(a,"number",J,"toEndSegmentLength"),0>a&&D.ua(a,">= 0",J,"toEndSegmentLength"),this.Z.Ek=a,this.i("toEndSegmentLength",b,a),this.gc())}); +D.defineProperty(J,{ev:"toEndSegmentDirection"},function(){return null!==this.Z?this.Z.Dk:xr},function(a){this.Wd();var b=this.Z.Dk;b!==a&&(D.Pn("Link.toEndSegmentDirection","2.0"),v&&D.Da(a,G,J,"toEndSegmentDirection"),this.Z.Dk=a,this.i("toEndSegmentDirection",b,a),this.gc())});D.defineProperty(J,{fv:"toShortLength"},function(){return null!==this.Z?this.Z.Fk:NaN},function(a){this.Wd();var b=this.Z.Fk;b!==a&&(v&&D.h(a,"number",J,"toShortLength"),this.Z.Fk=a,this.i("toShortLength",b,a),this.gc())}); +function wn(a){var b=a.aa,c=a.da;null!==b?null!==c?Rr(a,b.FI(c)):Rr(a,null):Rr(a,null)}function Rr(a,b){var c=a.sl;if(c!==b){null!==c&&rr(c,a);a.sl=b;null!==b&&sr(b,a);var d=a.TE;if(null!==d){var e=!0,g=a.g;null!==g&&(e=g.ab,g.ab=!0);d(a,c,b);null!==g&&(g.ab=e)}!a.lh||a.iE!==c&&a.jE!==c||a.gc()}}J.prototype.Vk=function(){var a=this.Pa;null!==a&&this.aa!==a&&this.da!==a&&a.tx&&F.prototype.Vk.call(this)}; +J.prototype.getOtherNode=J.prototype.RA=function(a){v&&D.l(a,G,J,"getOtherNode:node");var b=this.aa;return a===b?this.da:b};J.prototype.getOtherPort=function(a){v&&D.l(a,P,J,"getOtherPort:port");var b=this.Lc;return a===b?this.kd:b};D.w(J,{LL:"isLabeledLink"},function(){return null===this.zf?!1:0=d&&(h=d-1);var l=this.m(h-1),g=this.m(h);Ae(e.x,e.y,k.x,k.y,l.x,l.y,g.x,g.y,.5,a);b=Math.min(g.x,b);c=Math.min(g.y,c);e=g}else for(e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.n(e.x,e.y,0,0),a.Ki(g),h=2;hc&&(c=-c)):zb(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Cf(d)),g.push(c),e+=c;for(d=h=c=0;ce/2)break;c+=d;h++}D.Ba(g);b=this.m(h);g=this.m(h+1);b.x===g.x?b.y>g.y?a.n(b.x,b.y-(e/2-c)):a.n(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.n(b.x-(e/2-c),b.y):a.n(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.n(b.x+c*(g.x-b.x),b.y+c*(g.y-b.y)));return a};D.w(J,{gG:"midAngle"},function(){this.Ao();return this.computeMidAngle()}); +J.prototype.computeMidAngle=function(){var a=this.ta;if(2>a)return NaN;if(this.computeCurve()===Sj&&4<=a&&!this.rc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.m(c),d=this.m(c+1),a=this.m(c+2),c=this.m(c+3),e=d.x,d=d.y,g=a.x,a=a.y,h=(e+g)/2,k=(d+a)/2;return rb(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(g+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0e+10))?e>c+10?d.Yb(a):b.Yb(a):b.Yb(d);b=this.m(c-1);d=this.m(c);a=this.m(c+1);c=b.Cf(d);e=d.Cf(a);return c>e+10?b.Yb(d):e>c+10?d.Yb(a):b.Yb(a)}; +D.defineProperty(J,{points:"points"},function(){return this.bd},function(a){var b=this.bd;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;em&&(p=-p),u=(0>l?-1:1)*p+r,t=n*(u- +r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,y=r,w=s;Q(l,0)?w=0l?-1:1)*p+r,w=n*(y-r)+s);this.cq();this.Ai(h);this.yj(u,t);this.yj(y,w);this.Ai(q);this.fh(0,this.getLinkPoint(b,c,d,!0,!1,e,g));this.fh(3,this.getLinkPoint(e,g,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,g),a=this.getLinkPoint(e,g,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,g=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,Q(e,0)?k=0g&&(h=-h),h=(0>e?-1:1)*h+b, +k=q*(h-b)+c),this.Ai(d),this.yj(h,k)):this.Ai(d),this.Ai(a)}else{p=this.Oh;q&&(n&&p||m)&&this.cq();var C=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,g),r=u=s=0;if(n||!k||m)if(t=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,g),m&&(k||d.P(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>C&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(t+=Math.abs(C)*(n?1:2)),0===r?s=t:90===r?u=t:180===r?s=-t:270===r?u=-t:(s=t*Math.cos(r*Math.PI/180),u=t*Math.sin(r*Math.PI/ +180)),d.Zd()&&m){var A=c.eb(hc,D.O()),N=D.Fb(A.x+1E3*s,A.y+1E3*u);this.getLinkPointFromPoint(b,c,A,N,!0,p);D.A(A);D.A(N)}var t=this.getLinkPoint(e,g,a,!1,n,b,c),H=w=y=0;if(n||!l||m)A=this.computeEndSegmentLength(e,g,a,!1),H=this.getLinkDirection(e,g,t,a,!1,n,b,c),m&&(l||d.P(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(H+=n?0:30,0>C&&(H+=180)),0>H?H+=360:360<=H&&(H-=360),m&&(A+=Math.abs(C)*(n?1:2)),0===H?y=A:90===H?w=A:180===H?y=-A:270===H?w=-A:(y=A*Math.cos(H*Math.PI/180),w=A*Math.sin(H*Math.PI/180)),a.Zd()&& +m&&(A=g.eb(hc,D.O()),N=D.Fb(A.x+1E3*y,A.y+1E3*w),this.getLinkPointFromPoint(e,g,A,N,!1,t),D.A(A),D.A(N));a=p;if(n||!k||m)a=new O(p.x+s,p.y+u);d=t;if(n||!l||m)d=new O(t.x+y,t.y+w);!q&&!n&&k&&3Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b} +J.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new O);if(null===a||null===b)return g.assign(c),g;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.Q;null===e||e.kh()||(e=e.Q);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.Hh;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Vn(e,h,k,l, +g);null!==a&&g.transform(a);return g};function Yr(a,b){var c=b.Xs;null===c&&(c=new Zr,c.port=b,c.Wc=b.Y,b.Xs=c);return $r(c,a)} +J.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new O);if(c.fd())return b.eb(c,k),k;if(c.Lj()){var l=Yr(this,b);if(null!==l){k.assign(l.Aq);if(e&&this.zy===Or){var m=Yr(this,h);if(null!==m&&l.Mn=n.y&&a.y<=n.y+n.height?k.y=a.y:(c.Jj(vc)||c.Jj(Bc))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);D.A(l);D.A(m)}}return k}}c=b.eb(hc,D.O());l=g=null;this.ta> +(e?6:2)?(l=d?this.m(1):this.m(this.ta-2),e&&(l=Xr(c,l.copy()))):(g=D.O(),l=h.eb(hc,g),e&&(l=Xr(c,l)),D.A(g));this.getLinkPointFromPoint(a,b,c,l,d,k);D.A(c);return k}; +J.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.fd())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(g?6:2)?(n=e?this.m(1):this.m(this.ta-2),n=g?Xr(l,n.copy()):c):(m=D.O(),n=k.eb(hc,m),D.A(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y- +l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;D.A(l)}d.Zd()&&h.Ei(a)&&(c+=180,360<=c&&(c-=360));a=xr;a=e?this.mu:this.ev;a===xr&&(a=e?b.mu:b.ev);switch(a){case yr:b=b.Tn();c+=b;360<=c&&(c-=360);break;case xr:case Do:b=b.Tn();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c}; +J.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.Lj()&&(a=Yr(this,b),null!==a))return a.Cx;a=NaN;a=d?this.om:this.Dm;null!==b&&isNaN(a)&&(a=d?b.om:b.Dm);isNaN(a)&&(a=10);return a};J.prototype.computeSpot=function(a){return a?Vr(this,this.Lc):Wr(this,this.kd)};function Vr(a,b){if(null===b)return hc;var c=a.Gb;c.ed()&&null!==b&&(c=b.Gb);return c===Vc?cc:c}function Wr(a,b){if(null===b)return hc;var c=a.Hb;c.ed()&&null!==b&&(c=b.Hb);return c===Vc?cc:c} +J.prototype.computeOtherPoint=function(a,b){var c=b.eb(hc),d;d=b.Xs;d=null!==d?$r(d,this):null;null!==d&&(c=d.Aq);return c};J.prototype.computeShortLength=function(a){if(a){if(a=this.nu,isNaN(a)){var b=this.Lc;null!==b&&(a=b.nu)}}else a=this.fv,isNaN(a)&&(b=this.kd,null!==b&&(a=b.fv));return isNaN(a)?0:a}; +J.prototype.Qk=function(a,b,c,d,e,g){if(!1===this.qg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=D.Pf(),h.reset());h.multiply(this.transform);if(this.Jn(a,h))return eq(this,b,c,e),void 0===g&&D.He(h),!0;if(this.fg(a,h)){var k=!1;if(!this.$n)for(var l=this.ya.o,m=l.length;m--;){var n=l[m];if(n.visible||n===this.uf){var p=n.$,q=this.Ga;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=D.Pf();p.set(h);if(n instanceof x)k=n.Qk(a,b,c,d,e,p);else if(this.path=== +n){if(n instanceof z){var k=n,r=a,s=d,q=p;if(!1===k.qg)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,t=q;if(k.Jn(u,t))k=!0;else{if(void 0===t&&(t=k.transform,u.Nk(k.$))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,y=D.O(),w=D.O(),C=D.O(),A=D.Pf();A.set(t);A.pB(k.transform);A.Px();w.x=r;w.y=s;w.transform(A);y.x=q;y.y=s;y.transform(A);t=!1;rq(k,y,w,C)?t=!0:(y.x=r,y.y=u,y.transform(A),rq(k,y,w,C)?t=!0:(w.x=q,w.y=u,w.transform(A),rq(k,y,w,C)?t=!0:(y.x=q,y.y=s,y.transform(A),rq(k,y,w,C)&& +(t=!0))));D.He(A);D.A(y);D.A(w);D.A(C);k=t}}else k=k.Jn(r,q)}}else k=Jo(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof L&&e.add(n),e instanceof K&&e.add(n)));D.He(p)}}}void 0===g&&D.He(h);return k||null!==this.background||null!==this.$l}void 0===g&&D.He(h);return!1};D.w(J,{rc:"isOrthogonal"},function(){return 2===(this.mn.value&2)});D.w(J,{Oh:"isAvoiding"},function(){return 4===(this.mn.value&4)}); +J.prototype.computeCurve=function(){if(null===this.Yi){var a=this.Lc,b=this.rc;this.Yi=null!==a&&a===this.kd&&!b}return this.Yi?Sj:this.gf};J.prototype.computeCorner=function(){if(this.gf===Sj)return 0;var a=this.AA;if(isNaN(a)||0>a)a=10;return a};J.prototype.findMidLabel=function(){for(var a=this.path,b=this.ya.o,c=b.length,d=0;dl?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;zb(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.fh(a,b);for(a+= +1;al?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ia(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.fh(c,d)}}return!0;case Nr:g=this.m(a);p=this.m(c);if(!g.Tc(b)||!p.Tc(d)){var e=g.x,g=g.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-g)*(p-g),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.fh(a,b);for(a+=1;ab?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.$.copy(),k=g.$.copy();if(h.F()&&k.F()){h.Ff(8,8);k.Ff(8,8);h.Ki(a);k.Ki(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l=new O(c.x,a.y),m=new O(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.Oa(a)||h.Oa(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l=new O(Math.max((a.x+c.x)/2,a.x),a.y),m=new O(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,k.right,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.yh.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l=new O(a.x,Math.max((a.y+c.y)/2,a.y)),m=new O(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.y,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.y,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.Oa(a)||h.Oa(c))?l.x=this.computeMidOrthoPosition(a.x, c.x,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l=new O(a.x,Math.min((a.y+c.y)/2,a.y)),m=new O(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xk&&0!==$r(e,c.x,c.y)){as(this,e,c.x,c.y,d,!0);d=this.n(2);if(4>this.ta)0===b||180===b?(d.x=a.x,d.y=c.y):(d.x=c.x,d.y=a.y),this.ia(2,d.x,d.y),this.B(3,d.x,d.y);else if(c=this.n(3),0===b|| -180===b)Q(d.x,c.x)?(b=0===b?Math.max(d.x,a.x):Math.min(d.x,a.x),this.ia(2,b,a.y),this.ia(3,b,c.y)):Q(d.y,c.y)?(Math.abs(a.y-d.y)<=e.aq/2&&(this.ia(2,d.x,a.y),this.ia(3,c.x,a.y)),this.B(2,d.x,a.y)):this.ia(2,a.x,d.y);else if(90===b||270===b)Q(d.y,c.y)?(b=90===b?Math.max(d.y,a.y):Math.min(d.y,a.y),this.ia(2,a.x,b),this.ia(3,c.x,b)):Q(d.x,c.x)?(Math.abs(a.x-d.x)<=e.cq/2&&(this.ia(2,a.x,d.y),this.ia(3,a.x,c.y)),this.B(2,a.x,d.y)):this.ia(2,d.x,a.y);a=!0}else a=!1}else a=!1;a||(this.zi(l),this.zi(m))}}; -J.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};function Qh(a){if(null===a.g||!a.Di)return!1;var b=a.points.o,c=b.length;if(4>c)return!1;a=ha(a.g,!0,a.Pa,null);for(var d=1;da)return new bf(sf);var b=!1,c=this.g;null!==c&&Qr(this)&&c.sl.contains(this)&&null!==this.Iw&&(b=!0);var d=c=0,e=this.n(0).copy(),g=e.copy(),c=this.ad.o,h=this.computeCurve();if(h===Nj&&3<=a&&!yb(this.Tq,0))if(3===a)var k=this.n(1),c=Math.min(e.x,k.x),d=Math.min(e.y,k.y),k=this.n(2),c=Math.min(c,k.x),d=Math.min(d,k.y);else{if(this.qc)for(k=0;k=a&&(k=a-1),c=this.n(k), -g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);c=g.x;d=g.y}else{for(k=0;ky?r>q?(u.x=w-A,u.y=q-A,t.x=w+s,t.y=q+s):(u.x=w-A,u.y=q+A,t.x=w+s,t.y=q-s):r>q?(u.x=w+A,u.y=q-A,t.x=w-s,t.y=q+s):(u.x=w+A,u.y=q+A,t.x=w-s,t.y=q-s));yb(y,w)&&yb(q,r)&&(q>p?(C>w?(u.x= -w-A,u.y=q-A,t.x=w+s):(u.x=w+A,u.y=q-A,t.x=w-s),t.y=q+s):(C>w?(u.x=w-A,u.y=q+A,t.x=w+s):(u.x=w+A,u.y=q+A,t.x=w-s),t.y=q-s));if(yb(y,w)&&yb(w,C)||yb(p,q)&&yb(q,r))y=.5*(y+C),p=.5*(p+r),u.x=y,u.y=p,t.x=y,t.y=p;1===k?(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y)):2===k&&yb(b.x,this.n(0).x)&&yb(b.y,this.n(0).y)&&(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y));V(l,e.x-c,e.y-d,h.x-c,h.y-d,m.x-c,m.y-d);g.set(h);e.set(a);b=m}}k=b.x;b=b.y;g=this.n(this.ta-1);0!==this.computeShortLength(!1)&&(g=bs(this,g.copy(),!1,Gd));k=.5*(k+g.x); -b=.5*(b+g.y);V(l,a.x-c,a.y-d,k-c,b-d,g.x-c,g.y-d)}else for(k=3;k=a&&(k=a-1),g=this.n(k-1),e=this.n(k),k===a-1&&0!==this.computeShortLength(!1)&&(e=bs(this,e.copy(),!1,Gd)),V(l,b.x-c,b.y-d,g.x-c,g.y-d,e.x-c,e.y-d);else{g=D.P();g.assign(this.n(0));for(k=1;k=a-1){g!==u&&(0!==this.computeShortLength(!1)&&(u=bs(this,u.copy(),!1,Gd)),es(this,l,-c,-d,g,u,b));break}k=cs(this,u,k+1,kn.x?u.x-s:u.x+s,A=t.y>u.y?u.y+w:u.y-w,es(this,e,h,m,n,new O(q,C),p),zf(e,u.x+h,u.y+m,r+h,A+m),y.m(r,A))):Q(n.x,u.x)&&Q(u.y,t.y)?(s=this.computeCorner(),w=Math.min(s,Math.abs(u.y-n.y)/2),w=s=Math.min(w,Math.abs(t.x-u.x)/2),Q(s,0)?(es(this,e,h,m,n,u,p),y.assign(u)):(q=u.x,A=C=u.y,C=u.y>n.y?u.y-w:u.y+w,r=t.x>u.x?u.x+s:u.x-s,es(this,e, -h,m,n,new O(q,C),p),zf(e,u.x+h,u.y+m,r+h,A+m),y.m(r,A))):(es(this,e,h,m,n,u,p),y.assign(u))}D.A(g)}c=l.q;D.u(l)}else l=this.n(1).copy(),l.x-=c,l.y-=d,0!==this.computeShortLength(!0)&&(e=bs(this,e,!0,g)),0!==this.computeShortLength(!1)&&(l=bs(this,l,!1,g)),c=new bf(sf),c.ma=e.x,c.ka=e.y,c.H=l.x,c.I=l.y;return c}; -function ds(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return yb(a,0)?b:yb(b,0)?a:Math.sqrt(a*a+b*b)} -function bs(a,b,c,d){var e=a.ta;if(2>e)return b;if(c){var g=a.n(1);c=g.x-d.x;d=g.y-d.y;g=ds(b.x,b.y,c,d);if(0===g)return b;e=2===e?.5*g:g;a=a.computeShortLength(!0);a>e&&(a=e);c=a*(c-b.x)/g;a=a*(d-b.y)/g;b.x+=c;b.y+=a}else{g=a.n(e-2);c=g.x-d.x;d=g.y-d.y;g=ds(b.x,b.y,c,d);if(0===g)return b;e=2===e?.5*g:g;a=a.computeShortLength(!1);a>e&&(a=e);c=a*(b.x-c)/g;a=a*(b.y-d)/g;b.x-=c;b.y-=a}return b} -function cs(a,b,c,d){for(var e=a.ta,g=b;yb(b.x,g.x)&&yb(b.y,g.y);){if(c>=e)return e-1;g=a.n(c++)}if(!yb(b.x,g.x)&&!yb(b.y,g.y))return c-1;for(var h=g;yb(b.x,g.x)&&yb(g.x,h.x)&&(!d||(b.y>=g.y?g.y>=h.y:g.y<=h.y))||yb(b.y,g.y)&&yb(g.y,h.y)&&(!d||(b.x>=g.x?g.x>=h.x:g.x<=h.x));){if(c>=e)return e-1;h=a.n(c++)}return c-2} -function es(a,b,c,d,e,g,h){if(!h&&Qr(a)){h=[];var k=0;a.isVisible()&&(k=fs(a,e,g,h));var l=e.x,l=e.y;if(0p-10)m--,p=Math.max(q-5,g.x);else break;q=g.y-10+d;n=p+c;p=g.y+d;a.gf===mj?T(b,n,p,!1,!1):V(b,l,q,n,q,n,p)}else if(Q(e.x,g.x))if(e.yp-10)m--,p=Math.max(q-5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.gf===mj?T(b,n,p,!1,!1):V(b,q,l,q,p,n,p)}}b.lineTo(g.x+c,g.y+d)} -function fs(a,b,c,d){var e=a.g;if(null===e||b.O(c))return 0;for(e=e.ao;e.next();){var g=e.value;if(null!==g&&g.visible)for(var g=g.pb.o,h=g.length,k=0;kh.x&&n.x>m.x||m.xh.y&&n.y>m.y||m.yu&&Math.min(h,y)q&&!Q(h,y)){n.x=u;n.y=q;n=!0;break a}}else if(!Q(q,s)&&Q(h,y)&&Math.min(q,s)h&&Math.min(u,t)p&&!Q(u,t)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}D.A(k)}D.w(J,{ju:"firstPickIndex"},function(){var a;2>=this.ta?a=0:((a=this.qc)||(a=this.computeSpot(!0)!==bc),a=a?1:0);return a});D.w(J,{ay:"lastPickIndex"},function(){var a=this.ta;if(0===a)a=0;else if(2>=a)a-=1;else{var b;(b=this.qc)||(b=this.computeSpot(!1)!==bc);a=b?a-2:a-1}return a});function Qr(a){a=a.gf;return a===lj||a===mj} -function Sr(a,b){if(b||Qr(a)){var c=a.g;null===c||c.sl.contains(a)||null===a.Iw||c.sl.add(a,a.Iw)}}function oj(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Tc){var d=c.g;if(null!==d)for(var e=!1,d=d.ao;d.next();){var g=d.value;if(g.visible)if(g===c)for(var e=!0,h=!1,g=g.pb.o,k=g.length,l=0;l=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Vf=Math.floor((a.x-this.ce)/this.ce)*this.ce;this.Wf=Math.floor((b-this.Md)/this.Md)*this.Md;this.xs=Math.ceil((c+2*this.ce)/this.ce)*this.ce;this.ys=Math.ceil((d+2*this.Md)/this.Md)*this.Md;a=1+(Math.ceil((this.xs-this.Vf)/this.ce)|0);b=1+(Math.ceil((this.ys-this.Wf)/this.Md)|0);if(null===this.wd||this.ynthis.xs||a+cthis.ys||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.yn)|0;for(c=Math.min(b+e-1,this.zn)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.wd[a][e])return!1;return!0}; -function js(a,b,c,d,e,g,h,k,l){if(!(bh||cl)){var m,n;m=b|0;n=c|0;var p=a.wd[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;g<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.wd[m][n]);)a.wd[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0m;c+=d)js(a,b,c,1,!e,g,h,k,l),js(a,b,c,-1,!e,g,h,k,l);else if(0m;b+=d)js(a,b,c,1,!e,g,h,k,l),js(a,b,c,-1,!e,g,h, -k,l)}}function ks(a,b,c,d,e,g,h,k,l){b|=0;c|=0;var m=0,n=1;for(a.wd[b][c]=n;0===m&&b>g&&bk&&cg&&bk&&c=Math.abs(h-b)&&1>=Math.abs(k-d))a.abort=!0;else{var l=g.x,m=g.y,n=g.x+g.width,p=g.y+g.height,l=l-a.Vf,l=l/a.ce,m=m-a.Wf,m=m/a.Md,n=n-a.Vf,n=n/a.ce,p=p-a.Wf,p=p/a.Md;g=Math.max(0,Math.min(a.yn,l|0));n=Math.min(a.yn,Math.max(0,n|0));m=Math.max(0,Math.min(a.zn,m|0));p=Math.min(a.zn,Math.max(0,p|0));h|=0;k|=0;b|=0;d|=0;l=90===c|| -270===c;ks(a,h,k,0===c||90===c?1:-1,l,g,n,m,p);ks(a,h,k,1,!l,g,n,m,p);ks(a,h,k,-1,!l,g,n,m,p);ls(a,b,d,0===e||90===e?1:-1,90===e||270===e,g,n,m,p);ls(a,b,d,1,!(90===e||270===e),g,n,m,p);ls(a,b,d,-1,!(90===e||270===e),g,n,m,p);a.abort||(js(a,h,k,1,!1,g,n,m,p),js(a,h,k,-1,!1,g,n,m,p),js(a,h,k,1,!0,g,n,m,p),js(a,h,k,-1,!0,g,n,m,p))}}}function Xr(){D.tc(this);this.port=this.Vc=null;this.kg=[];this.Dq=!1}D.ke(Xr,{Vc:!0,port:!0,kg:!0,Dq:!0}); -Xr.prototype.toString=function(){for(var a=this.kg,b=this.Vc.toString()+" "+a.length.toString()+":",c=0;c=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case D.Yc|D.ud:return c>a&&c<=180+a?180:270;case D.ud|D.ld:return c>180-a&&c<=360-a?270:0;case D.ld|D.kd:return c>a&&c<=180+a?90:0;case D.kd|D.Yc:return c>180-a&&c<=360-a?180:90;case D.Yc|D.ud|D.ld:return 90180+a&&c<=360- -a?270:0;case D.ud|D.ld|D.kd:return 180a&&180>=c?90:0;case D.ld|D.kd|D.Yc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case D.kd|D.Yc|D.ud:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(D.Yc|D.ud|D.ld|D.kd)&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}Xr.prototype.wq=function(){this.kg.length=0}; -function Yr(a,b){var c=a.kg;if(0===c.length){a:if(!a.Dq){c=a.Dq;a.Dq=!0;var d,e=null,g=a.Vc,g=g instanceof I?g:null;if(null===g||g.Je)d=a.Vc.lF(a.port.sd);else{if(!g.$.F()){a.Dq=c;break a}e=g;d=e.kF()}var h=a.kg.length=0,k=a.port.eb(cc,D.P()),l=a.port.eb(rc,D.P()),g=D.gh(k.x,k.y,0,0);g.Ki(l);D.A(k);D.A(l);k=D.Fb(g.x+g.width/2,g.y+g.height/2);for(d=d.j;d.next();)if(l=d.value,l.isVisible()){var m=l.dd===a.port||l.aa.Ei(e),n=l.computeSpot(m);if(n.Kj()&&(m=m?l.Ld:l.dd,null!==m)){var p=m.Y;if(null!==p){var m= -l.computeOtherPoint(p,m),p=k.Jc(m),n=ms(g,n,p,l.qc),q=0;0===n?(q=D.ld,180Math.abs(H)?(C=Math.abs(H)/ -q,q=Math.abs(H)):C=1;break;case D.Yc:r>Math.abs(N)?(C=Math.abs(N)/r,r=Math.abs(N)):C=1;break;case D.ud:m>Math.abs(H)?(C=Math.abs(H)/m,m=Math.abs(H)):C=1;break;default:case D.ld:p>Math.abs(N)?(C=Math.abs(N)/p,p=Math.abs(N)):C=1}w=0}var W=u.Bq;if(e===xr){t=u.link.computeThickness();t*=C;W.set(A);switch(y){case D.kd:W.x=A.x+H/2+q/2-w-t/2;break;case D.Yc:W.y=A.y+N/2+r/2-w-t/2;break;case D.ud:W.x=A.x+H/2-m/2+w+t/2;break;default:case D.ld:W.y=A.y+N/2-p/2+w+t/2}w+=t}else t=.5,e===ur&&(t=(u.tq+1)/(u.Kn+1)), -W.x=A.x+H*t,W.y=A.y+N*t}D.A(k);D.A(d);D.A(l);D.A(n);A=a.kg;for(H=0;Hb.Ke?1:a.angleb.angle?1:0}; -Xr.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Vc,this.port,bc,b.dd===this.port),d=a.tq;if(0>d)return c;var e=a.Kn;if(1>=e||!b.qc)return c;var b=a.ny,g=a.Bq;if(a.Ke===D.Yc||a.Ke===D.kd)d=e-1-d;return((a=a.Ke===D.Yc||a.Ke===D.ld)?b.ye&&(e=k.right);k.bottom>g&&(g=k.bottom)}}isFinite(c)&&isFinite(d)?a.m(c,d,e-c,g-d):(b=b.location,c=this.padding,a.m(b.x+c.left,b.y+c.top,0,0));return a}; -D.defineProperty(Rj,{padding:"padding"},function(){return this.of},function(a){"number"===typeof a?a=new Hb(a):D.l(a,Hb,Rj,"padding");var b=this.of;b.O(a)||(this.of=a=a.V(),this.i("padding",b,a))});function Tg(){0=c-1?(h=0,e=d,g+=k+20,k=0):h++}null!==a&&a.Td("Layout")}this.Hf=!0};Tg.prototype.mo=function(a){return!a.location.F()||a instanceof I&&a.mo?!0:!1}; -function qs(a,b,c,d,e,g,h,k){for(c=c.j;c.next();){var l=c.value;d&&!l.zq||null!==e&&!e(l)||!l.canLayout()||(g&&l instanceof G?l.tf||(l instanceof I?null===l.Vb?qs(a,b,l.Mc,!1,e,g,h,k):(rs(l),b.add(l)):(rs(l),b.add(l))):h&&l instanceof J?b.add(l):!k||!l.oe()||l instanceof G||(rs(l),b.add(l)))}}function rs(a){var b=a.$;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.hf()} -Tg.prototype.collectParts=Tg.prototype.ZH=function(a){var b=new L(F);a instanceof E?(qs(this,b,a.ng,!0,null,!0,!0,!0),qs(this,b,a.links,!0,null,!0,!0,!0),qs(this,b,a.Gi,!0,null,!0,!0,!0)):a instanceof I?qs(this,b,a.Mc,!1,null,!0,!0,!0):qs(this,b,a.j,!1,null,!0,!0,!0);return b};D.defineProperty(Tg,{Ae:"arrangementOrigin"},function(){return this.gr},function(a){D.l(a,O,Tg,"arrangementOrigin");this.gr.O(a)||(this.gr.assign(a),this.N())}); -Tg.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.eb(cc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a}; -function va(){D.tc(this);this.te=null;if(this.vertexes)for(var a=this.vertexes.j;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.j;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new L(wa);this.edges=new L(xa);this.ky=new ma(G,wa);this.ey=new ma(J,xa)}D.ja("LayoutNetwork",va); -va.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.j;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.j;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new L(wa);this.edges=new L(xa);this.ky=new ma(G,wa);this.ey=new ma(J,xa)}; -va.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Vb?"("+this.Vb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1k&&0!==cs(s,c.x,c.y)){ds(this,s,c.x,c.y,d,!0);h=this.m(2);if(4>this.ta)0===b||180=== +b?(h.x=a.x,h.y=c.y):(h.x=c.x,h.y=a.y),this.ia(2,h.x,h.y),this.B(3,h.x,h.y);else if(c=this.m(3),0===b||180===b)Q(h.x,c.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.ia(2,h,a.y),this.ia(3,h,c.y)):Q(h.y,c.y)?(Math.abs(a.y-h.y)<=s.En/2&&(this.ia(2,h.x,a.y),this.ia(3,c.x,a.y)),this.B(2,h.x,a.y)):this.ia(2,a.x,h.y);else if(90===b||270===b)Q(h.y,c.y)?(h=90===b?Math.max(h.y,a.y):Math.min(h.y,a.y),this.ia(2,a.x,h),this.ia(3,c.x,h)):Q(h.x,c.x)?(Math.abs(a.x-h.x)<=s.Fn/2&&(this.ia(2,a.x,h.y),this.ia(3, +a.x,c.y)),this.B(2,a.x,h.y)):this.ia(2,h.x,a.y);null!==r&&(a=this.m(1),c=this.m(2),a.x!==c.x&&a.y!==c.y?0===b||180===b?this.B(2,a.x,c.y):this.B(2,c.x,a.y):0===b||180===b?this.B(2,e.x,r.y):this.B(2,r.x,e.y));null!==u&&(0===d||180===d?this.yj(g.x,u.y):this.yj(u.x,g.y));b=!0}else b=!1}}}else b=!1;b||(this.Ai(l),this.Ai(m))}};J.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2}; +function Mi(a){if(null===a.g||!a.Oh)return!1;var b=a.points.o,c=b.length;if(4>c)return!1;a=ha(a.g,!0,a.Pa,null);for(var d=1;da)return new Ye(qf);var b=!1,c=this.g;null!==c&&Sr(this)&&c.ul.contains(this)&&null!==this.Hw&&(b=!0);var d=c=0,e=this.m(0).copy(),g=e.copy(),c=this.bd.o,h=this.computeCurve();if(h===Sj&&3<=a&&!zb(this.Sq,0))if(3===a)var k=this.m(1),c=Math.min(e.x,k.x),d=Math.min(e.y,k.y),k=this.m(2),c=Math.min(c,k.x),d=Math.min(d,k.y);else{if(this.rc)for(k=0;k=a&&(k=a-1),c=this.m(k), +g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);c=g.x;d=g.y}else{for(k=0;ky?r>q?(u.x=w-A,u.y=q-A,t.x=w+s,t.y=q+s):(u.x=w-A,u.y=q+A,t.x=w+s,t.y=q-s):r>q?(u.x=w+A,u.y=q-A,t.x=w-s,t.y=q+s):(u.x=w+A,u.y=q+A,t.x=w-s,t.y=q-s));zb(y,w)&&zb(q,r)&&(q>p?(C>w?(u.x= +w-A,u.y=q-A,t.x=w+s):(u.x=w+A,u.y=q-A,t.x=w-s),t.y=q+s):(C>w?(u.x=w-A,u.y=q+A,t.x=w+s):(u.x=w+A,u.y=q+A,t.x=w-s),t.y=q-s));if(zb(y,w)&&zb(w,C)||zb(p,q)&&zb(q,r))y=.5*(y+C),p=.5*(p+r),u.x=y,u.y=p,t.x=y,t.y=p;1===k?(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y)):2===k&&zb(b.x,this.m(0).x)&&zb(b.y,this.m(0).y)&&(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y));V(l,e.x-c,e.y-d,h.x-c,h.y-d,m.x-c,m.y-d);g.set(h);e.set(a);b=m}}k=b.x;b=b.y;g=this.m(this.ta-1);0!==this.computeShortLength(!1)&&(g=es(this,g.copy(),!1,Gd));k=.5*(k+g.x); +b=.5*(b+g.y);V(l,a.x-c,a.y-d,k-c,b-d,g.x-c,g.y-d)}else for(k=3;k=a&&(k=a-1),g=this.m(k-1),e=this.m(k),k===a-1&&0!==this.computeShortLength(!1)&&(e=es(this,e.copy(),!1,Gd)),V(l,b.x-c,b.y-d,g.x-c,g.y-d,e.x-c,e.y-d);else{g=D.O();g.assign(this.m(0));for(k=1;k=a-1){g!==u&&(0!==this.computeShortLength(!1)&&(u=es(this,u.copy(),!1,Gd)),hs(this,l,-c,-d,g,u,b));break}k=fs(this,u,k+1,kn.x?u.x-s:u.x+s,A=t.y>u.y?u.y+w:u.y-w,hs(this,e,h,m,n,new O(q,C),p),xf(e,u.x+h,u.y+m,r+h,A+m),y.n(r,A))):Q(n.x,u.x)&&Q(u.y,t.y)?(s=this.computeCorner(),w=Math.min(s,Math.abs(u.y-n.y)/2),w=s=Math.min(w,Math.abs(t.x-u.x)/2),Q(s,0)?(hs(this,e,h,m,n,u,p),y.assign(u)):(q=u.x,A=C=u.y,C=u.y>n.y?u.y-w:u.y+w,r=t.x>u.x?u.x+s:u.x-s,hs(this,e, +h,m,n,new O(q,C),p),xf(e,u.x+h,u.y+m,r+h,A+m),y.n(r,A))):(hs(this,e,h,m,n,u,p),y.assign(u))}D.A(g)}c=l.q;D.u(l)}else l=this.m(1).copy(),l.x-=c,l.y-=d,0!==this.computeShortLength(!0)&&(e=es(this,e,!0,g)),0!==this.computeShortLength(!1)&&(l=es(this,l,!1,g)),c=new Ye(qf),c.ma=e.x,c.ka=e.y,c.H=l.x,c.I=l.y;return c}; +function gs(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return zb(a,0)?b:zb(b,0)?a:Math.sqrt(a*a+b*b)} +function es(a,b,c,d){var e=a.ta;if(2>e)return b;if(c){var g=a.m(1);c=g.x-d.x;d=g.y-d.y;g=gs(b.x,b.y,c,d);if(0===g)return b;e=2===e?.5*g:g;a=a.computeShortLength(!0);a>e&&(a=e);c=a*(c-b.x)/g;a=a*(d-b.y)/g;b.x+=c;b.y+=a}else{g=a.m(e-2);c=g.x-d.x;d=g.y-d.y;g=gs(b.x,b.y,c,d);if(0===g)return b;e=2===e?.5*g:g;a=a.computeShortLength(!1);a>e&&(a=e);c=a*(b.x-c)/g;a=a*(b.y-d)/g;b.x-=c;b.y-=a}return b} +function fs(a,b,c,d){for(var e=a.ta,g=b;zb(b.x,g.x)&&zb(b.y,g.y);){if(c>=e)return e-1;g=a.m(c++)}if(!zb(b.x,g.x)&&!zb(b.y,g.y))return c-1;for(var h=g;zb(b.x,g.x)&&zb(g.x,h.x)&&(!d||(b.y>=g.y?g.y>=h.y:g.y<=h.y))||zb(b.y,g.y)&&zb(g.y,h.y)&&(!d||(b.x>=g.x?g.x>=h.x:g.x<=h.x));){if(c>=e)return e-1;h=a.m(c++)}return c-2} +function hs(a,b,c,d,e,g,h){if(!h&&Sr(a)){h=[];var k=0;a.isVisible()&&(k=is(a,e,g,h));var l=e.x,l=e.y;if(0p-10)m--,p=Math.max(q-5,g.x);else break;q=g.y-10+d;n=p+c;p=g.y+d;a.gf===tj?T(b,n,p,!1,!1):V(b,l,q,n,q,n,p)}else if(Q(e.x,g.x))if(e.yp-10)m--,p=Math.max(q-5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.gf===tj?T(b,n,p,!1,!1):V(b,q,l,q,p,n,p)}}b.lineTo(g.x+c,g.y+d)} +function is(a,b,c,d){var e=a.g;if(null===e||b.P(c))return 0;for(e=e.co;e.next();){var g=e.value;if(null!==g&&g.visible)for(var g=g.qb.o,h=g.length,k=0;kh.x&&n.x>m.x||m.xh.y&&n.y>m.y||m.yu&&Math.min(h,y)q&&!Q(h,y)){n.x=u;n.y=q;n=!0;break a}}else if(!Q(q,s)&&Q(h,y)&&Math.min(q,s)h&&Math.min(u,t)p&&!Q(u,t)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}D.A(k)}D.w(J,{iu:"firstPickIndex"},function(){var a;2>=this.ta?a=0:((a=this.rc)||(a=this.computeSpot(!0)!==cc),a=a?1:0);return a});D.w(J,{$x:"lastPickIndex"},function(){var a=this.ta;if(0===a)a=0;else if(2>=a)a-=1;else{var b;(b=this.rc)||(b=this.computeSpot(!1)!==cc);a=b?a-2:a-1}return a});function Sr(a){a=a.gf;return a===sj||a===tj} +function Ur(a,b){if(b||Sr(a)){var c=a.g;null===c||c.ul.contains(a)||null===a.Hw||c.ul.add(a,a.Hw)}}function Bj(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Uc){var d=c.g;if(null!==d)for(var e=!1,d=d.co;d.next();){var g=d.value;if(g.visible)if(g===c)for(var e=!0,h=!1,g=g.qb.o,k=g.length,l=0;l=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Wf=Math.floor((a.x-this.ce)/this.ce)*this.ce;this.Xf=Math.floor((b-this.Md)/this.Md)*this.Md;this.ws=Math.ceil((c+2*this.ce)/this.ce)*this.ce;this.xs=Math.ceil((d+2*this.Md)/this.Md)*this.Md;a=1+(Math.ceil((this.ws-this.Wf)/this.ce)|0);b=1+(Math.ceil((this.xs-this.Xf)/this.Md)|0);if(null===this.nd||this.ynthis.ws||a+cthis.xs||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.yn)|0;for(c=Math.min(b+e-1,this.zn)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.nd[a][e])return!1;return!0}; +function ls(a,b,c,d,e,g,h,k,l){if(!(bh||cl)){var m,n;m=b|0;n=c|0;var p=a.nd[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;g<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.nd[m][n]);)a.nd[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0m;c+=d)ls(a,b,c,1,!e,g,h,k,l),ls(a,b,c,-1,!e,g,h,k,l);else if(0m;b+=d)ls(a,b,c,1,!e,g,h,k,l),ls(a,b,c,-1,!e,g,h, +k,l)}}function ms(a,b,c,d,e,g,h,k,l){b|=0;c|=0;var m=0,n=1;for(a.nd[b][c]=n;0===m&&b>g&&bk&&cg&&bk&&c=Math.abs(h-b)&&1>=Math.abs(k-d))a.abort=!0;else{var l=g.x,m=g.y,n=g.x+g.width,p=g.y+g.height,l=l-a.Wf,l=l/a.ce,m=m-a.Xf,m=m/a.Md,n=n-a.Wf,n=n/a.ce,p=p-a.Xf,p=p/a.Md;g=Math.max(0,Math.min(a.yn,l|0));n=Math.min(a.yn,Math.max(0,n|0));m=Math.max(0,Math.min(a.zn,m|0));p=Math.min(a.zn,Math.max(0,p|0));h|=0;k|=0;b|=0;d|=0;l=0===c|| +90===c?1:-1;c=90===c||270===c;0===a.nd[h][k]?(ms(a,h,k,l,c,g,n,m,p),ms(a,h,k,1,!c,g,n,m,p),ms(a,h,k,-1,!c,g,n,m,p)):ms(a,h,k,l,c,h,k,h,k);0===a.nd[b][d]?(ns(a,b,d,0===e||90===e?1:-1,90===e||270===e,g,n,m,p),ns(a,b,d,1,!(90===e||270===e),g,n,m,p),ns(a,b,d,-1,!(90===e||270===e),g,n,m,p)):ns(a,b,d,l,c,b,d,b,d);a.abort||(ls(a,h,k,1,!1,g,n,m,p),ls(a,h,k,-1,!1,g,n,m,p),ls(a,h,k,1,!0,g,n,m,p),ls(a,h,k,-1,!0,g,n,m,p))}}}function Zr(){D.uc(this);this.port=this.Wc=null;this.lg=[];this.Cq=!1} +D.ke(Zr,{Wc:!0,port:!0,lg:!0,Cq:!0});Zr.prototype.toString=function(){for(var a=this.lg,b=this.Wc.toString()+" "+a.length.toString()+":",c=0;c=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case D.Zc|D.wd:return c>a&&c<=180+a?180:270;case D.wd|D.md:return c>180-a&&c<=360-a?270:0;case D.md|D.ld:return c>a&&c<=180+a?90:0;case D.ld|D.Zc:return c>180-a&&c<=360-a?180:90;case D.Zc|D.wd|D.md:return 90180+a&&c<=360- +a?270:0;case D.wd|D.md|D.ld:return 180a&&180>=c?90:0;case D.md|D.ld|D.Zc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case D.ld|D.Zc|D.wd:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(D.Zc|D.wd|D.md|D.ld)&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}Zr.prototype.vq=function(){this.lg.length=0}; +function $r(a,b){var c=a.lg;if(0===c.length){a:if(!a.Cq){c=a.Cq;a.Cq=!0;var d,e=null,g=a.Wc,g=g instanceof I?g:null;if(null===g||g.Je)d=a.Wc.oF(a.port.ud);else{if(!g.$.F()){a.Cq=c;break a}e=g;d=e.nF()}var h=a.lg.length=0,k=a.port.eb(dc,D.O()),l=a.port.eb(uc,D.O()),g=D.sg(k.x,k.y,0,0);g.Ki(l);D.A(k);D.A(l);k=D.Fb(g.x+g.width/2,g.y+g.height/2);for(d=d.j;d.next();)if(l=d.value,l.isVisible()){var m=l.Lc===a.port||l.aa.Ei(e),n=l.computeSpot(m);if(n.Lj()&&(m=m?l.kd:l.Lc,null!==m)){var p=m.Y;if(null!==p){var m= +l.computeOtherPoint(p,m),p=k.Yb(m),n=os(g,n,p,l.rc),q=0;0===n?(q=D.md,180Math.abs(H)?(C=Math.abs(H)/ +q,q=Math.abs(H)):C=1;break;case D.Zc:r>Math.abs(N)?(C=Math.abs(N)/r,r=Math.abs(N)):C=1;break;case D.wd:m>Math.abs(H)?(C=Math.abs(H)/m,m=Math.abs(H)):C=1;break;default:case D.md:p>Math.abs(N)?(C=Math.abs(N)/p,p=Math.abs(N)):C=1}w=0}var W=u.Aq;if(e===zr){t=u.link.computeThickness();t*=C;W.set(A);switch(y){case D.ld:W.x=A.x+H/2+q/2-w-t/2;break;case D.Zc:W.y=A.y+N/2+r/2-w-t/2;break;case D.wd:W.x=A.x+H/2-m/2+w+t/2;break;default:case D.md:W.y=A.y+N/2-p/2+w+t/2}w+=t}else t=.5,e===wr&&(t=(u.sq+1)/(u.Mn+1)), +W.x=A.x+H*t,W.y=A.y+N*t}D.A(k);D.A(d);D.A(l);D.A(n);A=a.lg;for(H=0;Hb.Ke?1:a.angleb.angle?1:0}; +Zr.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Wc,this.port,cc,b.Lc===this.port),d=a.sq;if(0>d)return c;var e=a.Mn;if(1>=e||!b.rc)return c;var b=a.my,g=a.Aq;if(a.Ke===D.Zc||a.Ke===D.ld)d=e-1-d;return((a=a.Ke===D.Zc||a.Ke===D.md)?b.ye&&(e=k.right);k.bottom>g&&(g=k.bottom)}}isFinite(c)&&isFinite(d)?a.n(c,d,e-c,g-d):(b=b.location,c=this.padding,a.n(b.x+c.left,b.y+c.top,0,0));return a}; +D.defineProperty(Wj,{padding:"padding"},function(){return this.of},function(a){"number"===typeof a?a=new Ib(a):D.l(a,Ib,Wj,"padding");var b=this.of;b.P(a)||(this.of=a=a.V(),this.i("padding",b,a))});function Wg(){0=c-1?(h=0,e=d,g+=k+20,k=0):h++}null!==a&&a.Td("Layout")}this.If=!0};Wg.prototype.oo=function(a){return!a.location.F()||a instanceof I&&a.oo?!0:!1}; +function ss(a,b,c,d,e,g,h,k){for(c=c.j;c.next();){var l=c.value;d&&!l.yq||null!==e&&!e(l)||!l.canLayout()||(g&&l instanceof G?l.tf||(l instanceof I?null===l.Vb?ss(a,b,l.Nc,!1,e,g,h,k):(ts(l),b.add(l)):(ts(l),b.add(l))):h&&l instanceof J?b.add(l):!k||!l.oe()||l instanceof G||(ts(l),b.add(l)))}}function ts(a){var b=a.$;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.hf()} +Wg.prototype.collectParts=Wg.prototype.bI=function(a){var b=new L(F);a instanceof E?(ss(this,b,a.og,!0,null,!0,!0,!0),ss(this,b,a.links,!0,null,!0,!0,!0),ss(this,b,a.Gi,!0,null,!0,!0,!0)):a instanceof I?ss(this,b,a.Nc,!1,null,!0,!0,!0):ss(this,b,a.j,!1,null,!0,!0,!0);return b};D.defineProperty(Wg,{Ae:"arrangementOrigin"},function(){return this.fr},function(a){D.l(a,O,Wg,"arrangementOrigin");this.fr.P(a)||(this.fr.assign(a),this.N())}); +Wg.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.eb(dc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a}; +function va(){D.uc(this);this.te=null;if(this.vertexes)for(var a=this.vertexes.j;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.j;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new L(wa);this.edges=new L(xa);this.jy=new ma(G,wa);this.by=new ma(J,xa)}D.ja("LayoutNetwork",va); +va.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.j;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.j;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new L(wa);this.edges=new L(xa);this.jy=new ma(G,wa);this.by=new ma(J,xa)}; +va.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Vb?"("+this.Vb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1d?1:0):1:null!==d?-1:0}; -wa.smartComparer=function(a,b){v&&D.l(a,wa,wa,"smartComparer:m");v&&D.l(b,wa,wa,"smartComparer:n");if(null!==a){if(null!==b){var c=a.Bd,d=b.Bd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=g&&0>=h&&(g=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.$b("Layout");d=[];switch(this.alignment){case Fs:var k=a,l=c,m=Math.max(this.bq.width,1);if(!isFinite(m))for(var n=m=0;ng-1||0h)d.push(new B(0,y,h+k,C)),w=0,t=u,y+=C,C=0;C=Math.max(C,N);N=0;switch(s){case Es:N=-q.width;break;default:N=0}p.moveTo(t+N,y);switch(s){case Es:t-=A;break; -default:t+=A}w++}d.push(new B(0,y,h+k,C));break;case xs:k=g;l=a;m=c;n=Math.max(this.bq.width,1);p=y=A=0;q=D.P();for(g=0;g=A&&(h-=A);for(var A=N=0,H=Math.max(this.bq.height,1),fa=p=0,S=!0,ba=D.P(),g=0;gk-1||0h){d.push(new B(0,S?w-p:w,h+l,fa+p+m));for(W=0;WA&&(e.width+=e.x-A,e.x=A)}for(k=g=h=e=0;kd?1:0}; -Tn.smartComparer=function(a,b){v&&D.l(a,F,Tn,"standardComparer:a");v&&D.l(b,F,Tn,"standardComparer:b");if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=a.count)1===a.count&&(a=a.first(),a.na=0,a.va=0);else{var b=new K(Ys);b.Rc(a.j);a=new K(Ys);var c=new K(Ys),d;d=this.sort(b);var e=this.uz,g=this.YC,h=this.fe,k=this.Zo,l=this.vz,m=this.Nr,b=this.tl,n=this.oE,p=this.Rg,q=this.Dv,e=this.$f,g=this.jy,h=this.RJ;if(!isFinite(h)|| -0>=h)h=NaN;k=this.SH;if(!isFinite(k)||0>=k)k=1;l=this.Le;isFinite(l)||(l=0);m=this.xf;if(!isFinite(m)||360m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Vs&&g===Ws?e=Hs:e===Vs&&g!==Ws&&(g=Ws,e=this.$f);if((this.direction===Qs||this.direction===Rs)&&this.sorting!==Ks){for(var r=0;!(r>=d.length);r+=2){a.add(d.ea(r));if(r+1>=d.length)break;c.add(d.ea(r+1))}this.direction===Qs?(this.$f===Vs&&a.reverse(),d=new K(Ys),d.Rc(a),d.Rc(c)):(this.$f===Vs&&c.reverse(),d=new K(Ys),d.Rc(c),d.Rc(a))}for(var s= -d.length,u=n=0,r=0;rm&&(0===r||r===d.length-1)&&(t/=2);n+=t;u++}if(isNaN(h)||e===Vs){isNaN(b)&&(b=6);if(e!==Hs&&e!==Vs){t=-Infinity;for(r=0;rh?(h=r,p=h*k):q=u/(360<=m?s:s-1)}this.uz=e;this.YC=g;this.fe=h;this.Zo=k;this.vz=l;this.Nr=m;this.tl=b;this.oE=n;this.Rg=p;this.Dv=q;b=d;d=this.uz;e=this.fe;g=this.vz;k=this.Nr;l=this.tl;m=this.Rg;n=this.Dv;if(this.direction!==Qs&&this.direction!==Rs||d!==Vs)if(this.direction===Qs||this.direction===Rs){h=0;switch(d){case Us:h=180*bt(this,e,m,g,n)/Math.PI;break;case Hs:n=b=0;h=a.first();null!==h&&(b=Zs(h,Math.PI/2));h=c.first();null!==h&&(n=Zs(h,Math.PI/2));h=180*bt(this,e,m,g,l+(b+ -n)/2)/Math.PI;break;case Ts:h=k/b.length}if(this.direction===Qs){switch(d){case Us:ct(this,a,g,Ss);break;case Hs:dt(this,a,g,Ss);break;case Ts:et(this,a,k/2,g,Ss)}switch(d){case Us:ct(this,c,g+h,Js);break;case Hs:dt(this,c,g+h,Js);break;case Ts:et(this,c,k/2,g+h,Js)}}else{switch(d){case Us:ct(this,c,g,Ss);break;case Hs:dt(this,c,g,Ss);break;case Ts:et(this,c,k/2,g,Ss)}switch(d){case Us:ct(this,a,g+h,Js);break;case Hs:dt(this,a,g+h,Js);break;case Ts:et(this,a,k/2,g+h,Js)}}}else switch(d){case Us:ct(this, -b,g,this.direction);break;case Hs:dt(this,b,g,this.direction);break;case Ts:et(this,b,k,g,this.direction);break;case Vs:ft(this,b,k,g,this.direction)}else ft(this,b,k,g-k/2,Js)}this.updateParts();this.network=null;this.Hf=!0}; -function et(a,b,c,d,e){var g=a.Nr,h=a.fe;a=a.Rg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;lc){for(g=d+(e===Js?g:-g);0>g;)g+=360;g%=360;180=n.length-1)break;it(a,l,m,n,p,e,g)||jt(a,l,m,n,p,e,g);l=g.x;m=g.y}D.A(g);a.hn++;if(!(23Math.abs(r)?Math.abs(l-g)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0Math.abs(q)?0:q;q=!1;q=Math.abs(g)>Math.abs(p)?0p:0a.hn?a.fe-h/(2*Math.PI):5>n.length&&10=p.length-1)break;it(a,l,m,p,q,e,n)||jt(a,l,m,p,q,e,n);l=n.x;m=n.y}D.A(n);a.hn++;if(!(23a.hn?a.fe-g/(2*Math.PI):a.fe-(0k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0} -function jt(a,b,c,d,e,g,h){var k=a.fe,l=a.Rg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.tl;d=!1;if(0<=b!==(g===Js)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}Gs.prototype.commitLayout=function(){this.commitNodes();this.zu&&this.commitLinks()}; -Gs.prototype.commitNodes=function(){for(var a=this.HH,b=this.network.vertexes.j;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};Gs.prototype.commitLinks=function(){for(var a=this.network.edges.j;a.next();)a.value.commit()}; -function at(a,b,c,d,e){var g=a.yH;if(.001>Math.abs(a.Zo-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(g+1):Math.PI/(2*(g+1)),l=0,m=0;m<=g;m++)l=void 0!==d&&void 0!==e?d+m*e/g:m*Math.PI/(2*g),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function $s(a,b,c,d,e){var g=0,g=void 0!==d&&void 0!==e?at(a,1,c,d,e):at(a,1,c);return b/g} -function bt(a,b,c,d,e){if(.001>Math.abs(a.Zo-1))return e/b;var g=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-g*g*l*l)*a;if(h>=e)return k*a}} -Gs.prototype.sort=function(a){switch(this.sorting){case Os:break;case Ps:a.reverse();break;case Ms:a.sort(this.comparer);break;case Ns:a.sort(this.comparer);a.reverse();break;case Ks:for(var b=[],c=0;ce&&(e=k,g=h)}else for(h=0;he&&(e=k,g=h);d.add(a.ea(g));b[g]=-1;g=a.ea(g);e=0;for(h=g.sc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&& -b[e]++;for(g=g.pc;g.next();)e=a.indexOf(g.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(g=0;ga[g].indexOf(l)&&a[g].push(l);for(b=b.sc;b.next();)l=d.indexOf(b.value.fromVertex),l!==g&&0>a[g].indexOf(l)&&a[g].push(l)}h=[];for(g=0;gd?1:0):1:null!==d?-1:0}; +wa.smartComparer=function(a,b){v&&D.l(a,wa,wa,"smartComparer:m");v&&D.l(b,wa,wa,"smartComparer:n");if(null!==a){if(null!==b){var c=a.Cd,d=b.Cd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=g&&0>=h&&(g=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.ac("Layout");d=[];switch(this.alignment){case Hs:var k=a,l=c,m=Math.max(this.bq.width,1);if(!isFinite(m))for(var n=m=0;ng-1||0h)d.push(new B(0,y,h+k,C)),w=0,t=u,y+=C,C=0;C=Math.max(C,N);N=0;switch(s){case Gs:N=-q.width;break;default:N=0}p.moveTo(t+N,y);switch(s){case Gs:t-=A;break; +default:t+=A}w++}d.push(new B(0,y,h+k,C));break;case zs:k=g;l=a;m=c;n=Math.max(this.bq.width,1);p=y=A=0;q=D.O();for(g=0;g=A&&(h-=A);for(var A=N=0,H=Math.max(this.bq.height,1),fa=p=0,S=!0,ba=D.O(),g=0;gk-1||0h){d.push(new B(0,S?w-p:w,h+l,fa+p+m));for(W=0;WA&&(e.width+=e.x-A,e.x=A)}for(k=g=h=e=0;kd?1:0}; +Un.smartComparer=function(a,b){v&&D.l(a,F,Un,"standardComparer:a");v&&D.l(b,F,Un,"standardComparer:b");if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=a.count)1===a.count&&(a=a.first(),a.oa=0,a.va=0);else{var b=new K($s);b.Sc(a.j);a=new K($s);var c=new K($s),d;d=this.sort(b);var e=this.uz,g=this.aD,h=this.fe,k=this.ap,l=this.vz,m=this.Mr,b=this.vl,n=this.rE,p=this.Tg,q=this.Cv,e=this.ag,g=this.iy,h=this.UJ;if(!isFinite(h)|| +0>=h)h=NaN;k=this.VH;if(!isFinite(k)||0>=k)k=1;l=this.Le;isFinite(l)||(l=0);m=this.xf;if(!isFinite(m)||360m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Xs&&g===Ys?e=Js:e===Xs&&g!==Ys&&(g=Ys,e=this.ag);if((this.direction===Ss||this.direction===Ts)&&this.sorting!==Ms){for(var r=0;!(r>=d.length);r+=2){a.add(d.ea(r));if(r+1>=d.length)break;c.add(d.ea(r+1))}this.direction===Ss?(this.ag===Xs&&a.reverse(),d=new K($s),d.Sc(a),d.Sc(c)):(this.ag===Xs&&c.reverse(),d=new K($s),d.Sc(c),d.Sc(a))}for(var s= +d.length,u=n=0,r=0;rm&&(0===r||r===d.length-1)&&(t/=2);n+=t;u++}if(isNaN(h)||e===Xs){isNaN(b)&&(b=6);if(e!==Js&&e!==Xs){t=-Infinity;for(r=0;rh?(h=r,p=h*k):q=u/(360<=m?s:s-1)}this.uz=e;this.aD=g;this.fe=h;this.ap=k;this.vz=l;this.Mr=m;this.vl=b;this.rE=n;this.Tg=p;this.Cv=q;b=d;d=this.uz;e=this.fe;g=this.vz;k=this.Mr;l=this.vl;m=this.Tg;n=this.Cv;if(this.direction!==Ss&&this.direction!==Ts||d!==Xs)if(this.direction===Ss||this.direction===Ts){h=0;switch(d){case Ws:h=180*dt(this,e,m,g,n)/Math.PI;break;case Js:n=b=0;h=a.first();null!==h&&(b=at(h,Math.PI/2));h=c.first();null!==h&&(n=at(h,Math.PI/2));h=180*dt(this,e,m,g,l+(b+ +n)/2)/Math.PI;break;case Vs:h=k/b.length}if(this.direction===Ss){switch(d){case Ws:et(this,a,g,Us);break;case Js:ft(this,a,g,Us);break;case Vs:gt(this,a,k/2,g,Us)}switch(d){case Ws:et(this,c,g+h,Ls);break;case Js:ft(this,c,g+h,Ls);break;case Vs:gt(this,c,k/2,g+h,Ls)}}else{switch(d){case Ws:et(this,c,g,Us);break;case Js:ft(this,c,g,Us);break;case Vs:gt(this,c,k/2,g,Us)}switch(d){case Ws:et(this,a,g+h,Ls);break;case Js:ft(this,a,g+h,Ls);break;case Vs:gt(this,a,k/2,g+h,Ls)}}}else switch(d){case Ws:et(this, +b,g,this.direction);break;case Js:ft(this,b,g,this.direction);break;case Vs:gt(this,b,k,g,this.direction);break;case Xs:ht(this,b,k,g,this.direction)}else ht(this,b,k,g-k/2,Ls)}this.updateParts();this.network=null;this.If=!0}; +function gt(a,b,c,d,e){var g=a.Mr,h=a.fe;a=a.Tg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;lc){for(g=d+(e===Ls?g:-g);0>g;)g+=360;g%=360;180=n.length-1)break;kt(a,l,m,n,p,e,g)||lt(a,l,m,n,p,e,g);l=g.x;m=g.y}D.A(g);a.hn++;if(!(23Math.abs(r)?Math.abs(l-g)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0Math.abs(q)?0:q;q=!1;q=Math.abs(g)>Math.abs(p)?0p:0a.hn?a.fe-h/(2*Math.PI):5>n.length&&10=p.length-1)break;kt(a,l,m,p,q,e,n)||lt(a,l,m,p,q,e,n);l=n.x;m=n.y}D.A(n);a.hn++;if(!(23a.hn?a.fe-g/(2*Math.PI):a.fe-(0k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0} +function lt(a,b,c,d,e,g,h){var k=a.fe,l=a.Tg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.vl;d=!1;if(0<=b!==(g===Ls)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}Is.prototype.commitLayout=function(){this.commitNodes();this.yu&&this.commitLinks()}; +Is.prototype.commitNodes=function(){for(var a=this.KH,b=this.network.vertexes.j;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};Is.prototype.commitLinks=function(){for(var a=this.network.edges.j;a.next();)a.value.commit()}; +function ct(a,b,c,d,e){var g=a.BH;if(.001>Math.abs(a.ap-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(g+1):Math.PI/(2*(g+1)),l=0,m=0;m<=g;m++)l=void 0!==d&&void 0!==e?d+m*e/g:m*Math.PI/(2*g),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function bt(a,b,c,d,e){var g=0,g=void 0!==d&&void 0!==e?ct(a,1,c,d,e):ct(a,1,c);return b/g} +function dt(a,b,c,d,e){if(.001>Math.abs(a.ap-1))return e/b;var g=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-g*g*l*l)*a;if(h>=e)return k*a}} +Is.prototype.sort=function(a){switch(this.sorting){case Qs:break;case Rs:a.reverse();break;case Os:a.sort(this.comparer);break;case Ps:a.sort(this.comparer);a.reverse();break;case Ms:for(var b=[],c=0;ce&&(e=k,g=h)}else for(h=0;he&&(e=k,g=h);d.add(a.ea(g));b[g]=-1;g=a.ea(g);e=0;for(h=g.tc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&& +b[e]++;for(g=g.qc;g.next();)e=a.indexOf(g.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(g=0;ga[g].indexOf(l)&&a[g].push(l);for(b=b.tc;b.next();)l=d.indexOf(b.value.fromVertex),l!==g&&0>a[g].indexOf(l)&&a[g].push(l)}h=[];for(g=0;ga[b[p]].indexOf(b[p===b.length-1?0:p+1])&&u.push(p===b.length-1?0:p+1);if(0===u.length)for(p=0;pN.indexOf(S)||baN.indexOf(S)|| ba=t?l+1:l)),w+=l=t&&l++,A>=t&&A++,l>A&&(N=A,A=l,l=N),A-l<(b.length+2)/2===(lq||q===l||(s=q>l?q-l:l-q,p+=qh-s?1:-1);b.splice(0>p?l:l+1,0,m);c.splice(k,1);k--}else g=!1;if(g)break;else b.push(c[0]),c.splice(0,1)}for(g=0;g=a?a:360,this.N())}); -D.defineProperty(Gs,{$f:"arrangement"},function(){return this.vd},function(a){this.vd!==a&&(D.Ca(a,Gs,Gs,"arrangement"),a===Vs||a===Hs||a===Us||a===Ts)&&(this.vd=a,this.N())});D.defineProperty(Gs,{direction:"direction"},function(){return this.fa},function(a){this.fa!==a&&(D.Ca(a,Gs,Gs,"direction"),a===Js||a===Ss||a===Qs||a===Rs)&&(this.fa=a,this.N())}); -D.defineProperty(Gs,{sorting:"sorting"},function(){return this.qi},function(a){this.qi!==a&&(D.Ca(a,Gs,Gs,"sorting"),a===Os||a===Ps||a===Ms||Ns||a===Ks)&&(this.qi=a,this.N())});D.defineProperty(Gs,{comparer:"comparer"},function(){return this.Zh},function(a){this.Zh!==a&&(D.h(a,"function",Gs,"comparer"),this.Zh=a,this.N())});D.defineProperty(Gs,{spacing:"spacing"},function(){return this.ri},function(a){this.ri!==a&&(D.h(a,"number",Gs,"spacing"),this.ri=a,this.N())}); -D.defineProperty(Gs,{jy:"nodeDiameterFormula"},function(){return this.Os},function(a){this.Os!==a&&(D.Ca(a,Gs,Gs,"nodeDiameterFormula"),a===Ls||a===Ws)&&(this.Os=a,this.N())});D.w(Gs,{IH:"actualXRadius"},function(){return this.fe});D.w(Gs,{JH:"actualYRadius"},function(){return this.Rg});D.w(Gs,{DK:"actualSpacing"},function(){return this.tl});D.w(Gs,{HH:"actualCenter"},function(){return isNaN(this.Ae.x)||isNaN(this.Ae.y)?new O(0,0):new O(this.Ae.x+this.IH,this.Ae.y+this.JH)});var Hs; -Gs.ConstantSpacing=Hs=D.s(Gs,"ConstantSpacing",0);var Us;Gs.ConstantDistance=Us=D.s(Gs,"ConstantDistance",1);var Ts;Gs.ConstantAngle=Ts=D.s(Gs,"ConstantAngle",2);var Vs;Gs.Packed=Vs=D.s(Gs,"Packed",3);var Js;Gs.Clockwise=Js=D.s(Gs,"Clockwise",4);var Ss;Gs.Counterclockwise=Ss=D.s(Gs,"Counterclockwise",5);var Qs;Gs.BidirectionalLeft=Qs=D.s(Gs,"BidirectionalLeft",6);var Rs;Gs.BidirectionalRight=Rs=D.s(Gs,"BidirectionalRight",7);var Os;Gs.Forwards=Os=D.s(Gs,"Forwards",8);var Ps; -Gs.Reverse=Ps=D.s(Gs,"Reverse",9);var Ms;Gs.Ascending=Ms=D.s(Gs,"Ascending",10);var Ns;Gs.Descending=Ns=D.s(Gs,"Descending",11);var Ks;Gs.Optimized=Ks=D.s(Gs,"Optimized",12);var Ls;Gs.Pythagorean=Ls=D.s(Gs,"Pythagorean",13);var Ws;Gs.Circular=Ws=D.s(Gs,"Circular",14);function Is(){this.qq=-Infinity;this.Xq=this.Ao=null} -Is.prototype.compare=function(a,b){if(0this.qq||Math.abs(a)a&&0g?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new O(n.x+n.width+d.width,n.y),l[1]=new O(n.x,n.y+n.height+d.height),g=2):(p=du(l,g, -e,k,n.width,n.height,d),q=l[p],r=new O(q.x+n.width+d.width,q.y),s=new O(q.x,q.y+n.height+d.height),p+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().sb,d=this.network.vertexes.j;d.next();){if(d.value.sb.Wg(c)&&(a++,2a.network.vertexes.count)return!1;null===a.Qg?a.Qg=new K(ju):a.Qg.clear();a.Qg.Rc(a.network.vertexes);var c=a.Qg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.og-a.og});for(var d=c.count-1;0<=d&&1>=c.ea(d).og;)d--;return 1=h))){for(var m=0,n=0,p=l.count-h;ps&&(s=1);m=te((m+s+n*n*4/(h*h))/s);h=(m-1)*p/2;m=(m-1)*q/2;g.sb=new B(k-r.x-h,l-r.y-m,p+2*h,q+2*m);g.focus=new O(r.x+h,r.y+m)}a.network=d;return c}function iu(a,b,c){v&&(D.l(b,vt,lt,"popNetwork:oldnet"),D.p(c,lt,"popNetwork:level"));for(c=a.network.vertexes.j;c.next();){var d=c.value;d.network=b;if(null!==d.Uh){var e=d.Uh.ea(d.xB);d.og=e.Py;var g=e.dC,h=e.eC;d.sb=new B(d.na-g,d.va-h,e.Qy,e.Oy);d.focus=new O(g,h);d.xB--}}for(c=a.network.edges.j;c.next();)c.value.network=b;a.network=b} -function ku(a,b,c){v&&(D.l(b,ju,lt,"surroundNode:oldnet"),D.p(c,lt,"surroundNode:level"));var d=b.Gn;if(null!==d&&0!==d.count){c=b.na;var e=b.va,g=b.width,h=b.height;null!==b.Uh&&0=p.og?l++:(k=!0,m++,h+=Math.atan2(b.va-p.va,b.na-p.na))}if(0!==l)for(0>1)+m)*(0===k%2?1:-1);l.na=c+n*Math.cos(p);l.va=e+n*Math.sin(p);k++}}} -function du(a,b,c,d,e,g,h){var k=9E19,l=-1,m=0;a:for(;mn.y&&a[q].x-n.xn.x&&a[q].y-n.yl+h?(d=d+g-k,e=e-l-h,te(d*d+e*e)):e+ck+m?e>l+h?(d=d-k-m,e=e-l-h,te(d*d+e*e)):e+cl+h?e-(l+h):e+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.na,e=d,g=c.va,h=g,c=1;ch-g)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.na-b.na}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.va-b.va});for(var h=a.di,m=0,n=0,p=0,c=0;ch||p-d>h){if(g)break}else if(l-r>h||r-l>h){if(!g)break}else{var s=mu(k,e);1>s?(n=a.ty,null===n&&(a.ty=n=new Ia(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.R.right-k.R.x),n=(1+n)*m):dr?(p=Math.abs(e.R.bottom-k.R.y),p=(1+p)*s):ds?(n=a.ty,null===n&&(a.ty=n=new Ia(0)),m=n.random(),s= -n.random(),n=(d>p?1:-1)*(1+(e.width>k.width?e.width:k.width))*m,p=(l>r?1:-1)*(1+(e.height>k.height?e.height:k.height))*s):(m=g.stiffness*(s-g.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=Math.max(a.di/20,50);for(e=0;ed&&(g=d),h<-d?h=-d:h>d&&(h=d),k.na+=g,k.va+=h,c=Math.max(c,g*g+h*h));return c>a.jF*a.jF}lt.prototype.moveFixedVertex=function(){}; -lt.prototype.commitLayout=function(){this.EB();this.commitNodes();this.zu&&this.commitLinks()};lt.prototype.EB=function(){if(this.Rq)for(var a=this.network.edges.j;a.next();){var b=a.value.link;null!==b&&(b.Gb=Tc,b.Hb=Tc)}};lt.prototype.commitNodes=function(){var a=0,b=0;if(this.RH){var c=D.Nf();this.Kh(this.network,c);b=this.Ae;a=b.x-c.x;b=b.y-c.y;D.Mb(c)}for(var c=D.Nf(),d=this.network.vertexes.j;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.sb),c.x+=a,c.y+=b,e.sb=c;e.commit()}D.Mb(c)}; -lt.prototype.commitLinks=function(){for(var a=this.network.edges.j;a.next();)a.value.commit()};lt.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Vo:a};lt.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Uo:a};lt.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.So:a};lt.prototype.electricalFieldX=function(){return 0};lt.prototype.electricalFieldY=function(){return 0}; -lt.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.To:a};lt.prototype.gravitationalFieldX=function(){return 0};lt.prototype.gravitationalFieldY=function(){return 0};lt.prototype.isFixed=function(a){return a.isFixed};D.w(lt,{gL:"currentIteration"},function(){return this.os});D.defineProperty(lt,{IE:"arrangementSpacing"},function(){return this.sg},function(a){D.l(a,Ca,lt,"arrangementSpacing");this.sg.O(a)||(this.sg.assign(a),this.N())}); -D.defineProperty(lt,{RH:"arrangesToOrigin"},function(){return this.hr},function(a){this.hr!==a&&(D.h(a,"boolean",lt,"arrangesToOrigin"),this.hr=a,this.N())});D.defineProperty(lt,{Rq:"setsPortSpots"},function(){return this.pi},function(a){this.pi!==a&&(D.h(a,"boolean",lt,"setsPortSpots"),this.pi=a,this.N())});D.defineProperty(lt,{comments:"comments"},function(){return this.Yh},function(a){this.Yh!==a&&(D.h(a,"boolean",lt,"comments"),this.Yh=a,this.N())}); -D.defineProperty(lt,{fB:"maxIterations"},function(){return this.zp},function(a){this.zp!==a&&(D.h(a,"number",lt,"maxIterations"),0<=a&&(this.zp=a,this.N()))});D.defineProperty(lt,{jF:"epsilonDistance"},function(){return this.Rr},function(a){this.Rr!==a&&(D.h(a,"number",lt,"epsilonDistance"),0b.toVertex.index&&(a.zy(b),b.rev=!0);break;case qu:for(d=this.network.vertexes.j;d.next();)a=d.value,a.lq=-1,a.finish=-1;for(a=this.network.edges.j;a.next();)a.value.forest=!1;this.Ks=0;for(d.reset();d.next();)b=d.value,0===b.sc.count&&Au(this,b);for(d.reset();d.next();)b=d.value,-1===b.lq&&Au(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,g=e.finish,e.lqu&&0u&&0d[this.Uf]&&(this.ow=d[b]-1,this.Uf=b),d[b]h)for(var p=h+1;pn;p--)l=d[p],l.near===m&&l.Dn===m.Dn||k++;var m=0,q,r=q=p=l=0,s,u=0,t=0;s=0;var y;if(0<=c)for(n=d[h].Ve,m=0;mq||q===l||(s=q>l?q-l:l-q,p+=qh-s?1:-1);b.splice(0>p?l:l+1,0,m);c.splice(k,1);k--}else g=!1;if(g)break;else b.push(c[0]),c.splice(0,1)}for(g=0;g=a?a:360,this.N())}); +D.defineProperty(Is,{ag:"arrangement"},function(){return this.xd},function(a){this.xd!==a&&(D.Da(a,Is,Is,"arrangement"),a===Xs||a===Js||a===Ws||a===Vs)&&(this.xd=a,this.N())});D.defineProperty(Is,{direction:"direction"},function(){return this.fa},function(a){this.fa!==a&&(D.Da(a,Is,Is,"direction"),a===Ls||a===Us||a===Ss||a===Ts)&&(this.fa=a,this.N())}); +D.defineProperty(Is,{sorting:"sorting"},function(){return this.ri},function(a){this.ri!==a&&(D.Da(a,Is,Is,"sorting"),a===Qs||a===Rs||a===Os||Ps||a===Ms)&&(this.ri=a,this.N())});D.defineProperty(Is,{comparer:"comparer"},function(){return this.$h},function(a){this.$h!==a&&(D.h(a,"function",Is,"comparer"),this.$h=a,this.N())});D.defineProperty(Is,{spacing:"spacing"},function(){return this.si},function(a){this.si!==a&&(D.h(a,"number",Is,"spacing"),this.si=a,this.N())}); +D.defineProperty(Is,{iy:"nodeDiameterFormula"},function(){return this.Ns},function(a){this.Ns!==a&&(D.Da(a,Is,Is,"nodeDiameterFormula"),a===Ns||a===Ys)&&(this.Ns=a,this.N())});D.w(Is,{LH:"actualXRadius"},function(){return this.fe});D.w(Is,{MH:"actualYRadius"},function(){return this.Tg});D.w(Is,{GK:"actualSpacing"},function(){return this.vl});D.w(Is,{KH:"actualCenter"},function(){return isNaN(this.Ae.x)||isNaN(this.Ae.y)?new O(0,0):new O(this.Ae.x+this.LH,this.Ae.y+this.MH)});var Js; +Is.ConstantSpacing=Js=D.s(Is,"ConstantSpacing",0);var Ws;Is.ConstantDistance=Ws=D.s(Is,"ConstantDistance",1);var Vs;Is.ConstantAngle=Vs=D.s(Is,"ConstantAngle",2);var Xs;Is.Packed=Xs=D.s(Is,"Packed",3);var Ls;Is.Clockwise=Ls=D.s(Is,"Clockwise",4);var Us;Is.Counterclockwise=Us=D.s(Is,"Counterclockwise",5);var Ss;Is.BidirectionalLeft=Ss=D.s(Is,"BidirectionalLeft",6);var Ts;Is.BidirectionalRight=Ts=D.s(Is,"BidirectionalRight",7);var Qs;Is.Forwards=Qs=D.s(Is,"Forwards",8);var Rs; +Is.Reverse=Rs=D.s(Is,"Reverse",9);var Os;Is.Ascending=Os=D.s(Is,"Ascending",10);var Ps;Is.Descending=Ps=D.s(Is,"Descending",11);var Ms;Is.Optimized=Ms=D.s(Is,"Optimized",12);var Ns;Is.Pythagorean=Ns=D.s(Is,"Pythagorean",13);var Ys;Is.Circular=Ys=D.s(Is,"Circular",14);function Ks(){this.pq=-Infinity;this.Wq=this.Co=null} +Ks.prototype.compare=function(a,b){if(0this.pq||Math.abs(a)a&&0g?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new O(n.x+n.width+d.width,n.y),l[1]=new O(n.x,n.y+n.height+d.height),g=2):(p=eu(l,g, +e,k,n.width,n.height,d),q=l[p],r=new O(q.x+n.width+d.width,q.y),s=new O(q.x,q.y+n.height+d.height),p+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().mb,d=this.network.vertexes.j;d.next();){if(d.value.mb.fg(c)&&(a++,2a.network.vertexes.count)return!1;null===a.Sg?a.Sg=new K(ku):a.Sg.clear();a.Sg.Sc(a.network.vertexes);var c=a.Sg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.pg-a.pg});for(var d=c.count-1;0<=d&&1>=c.ea(d).pg;)d--;return 1=h))){for(var m=0,n=0,p=l.count-h;ps&&(s=1);m=qe((m+s+n*n*4/(h*h))/s);h=(m-1)*p/2;m=(m-1)*q/2;g.mb=new B(k-r.x-h,l-r.y-m,p+2*h,q+2*m);g.focus=new O(r.x+h,r.y+m)}a.network=d;return c}function ju(a,b,c){v&&(D.l(b,cu,vt,"popNetwork:oldnet"),D.p(c,vt,"popNetwork:level"));for(c=a.network.vertexes.j;c.next();){var d=c.value;d.network=b;if(null!==d.Vh){var e=d.Vh.ea(d.BB);d.pg=e.Oy;var g=e.hC,h=e.iC;d.mb=new B(d.oa-g,d.va-h,e.Py,e.Ny);d.focus=new O(g,h);d.BB--}}for(c=a.network.edges.j;c.next();)c.value.network=b;a.network=b} +function lu(a,b,c){v&&(D.l(b,ku,vt,"surroundNode:oldnet"),D.p(c,vt,"surroundNode:level"));var d=b.In;if(null!==d&&0!==d.count){c=b.oa;var e=b.va,g=b.width,h=b.height;null!==b.Vh&&0=p.pg?l++:(k=!0,m++,h+=Math.atan2(b.va-p.va,b.oa-p.oa))}if(0!==l)for(0>1)+m)*(0===k%2?1:-1);l.oa=c+n*Math.cos(p);l.va=e+n*Math.sin(p);k++}}} +function eu(a,b,c,d,e,g,h){var k=9E19,l=-1,m=0;a:for(;mn.y&&a[q].x-n.xn.x&&a[q].y-n.yl+h?(d=d+g-k,e=e-l-h,qe(d*d+e*e)):e+ck+m?e>l+h?(d=d-k-m,e=e-l-h,qe(d*d+e*e)):e+cl+h?e-(l+h):e+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.oa,e=d,g=c.va,h=g,c=1;ch-g)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.oa-b.oa}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.va-b.va});for(var h=a.ei,m=0,n=0,p=0,c=0;ch||p-d>h){if(g)break}else if(l-r>h||r-l>h){if(!g)break}else{var s=nu(k,e);1>s?(n=a.sy,null===n&&(a.sy=n=new Ia(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.R.right-k.R.x),n=(1+n)*m):dr?(p=Math.abs(e.R.bottom-k.R.y),p=(1+p)*s):ds?(n=a.sy,null===n&&(a.sy=n=new Ia(0)),m=n.random(),s= +n.random(),n=(d>p?1:-1)*(1+(e.width>k.width?e.width:k.width))*m,p=(l>r?1:-1)*(1+(e.height>k.height?e.height:k.height))*s):(m=g.stiffness*(s-g.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=Math.max(a.ei/20,50);for(e=0;ed&&(g=d),h<-d?h=-d:h>d&&(h=d),k.oa+=g,k.va+=h,c=Math.max(c,g*g+h*h));return c>a.mF*a.mF}vt.prototype.moveFixedVertex=function(){}; +vt.prototype.commitLayout=function(){this.IB();this.commitNodes();this.yu&&this.commitLinks()};vt.prototype.IB=function(){if(this.Qq)for(var a=this.network.edges.j;a.next();){var b=a.value.link;null!==b&&(b.Gb=Vc,b.Hb=Vc)}};vt.prototype.commitNodes=function(){var a=0,b=0;if(this.UH){var c=D.Of();this.Kh(this.network,c);b=this.Ae;a=b.x-c.x;b=b.y-c.y;D.Kb(c)}for(var c=D.Of(),d=this.network.vertexes.j;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.mb),c.x+=a,c.y+=b,e.mb=c;e.commit()}D.Kb(c)}; +vt.prototype.commitLinks=function(){for(var a=this.network.edges.j;a.next();)a.value.commit()};vt.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Xo:a};vt.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Wo:a};vt.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Uo:a};vt.prototype.electricalFieldX=function(){return 0};vt.prototype.electricalFieldY=function(){return 0}; +vt.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Vo:a};vt.prototype.gravitationalFieldX=function(){return 0};vt.prototype.gravitationalFieldY=function(){return 0};vt.prototype.isFixed=function(a){return a.isFixed};D.w(vt,{jL:"currentIteration"},function(){return this.ns});D.defineProperty(vt,{LE:"arrangementSpacing"},function(){return this.ug},function(a){D.l(a,Ca,vt,"arrangementSpacing");this.ug.P(a)||(this.ug.assign(a),this.N())}); +D.defineProperty(vt,{UH:"arrangesToOrigin"},function(){return this.gr},function(a){this.gr!==a&&(D.h(a,"boolean",vt,"arrangesToOrigin"),this.gr=a,this.N())});D.defineProperty(vt,{Qq:"setsPortSpots"},function(){return this.qi},function(a){this.qi!==a&&(D.h(a,"boolean",vt,"setsPortSpots"),this.qi=a,this.N())});D.defineProperty(vt,{comments:"comments"},function(){return this.Zh},function(a){this.Zh!==a&&(D.h(a,"boolean",vt,"comments"),this.Zh=a,this.N())}); +D.defineProperty(vt,{jB:"maxIterations"},function(){return this.Bp},function(a){this.Bp!==a&&(D.h(a,"number",vt,"maxIterations"),0<=a&&(this.Bp=a,this.N()))});D.defineProperty(vt,{mF:"epsilonDistance"},function(){return this.Qr},function(a){this.Qr!==a&&(D.h(a,"number",vt,"epsilonDistance"),0b.toVertex.index&&(a.yy(b),b.rev=!0);break;case ru:for(d=this.network.vertexes.j;d.next();)a=d.value,a.kq=-1,a.finish=-1;for(a=this.network.edges.j;a.next();)a.value.forest=!1;this.Js=0;for(d.reset();d.next();)b=d.value,0===b.tc.count&&Bu(this,b);for(d.reset();d.next();)b=d.value,-1===b.kq&&Bu(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,g=e.finish,e.kqu&&0u&&0d[this.Vf]&&(this.ow=d[b]-1,this.Vf=b),d[b]h)for(var p=h+1;pn;p--)l=d[p],l.near===m&&l.Dn===m.Dn||k++;var m=0,q,r=q=p=l=0,s,u=0,t=0;s=0;var y;if(0<=c)for(n=d[h].Ve,m=0;mu||l===u&&q>s)&&k++,tl||u===l&&s>q)&&k++);if(0>=c)for(n=d[h].Pe,m=0;mu||l===u&&p>t)&&k++, sl||u===l&&t>p)&&k++);g[h*e+h]=k;for(n=h+1;n=c)for(k=d[h].Pe,y=d[n].Pe,m=0;m=c&&(l=k.Ve);var m=null;0<=c&&(m=k.Pe);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q=c&&(l=k.Ve);var m=null;0<=c&&(m=k.Pe);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q>1,g[h]=0!==(n&1)?p[m]:p[m-1]+p[m]>>1)}Eu(a,b,d);return g}function Mu(a,b,c,d,e,g){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.pc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Mu(a,m,c,d,e,g)}if(g)for(l=b.sc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Mu(a,m,c,d,e,g)}} -function Nu(a,b,c,d,e,g){if(b.component===d){b.component=c;if(e)for(var h=b.pc;h.next();)Nu(a,h.value.toVertex,c,d,e,g);if(g)for(b=b.sc;b.next();)Nu(a,b.value.fromVertex,c,d,e,g)}}function xu(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid)return b}return null}function yu(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.pc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null} -function zu(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.sc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function Au(a,b){b.lq=a.Ks;a.Ks++;for(var c=b.pc;c.next();){var d=c.value,e=d.toVertex;-1===e.lq&&(d.forest=!0,Au(a,e))}b.finish=a.Ks;a.Ks++} -pu.prototype.assignLayers=function(){switch(this.vp){case Ou:Pu(this);break;case Qu:for(var a=0,b=this.network.vertexes.j;b.next();)a=Ru(this,b.value),this.yb=Math.max(a,this.yb);for(b.reset();b.next();)a=b.value,a.layer=this.yb-a.layer;break;default:case ru:Pu(this);for(b=this.network.vertexes.j;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.sc.count&&Su(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.yb=-1;for(b.reset();b.next();){var c=b.value;c.layer-= -a;this.yb=Math.max(this.yb,c.layer)}}};function Pu(a){for(var b=a.network.vertexes.j;b.next();){var c=Tu(a,b.value);a.yb=Math.max(c,a.yb)}}function Tu(a,b){var c=0;if(-1===b.layer){for(var d=b.pc;d.next();)var e=d.value,g=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Tu(a,g)+e);b.layer=c}else c=b.layer;return c}function Ru(a,b){var c=0;if(-1===b.layer){for(var d=b.sc;d.next();)var e=d.value,g=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Ru(a,g)+e);b.layer=c}else c=b.layer;return c} -function Su(a,b){if(!b.valid){b.valid=!0;for(var c=b.pc;c.next();)Su(a,c.value.toVertex);for(c=a.network.vertexes.j;c.next();)c.value.component=-1;for(var d=b.Ve.o,e=d.length,g=0;gh&&Mu(a,k,0,-1,!0,!1)}for(Mu(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.j;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Ve.o,e=s.length,g=0;g=c&&(l=k.Ve);var m=null;0<=c&&(m=k.Pe);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q=c&&(l=k.Ve);var m=null;0<=c&&(m=k.Pe);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q>1,g[h]=0!==(n&1)?p[m]:p[m-1]+p[m]>>1)}Fu(a,b,d);return g}function Nu(a,b,c,d,e,g){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.qc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Nu(a,m,c,d,e,g)}if(g)for(l=b.tc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Nu(a,m,c,d,e,g)}} +function Ou(a,b,c,d,e,g){if(b.component===d){b.component=c;if(e)for(var h=b.qc;h.next();)Ou(a,h.value.toVertex,c,d,e,g);if(g)for(b=b.tc;b.next();)Ou(a,b.value.fromVertex,c,d,e,g)}}function yu(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid)return b}return null}function zu(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.qc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null} +function Au(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.tc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function Bu(a,b){b.kq=a.Js;a.Js++;for(var c=b.qc;c.next();){var d=c.value,e=d.toVertex;-1===e.kq&&(d.forest=!0,Bu(a,e))}b.finish=a.Js;a.Js++} +qu.prototype.assignLayers=function(){switch(this.xp){case Pu:Qu(this);break;case Ru:for(var a=0,b=this.network.vertexes.j;b.next();)a=Su(this,b.value),this.yb=Math.max(a,this.yb);for(b.reset();b.next();)a=b.value,a.layer=this.yb-a.layer;break;default:case su:Qu(this);for(b=this.network.vertexes.j;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.tc.count&&Tu(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.yb=-1;for(b.reset();b.next();){var c=b.value;c.layer-= +a;this.yb=Math.max(this.yb,c.layer)}}};function Qu(a){for(var b=a.network.vertexes.j;b.next();){var c=Uu(a,b.value);a.yb=Math.max(c,a.yb)}}function Uu(a,b){var c=0;if(-1===b.layer){for(var d=b.qc;d.next();)var e=d.value,g=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Uu(a,g)+e);b.layer=c}else c=b.layer;return c}function Su(a,b){var c=0;if(-1===b.layer){for(var d=b.tc;d.next();)var e=d.value,g=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Su(a,g)+e);b.layer=c}else c=b.layer;return c} +function Tu(a,b){if(!b.valid){b.valid=!0;for(var c=b.qc;c.next();)Tu(a,c.value.toVertex);for(c=a.network.vertexes.j;c.next();)c.value.component=-1;for(var d=b.Ve.o,e=d.length,g=0;gh&&Nu(a,k,0,-1,!0,!1)}for(Nu(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.j;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Ve.o,e=s.length,g=0;gd)&&!n&&(h=l,d=m)}if(0>g){for(c.reset();c.next();)g=c.value,1===g.component&&(g.layer-=e);b.component=0}else h.component=0}}} -function Cu(a,b,c){return 90===a.fa?c&&!b.rev||!c&&b.rev?270:90:180===a.fa?c&&!b.rev||!c&&b.rev?0:180:270===a.fa?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} -pu.prototype.initializeIndices=function(){switch(this.jp){default:case Uu:for(var a=this.network.vertexes.j;a.next();){var b=a.value,c=b.layer;b.index=this.se[c];this.se[c]++}break;case su:a=this.network.vertexes.j;for(b=this.yb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Vu(this,c);break;case Wu:for(a=this.network.vertexes.j,b=0;b<=this.yb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Xu(this,c)}}; -function Vu(a,b){var c=b.layer;b.index=a.se[c];a.se[c]++;for(var c=b.Pe.lc(),d=!0;d;)for(var d=!1,e=0;eh.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;eh.portToColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e=h;d--)g=Zu(this,d,-1)||g;e=this.countCrossings();e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Zu(this,d,1)||g;e=this.countCrossings();e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Zu(this,d,1)||g;e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1, -d=h;d<=c;d++)g=Zu(this,d,-1)||g;e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Zu(this,d,0)||g;e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Zu(this,d,0)||g;e>=a?Hu(this,b):(a=e,b=Gu(this))}break;default:case tu:for(c=this.yb,h=0,k=a+1;(d=this.countCrossings())=h;d--)g=Zu(this,d,-1)||g;e=this.countCrossings();e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Zu(this,d,1)||g;e=this.countCrossings(); -e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Zu(this,d,1)||g;e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Zu(this,d,-1)||g;e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Zu(this,d,0)||g;e>=a?Hu(this,b):(a=e,b=Gu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Zu(this,d,0)||g;e>=a?Hu(this,b):(a=e,b=Gu(this))}}Hu(this,b)}; -function Yu(a,b,c){v&&(D.p(b,pu,"medianBarycenterCrossingReduction:unfixedLayer"),D.p(c,pu,"medianBarycenterCrossingReduction:direction"));var d=0,e=Du(a,b),g=a.se[b],h=Lu(a,b,c);c=Ku(a,b,c);for(d=0;dg+1&&(q+=4*(w-g),r+=4*(w-(g+1)))}A=d[g].pc.j;for(A.reset();A.next();)if(w=A.value,C=w.toVertex,w.valid&&C.layer===b){for(w=0;d[w]!==C;)w++;w===g+1&&(r+=1)}A=d[g+1].sc.j;for(A.reset();A.next();)if(w=A.value,C=w.fromVertex,w.valid&&C.layer===b){for(w=0;d[w]!==C;)w++;wg+1&&(q+=4*(w-(g+1)),r+=4*(w-g))}A=d[g+1].pc.j;for(A.reset();A.next();)if(w=A.value,C=w.toVertex,w.valid&& -C.layer===b){for(w=0;d[w]!==C;)w++;w===g&&(q+=1)}var w=C=0,A=h[d[g].index],N=k[d[g].index],H=h[d[g+1].index],W=k[d[g+1].index];-1!==A&&(C+=Math.abs(A-s),w+=Math.abs(A-y));-1!==N&&(C+=Math.abs(N-s),w+=Math.abs(N-y));-1!==H&&(C+=Math.abs(H-u),w+=Math.abs(H-t));-1!==W&&(C+=Math.abs(W-u),w+=Math.abs(W-t));if(r>1)+8*d;this.Pb*=8}if(0!==(this.oj&cv))for(b=!0;b;){b=!1;for(a=this.Uf+1;a<=this.yb;a++)b=dv(this,a,1)||b; -for(a=this.Uf-1;0<=a;a--)b=dv(this,a,-1)||b;b=dv(this,this.Uf,0)||b}if(0!==(this.oj&ev)){for(a=this.Uf+1;a<=this.yb;a++)fv(this,a,1);for(a=this.Uf-1;0<=a;a--)fv(this,a,-1);fv(this,this.Uf,0)}c&&(gv(this,-1),gv(this,1));if(0!==(this.oj&cv))for(b=!0;b;){b=!1;b=dv(this,this.Uf,0)||b;for(a=this.Uf+1;a<=this.yb;a++)b=dv(this,a,0)||b;for(a=this.Uf-1;0<=a;a--)b=dv(this,a,0)||b}}; -function dv(a,b,c){v&&(D.p(b,pu,"bendStraighten:unfixedLayer"),D.p(c,pu,"bendStraighten:direction"));for(var d=!1;hv(a,b,c);)d=!0;return d} -function hv(a,b,c){v&&(D.p(b,pu,"shiftbendStraighten:unfixedLayer"),D.p(c,pu,"shiftbendStraighten:direction"));var d=0,e=Du(a,b),g=a.se[b],h=Ku(a,b,-1);if(0c)for(d=0;dd-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=g||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q= -0,u=0,t=0,y=0,w=0;if(0>=c)for(var C=e[d].sc.j;C.next();){var w=C.value,A=w.fromVertex;w.valid&&A.layer!==b&&(t=Fu(w),y=w.portFromColOffset,w=w.portToColOffset,A=A.column,q+=(Math.abs(n+w-(A+y))+1)*t,s+=(Math.abs(r+w-(A+y))+1)*t,u+=(Math.abs(p+w-(A+y))+1)*t)}if(0<=c)for(C=e[d].pc.j;C.next();)w=C.value,A=w.toVertex,w.valid&&A.layer!==b&&(t=Fu(w),y=w.portFromColOffset,w=w.portToColOffset,A=A.column,q+=(Math.abs(n+y-(A+w))+1)*t,s+=(Math.abs(r+y-(A+w))+1)*t,u+=(Math.abs(p+y-(A+w))+1)*t);w=y=t=0;C=h[e[d].index]; -A=k[e[d].index];-1!==C&&(t+=Math.abs(C-n),y+=Math.abs(C-r),w+=Math.abs(C-p));-1!==A&&(t+=Math.abs(A-n),y+=Math.abs(A-r),w+=Math.abs(A-p));if(s=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}Eu(a,b,e);a.normalize()} -function iv(a,b){v&&(D.p(b,pu,"packAux:column"),D.p(1,pu,"packAux:direction"));for(var c=!0,d=a.network.vertexes.j;d.next();){var e=d.value,g=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-g<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e} -function jv(a,b){v&&(D.p(b,pu,"tightPackAux:column"),D.p(1,pu,"tightPackAux:direction"));for(var c=b,c=b+1,d=0,e=[],g=[],d=0;d<=a.yb;d++)e[d]=!1,g[d]=!1;for(var h=a.network.vertexes.j;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(g[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.yb;d++)k=k&&!(e[d]&&g[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c} -function gv(a,b){v&&D.p(b,pu,"componentPack:direction");for(var c=0;c<=a.Pb;c++)for(;iv(a,c););a.normalize();for(c=0;ce?Hu(a,d):hb)for(c=a.Pb;0<=c;c--)for(d=Gu(a),e=Ju(a),g=e+1;ee?Hu(a,d):hc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Hg);a.Hg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Nu(a,b,a.Hg,-1,!0,!0),a.Hg++);var g=0;b=[];for(g=0;gc)for(k=a.Pb;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} -pu.prototype.commitLayout=function(){if(this.Rq)for(var a=Bu(this,!0),b=Bu(this,!1),c=this.network.edges.j;c.next();){var d=c.value.link;null!==d&&(d.Gb=a,d.Hb=b)}this.commitNodes();this.sA();this.zu&&this.commitLinks()};function Bu(a,b){return 270===a.fa?b?Yc:gd:90===a.fa?b?gd:Yc:180===a.fa?b?ed:fd:b?fd:ed} -pu.prototype.commitNodes=function(){this.Fg=[];this.Tf=[];this.Sf=[];this.Ub=[];for(var a=0;a<=this.yb;a++)this.Fg[a]=0,this.Tf[a]=0,this.Sf[a]=0,this.Ub[a]=0;for(a=this.network.vertexes.j;a.next();){var b=a.value,c=b.layer;this.Fg[c]=Math.max(this.Fg[c],this.nodeMinLayerSpace(b,!0));this.Tf[c]=Math.max(this.Tf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.Zm,c=0;c<=this.yb;c++){var e=d;0>=this.Fg[c]+this.Tf[c]&&(e=0);0=m.R.bottom?(Fa=m.R.y+m.R.height,b.B(U++,sa,Fa+ib),b.B(U++,sa,Fa),b.B(U++,sa,Fa-nb)):(b.B(U++,sa,pa+ib),b.B(U++, -sa,pa),b.B(U++,sa,pa-nb)):270===this.fa?pa<=m.R.y?(Fa=m.R.y,b.B(U++,sa,Fa-nb),b.B(U++,sa,Fa),b.B(U++,sa,Fa+ib)):(b.B(U++,sa,pa-nb),b.B(U++,sa,pa),b.B(U++,sa,pa+ib)):0===this.fa&&(sa>=m.R.right?(Fa=m.R.x+m.R.width,b.B(U++,Fa+ib,pa),b.B(U++,Fa,pa),b.B(U++,Fa-nb,pa)):(b.B(U++,sa+ib,pa),b.B(U++,sa,pa),b.B(U++,sa-nb,pa)));else{b.B(U++,Za,pb);var de=0;if(180===this.fa||0===this.fa){if(180===this.fa?sa>=m.R.right:sa<=m.R.x)de=(0===this.fa?-nb:ib)/2;b.B(U++,Za+de,pa)}else{if(270===this.fa?pa>=m.R.bottom: -pa<=m.R.y)de=(90===this.fa?-nb:ib)/2;b.B(U++,sa,pb+de)}b.B(U++,sa,pa)}else nb=Math.max(10,this.Fg[ua.layer]),ib=Math.max(10,this.Tf[ua.layer]),180===this.fa?(S&&b.B(U++,sa-nb,pa),b.B(U++,sa,pa),S&&b.B(U++,sa+ib,pa)):90===this.fa?(S&&b.B(U++,sa,pa+ib),b.B(U++,sa,pa),S&&b.B(U++,sa,pa-nb)):270===this.fa?(S&&b.B(U++,sa,pa-nb),b.B(U++,sa,pa),S&&b.B(U++,sa,pa+ib)):(S&&b.B(U++,sa+ib,pa),b.B(U++,sa,pa),S&&b.B(U++,sa-nb,pa));m=ua}if(null===k||b.computeSpot(!1)!==bc||ba)if(Za=b.n(U-1).x,pb=b.n(U-1).y,sa=b.n(U).x, -pa=b.n(U).y,ba){var sd=this.Tf[l.layer],vc=0;180===this.fa||0===this.fa?(vc=pb,vc>=l.R.y&&vc<=l.R.bottom&&(180===this.fa?sa>=l.R.x:sa<=l.R.right)&&(Fa=l.na+(180===this.fa?-sd:sd),vc=vc=l.R.x&&vc<=l.R.right&&(270===this.fa?pa>=l.R.y:pa<=l.R.bottom)&&(Fa=l.va+(270===this.fa?-sd:sd),vc=vc=l.R.x?(Fa=l.R.x+l.R.width,b.ia(U-2,Fa,pb),b.ia(U-1,Fa+ib,pb)):90===this.fa&&pa<=l.R.bottom?(Fa=l.R.y,b.ia(U-2,Za,Fa),b.ia(U-1,Za,Fa-nb)):270===this.fa&&pa>=l.R.y?(Fa=l.R.y+l.R.height,b.ia(U-2,Za,Fa),b.ia(U-1,Za,Fa+ib)):0===this.fa&&sa<=l.R.right&&(Fa=l.R.x,b.ia(U-2,Fa,pb),b.ia(U-1,Fa-nb,pb));else{nb=Math.max(10,this.Fg[l.layer]);ib=Math.max(10,this.Tf[l.layer]);de=0;if(180===this.fa||0=== -this.fa){if(180===this.fa?sa<=l.R.x:sa>=l.R.right)de=(0===this.fa?ib:-nb)/2;b.B(U++,sa+de,pb)}else{if(270===this.fa?pa<=l.R.y:pa>=l.R.bottom)de=(90===this.fa?ib:-nb)/2;b.B(U++,Za,pa+de)}b.B(U++,sa,pa)}}else{for(;null!==l&&l!==m;){Oa=ua=null;for(var Bg=l.pc.j;Bg.next();){var Ff=Bg.value;if(Ff.link===c.link&&(ua=Ff.toVertex,Oa=Ff.fromVertex,null!==Oa.Bd&&(Oa=null),null===ua.Bd))break}var Za=0,pb=0,sa=0,pa=0,mb=0,nb=0,ib=0;if(ua!==m)if(Za=b.n(U-1).x,pb=b.n(U-1).y,sa=ua.na,pa=ua.va,ba)if(180===this.fa|| -0===this.fa){var ve=null!==Oa?Oa.va:pb;ve!==pa&&(mb=this.Ub[ua.layer],2===U&&(mb=0===this.fa?Math.max(mb,Za):Math.min(mb,Za)),b.B(U++,mb,pb),b.B(U++,mb,pa))}else{var Id=null!==Oa?Oa.na:Za;Id!==sa&&(mb=this.Ub[ua.layer],2===U&&(mb=90===this.fa?Math.max(mb,pb):Math.min(mb,pb)),b.B(U++,Za,mb),b.B(U++,sa,mb))}else nb=Math.max(10,this.Fg[ua.layer]),ib=Math.max(10,this.Tf[ua.layer]),180===this.fa?(b.B(U++,sa+ib,pa),S&&b.B(U++,sa,pa),b.B(U++,sa-nb,pa)):90===this.fa?(b.B(U++,sa,pa-nb),S&&b.B(U++,sa,pa),b.B(U++, -sa,pa+ib)):270===this.fa?(b.B(U++,sa,pa+ib),S&&b.B(U++,sa,pa),b.B(U++,sa,pa-nb)):(b.B(U++,sa-nb,pa),S&&b.B(U++,sa,pa),b.B(U++,sa+ib,pa));l=ua}ba&&(Za=b.n(U-1).x,pb=b.n(U-1).y,sa=b.n(U).x,pa=b.n(U).y,180===this.fa||0===this.fa?pb!==pa&&(mb=0===this.fa?Math.min(Math.max((sa+Za)/2,this.Ub[m.layer]),sa):Math.max(Math.min((sa+Za)/2,this.Ub[m.layer]),sa),b.B(U++,mb,pb),b.B(U++,mb,pa)):Za!==sa&&(mb=90===this.fa?Math.min(Math.max((pa+pb)/2,this.Ub[m.layer]),pa):Math.max(Math.min((pa+pb)/2,this.Ub[m.layer]), -pa),b.B(U++,Za,mb),b.B(U++,sa,mb)))}if(null!==d&&S){if(null!==h){if(b.computeSpot(!0)===bc){var zb=b.n(0),Oe=b.n(2);zb.O(Oe)||b.ia(1,(zb.x+Oe.x)/2,(zb.y+Oe.y)/2)}fa=b.getLinkPoint(e,h,bc,!0,!1,g,k);fa.F()||fa.set(e.$.bm);b.ia(0,fa.x,fa.y)}null!==k&&(b.computeSpot(!1)===bc&&(zb=b.n(b.ta-1),Oe=b.n(b.ta-3),zb.O(Oe)||b.ia(b.ta-2,(zb.x+Oe.x)/2,(zb.y+Oe.y)/2)),fa=b.getLinkPoint(g,k,bc,!1,!1,e,h),fa.F()||fa.set(g.$.bm),b.ia(b.ta-1,fa.x,fa.y))}b.Aj();c.commit()}}}for(var jd=new K(J),eg=this.network.edges.j;eg.next();){var Gf= -eg.value.link;null!==Gf&&Gf.qc&&!jd.contains(Gf)&&jd.add(Gf)}if(0hc.y&&(Hf=Nc.y>hc.y?0:Zc.x -Mb.x&&(ub=ai.x>Mb.x?0:Oc.yb.layer?1:a.efb.ef?1:a.Ceb.Ce?1:0:0};pu.prototype.JG=function(a,b){return a instanceof lv&&b instanceof lv&&a!==b?a.firstb.first||a.Jib.Ji||a.efb.ef?1:a.Ceb.Ce?1:0:0}; -pu.prototype.By=function(a,b){return a instanceof lv&&b instanceof lv&&a!==b?a.peb.pe||a.Jib.Ji||a.efb.ef?1:a.Ceb.Ce?1:0:0};function mv(a,b){v&&(D.p(a,pu,"isApprox:a"),D.p(b,pu,"isApprox:b"));var c=a-b;return-1c}function nv(a,b,c,d){v&&(D.p(a,pu,"isUnoccupied2:px"),D.p(b,pu,"isUnoccupied2:py"),D.p(c,pu,"isUnoccupied2:qx"),D.p(d,pu,"isUnoccupied2:qy"));return!0} -function Du(a,b){var c,d=a.se[b];if(d>=a.xh.length){c=[];for(var e=0;ea&&(this.oj=a,this.N()))});D.defineProperty(pu,{Rq:"setsPortSpots"},function(){return this.pi},function(a){this.pi!==a&&(D.h(a,"boolean",pu,"setsPortSpots"),this.pi=a,this.N())});D.defineProperty(pu,{aG:"linkSpacing"},function(){return this.ts},function(a){this.ts!==a&&(D.h(a,"number",pu,"linkSpacing"),0<=a&&(this.ts=a,this.N()))});D.w(pu,{yJ:"maxLayer"},function(){return this.yb}); -D.w(pu,{RL:"maxIndex"},function(){return this.ow});D.w(pu,{QL:"maxColumn"},function(){return this.Pb});D.w(pu,{WL:"minIndexLayer"},function(){return this.Cs});D.w(pu,{SL:"maxIndexLayer"},function(){return this.Uf});var qu;pu.CycleDepthFirst=qu=D.s(pu,"CycleDepthFirst",0);var wu;pu.CycleGreedy=wu=D.s(pu,"CycleGreedy",1);var ru;pu.LayerOptimalLinkLength=ru=D.s(pu,"LayerOptimalLinkLength",0);var Ou;pu.LayerLongestPathSink=Ou=D.s(pu,"LayerLongestPathSink",1);var Qu; -pu.LayerLongestPathSource=Qu=D.s(pu,"LayerLongestPathSource",2);var su;pu.InitDepthFirstOut=su=D.s(pu,"InitDepthFirstOut",0);var Wu;pu.InitDepthFirstIn=Wu=D.s(pu,"InitDepthFirstIn",1);var Uu;pu.InitNaive=Uu=D.s(pu,"InitNaive",2);var $u;pu.AggressiveNone=$u=D.s(pu,"AggressiveNone",0);var tu;pu.AggressiveLess=tu=D.s(pu,"AggressiveLess",1);var av;pu.AggressiveMore=av=D.s(pu,"AggressiveMore",2);pu.PackNone=0;var bv;pu.PackExpand=bv=1;var cv;pu.PackStraighten=cv=2;var ev;pu.PackMedian=ev=4;var uu; -pu.PackAll=uu=7;function lv(){this.index=this.Ce=this.ef=this.pe=this.first=this.layer=0;this.link=null;this.Ji=0}D.ke(lv,{layer:!0,first:!0,pe:!0,ef:!0,Ce:!0,index:!0,link:!0,Ji:!0});function vu(){va.call(this)}D.Sa(vu,va);D.ja("LayeredDigraphNetwork",vu);vu.prototype.createVertex=function(){return new ov};vu.prototype.createEdge=function(){return new pv}; -function ov(){wa.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.lq=NaN;this.Dn=0;this.mB=this.nB=null}D.Sa(ov,wa);D.ja("LayeredDigraphVertex",ov);function pv(){xa.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}D.Sa(pv,xa);D.ja("LayeredDigraphEdge",pv); -function Z(){0b.level)return!1;a.removeChild(c.parent,c)}return!0} -Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){v&&D.l(a,vv,Z,"removeChild:p");v&&D.l(b,vv,Z,"removeChild:c");for(var c=a.children,d=0,e=0;eg?fw(a,k,ua,C,A):gw(a,k,ua,C,A);ua=A.x;C=A.width;A=A.height;break;case Uv:for(m=0;ms&&(ba< -h&&Nw(a,p,h-ba,0,lb,m-1),U++,Ua=0,lb=m,N=A,ba=0,ia=135Fa&&(Qw(a,-Fa,0,lb,m-1),Rw(H,-Fa,0),Rw(W,-Fa,0),Fa=0)}n.sa.m(Fa,ia);C=Math.max(C,fa);A=Math.max(A,N+(0===U?0:y)+Oa.height);ba=fa}else{0< -s&&0s&&(iaFa&&(Qw(a,0,-Fa,lb,m-1),Rw(H,0,-Fa),Rw(W,0,-Fa),Fa=0);n.sa.m(ba,Fa);A=Math.max(A,S);C=Math.max(C,N+(0===U?0:y)+Oa.width); -ia=S}Ua++}0q&&(q=0),135w&&(w=0),p===Vv&&(l+=u/2+a.W.y),k+=d+c):b?(null===a.comments?d>C&&(p=Vw(p,d-C,0),k=p.x,l=p.y,C=d,q=0):C=Tw(a,C,q),0>q&&(k-=q,q=0),135A&&(p=Vw(p,0,e-A),k=p.x,l=p.y,A=e,w=0):A=Uw(a,A,w),0>w&&(l-=w,w=0),k+=d+c);if(0g[0].x?g[2].assign(g[1]):g[1].assign(g[2])),g[3].yg[0].x?g[3].assign(g[2]):g[2].assign(g[3])),p[0].m(q+d,0),p[1].m(p[0].x,e),p[2].yg[0].y?g[2].assign(g[1]):g[1].assign(g[2])),g[3].xg[0].y?g[3].assign(g[2]):g[2].assign(g[3])),p[0].m(0,w+e),p[1].m(d,p[0].y),p[2].xc?fw(b,e,Ua,N,H):gw(b,e,Ua,N,H);Ua=H.x;N=H.width;H=H.height;break;case Uv:for(k=0;kr&&(far&&(Sp&&(p=0),135C&&(C=0));b.Wa.m(p,C);b.rb.m(N,H)}} -function fw(a,b,c,d,e){v&&D.l(a,vv,Z,"layoutBusChildrenPosDir:v");var g=b.length;if(0===g)return new B(c,0,d,e);if(1===g){var h=b[0];d=h.rb.width;e=h.rb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===aw(a),n=0,p=0,q=0,r=0;rm&&(d-=m),e=Math.max(e,Math.max(w,q)+b+s.height),0>h.sa.x&&(c=Zw(a,h.sa.x,!1,c,k))):(h.sa.m(d+b,c+k/2-h.W.y-h.Wa.y),d=Math.max(d,Math.max(y,p)+b+s.width),m=c+k/2-h.W.y-h.Wa.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.sa.y&&(c=Zw(a,h.sa.y,!0,c,k))));return new B(c,0,d,e)} -function gw(a,b,c,d,e){v&&D.l(a,vv,Z,"layoutBusChildrenNegDir:v");var g=b.length;if(0===g)return new B(c,0,d,e);if(1===g){var h=b[0];d=h.rb.width;e=h.rb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===aw(a),n=0,p=0,q=0,r=0;rp&&(d-=p),e=Math.max(e,Math.abs(Math.min(w,q))+l+s.height),0>h.sa.x&&(c=Zw(a,h.sa.x,!1,c,k))):(h.sa.m(-d-s.width-l,c+k/2-h.W.y-h.Wa.y),d=Math.max(d,Math.abs(Math.min(y,p))+l+s.width),p=c+k/2-h.W.y-h.Wa.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.sa.y&&(c=Zw(a,h.sa.y,!0,c,k))));for(r=0;rd&&(d=c+a.width);0>c&&(d-=c);return d;case bw:return a.width>b?a.width:b;case cw:return 2*a.W.x>b?a.width:b+a.width-2*a.W.x;case Tv:case Iv:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Uv:return a.width-a.W.x+a.nodeSpacing/2+b;case Vv:return Math.max(a.width,a.W.x+a.nodeSpacing/2+b);default:return b}} -function Uw(a,b,c){v&&D.l(a,vv,Z,"calculateSubheight:v");switch(a.alignment){case Rv:case Sw:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case bw:return a.height>b?a.height:b;case cw:return 2*a.W.y>b?a.height:b+a.height-2*a.W.y;case Tv:case Iv:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Uv:return a.height-a.W.y+a.nodeSpacing/2+b;case Vv:return Math.max(a.height,a.W.y+a.nodeSpacing/2+b);default:return b}} -function Vw(a,b,c){v&&D.l(a,za,Z,"alignOffset:align");switch(a){case Sw:b/=2;c/=2;break;case Rv:b/=2;c/=2;break;case bw:c=b=0;break;case cw:break;default:D.k("Unhandled alignment value "+a.toString())}return new O(b,c)}function Nw(a,b,c,d,e,g){v&&D.l(a,vv,Z,"shiftRelPosAlign:v");v&&D.l(b,za,Z,"shiftRelPosAlign:align");b=Vw(b,c,d);Qw(a,b.x,b.y,e,g)}function Qw(a,b,c,d,e){v&&D.l(a,vv,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var g=a[d].sa;g.x+=b;g.y+=c}} -function Ow(a,b,c,d){v&&(D.l(b,vv,Z,"recordMidPoints:v"),D.h(c,"number",Z,"recordMidPoints:x"),D.h(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.Rf){case rv:for(a=b.sc;a.next();)b=a.value,b.fromVertex===e&&b.at.m(c,d);break;case yv:for(a=b.pc;a.next();)b=a.value,b.toVertex===e&&b.at.m(c,d);break;default:D.k("Unhandled path value "+a.Rf.toString())}}function Rw(a,b,c){for(var d=0;dp.length||null===q||2>q.length))for(m= -l=0;lt&&e.ye.y&&tb.length||null===l||2>l.length)d=null;else{n=Mw(a,b.length+l.length);for(d=g=e=0;ge;)t=l[g++],n[d++].m(t.x+m,t.y);l=Mw(a,d);for(e=0;ep.length||null===g||2>g.length)e=null;else{n=Mw(a,p.length+g.length);for(m=y=l=0;lg;)e=p[l++], -n[m++].m(e.x,e.y);e=Mw(a,m);for(l=0;lp.length||null===q||2>q.length))for(m=l=0;lg&&e.xe.x&&gb.length||null===l||2>l.length)d=null;else{n=Mw(a,b.length+l.length);for(d=g=e=0;ge;)t=l[g++],n[d++].m(t.x,t.y+m);l=Mw(a,d);for(e=0;ep.length||null===g||2>g.length)e=null;else{n=Mw(a,p.length+g.length);for(m=y=l=0;lg;)e=p[l++],n[m++].m(e.x,e.y);e=Mw(a,m);for(l=0;lh.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;eh.portToColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e=h;d--)g=$u(this,d,-1)||g;e=this.countCrossings();e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$u(this,d,1)||g;e=this.countCrossings();e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$u(this,d,1)||g;e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1, +d=h;d<=c;d++)g=$u(this,d,-1)||g;e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$u(this,d,0)||g;e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$u(this,d,0)||g;e>=a?Iu(this,b):(a=e,b=Hu(this))}break;default:case uu:for(c=this.yb,h=0,k=a+1;(d=this.countCrossings())=h;d--)g=$u(this,d,-1)||g;e=this.countCrossings();e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$u(this,d,1)||g;e=this.countCrossings(); +e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$u(this,d,1)||g;e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$u(this,d,-1)||g;e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$u(this,d,0)||g;e>=a?Iu(this,b):(a=e,b=Hu(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$u(this,d,0)||g;e>=a?Iu(this,b):(a=e,b=Hu(this))}}Iu(this,b)}; +function Zu(a,b,c){v&&(D.p(b,qu,"medianBarycenterCrossingReduction:unfixedLayer"),D.p(c,qu,"medianBarycenterCrossingReduction:direction"));var d=0,e=Eu(a,b),g=a.se[b],h=Mu(a,b,c);c=Lu(a,b,c);for(d=0;dg+1&&(q+=4*(w-g),r+=4*(w-(g+1)))}A=d[g].qc.j;for(A.reset();A.next();)if(w=A.value,C=w.toVertex,w.valid&&C.layer===b){for(w=0;d[w]!==C;)w++;w===g+1&&(r+=1)}A=d[g+1].tc.j;for(A.reset();A.next();)if(w=A.value,C=w.fromVertex,w.valid&&C.layer===b){for(w=0;d[w]!==C;)w++;wg+1&&(q+=4*(w-(g+1)),r+=4*(w-g))}A=d[g+1].qc.j;for(A.reset();A.next();)if(w=A.value,C=w.toVertex,w.valid&& +C.layer===b){for(w=0;d[w]!==C;)w++;w===g&&(q+=1)}var w=C=0,A=h[d[g].index],N=k[d[g].index],H=h[d[g+1].index],W=k[d[g+1].index];-1!==A&&(C+=Math.abs(A-s),w+=Math.abs(A-y));-1!==N&&(C+=Math.abs(N-s),w+=Math.abs(N-y));-1!==H&&(C+=Math.abs(H-u),w+=Math.abs(H-t));-1!==W&&(C+=Math.abs(W-u),w+=Math.abs(W-t));if(r>1)+8*d;this.Pb*=8}if(0!==(this.oj&dv))for(b=!0;b;){b=!1;for(a=this.Vf+1;a<=this.yb;a++)b=ev(this,a,1)||b; +for(a=this.Vf-1;0<=a;a--)b=ev(this,a,-1)||b;b=ev(this,this.Vf,0)||b}if(0!==(this.oj&fv)){for(a=this.Vf+1;a<=this.yb;a++)gv(this,a,1);for(a=this.Vf-1;0<=a;a--)gv(this,a,-1);gv(this,this.Vf,0)}c&&(hv(this,-1),hv(this,1));if(0!==(this.oj&dv))for(b=!0;b;){b=!1;b=ev(this,this.Vf,0)||b;for(a=this.Vf+1;a<=this.yb;a++)b=ev(this,a,0)||b;for(a=this.Vf-1;0<=a;a--)b=ev(this,a,0)||b}}; +function ev(a,b,c){v&&(D.p(b,qu,"bendStraighten:unfixedLayer"),D.p(c,qu,"bendStraighten:direction"));for(var d=!1;iv(a,b,c);)d=!0;return d} +function iv(a,b,c){v&&(D.p(b,qu,"shiftbendStraighten:unfixedLayer"),D.p(c,qu,"shiftbendStraighten:direction"));var d=0,e=Eu(a,b),g=a.se[b],h=Lu(a,b,-1);if(0c)for(d=0;dd-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=g||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q= +0,u=0,t=0,y=0,w=0;if(0>=c)for(var C=e[d].tc.j;C.next();){var w=C.value,A=w.fromVertex;w.valid&&A.layer!==b&&(t=Gu(w),y=w.portFromColOffset,w=w.portToColOffset,A=A.column,q+=(Math.abs(n+w-(A+y))+1)*t,s+=(Math.abs(r+w-(A+y))+1)*t,u+=(Math.abs(p+w-(A+y))+1)*t)}if(0<=c)for(C=e[d].qc.j;C.next();)w=C.value,A=w.toVertex,w.valid&&A.layer!==b&&(t=Gu(w),y=w.portFromColOffset,w=w.portToColOffset,A=A.column,q+=(Math.abs(n+y-(A+w))+1)*t,s+=(Math.abs(r+y-(A+w))+1)*t,u+=(Math.abs(p+y-(A+w))+1)*t);w=y=t=0;C=h[e[d].index]; +A=k[e[d].index];-1!==C&&(t+=Math.abs(C-n),y+=Math.abs(C-r),w+=Math.abs(C-p));-1!==A&&(t+=Math.abs(A-n),y+=Math.abs(A-r),w+=Math.abs(A-p));if(s=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}Fu(a,b,e);a.normalize()} +function jv(a,b){v&&(D.p(b,qu,"packAux:column"),D.p(1,qu,"packAux:direction"));for(var c=!0,d=a.network.vertexes.j;d.next();){var e=d.value,g=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-g<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e} +function kv(a,b){v&&(D.p(b,qu,"tightPackAux:column"),D.p(1,qu,"tightPackAux:direction"));for(var c=b,c=b+1,d=0,e=[],g=[],d=0;d<=a.yb;d++)e[d]=!1,g[d]=!1;for(var h=a.network.vertexes.j;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(g[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.yb;d++)k=k&&!(e[d]&&g[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c} +function hv(a,b){v&&D.p(b,qu,"componentPack:direction");for(var c=0;c<=a.Pb;c++)for(;jv(a,c););a.normalize();for(c=0;ce?Iu(a,d):hb)for(c=a.Pb;0<=c;c--)for(d=Hu(a),e=Ku(a),g=e+1;ee?Iu(a,d):hc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Jg);a.Jg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Ou(a,b,a.Jg,-1,!0,!0),a.Jg++);var g=0;b=[];for(g=0;gc)for(k=a.Pb;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} +qu.prototype.commitLayout=function(){if(this.Qq)for(var a=Cu(this,!0),b=Cu(this,!1),c=this.network.edges.j;c.next();){var d=c.value.link;null!==d&&(d.Gb=a,d.Hb=b)}this.commitNodes();this.uA();this.yu&&this.commitLinks()};function Cu(a,b){return 270===a.fa?b?$c:id:90===a.fa?b?id:$c:180===a.fa?b?gd:hd:b?hd:gd} +qu.prototype.commitNodes=function(){this.Hg=[];this.Uf=[];this.Tf=[];this.Ub=[];for(var a=0;a<=this.yb;a++)this.Hg[a]=0,this.Uf[a]=0,this.Tf[a]=0,this.Ub[a]=0;for(a=this.network.vertexes.j;a.next();){var b=a.value,c=b.layer;this.Hg[c]=Math.max(this.Hg[c],this.nodeMinLayerSpace(b,!0));this.Uf[c]=Math.max(this.Uf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.Zm,c=0;c<=this.yb;c++){var e=d;0>=this.Hg[c]+this.Uf[c]&&(e=0);0=m.R.bottom?(Fa=m.R.y+m.R.height,b.B(U++,sa,Fa+hb),b.B(U++,sa,Fa),b.B(U++,sa,Fa-mb)):(b.B(U++,sa,pa+hb),b.B(U++, +sa,pa),b.B(U++,sa,pa-mb)):270===this.fa?pa<=m.R.y?(Fa=m.R.y,b.B(U++,sa,Fa-mb),b.B(U++,sa,Fa),b.B(U++,sa,Fa+hb)):(b.B(U++,sa,pa-mb),b.B(U++,sa,pa),b.B(U++,sa,pa+hb)):0===this.fa&&(sa>=m.R.right?(Fa=m.R.x+m.R.width,b.B(U++,Fa+hb,pa),b.B(U++,Fa,pa),b.B(U++,Fa-mb,pa)):(b.B(U++,sa+hb,pa),b.B(U++,sa,pa),b.B(U++,sa-mb,pa)));else{b.B(U++,Xa,pb);var be=0;if(180===this.fa||0===this.fa){if(180===this.fa?sa>=m.R.right:sa<=m.R.x)be=(0===this.fa?-mb:hb)/2;b.B(U++,Xa+be,pa)}else{if(270===this.fa?pa>=m.R.bottom: +pa<=m.R.y)be=(90===this.fa?-mb:hb)/2;b.B(U++,sa,pb+be)}b.B(U++,sa,pa)}else mb=Math.max(10,this.Hg[ua.layer]),hb=Math.max(10,this.Uf[ua.layer]),180===this.fa?(S&&b.B(U++,sa-mb,pa),b.B(U++,sa,pa),S&&b.B(U++,sa+hb,pa)):90===this.fa?(S&&b.B(U++,sa,pa+hb),b.B(U++,sa,pa),S&&b.B(U++,sa,pa-mb)):270===this.fa?(S&&b.B(U++,sa,pa-mb),b.B(U++,sa,pa),S&&b.B(U++,sa,pa+hb)):(S&&b.B(U++,sa+hb,pa),b.B(U++,sa,pa),S&&b.B(U++,sa-mb,pa));m=ua}if(null===k||b.computeSpot(!1)!==cc||ba)if(Xa=b.m(U-1).x,pb=b.m(U-1).y,sa=b.m(U).x, +pa=b.m(U).y,ba){var td=this.Uf[l.layer],yc=0;180===this.fa||0===this.fa?(yc=pb,yc>=l.R.y&&yc<=l.R.bottom&&(180===this.fa?sa>=l.R.x:sa<=l.R.right)&&(Fa=l.oa+(180===this.fa?-td:td),yc=yc=l.R.x&&yc<=l.R.right&&(270===this.fa?pa>=l.R.y:pa<=l.R.bottom)&&(Fa=l.va+(270===this.fa?-td:td),yc=yc=l.R.x?(Fa=l.R.x+l.R.width,b.ia(U-2,Fa,pb),b.ia(U-1,Fa+hb,pb)):90===this.fa&&pa<=l.R.bottom?(Fa=l.R.y,b.ia(U-2,Xa,Fa),b.ia(U-1,Xa,Fa-mb)):270===this.fa&&pa>=l.R.y?(Fa=l.R.y+l.R.height,b.ia(U-2,Xa,Fa),b.ia(U-1,Xa,Fa+hb)):0===this.fa&&sa<=l.R.right&&(Fa=l.R.x,b.ia(U-2,Fa,pb),b.ia(U-1,Fa-mb,pb));else{mb=Math.max(10,this.Hg[l.layer]);hb=Math.max(10,this.Uf[l.layer]);be=0;if(180===this.fa||0=== +this.fa){if(180===this.fa?sa<=l.R.x:sa>=l.R.right)be=(0===this.fa?hb:-mb)/2;b.B(U++,sa+be,pb)}else{if(270===this.fa?pa<=l.R.y:pa>=l.R.bottom)be=(90===this.fa?hb:-mb)/2;b.B(U++,Xa,pa+be)}b.B(U++,sa,pa)}}else{for(;null!==l&&l!==m;){Oa=ua=null;for(var Dg=l.qc.j;Dg.next();){var Ef=Dg.value;if(Ef.link===c.link&&(ua=Ef.toVertex,Oa=Ef.fromVertex,null!==Oa.Cd&&(Oa=null),null===ua.Cd))break}var Xa=0,pb=0,sa=0,pa=0,lb=0,mb=0,hb=0;if(ua!==m)if(Xa=b.m(U-1).x,pb=b.m(U-1).y,sa=ua.oa,pa=ua.va,ba)if(180===this.fa|| +0===this.fa){var se=null!==Oa?Oa.va:pb;se!==pa&&(lb=this.Ub[ua.layer],2===U&&(lb=0===this.fa?Math.max(lb,Xa):Math.min(lb,Xa)),b.B(U++,lb,pb),b.B(U++,lb,pa))}else{var Id=null!==Oa?Oa.oa:Xa;Id!==sa&&(lb=this.Ub[ua.layer],2===U&&(lb=90===this.fa?Math.max(lb,pb):Math.min(lb,pb)),b.B(U++,Xa,lb),b.B(U++,sa,lb))}else mb=Math.max(10,this.Hg[ua.layer]),hb=Math.max(10,this.Uf[ua.layer]),180===this.fa?(b.B(U++,sa+hb,pa),S&&b.B(U++,sa,pa),b.B(U++,sa-mb,pa)):90===this.fa?(b.B(U++,sa,pa-mb),S&&b.B(U++,sa,pa),b.B(U++, +sa,pa+hb)):270===this.fa?(b.B(U++,sa,pa+hb),S&&b.B(U++,sa,pa),b.B(U++,sa,pa-mb)):(b.B(U++,sa-mb,pa),S&&b.B(U++,sa,pa),b.B(U++,sa+hb,pa));l=ua}ba&&(Xa=b.m(U-1).x,pb=b.m(U-1).y,sa=b.m(U).x,pa=b.m(U).y,180===this.fa||0===this.fa?pb!==pa&&(lb=0===this.fa?Math.min(Math.max((sa+Xa)/2,this.Ub[m.layer]),sa):Math.max(Math.min((sa+Xa)/2,this.Ub[m.layer]),sa),b.B(U++,lb,pb),b.B(U++,lb,pa)):Xa!==sa&&(lb=90===this.fa?Math.min(Math.max((pa+pb)/2,this.Ub[m.layer]),pa):Math.max(Math.min((pa+pb)/2,this.Ub[m.layer]), +pa),b.B(U++,Xa,lb),b.B(U++,sa,lb)))}if(null!==d&&S){if(null!==h){if(b.computeSpot(!0)===cc){var Ab=b.m(0),Ke=b.m(2);Ab.P(Ke)||b.ia(1,(Ab.x+Ke.x)/2,(Ab.y+Ke.y)/2)}fa=b.getLinkPoint(e,h,cc,!0,!1,g,k);fa.F()||fa.set(e.$.cm);b.ia(0,fa.x,fa.y)}null!==k&&(b.computeSpot(!1)===cc&&(Ab=b.m(b.ta-1),Ke=b.m(b.ta-3),Ab.P(Ke)||b.ia(b.ta-2,(Ab.x+Ke.x)/2,(Ab.y+Ke.y)/2)),fa=b.getLinkPoint(g,k,cc,!1,!1,e,h),fa.F()||fa.set(g.$.cm),b.ia(b.ta-1,fa.x,fa.y))}b.Bj();c.commit()}}}for(var ld=new K(J),eg=this.network.edges.j;eg.next();){var Ff= +eg.value.link;null!==Ff&&Ff.rc&&!ld.contains(Ff)&&ld.add(Ff)}if(0ic.y&&(Gf=Qc.y>ic.y?0:ad.x +Nb.x&&(tb=fi.x>Nb.x?0:Rc.yb.layer?1:a.efb.ef?1:a.Ceb.Ce?1:0:0};qu.prototype.MG=function(a,b){return a instanceof mv&&b instanceof mv&&a!==b?a.firstb.first||a.Jib.Ji||a.efb.ef?1:a.Ceb.Ce?1:0:0}; +qu.prototype.Ay=function(a,b){return a instanceof mv&&b instanceof mv&&a!==b?a.peb.pe||a.Jib.Ji||a.efb.ef?1:a.Ceb.Ce?1:0:0};function nv(a,b){v&&(D.p(a,qu,"isApprox:a"),D.p(b,qu,"isApprox:b"));var c=a-b;return-1c}function ov(a,b,c,d){v&&(D.p(a,qu,"isUnoccupied2:px"),D.p(b,qu,"isUnoccupied2:py"),D.p(c,qu,"isUnoccupied2:qx"),D.p(d,qu,"isUnoccupied2:qy"));return!0} +function Eu(a,b){var c,d=a.se[b];if(d>=a.xh.length){c=[];for(var e=0;ea&&(this.oj=a,this.N()))});D.defineProperty(qu,{Qq:"setsPortSpots"},function(){return this.qi},function(a){this.qi!==a&&(D.h(a,"boolean",qu,"setsPortSpots"),this.qi=a,this.N())});D.defineProperty(qu,{dG:"linkSpacing"},function(){return this.ss},function(a){this.ss!==a&&(D.h(a,"number",qu,"linkSpacing"),0<=a&&(this.ss=a,this.N()))});D.w(qu,{BJ:"maxLayer"},function(){return this.yb}); +D.w(qu,{UL:"maxIndex"},function(){return this.ow});D.w(qu,{TL:"maxColumn"},function(){return this.Pb});D.w(qu,{ZL:"minIndexLayer"},function(){return this.Bs});D.w(qu,{VL:"maxIndexLayer"},function(){return this.Vf});var ru;qu.CycleDepthFirst=ru=D.s(qu,"CycleDepthFirst",0);var xu;qu.CycleGreedy=xu=D.s(qu,"CycleGreedy",1);var su;qu.LayerOptimalLinkLength=su=D.s(qu,"LayerOptimalLinkLength",0);var Pu;qu.LayerLongestPathSink=Pu=D.s(qu,"LayerLongestPathSink",1);var Ru; +qu.LayerLongestPathSource=Ru=D.s(qu,"LayerLongestPathSource",2);var tu;qu.InitDepthFirstOut=tu=D.s(qu,"InitDepthFirstOut",0);var Xu;qu.InitDepthFirstIn=Xu=D.s(qu,"InitDepthFirstIn",1);var Vu;qu.InitNaive=Vu=D.s(qu,"InitNaive",2);var av;qu.AggressiveNone=av=D.s(qu,"AggressiveNone",0);var uu;qu.AggressiveLess=uu=D.s(qu,"AggressiveLess",1);var bv;qu.AggressiveMore=bv=D.s(qu,"AggressiveMore",2);qu.PackNone=0;var cv;qu.PackExpand=cv=1;var dv;qu.PackStraighten=dv=2;var fv;qu.PackMedian=fv=4;var vu; +qu.PackAll=vu=7;function mv(){this.index=this.Ce=this.ef=this.pe=this.first=this.layer=0;this.link=null;this.Ji=0}D.ke(mv,{layer:!0,first:!0,pe:!0,ef:!0,Ce:!0,index:!0,link:!0,Ji:!0});function wu(){va.call(this)}D.Sa(wu,va);D.ja("LayeredDigraphNetwork",wu);wu.prototype.createVertex=function(){return new pv};wu.prototype.createEdge=function(){return new qv}; +function pv(){wa.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.kq=NaN;this.Dn=0;this.qB=this.rB=null}D.Sa(pv,wa);D.ja("LayeredDigraphVertex",pv);function qv(){xa.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}D.Sa(qv,xa);D.ja("LayeredDigraphEdge",qv); +function Z(){0b.level)return!1;a.removeChild(c.parent,c)}return!0} +Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){v&&D.l(a,wv,Z,"removeChild:p");v&&D.l(b,wv,Z,"removeChild:c");for(var c=a.children,d=0,e=0;eg?gw(a,k,ua,C,A):hw(a,k,ua,C,A);ua=A.x;C=A.width;A=A.height;break;case Vv:for(m=0;ms&&(ba< +h&&Ow(a,p,h-ba,0,kb,m-1),U++,Ua=0,kb=m,N=A,ba=0,ia=135Fa&&(Rw(a,-Fa,0,kb,m-1),Sw(H,-Fa,0),Sw(W,-Fa,0),Fa=0)}n.sa.n(Fa,ia);C=Math.max(C,fa);A=Math.max(A,N+(0===U?0:y)+Oa.height);ba=fa}else{0< +s&&0s&&(iaFa&&(Rw(a,0,-Fa,kb,m-1),Sw(H,0,-Fa),Sw(W,0,-Fa),Fa=0);n.sa.n(ba,Fa);A=Math.max(A,S);C=Math.max(C,N+(0===U?0:y)+Oa.width); +ia=S}Ua++}0q&&(q=0),135w&&(w=0),p===Wv&&(l+=u/2+a.W.y),k+=d+c):b?(null===a.comments?d>C&&(p=Ww(p,d-C,0),k=p.x,l=p.y,C=d,q=0):C=Uw(a,C,q),0>q&&(k-=q,q=0),135A&&(p=Ww(p,0,e-A),k=p.x,l=p.y,A=e,w=0):A=Vw(a,A,w),0>w&&(l-=w,w=0),k+=d+c);if(0g[0].x?g[2].assign(g[1]):g[1].assign(g[2])),g[3].yg[0].x?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(q+d,0),p[1].n(p[0].x,e),p[2].yg[0].y?g[2].assign(g[1]):g[1].assign(g[2])),g[3].xg[0].y?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(0,w+e),p[1].n(d,p[0].y),p[2].xc?gw(b,e,Ua,N,H):hw(b,e,Ua,N,H);Ua=H.x;N=H.width;H=H.height;break;case Vv:for(k=0;kr&&(far&&(Sp&&(p=0),135C&&(C=0));b.Wa.n(p,C);b.sb.n(N,H)}} +function gw(a,b,c,d,e){v&&D.l(a,wv,Z,"layoutBusChildrenPosDir:v");var g=b.length;if(0===g)return new B(c,0,d,e);if(1===g){var h=b[0];d=h.sb.width;e=h.sb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===bw(a),n=0,p=0,q=0,r=0;rm&&(d-=m),e=Math.max(e,Math.max(w,q)+b+s.height),0>h.sa.x&&(c=$w(a,h.sa.x,!1,c,k))):(h.sa.n(d+b,c+k/2-h.W.y-h.Wa.y),d=Math.max(d,Math.max(y,p)+b+s.width),m=c+k/2-h.W.y-h.Wa.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.sa.y&&(c=$w(a,h.sa.y,!0,c,k))));return new B(c,0,d,e)} +function hw(a,b,c,d,e){v&&D.l(a,wv,Z,"layoutBusChildrenNegDir:v");var g=b.length;if(0===g)return new B(c,0,d,e);if(1===g){var h=b[0];d=h.sb.width;e=h.sb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===bw(a),n=0,p=0,q=0,r=0;rp&&(d-=p),e=Math.max(e,Math.abs(Math.min(w,q))+l+s.height),0>h.sa.x&&(c=$w(a,h.sa.x,!1,c,k))):(h.sa.n(-d-s.width-l,c+k/2-h.W.y-h.Wa.y),d=Math.max(d,Math.abs(Math.min(y,p))+l+s.width),p=c+k/2-h.W.y-h.Wa.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.sa.y&&(c=$w(a,h.sa.y,!0,c,k))));for(r=0;rd&&(d=c+a.width);0>c&&(d-=c);return d;case cw:return a.width>b?a.width:b;case dw:return 2*a.W.x>b?a.width:b+a.width-2*a.W.x;case Uv:case Jv:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Vv:return a.width-a.W.x+a.nodeSpacing/2+b;case Wv:return Math.max(a.width,a.W.x+a.nodeSpacing/2+b);default:return b}} +function Vw(a,b,c){v&&D.l(a,wv,Z,"calculateSubheight:v");switch(a.alignment){case Sv:case Tw:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case cw:return a.height>b?a.height:b;case dw:return 2*a.W.y>b?a.height:b+a.height-2*a.W.y;case Uv:case Jv:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Vv:return a.height-a.W.y+a.nodeSpacing/2+b;case Wv:return Math.max(a.height,a.W.y+a.nodeSpacing/2+b);default:return b}} +function Ww(a,b,c){v&&D.l(a,za,Z,"alignOffset:align");switch(a){case Tw:b/=2;c/=2;break;case Sv:b/=2;c/=2;break;case cw:c=b=0;break;case dw:break;default:D.k("Unhandled alignment value "+a.toString())}return new O(b,c)}function Ow(a,b,c,d,e,g){v&&D.l(a,wv,Z,"shiftRelPosAlign:v");v&&D.l(b,za,Z,"shiftRelPosAlign:align");b=Ww(b,c,d);Rw(a,b.x,b.y,e,g)}function Rw(a,b,c,d,e){v&&D.l(a,wv,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var g=a[d].sa;g.x+=b;g.y+=c}} +function Pw(a,b,c,d){v&&(D.l(b,wv,Z,"recordMidPoints:v"),D.h(c,"number",Z,"recordMidPoints:x"),D.h(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.Sf){case sv:for(a=b.tc;a.next();)b=a.value,b.fromVertex===e&&b.at.n(c,d);break;case zv:for(a=b.qc;a.next();)b=a.value,b.toVertex===e&&b.at.n(c,d);break;default:D.k("Unhandled path value "+a.Sf.toString())}}function Sw(a,b,c){for(var d=0;dp.length||null===q||2>q.length))for(m= +l=0;lt&&e.ye.y&&tb.length||null===l||2>l.length)d=null;else{n=Nw(a,b.length+l.length);for(d=g=e=0;ge;)t=l[g++],n[d++].n(t.x+m,t.y);l=Nw(a,d);for(e=0;ep.length||null===g||2>g.length)e=null;else{n=Nw(a,p.length+g.length);for(m=y=l=0;lg;)e=p[l++], +n[m++].n(e.x,e.y);e=Nw(a,m);for(l=0;lp.length||null===q||2>q.length))for(m=l=0;lg&&e.xe.x&&gb.length||null===l||2>l.length)d=null;else{n=Nw(a,b.length+l.length);for(d=g=e=0;ge;)t=l[g++],n[d++].n(t.x,t.y+m);l=Nw(a,d);for(e=0;ep.length||null===g||2>g.length)e=null;else{n=Nw(a,p.length+g.length);for(m=y=l=0;lg;)e=p[l++],n[m++].n(e.x,e.y);e=Nw(a,m);for(l=0;l=a?0:135>=a?90:225>=a?180:315>=a?270:0} -function dw(a){v&&D.l(a,vv,Z,"computeLayerSpacing:v");var b=aw(a),b=90===b||270===b,c=a.layerSpacing;if(0=a&&(this.ya.nodeIndentPastParent=a,this.N()))}); -D.defineProperty(Z,{nodeSpacing:"nodeSpacing"},function(){return this.ya.nodeSpacing},function(a){this.ya.nodeSpacing!==a&&(D.h(a,"number",Z,"nodeSpacing"),this.ya.nodeSpacing=a,this.N())});D.defineProperty(Z,{layerSpacing:"layerSpacing"},function(){return this.ya.layerSpacing},function(a){this.ya.layerSpacing!==a&&(D.h(a,"number",Z,"layerSpacing"),this.ya.layerSpacing=a,this.N())}); -D.defineProperty(Z,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.ya.layerSpacingParentOverlap},function(a){this.ya.layerSpacingParentOverlap!==a&&(D.h(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.ya.layerSpacingParentOverlap=a,this.N()))});D.defineProperty(Z,{compaction:"compaction"},function(){return this.ya.compaction},function(a){this.ya.compaction!==a&&(D.Ca(a,Z,Z,"compaction"),a===Yv||a===$v)&&(this.ya.compaction=a,this.N())}); -D.defineProperty(Z,{breadthLimit:"breadthLimit"},function(){return this.ya.breadthLimit},function(a){this.ya.breadthLimit!==a&&(D.h(a,"number",Z,"breadthLimit"),0<=a&&(this.ya.breadthLimit=a,this.N()))});D.defineProperty(Z,{rowSpacing:"rowSpacing"},function(){return this.ya.rowSpacing},function(a){this.ya.rowSpacing!==a&&(D.h(a,"number",Z,"rowSpacing"),this.ya.rowSpacing=a,this.N())}); -D.defineProperty(Z,{rowIndent:"rowIndent"},function(){return this.ya.rowIndent},function(a){this.ya.rowIndent!==a&&(D.h(a,"number",Z,"rowIndent"),0<=a&&(this.ya.rowIndent=a,this.N()))});D.defineProperty(Z,{commentSpacing:"commentSpacing"},function(){return this.ya.commentSpacing},function(a){this.ya.commentSpacing!==a&&(D.h(a,"number",Z,"commentSpacing"),this.ya.commentSpacing=a,this.N())}); -D.defineProperty(Z,{commentMargin:"commentMargin"},function(){return this.ya.commentMargin},function(a){this.ya.commentMargin!==a&&(D.h(a,"number",Z,"commentMargin"),this.ya.commentMargin=a,this.N())});D.defineProperty(Z,{setsPortSpot:"setsPortSpot"},function(){return this.ya.setsPortSpot},function(a){this.ya.setsPortSpot!==a&&(D.h(a,"boolean",Z,"setsPortSpot"),this.ya.setsPortSpot=a,this.N())}); -D.defineProperty(Z,{portSpot:"portSpot"},function(){return this.ya.portSpot},function(a){D.l(a,R,Z,"portSpot");this.ya.portSpot.O(a)||(this.ya.portSpot=a,this.N())});D.defineProperty(Z,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.ya.setsChildPortSpot},function(a){this.ya.setsChildPortSpot!==a&&(D.h(a,"boolean",Z,"setsChildPortSpot"),this.ya.setsChildPortSpot=a,this.N())}); -D.defineProperty(Z,{childPortSpot:"childPortSpot"},function(){return this.ya.childPortSpot},function(a){D.l(a,R,Z,"childPortSpot");this.ya.childPortSpot.O(a)||(this.ya.childPortSpot=a,this.N())});D.defineProperty(Z,{YK:"alternateSorting"},function(){return this.za.sorting},function(a){this.za.sorting!==a&&(D.Ca(a,Z,Z,"alternateSorting"),a===Nv||a===Ov||a===Pv||Qv)&&(this.za.sorting=a,this.N())}); -D.defineProperty(Z,{MK:"alternateComparer"},function(){return this.za.comparer},function(a){this.za.comparer!==a&&(D.h(a,"function",Z,"alternateComparer"),this.za.comparer=a,this.N())});D.defineProperty(Z,{GK:"alternateAngle"},function(){return this.za.angle},function(a){this.za.angle!==a&&(D.h(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.za.angle=a,this.N())}); -D.defineProperty(Z,{FK:"alternateAlignment"},function(){return this.za.alignment},function(a){this.za.alignment!==a&&(D.Ca(a,Z,Z,"alternateAlignment"),this.za.alignment=a,this.N())});D.defineProperty(Z,{QK:"alternateNodeIndent"},function(){return this.za.nodeIndent},function(a){this.za.nodeIndent!==a&&(D.h(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.za.nodeIndent=a,this.N()))}); -D.defineProperty(Z,{RK:"alternateNodeIndentPastParent"},function(){return this.za.nodeIndentPastParent},function(a){this.za.nodeIndentPastParent!==a&&(D.h(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.za.nodeIndentPastParent=a,this.N()))});D.defineProperty(Z,{SK:"alternateNodeSpacing"},function(){return this.za.nodeSpacing},function(a){this.za.nodeSpacing!==a&&(D.h(a,"number",Z,"alternateNodeSpacing"),this.za.nodeSpacing=a,this.N())}); -D.defineProperty(Z,{OK:"alternateLayerSpacing"},function(){return this.za.layerSpacing},function(a){this.za.layerSpacing!==a&&(D.h(a,"number",Z,"alternateLayerSpacing"),this.za.layerSpacing=a,this.N())});D.defineProperty(Z,{PK:"alternateLayerSpacingParentOverlap"},function(){return this.za.layerSpacingParentOverlap},function(a){this.za.layerSpacingParentOverlap!==a&&(D.h(a,"number",Z,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.za.layerSpacingParentOverlap=a,this.N()))}); -D.defineProperty(Z,{LK:"alternateCompaction"},function(){return this.za.compaction},function(a){this.za.compaction!==a&&(D.Ca(a,Z,Z,"alternateCompaction"),a===Yv||a===$v)&&(this.za.compaction=a,this.N())});D.defineProperty(Z,{HK:"alternateBreadthLimit"},function(){return this.za.breadthLimit},function(a){this.za.breadthLimit!==a&&(D.h(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.za.breadthLimit=a,this.N()))}); -D.defineProperty(Z,{VK:"alternateRowSpacing"},function(){return this.za.rowSpacing},function(a){this.za.rowSpacing!==a&&(D.h(a,"number",Z,"alternateRowSpacing"),this.za.rowSpacing=a,this.N())});D.defineProperty(Z,{UK:"alternateRowIndent"},function(){return this.za.rowIndent},function(a){this.za.rowIndent!==a&&(D.h(a,"number",Z,"alternateRowIndent"),0<=a&&(this.za.rowIndent=a,this.N()))}); -D.defineProperty(Z,{KK:"alternateCommentSpacing"},function(){return this.za.commentSpacing},function(a){this.za.commentSpacing!==a&&(D.h(a,"number",Z,"alternateCommentSpacing"),this.za.commentSpacing=a,this.N())});D.defineProperty(Z,{JK:"alternateCommentMargin"},function(){return this.za.commentMargin},function(a){this.za.commentMargin!==a&&(D.h(a,"number",Z,"alternateCommentMargin"),this.za.commentMargin=a,this.N())}); -D.defineProperty(Z,{XK:"alternateSetsPortSpot"},function(){return this.za.setsPortSpot},function(a){this.za.setsPortSpot!==a&&(D.h(a,"boolean",Z,"alternateSetsPortSpot"),this.za.setsPortSpot=a,this.N())});D.defineProperty(Z,{TK:"alternatePortSpot"},function(){return this.za.portSpot},function(a){D.l(a,R,Z,"alternatePortSpot");this.za.portSpot.O(a)||(this.za.portSpot=a,this.N())}); -D.defineProperty(Z,{WK:"alternateSetsChildPortSpot"},function(){return this.za.setsChildPortSpot},function(a){this.za.setsChildPortSpot!==a&&(D.h(a,"boolean",Z,"alternateSetsChildPortSpot"),this.za.setsChildPortSpot=a,this.N())});D.defineProperty(Z,{IK:"alternateChildPortSpot"},function(){return this.za.childPortSpot},function(a){D.l(a,R,Z,"alternateChildPortSpot");this.za.childPortSpot.O(a)||(this.za.childPortSpot=a,this.N())});var qv;Z.PathDefault=qv=D.s(Z,"PathDefault",-1);var rv; -Z.PathDestination=rv=D.s(Z,"PathDestination",0);var yv;Z.PathSource=yv=D.s(Z,"PathSource",1);var Nv;Z.SortingForwards=Nv=D.s(Z,"SortingForwards",10);var Ov;Z.SortingReverse=Ov=D.s(Z,"SortingReverse",11);var Pv;Z.SortingAscending=Pv=D.s(Z,"SortingAscending",12);var Qv;Z.SortingDescending=Qv=D.s(Z,"SortingDescending",13);var Sw;Z.AlignmentCenterSubtrees=Sw=D.s(Z,"AlignmentCenterSubtrees",20);var Rv;Z.AlignmentCenterChildren=Rv=D.s(Z,"AlignmentCenterChildren",21);var bw; -Z.AlignmentStart=bw=D.s(Z,"AlignmentStart",22);var cw;Z.AlignmentEnd=cw=D.s(Z,"AlignmentEnd",23);var Tv;Z.AlignmentBus=Tv=D.s(Z,"AlignmentBus",24);var Iv;Z.AlignmentBusBranching=Iv=D.s(Z,"AlignmentBusBranching",25);var Uv;Z.AlignmentTopLeftBus=Uv=D.s(Z,"AlignmentTopLeftBus",26);var Vv;Z.AlignmentBottomRightBus=Vv=D.s(Z,"AlignmentBottomRightBus",27);var Yv;Z.CompactionNone=Yv=D.s(Z,"CompactionNone",30);var $v;Z.CompactionBlock=$v=D.s(Z,"CompactionBlock",31);var sv; -Z.StyleLayered=sv=D.s(Z,"StyleLayered",40);var Mv;Z.StyleLastParents=Mv=D.s(Z,"StyleLastParents",41);var Lv;Z.StyleAlternating=Lv=D.s(Z,"StyleAlternating",42);var Kv;Z.StyleRootOnly=Kv=D.s(Z,"StyleRootOnly",43);var uv;Z.ArrangementVertical=uv=D.s(Z,"ArrangementVertical",50);var ax;Z.ArrangementHorizontal=ax=D.s(Z,"ArrangementHorizontal",51);var xv;Z.ArrangementFixedRoots=xv=D.s(Z,"ArrangementFixedRoots",52);var tv;Z.LayerIndividual=tv=D.s(Z,"LayerIndividual",60);var Gv; -Z.LayerSiblings=Gv=D.s(Z,"LayerSiblings",61);var Fv;Z.LayerUniform=Fv=D.s(Z,"LayerUniform",62);function wv(){va.call(this)}D.Sa(wv,va);D.ja("TreeNetwork",wv);wv.prototype.createVertex=function(){return new vv};wv.prototype.createEdge=function(){return new cx}; -function vv(){wa.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.sa=new O(0,0);this.rb=new Ca(0,0);this.Wa=new O(0,0);this.Mq=this.Lq=this.bK=!1;this.Wu=this.Bu=null;this.sorting=Nv;this.comparer=ws;this.angle=0;this.alignment=Rv;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=$v;this.breadthLimit= -0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=Tc;this.setsChildPortSpot=!0;this.childPortSpot=Tc}D.Sa(vv,wa);D.ja("TreeVertex",vv); -vv.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing, -this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};D.w(vv,{Fn:"childrenCount"},function(){return this.children.length});D.defineProperty(vv,{oM:"relativePosition"},function(){return this.sa},function(a){this.sa.set(a)});D.defineProperty(vv,{BM:"subtreeSize"},function(){return this.rb},function(a){this.rb.set(a)}); -D.defineProperty(vv,{AM:"subtreeOffset"},function(){return this.Wa},function(a){this.Wa.set(a)});function cx(){xa.call(this);this.at=new O(0,0)}D.Sa(cx,xa);D.ja("TreeEdge",cx); -cx.prototype.commit=function(){var a=this.link;if(null!==a&&!a.Di){var b=this.network.Vb,c=null,d=null;switch(b.Rf){case rv:c=this.fromVertex;d=this.toVertex;break;case yv:c=this.toVertex;d=this.fromVertex;break;default:D.k("Unhandled path value "+b.Rf.toString())}if(null!==c&&null!==d)if(b=this.at,0!==b.x||0!==b.y||c.bK){var d=c.sb,e=aw(c),g=dw(c),h=c.rowSpacing;a.yo();var k=a.gf===Nj,l=a.qc,m=0,n,p;a.zm();if(l||k){for(m=2;4q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-ew(c))))):c.alignment===bw?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-ew(c))))):c.alignment===bw?(r=d.left+b.x,0===b.x&&n.xq.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-ew(c))))):c.alignment===bw?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-ew(c))))):c.alignment===bw?(r=d.left+b.x,0===b.x&&n.x=a?0:135>=a?90:225>=a?180:315>=a?270:0} +function ew(a){v&&D.l(a,wv,Z,"computeLayerSpacing:v");var b=bw(a),b=90===b||270===b,c=a.layerSpacing;if(0=a&&(this.za.nodeIndentPastParent=a,this.N()))}); +D.defineProperty(Z,{nodeSpacing:"nodeSpacing"},function(){return this.za.nodeSpacing},function(a){this.za.nodeSpacing!==a&&(D.h(a,"number",Z,"nodeSpacing"),this.za.nodeSpacing=a,this.N())});D.defineProperty(Z,{layerSpacing:"layerSpacing"},function(){return this.za.layerSpacing},function(a){this.za.layerSpacing!==a&&(D.h(a,"number",Z,"layerSpacing"),this.za.layerSpacing=a,this.N())}); +D.defineProperty(Z,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.za.layerSpacingParentOverlap},function(a){this.za.layerSpacingParentOverlap!==a&&(D.h(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.za.layerSpacingParentOverlap=a,this.N()))});D.defineProperty(Z,{compaction:"compaction"},function(){return this.za.compaction},function(a){this.za.compaction!==a&&(D.Da(a,Z,Z,"compaction"),a===Zv||a===aw)&&(this.za.compaction=a,this.N())}); +D.defineProperty(Z,{breadthLimit:"breadthLimit"},function(){return this.za.breadthLimit},function(a){this.za.breadthLimit!==a&&(D.h(a,"number",Z,"breadthLimit"),0<=a&&(this.za.breadthLimit=a,this.N()))});D.defineProperty(Z,{rowSpacing:"rowSpacing"},function(){return this.za.rowSpacing},function(a){this.za.rowSpacing!==a&&(D.h(a,"number",Z,"rowSpacing"),this.za.rowSpacing=a,this.N())}); +D.defineProperty(Z,{rowIndent:"rowIndent"},function(){return this.za.rowIndent},function(a){this.za.rowIndent!==a&&(D.h(a,"number",Z,"rowIndent"),0<=a&&(this.za.rowIndent=a,this.N()))});D.defineProperty(Z,{commentSpacing:"commentSpacing"},function(){return this.za.commentSpacing},function(a){this.za.commentSpacing!==a&&(D.h(a,"number",Z,"commentSpacing"),this.za.commentSpacing=a,this.N())}); +D.defineProperty(Z,{commentMargin:"commentMargin"},function(){return this.za.commentMargin},function(a){this.za.commentMargin!==a&&(D.h(a,"number",Z,"commentMargin"),this.za.commentMargin=a,this.N())});D.defineProperty(Z,{setsPortSpot:"setsPortSpot"},function(){return this.za.setsPortSpot},function(a){this.za.setsPortSpot!==a&&(D.h(a,"boolean",Z,"setsPortSpot"),this.za.setsPortSpot=a,this.N())}); +D.defineProperty(Z,{portSpot:"portSpot"},function(){return this.za.portSpot},function(a){D.l(a,R,Z,"portSpot");this.za.portSpot.P(a)||(this.za.portSpot=a,this.N())});D.defineProperty(Z,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.za.setsChildPortSpot},function(a){this.za.setsChildPortSpot!==a&&(D.h(a,"boolean",Z,"setsChildPortSpot"),this.za.setsChildPortSpot=a,this.N())}); +D.defineProperty(Z,{childPortSpot:"childPortSpot"},function(){return this.za.childPortSpot},function(a){D.l(a,R,Z,"childPortSpot");this.za.childPortSpot.P(a)||(this.za.childPortSpot=a,this.N())});D.defineProperty(Z,{aL:"alternateSorting"},function(){return this.Aa.sorting},function(a){this.Aa.sorting!==a&&(D.Da(a,Z,Z,"alternateSorting"),a===Ov||a===Pv||a===Qv||Rv)&&(this.Aa.sorting=a,this.N())}); +D.defineProperty(Z,{PK:"alternateComparer"},function(){return this.Aa.comparer},function(a){this.Aa.comparer!==a&&(D.h(a,"function",Z,"alternateComparer"),this.Aa.comparer=a,this.N())});D.defineProperty(Z,{JK:"alternateAngle"},function(){return this.Aa.angle},function(a){this.Aa.angle!==a&&(D.h(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.Aa.angle=a,this.N())}); +D.defineProperty(Z,{IK:"alternateAlignment"},function(){return this.Aa.alignment},function(a){this.Aa.alignment!==a&&(D.Da(a,Z,Z,"alternateAlignment"),this.Aa.alignment=a,this.N())});D.defineProperty(Z,{TK:"alternateNodeIndent"},function(){return this.Aa.nodeIndent},function(a){this.Aa.nodeIndent!==a&&(D.h(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.Aa.nodeIndent=a,this.N()))}); +D.defineProperty(Z,{UK:"alternateNodeIndentPastParent"},function(){return this.Aa.nodeIndentPastParent},function(a){this.Aa.nodeIndentPastParent!==a&&(D.h(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.Aa.nodeIndentPastParent=a,this.N()))});D.defineProperty(Z,{VK:"alternateNodeSpacing"},function(){return this.Aa.nodeSpacing},function(a){this.Aa.nodeSpacing!==a&&(D.h(a,"number",Z,"alternateNodeSpacing"),this.Aa.nodeSpacing=a,this.N())}); +D.defineProperty(Z,{RK:"alternateLayerSpacing"},function(){return this.Aa.layerSpacing},function(a){this.Aa.layerSpacing!==a&&(D.h(a,"number",Z,"alternateLayerSpacing"),this.Aa.layerSpacing=a,this.N())});D.defineProperty(Z,{SK:"alternateLayerSpacingParentOverlap"},function(){return this.Aa.layerSpacingParentOverlap},function(a){this.Aa.layerSpacingParentOverlap!==a&&(D.h(a,"number",Z,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.Aa.layerSpacingParentOverlap=a,this.N()))}); +D.defineProperty(Z,{OK:"alternateCompaction"},function(){return this.Aa.compaction},function(a){this.Aa.compaction!==a&&(D.Da(a,Z,Z,"alternateCompaction"),a===Zv||a===aw)&&(this.Aa.compaction=a,this.N())});D.defineProperty(Z,{KK:"alternateBreadthLimit"},function(){return this.Aa.breadthLimit},function(a){this.Aa.breadthLimit!==a&&(D.h(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.Aa.breadthLimit=a,this.N()))}); +D.defineProperty(Z,{YK:"alternateRowSpacing"},function(){return this.Aa.rowSpacing},function(a){this.Aa.rowSpacing!==a&&(D.h(a,"number",Z,"alternateRowSpacing"),this.Aa.rowSpacing=a,this.N())});D.defineProperty(Z,{XK:"alternateRowIndent"},function(){return this.Aa.rowIndent},function(a){this.Aa.rowIndent!==a&&(D.h(a,"number",Z,"alternateRowIndent"),0<=a&&(this.Aa.rowIndent=a,this.N()))}); +D.defineProperty(Z,{NK:"alternateCommentSpacing"},function(){return this.Aa.commentSpacing},function(a){this.Aa.commentSpacing!==a&&(D.h(a,"number",Z,"alternateCommentSpacing"),this.Aa.commentSpacing=a,this.N())});D.defineProperty(Z,{MK:"alternateCommentMargin"},function(){return this.Aa.commentMargin},function(a){this.Aa.commentMargin!==a&&(D.h(a,"number",Z,"alternateCommentMargin"),this.Aa.commentMargin=a,this.N())}); +D.defineProperty(Z,{$K:"alternateSetsPortSpot"},function(){return this.Aa.setsPortSpot},function(a){this.Aa.setsPortSpot!==a&&(D.h(a,"boolean",Z,"alternateSetsPortSpot"),this.Aa.setsPortSpot=a,this.N())});D.defineProperty(Z,{WK:"alternatePortSpot"},function(){return this.Aa.portSpot},function(a){D.l(a,R,Z,"alternatePortSpot");this.Aa.portSpot.P(a)||(this.Aa.portSpot=a,this.N())}); +D.defineProperty(Z,{ZK:"alternateSetsChildPortSpot"},function(){return this.Aa.setsChildPortSpot},function(a){this.Aa.setsChildPortSpot!==a&&(D.h(a,"boolean",Z,"alternateSetsChildPortSpot"),this.Aa.setsChildPortSpot=a,this.N())});D.defineProperty(Z,{LK:"alternateChildPortSpot"},function(){return this.Aa.childPortSpot},function(a){D.l(a,R,Z,"alternateChildPortSpot");this.Aa.childPortSpot.P(a)||(this.Aa.childPortSpot=a,this.N())});var rv;Z.PathDefault=rv=D.s(Z,"PathDefault",-1);var sv; +Z.PathDestination=sv=D.s(Z,"PathDestination",0);var zv;Z.PathSource=zv=D.s(Z,"PathSource",1);var Ov;Z.SortingForwards=Ov=D.s(Z,"SortingForwards",10);var Pv;Z.SortingReverse=Pv=D.s(Z,"SortingReverse",11);var Qv;Z.SortingAscending=Qv=D.s(Z,"SortingAscending",12);var Rv;Z.SortingDescending=Rv=D.s(Z,"SortingDescending",13);var Tw;Z.AlignmentCenterSubtrees=Tw=D.s(Z,"AlignmentCenterSubtrees",20);var Sv;Z.AlignmentCenterChildren=Sv=D.s(Z,"AlignmentCenterChildren",21);var cw; +Z.AlignmentStart=cw=D.s(Z,"AlignmentStart",22);var dw;Z.AlignmentEnd=dw=D.s(Z,"AlignmentEnd",23);var Uv;Z.AlignmentBus=Uv=D.s(Z,"AlignmentBus",24);var Jv;Z.AlignmentBusBranching=Jv=D.s(Z,"AlignmentBusBranching",25);var Vv;Z.AlignmentTopLeftBus=Vv=D.s(Z,"AlignmentTopLeftBus",26);var Wv;Z.AlignmentBottomRightBus=Wv=D.s(Z,"AlignmentBottomRightBus",27);var Zv;Z.CompactionNone=Zv=D.s(Z,"CompactionNone",30);var aw;Z.CompactionBlock=aw=D.s(Z,"CompactionBlock",31);var tv; +Z.StyleLayered=tv=D.s(Z,"StyleLayered",40);var Nv;Z.StyleLastParents=Nv=D.s(Z,"StyleLastParents",41);var Mv;Z.StyleAlternating=Mv=D.s(Z,"StyleAlternating",42);var Lv;Z.StyleRootOnly=Lv=D.s(Z,"StyleRootOnly",43);var vv;Z.ArrangementVertical=vv=D.s(Z,"ArrangementVertical",50);var bx;Z.ArrangementHorizontal=bx=D.s(Z,"ArrangementHorizontal",51);var yv;Z.ArrangementFixedRoots=yv=D.s(Z,"ArrangementFixedRoots",52);var uv;Z.LayerIndividual=uv=D.s(Z,"LayerIndividual",60);var Hv; +Z.LayerSiblings=Hv=D.s(Z,"LayerSiblings",61);var Gv;Z.LayerUniform=Gv=D.s(Z,"LayerUniform",62);function xv(){va.call(this)}D.Sa(xv,va);D.ja("TreeNetwork",xv);xv.prototype.createVertex=function(){return new wv};xv.prototype.createEdge=function(){return new dx}; +function wv(){wa.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.sa=new O(0,0);this.sb=new Ca(0,0);this.Wa=new O(0,0);this.Lq=this.Kq=this.eK=!1;this.Vu=this.Au=null;this.sorting=Ov;this.comparer=ys;this.angle=0;this.alignment=Sv;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=aw;this.breadthLimit= +0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=Vc;this.setsChildPortSpot=!0;this.childPortSpot=Vc}D.Sa(wv,wa);D.ja("TreeVertex",wv); +wv.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing, +this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};D.w(wv,{Hn:"childrenCount"},function(){return this.children.length});D.defineProperty(wv,{rM:"relativePosition"},function(){return this.sa},function(a){this.sa.set(a)});D.defineProperty(wv,{EM:"subtreeSize"},function(){return this.sb},function(a){this.sb.set(a)}); +D.defineProperty(wv,{DM:"subtreeOffset"},function(){return this.Wa},function(a){this.Wa.set(a)});function dx(){xa.call(this);this.at=new O(0,0)}D.Sa(dx,xa);D.ja("TreeEdge",dx); +dx.prototype.commit=function(){var a=this.link;if(null!==a&&!a.Oh){var b=this.network.Vb,c=null,d=null;switch(b.Sf){case sv:c=this.fromVertex;d=this.toVertex;break;case zv:c=this.toVertex;d=this.fromVertex;break;default:D.k("Unhandled path value "+b.Sf.toString())}if(null!==c&&null!==d)if(b=this.at,0!==b.x||0!==b.y||c.eK){var d=c.mb,e=bw(c),g=ew(c),h=c.rowSpacing;a.Ao();var k=a.gf===Sj,l=a.rc,m=0,n,p;a.ym();if(l||k){for(m=2;4q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-fw(c))))):c.alignment===cw?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-fw(c))))):c.alignment===cw?(r=d.left+b.x,0===b.x&&n.xq.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-fw(c))))):c.alignment===cw?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-fw(c))))):c.alignment===cw?(r=d.left+b.x,0===b.x&&n.x, reroute: boolean): void; // undocumented protected setPointAt(i: number, x: number, y: number): void; // undocumented diff --git a/release/go.js b/release/go.js index 54d967abc..0f69c2bc7 100644 --- a/release/go.js +++ b/release/go.js @@ -1,1463 +1,1466 @@ /* - * GoJS v1.7.7 JavaScript Library for HTML Diagrams + * GoJS v1.7.8 JavaScript Library for HTML Diagrams * Northwoods Software, https://www.nwoods.com/ * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation. * Copyright (C) 1998-2017 by Northwoods Software Corporation. All Rights Reserved. - * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.7.7/doc/license.html. + * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.7.8/doc/license.html. */ (function(window) { var g,da={};if(!window.document||void 0===window.document.createElement("canvas").getContext)throw window.console&&window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."),Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");if(!Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript"); Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return f.apply(a,e.concat(d.call(arguments)))}function c(){}var d=Array.prototype.slice,e=d.call(arguments,1),f=this;c.prototype=this.prototype;b.prototype=new c;return b}); (function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c=a.length?a.push(c):a.splice(b,0,c):w.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Fg:function(a, -b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):w.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},ty:[],K:function(){var a=w.ty.pop();return void 0===a?new z:a},xb:function(a,b){var c=w.ty.pop();if(void 0===c)return new z(a,b);c.x=a;c.y=b;return c},v:function(a){w.ty.push(a)},FB:[],im:function(){var a=w.FB.pop();return void 0===a?new ha:a},zk:function(a){w.FB.push(a)},uy:[],Df:function(){var a=w.uy.pop();return void 0===a?new A:a},Vg:function(a,b,c,d){var e=w.uy.pop(); -if(void 0===e)return new A(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},Gb:function(a){w.uy.push(a)},GB:[],Ef:function(){var a=w.GB.pop();return void 0===a?new ia:a},ue:function(a){w.GB.push(a)},vy:null,s:function(){var a=w.vy;return null!==a?(w.vy=null,a):new ja},q:function(a){a.reset();w.vy=a},EB:[],lb:function(){var a=w.EB.pop();return void 0===a?[]:a},va:function(a){a.length=0;w.EB.push(a)},fo:Object.freeze([]),mm:1,lc:function(a){a.__gohashid=w.mm++},Yp:function(a){var b=a.__gohashid; -void 0===b&&(b=w.mm++,a.__gohashid=b);return b},Jd:function(a){return a.__gohashid},fa:function(a,b){b.Ey=a;da[a]=b},La:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},ji:function(a){a.PG=!0},defineProperty:function(a,b,c,d,e){w.j(a,"function","Util.defineProperty:classfunc");w.j(b,"object","Util.defineProperty:propobj");w.j(c,"function","Util.defineProperty:getter");w.j(d,"function","Util.defineProperty:setter");for(var f in b){b=b[f];c={get:c,set:d, -enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,f,c);e=Object.getOwnPropertyDescriptor(a.prototype,f);b&&e&&Object.defineProperty(a.prototype,b,e);break}},TJ:!1,u:function(a,b,c,d){w.j(a,"function","Util.defineReadOnlyProperty:classfunc");w.j(b,"object","Util.defineReadOnlyProperty:propobj");w.j(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var f=b[e];b={get:c,set:function(a){w.k('The property "'+f+'" is read-only and cannot be set to '+ -a)},enumerable:!0};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);f&&d&&Object.defineProperty(a.prototype,f,d);break}},$d:function(a,b){for(var c in b)b[c]=!0;a.prototype.LG=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?w.hf(a):null===a?"*":""},hf:function(a){if("function"===typeof a){if(a.Ey)return a.Ey;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9, -c).trim();if(""!==b)return a.Ey=b}else if("object"===typeof a&&a.constructor)return w.hf(a.constructor);return typeof a},p:function(a,b,c){w.j(a,"function","Util.defineEnumValue:classfunc");w.j(b,"string","Util.defineEnumValue:name");w.j(c,"number","Util.defineEnumValue:num");c=new ea(a,b,c);Object.freeze(c);a[b]=c;var d=a.Ru;d instanceof ka||(d=new ka("string",ea),a.Ru=d);d.add(b,c);return c},rb:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute? -(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c},Ma:function(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){}},Fu:function(a,b){w.j(a,"object","Setting properties requires Objects as arguments");w.j(b,"object","Setting properties requires Objects as arguments");var c=a instanceof C,d=a instanceof D,e;for(e in b){""===e&&w.k("Setting properties requires non-empty property names");var f=a,h=e;if(c||d){var k= -e.indexOf(".");if(0c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0,f="",h=0;hc;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);for(var d=[],e=0,c=0;cd;d++)b[w.Gg("7ca11abfd7330390")](w.Gg(c[d-1]),10,15*d+0);b[w.Gg("7ca11abfd022028846")]=w.Gg("39f046ebb36e4b");for(d=1;5>d;d++)b[w.Gg("7ca11abfd7330390")](w.Gg(c[d- -1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])w.p=function(a,b){var c=new ea(a,b,2);Object.freeze(c);a[b]=c;var d=a.Ru;d instanceof ka||(d=new ka("string",ea),a.Ru=d);d.add(b,c);return c};return a}();function ea(a,b,c){w.lc(this);this.TB=a;this.Qb=b;this.TG=c}w.fa("EnumValue",ea);ea.prototype.toString=function(){return w.hf(this.TB)+"."+this.Qb};w.u(ea,{De:"classType"},function(){return this.TB});w.u(ea,{name:"name"},function(){return this.Qb});w.u(ea,{value:"value"},function(){return this.TG}); -var pa;ea.findName=pa=function(a,b){if(void 0===b||null===b||""===b)return null;w.j(a,"function","findName:classfunc");w.j(b,"string","EnumValue.findName:name");var c=a.Ru;return c instanceof ka?c.ka(b):null};function ra(){this.RB=[]}ra.prototype.toString=function(){return this.RB.join("")};ra.prototype.add=function(a){""!==a&&this.RB.push(a)};function sa(){} -function ta(a){void 0===a&&(a=42);this.seed=a;this.oy=48271;this.Qu=2147483647;this.DB=this.Qu/this.oy;this.AG=this.Qu%this.oy;this.zG=1/this.Qu;this.random()}ta.prototype.random=function(){var a=this.seed%this.DB*this.oy-this.seed/this.DB*this.AG;this.seed=0=a.length?a.push(c):a.splice(b,0,c):w.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Hg:function(a, +b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):w.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},sy:[],K:function(){var a=w.sy.pop();return void 0===a?new z:a},xb:function(a,b){var c=w.sy.pop();if(void 0===c)return new z(a,b);c.x=a;c.y=b;return c},v:function(a){w.sy.push(a)},JB:[],im:function(){var a=w.JB.pop();return void 0===a?new ha:a},Ak:function(a){w.JB.push(a)},ty:[],Ef:function(){var a=w.ty.pop();return void 0===a?new A:a},hg:function(a,b,c,d){var e=w.ty.pop(); +if(void 0===e)return new A(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},Db:function(a){w.ty.push(a)},KB:[],Ff:function(){var a=w.KB.pop();return void 0===a?new ia:a},ue:function(a){w.KB.push(a)},uy:null,s:function(){var a=w.uy;return null!==a?(w.uy=null,a):new ja},q:function(a){a.reset();w.uy=a},IB:[],lb:function(){var a=w.IB.pop();return void 0===a?[]:a},wa:function(a){a.length=0;w.IB.push(a)},io:Object.freeze([]),mm:1,mc:function(a){a.__gohashid=w.mm++},Xp:function(a){var b=a.__gohashid; +void 0===b&&(b=w.mm++,a.__gohashid=b);return b},Kd:function(a){return a.__gohashid},fa:function(a,b){b.Dy=a;da[a]=b},La:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},ji:function(a){a.SG=!0},defineProperty:function(a,b,c,d,e){w.j(a,"function","Util.defineProperty:classfunc");w.j(b,"object","Util.defineProperty:propobj");w.j(c,"function","Util.defineProperty:getter");w.j(d,"function","Util.defineProperty:setter");for(var f in b){b=b[f];c={get:c,set:d, +enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,f,c);e=Object.getOwnPropertyDescriptor(a.prototype,f);b&&e&&Object.defineProperty(a.prototype,b,e);break}},WJ:!1,u:function(a,b,c,d){w.j(a,"function","Util.defineReadOnlyProperty:classfunc");w.j(b,"object","Util.defineReadOnlyProperty:propobj");w.j(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var f=b[e];b={get:c,set:function(a){w.k('The property "'+f+'" is read-only and cannot be set to '+ +a)},enumerable:!0};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);f&&d&&Object.defineProperty(a.prototype,f,d);break}},$d:function(a,b){for(var c in b)b[c]=!0;a.prototype.OG=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?w.hf(a):null===a?"*":""},hf:function(a){if("function"===typeof a){if(a.Dy)return a.Dy;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9, +c).trim();if(""!==b)return a.Dy=b}else if("object"===typeof a&&a.constructor)return w.hf(a.constructor);return typeof a},p:function(a,b,c){w.j(a,"function","Util.defineEnumValue:classfunc");w.j(b,"string","Util.defineEnumValue:name");w.j(c,"number","Util.defineEnumValue:num");c=new ea(a,b,c);Object.freeze(c);a[b]=c;var d=a.Qu;d instanceof ka||(d=new ka("string",ea),a.Qu=d);d.add(b,c);return c},sb:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute? +(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c},Ma:function(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){}},Eu:function(a,b){w.j(a,"object","Setting properties requires Objects as arguments");w.j(b,"object","Setting properties requires Objects as arguments");var c=a instanceof C,d=a instanceof D,e;for(e in b){""===e&&w.k("Setting properties requires non-empty property names");var f=a,h=e;if(c||d){var k= +e.indexOf(".");if(0c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0,f="",h=0;hc;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);for(var d=[],e=0,c=0;cd;d++)b[w.Ig("7ca11abfd7330390")](w.Ig(c[d-1]),10,15*d+0);b[w.Ig("7ca11abfd022028846")]=w.Ig("39f046ebb36e4b");for(d=1;5>d;d++)b[w.Ig("7ca11abfd7330390")](w.Ig(c[d- +1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])w.p=function(a,b){var c=new ea(a,b,2);Object.freeze(c);a[b]=c;var d=a.Qu;d instanceof ka||(d=new ka("string",ea),a.Qu=d);d.add(b,c);return c};return a}();function ea(a,b,c){w.mc(this);this.XB=a;this.Qb=b;this.WG=c}w.fa("EnumValue",ea);ea.prototype.toString=function(){return w.hf(this.XB)+"."+this.Qb};w.u(ea,{De:"classType"},function(){return this.XB});w.u(ea,{name:"name"},function(){return this.Qb});w.u(ea,{value:"value"},function(){return this.WG}); +var pa;ea.findName=pa=function(a,b){if(void 0===b||null===b||""===b)return null;w.j(a,"function","findName:classfunc");w.j(b,"string","EnumValue.findName:name");var c=a.Qu;return c instanceof ka?c.ja(b):null};function ra(){this.VB=[]}ra.prototype.toString=function(){return this.VB.join("")};ra.prototype.add=function(a){""!==a&&this.VB.push(a)};function sa(){} +function ta(a){void 0===a&&(a=42);this.seed=a;this.ny=48271;this.Pu=2147483647;this.HB=this.Pu/this.ny;this.DG=this.Pu%this.ny;this.CG=1/this.Pu;this.random()}ta.prototype.random=function(){var a=this.seed%this.HB*this.ny-this.seed/this.HB*this.DG;this.seed=0this.key)return!1;w.Na(a)}var a=a.n,b=a.length,c=++this.tc,d=this.Wh;if(null!==d)for(;cthis.key)return!1;w.Na(a)}var b=--this.tc;if(0<=b)return this.key=b,this.value=a.n[b],!0;this.Gf();return!1};Aa.prototype.hasNext=function(){return this.next()}; -Aa.prototype.first=Aa.prototype.first=function(){var a=this.uc;this.Ta=a.C;var b=a.n;this.tc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Aa.prototype.any=function(a){var b=this.uc;b.Li=null;var c=b.C,d=b.n,e=d.length;this.tc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.C!==c&&w.Na(b)}return!1};Aa.prototype.all=function(a){var b=this.uc;b.Li=null;var c=b.C,d=b.n,e=d.length;this.tc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.C!==c&&w.Na(b)}return!0}; -Aa.prototype.each=function(a){var b=this.uc;b.Li=null;var c=b.C,d=b.n,e=d.length;this.tc=e;for(e-=1;0<=e;e--)a(d[e]),b.C!==c&&w.Na(b);return this};Aa.prototype.map=function(a){var b=this.uc;b.Li=null;var c=b.C,d=[],e=b.n,f=e.length;this.tc=f;for(f-=1;0<=f;f--)d.push(a(e[f])),b.C!==c&&w.Na(b);a=new I;a.n=d;a.Fc();return a.i}; -Aa.prototype.filter=function(a){var b=this.uc;b.Li=null;var c=b.C,d=[],e=b.n,f=e.length;this.tc=f;for(f-=1;0<=f;f--){var h=e[f];a(h)&&d.push(h);b.C!==c&&w.Na(b)}a=new I(b.ma);a.n=d;a.Fc();return a.i};Aa.prototype.concat=function(a){this.uc.Li=null;return new xa(this,a.i)};w.u(Aa,{count:"count"},function(){return this.uc.n.length});Aa.prototype.Gf=function(){this.key=-1;this.value=null;this.Ta=-1;this.uc.Li=this}; -Aa.prototype.toString=function(){return"ListIteratorBackwards("+this.tc+"/"+this.uc.count+")"}; -function I(a){w.lc(this);this.Q=!1;this.n=[];this.C=0;this.Li=this.Ob=null;void 0===a||null===a?this.ma=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ma=a:w.Ea(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ma=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:w.Ea(a,"null, a primitive type name, or a class type", -"List constructor: type")}w.fa("List",I);I.prototype.Fc=function(){var a=this.C;a++;999999999this.key)return!1;w.Na(a)}var a=a.n,b=a.length,c=++this.uc,d=this.Wh;if(null!==d)for(;cthis.key)return!1;w.Na(a)}var b=--this.uc;if(0<=b)return this.key=b,this.value=a.n[b],!0;this.Hf();return!1};Aa.prototype.hasNext=function(){return this.next()}; +Aa.prototype.first=Aa.prototype.first=function(){var a=this.vc;this.Ta=a.C;var b=a.n;this.uc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Aa.prototype.any=function(a){var b=this.vc;b.Li=null;var c=b.C,d=b.n,e=d.length;this.uc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.C!==c&&w.Na(b)}return!1};Aa.prototype.all=function(a){var b=this.vc;b.Li=null;var c=b.C,d=b.n,e=d.length;this.uc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.C!==c&&w.Na(b)}return!0}; +Aa.prototype.each=function(a){var b=this.vc;b.Li=null;var c=b.C,d=b.n,e=d.length;this.uc=e;for(e-=1;0<=e;e--)a(d[e]),b.C!==c&&w.Na(b);return this};Aa.prototype.map=function(a){var b=this.vc;b.Li=null;var c=b.C,d=[],e=b.n,f=e.length;this.uc=f;for(f-=1;0<=f;f--)d.push(a(e[f])),b.C!==c&&w.Na(b);a=new I;a.n=d;a.Fc();return a.i}; +Aa.prototype.filter=function(a){var b=this.vc;b.Li=null;var c=b.C,d=[],e=b.n,f=e.length;this.uc=f;for(f-=1;0<=f;f--){var h=e[f];a(h)&&d.push(h);b.C!==c&&w.Na(b)}a=new I(b.ma);a.n=d;a.Fc();return a.i};Aa.prototype.concat=function(a){this.vc.Li=null;return new xa(this,a.i)};w.u(Aa,{count:"count"},function(){return this.vc.n.length});Aa.prototype.Hf=function(){this.key=-1;this.value=null;this.Ta=-1;this.vc.Li=this}; +Aa.prototype.toString=function(){return"ListIteratorBackwards("+this.uc+"/"+this.vc.count+")"}; +function I(a){w.mc(this);this.Q=!1;this.n=[];this.C=0;this.Li=this.Ob=null;void 0===a||null===a?this.ma=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ma=a:w.Ea(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ma=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:w.Ea(a,"null, a primitive type name, or a class type", +"List constructor: type")}w.fa("List",I);I.prototype.Fc=function(){var a=this.C;a++;999999999a||a>=b.length)&&w.Ea(a,"0 <= i < length",I,"elt:i");return b[a]};I.prototype.get=I.prototype.get=function(a){return this.da(a)};I.prototype.setElt=I.prototype.fg=function(a,b){var c=this.n;(0>a||a>=c.length)&&w.Ea(a,"0 <= i < length",I,"setElt:i");this.Q&&w.la(this,a);c[a]=b};I.prototype.set=I.prototype.set=function(a,b){this.fg(a,b)}; +I.prototype.indexOf=I.prototype.indexOf=function(a){return null===a?-1:this.n.indexOf(a)};I.prototype.elt=I.prototype.da=function(a){var b=this.n;(0>a||a>=b.length)&&w.Ea(a,"0 <= i < length",I,"elt:i");return b[a]};I.prototype.get=I.prototype.get=function(a){return this.da(a)};I.prototype.setElt=I.prototype.gg=function(a,b){var c=this.n;(0>a||a>=c.length)&&w.Ea(a,"0 <= i < length",I,"setElt:i");this.Q&&w.la(this,a);c[a]=b};I.prototype.set=I.prototype.set=function(a,b){this.gg(a,b)}; I.prototype.first=I.prototype.first=function(){var a=this.n;return 0===a.length?null:a[0]};I.prototype.last=I.prototype.ee=function(){var a=this.n,b=a.length;return 0a&&w.Ea(a,">= 0",I,"insertAt:i");this.Q&&w.la(this,a);var c=this.n;a>=c.length?c.push(b):c.splice(a,0,b);this.Fc();return!0}; -I.prototype.remove=I.prototype.remove=function(a){if(null===a)return!1;this.Q&&w.la(this,a);var b=this.n;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Fc();return!0};I.prototype["delete"]=I.prototype.delete=function(a){return this.remove(a)};I.prototype.removeAt=I.prototype.Xc=function(a){var b=this.n;(0>a||a>=b.length)&&w.Ea(a,"0 <= i < length",I,"removeAt:i");this.Q&&w.la(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Fc()}; -I.prototype.removeRange=I.prototype.removeRange=function(a,b){var c=this.n,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.Q&&w.la(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&w.Ea(b,"0 <= from < length",I,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(f=d.slice(0,c),f.sort(a),a=0;a=e)for(f=d.slice(b),f.sort(a),a=b;aa&&w.Ea(a,">= 0",I,"insertAt:i");this.Q&&w.la(this,a);var c=this.n;a>=c.length?c.push(b):c.splice(a,0,b);this.Fc();return!0}; +I.prototype.remove=I.prototype["delete"]=I.prototype.remove=function(a){if(null===a)return!1;this.Q&&w.la(this,a);var b=this.n;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Fc();return!0};I.prototype.removeAt=I.prototype.Yc=function(a){var b=this.n;(0>a||a>=b.length)&&w.Ea(a,"0 <= i < length",I,"removeAt:i");this.Q&&w.la(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Fc()}; +I.prototype.removeRange=I.prototype.removeRange=function(a,b){var c=this.n,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.Q&&w.la(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&w.Ea(b,"0 <= from < length",I,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(f=d.slice(0,c),f.sort(a),a=0;a=e)for(f=d.slice(b),f.sort(a),a=b;a=this.n.length)return va;var a=this.Ob;return null!==a?(a.reset(),a):new ya(this)}); -w.u(I,{Gn:"iteratorBackwards"},function(){if(0>=this.n.length)return va;var a=this.Li;return null!==a?(a.reset(),a):new Aa(this)});function Ba(a){this.Yh=a;a.Ob=null;this.Ta=a.C;this.Va=null}w.$d(Ba,{key:!0,value:!0});w.u(Ba,{i:"iterator"},function(){return this});Ba.prototype.reset=Ba.prototype.reset=function(){var a=this.Yh;a.Ob=null;this.Ta=a.C;this.Va=null}; -Ba.prototype.next=Ba.prototype.next=function(){var a=this.Yh;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.value=b.value,this.key=b.key,!0;this.Gf();return!1};Ba.prototype.hasNext=function(){return this.next()};Ba.prototype.first=Ba.prototype.first=function(){var a=this.Yh;this.Ta=a.C;a=a.Ca;if(null!==a){this.Va=a;var b=a.value;this.key=a.key;return this.value=b}return null}; +w.u(I,{In:"iteratorBackwards"},function(){if(0>=this.n.length)return va;var a=this.Li;return null!==a?(a.reset(),a):new Aa(this)});function Ba(a){this.Yh=a;a.Ob=null;this.Ta=a.C;this.Va=null}w.$d(Ba,{key:!0,value:!0});w.u(Ba,{i:"iterator"},function(){return this});Ba.prototype.reset=Ba.prototype.reset=function(){var a=this.Yh;a.Ob=null;this.Ta=a.C;this.Va=null}; +Ba.prototype.next=Ba.prototype.next=function(){var a=this.Yh;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.value=b.value,this.key=b.key,!0;this.Hf();return!1};Ba.prototype.hasNext=function(){return this.next()};Ba.prototype.first=Ba.prototype.first=function(){var a=this.Yh;this.Ta=a.C;a=a.Ca;if(null!==a){this.Va=a;var b=a.value;this.key=a.key;return this.value=b}return null}; Ba.prototype.any=function(a){var b=this.Yh;b.Ob=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(a(d.value))return!0;b.C!==c&&w.Na(b);d=d.Xa}return!1};Ba.prototype.all=function(a){var b=this.Yh;b.Ob=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(!a(d.value))return!1;b.C!==c&&w.Na(b);d=d.Xa}return!0};Ba.prototype.each=function(a){var b=this.Yh;b.Ob=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;)a(d.value),b.C!==c&&w.Na(b),d=d.Xa;return this}; -Ba.prototype.map=function(a){var b=this.Yh;b.Ob=null;for(var c=new I,d=b.C,e=b.Ca;null!==e;)c.add(a(e.value)),b.C!==d&&w.Na(b),e=e.Xa;return c.i};Ba.prototype.filter=function(a){var b=this.Yh;b.Ob=null;for(var c=new I(b.ma),d=b.C,e=b.Ca;null!==e;){var f=e.value;a(f)&&c.add(f);b.C!==d&&w.Na(b);e=e.Xa}return c.i};Ba.prototype.concat=function(a){this.Yh.Ob=null;return new xa(this,a.i)};w.u(Ba,{count:"count"},function(){return this.Yh.ld}); -Ba.prototype.Gf=function(){this.value=this.key=null;this.Ta=-1;this.Yh.Ob=this};Ba.prototype.toString=function(){return null!==this.Va?"SetIterator@"+this.Va.value:"SetIterator"}; -function J(a){w.lc(this);this.Q=!1;void 0===a||null===a?this.ma=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.ma=a:w.Ea(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.ma=a===Object?"object":a===String?"string":a===Number?"number":a:w.Ea(a,"null, a primitive type name, or a class type","Set constructor: type");this.md={};this.ld=0;this.Ob=null;this.C=0;this.Rh=this.Ca=null}w.fa("Set",J); -J.prototype.Fc=function(){var a=this.C;a++;999999999=this.ld)return va;var a=this.Ob;return null!==a?(a.reset(),a):new Ba(this)});function Da(a){this.Fa=a;this.Ta=a.C;this.Va=null}w.$d(Da,{key:!0,value:!0});w.u(Da,{i:"iterator"},function(){return this});Da.prototype.reset=Da.prototype.reset=function(){this.Ta=this.Fa.C;this.Va=null}; -Da.prototype.next=Da.prototype.next=function(){var a=this.Fa;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.value=this.key=a=b.key,!0;this.Gf();return!1};Da.prototype.hasNext=function(){return this.next()};Da.prototype.first=Da.prototype.first=function(){var a=this.Fa;this.Ta=a.C;a=a.Ca;return null!==a?(this.Va=a,this.value=this.key=a=a.key):null}; +J.prototype.remove=J.prototype["delete"]=J.prototype.remove=function(a){if(null===a)return!1;this.Q&&w.la(this,a);var b=a;if(w.Qa(a)&&(b=w.Kd(a),void 0===b))return!1;a=this.od[b];if(void 0===a)return!1;var c=a.Xa,d=a.jp;null!==c&&(c.jp=d);null!==d&&(d.Xa=c);this.Ca===a&&(this.Ca=c);this.Rh===a&&(this.Rh=d);delete this.od[b];this.nd--;this.Fc();return!0}; +J.prototype.removeAll=J.prototype.Ux=function(a){if(null===a)return this;this.Q&&w.la(this);if(w.isArray(a))for(var b=w.Ya(a),c=0;c=this.nd)return va;var a=this.Ob;return null!==a?(a.reset(),a):new Ba(this)});function Da(a){this.Fa=a;this.Ta=a.C;this.Va=null}w.$d(Da,{key:!0,value:!0});w.u(Da,{i:"iterator"},function(){return this});Da.prototype.reset=Da.prototype.reset=function(){this.Ta=this.Fa.C;this.Va=null}; +Da.prototype.next=Da.prototype.next=function(){var a=this.Fa;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.value=this.key=a=b.key,!0;this.Hf();return!1};Da.prototype.hasNext=function(){return this.next()};Da.prototype.first=Da.prototype.first=function(){var a=this.Fa;this.Ta=a.C;a=a.Ca;return null!==a?(this.Va=a,this.value=this.key=a=a.key):null}; Da.prototype.any=function(a){var b=this.Fa,c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(a(d.key))return!0;b.C!==c&&w.Na(b);d=d.Xa}return!1};Da.prototype.all=function(a){var b=this.Fa,c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(!a(d.key))return!1;b.C!==c&&w.Na(b);d=d.Xa}return!0};Da.prototype.each=function(a){var b=this.Fa,c=b.C;this.Va=null;for(var d=b.Ca;null!==d;)a(d.key),b.C!==c&&w.Na(b),d=d.Xa;return this}; -Da.prototype.map=function(a){var b=this.Fa,c=b.C;this.Va=null;for(var d=new I,e=b.Ca;null!==e;)d.add(a(e.key)),b.C!==c&&w.Na(b),e=e.Xa;return d.i};Da.prototype.filter=function(a){var b=this.Fa,c=b.C;this.Va=null;for(var d=new I(b.Qh),e=b.Ca;null!==e;){var f=e.key;a(f)&&d.add(f);b.C!==c&&w.Na(b);e=e.Xa}return d.i};Da.prototype.concat=function(a){return new xa(this,a.i)};w.u(Da,{count:"count"},function(){return this.Fa.ld});Da.prototype.Gf=function(){this.value=this.key=null;this.Ta=-1}; -Da.prototype.toString=function(){return null!==this.Va?"MapKeySetIterator@"+this.Va.value:"MapKeySetIterator"};function Ea(a){w.lc(this);this.Q=!0;this.Fa=a}w.La(Ea,J);Ea.prototype.freeze=function(){return this};Ea.prototype.Ra=function(){return this};Ea.prototype.toString=function(){return"MapKeySet("+this.Fa.toString()+")"};Ea.prototype.add=Ea.prototype.add=function(){w.k("This Set is read-only: "+this.toString());return!1}; -Ea.prototype.set=Ea.prototype.set=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype.contains=Ea.prototype.contains=function(a){return this.Fa.contains(a)};Ea.prototype.has=Ea.prototype.has=function(a){return this.contains(a)};Ea.prototype.remove=Ea.prototype.remove=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype["delete"]=Ea.prototype.delete=function(){return this.remove()}; -Ea.prototype.clear=Ea.prototype.clear=function(){w.k("This Set is read-only: "+this.toString())};Ea.prototype.first=Ea.prototype.first=function(){var a=this.Fa.Ca;return null!==a?a.key:null};Ea.prototype.any=function(a){for(var b=this.Fa.Ca;null!==b;){if(a(b.key))return!0;b=b.Xa}return!1};Ea.prototype.all=function(a){for(var b=this.Fa.Ca;null!==b;){if(!a(b.key))return!1;b=b.Xa}return!0};Ea.prototype.each=function(a){for(var b=this.Fa.Ca;null!==b;)a(b.key),b=b.Xa;return this}; -Ea.prototype.map=function(a){for(var b=new J,c=this.Fa.Ca;null!==c;)b.add(a(c.key)),c=c.Xa;return b};Ea.prototype.filter=function(a){for(var b=new J(this.Fa.Qh),c=this.Fa.Ca;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Xa}return b};Ea.prototype.concat=function(a){return this.oG().Hc(a)};Ea.prototype.copy=function(){return new Ea(this.Fa)};Ea.prototype.toSet=Ea.prototype.oG=function(){var a=new J(this.Fa.Qh),b=this.Fa.md,c;for(c in b)a.add(b[c].key);return a}; -Ea.prototype.toArray=Ea.prototype.dc=function(){var a=this.Fa.md,b=Array(this.Fa.ld),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Ea.prototype.toList=function(){var a=new I(this.Fa.Qh),b=this.Fa.md,c;for(c in b)a.add(b[c].key);return a};w.u(Ea,{count:"count"},function(){return this.Fa.ld});w.u(Ea,{size:"size"},function(){return this.Fa.ld});w.u(Ea,{i:"iterator"},function(){return 0>=this.Fa.ld?va:new Da(this.Fa)});function Fa(a){this.Fa=a;a.Mi=null;this.Ta=a.C;this.Va=null}w.$d(Fa,{key:!0,value:!0}); -w.u(Fa,{i:"iterator"},function(){return this});Fa.prototype.reset=Fa.prototype.reset=function(){var a=this.Fa;a.Mi=null;this.Ta=a.C;this.Va=null};Fa.prototype.next=Fa.prototype.next=function(){var a=this.Fa;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.value=b.value,this.key=b.key,!0;this.Gf();return!1};Fa.prototype.hasNext=function(){return this.next()}; +Da.prototype.map=function(a){var b=this.Fa,c=b.C;this.Va=null;for(var d=new I,e=b.Ca;null!==e;)d.add(a(e.key)),b.C!==c&&w.Na(b),e=e.Xa;return d.i};Da.prototype.filter=function(a){var b=this.Fa,c=b.C;this.Va=null;for(var d=new I(b.Qh),e=b.Ca;null!==e;){var f=e.key;a(f)&&d.add(f);b.C!==c&&w.Na(b);e=e.Xa}return d.i};Da.prototype.concat=function(a){return new xa(this,a.i)};w.u(Da,{count:"count"},function(){return this.Fa.nd});Da.prototype.Hf=function(){this.value=this.key=null;this.Ta=-1}; +Da.prototype.toString=function(){return null!==this.Va?"MapKeySetIterator@"+this.Va.value:"MapKeySetIterator"};function Ea(a){w.mc(this);this.Q=!0;this.Fa=a}w.La(Ea,J);Ea.prototype.freeze=function(){return this};Ea.prototype.Ra=function(){return this};Ea.prototype.toString=function(){return"MapKeySet("+this.Fa.toString()+")"};Ea.prototype.add=Ea.prototype.add=function(){w.k("This Set is read-only: "+this.toString());return!1}; +Ea.prototype.set=Ea.prototype.set=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype.contains=Ea.prototype.contains=function(a){return this.Fa.contains(a)};Ea.prototype.has=Ea.prototype.has=function(a){return this.contains(a)};Ea.prototype.remove=Ea.prototype["delete"]=Ea.prototype.remove=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype.clear=Ea.prototype.clear=function(){w.k("This Set is read-only: "+this.toString())}; +Ea.prototype.first=Ea.prototype.first=function(){var a=this.Fa.Ca;return null!==a?a.key:null};Ea.prototype.any=function(a){for(var b=this.Fa.Ca;null!==b;){if(a(b.key))return!0;b=b.Xa}return!1};Ea.prototype.all=function(a){for(var b=this.Fa.Ca;null!==b;){if(!a(b.key))return!1;b=b.Xa}return!0};Ea.prototype.each=function(a){for(var b=this.Fa.Ca;null!==b;)a(b.key),b=b.Xa;return this};Ea.prototype.map=function(a){for(var b=new J,c=this.Fa.Ca;null!==c;)b.add(a(c.key)),c=c.Xa;return b}; +Ea.prototype.filter=function(a){for(var b=new J(this.Fa.Qh),c=this.Fa.Ca;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Xa}return b};Ea.prototype.concat=function(a){return this.rG().Hc(a)};Ea.prototype.copy=function(){return new Ea(this.Fa)};Ea.prototype.toSet=Ea.prototype.rG=function(){var a=new J(this.Fa.Qh),b=this.Fa.od,c;for(c in b)a.add(b[c].key);return a};Ea.prototype.toArray=Ea.prototype.ec=function(){var a=this.Fa.od,b=Array(this.Fa.nd),c=0,d;for(d in a)b[c]=a[d].key,c++;return b}; +Ea.prototype.toList=function(){var a=new I(this.Fa.Qh),b=this.Fa.od,c;for(c in b)a.add(b[c].key);return a};w.u(Ea,{count:"count"},function(){return this.Fa.nd});w.u(Ea,{size:"size"},function(){return this.Fa.nd});w.u(Ea,{i:"iterator"},function(){return 0>=this.Fa.nd?va:new Da(this.Fa)});function Fa(a){this.Fa=a;a.Mi=null;this.Ta=a.C;this.Va=null}w.$d(Fa,{key:!0,value:!0});w.u(Fa,{i:"iterator"},function(){return this}); +Fa.prototype.reset=Fa.prototype.reset=function(){var a=this.Fa;a.Mi=null;this.Ta=a.C;this.Va=null};Fa.prototype.next=Fa.prototype.next=function(){var a=this.Fa;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.value=b.value,this.key=b.key,!0;this.Hf();return!1};Fa.prototype.hasNext=function(){return this.next()}; Fa.prototype.first=Fa.prototype.first=function(){var a=this.Fa;this.Ta=a.C;a=a.Ca;if(null!==a){this.Va=a;var b=a.value;this.key=a.key;return this.value=b}return null};Fa.prototype.any=function(a){var b=this.Fa;b.Mi=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(a(d.value))return!0;b.C!==c&&w.Na(b);d=d.Xa}return!1};Fa.prototype.all=function(a){var b=this.Fa;b.Mi=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(!a(d.value))return!1;b.C!==c&&w.Na(b);d=d.Xa}return!0}; Fa.prototype.each=function(a){var b=this.Fa;b.Mi=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;)a(d.value),b.C!==c&&w.Na(b),d=d.Xa;return this};Fa.prototype.map=function(a){var b=this.Fa;b.Mi=null;var c=b.C;this.Va=null;for(var d=new I,e=b.Ca;null!==e;)d.add(a(e.value)),b.C!==c&&w.Na(b),e=e.Xa;return d.i};Fa.prototype.filter=function(a){var b=this.Fa;b.Mi=null;var c=b.C;this.Va=null;for(var d=new I(b.Qh),e=b.Ca;null!==e;){var f=e.value;a(f)&&d.add(f);b.C!==c&&w.Na(b);e=e.Xa}return d.i}; -Fa.prototype.concat=function(a){this.Fa.Mi=null;return new xa(this,a.i)};w.u(Fa,{count:"count"},function(){return this.Fa.ld});Fa.prototype.Gf=function(){this.value=this.key=null;this.Ta=-1;this.Fa.Mi=this};Fa.prototype.toString=function(){return null!==this.Va?"MapValueSetIterator@"+this.Va.value:"MapValueSetIterator"};function Ca(a,b){this.key=a;this.value=b;this.hp=this.Xa=null}w.$d(Ca,{key:!0,value:!0});Ca.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; -function Ga(a){this.Fa=a;a.Ob=null;this.Ta=a.C;this.Va=null}w.$d(Ga,{key:!0,value:!0});w.u(Ga,{i:"iterator"},function(){return this});Ga.prototype.reset=Ga.prototype.reset=function(){var a=this.Fa;a.Ob=null;this.Ta=a.C;this.Va=null};Ga.prototype.next=Ga.prototype.next=function(){var a=this.Fa;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.key=b.key,this.value=b.value,!0;this.Gf();return!1};Ga.prototype.hasNext=function(){return this.next()}; +Fa.prototype.concat=function(a){this.Fa.Mi=null;return new xa(this,a.i)};w.u(Fa,{count:"count"},function(){return this.Fa.nd});Fa.prototype.Hf=function(){this.value=this.key=null;this.Ta=-1;this.Fa.Mi=this};Fa.prototype.toString=function(){return null!==this.Va?"MapValueSetIterator@"+this.Va.value:"MapValueSetIterator"};function Ca(a,b){this.key=a;this.value=b;this.jp=this.Xa=null}w.$d(Ca,{key:!0,value:!0});Ca.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; +function Ga(a){this.Fa=a;a.Ob=null;this.Ta=a.C;this.Va=null}w.$d(Ga,{key:!0,value:!0});w.u(Ga,{i:"iterator"},function(){return this});Ga.prototype.reset=Ga.prototype.reset=function(){var a=this.Fa;a.Ob=null;this.Ta=a.C;this.Va=null};Ga.prototype.next=Ga.prototype.next=function(){var a=this.Fa;if(a.C!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Va,b=null===b?a.Ca:b.Xa;if(null!==b)return this.Va=b,this.key=b.key,this.value=b.value,!0;this.Hf();return!1};Ga.prototype.hasNext=function(){return this.next()}; Ga.prototype.first=Ga.prototype.first=function(){var a=this.Fa;this.Ta=a.C;a=a.Ca;return null!==a?(this.Va=a,this.key=a.key,this.value=a.value,a):null};Ga.prototype.any=function(a){var b=this.Fa;b.Ob=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(a(d))return!0;b.C!==c&&w.Na(b);d=d.Xa}return!1};Ga.prototype.all=function(a){var b=this.Fa;b.Ob=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;){if(!a(d))return!1;b.C!==c&&w.Na(b);d=d.Xa}return!0}; Ga.prototype.each=function(a){var b=this.Fa;b.Ob=null;var c=b.C;this.Va=null;for(var d=b.Ca;null!==d;)a(d),b.C!==c&&w.Na(b),d=d.Xa;return this};Ga.prototype.map=function(a){var b=this.Fa;b.Ob=null;var c=b.C;this.Va=null;for(var d=new I,e=b.Ca;null!==e;)d.add(a(e)),b.C!==c&&w.Na(b),e=e.Xa;return d.i};Ga.prototype.filter=function(a){var b=this.Fa;b.Ob=null;var c=b.C;this.Va=null;for(var d=new I,e=b.Ca;null!==e;)a(e)&&d.add(e),b.C!==c&&w.Na(b),e=e.Xa;return d.i}; -Ga.prototype.concat=function(a){this.Fa.Ob=null;return new xa(this,a.i)};w.u(Ga,{count:"count"},function(){return this.Fa.ld});Ga.prototype.Gf=function(){this.value=this.key=null;this.Ta=-1;this.Fa.Ob=this};Ga.prototype.toString=function(){return null!==this.Va?"MapIterator@"+this.Va:"MapIterator"}; -function ka(a,b){w.lc(this);this.Q=!1;void 0===a||null===a?this.Qh=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.Qh=a:w.Ea(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.Qh=a===Object?"object":a===String?"string":a===Number?"number":a:w.Ea(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.qt=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"=== -b||"function"===b?this.qt=b:w.Ea(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.qt=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:w.Ea(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.md={};this.ld=0;this.Mi=this.Ob=null;this.C=0;this.Rh=this.Ca=null}w.fa("Map",ka); -ka.prototype.Fc=function(){var a=this.C;a++;999999999=this.count)return va;var a=this.Ob;return null!==a?(a.reset(),a):new Ga(this)});w.u(ka,{pF:"iteratorKeys"},function(){return 0>=this.count?va:new Da(this)});w.u(ka,{qF:"iteratorValues"},function(){if(0>=this.count)return va;var a=this.Mi;return null!==a?(a.reset(),a):new Fa(this)});function z(a,b){void 0===a?this.y=this.x=0:(this.x=a,this.y=b)}w.fa("Point",z);w.ji(z);w.$d(z,{x:!0,y:!0}); -z.prototype.assign=function(a){this.x=a.x;this.y=a.y};z.prototype.setTo=z.prototype.l=function(a,b){this.x=a;this.y=b;return this};z.prototype.set=z.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};z.prototype.copy=function(){var a=new z;a.x=this.x;a.y=this.y;return a};z.prototype.Ga=function(){Object.freeze(this);return this};z.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};z.prototype.freeze=function(){return this}; -z.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};z.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new z(c,e)}return new z};z.stringify=function(a){return a.x.toString()+" "+a.y.toString()};z.prototype.toString=function(){return"Point("+this.x+","+this.y+")"}; -z.prototype.equals=z.prototype.L=function(a){return a instanceof z?this.x===a.x&&this.y===a.y:!1};z.prototype.equalTo=z.prototype.ex=function(a,b){return this.x===a&&this.y===b};z.prototype.equalsApprox=z.prototype.Ic=function(a){return K(this.x,a.x)&&K(this.y,a.y)};z.prototype.add=z.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};z.prototype.subtract=z.prototype.Yn=function(a){this.x-=a.x;this.y-=a.y;return this}; -z.prototype.offset=z.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};z.prototype.rotate=z.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.x=d*b-e*c;this.y=e*b+d*c;return this};z.prototype.scale=z.prototype.scale=function(a,b){this.x*=a;this.y*=b;return this}; -z.prototype.distanceSquaredPoint=z.prototype.uf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};z.prototype.distanceSquared=z.prototype.Sp=function(a,b){var c=a-this.x,d=b-this.y;return c*c+d*d};z.prototype.normalize=z.prototype.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}z.prototype.projectOntoLineSegment=function(a,b,c,d){Ia(a,b,c,d,this.x,this.y,this);return this};z.prototype.projectOntoLineSegmentPoint=function(a,b){Ia(a.x,a.y,b.x,b.y,this.x,this.y,this);return this}; -z.prototype.snapToGrid=function(a,b,c,d){Ka(this.x,this.y,a,b,c,d,this);return this};z.prototype.snapToGridPoint=function(a,b){Ka(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};z.prototype.setRectSpot=z.prototype.Vn=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};z.prototype.setSpot=z.prototype.Hu=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};z.prototype.transform=function(a){a.nb(this);return this}; -function La(a,b){b.li(a);return a}var Ma;z.distanceLineSegmentSquared=Ma=function(a,b,c,d,e,f){var h=e-c,k=f-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=f-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var Na;z.distanceSquared=Na=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};var Oa; -z.direction=Oa=function(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};z.prototype.isReal=z.prototype.H=function(){return isFinite(this.x)&&isFinite(this.y)};function ha(a,b){void 0===a?this.height=this.width=0:(this.width=a,this.height=b)}w.fa("Size",ha);w.ji(ha);w.$d(ha,{width:!0,height:!0}); -ha.prototype.assign=function(a){this.width=a.width;this.height=a.height};ha.prototype.setTo=ha.prototype.l=function(a,b){this.width=a;this.height=b;return this};ha.prototype.set=ha.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};ha.prototype.copy=function(){var a=new ha;a.width=this.width;a.height=this.height;return a};ha.prototype.Ga=function(){Object.freeze(this);return this};ha.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()}; -ha.prototype.freeze=function(){return this};ha.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};ha.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new ha(c,e)}return new ha};ha.stringify=function(a){return a.width.toString()+" "+a.height.toString()}; -ha.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};ha.prototype.equals=ha.prototype.L=function(a){return a instanceof ha?this.width===a.width&&this.height===a.height:!1};ha.prototype.equalTo=ha.prototype.ex=function(a,b){return this.width===a&&this.height===b};ha.prototype.equalsApprox=ha.prototype.Ic=function(a){return K(this.width,a.width)&&K(this.height,a.height)};ha.prototype.isReal=ha.prototype.H=function(){return isFinite(this.width)&&isFinite(this.height)}; +ka.prototype.filter=function(a){for(var b=new ka(this.Qh,this.pt),c=this.C,d=this.Ca;null!==d;)a(d)&&b.add(d.key,d.value),this.C!==c&&w.Na(this),d=d.Xa;return b};ka.prototype.concat=function(a){return this.copy().Hc(a)};ka.prototype.contains=ka.prototype.contains=function(a){var b=a;return w.Qa(a)&&(b=w.Kd(a),void 0===b)?!1:void 0!==this.od[b]};ka.prototype.has=ka.prototype.has=function(a){return this.contains(a)}; +ka.prototype.getValue=ka.prototype.ja=function(a){var b=a;if(w.Qa(a)&&(b=w.Kd(a),void 0===b))return null;a=this.od[b];return void 0===a?null:a.value};ka.prototype.get=ka.prototype.get=function(a){return this.ja(a)}; +ka.prototype.remove=ka.prototype["delete"]=ka.prototype.remove=function(a){if(null===a)return!1;this.Q&&w.la(this,a);var b=a;if(w.Qa(a)&&(b=w.Kd(a),void 0===b))return!1;a=this.od[b];if(void 0===a)return!1;var c=a.Xa,d=a.jp;null!==c&&(c.jp=d);null!==d&&(d.Xa=c);this.Ca===a&&(this.Ca=c);this.Rh===a&&(this.Rh=d);delete this.od[b];this.nd--;this.Fc();return!0};ka.prototype.clear=ka.prototype.clear=function(){this.Q&&w.la(this);this.od={};this.nd=0;this.Rh=this.Ca=null;this.Fc()}; +ka.prototype.copy=function(){var a=new ka(this.Qh,this.pt),b=this.od,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};ka.prototype.toArray=ka.prototype.ec=function(){var a=this.od,b=Array(this.nd),c=0,d;for(d in a){var e=a[d];b[c]=new Ca(e.key,e.value);c++}return b};ka.prototype.toKeySet=ka.prototype.Gj=function(){return new Ea(this)};w.u(ka,{count:"count"},function(){return this.nd});w.u(ka,{size:"size"},function(){return this.nd}); +w.u(ka,{i:"iterator"},function(){if(0>=this.count)return va;var a=this.Ob;return null!==a?(a.reset(),a):new Ga(this)});w.u(ka,{sF:"iteratorKeys"},function(){return 0>=this.count?va:new Da(this)});w.u(ka,{tF:"iteratorValues"},function(){if(0>=this.count)return va;var a=this.Mi;return null!==a?(a.reset(),a):new Fa(this)});function z(a,b){void 0===a?this.y=this.x=0:(this.x=a,this.y=b)}w.fa("Point",z);w.ji(z);w.$d(z,{x:!0,y:!0});z.prototype.assign=function(a){this.x=a.x;this.y=a.y}; +z.prototype.setTo=z.prototype.m=function(a,b){this.x=a;this.y=b;return this};z.prototype.set=z.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};z.prototype.copy=function(){var a=new z;a.x=this.x;a.y=this.y;return a};z.prototype.Ga=function(){Object.freeze(this);return this};z.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};z.prototype.freeze=function(){return this};z.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this}; +z.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new z(c,e)}return new z};z.stringify=function(a){return a.x.toString()+" "+a.y.toString()};z.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};z.prototype.equals=z.prototype.L=function(a){return a instanceof z?this.x===a.x&&this.y===a.y:!1}; +z.prototype.equalTo=z.prototype.bx=function(a,b){return this.x===a&&this.y===b};z.prototype.equalsApprox=z.prototype.Ic=function(a){return K(this.x,a.x)&&K(this.y,a.y)};z.prototype.add=z.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};z.prototype.subtract=z.prototype.$n=function(a){this.x-=a.x;this.y-=a.y;return this};z.prototype.offset=z.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this}; +z.prototype.rotate=z.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.x=d*b-e*c;this.y=e*b+d*c;return this};z.prototype.scale=z.prototype.scale=function(a,b){this.x*=a;this.y*=b;return this};z.prototype.distanceSquaredPoint=z.prototype.uf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a}; +z.prototype.distanceSquared=z.prototype.Rp=function(a,b){var c=a-this.x,d=b-this.y;return c*c+d*d};z.prototype.normalize=z.prototype.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}z.prototype.projectOntoLineSegment=function(a,b,c,d){Ia(a,b,c,d,this.x,this.y,this);return this};z.prototype.projectOntoLineSegmentPoint=function(a,b){Ia(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};z.prototype.snapToGrid=function(a,b,c,d){Ka(this.x,this.y,a,b,c,d,this);return this}; +z.prototype.snapToGridPoint=function(a,b){Ka(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};z.prototype.setRectSpot=z.prototype.Xn=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};z.prototype.setSpot=z.prototype.Gu=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};z.prototype.transform=function(a){a.nb(this);return this};function La(a,b){b.li(a);return a}var Ma; +z.distanceLineSegmentSquared=Ma=function(a,b,c,d,e,f){var h=e-c,k=f-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=f-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var Na;z.distanceSquared=Na=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};var Oa;z.direction=Oa=function(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}; +z.prototype.isReal=z.prototype.H=function(){return isFinite(this.x)&&isFinite(this.y)};function ha(a,b){void 0===a?this.height=this.width=0:(this.width=a,this.height=b)}w.fa("Size",ha);w.ji(ha);w.$d(ha,{width:!0,height:!0});ha.prototype.assign=function(a){this.width=a.width;this.height=a.height};ha.prototype.setTo=ha.prototype.m=function(a,b){this.width=a;this.height=b;return this};ha.prototype.set=ha.prototype.set=function(a){this.width=a.width;this.height=a.height;return this}; +ha.prototype.copy=function(){var a=new ha;a.width=this.width;a.height=this.height;return a};ha.prototype.Ga=function(){Object.freeze(this);return this};ha.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};ha.prototype.freeze=function(){return this};ha.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this}; +ha.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new ha(c,e)}return new ha};ha.stringify=function(a){return a.width.toString()+" "+a.height.toString()};ha.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};ha.prototype.equals=ha.prototype.L=function(a){return a instanceof ha?this.width===a.width&&this.height===a.height:!1}; +ha.prototype.equalTo=ha.prototype.bx=function(a,b){return this.width===a&&this.height===b};ha.prototype.equalsApprox=ha.prototype.Ic=function(a){return K(this.width,a.width)&&K(this.height,a.height)};ha.prototype.isReal=ha.prototype.H=function(){return isFinite(this.width)&&isFinite(this.height)}; function A(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof z?b instanceof z?(this.x=Math.min(a.x,b.x),this.y=Math.min(a.y,b.y),this.width=Math.abs(a.x-b.x),this.height=Math.abs(a.y-b.y)):b instanceof ha?(this.x=a.x,this.y=a.y,this.width=b.width,this.height=b.height):w.k("Incorrect arguments supplied to Rect constructor"):(this.x=a,this.y=b,this.width=c,this.height=d)}w.fa("Rect",A);w.ji(A);w.$d(A,{x:!0,y:!0,width:!0,height:!0}); -A.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height};function Pa(a,b,c){a.width=b;a.height=c}A.prototype.setTo=A.prototype.l=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};A.prototype.set=A.prototype.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};A.prototype.setPoint=A.prototype.Tg=function(a){this.x=a.x;this.y=a.y;return this}; +A.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height};function Pa(a,b,c){a.width=b;a.height=c}A.prototype.setTo=A.prototype.m=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};A.prototype.set=A.prototype.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};A.prototype.setPoint=A.prototype.Ug=function(a){this.x=a.x;this.y=a.y;return this}; A.prototype.setSize=function(a){this.width=a.width;this.height=a.height;return this};A.prototype.copy=function(){var a=new A;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};A.prototype.Ga=function(){Object.freeze(this);return this};A.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};A.prototype.freeze=function(){return this};A.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this}; A.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new A(c,e,f,h)}return new A};A.stringify=function(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}; -A.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};A.prototype.equals=A.prototype.L=function(a){return a instanceof A?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};A.prototype.equalTo=A.prototype.ex=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};A.prototype.equalsApprox=A.prototype.Ic=function(a){return K(this.x,a.x)&&K(this.y,a.y)&&K(this.width,a.width)&&K(this.height,a.height)}; -function Qa(a,b){return Xa(a.x,b.x)&&Xa(a.y,b.y)&&Xa(a.width,b.width)&&Xa(a.height,b.height)}A.prototype.containsPoint=A.prototype.Ha=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};A.prototype.containsRect=A.prototype.vk=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height}; -A.prototype.contains=A.prototype.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};A.prototype.reset=function(){this.height=this.width=this.y=this.x=0};A.prototype.offset=A.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};A.prototype.inflate=A.prototype.Sf=function(a,b){return Za(this,b,a,b,a)};A.prototype.addMargin=A.prototype.Jw=function(a){return Za(this,a.top,a.right,a.bottom,a.left)}; -A.prototype.subtractMargin=A.prototype.EJ=function(a){return Za(this,-a.top,-a.right,-a.bottom,-a.left)};A.prototype.grow=function(a,b,c,d){return Za(this,a,b,c,d)};function Za(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}A.prototype.intersectRect=function(a){return $a(this,a.x,a.y,a.width,a.height)};A.prototype.intersect=A.prototype.$E=function(a,b,c,d){return $a(this,a,b,c,d)}; -function $a(a,b,c,d,e){var f=Math.max(a.x,b),h=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=h;a.width=Math.max(0,b-f);a.height=Math.max(0,c-h);return a}A.prototype.intersectsRect=A.prototype.Kg=function(a){return this.aF(a.x,a.y,a.width,a.height)}; -A.prototype.intersects=A.prototype.aF=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};function ab(a,b){var c=a.width,d=b.width+10+10,e=a.x,f=b.x-10;if(e>d+f||f>c+e)return!1;c=a.height;d=b.height+10+10;e=a.y;f=b.y-10;return e>d+f||f>c+e?!1:!0}A.prototype.unionPoint=A.prototype.ri=function(a){return bb(this,a.x,a.y,0,0)}; -A.prototype.unionRect=A.prototype.Gh=function(a){return bb(this,a.x,a.y,a.width,a.height)};A.prototype.union=A.prototype.tG=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return bb(this,a,b,c,d)};function bb(a,b,c,d,e){var f=Math.min(a.x,b),h=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=h;a.width=b-f;a.height=c-h;return a}A.prototype.setSpot=A.prototype.Hu=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this}; -var db;A.contains=db=function(a,b,c,d,e,f,h,k){void 0===h&&(h=0);void 0===k&&(k=0);return a<=e&&e+h<=a+c&&b<=f&&f+k<=b+d};A.intersects=function(a,b,c,d,e,f,h,k){c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=f;return b>k||f>a?!1:!0};w.defineProperty(A,{left:"left"},function(){return this.x},function(a){this.x=a});w.defineProperty(A,{top:"top"},function(){return this.y},function(a){this.y=a});w.defineProperty(A,{right:"right"},function(){return this.x+this.width},function(a){this.x+=a-(this.x+this.width)}); +A.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};A.prototype.equals=A.prototype.L=function(a){return a instanceof A?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};A.prototype.equalTo=A.prototype.bx=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};A.prototype.equalsApprox=A.prototype.Ic=function(a){return K(this.x,a.x)&&K(this.y,a.y)&&K(this.width,a.width)&&K(this.height,a.height)}; +function Qa(a,b){return Va(a.x,b.x)&&Va(a.y,b.y)&&Va(a.width,b.width)&&Va(a.height,b.height)}A.prototype.containsPoint=A.prototype.Ha=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};A.prototype.containsRect=A.prototype.wk=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height}; +A.prototype.contains=A.prototype.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};A.prototype.reset=function(){this.height=this.width=this.y=this.x=0};A.prototype.offset=A.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};A.prototype.inflate=A.prototype.xf=function(a,b){return Xa(this,b,a,b,a)};A.prototype.addMargin=A.prototype.Iw=function(a){return Xa(this,a.top,a.right,a.bottom,a.left)}; +A.prototype.subtractMargin=A.prototype.HJ=function(a){return Xa(this,-a.top,-a.right,-a.bottom,-a.left)};A.prototype.grow=function(a,b,c,d){return Xa(this,a,b,c,d)};function Xa(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}A.prototype.intersectRect=function(a){return Ya(this,a.x,a.y,a.width,a.height)};A.prototype.intersect=A.prototype.cF=function(a,b,c,d){return Ya(this,a,b,c,d)}; +function Ya(a,b,c,d,e){var f=Math.max(a.x,b),h=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=h;a.width=Math.max(0,b-f);a.height=Math.max(0,c-h);return a}A.prototype.intersectsRect=A.prototype.Tf=function(a){return this.dF(a.x,a.y,a.width,a.height)}; +A.prototype.intersects=A.prototype.dF=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};function $a(a,b){var c=a.width,d=b.width+10+10,e=a.x,f=b.x-10;if(e>d+f||f>c+e)return!1;c=a.height;d=b.height+10+10;e=a.y;f=b.y-10;return e>d+f||f>c+e?!1:!0}A.prototype.unionPoint=A.prototype.ri=function(a){return ab(this,a.x,a.y,0,0)}; +A.prototype.unionRect=A.prototype.Gh=function(a){return ab(this,a.x,a.y,a.width,a.height)};A.prototype.union=A.prototype.wG=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return ab(this,a,b,c,d)};function ab(a,b,c,d,e){var f=Math.min(a.x,b),h=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=h;a.width=b-f;a.height=c-h;return a}A.prototype.setSpot=A.prototype.Gu=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this}; +var cb;A.contains=cb=function(a,b,c,d,e,f,h,k){void 0===h&&(h=0);void 0===k&&(k=0);return a<=e&&e+h<=a+c&&b<=f&&f+k<=b+d};A.intersects=function(a,b,c,d,e,f,h,k){c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=f;return b>k||f>a?!1:!0};w.defineProperty(A,{left:"left"},function(){return this.x},function(a){this.x=a});w.defineProperty(A,{top:"top"},function(){return this.y},function(a){this.y=a});w.defineProperty(A,{right:"right"},function(){return this.x+this.width},function(a){this.x+=a-(this.x+this.width)}); w.defineProperty(A,{bottom:"bottom"},function(){return this.y+this.height},function(a){this.y+=a-(this.y+this.height)});w.defineProperty(A,{position:"position"},function(){return new z(this.x,this.y)},function(a){this.x=a.x;this.y=a.y});w.defineProperty(A,{size:"size"},function(){return new ha(this.width,this.height)},function(a){this.width=a.width;this.height=a.height}); -w.defineProperty(A,{Gl:"center"},function(){return new z(this.x+this.width/2,this.y+this.height/2)},function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2});w.defineProperty(A,{ja:"centerX"},function(){return this.x+this.width/2},function(a){this.x=a-this.width/2});w.defineProperty(A,{ra:"centerY"},function(){return this.y+this.height/2},function(a){this.y=a-this.height/2});A.prototype.isReal=A.prototype.H=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}; -A.prototype.isEmpty=function(){return 0===this.width&&0===this.height};function eb(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):w.k("Invalid arguments to Margin constructor")}w.fa("Margin",eb);w.ji(eb);w.$d(eb,{top:!0,right:!0,bottom:!0,left:!0}); -eb.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left};eb.prototype.setTo=eb.prototype.l=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};eb.prototype.set=eb.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};eb.prototype.copy=function(){var a=new eb;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a}; -eb.prototype.Ga=function(){Object.freeze(this);return this};eb.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};eb.prototype.freeze=function(){return this};eb.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this}; -eb.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new eb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new eb(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new eb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new eb(c,e):new eb(c,e,f,h)}return new eb}; -eb.stringify=function(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()};eb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};eb.prototype.equals=eb.prototype.L=function(a){return a instanceof eb?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1}; -eb.prototype.equalTo=eb.prototype.ex=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};eb.prototype.equalsApprox=eb.prototype.Ic=function(a){return K(this.top,a.top)&&K(this.right,a.right)&&K(this.bottom,a.bottom)&&K(this.left,a.left)};eb.prototype.isReal=eb.prototype.H=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function ia(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}w.ji(ia); +w.defineProperty(A,{Hl:"center"},function(){return new z(this.x+this.width/2,this.y+this.height/2)},function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2});w.defineProperty(A,{ka:"centerX"},function(){return this.x+this.width/2},function(a){this.x=a-this.width/2});w.defineProperty(A,{ra:"centerY"},function(){return this.y+this.height/2},function(a){this.y=a-this.height/2});A.prototype.isReal=A.prototype.H=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}; +A.prototype.isEmpty=function(){return 0===this.width&&0===this.height};function db(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):w.k("Invalid arguments to Margin constructor")}w.fa("Margin",db);w.ji(db);w.$d(db,{top:!0,right:!0,bottom:!0,left:!0}); +db.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left};db.prototype.setTo=db.prototype.m=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};db.prototype.set=db.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};db.prototype.copy=function(){var a=new db;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a}; +db.prototype.Ga=function(){Object.freeze(this);return this};db.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};db.prototype.freeze=function(){return this};db.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this}; +db.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new db;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new db(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new db(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new db(c,e):new db(c,e,f,h)}return new db}; +db.stringify=function(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()};db.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};db.prototype.equals=db.prototype.L=function(a){return a instanceof db?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1}; +db.prototype.equalTo=db.prototype.bx=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};db.prototype.equalsApprox=db.prototype.Ic=function(a){return K(this.top,a.top)&&K(this.right,a.right)&&K(this.bottom,a.bottom)&&K(this.left,a.left)};db.prototype.isReal=db.prototype.H=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function ia(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}w.ji(ia); w.$d(ia,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});ia.prototype.set=ia.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};ia.prototype.copy=function(){var a=new ia;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};ia.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}; -ia.prototype.equals=ia.prototype.L=function(a){return a instanceof ia?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};ia.prototype.isIdentity=ia.prototype.cu=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};ia.prototype.reset=ia.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; +ia.prototype.equals=ia.prototype.L=function(a){return a instanceof ia?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};ia.prototype.isIdentity=ia.prototype.bu=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};ia.prototype.reset=ia.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; ia.prototype.multiply=ia.prototype.multiply=function(a){var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,f=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; -ia.prototype.multiplyInverted=ia.prototype.yF=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;f=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=f;this.dy=h;return this}; -ia.prototype.invert=ia.prototype.qx=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; +ia.prototype.multiplyInverted=ia.prototype.BF=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;f=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=f;this.dy=h;return this}; +ia.prototype.invert=ia.prototype.px=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; ia.prototype.rotate=ia.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);var d=0,e=0;90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(e=a*Math.PI/180,d=Math.cos(e),e=Math.sin(e));a=this.m12*d+this.m22*e;var f=this.m11*-e+this.m21*d,h=this.m12*-e+this.m22*d;this.m11=this.m11*d+this.m21*e;this.m12=a;this.m21=f;this.m22=h;this.translate(-b,-c);return this}; ia.prototype.translate=ia.prototype.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};ia.prototype.scale=ia.prototype.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};ia.prototype.transformPoint=ia.prototype.nb=function(a){var b=a.x,c=a.y;a.x=b*this.m11+c*this.m21+this.dx;a.y=b*this.m12+c*this.m22+this.dy;return a}; ia.prototype.invertedTransformPoint=ia.prototype.li=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),f=a.x,h=a.y;a.x=f*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.y=f*c+h*d+e;return a}; -ia.prototype.transformRect=ia.prototype.sG=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*f+c*k+m,q=b*h+c*l+n,r=d*f+c*k+m,c=d*h+c*l+n,s=b*f+e*k+m,b=b*h+e*l+n,f=d*f+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,f),e=Math.max(e,f),h=Math.min(h,d),q=Math.max(q,d);a.x=p;a.y=h;a.width=e-p;a.height=q-h;return a}; -function L(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d)}w.fa("Spot",L);w.ji(L);w.$d(L,{x:!0,y:!0,offsetX:!0,offsetY:!0});L.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY};L.prototype.setTo=L.prototype.l=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this}; +ia.prototype.transformRect=ia.prototype.vG=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*f+c*k+m,q=b*h+c*l+n,r=d*f+c*k+m,c=d*h+c*l+n,s=b*f+e*k+m,b=b*h+e*l+n,f=d*f+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,f),e=Math.max(e,f),h=Math.min(h,d),q=Math.max(q,d);a.x=p;a.y=h;a.width=e-p;a.height=q-h;return a}; +function L(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d)}w.fa("Spot",L);w.ji(L);w.$d(L,{x:!0,y:!0,offsetX:!0,offsetY:!0});L.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY};L.prototype.setTo=L.prototype.m=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this}; L.prototype.set=L.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};L.prototype.copy=function(){var a=new L;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};L.prototype.Ga=function(){Object.freeze(this);return this};L.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};L.prototype.freeze=function(){return this}; -L.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};function gb(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a}var rb; -L.parse=rb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return sb;if("TopLeft"===a)return vb;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return wb;if("TopRight"===a)return Ab;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Eb;if("Center"===a)return Fb;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Hb;if("BottomLeft"===a)return Ib;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Jb;if("BottomRight"===a)return Kb;if("TopSide"===a)return Sb;if("LeftSide"=== -a)return Tb;if("RightSide"===a)return Ub;if("BottomSide"===a)return Vb;if("TopBottomSides"===a)return Yb;if("LeftRightSides"===a)return Zb;if("TopLeftSides"===a)return $b;if("TopRightSides"===a)return ac;if("BottomLeftSides"===a)return bc;if("BottomRightSides"===a)return cc;if("NotTopSide"===a)return dc;if("NotLeftSide"===a)return kc;if("NotRightSide"===a)return lc;if("NotBottomSide"===a)return mc;if("AllSides"===a)return nc;if("Default"===a)return oc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; +L.prototype.Ra=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};function fb(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a}var sb; +L.parse=sb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return tb;if("TopLeft"===a)return xb;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return yb;if("TopRight"===a)return Bb;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Fb;if("Center"===a)return Gb;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Ib;if("BottomLeft"===a)return Jb;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Kb;if("BottomRight"===a)return Lb;if("TopSide"===a)return Tb;if("LeftSide"=== +a)return Ub;if("RightSide"===a)return Vb;if("BottomSide"===a)return Wb;if("TopBottomSides"===a)return Zb;if("LeftRightSides"===a)return $b;if("TopLeftSides"===a)return ac;if("TopRightSides"===a)return bc;if("BottomLeftSides"===a)return cc;if("BottomRightSides"===a)return dc;if("NotTopSide"===a)return ec;if("NotLeftSide"===a)return nc;if("NotRightSide"===a)return oc;if("NotBottomSide"===a)return pc;if("AllSides"===a)return qc;if("Default"===a)return rc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0b.offset?1:-1});for(k=0;k=2*Math.PI?(Oc(a,b,c,d,e,e+Math.PI,h),Oc(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,f])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k===!!h?0:1,0!==a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,f]))}}function Nc(a,b,c,d,e,f,h){var k=new Hc;k.Sb=[b,c,d,e,f,h];b={};Qc(a,"g",b,k);k=a.addElement("g",b);a.wf.push(k)} -g.$a=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+w.mm++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,f,h;c=Mc(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",GL:this.shadowBlur/2});d=Mc(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=Mc(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});f=Mc(this,"feOffset",{"in":"comp",result:"offsetBlur", -dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=Mc(this,"feMerge",{});h.appendChild(Mc(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(Mc(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);b.appendChild(h);0b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.Tq?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.Tq?this.clip():this.fill()}; -g.Cj=function(){this.Tq||this.stroke()};w.defineProperty(Uc,{Kp:"clipInsteadOfFill"},function(){return this.Tq},function(a){this.Tq=a});g=Uc.prototype;g.hB=function(a,b,c){this.Xs=a;this.Ys=b;this.zg=c};g.Wn=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};g.Xn=function(){this.shadowOffsetX=this.Xs;this.shadowOffsetY=this.Ys;this.shadowBlur=this.zg}; -g.dA=function(a,b){var c=this.ya;if(void 0!==c.setLineDash)c.setLineDash(a),c.lineDashOffset=b;else if(void 0!==c.webkitLineDash)c.webkitLineDash=a,c.webkitLineDashOffset=b;else if(void 0!==c.mozDash)c.mozDash=a,c.mozDashOffset=b;else return!1;return!0};g.aA=function(){var a=this.ya;void 0!==a.setLineDash?(a.setLineDash(w.fo),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=w.fo,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0)}; -g.Ee=function(a){a&&(this.Cy="");this.By=this.Dy=""}; -var ad=(Math.sqrt(2)-1)/3*4,bd=(new z(0,0)).Ga(),cd=(new A(0,0,0,0)).Ga(),dd=(new eb(0,0,0,0)).Ga(),jd=(new eb(2,2,2,2)).Ga(),kd=(new z(6,6)).Ga(),ld=(new z(-Infinity,-Infinity)).Ga(),md=(new z(Infinity,Infinity)).Ga(),nd=(new ha(0,0)).Ga(),od=(new ha(1,1)).Ga(),yd=(new ha(6,6)).Ga(),zd=(new ha(8,8)).Ga(),Ad=(new ha(10,10)).Ga(),Bd=(new ha(Infinity,Infinity)).Ga(),Cd=(new z(NaN,NaN)).Ga(),Dd=(new ha(NaN,NaN)).Ga(),Qd=(new A(NaN,NaN,NaN,NaN)).Ga(),Rd=(new L(.156,.156)).Ga(),Sd=(new L(.844,.844)).Ga(), -Td=new sa,Ud=new sa,Vd=null;function Wd(a){if(0>=a)return 0;var b=Vd;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);Vd=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)}function K(a,b){var c=a-b;return.5>c&&-.5c&&-5E-8=e&&(e=1E-6);var k=0,l=0,m=0,n=0;am-n)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=h&&h<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=f&&f<=h+e)return!0}else return!0;return!1} -function Yd(a,b,c,d,e,f,h,k,l,m,n,p){if(Xd(a,b,h,k,p,c,d)&&Xd(a,b,h,k,p,e,f))return Xd(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+f)/2,t=(d+s)/2,x=(c+u)/2;return Yd(a,b,q,r,d,c,t,x,l,m,n,p)||Yd(t,x,s,u,e,f,h,k,l,m,n,p)} -function Zd(a,b,c,d,e,f,h,k,l,m){if(Xd(a,b,h,k,l,c,d)&&Xd(a,b,h,k,l,e,f))bb(m,a,b,0,0),bb(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Zd(a,b,n,p,d,c,s,u,l,m);Zd(s,u,q,r,e,f,h,k,l,m)}} -function $d(a,b,c,d,e,f,h,k,l,m){if(Xd(a,b,h,k,l,c,d)&&Xd(a,b,h,k,l,e,f))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;$d(a,b,n,p,d,c,s,u,l,m);$d(s,u,q,r,e,f,h,k,l,m)}} -function he(a,b,c,d,e,f,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+f*l;e=e*s+h*l;f=f*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+f*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=f}function ie(a,b,c,d,e,f,h,k,l,m){if(Xd(a,b,e,f,m,c,d))return Xd(a,b,e,f,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var q=(n+c)/2,r=(p+d)/2;return ie(a,b,n,p,q,r,h,k,l,m)||ie(q,r,c,d,e,f,h,k,l,m)} -function je(a,b,c,d,e,f,h,k){if(Xd(a,b,e,f,h,c,d))bb(k,a,b,0,0),bb(k,e,f,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;je(a,b,l,m,n,p,h,k);je(n,p,c,d,e,f,h,k)}}function ke(a,b,c,d,e,f,h,k){if(Xd(a,b,e,f,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(f);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;ke(a,b,l,m,n,p,h,k);ke(n,p,c,d,e,f,h,k)}} -function le(a,b,c,d,e,f,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(Xd(a,b,h,k,q,c,d)&&Xd(a,b,h,k,q,e,f)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,bh)return!1}else if(ah)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,u=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+h)/2;f=(f+k)/2;var t=(s+c)/2,x=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var v=(t+c)/2,B=(x+d)/2, -y=(n-l)*(n-l)+(p-m)*(p-m),H=!1;le(a,b,s,u,t,x,v,B,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b=q&&(q=1E-6);if(Xd(a,b,h,k,q,c,d)&&Xd(a,b,h,k,q,e,f)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,u=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(a=l=0,ba)return r}else if(aa)return r;0q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,x=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(s+t)/2;c=(u+x)/2;var t=(t+e)/2,x=(x+f)/2, -v=(d+t)/2,B=(c+x)/2,r=r+me(a,b,s,u,d,c,v,B,l,m,n,p,q),r=r+me(v,B,t,x,e,f,h,k,l,m,n,p,q)}return r} -function Ia(a,b,c,d,e,f,h){if(Xa(a,c)){var k=0;c=0;bc)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(Xa(b,d)){ac)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005c)return l.x=a,l.y=c,!1;l.x=a;l.y=f;return!0}h=(d-b)/(c-a);if(Xa(k,h))return Ia(a,b,c,d,e,f,l),!1;e=(h*a-k*e+f-b)/(h-k);if(Xa(h,0)){ac)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}f= -h*(e-a)+b;return Ia(a,b,c,d,e,f,l)}function oe(a,b,c,d,e,f,h,k,l){var m=1E21,n=a,p=b;if(ne(a,b,a,d,e,f,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f);qm} -function pe(a,b,c,d,e,f,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(f-k)/m,h=a,n=k*h+(f-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(f-k)/m,a=b-d*a,h=(f-k*e-a)/(d-k),n=d*h+a);l.l(h,n);return l} -function qe(a,b,c){var d=b.x,e=b.y,f=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===f?(f=a=0,e=m):e===h?(d=k):a.Ha(b)||a.Ha(c)||re(k,m,l,m,d,e,f,h)||re(l,m,l,n,d,e,f,h)||re(l,n,k,n,d,e,f,h)||re(k,n,k,m,d,e,f,h)?!0:!1}function re(a,b,c,d,e,f,h,k){return 0>=Ae(a,b,c,d,e,f)*Ae(a,b,c,d,h,k)&&0>=Ae(e,f,h,k,a,b)*Ae(e,f,h,k,c,d)} -function Ae(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0f&&(f=0)));return 0>f?-1:0a&&(a+=360);360<=a&&(a-=360);return a} -function Ce(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);d=bc,f=0>d,h=0,k=h=0;af;++f){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,aa?"M"+this.ia.toString()+" "+this.ga.toString()+"L"+this.D.toString()+" "+this.F.toString():"M"+this.ia.toFixed(a)+" "+this.ga.toFixed(a)+"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);case Ke:var b=new A(this.ia,this.ga,0,0);b.tG(this.D,this.F,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+ -"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Se:b=new A(this.ia,this.ga,0,0);b.tG(this.D,this.F,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ -2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case Ge:for(var b="",c=this.cc.n,d=c.length,e=0;e=u-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new z(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function f(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new z(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&w.wd(a,"string",Fe,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, +L.prototype.toString=function(){return this.fd()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.L(tb)?"None":this.L(xb)?"TopLeft":this.L(yb)?"Top":this.L(Bb)?"TopRight":this.L(Fb)?"Left":this.L(Gb)?"Center":this.L(Ib)?"Right":this.L(Jb)?"BottomLeft":this.L(Kb)?"Bottom":this.L(Lb)?"BottomRight":this.L(Tb)?"TopSide":this.L(Ub)?"LeftSide":this.L(Vb)?"RightSide":this.L(Wb)?"BottomSide":this.L(Zb)?"TopBottomSides":this.L($b)? +"LeftRightSides":this.L(ac)?"TopLeftSides":this.L(bc)?"TopRightSides":this.L(cc)?"BottomLeftSides":this.L(dc)?"BottomRightSides":this.L(ec)?"NotTopSide":this.L(nc)?"NotLeftSide":this.L(oc)?"NotRightSide":this.L(pc)?"NotBottomSide":this.L(qc)?"AllSides":this.L(rc)?"Default":"None"};L.prototype.equals=L.prototype.L=function(a){return a instanceof L?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1}; +L.prototype.opposite=L.prototype.FF=function(){return new L(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)};L.prototype.includesSide=L.prototype.rj=function(a){if(!this.uj())return!1;if(!a.uj())if(a.L(sc))a=Ub;else if(a.L(tc))a=Vb;else if(a.L(xc))a=Tb;else if(a.L(yc))a=Wb;else return!1;a=a.offsetY;return(this.offsetY&a)===a};L.prototype.isSpot=L.prototype.fd=function(){return!isNaN(this.x)&&!isNaN(this.y)};L.prototype.isNoSpot=L.prototype.Od=function(){return isNaN(this.x)||isNaN(this.y)}; +L.prototype.isSide=L.prototype.uj=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY};L.prototype.isNone=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY};L.prototype.isDefault=L.prototype.Vc=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var tb;L.None=tb=fb(new L(0,0,0,0),0).Ga();var rc;L.Default=rc=fb(new L(0,0,-1,0),-1).Ga();var xb;L.TopLeft=xb=(new L(0,0,0,0)).Ga();var yb; +L.TopCenter=yb=(new L(.5,0,0,0)).Ga();var Bb;L.TopRight=Bb=(new L(1,0,0,0)).Ga();var Fb;L.LeftCenter=Fb=(new L(0,.5,0,0)).Ga();var Gb;L.Center=Gb=(new L(.5,.5,0,0)).Ga();var Ib;L.RightCenter=Ib=(new L(1,.5,0,0)).Ga();var Jb;L.BottomLeft=Jb=(new L(0,1,0,0)).Ga();var Kb;L.BottomCenter=Kb=(new L(.5,1,0,0)).Ga();var Lb;L.BottomRight=Lb=(new L(1,1,0,0)).Ga();var Gc;L.MiddleTop=Gc=yb;var Hc;L.MiddleLeft=Hc=Fb;var Ic;L.MiddleRight=Ic=Ib;var Jc;L.MiddleBottom=Jc=Kb;var xc;L.Top=xc=yb;var sc;L.Left=sc=Fb; +var tc;L.Right=tc=Ib;var yc;L.Bottom=yc=Kb;var Tb;L.TopSide=Tb=fb(new L(0,0,1,w.kd),1).Ga();var Ub;L.LeftSide=Ub=fb(new L(0,0,1,w.Rc),1).Ga();var Vb;L.RightSide=Vb=fb(new L(0,0,1,w.$c),1).Ga();var Wb;L.BottomSide=Wb=fb(new L(0,0,1,w.Zc),1).Ga();var Zb;L.TopBottomSides=Zb=fb(new L(0,0,1,w.kd|w.Zc),1).Ga();var $b;L.LeftRightSides=$b=fb(new L(0,0,1,w.Rc|w.$c),1).Ga();var ac;L.TopLeftSides=ac=fb(new L(0,0,1,w.kd|w.Rc),1).Ga();var bc;L.TopRightSides=bc=fb(new L(0,0,1,w.kd|w.$c),1).Ga();var cc; +L.BottomLeftSides=cc=fb(new L(0,0,1,w.Zc|w.Rc),1).Ga();var dc;L.BottomRightSides=dc=fb(new L(0,0,1,w.Zc|w.$c),1).Ga();var ec;L.NotTopSide=ec=fb(new L(0,0,1,w.Rc|w.$c|w.Zc),1).Ga();var nc;L.NotLeftSide=nc=fb(new L(0,0,1,w.kd|w.$c|w.Zc),1).Ga();var oc;L.NotRightSide=oc=fb(new L(0,0,1,w.kd|w.Rc|w.Zc),1).Ga();var pc;L.NotBottomSide=pc=fb(new L(0,0,1,w.kd|w.Rc|w.$c),1).Ga();var qc;L.AllSides=qc=fb(new L(0,0,1,w.kd|w.Rc|w.$c|w.Zc),1).Ga();function Kc(){this.Tb=[1,0,0,1,0,0]} +Kc.prototype.copy=function(){var a=new Kc;a.Tb[0]=this.Tb[0];a.Tb[1]=this.Tb[1];a.Tb[2]=this.Tb[2];a.Tb[3]=this.Tb[3];a.Tb[4]=this.Tb[4];a.Tb[5]=this.Tb[5];return a};Kc.prototype.translate=function(a,b){this.Tb[4]+=this.Tb[0]*a+this.Tb[2]*b;this.Tb[5]+=this.Tb[1]*a+this.Tb[3]*b};Kc.prototype.scale=function(a,b){this.Tb[0]*=a;this.Tb[1]*=a;this.Tb[2]*=b;this.Tb[3]*=b};function Lc(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.pE=[];this.pattern=null} +Lc.prototype.addColorStop=function(a,b){this.pE.push({offset:a,color:b})}; +function Nc(a,b,c){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.Jn=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.Jp=!1;this.Bg=this.Ys=this.Xs=0;this.document=b||document;this.EE=c;this.Ax=null;this.path=[];this.uh=new Kc;this.stack=[];this.wf=[];this.$w=a;this.bJ="http://www.w3.org/2000/svg"; +this.width=this.$w.width;this.height=this.$w.height;this.gm=Oc(this,"svg",{width:this.width+"px",height:this.height+"px",UL:"0 0 "+this.$w.width+" "+this.$w.height});this.gm.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.gm.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");Pc(this,1,0,0,1,0,0);a=w.mm++;b=Oc(this,"clipPath",{id:"mainClip"+a});b.appendChild(Oc(this,"rect",{x:0,y:0,width:this.width,height:this.height})); +this.gm.appendChild(b);this.wf[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}g=Nc.prototype;g.arc=function(a,b,c,d,e,f){Qc(this,a,b,c,d,e,f)};g.beginPath=function(){this.path=[]};g.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};g.clearRect=function(){};g.clip=function(){Rc(this,"clipPath",this.path,new Kc)};g.closePath=function(){this.path.push(["z"])};g.createLinearGradient=function(a,b,c,d){var e=new Lc("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e}; +g.createPattern=function(){return null};g.createRadialGradient=function(a,b,c,d,e,f){var h=new Lc("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=f;return h}; +g.drawImage=function(a,b,c,d,e,f,h,k,l){var m="";a instanceof HTMLCanvasElement&&(m=a.toDataURL());a instanceof HTMLImageElement&&(m=a.src);void 0===d&&(f=b,h=c,k=d=a.naturalWidth,l=e=a.naturalHeight);d=d||0;e=e||0;f=f||0;h=h||0;k=k||0;l=l||0;m={x:0,y:0,width:a.naturalWidth,height:a.naturalHeight,href:m,preserveAspectRatio:"xMidYMid slice"};Va(d,k)&&Va(e,l)||(m.preserveAspectRatio="none");var n="";k/=d;l/=e;if(0!==f||0!==h)n+=" translate("+f+", "+h+")";if(1!==k||1!==l)n+=" scale("+k+", "+l+")";if(0!== +b||0!==c)n+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==a.naturalWidth||e!==a.naturalHeight)a="CLIP"+w.mm++,f=Oc(this,"clipPath",{id:a}),f.appendChild(Oc(this,"rect",{x:b,y:c,width:d,height:e})),this.gm.appendChild(f),m["clip-path"]="url(#"+a+")";Sc(this,"image",m,this.uh,n);this.addElement("image",m)};g.fill=function(){Rc(this,"fill",this.path,this.uh)};g.Jg=function(){this.Jp?this.clip():this.fill()};g.fillRect=function(a,b,c,d){Tc(this,"fill",[a,b,c,d],this.uh)}; +g.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};Sc(this,"fill",b,this.uh);this.addElement("text",b,a[0])};g.lineTo=function(a,b){this.path.push(["L",a,b])};g.moveTo=function(a,b){this.path.push(["M",a,b])};g.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};g.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])}; +g.restore=function(){this.uh=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.Jn=a.Jn;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign}; +g.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,Jn:this.Jn,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;bb.offset?1:-1});for(k=0;k=2*Math.PI?(Qc(a,b,c,d,e,e+Math.PI,h),Qc(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,f])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k===!!h?0:1,0!==a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,f]))}}function Pc(a,b,c,d,e,f,h){var k=new Kc;k.Tb=[b,c,d,e,f,h];b={};Sc(a,"g",b,k);k=a.addElement("g",b);a.wf.push(k)} +g.$a=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+w.mm++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,f,h;c=Oc(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",JL:this.shadowBlur/2});d=Oc(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=Oc(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});f=Oc(this,"feOffset",{"in":"comp",result:"offsetBlur", +dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=Oc(this,"feMerge",{});h.appendChild(Oc(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(Oc(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);b.appendChild(h);0b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.Sq?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.Sq?this.clip():this.fill()}; +g.Ej=function(){this.Sq||this.stroke()};w.defineProperty(Wc,{Jp:"clipInsteadOfFill"},function(){return this.Sq},function(a){this.Sq=a});g=Wc.prototype;g.lB=function(a,b,c){this.Xs=a;this.Ys=b;this.Bg=c};g.Yn=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};g.Zn=function(){this.shadowOffsetX=this.Xs;this.shadowOffsetY=this.Ys;this.shadowBlur=this.Bg}; +g.fA=function(a,b){var c=this.ta;if(void 0!==c.setLineDash)c.setLineDash(a),c.lineDashOffset=b;else if(void 0!==c.webkitLineDash)c.webkitLineDash=a,c.webkitLineDashOffset=b;else if(void 0!==c.mozDash)c.mozDash=a,c.mozDashOffset=b;else return!1;return!0};g.cA=function(){var a=this.ta;void 0!==a.setLineDash?(a.setLineDash(w.io),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=w.io,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0)}; +g.Ee=function(a){a&&(this.By="");this.Ay=this.Cy=""}; +var cd=(Math.sqrt(2)-1)/3*4,dd=(new z(0,0)).Ga(),ed=(new A(0,0,0,0)).Ga(),fd=(new db(0,0,0,0)).Ga(),kd=(new db(2,2,2,2)).Ga(),ld=(new z(6,6)).Ga(),md=(new z(-Infinity,-Infinity)).Ga(),nd=(new z(Infinity,Infinity)).Ga(),od=(new ha(0,0)).Ga(),pd=(new ha(1,1)).Ga(),yd=(new ha(6,6)).Ga(),zd=(new ha(8,8)).Ga(),Ad=(new ha(10,10)).Ga(),Bd=(new ha(Infinity,Infinity)).Ga(),Cd=(new z(NaN,NaN)).Ga(),Dd=(new ha(NaN,NaN)).Ga(),Nd=(new A(NaN,NaN,NaN,NaN)).Ga(),Od=(new L(.156,.156)).Ga(),Pd=(new L(.844,.844)).Ga(), +Qd=new sa,Rd=new sa,Sd=null;function Td(a){if(0>=a)return 0;var b=Sd;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);Sd=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)}function K(a,b){var c=a-b;return.5>c&&-.5c&&-5E-8=e&&(e=1E-6);var k=0,l=0,m=0,n=0;am-n)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=h&&h<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=f&&f<=h+e)return!0}else return!0;return!1} +function Vd(a,b,c,d,e,f,h,k,l,m,n,p){if(Ud(a,b,h,k,p,c,d)&&Ud(a,b,h,k,p,e,f))return Ud(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+f)/2,t=(d+s)/2,x=(c+u)/2;return Vd(a,b,q,r,d,c,t,x,l,m,n,p)||Vd(t,x,s,u,e,f,h,k,l,m,n,p)} +function Wd(a,b,c,d,e,f,h,k,l,m){if(Ud(a,b,h,k,l,c,d)&&Ud(a,b,h,k,l,e,f))ab(m,a,b,0,0),ab(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Wd(a,b,n,p,d,c,s,u,l,m);Wd(s,u,q,r,e,f,h,k,l,m)}} +function Xd(a,b,c,d,e,f,h,k,l,m){if(Ud(a,b,h,k,l,c,d)&&Ud(a,b,h,k,l,e,f))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Xd(a,b,n,p,d,c,s,u,l,m);Xd(s,u,q,r,e,f,h,k,l,m)}} +function de(a,b,c,d,e,f,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+f*l;e=e*s+h*l;f=f*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+f*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=f}function ee(a,b,c,d,e,f,h,k,l,m){if(Ud(a,b,e,f,m,c,d))return Ud(a,b,e,f,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var q=(n+c)/2,r=(p+d)/2;return ee(a,b,n,p,q,r,h,k,l,m)||ee(q,r,c,d,e,f,h,k,l,m)} +function fe(a,b,c,d,e,f,h,k){if(Ud(a,b,e,f,h,c,d))ab(k,a,b,0,0),ab(k,e,f,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;fe(a,b,l,m,n,p,h,k);fe(n,p,c,d,e,f,h,k)}}function ge(a,b,c,d,e,f,h,k){if(Ud(a,b,e,f,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(f);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;ge(a,b,l,m,n,p,h,k);ge(n,p,c,d,e,f,h,k)}} +function he(a,b,c,d,e,f,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(Ud(a,b,h,k,q,c,d)&&Ud(a,b,h,k,q,e,f)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,bh)return!1}else if(ah)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,u=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+h)/2;f=(f+k)/2;var t=(s+c)/2,x=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var v=(t+c)/2,B=(x+d)/2, +y=(n-l)*(n-l)+(p-m)*(p-m),H=!1;he(a,b,s,u,t,x,v,B,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b=q&&(q=1E-6);if(Ud(a,b,h,k,q,c,d)&&Ud(a,b,h,k,q,e,f)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,u=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(a=l=0,ba)return r}else if(aa)return r;0q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,x=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(s+t)/2;c=(u+x)/2;var t=(t+e)/2,x=(x+f)/2, +v=(d+t)/2,B=(c+x)/2,r=r+ie(a,b,s,u,d,c,v,B,l,m,n,p,q),r=r+ie(v,B,t,x,e,f,h,k,l,m,n,p,q)}return r} +function Ia(a,b,c,d,e,f,h){if(Va(a,c)){var k=0;c=0;bc)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(Va(b,d)){ac)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005c)return l.x=a,l.y=c,!1;l.x=a;l.y=f;return!0}h=(d-b)/(c-a);if(Va(k,h))return Ia(a,b,c,d,e,f,l),!1;e=(h*a-k*e+f-b)/(h-k);if(Va(h,0)){ac)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}f= +h*(e-a)+b;return Ia(a,b,c,d,e,f,l)}function ke(a,b,c,d,e,f,h,k,l){var m=1E21,n=a,p=b;if(je(a,b,a,d,e,f,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f);qm} +function le(a,b,c,d,e,f,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(f-k)/m,h=a,n=k*h+(f-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(f-k)/m,a=b-d*a,h=(f-k*e-a)/(d-k),n=d*h+a);l.m(h,n);return l} +function me(a,b,c){var d=b.x,e=b.y,f=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===f?(f=a=0,e=m):e===h?(d=k):a.Ha(b)||a.Ha(c)||ne(k,m,l,m,d,e,f,h)||ne(l,m,l,n,d,e,f,h)||ne(l,n,k,n,d,e,f,h)||ne(k,n,k,m,d,e,f,h)?!0:!1}function ne(a,b,c,d,e,f,h,k){return 0>=ve(a,b,c,d,e,f)*ve(a,b,c,d,h,k)&&0>=ve(e,f,h,k,a,b)*ve(e,f,h,k,c,d)} +function ve(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0f&&(f=0)));return 0>f?-1:0a&&(a+=360);360<=a&&(a-=360);return a} +function xe(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);d=bc,f=0>d,h=0,k=h=0;af;++f){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,aa?"M"+this.ia.toString()+" "+this.ga.toString()+"L"+this.D.toString()+" "+this.F.toString():"M"+this.ia.toFixed(a)+" "+this.ga.toFixed(a)+"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);case Fe:var b=new A(this.ia,this.ga,0,0);b.wG(this.D,this.F,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+ +"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Ne:b=new A(this.ia,this.ga,0,0);b.wG(this.D,this.F,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ +2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case Be:for(var b="",c=this.dc.n,d=c.length,e=0;e=u-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new z(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function f(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new z(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&w.yd(a,"string",Ae,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var l=a.split(" "),m=-1,n="",p="",q=new z(0,0),r=new z(0,0),s=new z(0, -0),u=l.length,t=w.s(),x=!1,v=!1,B=!0,y=null;!(m>=u-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":B=!0;v=x=!1;break;case "M":y=f();null===t.Ub||!0===B?(M(t,y.x,y.y,x,!1,!v),B=!1):t.moveTo(y.x,y.y);for(q=s;!c();)y=f(),t.lineTo(y.x,y.y);break;case "L":for(;!c();)y=f(),t.lineTo(y.x,y.y);break;case "H":for(;!c();)s=y=new z((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),t.lineTo(s.x,s.y);break;case "V":for(;!c();)s=y=new z(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),t.lineTo(s.x,s.y); -break;case "C":for(;!c();){var H=e(),E=h(),y=f();N(t,H.x,H.y,E.x,E.y,y.x,y.y)}break;case "S":for(;!c();)H=k(),E=h(),y=f(),N(t,H.x,H.y,E.x,E.y,y.x,y.y);break;case "Q":for(;!c();)E=h(),y=f(),Xe(t,E.x,E.y,y.x,y.y);break;case "T":for(;!c();)r=E=k(),y=f(),Xe(t,E.x,E.y,y.x,y.y);break;case "B":for(;!c();){var y=parseFloat(d()),H=parseFloat(d()),E=parseFloat(d()),V=parseFloat(d()),ba=parseFloat(d()),Q=ba,$=!1;c()||(Q=parseFloat(d()),c()||($=0!==parseFloat(d())));n===n.toLowerCase()&&(E+=s.x,V+=s.y);t.arcTo(y, -H,E,V,ba,Q,$)}break;case "A":for(;!c();)H=Math.abs(parseFloat(d())),E=Math.abs(parseFloat(d())),V=parseFloat(d()),ba=!!parseFloat(d()),Q=!!parseFloat(d()),y=f(),Ye(t,H,E,V,ba,Q,y.x,y.y);break;case "Z":y=t.o.cc.n[t.o.cc.length-1];O(t);s=q;break;case "F":y="";for(H=1;l[m+H];)if(null!==l[m+H].match(/[Uu]/))H++;else if(null===l[m+H].match(/[A-Za-z]/))H++;else{y=l[m+H];break}y.match(/[Mm]/)?x=!0:Ze(t);break;case "U":y="";for(H=1;l[m+H];)if(null!==l[m+H].match(/[Ff]/))H++;else if(null===l[m+H].match(/[A-Za-z]/))H++; -else{y=l[m+H];break}y.match(/[Mm]/)?v=!0:t.$a(!1)}q=t.o;w.q(t);if(b)for(t=q.cc.i;t.next();)y=t.value,y.bu=!0;return q};function $e(a,b){for(var c=a.length,d=w.K(),e=0;eh&&(h+=360),s.ye+=h);0>a&&(s.ye=180-s.ye,s.of=-s.of);0>d&&(s.ye=-s.ye,s.of=-s.of);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case sf:h=s.D;k=s.F;s.D=h* -a+k*c+e;s.F=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Gj+=h);0>a&&(s.Gj=180-s.Gj,s.Wl=!s.Wl);0>d&&(s.Gj=-s.Gj,s.Wl=!s.Wl);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:w.k("Unknown Segment type: "+s.type)}}}}this.bb=!0;return this}; -Fe.prototype.Ha=function(a,b,c,d){var e=a.x,f=a.y,h=this.jb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.cc.n,s=r.length,u=0;u=a)return 0;if((e>h?e-h:h-e)<(f>k?f-k:k-f)){if(e=a=0,fe)return 0}else if(ee)return 0;return 0a?a=0:1=f)return d=(f-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.l(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.l(NaN,NaN);return b}; -Fe.prototype.getFractionForPoint=Fe.prototype.TH=function(a){if(this.type===Je){var b=this.ia,c=this.ga,d=this.D,e=this.F;if(b!==d||c!==e){var f=a.x;a=a.y;var h=0,k=0;return b===d?(c=k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b=k?k===b?0:1:Math.abs(f-b)/(k-h)):((f-b)*(f-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===Ke){if(b=this.ia,c=this.ga,d=this.D,e=this.F,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,f=a.x; -a=a.y;f=Math.min(Math.max(f,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(f-b),d=Math.abs(f-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return f/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-f)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.gA,h=this.lx,k=this.hA,l=w.K(),c=Infinity,b=d=0,f=e.length,n=m=0,p=0;pa?0:1=u-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":B=!0;v=x=!1;break;case "M":y=f();null===t.Vb||!0===B?(M(t,y.x,y.y,x,!1,!v),B=!1):t.moveTo(y.x,y.y);for(q=s;!c();)y=f(),t.lineTo(y.x,y.y);break;case "L":for(;!c();)y=f(),t.lineTo(y.x,y.y);break;case "H":for(;!c();)s=y=new z((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),t.lineTo(s.x,s.y);break;case "V":for(;!c();)s=y=new z(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),t.lineTo(s.x,s.y); +break;case "C":for(;!c();){var H=e(),E=h(),y=f();N(t,H.x,H.y,E.x,E.y,y.x,y.y)}break;case "S":for(;!c();)H=k(),E=h(),y=f(),N(t,H.x,H.y,E.x,E.y,y.x,y.y);break;case "Q":for(;!c();)E=h(),y=f(),Se(t,E.x,E.y,y.x,y.y);break;case "T":for(;!c();)r=E=k(),y=f(),Se(t,E.x,E.y,y.x,y.y);break;case "B":for(;!c();){var y=parseFloat(d()),H=parseFloat(d()),E=parseFloat(d()),V=parseFloat(d()),ba=parseFloat(d()),Q=ba,$=!1;c()||(Q=parseFloat(d()),c()||($=0!==parseFloat(d())));n===n.toLowerCase()&&(E+=s.x,V+=s.y);t.arcTo(y, +H,E,V,ba,Q,$)}break;case "A":for(;!c();)H=Math.abs(parseFloat(d())),E=Math.abs(parseFloat(d())),V=parseFloat(d()),ba=!!parseFloat(d()),Q=!!parseFloat(d()),y=f(),Te(t,H,E,V,ba,Q,y.x,y.y);break;case "Z":y=t.o.dc.n[t.o.dc.length-1];O(t);s=q;break;case "F":y="";for(H=1;l[m+H];)if(null!==l[m+H].match(/[Uu]/))H++;else if(null===l[m+H].match(/[A-Za-z]/))H++;else{y=l[m+H];break}y.match(/[Mm]/)?x=!0:Ue(t);break;case "U":y="";for(H=1;l[m+H];)if(null!==l[m+H].match(/[Ff]/))H++;else if(null===l[m+H].match(/[A-Za-z]/))H++; +else{y=l[m+H];break}y.match(/[Mm]/)?v=!0:t.$a(!1)}q=t.o;w.q(t);if(b)for(t=q.dc.i;t.next();)y=t.value,y.au=!0;return q};function Ve(a,b){for(var c=a.length,d=w.K(),e=0;eh&&(h+=360),s.ye+=h);0>a&&(s.ye=180-s.ye,s.of=-s.of);0>d&&(s.ye=-s.ye,s.of=-s.of);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case qf:h=s.D;k=s.F;s.D=h* +a+k*c+e;s.F=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Hj+=h);0>a&&(s.Hj=180-s.Hj,s.Wl=!s.Wl);0>d&&(s.Hj=-s.Hj,s.Wl=!s.Wl);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:w.k("Unknown Segment type: "+s.type)}}}}this.bb=!0;return this}; +Ae.prototype.Ha=function(a,b,c,d){var e=a.x,f=a.y,h=this.cb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.dc.n,s=r.length,u=0;u=a)return 0;if((e>h?e-h:h-e)<(f>k?f-k:k-f)){if(e=a=0,fe)return 0}else if(ee)return 0;return 0a?a=0:1=f)return d=(f-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.m(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.m(NaN,NaN);return b}; +Ae.prototype.getFractionForPoint=Ae.prototype.WH=function(a){if(this.type===Ee){var b=this.ia,c=this.ga,d=this.D,e=this.F;if(b!==d||c!==e){var f=a.x;a=a.y;var h=0,k=0;return b===d?(c=k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b=k?k===b?0:1:Math.abs(f-b)/(k-h)):((f-b)*(f-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===Fe){if(b=this.ia,c=this.ga,d=this.D,e=this.F,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,f=a.x; +a=a.y;f=Math.min(Math.max(f,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(f-b),d=Math.abs(f-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return f/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-f)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.iA,h=this.kx,k=this.jA,l=w.K(),c=Infinity,b=d=0,f=e.length,n=m=0,p=0;pa?0:1a?"M"+this.ia.toString()+" "+this.ga.toString():"M"+this.ia.toFixed(a)+" "+this.ga.toFixed(a),c=this.vb.n,d=c.length,e=0;ea&&(a+=360),this.Ad=a,this.Ve=0,this.mh=Math.max(d,0),this.yg=Math.max(e,0),this.Vo="boolean"===typeof h?!!h:!1,this.oo=!!k):(this.Ad=d,this.Ve=e,a===rf&&(f=Math.max(f,0)),this.mh=f,"number"===typeof h?(a===rf&&(h=Math.max(h,0)),this.yg=h):this.yg=0,this.oo=this.Vo=!1);this.Ph=!1;this.bb= -!0;this.ig=null}w.fa("PathSegment",yf);w.ji(yf);yf.prototype.copy=function(){var a=new yf;a.ma=this.ma;a.yb=this.yb;a.Fb=this.Fb;a.Ad=this.Ad;a.Ve=this.Ve;a.mh=this.mh;a.yg=this.yg;a.Vo=this.Vo;a.oo=this.oo;a.Ph=this.Ph;a.bb=this.bb;return a}; -yf.prototype.equalsApprox=yf.prototype.Ic=function(a){if(!(a instanceof yf)||this.type!==a.type||this.tx!==a.tx)return!1;switch(this.type){case of:case Ue:return K(this.D,a.D)&&K(this.F,a.F);case pf:return K(this.D,a.D)&&K(this.F,a.F)&&K(this.rc,a.rc)&&K(this.Oc,a.Oc)&&K(this.Ah,a.Ah)&&K(this.Bh,a.Bh);case qf:return K(this.D,a.D)&&K(this.F,a.F)&&K(this.rc,a.rc)&&K(this.Oc,a.Oc);case rf:return K(this.ye,a.ye)&&K(this.of,a.of)&&K(this.ja,a.ja)&&K(this.ra,a.ra)&&K(this.radiusX,a.radiusX)&&K(this.radiusY, -a.radiusY);case sf:return this.Wl===a.Wl&&this.xx===a.xx&&K(this.Gj,a.Gj)&&K(this.D,a.D)&&K(this.F,a.F)&&K(this.radiusX,a.radiusX)&&K(this.radiusY,a.radiusY);default:return!1}};yf.prototype.fc=function(a){a.De===yf?this.type=a:w.Ej(this,a)}; -yf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case of:b=0>a?"M"+this.D.toString()+" "+this.F.toString():"M"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case Ue:b=0>a?"L"+this.D.toString()+" "+this.F.toString():"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case pf:b=0>a?"C"+this.rc.toString()+" "+this.Oc.toString()+" "+this.Ah.toString()+" "+this.Bh.toString()+" "+this.D.toString()+" "+this.F.toString():"C"+this.rc.toFixed(a)+" "+this.Oc.toFixed(a)+" "+this.Ah.toFixed(a)+ -" "+this.Bh.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case qf:b=0>a?"Q"+this.rc.toString()+" "+this.Oc.toString()+" "+this.D.toString()+" "+this.F.toString():"Q"+this.rc.toFixed(a)+" "+this.Oc.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case rf:b=0>a?"B"+this.ye.toString()+" "+this.of.toString()+" "+this.ja.toString()+" "+this.ra.toString()+" "+this.radiusX:"B"+this.ye.toFixed(a)+" "+this.of.toFixed(a)+" "+this.ja.toFixed(a)+" "+this.ra.toFixed(a)+" "+this.radiusX; -break;case sf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Gj.toString()+" "+(this.xx?1:0)+" "+(this.Wl?1:0)+" "+this.D.toString()+" "+this.F.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Gj.toFixed(a)+" "+(this.xx?1:0)+" "+(this.Wl?1:0)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;default:b=this.type.toString()}return b+(this.Ph?"z":"")};var of;yf.Move=of=w.p(yf,"Move",0);var Ue;yf.Line=Ue=w.p(yf,"Line",1);var pf; -yf.Bezier=pf=w.p(yf,"Bezier",2);var qf;yf.QuadraticBezier=qf=w.p(yf,"QuadraticBezier",3);var rf;yf.Arc=rf=w.p(yf,"Arc",4);var sf;yf.SvgArc=sf=w.p(yf,"SvgArc",4);yf.prototype.freeze=function(){this.Q=!0;return this};yf.prototype.Ra=function(){this.Q=!1;return this};yf.prototype.close=yf.prototype.close=function(){this.Ph=!0;return this}; -function tf(a,b){if(null!==a.ig&&!1===b.bb)return a.ig;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.ig=[],a.ig;var e=a.Ad,f=a.Ve,h=Ce(c=r?h=Math.PI:1<=r&&(h=0);!l&&0h&&(h+=2*Math.PI);l=b>f?1:b/f;r=b>f?f/b:1;b=Ce(b>f?b:f,n,n+h,!0);f=w.Ef();f.reset();f.translate(c,d);f.rotate(a.Ad,0,0);f.scale(l,r);$e(b,f);w.ue(f);a.ig=b;return a.ig} -w.defineProperty(yf,{tx:"isClosed"},function(){return this.Ph},function(a){this.Ph!==a&&(this.Ph=a,this.bb=!0)});w.defineProperty(yf,{type:"type"},function(){return this.ma},function(a){this.Q&&w.la(this,a);this.ma=a;this.bb=!0});w.defineProperty(yf,{D:"endX"},function(){return this.yb},function(a){this.Q&&w.la(this,a);this.yb=a;this.bb=!0});w.defineProperty(yf,{F:"endY"},function(){return this.Fb},function(a){this.Q&&w.la(this,a);this.Fb=a;this.bb=!0}); -w.defineProperty(yf,{rc:"point1X"},function(){return this.Ad},function(a){this.Q&&w.la(this,a);this.Ad=a;this.bb=!0});w.defineProperty(yf,{Oc:"point1Y"},function(){return this.Ve},function(a){this.Q&&w.la(this,a);this.Ve=a;this.bb=!0});w.defineProperty(yf,{Ah:"point2X"},function(){return this.mh},function(a){this.Q&&w.la(this,a);this.mh=a;this.bb=!0});w.defineProperty(yf,{Bh:"point2Y"},function(){return this.yg},function(a){this.Q&&w.la(this,a);this.yg=a;this.bb=!0}); -w.defineProperty(yf,{ja:"centerX"},function(){return this.Ad},function(a){this.Q&&w.la(this,a);this.Ad=a;this.bb=!0});w.defineProperty(yf,{ra:"centerY"},function(){return this.Ve},function(a){this.Q&&w.la(this,a);this.Ve=a;this.bb=!0});w.defineProperty(yf,{radiusX:"radiusX"},function(){return this.mh},function(a){0>a&&w.Ea(a,">= zero",yf,"radiusX");this.Q&&w.la(this,a);this.mh=a;this.bb=!0}); -w.defineProperty(yf,{radiusY:"radiusY"},function(){return this.yg},function(a){0>a&&w.Ea(a,">= zero",yf,"radiusY");this.Q&&w.la(this,a);this.yg=a;this.bb=!0});w.defineProperty(yf,{ye:"startAngle"},function(){return this.yb},function(a){this.yb!==a&&(this.Q&&w.la(this,a),a%=360,0>a&&(a+=360),this.yb=a,this.bb=!0)});w.defineProperty(yf,{of:"sweepAngle"},function(){return this.Fb},function(a){this.Q&&w.la(this,a);360a&&(a=-360);this.Fb=a;this.bb=!0}); -w.defineProperty(yf,{Wl:"isClockwiseArc"},function(){return this.oo},function(a){this.Q&&w.la(this,a);this.oo=a;this.bb=!0});w.defineProperty(yf,{xx:"isLargeArc"},function(){return this.Vo},function(a){this.Q&&w.la(this,a);this.Vo=a;this.bb=!0});w.defineProperty(yf,{Gj:"xAxisRotation"},function(){return this.Ad},function(a){a%=360;0>a&&(a+=360);this.Q&&w.la(this,a);this.Ad=a;this.bb=!0}); -function Af(){this.Z=null;this.Hz=(new z(0,0)).freeze();this.Py=(new z(0,0)).freeze();this.ev=this.aw=0;this.fv=1;this.Qv="";this.Ew=this.tv=!1;this.qv=this.gv=0;this.Ij=this.Cv=this.Nv=!1;this.ur=null;this.Cw=0;this.Bg=this.Bw=null}w.fa("InputEvent",Af); -Af.prototype.copy=function(){var a=new Af;a.Z=this.Z;a.Hz.assign(this.bf);a.Py.assign(this.ca);a.aw=this.aw;a.ev=this.ev;a.fv=this.fv;a.Qv=this.Qv;a.tv=this.tv;a.Ew=this.Ew;a.gv=this.gv;a.qv=this.qv;a.Nv=this.Nv;a.Cv=this.Cv;a.Ij=this.Ij;a.ur=this.ur;a.Cw=this.Cw;a.Bw=this.Bw;a.Bg=this.Bg;return a}; -Af.prototype.toString=function(){var a="^";0!==this.ud&&(a+="M:"+this.ud);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Fe&&(a+="C:"+this.Fe);0!==this.Ml&&(a+="D:"+this.Ml);this.Ac&&(a+="h");this.bubbles&&(a+="b");null!==this.ca&&(a+="@"+this.ca.toString());return a};w.defineProperty(Af,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});w.defineProperty(Af,{bf:"viewPoint"},function(){return this.Hz},function(a){w.G(a,z,Af,"viewPoint");this.Hz.assign(a)}); -w.defineProperty(Af,{ca:"documentPoint"},function(){return this.Py},function(a){w.G(a,z,Af,"documentPoint");this.Py.assign(a)});Af.prototype.getMultiTouchViewPoint=Af.prototype.nx=function(a,b){var c=this.g;if(null===c)return b;Bf(c,this.event,a,b);return b};Af.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;Bf(c,this.event,a,b);b.assign(c.rB(b));return b};w.defineProperty(Af,{ud:"modifiers"},function(){return this.aw},function(a){this.aw=a}); -w.defineProperty(Af,{button:"button"},function(){return this.ev},function(a){this.ev=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});w.defineProperty(Af,{buttons:"buttons"},function(){return this.fv},function(a){this.fv=a});w.defineProperty(Af,{key:"key"},function(){return this.Qv},function(a){this.Qv=a});w.defineProperty(Af,{Nl:"down"},function(){return this.tv},function(a){this.tv=a}); -w.defineProperty(Af,{up:"up"},function(){return this.Ew},function(a){this.Ew=a});w.defineProperty(Af,{Fe:"clickCount"},function(){return this.gv},function(a){this.gv=a});w.defineProperty(Af,{Ml:"delta"},function(){return this.qv},function(a){this.qv=a});w.defineProperty(Af,{du:"isMultiTouch"},function(){return this.Nv},function(a){this.Nv=a});w.defineProperty(Af,{Ac:"handled"},function(){return this.Cv},function(a){this.Cv=a}); -w.defineProperty(Af,{bubbles:"bubbles"},function(){return this.Ij},function(a){this.Ij=a});w.defineProperty(Af,{event:"event"},function(){return this.ur},function(a){this.ur=a});w.u(Af,{tj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});w.u(Af,{Ek:"isMac"},function(){return w.Ek});w.defineProperty(Af,{timestamp:"timestamp"},function(){return this.Cw},function(a){this.Cw=a}); -w.defineProperty(Af,{Ug:"targetDiagram"},function(){return this.Bw},function(a){this.Bw=a});w.defineProperty(Af,{Pe:"targetObject"},function(){return this.Bg},function(a){this.Bg=a});w.defineProperty(Af,{control:"control"},function(){return 0!==(this.ud&1)},function(a){this.ud=a?this.ud|1:this.ud&-2});w.defineProperty(Af,{shift:"shift"},function(){return 0!==(this.ud&4)},function(a){this.ud=a?this.ud|4:this.ud&-5}); -w.defineProperty(Af,{alt:"alt"},function(){return 0!==(this.ud&2)},function(a){this.ud=a?this.ud|2:this.ud&-3});w.defineProperty(Af,{mu:"meta"},function(){return 0!==(this.ud&8)},function(a){this.ud=a?this.ud|8:this.ud&-9});w.defineProperty(Af,{left:"left"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?0===this.button:0!==(this.buttons&1)},function(a){this.buttons=a?this.buttons|1:this.buttons&-2}); -w.defineProperty(Af,{right:"right"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?2===this.button:0!==(this.buttons&2)},function(a){this.buttons=a?this.buttons|2:this.buttons&-3});w.defineProperty(Af,{jL:"middle"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?1===this.button:0!==(this.buttons&4)},function(a){this.buttons=a?this.buttons|4:this.buttons&-5}); -function Cf(){this.Z=null;this.Qb="";this.iw=this.zw=null;this.Qq=!1}w.fa("DiagramEvent",Cf);Cf.prototype.copy=function(){var a=new Cf;a.Z=this.Z;a.Qb=this.Qb;a.zw=this.zw;a.iw=this.iw;a.Qq=this.Qq;return a};Cf.prototype.toString=function(){var a="*"+this.name;null!==this.jB&&(a+=":"+this.jB.toString());null!==this.OA&&(a+="("+this.OA.toString()+")");return a};w.defineProperty(Cf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a}); -w.defineProperty(Cf,{name:"name"},function(){return this.Qb},function(a){this.Qb=a});w.defineProperty(Cf,{jB:"subject"},function(){return this.zw},function(a){this.zw=a});w.defineProperty(Cf,{OA:"parameter"},function(){return this.iw},function(a){this.iw=a});w.defineProperty(Cf,{cancel:"cancel"},function(){return this.Qq},function(a){this.Qq!==a&&w.Gt("DiagramEvent.cancel","2.0");this.Qq=a});function Lf(){this.Rq=Mf;this.Tm=this.$v="";this.qs=this.rs=this.us=this.vs=this.ts=this.Z=this.ke=null} -w.fa("ChangedEvent",Lf);var Nf;Lf.Transaction=Nf=w.p(Lf,"Transaction",-1);var Mf;Lf.Property=Mf=w.p(Lf,"Property",0);var Of;Lf.Insert=Of=w.p(Lf,"Insert",1);var Pf;Lf.Remove=Pf=w.p(Lf,"Remove",2);Lf.prototype.clear=Lf.prototype.clear=function(){this.qs=this.rs=this.us=this.vs=this.ts=this.Z=this.ke=null}; -Lf.prototype.copy=function(){var a=new Lf;a.Rq=this.Rq;a.$v=this.$v;a.Tm=this.Tm;a.ke=this.ke;a.Z=this.Z;a.ts=this.ts;var b=this.vs;a.vs=w.Qa(b)&&"function"===typeof b.S?b.S():b;b=this.us;a.us=w.Qa(b)&&"function"===typeof b.S?b.S():b;b=this.rs;a.rs=w.Qa(b)&&"function"===typeof b.S?b.S():b;b=this.qs;a.qs=w.Qa(b)&&"function"===typeof b.S?b.S():b;return a};Lf.prototype.fc=function(a){a.De===Lf?this.xc=a:w.Ej(this,a)}; -Lf.prototype.toString=function(){var a="",a=this.xc===Nf?a+"* ":this.xc===Mf?a+(null!==this.ba?"!m":"!d"):a+((null!==this.ba?"!m":"!d")+this.xc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.nf&&this.nf!==this.propertyName&&(a+=" "+this.nf);a+=": ";this.xc===Nf?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Qf(this.object)),null!==this.oldValue&&(a+=" old: "+Qf(this.oldValue)),null!==this.zj&&(a+=" "+this.zj),null!==this.newValue&& -(a+=" new: "+Qf(this.newValue)),null!==this.yj&&(a+=" "+this.yj));return a};Lf.prototype.getValue=Lf.prototype.ka=function(a){return a?this.oldValue:this.newValue};Lf.prototype.getParam=function(a){return a?this.zj:this.yj};Lf.prototype.canUndo=Lf.prototype.canUndo=function(){return null!==this.ba||null!==this.g?!0:!1};Lf.prototype.undo=Lf.prototype.undo=function(){this.canUndo()&&(null!==this.ba?this.ba.ln(this,!0):null!==this.g&&this.g.ln(this,!0))}; -Lf.prototype.canRedo=Lf.prototype.canRedo=function(){return null!==this.ba||null!==this.g?!0:!1};Lf.prototype.redo=Lf.prototype.redo=function(){this.canRedo()&&(null!==this.ba?this.ba.ln(this,!1):null!==this.g&&this.g.ln(this,!1))};w.defineProperty(Lf,{ba:"model"},function(){return this.ke},function(a){this.ke=a});w.defineProperty(Lf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});w.defineProperty(Lf,{xc:"change"},function(){return this.Rq},function(a){this.Rq=a}); -w.defineProperty(Lf,{nf:"modelChange"},function(){return this.$v},function(a){this.$v=a});w.defineProperty(Lf,{propertyName:"propertyName"},function(){return this.Tm},function(a){this.Tm=a});w.u(Lf,{oF:"isTransactionFinished"},function(){return this.Rq===Nf&&("CommittedTransaction"===this.Tm||"FinishedUndo"===this.Tm||"FinishedRedo"===this.Tm)});w.defineProperty(Lf,{object:"object"},function(){return this.ts},function(a){this.ts=a}); -w.defineProperty(Lf,{oldValue:"oldValue"},function(){return this.vs},function(a){this.vs=a});w.defineProperty(Lf,{zj:"oldParam"},function(){return this.us},function(a){this.us=a});w.defineProperty(Lf,{newValue:"newValue"},function(){return this.rs},function(a){this.rs=a});w.defineProperty(Lf,{yj:"newParam"},function(){return this.qs},function(a){this.qs=a}); -function F(a){1a&&(a+=360),this.Bd=a,this.Ve=0,this.mh=Math.max(d,0),this.Ag=Math.max(e,0),this.Xo="boolean"===typeof h?!!h:!1,this.qo=!!k):(this.Bd=d,this.Ve=e,a===pf&&(f=Math.max(f,0)),this.mh=f,"number"===typeof h?(a===pf&&(h=Math.max(h,0)),this.Ag=h):this.Ag=0,this.qo=this.Xo=!1);this.Ph=!1;this.bb= +!0;this.kg=null}w.fa("PathSegment",wf);w.ji(wf);wf.prototype.copy=function(){var a=new wf;a.ma=this.ma;a.yb=this.yb;a.Gb=this.Gb;a.Bd=this.Bd;a.Ve=this.Ve;a.mh=this.mh;a.Ag=this.Ag;a.Xo=this.Xo;a.qo=this.qo;a.Ph=this.Ph;a.bb=this.bb;return a}; +wf.prototype.equalsApprox=wf.prototype.Ic=function(a){if(!(a instanceof wf)||this.type!==a.type||this.sx!==a.sx)return!1;switch(this.type){case mf:case Pe:return K(this.D,a.D)&&K(this.F,a.F);case nf:return K(this.D,a.D)&&K(this.F,a.F)&&K(this.sc,a.sc)&&K(this.Pc,a.Pc)&&K(this.Ah,a.Ah)&&K(this.Bh,a.Bh);case of:return K(this.D,a.D)&&K(this.F,a.F)&&K(this.sc,a.sc)&&K(this.Pc,a.Pc);case pf:return K(this.ye,a.ye)&&K(this.of,a.of)&&K(this.ka,a.ka)&&K(this.ra,a.ra)&&K(this.radiusX,a.radiusX)&&K(this.radiusY, +a.radiusY);case qf:return this.Wl===a.Wl&&this.wx===a.wx&&K(this.Hj,a.Hj)&&K(this.D,a.D)&&K(this.F,a.F)&&K(this.radiusX,a.radiusX)&&K(this.radiusY,a.radiusY);default:return!1}};wf.prototype.gc=function(a){a.De===wf?this.type=a:w.Fj(this,a)}; +wf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case mf:b=0>a?"M"+this.D.toString()+" "+this.F.toString():"M"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case Pe:b=0>a?"L"+this.D.toString()+" "+this.F.toString():"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case nf:b=0>a?"C"+this.sc.toString()+" "+this.Pc.toString()+" "+this.Ah.toString()+" "+this.Bh.toString()+" "+this.D.toString()+" "+this.F.toString():"C"+this.sc.toFixed(a)+" "+this.Pc.toFixed(a)+" "+this.Ah.toFixed(a)+ +" "+this.Bh.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case of:b=0>a?"Q"+this.sc.toString()+" "+this.Pc.toString()+" "+this.D.toString()+" "+this.F.toString():"Q"+this.sc.toFixed(a)+" "+this.Pc.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case pf:b=0>a?"B"+this.ye.toString()+" "+this.of.toString()+" "+this.ka.toString()+" "+this.ra.toString()+" "+this.radiusX:"B"+this.ye.toFixed(a)+" "+this.of.toFixed(a)+" "+this.ka.toFixed(a)+" "+this.ra.toFixed(a)+" "+this.radiusX; +break;case qf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Hj.toString()+" "+(this.wx?1:0)+" "+(this.Wl?1:0)+" "+this.D.toString()+" "+this.F.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Hj.toFixed(a)+" "+(this.wx?1:0)+" "+(this.Wl?1:0)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;default:b=this.type.toString()}return b+(this.Ph?"z":"")};var mf;wf.Move=mf=w.p(wf,"Move",0);var Pe;wf.Line=Pe=w.p(wf,"Line",1);var nf; +wf.Bezier=nf=w.p(wf,"Bezier",2);var of;wf.QuadraticBezier=of=w.p(wf,"QuadraticBezier",3);var pf;wf.Arc=pf=w.p(wf,"Arc",4);var qf;wf.SvgArc=qf=w.p(wf,"SvgArc",4);wf.prototype.freeze=function(){this.Q=!0;return this};wf.prototype.Ra=function(){this.Q=!1;return this};wf.prototype.close=wf.prototype.close=function(){this.Ph=!0;return this}; +function rf(a,b){if(null!==a.kg&&!1===b.bb)return a.kg;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.kg=[],a.kg;var e=a.Bd,f=a.Ve,h=xe(c=r?h=Math.PI:1<=r&&(h=0);!l&&0h&&(h+=2*Math.PI);l=b>f?1:b/f;r=b>f?f/b:1;b=xe(b>f?b:f,n,n+h,!0);f=w.Ff();f.reset();f.translate(c,d);f.rotate(a.Bd,0,0);f.scale(l,r);Ve(b,f);w.ue(f);a.kg=b;return a.kg} +w.defineProperty(wf,{sx:"isClosed"},function(){return this.Ph},function(a){this.Ph!==a&&(this.Ph=a,this.bb=!0)});w.defineProperty(wf,{type:"type"},function(){return this.ma},function(a){this.Q&&w.la(this,a);this.ma=a;this.bb=!0});w.defineProperty(wf,{D:"endX"},function(){return this.yb},function(a){this.Q&&w.la(this,a);this.yb=a;this.bb=!0});w.defineProperty(wf,{F:"endY"},function(){return this.Gb},function(a){this.Q&&w.la(this,a);this.Gb=a;this.bb=!0}); +w.defineProperty(wf,{sc:"point1X"},function(){return this.Bd},function(a){this.Q&&w.la(this,a);this.Bd=a;this.bb=!0});w.defineProperty(wf,{Pc:"point1Y"},function(){return this.Ve},function(a){this.Q&&w.la(this,a);this.Ve=a;this.bb=!0});w.defineProperty(wf,{Ah:"point2X"},function(){return this.mh},function(a){this.Q&&w.la(this,a);this.mh=a;this.bb=!0});w.defineProperty(wf,{Bh:"point2Y"},function(){return this.Ag},function(a){this.Q&&w.la(this,a);this.Ag=a;this.bb=!0}); +w.defineProperty(wf,{ka:"centerX"},function(){return this.Bd},function(a){this.Q&&w.la(this,a);this.Bd=a;this.bb=!0});w.defineProperty(wf,{ra:"centerY"},function(){return this.Ve},function(a){this.Q&&w.la(this,a);this.Ve=a;this.bb=!0});w.defineProperty(wf,{radiusX:"radiusX"},function(){return this.mh},function(a){0>a&&w.Ea(a,">= zero",wf,"radiusX");this.Q&&w.la(this,a);this.mh=a;this.bb=!0}); +w.defineProperty(wf,{radiusY:"radiusY"},function(){return this.Ag},function(a){0>a&&w.Ea(a,">= zero",wf,"radiusY");this.Q&&w.la(this,a);this.Ag=a;this.bb=!0});w.defineProperty(wf,{ye:"startAngle"},function(){return this.yb},function(a){this.yb!==a&&(this.Q&&w.la(this,a),a%=360,0>a&&(a+=360),this.yb=a,this.bb=!0)});w.defineProperty(wf,{of:"sweepAngle"},function(){return this.Gb},function(a){this.Q&&w.la(this,a);360a&&(a=-360);this.Gb=a;this.bb=!0}); +w.defineProperty(wf,{Wl:"isClockwiseArc"},function(){return this.qo},function(a){this.Q&&w.la(this,a);this.qo=a;this.bb=!0});w.defineProperty(wf,{wx:"isLargeArc"},function(){return this.Xo},function(a){this.Q&&w.la(this,a);this.Xo=a;this.bb=!0});w.defineProperty(wf,{Hj:"xAxisRotation"},function(){return this.Bd},function(a){a%=360;0>a&&(a+=360);this.Q&&w.la(this,a);this.Bd=a;this.bb=!0}); +function yf(){this.Z=null;this.Jz=(new z(0,0)).freeze();this.Oy=(new z(0,0)).freeze();this.dv=this.aw=0;this.ev=1;this.Qv="";this.Dw=this.sv=!1;this.pv=this.fv=0;this.Jj=this.Bv=this.Mv=!1;this.tr=null;this.Bw=0;this.Dg=this.Aw=null}w.fa("InputEvent",yf); +yf.prototype.copy=function(){var a=new yf;a.Z=this.Z;a.Jz.assign(this.bf);a.Oy.assign(this.ca);a.aw=this.aw;a.dv=this.dv;a.ev=this.ev;a.Qv=this.Qv;a.sv=this.sv;a.Dw=this.Dw;a.fv=this.fv;a.pv=this.pv;a.Mv=this.Mv;a.Bv=this.Bv;a.Jj=this.Jj;a.tr=this.tr;a.Bw=this.Bw;a.Aw=this.Aw;a.Dg=this.Dg;return a}; +yf.prototype.toString=function(){var a="^";0!==this.wd&&(a+="M:"+this.wd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Fe&&(a+="C:"+this.Fe);0!==this.Nl&&(a+="D:"+this.Nl);this.Ac&&(a+="h");this.bubbles&&(a+="b");null!==this.ca&&(a+="@"+this.ca.toString());return a};w.defineProperty(yf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});w.defineProperty(yf,{bf:"viewPoint"},function(){return this.Jz},function(a){w.G(a,z,yf,"viewPoint");this.Jz.assign(a)}); +w.defineProperty(yf,{ca:"documentPoint"},function(){return this.Oy},function(a){w.G(a,z,yf,"documentPoint");this.Oy.assign(a)});yf.prototype.getMultiTouchViewPoint=yf.prototype.mx=function(a,b){var c=this.g;if(null===c)return b;zf(c,this.event,a,b);return b};yf.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;zf(c,this.event,a,b);b.assign(c.vB(b));return b};w.defineProperty(yf,{wd:"modifiers"},function(){return this.aw},function(a){this.aw=a}); +w.defineProperty(yf,{button:"button"},function(){return this.dv},function(a){this.dv=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});w.defineProperty(yf,{buttons:"buttons"},function(){return this.ev},function(a){this.ev=a});w.defineProperty(yf,{key:"key"},function(){return this.Qv},function(a){this.Qv=a});w.defineProperty(yf,{Ol:"down"},function(){return this.sv},function(a){this.sv=a}); +w.defineProperty(yf,{up:"up"},function(){return this.Dw},function(a){this.Dw=a});w.defineProperty(yf,{Fe:"clickCount"},function(){return this.fv},function(a){this.fv=a});w.defineProperty(yf,{Nl:"delta"},function(){return this.pv},function(a){this.pv=a});w.defineProperty(yf,{cu:"isMultiTouch"},function(){return this.Mv},function(a){this.Mv=a});w.defineProperty(yf,{Ac:"handled"},function(){return this.Bv},function(a){this.Bv=a}); +w.defineProperty(yf,{bubbles:"bubbles"},function(){return this.Jj},function(a){this.Jj=a});w.defineProperty(yf,{event:"event"},function(){return this.tr},function(a){this.tr=a});w.u(yf,{vj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});w.u(yf,{Fk:"isMac"},function(){return w.Fk});w.defineProperty(yf,{timestamp:"timestamp"},function(){return this.Bw},function(a){this.Bw=a}); +w.defineProperty(yf,{Vg:"targetDiagram"},function(){return this.Aw},function(a){this.Aw=a});w.defineProperty(yf,{Pe:"targetObject"},function(){return this.Dg},function(a){this.Dg=a});w.defineProperty(yf,{control:"control"},function(){return 0!==(this.wd&1)},function(a){this.wd=a?this.wd|1:this.wd&-2});w.defineProperty(yf,{shift:"shift"},function(){return 0!==(this.wd&4)},function(a){this.wd=a?this.wd|4:this.wd&-5}); +w.defineProperty(yf,{alt:"alt"},function(){return 0!==(this.wd&2)},function(a){this.wd=a?this.wd|2:this.wd&-3});w.defineProperty(yf,{lu:"meta"},function(){return 0!==(this.wd&8)},function(a){this.wd=a?this.wd|8:this.wd&-9});w.defineProperty(yf,{left:"left"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?0===this.button:0!==(this.buttons&1)},function(a){this.buttons=a?this.buttons|1:this.buttons&-2}); +w.defineProperty(yf,{right:"right"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?2===this.button:0!==(this.buttons&2)},function(a){this.buttons=a?this.buttons|2:this.buttons&-3});w.defineProperty(yf,{mL:"middle"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?1===this.button:0!==(this.buttons&4)},function(a){this.buttons=a?this.buttons|4:this.buttons&-5}); +function Af(){this.Z=null;this.Qb="";this.hw=this.yw=null;this.Pq=!1}w.fa("DiagramEvent",Af);Af.prototype.copy=function(){var a=new Af;a.Z=this.Z;a.Qb=this.Qb;a.yw=this.yw;a.hw=this.hw;a.Pq=this.Pq;return a};Af.prototype.toString=function(){var a="*"+this.name;null!==this.nB&&(a+=":"+this.nB.toString());null!==this.SA&&(a+="("+this.SA.toString()+")");return a};w.defineProperty(Af,{g:"diagram"},function(){return this.Z},function(a){this.Z=a}); +w.defineProperty(Af,{name:"name"},function(){return this.Qb},function(a){this.Qb=a});w.defineProperty(Af,{nB:"subject"},function(){return this.yw},function(a){this.yw=a});w.defineProperty(Af,{SA:"parameter"},function(){return this.hw},function(a){this.hw=a});w.defineProperty(Af,{cancel:"cancel"},function(){return this.Pq},function(a){this.Pq!==a&&w.Ft("DiagramEvent.cancel","2.0");this.Pq=a});function Bf(){this.Qq=Mf;this.Tm=this.$v="";this.ps=this.qs=this.us=this.vs=this.ts=this.Z=this.ke=null} +w.fa("ChangedEvent",Bf);var Nf;Bf.Transaction=Nf=w.p(Bf,"Transaction",-1);var Mf;Bf.Property=Mf=w.p(Bf,"Property",0);var Of;Bf.Insert=Of=w.p(Bf,"Insert",1);var Pf;Bf.Remove=Pf=w.p(Bf,"Remove",2);Bf.prototype.clear=Bf.prototype.clear=function(){this.ps=this.qs=this.us=this.vs=this.ts=this.Z=this.ke=null}; +Bf.prototype.copy=function(){var a=new Bf;a.Qq=this.Qq;a.$v=this.$v;a.Tm=this.Tm;a.ke=this.ke;a.Z=this.Z;a.ts=this.ts;var b=this.vs;a.vs=w.Qa(b)&&"function"===typeof b.S?b.S():b;b=this.us;a.us=w.Qa(b)&&"function"===typeof b.S?b.S():b;b=this.qs;a.qs=w.Qa(b)&&"function"===typeof b.S?b.S():b;b=this.ps;a.ps=w.Qa(b)&&"function"===typeof b.S?b.S():b;return a};Bf.prototype.gc=function(a){a.De===Bf?this.yc=a:w.Fj(this,a)}; +Bf.prototype.toString=function(){var a="",a=this.yc===Nf?a+"* ":this.yc===Mf?a+(null!==this.ba?"!m":"!d"):a+((null!==this.ba?"!m":"!d")+this.yc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.nf&&this.nf!==this.propertyName&&(a+=" "+this.nf);a+=": ";this.yc===Nf?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Qf(this.object)),null!==this.oldValue&&(a+=" old: "+Qf(this.oldValue)),null!==this.Bj&&(a+=" "+this.Bj),null!==this.newValue&& +(a+=" new: "+Qf(this.newValue)),null!==this.Aj&&(a+=" "+this.Aj));return a};Bf.prototype.getValue=Bf.prototype.ja=function(a){return a?this.oldValue:this.newValue};Bf.prototype.getParam=function(a){return a?this.Bj:this.Aj};Bf.prototype.canUndo=Bf.prototype.canUndo=function(){return null!==this.ba||null!==this.g?!0:!1};Bf.prototype.undo=Bf.prototype.undo=function(){this.canUndo()&&(null!==this.ba?this.ba.nn(this,!0):null!==this.g&&this.g.nn(this,!0))}; +Bf.prototype.canRedo=Bf.prototype.canRedo=function(){return null!==this.ba||null!==this.g?!0:!1};Bf.prototype.redo=Bf.prototype.redo=function(){this.canRedo()&&(null!==this.ba?this.ba.nn(this,!1):null!==this.g&&this.g.nn(this,!1))};w.defineProperty(Bf,{ba:"model"},function(){return this.ke},function(a){this.ke=a});w.defineProperty(Bf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});w.defineProperty(Bf,{yc:"change"},function(){return this.Qq},function(a){this.Qq=a}); +w.defineProperty(Bf,{nf:"modelChange"},function(){return this.$v},function(a){this.$v=a});w.defineProperty(Bf,{propertyName:"propertyName"},function(){return this.Tm},function(a){this.Tm=a});w.u(Bf,{rF:"isTransactionFinished"},function(){return this.Qq===Nf&&("CommittedTransaction"===this.Tm||"FinishedUndo"===this.Tm||"FinishedRedo"===this.Tm)});w.defineProperty(Bf,{object:"object"},function(){return this.ts},function(a){this.ts=a}); +w.defineProperty(Bf,{oldValue:"oldValue"},function(){return this.vs},function(a){this.vs=a});w.defineProperty(Bf,{Bj:"oldParam"},function(){return this.us},function(a){this.us=a});w.defineProperty(Bf,{newValue:"newValue"},function(){return this.qs},function(a){this.qs=a});w.defineProperty(Bf,{Aj:"newParam"},function(){return this.ps},function(a){this.ps=a}); +function F(a){1f?b+("\\u000"+a.charCodeAt(d).toString(16)):32>f?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===f?b+"\\u2028":8233===f?b+"\\u2029":b+e}return'"'+b+'"'}; -F.prototype.writeJsonValue=F.prototype.Pu=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.Pu(a.valueOf()):w.isArray(a)?Wf(this,a):w.Qa(a)?Tf(this,a):"function"===typeof a?"null":a.toString()}; -function Wf(a,b,c){void 0===c&&(c=!1);var d=w.Ya(b);if(0>=d)return"[]";var e=new ra;e.add("[ ");c&&1d)return;w.Fg(a.Ce,d)}rg(a,"nodeDataArray",Pf,"nodeDataArray",a,b,null,d,null);a.Nu(b)} -F.prototype.removeNodeDataCollection=function(a){if(w.isArray(a))for(var b=w.Ya(a),c=0;cb&&(b=w.Ya(a));w.qh(a,b,c);rg(this,"",Of,"",a,null,c,null,b)};F.prototype.removeArrayItem=F.prototype.KF=function(a,b){void 0===b&&(b=-1);a===this.Ce&&w.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=w.Ya(a)-1);var c=w.Da(a,b);w.Fg(a,b);rg(this,"",Pf,"",a,c,null,b,null)}; -w.defineProperty(F,{Rn:"nodeCategoryProperty"},function(){return this.Om},function(a){var b=this.Om;b!==a&&(sg(a,F,"nodeCategoryProperty"),this.Om=a,this.h("nodeCategoryProperty",b,a))});F.prototype.getCategoryForNodeData=F.prototype.lA=function(a){if(null===a)return"";var b=this.Om;if(""===b)return"";b=w.rb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""}; -F.prototype.setCategoryForNodeData=F.prototype.by=function(a,b){w.j(b,"string",F,"setCategoryForNodeData:cat");if(null!==a){var c=this.Om;if(""!==c)if(this.Ge(a)){var d=w.rb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),rg(this,"nodeCategory",Mf,c,a,d,b))}else w.Ma(a,c,b)}}; -function P(a,b){F.call(this);2w.El(d,a.newValue)&&w.qh(d,c,a.newValue));return}}else if(a.xc=== -Pf){c=a.zj;if("linkDataArray"===a.nf){d=a.oldValue;w.Qa(d)&&"number"===typeof c&&(e=this.Rf(d),b?(this.Pi.add(d),w.Da(this.df,c)!==d&&w.qh(this.df,c,d),void 0!==e&&this.$c.add(e,d)):(this.Pi.remove(d),w.Da(this.df,c)===d&&w.Fg(this.df,c),void 0!==e&&this.$c.remove(e)));return}if("linkLabelKeys"===a.nf){d=this.Ak(a.object);w.isArray(d)&&"number"===typeof c&&(b?0>w.El(d,a.newValue)&&w.qh(d,c,a.newValue):(c=w.El(d,a.newValue),0<=c&&w.Fg(d,c)));return}}F.prototype.ln.call(this,a,b)}; -w.defineProperty(P,{Oz:"archetypeNodeData"},function(){return this.pm},function(a){var b=this.pm;b!==a&&(null!==a&&w.G(a,Object,P,"archetypeNodeData"),this.pm=a,this.h("archetypeNodeData",b,a))});P.prototype.Kn=function(a){if(void 0!==a){var b=this.pm;if(null!==b){var c=this.te(a);null===c&&(c=this.copyNodeData(b),w.Ma(c,this.ek,a),this.Al(c))}return a}}; -w.defineProperty(P,{In:"linkFromKeyProperty"},function(){return this.Sh},function(a){var b=this.Sh;b!==a&&(sg(a,P,"linkFromKeyProperty"),this.Sh=a,this.h("linkFromKeyProperty",b,a))});P.prototype.getFromKeyForLinkData=P.prototype.Sl=function(a){if(null!==a){var b=this.Sh;if(""!==b&&(b=w.rb(a,b),void 0!==b)){if(tg(b))return b;w.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}}; -P.prototype.setFromKeyForLinkData=P.prototype.$A=function(a,b){null===b&&(b=void 0);void 0===b||tg(b)||w.wd(b,"number or string",P,"setFromKeyForLinkData:key");if(null!==a){var c=this.Sh;if(""!==c)if(b=this.Kn(b),this.th(a)){var d=w.rb(a,c);d!==b&&(Ng(this,d,a),w.Ma(a,c,b),null===this.te(b)&&Mg(this,b,a),rg(this,"linkFromKey",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}}; -w.defineProperty(P,{Jn:"linkToKeyProperty"},function(){return this.Th},function(a){var b=this.Th;b!==a&&(sg(a,P,"linkToKeyProperty"),this.Th=a,this.h("linkToKeyProperty",b,a))});P.prototype.getToKeyForLinkData=P.prototype.Tl=function(a){if(null!==a){var b=this.Th;if(""!==b&&(b=w.rb(a,b),void 0!==b)){if(tg(b))return b;w.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}}; -P.prototype.setToKeyForLinkData=P.prototype.fB=function(a,b){null===b&&(b=void 0);void 0===b||tg(b)||w.wd(b,"number or string",P,"setToKeyForLinkData:key");if(null!==a){var c=this.Th;if(""!==c)if(b=this.Kn(b),this.th(a)){var d=w.rb(a,c);d!==b&&(Ng(this,d,a),w.Ma(a,c,b),null===this.te(b)&&Mg(this,b,a),rg(this,"linkToKey",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}}; -w.defineProperty(P,{iu:"linkFromPortIdProperty"},function(){return this.Jm},function(a){var b=this.Jm;b!==a&&(sg(a,P,"linkFromPortIdProperty"),a!==this.In&&a!==this.Jn||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Jm=a,this.h("linkFromPortIdProperty",b,a))});P.prototype.getFromPortIdForLinkData=P.prototype.UH=function(a){if(null===a)return"";var b=this.Jm;if(""===b)return"";a=w.rb(a,b);return void 0===a?"":a}; -P.prototype.setFromPortIdForLinkData=P.prototype.aB=function(a,b){w.j(b,"string",P,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.Jm;if(""!==c)if(this.th(a)){var d=w.rb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),rg(this,"linkFromPortId",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}}; -w.defineProperty(P,{ku:"linkToPortIdProperty"},function(){return this.Km},function(a){var b=this.Km;b!==a&&(sg(a,P,"linkToPortIdProperty"),a!==this.In&&a!==this.Jn||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Km=a,this.h("linkToPortIdProperty",b,a))});P.prototype.getToPortIdForLinkData=P.prototype.YH=function(a){if(null===a)return"";var b=this.Km;if(""===b)return"";a=w.rb(a,b);return void 0===a?"":a}; -P.prototype.setToPortIdForLinkData=P.prototype.gB=function(a,b){w.j(b,"string",P,"setToPortIdForLinkData:portname");if(null!==a){var c=this.Km;if(""!==c)if(this.th(a)){var d=w.rb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),rg(this,"linkToPortId",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}};w.defineProperty(P,{ju:"linkLabelKeysProperty"},function(){return this.ug},function(a){var b=this.ug;b!==a&&(sg(a,P,"linkLabelKeysProperty"),this.ug=a,this.h("linkLabelKeysProperty",b,a))}); -P.prototype.getLabelKeysForLinkData=P.prototype.Ak=function(a){if(null===a)return w.fo;var b=this.ug;if(""===b)return w.fo;a=w.rb(a,b);return void 0===a?w.fo:a}; -P.prototype.setLabelKeysForLinkData=P.prototype.dG=function(a,b){w.Qz(b,P,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.ug;if(""!==c)if(this.th(a)){var d=w.rb(a,c);void 0===d&&(d=w.fo);if(d!==b){for(var e=w.Ya(d),f=0;fe||(w.Fg(d,e),this.th(a)&&(Ng(this,b,a),rg(this,"linkLabelKeys",Pf,c,a,b,null,e,null)))}else void 0!==d&&w.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; -w.defineProperty(P,{Mg:"linkDataArray"},function(){return this.df},function(a){var b=this.df;if(b!==a){w.Qz(a,P,"linkDataArray");this.$c.clear();for(var c=w.Ya(a),d=0;dd)return;w.Fg(a.df,d)}rg(a,"linkDataArray",Pf,"linkDataArray",a,b,null,d,null);c=a.Sl(b);Ng(a,c,b);c=a.Tl(b);Ng(a,c,b);d=a.Ak(b);if(w.isArray(d))for(var e=w.Ya(d),f=0;fa.Fh&&w.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Fh;d&&b&&a.bd("CommittingTransaction",c,a.kj);var e=0;if(0a.pj;e--)f=d.da(e),null!==f&&f.clear(), -d.Xc(e),a.hz=!0;e=a.uF;0===e&&(e=1);0=e&&(f=d.da(0),null!==f&&f.clear(),d.Xc(0),a.dh--);d.add(b);a.dh++;d.freeze();f=b}a.bd("CommittedTransaction",c,f)}else{a.Ki=!0;try{a.isEnabled&&null!==f&&(f.$t=!0,f.undo())}finally{a.bd("RolledBackTransaction",c,f),a.Ki=!1}null!==f&&f.clear()}a.pv=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c=f.Pf;for(b=c.count-1;b>=a;b--)d=c.da(b),null!==d&&d.undo(),c.Ra(),c.Xc(b);c.freeze()}return!1} -Rf.prototype.canUndo=Rf.prototype.canUndo=function(){if(!this.isEnabled||0=this.Fh&&!this.Yy&&(a=a.g,null!==a&&!1===a.Fn||w.trace("Change not within a transaction: "+c.toString()))}}; -Rf.prototype.skipsEvent=function(a){if(null===a||0>a.xc.value)return!0;a=a.object;if(a instanceof G){if(a=a.layer,null!==a&&a.Jc)return!0}else if(a instanceof mg&&a.Jc)return!0;return!1};w.u(Rf,{SI:"models"},function(){return this.mz.i});w.defineProperty(Rf,{isEnabled:"isEnabled"},function(){return this.cf},function(a){this.cf=a});w.u(Rf,{qG:"transactionToUndo"},function(){return 0<=this.pj&&this.pj<=this.history.count-1?this.history.da(this.pj):null}); -w.u(Rf,{pG:"transactionToRedo"},function(){return this.pj=d)return"[]";var e=new ra;e.add("[ ");c&&1d)return;w.Hg(a.Ce,d)}tg(a,"nodeDataArray",Pf,"nodeDataArray",a,b,null,d,null);a.Mu(b)} +F.prototype.removeNodeDataCollection=function(a){if(w.isArray(a))for(var b=w.Ya(a),c=0;cb&&(b=w.Ya(a));w.qh(a,b,c);tg(this,"",Of,"",a,null,c,null,b)};F.prototype.removeArrayItem=F.prototype.NF=function(a,b){void 0===b&&(b=-1);a===this.Ce&&w.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=w.Ya(a)-1);var c=w.Da(a,b);w.Hg(a,b);tg(this,"",Pf,"",a,c,null,b,null)}; +w.defineProperty(F,{Tn:"nodeCategoryProperty"},function(){return this.Om},function(a){var b=this.Om;b!==a&&(ug(a,F,"nodeCategoryProperty"),this.Om=a,this.h("nodeCategoryProperty",b,a))});F.prototype.getCategoryForNodeData=F.prototype.nA=function(a){if(null===a)return"";var b=this.Om;if(""===b)return"";b=w.sb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""}; +F.prototype.setCategoryForNodeData=F.prototype.ay=function(a,b){w.j(b,"string",F,"setCategoryForNodeData:cat");if(null!==a){var c=this.Om;if(""!==c)if(this.Ge(a)){var d=w.sb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),tg(this,"nodeCategory",Mf,c,a,d,b))}else w.Ma(a,c,b)}}; +function P(a,b){F.call(this);2w.Fl(d,a.newValue)&&w.qh(d,c,a.newValue));return}}else if(a.yc=== +Pf){c=a.Bj;if("linkDataArray"===a.nf){d=a.oldValue;w.Qa(d)&&"number"===typeof c&&(e=this.Sf(d),b?(this.Pi.add(d),w.Da(this.df,c)!==d&&w.qh(this.df,c,d),void 0!==e&&this.ad.add(e,d)):(this.Pi.remove(d),w.Da(this.df,c)===d&&w.Hg(this.df,c),void 0!==e&&this.ad.remove(e)));return}if("linkLabelKeys"===a.nf){d=this.Bk(a.object);w.isArray(d)&&"number"===typeof c&&(b?0>w.Fl(d,a.newValue)&&w.qh(d,c,a.newValue):(c=w.Fl(d,a.newValue),0<=c&&w.Hg(d,c)));return}}F.prototype.nn.call(this,a,b)}; +w.defineProperty(P,{Qz:"archetypeNodeData"},function(){return this.pm},function(a){var b=this.pm;b!==a&&(null!==a&&w.G(a,Object,P,"archetypeNodeData"),this.pm=a,this.h("archetypeNodeData",b,a))});P.prototype.Mn=function(a){if(void 0!==a){var b=this.pm;if(null!==b){var c=this.te(a);null===c&&(c=this.copyNodeData(b),w.Ma(c,this.fk,a),this.Cl(c))}return a}}; +w.defineProperty(P,{Kn:"linkFromKeyProperty"},function(){return this.Sh},function(a){var b=this.Sh;b!==a&&(ug(a,P,"linkFromKeyProperty"),this.Sh=a,this.h("linkFromKeyProperty",b,a))});P.prototype.getFromKeyForLinkData=P.prototype.Tl=function(a){if(null!==a){var b=this.Sh;if(""!==b&&(b=w.sb(a,b),void 0!==b)){if(vg(b))return b;w.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}}; +P.prototype.setFromKeyForLinkData=P.prototype.dB=function(a,b){null===b&&(b=void 0);void 0===b||vg(b)||w.yd(b,"number or string",P,"setFromKeyForLinkData:key");if(null!==a){var c=this.Sh;if(""!==c)if(b=this.Mn(b),this.th(a)){var d=w.sb(a,c);d!==b&&(Rg(this,d,a),w.Ma(a,c,b),null===this.te(b)&&zg(this,b,a),tg(this,"linkFromKey",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}}; +w.defineProperty(P,{Ln:"linkToKeyProperty"},function(){return this.Th},function(a){var b=this.Th;b!==a&&(ug(a,P,"linkToKeyProperty"),this.Th=a,this.h("linkToKeyProperty",b,a))});P.prototype.getToKeyForLinkData=P.prototype.Ul=function(a){if(null!==a){var b=this.Th;if(""!==b&&(b=w.sb(a,b),void 0!==b)){if(vg(b))return b;w.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}}; +P.prototype.setToKeyForLinkData=P.prototype.jB=function(a,b){null===b&&(b=void 0);void 0===b||vg(b)||w.yd(b,"number or string",P,"setToKeyForLinkData:key");if(null!==a){var c=this.Th;if(""!==c)if(b=this.Mn(b),this.th(a)){var d=w.sb(a,c);d!==b&&(Rg(this,d,a),w.Ma(a,c,b),null===this.te(b)&&zg(this,b,a),tg(this,"linkToKey",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}}; +w.defineProperty(P,{hu:"linkFromPortIdProperty"},function(){return this.Jm},function(a){var b=this.Jm;b!==a&&(ug(a,P,"linkFromPortIdProperty"),a!==this.Kn&&a!==this.Ln||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Jm=a,this.h("linkFromPortIdProperty",b,a))});P.prototype.getFromPortIdForLinkData=P.prototype.XH=function(a){if(null===a)return"";var b=this.Jm;if(""===b)return"";a=w.sb(a,b);return void 0===a?"":a}; +P.prototype.setFromPortIdForLinkData=P.prototype.eB=function(a,b){w.j(b,"string",P,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.Jm;if(""!==c)if(this.th(a)){var d=w.sb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),tg(this,"linkFromPortId",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}}; +w.defineProperty(P,{ju:"linkToPortIdProperty"},function(){return this.Km},function(a){var b=this.Km;b!==a&&(ug(a,P,"linkToPortIdProperty"),a!==this.Kn&&a!==this.Ln||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Km=a,this.h("linkToPortIdProperty",b,a))});P.prototype.getToPortIdForLinkData=P.prototype.aI=function(a){if(null===a)return"";var b=this.Km;if(""===b)return"";a=w.sb(a,b);return void 0===a?"":a}; +P.prototype.setToPortIdForLinkData=P.prototype.kB=function(a,b){w.j(b,"string",P,"setToPortIdForLinkData:portname");if(null!==a){var c=this.Km;if(""!==c)if(this.th(a)){var d=w.sb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),tg(this,"linkToPortId",Mf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else w.Ma(a,c,b)}};w.defineProperty(P,{iu:"linkLabelKeysProperty"},function(){return this.wg},function(a){var b=this.wg;b!==a&&(ug(a,P,"linkLabelKeysProperty"),this.wg=a,this.h("linkLabelKeysProperty",b,a))}); +P.prototype.getLabelKeysForLinkData=P.prototype.Bk=function(a){if(null===a)return w.io;var b=this.wg;if(""===b)return w.io;a=w.sb(a,b);return void 0===a?w.io:a}; +P.prototype.setLabelKeysForLinkData=P.prototype.gG=function(a,b){w.Sz(b,P,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.wg;if(""!==c)if(this.th(a)){var d=w.sb(a,c);void 0===d&&(d=w.io);if(d!==b){for(var e=w.Ya(d),f=0;fe||(w.Hg(d,e),this.th(a)&&(Rg(this,b,a),tg(this,"linkLabelKeys",Pf,c,a,b,null,e,null)))}else void 0!==d&&w.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; +w.defineProperty(P,{Ng:"linkDataArray"},function(){return this.df},function(a){var b=this.df;if(b!==a){w.Sz(a,P,"linkDataArray");this.ad.clear();for(var c=w.Ya(a),d=0;dd)return;w.Hg(a.df,d)}tg(a,"linkDataArray",Pf,"linkDataArray",a,b,null,d,null);c=a.Tl(b);Rg(a,c,b);c=a.Ul(b);Rg(a,c,b);d=a.Bk(b);if(w.isArray(d))for(var e=w.Ya(d),f=0;fa.Fh&&w.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Fh;d&&b&&a.cd("CommittingTransaction",c,a.lj);var e=0;if(0a.qj;e--)f=d.da(e),null!==f&&f.clear(), +d.Yc(e),a.hz=!0;e=a.xF;0===e&&(e=1);0=e&&(f=d.da(0),null!==f&&f.clear(),d.Yc(0),a.dh--);d.add(b);a.dh++;d.freeze();f=b}a.cd("CommittedTransaction",c,f)}else{a.Ki=!0;try{a.isEnabled&&null!==f&&(f.Zt=!0,f.undo())}finally{a.cd("RolledBackTransaction",c,f),a.Ki=!1}null!==f&&f.clear()}a.ov=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c=f.Qf;for(b=c.count-1;b>=a;b--)d=c.da(b),null!==d&&d.undo(),c.Ra(),c.Yc(b);c.freeze()}return!1} +Rf.prototype.canUndo=Rf.prototype.canUndo=function(){if(!this.isEnabled||0=this.Fh&&!this.Yy&&(a=a.g,null!==a&&!1===a.Hn||w.trace("Change not within a transaction: "+c.toString()))}}; +Rf.prototype.skipsEvent=function(a){if(null===a||0>a.yc.value)return!0;a=a.object;if(a instanceof G){if(a=a.layer,null!==a&&a.Kc)return!0}else if(a instanceof og&&a.Kc)return!0;return!1};w.u(Rf,{VI:"models"},function(){return this.mz.i});w.defineProperty(Rf,{isEnabled:"isEnabled"},function(){return this.cf},function(a){this.cf=a});w.u(Rf,{tG:"transactionToUndo"},function(){return 0<=this.qj&&this.qj<=this.history.count-1?this.history.da(this.qj):null}); +w.u(Rf,{sG:"transactionToRedo"},function(){return this.qjb.xh||(b.scale=a))};og.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.ny);w.Ed(a,og,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.Fl!==ih)return!1;a*=b.scale;return ab.xh?!1:b.Qw}; -og.prototype.increaseZoom=function(a){void 0===a&&(a=this.ny);w.Ed(a,og,"increaseZoom:factor");var b=this.g;null!==b&&b.Fl===ih&&(a*=b.scale,ab.xh||(b.scale=a))};og.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.ny);w.Ed(a,og,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.Fl!==ih)return!1;a*=b.scale;return ab.xh?!1:b.Qw};og.prototype.resetZoom=function(a){void 0===a&&(a=this.Yw);w.Ed(a,og,"resetZoom:newscale");var b=this.g;null===b||ab.xh||(b.scale=a)}; -og.prototype.canResetZoom=function(a){void 0===a&&(a=this.Yw);w.Ed(a,og,"canResetZoom:newscale");var b=this.g;return null===b||ab.xh?!1:b.Qw};og.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.Kz&&!isNaN(this.iz)&&a.qe.L(this.Jz)?(a.scale=this.iz,a.position=this.TC,this.Kz=NaN,this.Jz=cd):(this.iz=b,this.TC=c.copy(),a.zoomToFit(),this.Kz=a.scale,this.Jz=a.qe.copy())}};og.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.Qw}; -og.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w.G(a,S,og,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.bj&&(this.bj.next()?a=this.bj.value:this.bj=null)}catch(c){this.bj=null}null===a&&(0e||Math.abs(b.y-a.y)>d};w.u(ng,{g:"diagram"},function(){return this.Z});w.defineProperty(ng,{name:"name"},function(){return this.Qb},function(a){w.j(a,"string",ng,"name");this.Qb=a}); -w.defineProperty(ng,{isEnabled:"isEnabled"},function(){return this.cf},function(a){w.j(a,"boolean",ng,"isEnabled");this.cf=a});w.defineProperty(ng,{sa:"isActive"},function(){return this.GC},function(a){w.j(a,"boolean",ng,"isActive");this.GC=a});w.defineProperty(ng,{Ff:"transactionResult"},function(){return this.RD},function(a){null!==a&&w.j(a,"string",ng,"transactionResult");this.RD=a}); -function hh(){ng.call(this);0e&&(e=k),l>f&&(f=l))}}Infinity===c?b.l(0,0,0,0):b.l(c,d,e-c,f-d)} -function wi(a,b){if(null===a.ac){var c=a.g;if(!(null===c||b&&(c.cb||c.xf))&&null!==a.Wb){var d=c.oa;d.isEnabled&&d.jF?null!==d.kj&&0c.qa)){var d=a.g;if(null!==d&&!d.cb&&(d=a.$i,null!==d)){var e=null,f=null;null===c.W&&(e=Gi(a,c.m(0),!1),null!==e&&(f=e.U));var h=null,k=null;null===c.$&&(h=Gi(a,c.m(c.qa-1),!0),null!==h&&(k=h.U));d.isValidLink(f,e,k,h)?b?(c.Op=c.m(0),c.Pp=c.m(c.qa-1),c.Dj=!1,c.W=f,null!==e&&(c.Jg=e.Pd),c.$=k,null!==h&&(c.Eh=h.Pd)):Hi(d,f,e,k,h):Hi(d,null,null,null,null)}}}hh.prototype.doDragOver=function(){}; -function Ii(a,b){var c=a.g;if(null!==c){a.mj&&Di(a,!0);Qh(a);var d=Ei(c,b,null,function(b){return!Bi(a,b)}),e=c.R;e.Pe=d;if(null!==d){e.Ac=!1;for(var f=d;null!==f;){var h=f.GA;if(null!==h&&(h(e,f),e.Ac))break;f=Fi(f)}}else f=c.GA,null!==f&&f(e);if(a.sa||null!==Jh){for(e=(a.ac||a.Wb).i;e.next();)f=e.key,f instanceof T&&f.fe.each(function(a){a.Dj=!1});a.doDropOnto(b,d);if(a.sa||null!==Jh){d=w.Df();for(e=c.selection.i;e.next();)f=e.value,f instanceof T&&Ji(c,f.getAvoidableRect(d));w.Gb(d)}}}} -hh.prototype.doDropOnto=function(){};hh.prototype.doMouseMove=function(){if(this.sa){var a=this.g;if(null!==a&&null!==this.sn&&null!==this.Wb){var b=!1,c=!1;this.mayCopy()?(b=!0,a.bc="copy",wi(this,!1),this.ft(this.ac),xi(this,this.ac,!1),this.jp(this.ac)):this.mayMove()?(c=!0,a.bc="default",Th(this),xi(this,this.Wb,!0)):this.mayDragOut()?(a.bc="no-drop",wi(this,!1),xi(this,this.ac,!1)):Th(this);Ci(this,a.R.ca,c,b)}}}; -hh.prototype.doMouseUp=function(){if(this.sa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.ac?(Th(this),wi(this,!0),this.ft(this.ac),xi(this,this.ac,!1),this.jp(this.ac),null!==this.ac&&a.$F(this.ac.Fj())):(b=!0,Th(this),this.mayMove()&&(xi(this,this.Wb,!0),Ci(this,a.R.ca,!0,!1)));this.pr=!0;Ii(this,a.R.ca);if(this.sa){this.ac=null;if(b&&null!==this.Wb)for(b=this.Wb.i;b.next();){var d=b.key;d instanceof T&&(d=d.Ka,null===d||null===d.placeholder||this.Wb.contains(d)||d.placeholder.I())}a.qc(); -this.jp(this.Wb);this.Ff=c?"Copy":"Move";a.Ba(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};hh.prototype.mayCopy=function(){if(!this.eF)return!1;var a=this.g;if(null===a||a.cb||a.xf||!a.Ep||!a.sk||(w.Ek?!a.R.alt:!a.R.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.de()&&b.canCopy())return!0}return null!==this.dd&&this.mj&&this.dd.canCopy()?!0:!1}; -hh.prototype.mayDragOut=function(){if(!this.eF)return!1;var a=this.g;if(null===a||!a.zt||!a.sk||a.Dl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.de()&&b.canCopy())return!0}return null!==this.dd&&this.mj&&this.dd.canCopy()?!0:!1};hh.prototype.mayMove=function(){var a=this.g;if(null===a||a.cb||!a.Dl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.de()&&b.canMove())return!0}return null!==this.dd&&this.mj&&this.dd.canMove()?!0:!1};var Rh=new I(hh),Jh=null,Kh=null; -hh.prototype.getDraggingSource=function(){return Jh};hh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.eE||a.cb||a.xf||!a.Ep)return!1;var b=Jh;return null===b||null===b.g||b.g.ba.Kl!==a.ba.Kl?!1:!0};hh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Pa.pi();Ki(a);a=Jh;null!==a&&null!==a.g&&(a.g.bc="copy")}};hh.prototype.doSimulatedDragLeave=function(){var a=Jh;null!==a&&a.doSimulatedDragOut();this.doCancel()}; -hh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Jh;null!==b&&null!==b.Wb&&this.mayDragIn()&&(a.bc="copy",Li(this,b.Wb.Fj(),!1),xi(this,this.ac,!1),Ci(this,a.R.ca,!1,!0))}}; -hh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Jh;if(null!==b){var c=b.g;b.pr=!0;Th(this);this.mayDragIn()&&(this.Tb("Drop"),Li(this,b.Wb.Fj(),!0),xi(this,this.ac,!1),null!==this.ac&&a.$F(this.ac.Fj()),Ii(this,a.R.ca),a.qc(),b=a.selection,null!==this.ac?this.Ff="ExternalCopy":b=new J(S),this.ac=null,a.doFocus(),a.Ba("ExternalObjectsDropped",b,c),this.Jk())}}}; -function Li(a,b,c){if(null===a.ac){var d=a.g;if(null!==d&&!d.cb&&!d.xf){d.wb=!c;d.Fq=!c;a.Ik=d.R.ca;d=d.Np(b,d,!0);c=w.Df();vi(b,c);var e=c.x+c.width/2,f=c.y+c.height/2;w.Gb(c);var h=a.xw;c=new ka(S);var k=w.K();for(b=b.i;b.next();){var l=b.value;if(l.de()&&l.canCopy()){var m=l.location,l=d.ka(l);k.l(h.x-(e-m.x),h.y-(f-m.y));l.location=k;l.Ze();c.add(l,Nh(k))}}w.v(k);for(d=d.i;d.next();)e=d.value,e instanceof W&&e.canCopy()&&c.add(e,Nh());a.ac=c;Ih(a,c.Fj());null!==a.dd&&(c=a.dd,d=c.Un,c.am(a.Ik.x- -(d.x+d.width/2),a.Ik.y-(d.y+d.height/2)))}}}hh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.bc="":a.bc="no-drop")};function Oh(a){this.point=a;this.eG=bd}w.fa("DraggingInfo",Oh);function yi(a,b,c){this.Nc=a;this.info=b;this.aI=c} -function Mi(){0=d&&(d=.1);for(var e=this,f=b.un(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,f=f.i;f.next();){var h=f.value,k=h.U;if(k instanceof T){var l=h.Wa(Fb,w.K()),m=c.x-l.x,n=c.y-l.y;w.v(l);l=m*m+n*n;lc){if(null!==this.jc&&a===this.Og&&b===this.Pg)return!0;var d=b.Pd;null===d&&(d="");if(a.ix(d).count>=c)return!1}return!0}; -Mi.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.dq;if(null!==this.g&&this.g.Za===this&&(null!==a.layer&&!a.layer.At||!0!==b.mG))return!1;var c=b.KJ;if(Infinity>c){if(null!==this.jc&&a===this.Qg&&b===this.Rg)return!0;var d=b.Pd;null===d&&(d="");if(a.Ig(d).count>=c)return!1}return!0};Mi.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.U,d=b.U;return null!==c&&c===d}; -Mi.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.U;if(!(c instanceof T))return!1;var d=a.Pd;null===d&&(d="");var e=b.U;if(!(e instanceof T))return!1;var f=b.Pd;null===f&&(f="");for(e=e.Ig(f);e.next();)if(f=e.value,f.W===c&&f.Jg===d)return!0;return!1}; -Mi.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.RH&&d.JJ||!this.isInSameNode(b,d))&&(b.QH&&d.IJ||!this.isLinked(b,d)))||null!==this.jc&&(null!==a&&this.isLabelDependentOnLink(a,this.jc)||null!==c&&this.isLabelDependentOnLink(c,this.jc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.jc))return!1;if(null!==a){var e=a.Gx;if(null!==e&&!e(a,b,c,d,this.jc))return!1}if(null!== -c&&(e=c.Gx,null!==e&&!e(a,b,c,d,this.jc)))return!1;e=this.Gx;return null!==e?e(a,b,c,d,this.jc):!0};Mi.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Lc;if(null===c)return!1;if(c===b)return!0;var d=new J(T);d.add(a);return Ni(this,c,b,d)};function Ni(a,b,c,d){if(b===c)return!0;var e=b.W;if(null!==e&&e.lf&&(d.add(e),Ni(a,e.Lc,c,d)))return!0;b=b.$;return null!==b&&b.lf&&(d.add(b),Ni(a,b.Lc,c,d))?!0:!1} -Mi.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.dq;var d=null!==this.g?this.g.QJ:Oi;if(d!==Oi){if(d===Pi){if(null!==c&&!c.Kc)return!0;for(d=b.fe;d.next();){var e=d.value;if(e!==c&&e.Kc&&e.$===b)return!1}return!Qi(this,a,b,c,!0)}if(d===Ri){if(null!==c&&!c.Kc)return!0;for(d=a.fe;d.next();)if(e=d.value,e!==c&&e.Kc&&e.W===a)return!1;return!Qi(this,a,b,c,!0)}if(d===Si)return a===b?a=!0:(d=new J(T),d.add(b),a=Ti(this,d,a,b,c)),!a;if(d===Ui)return!Qi(this, -a,b,c,!1);if(d===Vi)return a===b?a=!0:(d=new J(T),d.add(b),a=Wi(this,d,a,b,c)),!a}return!0};function Qi(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.fe;f.next();){var h=f.value;if(h!==d&&(!e||h.Kc)&&h.$===b&&(h=h.W,h!==b&&Qi(a,h,c,d,e)))return!0}return!1}function Ti(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.fe;f.next();){var h=f.value;if(h!==e&&h.$===c&&(h=h.W,h!==c&&Ti(a,b,h,d,e)))return!0}return!1} -function Wi(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.fe;f.next();){var h=f.value;if(h!==e){var k=h.W,h=h.$,k=k===c?h:k;if(k!==c&&Wi(a,b,k,d,e))return!0}}return!1}w.defineProperty(Mi,{Gx:"linkValidation"},function(){return this.ml},function(a){null!==a&&w.j(a,"function",Mi,"linkValidation");this.ml=a});w.defineProperty(Mi,{Qx:"portTargeted"},function(){return this.rD},function(a){null!==a&&w.j(a,"function",Mi,"portTargeted");this.rD=a}); -function Xi(){0b.Ot+1&&c=c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d? -"ne-resize":"e-resize"}else if(a instanceof C)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};w.defineProperty(uj,{Vt:"handleArchetype"},function(){return this.bl},function(a){null!==a&&w.G(a,G,uj,"handleArchetype");this.bl=a});w.u(uj,{handle:"handle"},function(){return this.ec});w.defineProperty(uj,{qb:"adornedObject"},function(){return this.Dc},function(a){null!==a&&w.G(a,G,uj,"adornedObject");this.Dc=a}); -uj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.cb&&a.Bt&&a.R.left?null!==this.findToolHandleAt(a.zc.ca,this.name):!1}; -uj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.ec=this.findToolHandleAt(a.zc.ca,this.name),null!==this.ec&&(this.Dc=this.ec.U.qb,this.fp.set(this.qb.Wa(this.handle.alignment.CF())),this.mD.set(this.Dc.U.location),this.hD.set(this.Dc.Aa),this.Uy=this.computeCellSize(),this.Wy=this.computeMinSize(),this.Vy=this.computeMaxSize(),a.$e=!0,this.eD=a.Pa.isEnabled,a.Pa.isEnabled=!1,this.Tb(this.name),this.sa=!0))}; -uj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Jk(),this.Dc=this.ec=null,this.sa=a.$e=!1,a.Pa.isEnabled=this.eD)};uj.prototype.doCancel=function(){null!==this.qb&&(this.qb.Aa=this.DF,this.qb.U.location=this.$I);this.stopTool()};uj.prototype.doMouseMove=function(){var a=this.g;if(this.sa&&null!==a){var b=this.Wy,c=this.Vy,d=this.Uy,e=this.qb.OE(a.R.ca,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.Yf();w.v(e)}}; -uj.prototype.doMouseUp=function(){var a=this.g;if(this.sa&&null!==a){var b=this.Wy,c=this.Vy,d=this.Uy,e=this.qb.OE(a.R.ca,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);w.v(e);a.qc();this.Ff=this.name;a.Ba("PartResized",this.qb,this.DF)}this.stopTool()}; -uj.prototype.resize=function(a){if(null!==this.g){var b=this.qb,c=b.U;b.Aa=a.size;c.Ze();a=this.qb.Wa(this.handle.alignment.CF());c instanceof U?(a=c.position.copy().Yn(a).add(this.fp),c.move(a)):c.location=c.location.copy().Yn(a).add(this.fp)}}; -uj.prototype.computeResize=function(a,b,c,d,e,f){b.Nd()&&(b=Fb);var h=this.qb.Ia,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!f){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=w.K();Ka(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,pb.xh||(b.scale=a))};qg.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.my);w.Fd(a,qg,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.Gl!==mh)return!1;a*=b.scale;return ab.xh?!1:b.Pw}; +qg.prototype.increaseZoom=function(a){void 0===a&&(a=this.my);w.Fd(a,qg,"increaseZoom:factor");var b=this.g;null!==b&&b.Gl===mh&&(a*=b.scale,ab.xh||(b.scale=a))};qg.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.my);w.Fd(a,qg,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.Gl!==mh)return!1;a*=b.scale;return ab.xh?!1:b.Pw};qg.prototype.resetZoom=function(a){void 0===a&&(a=this.Xw);w.Fd(a,qg,"resetZoom:newscale");var b=this.g;null===b||ab.xh||(b.scale=a)}; +qg.prototype.canResetZoom=function(a){void 0===a&&(a=this.Xw);w.Fd(a,qg,"canResetZoom:newscale");var b=this.g;return null===b||ab.xh?!1:b.Pw};qg.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.Mz&&!isNaN(this.iz)&&a.qe.L(this.Lz)?(a.scale=this.iz,a.position=this.WC,this.Mz=NaN,this.Lz=ed):(this.iz=b,this.WC=c.copy(),a.zoomToFit(),this.Mz=a.scale,this.Lz=a.qe.copy())}};qg.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.Pw}; +qg.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w.G(a,S,qg,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.bj&&(this.bj.next()?a=this.bj.value:this.bj=null)}catch(c){this.bj=null}null===a&&(0e||Math.abs(b.y-a.y)>d};w.u(pg,{g:"diagram"},function(){return this.Z});w.defineProperty(pg,{name:"name"},function(){return this.Qb},function(a){w.j(a,"string",pg,"name");this.Qb=a}); +w.defineProperty(pg,{isEnabled:"isEnabled"},function(){return this.cf},function(a){w.j(a,"boolean",pg,"isEnabled");this.cf=a});w.defineProperty(pg,{sa:"isActive"},function(){return this.JC},function(a){w.j(a,"boolean",pg,"isActive");this.JC=a});w.defineProperty(pg,{Gf:"transactionResult"},function(){return this.UD},function(a){null!==a&&w.j(a,"string",pg,"transactionResult");this.UD=a}); +function lh(){pg.call(this);0e&&(e=k),l>f&&(f=l))}}Infinity===c?b.m(0,0,0,0):b.m(c,d,e-c,f-d)} +function Di(a,b){if(null===a.bc){var c=a.g;if(!(null===c||b&&(c.eb||c.yf))&&null!==a.Xb){var d=c.oa;d.isEnabled&&d.mF?null!==d.lj&&0c.qa)){var d=a.g;if(null!==d&&!d.eb){var e=a.$i;if(null!==e){var f=null,h=null;null===c.Y&&(f=Ni(a,c.l(0),!1),null!==f&&(h=f.U));var k=null,l=null;null===c.$&&(k=Ni(a,c.l(c.qa-1),!0),null!==k&&(l=k.U));e.isValidLink(h,f,l,k)?b?(c.Np=c.l(0),c.Op=c.l(c.qa-1),c.fm=!1,c.Y=h,null!==f&&(c.Lg=f.Qd),c.$=l,null!==k&&(c.Eh=k.Qd),c.Jc!==a.pz&&d.Aa("LinkRelinked",c,a.pz),c.jd!==a.qz&&d.Aa("LinkRelinked",c,a.qz)):Oi(e,h,f,l,k):Oi(e,null,null,null,null)}}}} +lh.prototype.doDragOver=function(){}; +function Pi(a,b){var c=a.g;if(null!==c){a.nj&&Ki(a,!0);Vh(a);var d=Li(c,b,null,function(b){return!Ii(a,b)}),e=c.R;e.Pe=d;if(null!==d){e.Ac=!1;for(var f=d;null!==f;){var h=f.KA;if(null!==h&&(h(e,f),e.Ac))break;f=Mi(f)}}else f=c.KA,null!==f&&f(e);if(a.sa||null!==Oh){for(e=(a.bc||a.Xb).i;e.next();)f=e.key,f instanceof T&&f.fe.each(function(a){a.fm=!1});a.doDropOnto(b,d);if(a.sa||null!==Oh){d=w.Ef();for(e=c.selection.i;e.next();)f=e.value,f instanceof T&&Qi(c,f.getAvoidableRect(d));w.Db(d)}}}} +lh.prototype.doDropOnto=function(){};lh.prototype.doMouseMove=function(){if(this.sa){var a=this.g;if(null!==a&&null!==this.un&&null!==this.Xb){var b=!1,c=!1;this.mayCopy()?(b=!0,a.cc="copy",Di(this,!1),Nh(this,this.bc),Ei(this,this.bc,!1),Wh(this,this.bc)):this.mayMove()?(c=!0,a.cc="default",Zh(this),Ei(this,this.Xb,!0)):this.mayDragOut()?(a.cc="no-drop",Di(this,!1),Ei(this,this.bc,!1)):Zh(this);Ji(this,a.R.ca,c,b)}}}; +lh.prototype.doMouseUp=function(){if(this.sa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.bc?(Zh(this),Di(this,!0),Nh(this,this.bc),Ei(this,this.bc,!1),Wh(this,this.bc),null!==this.bc&&a.cG(this.bc.Gj())):(b=!0,Zh(this),this.mayMove()&&(Ei(this,this.Xb,!0),Ji(this,a.R.ca,!0,!1)));this.or=!0;Pi(this,a.R.ca);if(this.sa){this.bc=null;if(b&&null!==this.Xb)for(b=this.Xb.i;b.next();){var d=b.key;d instanceof T&&(d=d.Ka,null===d||null===d.placeholder||this.Xb.contains(d)||d.placeholder.I())}a.rc(); +Wh(this,this.Xb);this.Gf=c?"Copy":"Move";a.Aa(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};lh.prototype.mayCopy=function(){if(!this.hF)return!1;var a=this.g;if(null===a||a.eb||a.yf||!a.Fp||!a.tk||(w.Fk?!a.R.alt:!a.R.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.de()&&b.canCopy())return!0}return null!==this.ed&&this.nj&&this.ed.canCopy()?!0:!1}; +lh.prototype.mayDragOut=function(){if(!this.hF)return!1;var a=this.g;if(null===a||!a.yt||!a.tk||a.El)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.de()&&b.canCopy())return!0}return null!==this.ed&&this.nj&&this.ed.canCopy()?!0:!1};lh.prototype.mayMove=function(){var a=this.g;if(null===a||a.eb||!a.El)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.de()&&b.canMove())return!0}return null!==this.ed&&this.nj&&this.ed.canMove()?!0:!1};var Xh=new I(lh),Oh=null,Ph=null; +lh.prototype.getDraggingSource=function(){return Oh};lh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.hE||a.eb||a.yf||!a.Fp)return!1;var b=Oh;return null===b||null===b.g||b.g.ba.Ll!==a.ba.Ll?!1:!0};lh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Pa.pi();Ri(a);a=Oh;null!==a&&null!==a.g&&(a.g.cc="copy")}};lh.prototype.doSimulatedDragLeave=function(){var a=Oh;null!==a&&a.doSimulatedDragOut();this.doCancel()}; +lh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Oh;null!==b&&null!==b.Xb&&this.mayDragIn()&&(a.cc="copy",Si(this,b.Xb.Gj(),!1),Ei(this,this.bc,!1),Ji(this,a.R.ca,!1,!0))}}; +lh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Oh;if(null!==b){var c=b.g;b.or=!0;Zh(this);this.mayDragIn()&&(this.Ub("Drop"),Si(this,b.Xb.Gj(),!0),Ei(this,this.bc,!1),null!==this.bc&&a.cG(this.bc.Gj()),Pi(this,a.R.ca),a.rc(),b=a.selection,null!==this.bc?this.Gf="ExternalCopy":b=new J(S),this.bc=null,a.doFocus(),a.Aa("ExternalObjectsDropped",b,c),this.Lk())}}}; +function Si(a,b,c){if(null===a.bc){var d=a.g;if(null!==d&&!d.eb&&!d.yf){d.wb=!c;d.Eq=!c;a.Kk=d.R.ca;d=d.Mp(b,d,!0);c=w.Ef();Ci(b,c);var e=c.x+c.width/2,f=c.y+c.height/2;w.Db(c);var h=a.ww;c=new ka(S);var k=w.K();for(b=b.i;b.next();){var l=b.value,m=d.ja(l);l.de()&&l.canCopy()?(l=l.location,k.m(h.x-(e-l.x),h.y-(f-l.y)),m.location=k,m.Ze(),c.add(m,Sh(k))):l instanceof W&&l.canCopy()&&m.Hk(h.x-e,h.y-f)}w.v(k);for(d=d.i;d.next();)e=d.value,e instanceof W&&e.canCopy()&&c.add(e,Sh());a.bc=c;Mh(a,c.Gj()); +null!==a.ed&&(c=a.ed,d=c.Wn,c.Hk(a.Kk.x-(d.x+d.width/2),a.Kk.y-(d.y+d.height/2)))}}}lh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.cc="":a.cc="no-drop")};function Th(a){this.point=a;this.hG=dd}w.fa("DraggingInfo",Th);function Fi(a,b,c){this.Oc=a;this.info=b;this.dI=c} +function Ti(){0=d&&(d=.1);for(var e=this,f=b.wn(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,f=f.i;f.next();){var h=f.value,k=h.U;if(k instanceof T){var l=h.Wa(Gb,w.K()),m=c.x-l.x,n=c.y-l.y;w.v(l);l=m*m+n*n;lc){if(null!==this.kc&&a===this.Pg&&b===this.Qg)return!0;var d=b.Qd;null===d&&(d="");if(a.hx(d).count>=c)return!1}return!0}; +Ti.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.cq;if(null!==this.g&&this.g.Za===this&&(null!==a.layer&&!a.layer.zt||!0!==b.pG))return!1;var c=b.NJ;if(Infinity>c){if(null!==this.kc&&a===this.Rg&&b===this.Sg)return!0;var d=b.Qd;null===d&&(d="");if(a.Kg(d).count>=c)return!1}return!0};Ti.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.U,d=b.U;return null!==c&&c===d}; +Ti.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.U;if(!(c instanceof T))return!1;var d=a.Qd;null===d&&(d="");var e=b.U;if(!(e instanceof T))return!1;var f=b.Qd;null===f&&(f="");for(e=e.Kg(f);e.next();)if(f=e.value,f.Y===c&&f.Lg===d)return!0;return!1}; +Ti.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.UH&&d.MJ||!this.isInSameNode(b,d))&&(b.TH&&d.LJ||!this.isLinked(b,d)))||null!==this.kc&&(null!==a&&this.isLabelDependentOnLink(a,this.kc)||null!==c&&this.isLabelDependentOnLink(c,this.kc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.kc))return!1;if(null!==a){var e=a.Fx;if(null!==e&&!e(a,b,c,d,this.kc))return!1}if(null!== +c&&(e=c.Fx,null!==e&&!e(a,b,c,d,this.kc)))return!1;e=this.Fx;return null!==e?e(a,b,c,d,this.kc):!0};Ti.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Mc;if(null===c)return!1;if(c===b)return!0;var d=new J(T);d.add(a);return Ui(this,c,b,d)};function Ui(a,b,c,d){if(b===c)return!0;var e=b.Y;if(null!==e&&e.lf&&(d.add(e),Ui(a,e.Mc,c,d)))return!0;b=b.$;return null!==b&&b.lf&&(d.add(b),Ui(a,b.Mc,c,d))?!0:!1} +Ti.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.cq;var d=null!==this.g?this.g.TJ:Vi;if(d!==Vi){if(d===Wi){if(null!==c&&!c.Lc)return!0;for(d=b.fe;d.next();){var e=d.value;if(e!==c&&e.Lc&&e.$===b)return!1}return!Xi(this,a,b,c,!0)}if(d===Yi){if(null!==c&&!c.Lc)return!0;for(d=a.fe;d.next();)if(e=d.value,e!==c&&e.Lc&&e.Y===a)return!1;return!Xi(this,a,b,c,!0)}if(d===Zi)return a===b?a=!0:(d=new J(T),d.add(b),a=$i(this,d,a,b,c)),!a;if(d===aj)return!Xi(this, +a,b,c,!1);if(d===bj)return a===b?a=!0:(d=new J(T),d.add(b),a=cj(this,d,a,b,c)),!a}return!0};function Xi(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.fe;f.next();){var h=f.value;if(h!==d&&(!e||h.Lc)&&h.$===b&&(h=h.Y,h!==b&&Xi(a,h,c,d,e)))return!0}return!1}function $i(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.fe;f.next();){var h=f.value;if(h!==e&&h.$===c&&(h=h.Y,h!==c&&$i(a,b,h,d,e)))return!0}return!1} +function cj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.fe;f.next();){var h=f.value;if(h!==e){var k=h.Y,h=h.$,k=k===c?h:k;if(k!==c&&cj(a,b,k,d,e))return!0}}return!1}w.defineProperty(Ti,{Fx:"linkValidation"},function(){return this.ol},function(a){null!==a&&w.j(a,"function",Ti,"linkValidation");this.ol=a});w.defineProperty(Ti,{Px:"portTargeted"},function(){return this.uD},function(a){null!==a&&w.j(a,"function",Ti,"portTargeted");this.uD=a}); +function dj(){0b.Nt+1&&c=c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d? +"ne-resize":"e-resize"}else if(a instanceof C)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};w.defineProperty(Kj,{Ut:"handleArchetype"},function(){return this.dl},function(a){null!==a&&w.G(a,G,Kj,"handleArchetype");this.dl=a});w.u(Kj,{handle:"handle"},function(){return this.fc});w.defineProperty(Kj,{rb:"adornedObject"},function(){return this.Dc},function(a){null!==a&&w.G(a,G,Kj,"adornedObject");this.Dc=a}); +Kj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.eb&&a.At&&a.R.left?null!==this.findToolHandleAt(a.zc.ca,this.name):!1}; +Kj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.fc=this.findToolHandleAt(a.zc.ca,this.name),null!==this.fc&&(this.Dc=this.fc.U.rb,this.hp.set(this.rb.Wa(this.handle.alignment.FF())),this.pD.set(this.Dc.U.location),this.kD.set(this.Dc.Ba),this.Uy=this.computeCellSize(),this.Wy=this.computeMinSize(),this.Vy=this.computeMaxSize(),a.$e=!0,this.hD=a.Pa.isEnabled,a.Pa.isEnabled=!1,this.Ub(this.name),this.sa=!0))}; +Kj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Lk(),this.Dc=this.fc=null,this.sa=a.$e=!1,a.Pa.isEnabled=this.hD)};Kj.prototype.doCancel=function(){null!==this.rb&&(this.rb.Ba=this.GF,this.rb.U.location=this.cJ);this.stopTool()};Kj.prototype.doMouseMove=function(){var a=this.g;if(this.sa&&null!==a){var b=this.Wy,c=this.Vy,d=this.Uy,e=this.rb.RE(a.R.ca,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.Zf();w.v(e)}}; +Kj.prototype.doMouseUp=function(){var a=this.g;if(this.sa&&null!==a){var b=this.Wy,c=this.Vy,d=this.Uy,e=this.rb.RE(a.R.ca,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);w.v(e);a.rc();this.Gf=this.name;a.Aa("PartResized",this.rb,this.GF)}this.stopTool()}; +Kj.prototype.resize=function(a){if(null!==this.g){var b=this.rb,c=b.U;b.Ba=a.size;c.Ze();a=this.rb.Wa(this.handle.alignment.FF());c instanceof U?(a=c.position.copy().$n(a).add(this.hp),c.move(a)):c.location=c.location.copy().$n(a).add(this.hp)}}; +Kj.prototype.computeResize=function(a,b,c,d,e,f){b.Od()&&(b=Gb);var h=this.rb.Ia,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!f){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=w.K();Ka(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height), a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p=b.y?(a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=n-a.y,f||(a.width=a.height/p,a.x= -k+.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(a.width=a.height/p,a.x=k+.5*(m-k-a.width)));w.v(q);return a};uj.prototype.computeReshape=function(){var a=Ij;this.qb instanceof X&&(a=Jj(this.qb));return!(a===Kj||a===Lj||null!==this.g&&this.g.R.shift)};uj.prototype.computeMinSize=function(){var a=this.qb.zh.copy(),b=this.zh;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a}; -uj.prototype.computeMaxSize=function(){var a=this.qb.Af.copy(),b=this.Af;!isNaN(b.width)&&b.widtha&&(a+=360));var b=Math.min(Math.abs(this.AJ),180),c=Math.min(Math.abs(this.zJ),b/2);(null===this.g||!this.g.R.shift)&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};w.defineProperty(Mj,{AJ:"snapAngleMultiple"},function(){return this.xD},function(a){w.j(a,"number",Mj,"snapAngleMultiple");this.xD=a}); -w.defineProperty(Mj,{zJ:"snapAngleEpsilon"},function(){return this.wD},function(a){w.j(a,"number",Mj,"snapAngleEpsilon");this.wD=a});w.u(Mj,{qL:"originalAngle"},function(){return this.ew});function Oj(){ng.call(this);0e.right&&(c.x-=d.width+5);c.xe.bottom&&(c.y-=d.height+5);c.ya.R.Fe?!1:!0};ak.prototype.doStart=function(){this.sa||null===this.Xg||this.doActivate()}; -ak.prototype.doActivate=function(){if(!this.sa){var a=this.g;if(null!==a){var b=this.Xg;null===b&&(b=a.Je(a.R.ca,function(a){return a instanceof Ch?a:null}));if(null!==b&&(this.Xg=b,null!==b.U)){this.sa=!0;this.Ta=jk;var c=this.DH;null!==b.lG&&(c=b.lG);this.kk=this.Xg.copy();var d=new A(this.Xg.Wa(vb),this.Xg.Wa(Kb));a.sJ(d);if(c instanceof Rj)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex="100";c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();"function"=== -typeof c.focus&&c.focus();"function"===typeof c.select&&this.ay&&(c.select(),c.setSelectionRange(0,9999));a.lj.appendChild(c)}this.jj=c}}}};ak.prototype.doCancel=function(){null!==this.ql&&this.jj instanceof HTMLElement&&(this.jj.style.border=this.ql,this.ql=null);this.stopTool()};ak.prototype.doMouseUp=function(){!this.sa&&this.canStart()&&this.doActivate()};ak.prototype.doMouseDown=function(){this.sa&&this.acceptText(fk)}; -ak.prototype.acceptText=function(a){switch(a){case fk:if(this.Ta===nk)this.jj instanceof HTMLElement&&this.jj.focus();else if(this.Ta===jk||this.Ta===mk||this.Ta===kk)this.Ta=lk,qk(this);break;case ek:case hk:case gk:if(hk===a&&!0===this.Dz.yx)break;if(this.Ta===jk||this.Ta===mk||this.Ta===kk)this.Ta=lk,qk(this)}}; -function qk(a){var b=a.Xg,c=a.g,d=a.jj;if(null!==b&&null!==d){var e=b.text,f="";d instanceof Rj?null!==d.vB&&(f=d.vB()):(f=d.value,f="function"===typeof f?f():f);a.isValidText(b,e,f)?(a.Tb(a.name),a.Ta=nk,d instanceof Rj?d.show(b,c,a):null!==a.ql&&(d.style.border=a.ql,a.ql=null),a.Ff=a.name,b.text=f,null!==b.kG&&b.kG(b,e,f),null!==c&&c.Ba("TextEdited",b,e),a.Jk(),a.stopTool(),null!==c&&c.doFocus()):(a.Ta=mk,null!==b.eA&&b.eA(a,e,f),d instanceof Rj?d.show(b,c,a):(null===a.ql&&(a.ql=d.style.border, -d.style.border="3px solid red"),"function"===typeof d.focus&&d.focus()))}}ak.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.Ta=ck;this.Xg=null;if(null!==this.jj){var b=this.jj;if(b instanceof Rj)b.Cn(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.lj.removeChild(b)}}this.sa=!1}};ak.prototype.doFocus=function(){ok(this)};ak.prototype.doBlur=function(){pk(this)}; -function ok(a){if(null!==a.jj){var b=a.Ky;a.Ta===jk&&(a.Ta=kk);"function"===typeof b.select&&a.ay&&(b.select(),b.setSelectionRange(0,9999))}}function pk(a){if(null!==a.jj){var b=a.Ky;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.ay&&(b.select(),b.setSelectionRange(0,9999))}}ak.prototype.isValidText=function(a,b,c){w.G(a,Ch,ak,"isValidText:textblock");var d=this.lB;if(null!==d&&!d(a,b,c))return!1;d=a.lB;return null===d||d(a,b,c)?!0:!1}; -w.defineProperty(ak,{lB:"textValidation"},function(){return this.vl},function(a){null!==a&&w.j(a,"function",ak,"textValidation");this.vl=a});w.defineProperty(ak,{xF:"minimumEditorScale"},function(){return this.ZC},function(a){null!==a&&w.j(a,"number",ak,"minimumEditorScale");this.ZC=a});w.defineProperty(ak,{ay:"selectsTextOnActivate"},function(){return this.uD},function(a){null!==a&&w.j(a,"boolean",ak,"selectsTextOnActivate");this.uD=a}); -w.defineProperty(ak,{state:"state"},function(){return this.Ta},function(a){this.Ta!==a&&(w.mb(a,ak,ak,"starting"),this.Ta=a)});ak.prototype.measureTemporaryTextBlock=ak.prototype.MI=function(a){var b=this.kk;b.text=a;rk(b,this.Xg.Wo,Infinity);return b};function bh(){ng.call(this);this.name="ToolManager";this.HG=new I(ng);this.IG=new I(ng);this.JG=new I(ng);this.DC=this.EC=850;this.sC=(new ha(2,2)).Ga();this.OD=5E3;this.cD=Hh;this.BC=sk;this.ov=this.gC=null;this.en=-1}w.La(bh,ng); -w.fa("ToolManager",bh);var Hh;bh.WheelScroll=Hh=w.p(bh,"WheelScroll",0);var Gh;bh.WheelZoom=Gh=w.p(bh,"WheelZoom",1);bh.WheelNone=w.p(bh,"WheelNone",2);var sk;bh.GestureZoom=sk=w.p(bh,"GestureZoom",3);var tk;bh.GestureCancel=tk=w.p(bh,"GestureCancel",4);var uk;bh.GestureNone=uk=w.p(bh,"GestureNone",5);w.defineProperty(bh,{pu:"mouseWheelBehavior"},function(){return this.cD},function(a){w.mb(a,bh,bh,"mouseWheelBehavior");this.cD=a}); -w.defineProperty(bh,{Xp:"gestureBehavior"},function(){return this.BC},function(a){w.mb(a,bh,bh,"gestureBehavior");this.BC=a});bh.prototype.initializeStandardTools=function(){this.UG=new Pj;this.JF=new Lh;this.EI=new fj;this.UF=new uj;this.pJ=new Mj;this.tF=new Xi;this.re=new hh;this.IH=new Yj;this.aJ=new Zj;this.Vz=new Tj;this.kB=new ak;this.kH=new Qj;this.lH=new Oj}; -bh.prototype.updateAdornments=function(a){var b=this.Jl;if(b instanceof dh&&this.ov===a){var c=b.qb;(null!==a?c.U===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; -bh.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.R;b.tj&&this.Xp===tk&&(b.bubbles=!1);if(b.du){this.cancelWaitAfter();if(this.Xp===uk){b.bubbles=!0;return}if(this.Xp===tk)return;if(a.Za.canStartMultiTouch()){a.Za.standardPinchZoomStart();return}}var c=a.oa;c.Rz&&0!==c.Fh&&w.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.af.length,d=0;de.right&&(c.x-=d.width+5);c.xe.bottom?c.y-(d.height+5):c.y+20;c.ya?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}w.u(Qg,{pK:"animationReasons"},function(){return this.av}); -Qg.prototype.canStart=function(){return!0};Qg.prototype.prepareAutomaticAnimation=Qg.prototype.Sn=function(a){this.cf&&(this.Wj||this.Z.Fn)&&(this.av.add(a),this.canStart(a)&&(this.Vj&&this.pi(),this.oc=!0))};function zk(a){if(a.cf&&(a.av.clear(),a.oc))if(!a.lo)a.oc=!1;else if(0===a.ko){var b=+new Date;a.ko=b;requestAnimationFrame(function(){if(!1!==a.oc&&!a.Vj&&a.ko===b){var c=a.Z;c.oj("temporaryPixelRatio")&&(c.jk=1);Ak(c);a.oc=!1;c.Ba("AnimationStarting");Bk(a,b)}})}} -function Ck(a,b,c,d,e,f){if(!(!a.oc||"position"===c&&d.L(e)||b instanceof S&&!b.cF)){var h=a.Pm;if(h.contains(b)){var h=h.ka(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=Qk(d));h.Vw&&void 0!==l[c]?h.Jt[c]=Qk(e):(f||(h.Jt[c]=Qk(e)),l[c]=Qk(e));f&&0===c.indexOf("position:")&&b instanceof S&&(h.Jt.location=Qk(b.location))}else k=new sa,l=new sa,k[c]=Qk(d),l[c]=Qk(e),d=l,e=k.position,e instanceof z&&!e.H()&&a.av.contains("Expand SubGraph")&&e.assign(d.position),k=new yk(k,l,f),f&&0===c.indexOf("position:")&& -b instanceof S&&(k.Jt.location=Qk(b.location)),h.add(b,k);a.lo=!0}}function Qk(a){return a instanceof z?a.copy():a instanceof ha?a.copy():a} -function Bk(a,b){var c;function d(){if(!1!==f.Vj&&f.ko===b){var a=+new Date,c=a>s?m:a-r;Wk(f);Xk(f,e,q,h,c,m);f.lv&&f.lv();Ki(e);Yk(f);a>s?Zk(f):requestAnimationFrame(d)}}void 0===c&&(c=new sa);var e=a.Z;if(null!==e){a.Vj=!0;var f=a,h=c.OK||a.hC,k=c.oL||null,l=c.pL||null,m=c.duration||a.Ry,n=a.KG;for(c=a.Pm.i;c.next();){var p=c.value.start.position;p instanceof z&&(p.H()||p.assign(n))}a.cC=h;a.lv=k;a.mv=l;a.bC=m;a.nv=a.Pm;var q=a.nv;for(c=q.i;c.next();)k=c.value.end,k["position:placeholder"]&&(l= -k["position:placeholder"],n=l.Wa(vb),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n);Wk(a);Xk(a,e,q,h,0,m);Ki(a.Z);Yk(a);var r=+new Date,s=r+m;f.ko===b&&requestAnimationFrame(function(){d()})}}function Wk(a){if(!a.Ro){var b=a.Z;a.SD=b.wb;a.PB=b.Ne;a.QB=b.Ju;b.wb=!0;b.Ne=!0;b.Ju=!0;a.Ro=!0}}function Yk(a){var b=a.Z;b.wb=a.SD;b.Ne=a.PB;b.Ju=a.QB;a.Ro=!1} -function Xk(a,b,c,d,e,f){for(c=c.i;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==$k[m])$k[m](h,l[m],k[m],d,e,f)}d=b.vA;b.vA=!0;m=a.hC;0!==a.nr&&0!==a.mr&&(c=a.nr,b.tb=m(e,c,a.mr-c,f));null!==a.lr&&null!==a.kr&&(c=a.lr,a=a.kr,b.hb=new z(m(e,c.x,a.x-c.x,f),m(e,c.y,a.y-c.y,f)));b.vA=d}Qg.prototype.stopAnimation=Qg.prototype.pi=function(){!0===this.oc&&(this.oc=!1,this.lo&&this.Z.Le());this.Vj&&this.cf&&Zk(this)}; -function Zk(a){a.Vj=!1;a.lo=!1;Wk(a);for(var b=a.Z,c=a.cC,d=a.bC,e=a.nv.i;e.next();){var f=e.key,h=e.value,k=h.start,l=h.end,m=h.Jt,n;for(n in l)if(void 0!==$k[n]){var p=n;!h.Vw||"position:node"!==p&&"position:placeholder"!==p||(p="position");$k[p](f,k[n],void 0!==m[n]?m[n]:h.Vw?k[n]:l[n],c,d,d)}h.Vw&&void 0!==m.location&&f instanceof S&&(f.location=m.location);h.Ux&&f instanceof S&&f.td(!1)}for(c=a.Z.links;c.next();)d=c.value,null!==d.lp&&(d.points=d.lp,d.lp=null);b.Hx.clear();b.jk=null;b.qc();b.na(); -b.Yf();al(b);Yk(a);a.mv&&a.mv();a.ko=0;a.nv=null;a.mv=null;a.lv=null;a.lr=null;a.kr=null;a.nr=0;a.mr=0;a.Pm=new ka(G,yk);b.Ba("AnimationFinished");b.Le()} -function bl(a,b,c){var d=b.Y,e=c.Y,f=null;c instanceof U&&(f=c.placeholder);null!==f?(d=f.Wa(vb),d.x+=f.padding.left,d.y+=f.padding.top,Ck(a,b,"position",d,b.position,!1)):Ck(a,b,"position",new z(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);Ck(a,b,"scale",.01,b.scale,!1);if(b instanceof U)for(b=b.Mc;b.next();)f=b.value,f instanceof T&&bl(a,f,c)} -function cl(a,b,c){if(b.isVisible()){var d=null;c instanceof U&&(d=c.placeholder);null!==d?Ck(a,b,"position:placeholder",b.position,d,!0):Ck(a,b,"position:node",b.position,c,!0);Ck(a,b,"scale",b.scale,.01,!0);a.oc&&(d=a.Pm,d.contains(b)&&(d.ka(b).Ux=!0));if(b instanceof U)for(b=b.Mc;b.next();)d=b.value,d instanceof T&&cl(a,d,c)}}function dl(a,b,c){a.oc&&(null===a.lr&&b.H()&&null===a.kr&&(a.lr=b.copy()),a.kr=c.copy(),a.lo=!0)} -function el(a,b,c){a.oc&&a.Z.Fn&&(0===a.nr&&0===a.mr&&(a.nr=b),a.mr=c,a.lo=!0)}w.defineProperty(Qg,{isEnabled:"isEnabled"},function(){return this.cf},function(a){w.j(a,"boolean",Qg,"isEnabled");this.cf=a});w.defineProperty(Qg,{duration:"duration"},function(){return this.Ry},function(a){w.j(a,"number",Qg,"duration");1>a&&w.Ea(a,">= 1",Qg,"duration");this.Ry=a});w.u(Qg,{kf:"isAnimating"},function(){return this.Vj});w.u(Qg,{vI:"isTicking"},function(){return this.Ro}); -w.defineProperty(Qg,{kF:"isInitial"},function(){return this.Wj},function(a){w.j(a,"boolean",Qg,"isInitial");this.Wj=a});function yk(a,b,c){this.start=a;this.end=b;this.Jt=new sa;this.Vw=c;this.Ux=!1} -var $k={opacity:function(a,b,c,d,e,f){a.opacity=d(e,b,c-b,f)},position:function(a,b,c,d,e,f){e!==f?a.hy(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):a.position=new z(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},"position:node":function(a,b,c,d,e,f){var h=a.Y,k=c.Y;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==f?a.hy(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f)):a.position=new z(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f))},"position:placeholder":function(a,b,c,d,e,f){e!==f?a.hy(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)): -a.position=new z(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},scale:function(a,b,c,d,e,f){a.scale=d(e,b,c-b,f)},visible:function(a,b,c,d,e,f){a.visible=e!==f?b:c}};function mg(){0=a)return b;for(var c=0,d=0,e=0,f=0,h=0,k=this.zb.i;k.next();){var l=k.value;l instanceof U?e++:l instanceof T?d++:l instanceof W?f++:l instanceof dh?h++:c++}k="";0=d.count)a=d.count;else if(d.da(a)===b)return-1;d.Ld(a,b);b.Wt(c);d=this.g;null!==d&&(c?d.na():d.$p(b));kl(this,a,b);return a}; -g.jf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.jf(a,b,c);var d=this.zb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.da(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Xt(c);d.Xc(a);d=this.g;null!==d&&(c?d.na():d.jf(b));b.Rv=null;return a}; -function kl(a,b,c){b=ll(a,b,c);if(c instanceof U&&null!==c&&isNaN(c.eo)){if(0!==c.Mc.count){for(var d=-1,e=a.zb.n,f=e.length,h=0;hd&&k.Ka===c&&(d=h,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,h=NaN;0<=f;){h=a.da(f).eo;if(!isNaN(h))break;f--}for(var k=b+1,l=NaN;kd)for(;;){if(-1===f||h<=d){f++;if(f===b)break;a.Xc(b);a.Ld(f,c);return f}for(h=NaN;0<=--f&&(h=a.da(f).eo,isNaN(h)););}else if(!isNaN(l)&&l=d){k--;if(k===b)break;a.Xc(b);a.Ld(k,c);return k}for(l=NaN;++ka||1parseInt(e[1],10)&&(w.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+ -w.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),w.$w.licenseKey=!0);this.jl=1;this.Gm=0;this.UC=new z;this.QD=500;this.cv=new z;this.Zs=null;this.gl=!1;this.preventDefault=this.Tx=this.FF=this.GF=this.EF=this.On=this.Ng=this.Pn=this.Mn=this.Nn=this.xB=this.oB=this.pB=this.qB=this.tl=this.Ms=this.sl=this.Ls=null;this.dl=new yl;void 0!==a&&zl(this,a);this.Mv=!1;this.dD=1;this.Rc=!1}w.fa("Diagram",D); -D.prototype.clear=D.prototype.clear=function(){var a=null;null!==this.nd&&(a=this.nd.U);this.ba.clear();for(var b=this.$b.length,c=0;ca.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a}; +Kj.prototype.computeMaxSize=function(){var a=this.rb.Bf.copy(),b=this.Bf;!isNaN(b.width)&&b.widtha&&(a+=360));var b=Math.min(Math.abs(this.DJ),180),c=Math.min(Math.abs(this.CJ),b/2);(null===this.g||!this.g.R.shift)&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};w.defineProperty(Rj,{DJ:"snapAngleMultiple"},function(){return this.AD},function(a){w.j(a,"number",Rj,"snapAngleMultiple");this.AD=a}); +w.defineProperty(Rj,{CJ:"snapAngleEpsilon"},function(){return this.zD},function(a){w.j(a,"number",Rj,"snapAngleEpsilon");this.zD=a});w.u(Rj,{tL:"originalAngle"},function(){return this.dw});function Tj(){pg.call(this);0e.right&&(c.x-=d.width+5);c.xe.bottom&&(c.y-=d.height+5);c.ya.R.Fe?!1:!0};fk.prototype.doStart=function(){this.sa||null===this.Xg||this.doActivate()}; +fk.prototype.doActivate=function(){if(!this.sa){var a=this.g;if(null!==a){var b=this.Xg;null===b&&(b=a.Je(a.R.ca,function(a){return a instanceof Hh?a:null}));if(null!==b&&(this.Xg=b,null!==b.U)){this.sa=!0;this.Ta=ok;var c=this.GH;null!==b.oG&&(c=b.oG);this.lk=this.Xg.copy();var d=new A(this.Xg.Wa(xb),this.Xg.Wa(Lb));a.vJ(d);if(c instanceof Wj)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex="100";c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();"function"=== +typeof c.focus&&c.focus();"function"===typeof c.select&&this.$x&&(c.select(),c.setSelectionRange(0,9999));a.mj.appendChild(c)}this.kj=c}}}};fk.prototype.doCancel=function(){null!==this.sl&&this.kj instanceof HTMLElement&&(this.kj.style.border=this.sl,this.sl=null);this.stopTool()};fk.prototype.doMouseUp=function(){!this.sa&&this.canStart()&&this.doActivate()};fk.prototype.doMouseDown=function(){this.sa&&this.acceptText(kk)}; +fk.prototype.acceptText=function(a){switch(a){case kk:if(this.Ta===sk)this.kj instanceof HTMLElement&&this.kj.focus();else if(this.Ta===ok||this.Ta===rk||this.Ta===pk)this.Ta=qk,vk(this);break;case jk:case mk:case lk:if(mk===a&&!0===this.Fz.xx)break;if(this.Ta===ok||this.Ta===rk||this.Ta===pk)this.Ta=qk,vk(this)}}; +function vk(a){var b=a.Xg,c=a.g,d=a.kj;if(null!==b&&null!==d){var e=b.text,f="";d instanceof Wj?null!==d.zB&&(f=d.zB()):(f=d.value,f="function"===typeof f?f():f);a.isValidText(b,e,f)?(a.Ub(a.name),a.Ta=sk,d instanceof Wj?d.show(b,c,a):null!==a.sl&&(d.style.border=a.sl,a.sl=null),a.Gf=a.name,b.text=f,null!==b.nG&&b.nG(b,e,f),null!==c&&c.Aa("TextEdited",b,e),a.Lk(),a.stopTool(),null!==c&&c.doFocus()):(a.Ta=rk,null!==b.gA&&b.gA(a,e,f),d instanceof Wj?d.show(b,c,a):(null===a.sl&&(a.sl=d.style.border, +d.style.border="3px solid red"),"function"===typeof d.focus&&d.focus()))}}fk.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.Ta=hk;this.Xg=null;if(null!==this.kj){var b=this.kj;if(b instanceof Wj)b.En(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.mj.removeChild(b)}}this.sa=!1}};fk.prototype.doFocus=function(){tk(this)};fk.prototype.doBlur=function(){uk(this)}; +function tk(a){if(null!==a.kj){var b=a.Jy;a.Ta===ok&&(a.Ta=pk);"function"===typeof b.select&&a.$x&&(b.select(),b.setSelectionRange(0,9999))}}function uk(a){if(null!==a.kj){var b=a.Jy;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.$x&&(b.select(),b.setSelectionRange(0,9999))}}fk.prototype.isValidText=function(a,b,c){w.G(a,Hh,fk,"isValidText:textblock");var d=this.pB;if(null!==d&&!d(a,b,c))return!1;d=a.pB;return null===d||d(a,b,c)?!0:!1}; +w.defineProperty(fk,{pB:"textValidation"},function(){return this.xl},function(a){null!==a&&w.j(a,"function",fk,"textValidation");this.xl=a});w.defineProperty(fk,{AF:"minimumEditorScale"},function(){return this.bD},function(a){null!==a&&w.j(a,"number",fk,"minimumEditorScale");this.bD=a});w.defineProperty(fk,{$x:"selectsTextOnActivate"},function(){return this.xD},function(a){null!==a&&w.j(a,"boolean",fk,"selectsTextOnActivate");this.xD=a}); +w.defineProperty(fk,{state:"state"},function(){return this.Ta},function(a){this.Ta!==a&&(w.mb(a,fk,fk,"starting"),this.Ta=a)});fk.prototype.measureTemporaryTextBlock=fk.prototype.QI=function(a){var b=this.lk;b.text=a;wk(b,this.Xg.Yo,Infinity);return b};function fh(){pg.call(this);this.name="ToolManager";this.KG=new I(pg);this.LG=new I(pg);this.MG=new I(pg);this.GC=this.HC=850;this.wC=(new ha(2,2)).Ga();this.RD=5E3;this.fD=Lh;this.EC=xk;this.nv=this.kC=null;this.en=-1}w.La(fh,pg); +w.fa("ToolManager",fh);var Lh;fh.WheelScroll=Lh=w.p(fh,"WheelScroll",0);var Kh;fh.WheelZoom=Kh=w.p(fh,"WheelZoom",1);fh.WheelNone=w.p(fh,"WheelNone",2);var xk;fh.GestureZoom=xk=w.p(fh,"GestureZoom",3);var yk;fh.GestureCancel=yk=w.p(fh,"GestureCancel",4);var zk;fh.GestureNone=zk=w.p(fh,"GestureNone",5);w.defineProperty(fh,{ou:"mouseWheelBehavior"},function(){return this.fD},function(a){w.mb(a,fh,fh,"mouseWheelBehavior");this.fD=a}); +w.defineProperty(fh,{Wp:"gestureBehavior"},function(){return this.EC},function(a){w.mb(a,fh,fh,"gestureBehavior");this.EC=a});fh.prototype.initializeStandardTools=function(){this.XG=new Uj;this.MF=new Qh;this.HI=new mj;this.XF=new Kj;this.sJ=new Rj;this.wF=new dj;this.re=new lh;this.LH=new dk;this.dJ=new ek;this.Xz=new Yj;this.oB=new fk;this.nH=new Vj;this.oH=new Tj}; +fh.prototype.updateAdornments=function(a){var b=this.Kl;if(b instanceof hh&&this.nv===a){var c=b.rb;(null!==a?c.U===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; +fh.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.R;b.vj&&this.Wp===yk&&(b.bubbles=!1);if(b.cu){this.cancelWaitAfter();if(this.Wp===zk){b.bubbles=!0;return}if(this.Wp===yk)return;if(a.Za.canStartMultiTouch()){a.Za.standardPinchZoomStart();return}}var c=a.oa;c.Tz&&0!==c.Fh&&w.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.af.length,d=0;de.right&&(c.x-=d.width+5);c.xe.bottom?c.y-(d.height+5):c.y+20;c.ya?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}w.u(Ug,{sK:"animationReasons"},function(){return this.$u}); +Ug.prototype.canStart=function(){return!0};Ug.prototype.prepareAutomaticAnimation=Ug.prototype.Un=function(a){this.cf&&(this.Xj||this.Z.Hn)&&(this.$u.add(a),this.canStart(a)&&(this.Wj&&this.pi(),this.pc=!0))};function Ek(a){if(a.cf&&(a.$u.clear(),a.pc))if(!a.no)a.pc=!1;else if(0===a.mo){var b=+new Date;a.mo=b;requestAnimationFrame(function(){if(!1!==a.pc&&!a.Wj&&a.mo===b){var c=a.Z;c.pj("temporaryPixelRatio")&&(c.kk=1);Fk(c);a.pc=!1;c.Aa("AnimationStarting");Gk(a,b)}})}} +function Hk(a,b,c,d,e,f){if(!(!a.pc||"position"===c&&d.L(e)||b instanceof S&&!b.fF)){var h=a.Pm;if(h.contains(b)){var h=h.ja(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=Tk(d));h.Uw&&void 0!==l[c]?h.It[c]=Tk(e):(f||(h.It[c]=Tk(e)),l[c]=Tk(e));f&&0===c.indexOf("position:")&&b instanceof S&&(h.It.location=Tk(b.location))}else k=new sa,l=new sa,k[c]=Tk(d),l[c]=Tk(e),d=l,e=k.position,e instanceof z&&!e.H()&&a.$u.contains("Expand SubGraph")&&e.assign(d.position),k=new Dk(k,l,f),f&&0===c.indexOf("position:")&& +b instanceof S&&(k.It.location=Tk(b.location)),h.add(b,k);a.no=!0}}function Tk(a){return a instanceof z?a.copy():a instanceof ha?a.copy():a} +function Gk(a,b){var c;function d(){if(!1!==f.Wj&&f.mo===b){var a=+new Date,c=a>s?m:a-r;Zk(f);$k(f,e,q,h,c,m);f.kv&&f.kv();Ri(e);al(f);a>s?bl(f):requestAnimationFrame(d)}}void 0===c&&(c=new sa);var e=a.Z;if(null!==e){a.Wj=!0;var f=a,h=c.RK||a.lC,k=c.rL||null,l=c.sL||null,m=c.duration||a.Ry,n=a.NG;for(c=a.Pm.i;c.next();){var p=c.value.start.position;p instanceof z&&(p.H()||p.assign(n))}a.gC=h;a.kv=k;a.lv=l;a.fC=m;a.mv=a.Pm;var q=a.mv;for(c=q.i;c.next();)k=c.value.end,k["position:placeholder"]&&(l= +k["position:placeholder"],n=l.Wa(xb),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n);Zk(a);$k(a,e,q,h,0,m);Ri(a.Z);al(a);var r=+new Date,s=r+m;f.mo===b&&requestAnimationFrame(function(){d()})}}function Zk(a){if(!a.To){var b=a.Z;a.VD=b.wb;a.TB=b.Ne;a.UB=b.Iu;b.wb=!0;b.Ne=!0;b.Iu=!0;a.To=!0}}function al(a){var b=a.Z;b.wb=a.VD;b.Ne=a.TB;b.Iu=a.UB;a.To=!1} +function $k(a,b,c,d,e,f){for(c=c.i;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==cl[m])cl[m](h,l[m],k[m],d,e,f)}d=b.yA;b.yA=!0;m=a.lC;0!==a.mr&&0!==a.lr&&(c=a.mr,b.tb=m(e,c,a.lr-c,f));null!==a.kr&&null!==a.jr&&(c=a.kr,a=a.jr,b.ib=new z(m(e,c.x,a.x-c.x,f),m(e,c.y,a.y-c.y,f)));b.yA=d}Ug.prototype.stopAnimation=Ug.prototype.pi=function(){!0===this.pc&&(this.pc=!1,this.no&&this.Z.Le());this.Wj&&this.cf&&bl(this)}; +function bl(a){a.Wj=!1;a.no=!1;Zk(a);for(var b=a.Z,c=a.gC,d=a.fC,e=a.mv.i;e.next();){var f=e.key,h=e.value,k=h.start,l=h.end,m=h.It,n;for(n in l)if(void 0!==cl[n]){var p=n;!h.Uw||"position:node"!==p&&"position:placeholder"!==p||(p="position");cl[p](f,k[n],void 0!==m[n]?m[n]:h.Uw?k[n]:l[n],c,d,d)}h.Uw&&void 0!==m.location&&f instanceof S&&(f.location=m.location);h.Tx&&f instanceof S&&f.vd(!1)}for(c=a.Z.links;c.next();)d=c.value,null!==d.mp&&(d.points=d.mp,d.mp=null);b.Gx.clear();b.kk=null;b.rc();b.na(); +b.Zf();dl(b);al(a);a.lv&&a.lv();a.mo=0;a.mv=null;a.lv=null;a.kv=null;a.kr=null;a.jr=null;a.mr=0;a.lr=0;a.Pm=new ka(G,Dk);b.Aa("AnimationFinished");b.Le()} +function el(a,b,c){var d=b.W,e=c.W,f=null;c instanceof U&&(f=c.placeholder);null!==f?(d=f.Wa(xb),d.x+=f.padding.left,d.y+=f.padding.top,Hk(a,b,"position",d,b.position,!1)):Hk(a,b,"position",new z(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);Hk(a,b,"scale",.01,b.scale,!1);if(b instanceof U)for(b=b.Nc;b.next();)f=b.value,f instanceof T&&el(a,f,c)} +function fl(a,b,c){if(b.isVisible()){var d=null;c instanceof U&&(d=c.placeholder);null!==d?Hk(a,b,"position:placeholder",b.position,d,!0):Hk(a,b,"position:node",b.position,c,!0);Hk(a,b,"scale",b.scale,.01,!0);a.pc&&(d=a.Pm,d.contains(b)&&(d.ja(b).Tx=!0));if(b instanceof U)for(b=b.Nc;b.next();)d=b.value,d instanceof T&&fl(a,d,c)}}function gl(a,b,c){a.pc&&(null===a.kr&&b.H()&&null===a.jr&&(a.kr=b.copy()),a.jr=c.copy(),a.no=!0)} +function hl(a,b,c){a.pc&&a.Z.Hn&&(0===a.mr&&0===a.lr&&(a.mr=b),a.lr=c,a.no=!0)}w.defineProperty(Ug,{isEnabled:"isEnabled"},function(){return this.cf},function(a){w.j(a,"boolean",Ug,"isEnabled");this.cf=a});w.defineProperty(Ug,{duration:"duration"},function(){return this.Ry},function(a){w.j(a,"number",Ug,"duration");1>a&&w.Ea(a,">= 1",Ug,"duration");this.Ry=a});w.u(Ug,{kf:"isAnimating"},function(){return this.Wj});w.u(Ug,{yI:"isTicking"},function(){return this.To}); +w.defineProperty(Ug,{nF:"isInitial"},function(){return this.Xj},function(a){w.j(a,"boolean",Ug,"isInitial");this.Xj=a});function Dk(a,b,c){this.start=a;this.end=b;this.It=new sa;this.Uw=c;this.Tx=!1} +var cl={opacity:function(a,b,c,d,e,f){a.opacity=d(e,b,c-b,f)},position:function(a,b,c,d,e,f){e!==f?a.gy(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):a.position=new z(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},"position:node":function(a,b,c,d,e,f){var h=a.W,k=c.W;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==f?a.gy(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f)):a.position=new z(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f))},"position:placeholder":function(a,b,c,d,e,f){e!==f?a.gy(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)): +a.position=new z(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},scale:function(a,b,c,d,e,f){a.scale=d(e,b,c-b,f)},visible:function(a,b,c,d,e,f){a.visible=e!==f?b:c}};function og(){0=a)return b;for(var c=0,d=0,e=0,f=0,h=0,k=this.zb.i;k.next();){var l=k.value;l instanceof U?e++:l instanceof T?d++:l instanceof W?f++:l instanceof hh?h++:c++}k="";0=d.count)a=d.count;else if(d.da(a)===b)return-1;d.Md(a,b);b.Vt(c);d=this.g;null!==d&&(c?d.na():d.Zp(b));nl(this,a,b);return a}; +g.jf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.jf(a,b,c);var d=this.zb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.da(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Wt(c);d.Yc(a);d=this.g;null!==d&&(c?d.na():d.jf(b));b.Rv=null;return a}; +function nl(a,b,c){b=ol(a,b,c);if(c instanceof U&&null!==c&&isNaN(c.ho)){if(0!==c.Nc.count){for(var d=-1,e=a.zb.n,f=e.length,h=0;hd&&k.Ka===c&&(d=h,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,h=NaN;0<=f;){h=a.da(f).ho;if(!isNaN(h))break;f--}for(var k=b+1,l=NaN;kd)for(;;){if(-1===f||h<=d){f++;if(f===b)break;a.Yc(b);a.Md(f,c);return f}for(h=NaN;0<=--f&&(h=a.da(f).ho,isNaN(h)););}else if(!isNaN(l)&&l=d){k--;if(k===b)break;a.Yc(b);a.Md(k,c);return k}for(l=NaN;++ka||1parseInt(e[1],10)&&(w.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+ +w.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),w.Zw.licenseKey=!0);this.ll=1;this.Gm=0;this.XC=new z;this.TD=500;this.bv=new z;this.Zs=null;this.il=!1;this.preventDefault=this.Sx=this.IF=this.JF=this.HF=this.Qn=this.Og=this.Rn=this.On=this.Pn=this.BB=this.sB=this.tB=this.uB=this.vl=this.Ms=this.ul=this.Ls=null;this.fl=new Bl;void 0!==a&&Cl(this,a);this.Lv=!1;this.gD=1;this.Sc=!1}w.fa("Diagram",D); +D.prototype.clear=D.prototype.clear=function(){var a=null;null!==this.pd&&(a=this.pd.U);this.ba.clear();for(var b=this.ac.length,c=0;c=a)return b;for(var c=this.$b.i;c.next();)b+="\n "+c.value.toString(a-1);return b};D.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.Z instanceof D?b.Z:null}; -w.defineProperty(D,{lj:"div"},function(){return this.Mb},function(a){null!==a&&w.G(a,HTMLDivElement,D,"div");if(this.Mb!==a){nl=[];var b=this.Mb;null!==b?(b.Z=void 0,b.innerHTML="",null!==this.Eb&&(this.Eb.removeEventListener("touchstart",this.qB,!1),this.Eb.removeEventListener("touchmove",this.pB,!1),this.Eb.removeEventListener("touchend",this.oB,!1),this.Eb.Gd.Z=null),b=this.ab,null!==b&&(b.af.each(function(a){a.cancelWaitAfter()}),b.Zf.each(function(a){a.cancelWaitAfter()}),b.$f.each(function(a){a.cancelWaitAfter()})), -b.cancelWaitAfter(),this.Za.doCancel(),this.qf=this.Eb=null,window.removeEventListener("resize",this.xB,!1),window.removeEventListener("mousemove",this.Nn,!0),window.removeEventListener("mousedown",this.Mn,!0),window.removeEventListener("mouseup",this.Pn,!0),window.removeEventListener("mousewheel",this.Ng,!0),window.removeEventListener("DOMMouseScroll",this.Ng,!0),window.removeEventListener("mouseout",this.On,!0)):this.eh=!1;this.Mb=null;if(null!==a){if(b=a.Z)b.lj=null;zl(this,a);this.Sx()}}}); -function Cl(a){var b=a.Eb;b.addEventListener("touchstart",a.qB,!1);b.addEventListener("touchmove",a.pB,!1);b.addEventListener("touchend",a.oB,!1);b.addEventListener("mousemove",a.Nn,!1);b.addEventListener("mousedown",a.Mn,!1);b.addEventListener("mouseup",a.Pn,!1);b.addEventListener("mousewheel",a.Ng,!1);b.addEventListener("DOMMouseScroll",a.Ng,!1);b.addEventListener("mouseout",a.On,!1);b.addEventListener("keydown",a.xI,!1);b.addEventListener("keyup",a.yI,!1);b.addEventListener("selectstart",function(a){a.preventDefault(); -return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.ab.Xp===tk&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.EF,!1);b.addEventListener("pointermove",a.GF,!1);b.addEventListener("pointerleave",a.FF,!1);window.addEventListener("resize",a.xB,!1)}D.prototype.computePixelRatio=function(){return null!==this.jk?this.jk:this.dD};D.prototype.doMouseMove=function(){this.Za.doMouseMove()}; -D.prototype.doMouseDown=function(){this.Za.doMouseDown()};D.prototype.doMouseUp=function(){this.Za.doMouseUp()};D.prototype.doMouseWheel=function(){this.Za.doMouseWheel()};D.prototype.doKeyDown=function(){this.Za.doKeyDown()};D.prototype.doKeyUp=function(){this.Za.doKeyUp()};D.prototype.doFocus=function(){this.focus()};D.prototype.focus=D.prototype.focus=function(){this.Eb&&this.Eb.focus()}; -function Ak(a){if(null!==a.Eb){var b=a.Mb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.cl?a.Cd:0,d=a.Tj?a.Cd:0,e=a.zd;a.zd=a.computePixelRatio();a.zd!==e&&(a.Hr=!0,a.Le());if(b.clientWidth!==a.Ib+c||b.clientHeight!==a.Lb+d)a.Am=!0,a.Be=!0,b=a.Rb,null!==b&&b.Ax&&a.Fl===ih&&b.J(),a.Xd||a.Le()}}} -function wl(a){var b=new mg;b.name="Background";a.ut(b);b=new mg;b.name="";a.ut(b);b=new mg;b.name="Foreground";a.ut(b);b=new mg;b.name="Adornment";b.Jc=!0;a.ut(b);b=new mg;b.name="Tool";b.Jc=!0;b.dF=!0;a.ut(b);b=new mg;b.name="Grid";b.tf=!1;b.Sg=!1;b.Jc=!0;a.ZG(b,a.Lt("Background"))} -function Dl(a){a.nd=new C(El);a.nd.name="GRID";var b=new X;b.Cb="LineH";b.stroke="lightgray";b.kb=.5;b.interval=1;a.nd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.kb=.5;b.interval=5;a.nd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.kb=1;b.interval=10;a.nd.add(b);b=new X;b.Cb="LineV";b.stroke="lightgray";b.kb=.5;b.interval=1;a.nd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.kb=.5;b.interval=5;a.nd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.kb=1;b.interval=10;a.nd.add(b);b=new S;b.add(a.nd); -b.Wf="Grid";b.eo=0;b.xA=!1;b.cF=!1;b.Sg=!1;b.AA="GRID";a.add(b);a.zb.remove(b);a.nd.visible=!1}function Fl(){this.Z.isEnabled?this.Z.HH(this):Gl(this.Z)}function Hl(a){this.Z.isEnabled?(this.Z.vz=!0,this.Z.xz=a.target.scrollTop,this.Z.wz=a.target.scrollLeft):Gl(this.Z)} -D.prototype.diagramScroll=D.prototype.HH=function(a){if(this.vz&&null!==this.Eb){this.ow=!0;var b=this.qe,c=this.sb,d=b.width,e=c.width,f=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=this.scale,s;s=a.scrollLeft;if(this.Lr)switch(this.sz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;el&&(this.position=s.l(-(this.sw.scrollWidth-this.Ib)+u-this.Ib/r+k,this.position.y))),a.OG&&this.ne&&(bn&&(this.position=s.l(this.position.x,-(this.sw.scrollHeight-this.Lb)+a.scrollTop-this.Lb/r+m))),w.v(s),Il(this),this.Am=this.ow=!1,b=this.qe,c=this.sb,k=b.right,l=c.right, -m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(this.Qs.style.width="1px"),h>=f&&b>=c&&m<=n&&(this.Qs.style.height="1px"))}};D.prototype.computeBounds=D.prototype.sh=function(){0c&&(e=c),ea.xh&&(e=a.xh),e):b===Pl?(e=l>k?(h-a.Cd)/d:(f-a.Cd)/e,e>c&&(e=c),ea.xh&&(e=a.xh),e):a.scale}D.prototype.zoomToFit=D.prototype.zoomToFit=function(){this.scale=Ll(this,Ol)}; -D.prototype.zoomToRect=function(a,b){void 0===b&&(b=Ol);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Ol||b===Pl)if(isNaN(c))e=this.sb.height*this.scale/d;else if(isNaN(d))e=this.sb.width*this.scale/c;else var e=this.Ib,f=this.Lb,e=b===Pl?f/d>e/c?(f-(this.Tj?this.Cd:0))/d:(e-(this.cl?this.Cd:0))/c:Math.min(f/d,e/c);this.scale=e;this.position=new z(a.x,a.y)}};w.defineProperty(D,{vA:null},function(){return this.Rc},function(a){this.Rc=a}); -D.prototype.alignDocument=function(a,b){this.Uj&&Nl(this,this.sh());var c=this.qe,d=this.sb;this.position=new z(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))}; -function Ml(a,b,c,d,e,f,h){var k=b.x,l=b.y;if(h||a.WA===ol)f.fd()&&(d>c.width&&(k=c.x+(f.x*c.width+f.offsetX)-(f.x*d-f.offsetX)),e>c.height&&(l=c.y+(f.y*c.height+f.offsetY)-(f.y*e-f.offsetY))),f=a.XF,h=d-c.width,dc.left?k=c.left:kc.top?l=c.top:lb.touches.length)&&b.preventDefault();b.cancelBubble=!0;return!1} -D.prototype.xI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Pb;Ql(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.Nl=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:case 61:case 107:b.key= -"Add";break;case 189:case 173:case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.Z.doKeyDown();return 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which&&61!==a.which&&173!==a.which||!0!==a.ctrlKey?Ul(b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)}; -D.prototype.yI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Pb;Ql(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 93:a.preventDefault()}this.Z.doKeyUp(); -return Ul(b,a)};D.prototype.zr=function(a){var b=this.Eb;if(null===b)return new z(0,0);var c=this.Ib,d=this.Lb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.cd?(a=new z(c,a),La(a,this.cd),a):new z(c,a)};function Rl(a,b,c){var d=a.Eb,e=a.Ib,f=a.Lb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-f/d.height*d.top);c.bf.l(h,k);null!==a.cd?(b=w.xb(h,k),a.cd.li(b),c.ca.assign(b),w.v(b)):c.ca.l(h,k)} -function Bf(a,b,c,d){var e=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.Zi[0])e=a.Zi[c];else return;c=a.Eb;b=a.Ib;a=a.Lb;var f=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),f=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.l(f,h)}D.prototype.invalidateDocumentBounds=D.prototype.qc=function(){this.Uj||(this.Uj=!0,this.Le(!0))};function al(a){a.Xd||Ai(a);a.Uj&&Nl(a,a.sh())} -D.prototype.redraw=D.prototype.Sx=function(){this.Rc||this.Xd||(this.na(),Vl(this),Il(this),this.qc(),this.Yf())};D.prototype.isUpdateRequested=function(){return this.Mf};D.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Pa,c=b.isEnabled;b.pi();b.isEnabled=!1;Ki(this);this.eh=!1;b.isEnabled=c;null!==a&&w.setTimeout(a,1)}; -D.prototype.requestUpdate=D.prototype.Le=function(a){void 0===a&&(a=!1);if(!0!==this.Mf&&!(this.Rc||!1===a&&this.Xd)){this.Mf=!0;var b=this;requestAnimationFrame(function(){b.Mf&&b.Yf()})}};D.prototype.maybeUpdate=D.prototype.Yf=function(){if(!this.Go||this.Mf)this.Go&&(this.Go=!1),Ki(this)};function Wl(a,b){a.Pa.kf||a.Rc||!a.Am||Gl(a)||(b&&Ai(a),Kl(a,!1))} -function Ki(a){if(!a.Xd&&(a.Mf=!1,null!==a.Mb)){a.Xd=!0;var b=a.Pa,c=a.qz;if(!b.Ro&&0!==c.length){for(var d=c.n,e=d.length,f=0;fb;b++){var c=a.qg.i;if(null===c||0===a.qg.count)break;a.qg=new J(S);a.uB(c,a.qg)}a.dg.each(function(a){a instanceof U&&0!==(a.xa&65536)!==!1&&(a.xa^=65536)})}} -D.prototype.uB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.de()||c instanceof U||(c.Yl()?(rk(c,Infinity,Infinity),c.gc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof U&&c.isVisible()&&em(this,c);for(a.reset();a.next();)c=a.value,c instanceof W&&c.isVisible()&&(c.Yl()?(rk(c,Infinity,Infinity),c.gc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof dh&&c.isVisible()&&(c.Yl()?(rk(c,Infinity,Infinity),c.gc()):b.add(c))}; -function em(a,b){for(var c=w.lb(),d=w.lb(),e=b.Mc;e.next();){var f=e.value;f.isVisible()&&(f instanceof U?(ym(f)||zm(f)||Am(f))&&em(a,f):f instanceof W?f.W===b||f.$===b?d.push(f):c.push(f):(rk(f,Infinity,Infinity),f.gc()))}for(var e=c.length,h=0;hx+1&& -(H=Math.max((t-x)*c+a.Ib,H)),q+k+1p+1&&(k=Math.max((y-p)*c+a.Lb,k)),r+l+1x+1&&(H=Math.max((t-x)*c+a.Ib,H)),q+1p+1&&(k=Math.max((y-p)*c+V,k)),r+1x+1&&(l=a.position.x*c));if(a.Lr)switch(a.sz){case "negative":l=-(b.scrollWidth-l-b.clientWidth);break;case "reverse":l=b.scrollWidth-l-b.clientWidth}b.scrollLeft=l;a.rA&&a.ne&&(r+1p+1&&(b.scrollTop=a.position.y*c));h&&(a.Hr=!0);m=a.Ib;n=a.Lb;b.style.width=m+(a.cl?a.Cd:0)+ -"px";b.style.height=n+(a.Tj?a.Cd:0)+"px";a.vz=!1;return d!==m||e!==n||a.Pa.oc?(p=a.sb,a.uu(f,p,c,a.scale,h),!1):!0} -D.prototype.add=D.prototype.add=function(a){w.G(a,S,D,"add:part");var b=a.g;if(b!==this){null!==b&&w.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.Fq&&(a.kl="Tool");var c=a.Wf,b=this.Lt(c);null===b&&(b=this.Lt(""));null===b&&w.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.$p(99999999,a,a.g===this),0<=c&&this.Wc(Of,"parts",b,null,a,null,c),b.Jc||this.qc(),a.J(Hm),c=a.Dx,null!== +D.prototype.reset=D.prototype.reset=function(){this.Sc=!0;this.clear();this.ac=new I(og);this.TF();this.SF();this.ib=(new z(NaN,NaN)).freeze();this.tb=1;this.Gv=(new z(NaN,NaN)).freeze();this.Hv=NaN;this.Zv=1E-4;this.Xv=100;this.Hw=(new z(NaN,NaN)).freeze();this.yv=(new A(NaN,NaN,NaN,NaN)).freeze();this.pw=(new db(0,0,0,0)).freeze();this.qw=rl;this.mw=this.kw=null;this.qm=mh;this.to=rc;this.gl=mh;this.No=rc;this.Iv=this.Fv=xb;this.Mq=250;this.cv=(new db(16,16,16,16)).freeze();this.Ov=!0;this.Cw=tl; +this.Ew=Vi;this.ir="auto";this.zi=this.dj=this.Si=this.bw=this.Ti=this.Ui=this.Vi=this.yi=this.Ei=this.wi=null;this.Ji=!1;this.Nk=this.Mk=this.Su=this.cf=!0;this.Uu=this.Tu=!1;this.Yu=this.Vu=this.Dv=this.Cv=this.Zu=this.Xu=this.Vk=this.Uk=this.Tk=this.Sk=this.Qk=this.Rk=this.Pk=this.Wu=this.Xk=this.Ok=this.Wk=!0;this.sw=this.ow=16;this.ff=(new db(5)).freeze();this.Yv=999999999;this.ie=null;this.Pv=!1;Al(this);this.pd=null;this.ab=new fh;this.ab.initializeStandardTools();this.Za=this.Et=this.ab;this.ob= +new qg;this.cj=!0;zl(this);this.Sb=new rg;this.cj=!1;this.ba=new P;this.eh=!1;this.Io=!0;this.Sc=this.Nf=!1;this.na();this.gh=this.vi=null;sl(this);this.jv=""}; +function Al(a){a.Wi=new ka("string",S);var b=new T,c=new Hh;c.bind(new Zg("text","",Qf));b.add(c);a.pC=b;a.Wi.add("",b);b=new T;c=new Hh;c.stroke="brown";c.bind(new Zg("text","",Qf));b.add(c);a.Wi.add("Comment",b);b=new T;b.cm=!1;b.Rz=!1;c=new X;c.Cb="Ellipse";c.fill="black";c.stroke=null;c.Ba=(new ha(3,3)).Ga();b.add(c);a.Wi.add("LinkLabel",b);a.cl=new ka("string",U);b=new U;b.cB="GROUPPANEL";b.type=Dl;c=new Hh;c.font="bold 12pt sans-serif";c.bind(new Zg("text","",Qf));b.add(c);c=new C(El);c.name= +"GROUPPANEL";var d=new X;d.Cb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new Mj;d.padding=(new db(5,5,5,5)).Ga();c.add(d);b.add(c);a.nC=b;a.cl.add("",b);a.ak=new ka("string",W);b=new W;c=new X;c.Vf=!0;b.add(c);c=new X;c.yq="Standard";c.fill="black";c.stroke=null;c.kb=0;b.add(c);a.oC=b;a.ak.add("",b);b=new W;c=new X;c.Vf=!0;c.stroke="brown";b.add(c);a.ak.add("Comment",b);b=new hh;b.type=El;c=new X;c.fill=null;c.stroke="dodgerblue";c.kb=3;b.add(c);c=new Mj;c.margin=(new db(1.5, +1.5,1.5,1.5)).Ga();b.add(c);a.cw=b;a.Av=b;b=new hh;b.type=hj;c=new X;c.Vf=!0;c.fill=null;c.stroke="dodgerblue";c.kb=3;b.add(c);a.Tv=b} +function pl(a){var b=w.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=w.createElement("div");c.style.position="absolute";c.style.visibility="hidden";c.style.width="200px";c.style.height="150px";c.style.overflow="hidden";c.style.boxSizing="content-box";c.appendChild(b);window.document.body.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);window.document.body.removeChild(c);c=d-b;0!==c||w.lF|| +(c=11);a.Dd=c;c=w.createElement("div");c.dir="rtl";c.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";c.textContent="A";window.document.body.appendChild(c);d="reverse";0=a)return b;for(var c=this.ac.i;c.next();)b+="\n "+c.value.toString(a-1);return b};D.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.Z instanceof D?b.Z:null}; +w.defineProperty(D,{mj:"div"},function(){return this.Mb},function(a){null!==a&&w.G(a,HTMLDivElement,D,"div");if(this.Mb!==a){ql=[];var b=this.Mb;null!==b?(b.Z=void 0,b.innerHTML="",null!==this.Fb&&(this.Fb.removeEventListener("touchstart",this.uB,!1),this.Fb.removeEventListener("touchmove",this.tB,!1),this.Fb.removeEventListener("touchend",this.sB,!1),this.Fb.Hd.Z=null),b=this.ab,null!==b&&(b.af.each(function(a){a.cancelWaitAfter()}),b.$f.each(function(a){a.cancelWaitAfter()}),b.ag.each(function(a){a.cancelWaitAfter()})), +b.cancelWaitAfter(),this.Za.doCancel(),this.qf=this.Fb=null,window.removeEventListener("resize",this.BB,!1),window.removeEventListener("mousemove",this.Pn,!0),window.removeEventListener("mousedown",this.On,!0),window.removeEventListener("mouseup",this.Rn,!0),window.removeEventListener("mousewheel",this.Og,!0),window.removeEventListener("DOMMouseScroll",this.Og,!0),window.removeEventListener("mouseout",this.Qn,!0)):this.eh=!1;this.Mb=null;if(null!==a){if(b=a.Z)b.mj=null;Cl(this,a);this.Rx()}}}); +function Fl(a){var b=a.Fb;b.addEventListener("touchstart",a.uB,!1);b.addEventListener("touchmove",a.tB,!1);b.addEventListener("touchend",a.sB,!1);b.addEventListener("mousemove",a.Pn,!1);b.addEventListener("mousedown",a.On,!1);b.addEventListener("mouseup",a.Rn,!1);b.addEventListener("mousewheel",a.Og,!1);b.addEventListener("DOMMouseScroll",a.Og,!1);b.addEventListener("mouseout",a.Qn,!1);b.addEventListener("keydown",a.AI,!1);b.addEventListener("keyup",a.BI,!1);b.addEventListener("selectstart",function(a){a.preventDefault(); +return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.ab.Wp===yk&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.HF,!1);b.addEventListener("pointermove",a.JF,!1);b.addEventListener("pointerleave",a.IF,!1);window.addEventListener("resize",a.BB,!1)}D.prototype.computePixelRatio=function(){return null!==this.kk?this.kk:this.gD};D.prototype.doMouseMove=function(){this.Za.doMouseMove()}; +D.prototype.doMouseDown=function(){this.Za.doMouseDown()};D.prototype.doMouseUp=function(){this.Za.doMouseUp()};D.prototype.doMouseWheel=function(){this.Za.doMouseWheel()};D.prototype.doKeyDown=function(){this.Za.doKeyDown()};D.prototype.doKeyUp=function(){this.Za.doKeyUp()};D.prototype.doFocus=function(){this.focus()};D.prototype.focus=D.prototype.focus=function(){this.Fb&&this.Fb.focus()}; +function Fk(a){if(null!==a.Fb){var b=a.Mb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.el?a.Dd:0,d=a.Uj?a.Dd:0,e=a.Ad;a.Ad=a.computePixelRatio();a.Ad!==e&&(a.Gr=!0,a.Le());if(b.clientWidth!==a.Ib+c||b.clientHeight!==a.Lb+d)a.Am=!0,a.Be=!0,b=a.Sb,null!==b&&b.zx&&a.Gl===mh&&b.J(),a.Xd||a.Le()}}} +function zl(a){var b=new og;b.name="Background";a.tt(b);b=new og;b.name="";a.tt(b);b=new og;b.name="Foreground";a.tt(b);b=new og;b.name="Adornment";b.Kc=!0;a.tt(b);b=new og;b.name="Tool";b.Kc=!0;b.gF=!0;a.tt(b);b=new og;b.name="Grid";b.tf=!1;b.Tg=!1;b.Kc=!0;a.bH(b,a.Kt("Background"))} +function Gl(a){a.pd=new C(Hl);a.pd.name="GRID";var b=new X;b.Cb="LineH";b.stroke="lightgray";b.kb=.5;b.interval=1;a.pd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.kb=.5;b.interval=5;a.pd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.kb=1;b.interval=10;a.pd.add(b);b=new X;b.Cb="LineV";b.stroke="lightgray";b.kb=.5;b.interval=1;a.pd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.kb=.5;b.interval=5;a.pd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.kb=1;b.interval=10;a.pd.add(b);b=new S;b.add(a.pd); +b.Xf="Grid";b.ho=0;b.AA=!1;b.fF=!1;b.Tg=!1;b.EA="GRID";a.add(b);a.zb.remove(b);a.pd.visible=!1}function Il(){this.Z.isEnabled?this.Z.KH(this):Jl(this.Z)}function Kl(a){this.Z.isEnabled?(this.Z.xz=!0,this.Z.zz=a.target.scrollTop,this.Z.yz=a.target.scrollLeft):Jl(this.Z)} +D.prototype.diagramScroll=D.prototype.KH=function(a){if(this.xz&&null!==this.Fb){this.nw=!0;var b=this.qe,c=this.pb,d=b.width,e=c.width,f=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=this.scale,s;s=a.scrollLeft;if(this.Kr)switch(this.vz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;el&&(this.position=s.m(-(this.rw.scrollWidth-this.Ib)+u-this.Ib/r+k,this.position.y))),a.RG&&this.ne&&(bn&&(this.position=s.m(this.position.x,-(this.rw.scrollHeight-this.Lb)+a.scrollTop-this.Lb/r+m))),w.v(s),Ll(this),this.Am=this.nw=!1,b=this.qe,c=this.pb,k=b.right,l=c.right, +m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(this.Qs.style.width="1px"),h>=f&&b>=c&&m<=n&&(this.Qs.style.height="1px"))}};D.prototype.computeBounds=D.prototype.sh=function(){0c&&(e=c),ea.xh&&(e=a.xh),e):b===Sl?(e=l>k?(h-a.Dd)/d:(f-a.Dd)/e,e>c&&(e=c),ea.xh&&(e=a.xh),e):a.scale}D.prototype.zoomToFit=D.prototype.zoomToFit=function(){this.scale=Ol(this,Rl)}; +D.prototype.zoomToRect=function(a,b){void 0===b&&(b=Rl);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Rl||b===Sl)if(isNaN(c))e=this.pb.height*this.scale/d;else if(isNaN(d))e=this.pb.width*this.scale/c;else var e=this.Ib,f=this.Lb,e=b===Sl?f/d>e/c?(f-(this.Uj?this.Dd:0))/d:(e-(this.el?this.Dd:0))/c:Math.min(f/d,e/c);this.scale=e;this.position=new z(a.x,a.y)}};w.defineProperty(D,{yA:null},function(){return this.Sc},function(a){this.Sc=a}); +D.prototype.alignDocument=function(a,b){this.Vj&&Ql(this,this.sh());var c=this.qe,d=this.pb;this.position=new z(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))}; +function Pl(a,b,c,d,e,f,h){var k=b.x,l=b.y;if(h||a.$A===rl)f.fd()&&(d>c.width&&(k=c.x+(f.x*c.width+f.offsetX)-(f.x*d-f.offsetX)),e>c.height&&(l=c.y+(f.y*c.height+f.offsetY)-(f.y*e-f.offsetY))),f=a.$F,h=d-c.width,dc.left?k=c.left:kc.top?l=c.top:lb.touches.length)&&b.preventDefault();b.cancelBubble=!0;return!1} +D.prototype.AI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Pb;Tl(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.Ol=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:case 61:case 107:b.key= +"Add";break;case 189:case 173:case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.Z.doKeyDown();return 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which&&61!==a.which&&173!==a.which||!0!==a.ctrlKey?Xl(b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)}; +D.prototype.BI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Pb;Tl(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 93:a.preventDefault()}this.Z.doKeyUp(); +return Xl(b,a)};D.prototype.yr=function(a){var b=this.Fb;if(null===b)return new z(0,0);var c=this.Ib,d=this.Lb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.dd?(a=new z(c,a),La(a,this.dd),a):new z(c,a)};function Ul(a,b,c){var d=a.Fb,e=a.Ib,f=a.Lb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-f/d.height*d.top);c.bf.m(h,k);null!==a.dd?(b=w.xb(h,k),a.dd.li(b),c.ca.assign(b),w.v(b)):c.ca.m(h,k)} +function zf(a,b,c,d){var e=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.Zi[0])e=a.Zi[c];else return;c=a.Fb;b=a.Ib;a=a.Lb;var f=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),f=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.m(f,h)}D.prototype.invalidateDocumentBounds=D.prototype.rc=function(){this.Vj||(this.Vj=!0,this.Le(!0))};function dl(a){a.Xd||Hi(a);a.Vj&&Ql(a,a.sh())} +D.prototype.redraw=D.prototype.Rx=function(){this.Sc||this.Xd||(this.na(),Yl(this),Ll(this),this.rc(),this.Zf())};D.prototype.isUpdateRequested=function(){return this.Nf};D.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Pa,c=b.isEnabled;b.pi();b.isEnabled=!1;Ri(this);this.eh=!1;b.isEnabled=c;null!==a&&w.setTimeout(a,1)}; +D.prototype.requestUpdate=D.prototype.Le=function(a){void 0===a&&(a=!1);if(!0!==this.Nf&&!(this.Sc||!1===a&&this.Xd)){this.Nf=!0;var b=this;requestAnimationFrame(function(){b.Nf&&b.Zf()})}};D.prototype.maybeUpdate=D.prototype.Zf=function(){if(!this.Io||this.Nf)this.Io&&(this.Io=!1),Ri(this)};function Zl(a,b){a.Pa.kf||a.Sc||!a.Am||Jl(a)||(b&&Hi(a),Nl(a,!1))} +function Ri(a){if(!a.Xd&&(a.Nf=!1,null!==a.Mb)){a.Xd=!0;var b=a.Pa,c=a.sz;if(!b.To&&0!==c.length){for(var d=c.n,e=d.length,f=0;fb;b++){var c=a.sg.i;if(null===c||0===a.sg.count)break;a.sg=new J(S);a.yB(c,a.sg)}a.eg.each(function(a){a instanceof U&&0!==(a.ya&65536)!==!1&&(a.ya^=65536)})}} +D.prototype.yB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.de()||c instanceof U||(c.Yl()?(wk(c,Infinity,Infinity),c.hc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof U&&c.isVisible()&&em(this,c);for(a.reset();a.next();)c=a.value,c instanceof W&&c.isVisible()&&(c.Yl()?(wk(c,Infinity,Infinity),c.hc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof hh&&c.isVisible()&&(c.Yl()?(wk(c,Infinity,Infinity),c.hc()):b.add(c))}; +function em(a,b){for(var c=w.lb(),d=w.lb(),e=b.Nc;e.next();){var f=e.value;f.isVisible()&&(f instanceof U?(hm(f)||Bm(f)||Cm(f))&&em(a,f):f instanceof W?f.Y===b||f.$===b?d.push(f):c.push(f):(wk(f,Infinity,Infinity),f.hc()))}for(var e=c.length,h=0;hx+1&& +(H=Math.max((t-x)*c+a.Ib,H)),q+k+1p+1&&(k=Math.max((y-p)*c+a.Lb,k)),r+l+1x+1&&(H=Math.max((t-x)*c+a.Ib,H)),q+1p+1&&(k=Math.max((y-p)*c+V,k)),r+1x+1&&(l=a.position.x*c));if(a.Kr)switch(a.vz){case "negative":l=-(b.scrollWidth-l-b.clientWidth);break;case "reverse":l=b.scrollWidth-l-b.clientWidth}b.scrollLeft=l;a.tA&&a.ne&&(r+1p+1&&(b.scrollTop=a.position.y*c));h&&(a.Gr=!0);m=a.Ib;n=a.Lb;b.style.width=m+(a.el?a.Dd:0)+ +"px";b.style.height=n+(a.Uj?a.Dd:0)+"px";a.xz=!1;return d!==m||e!==n||a.Pa.pc?(p=a.pb,a.tu(f,p,c,a.scale,h),!1):!0} +D.prototype.add=D.prototype.add=function(a){w.G(a,S,D,"add:part");var b=a.g;if(b!==this){null!==b&&w.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.Eq&&(a.ml="Tool");var c=a.Xf,b=this.Kt(c);null===b&&(b=this.Kt(""));null===b&&w.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.Zp(99999999,a,a.g===this),0<=c&&this.Xc(Of,"parts",b,null,a,null,c),b.Kc||this.rc(),a.J(Jm),c=a.Cx,null!== c&&c(a,null,b))}}; -D.prototype.$p=function(a){if(a instanceof T){if(this.ep.add(a),a instanceof U){var b=a.Ka;null===b?this.wl.add(a):b.bp.add(a);b=a.Rb;null!==b&&(b.g=this)}}else a instanceof W?this.Yo.add(a):a instanceof dh||this.zb.add(a);var c=this;Im(a,function(a){Jm(c,a)});(a instanceof dh||a instanceof U&&null!==a.Kb)&&a.I();b=a.data;null!==b&&(a instanceof dh||(a instanceof W?this.Kj.add(b,a):this.Ai.add(b,a)),Im(a,function(a){Km(c,a)}));!0!==zm(a)&&!0!==Am(a)||this.qg.add(a);Lm(a,!0,this);Mm(a)?(a.Y.H()&&this.na(jl(a, -a.Y)),this.qc()):a.isVisible()&&a.Y.H()&&this.na(jl(a,a.Y));this.Le()}; -D.prototype.jf=function(a){a.Ct();if(a instanceof T){if(this.ep.remove(a),a instanceof U){var b=a.Ka;null===b?this.wl.remove(a):b.bp.remove(a);b=a.Rb;null!==b&&(b.g=null)}}else a instanceof W?this.Yo.remove(a):a instanceof dh||this.zb.remove(a);var c=this;Im(a,function(a){Nm(c,a)});b=a.data;null!==b&&(a instanceof dh||(a instanceof W?this.Kj.remove(b):this.Ai.remove(b)),Im(a,function(a){Om(c,a)}));this.qg.remove(a);Mm(a)?(a.Y.H()&&this.na(jl(a,a.Y)),this.qc()):a.isVisible()&&a.Y.H()&&this.na(jl(a, -a.Y));this.Le()};D.prototype.remove=D.prototype.remove=function(a){w.G(a,S,D,"remove:part");Pm(this,a,!0)};function Pm(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.eb=!1,b.Lg=!1,b.J(Qm),c&&b.tn(),c=d.jf(-1,b,!1),0<=c&&a.Wc(Pf,"parts",d,b,null,c,null),a=b.Dx,null!==a&&a(b,d,null))} -D.prototype.removeParts=D.prototype.TA=function(a,b){if(w.isArray(a))for(var c=w.Ya(a),d=0;dd&&this.qc()}; -D.prototype.addLayerAfter=function(a,b){Rm(this,a,b);a.Pc(this);var c=this.$b,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ke&&this.Wc(Pf,"layers",this,a,null,d,null));for(var e=c.count,f=0;fd&&this.qc()}; -D.prototype.removeLayer=function(a){w.G(a,mg,D,"removeLayer:layer");a.g!==this&&w.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.$b,c=b.indexOf(a);if(b.remove(a)){for(b=a.zb.copy().i;b.next();){var d=b.value,e=d.Wf;d.Wf=e!==a.name?e:""}null!==this.ke&&this.Wc(Pf,"layers",this,a,null,c,null);this.na();this.qc()}}};D.prototype.findLayer=D.prototype.Lt=function(a){for(var b=this.Ex;b.next();){var c=b.value;if(c.name===a)return c}return null}; -D.prototype.addModelChangedListener=D.prototype.aH=function(a){w.j(a,"function",D,"addModelChangedListener:listener");null===this.gh&&(this.gh=new I("function"));this.gh.add(a);this.ba.fn(a)};D.prototype.removeModelChangedListener=function(a){w.j(a,"function",D,"removeModelChangedListener:listener");null!==this.gh&&(this.gh.remove(a),0===this.gh.count&&(this.gh=null));this.ba.xu(a)}; -D.prototype.addChangedListener=D.prototype.fn=function(a){w.j(a,"function",D,"addChangedListener:listener");null===this.vi&&(this.vi=new I("function"));this.vi.add(a)};D.prototype.removeChangedListener=D.prototype.xu=function(a){w.j(a,"function",D,"removeChangedListener:listener");null!==this.vi&&(this.vi.remove(a),0===this.vi.count&&(this.vi=null))}; -D.prototype.Rw=function(a){this.wb||this.oa.XE(a);a.xc!==Nf&&(this.ni=!0);if(null!==this.vi){var b=this.vi,c=b.length;if(1===c)b=b.da(0),b(a);else if(0!==c)for(var d=b.dc(),e=0;ea.xh&&(c=a.xh);e=w.xb(a.hb.x+h/b-h/c,a.hb.y+k/b-k/c);a.position=e;w.v(e);a.tb=c;a.uu(d,a.sb,b,c,!1);a.Rc=!1;Kl(a, -!1);c=a.Pa;c.oc&&el(c,b,a.tb);a.na();Vl(a)}}D.prototype.uu=function(a,b,c,d,e){a.L(b)||(void 0===e&&(e=!1),e||Vl(this),Il(this),d=this.Rb,null===d||!d.Ax||this.Fl!==ih||e||a.width===b.width&&a.height===b.height||d.J(),d=this.Za,!0===this.Cm&&d instanceof bh&&(this.R.ca=this.rB(this.R.bf),vk(d,this)),this.Rc||this.bF(a,b),Yl(this),this.nh.scale=c,this.nh.position.x=a.x,this.nh.position.y=a.y,this.nh.bounds.set(a),this.nh.isScroll=e,this.Ba("ViewportBoundsChanged",this.nh,a))}; -function Yl(a,b){void 0===b&&(b=null);var c=a.nd;if(null!==c&&c.visible){for(var d=w.im(),e=1,f=1,h=c.wa.n,k=h.length,l=0;ln||(Tm(m.Cb)?f=f*n/De(f,n):e=e*n/De(e,n))}h=c.px;d.l(f*h.width,e*h.height);h=f=l=k=0;if(null!==b)k=b.width,l=b.height,f=b.x,h=b.y;else{e=w.Df();f=a.sb;e.l(f.x,f.y,f.width,f.height);for(h=a.hw.i;h.next();)f=h.value.sb,f.H()&&bb(e,f.x,f.y,f.width,f.height);if(!e.H()){w.Gb(e);return}k=e.width;l=e.height;f=e.x;h=e.y;w.Gb(e)}c.width=k+2*d.width;c.height= -l+2*d.height;e=w.K();Ka(f,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);w.zk(d);c.U.location=e;w.v(e)}}D.prototype.clearSelection=D.prototype.Sw=function(){var a=0a&&w.Ea(a,">= 0",D,"scrollHorizontalLineChange"),this.pw=a,this.h("scrollHorizontalLineChange",b,a))}); -w.defineProperty(D,{Du:"scrollVerticalLineChange"},function(){return this.tw},function(a){var b=this.tw;b!==a&&(w.j(a,"number",D,"scrollVerticalLineChange"),0>a&&w.Ea(a,">= 0",D,"scrollVerticalLineChange"),this.tw=a,this.h("scrollVerticalLineChange",b,a))});w.defineProperty(D,{R:"lastInput"},function(){return this.Pb},function(a){this.Pb=a});w.defineProperty(D,{zc:"firstInput"},function(){return this.Hi},function(a){this.Hi=a}); -w.defineProperty(D,{bc:"currentCursor"},function(){return this.kv},function(a){""===a&&(a=this.jr);var b=this.kv;if(b!==a){w.j(a,"string",D,"currentCursor");var c=this.Eb,d=this.Mb;null!==c&&(this.kv=a,c.style.cursor=a,d.style.cursor=a,c.style.cursor===b&&(c.style.cursor="-webkit-"+a,d.style.cursor="-webkit-"+a,c.style.cursor===b&&(c.style.cursor="-moz-"+a,d.style.cursor="-moz-"+a,c.style.cursor===b&&(c.style.cursor=a,d.style.cursor=a))))}}); -w.defineProperty(D,{CK:"defaultCursor"},function(){return this.jr},function(a){""===a&&(a="auto");var b=this.jr;b!==a&&(w.j(a,"string",D,"defaultCursor"),this.jr=a,this.h("defaultCursor",b,a))});w.defineProperty(D,{click:"click"},function(){return this.wi},function(a){var b=this.wi;b!==a&&(null!==a&&w.j(a,"function",D,"click"),this.wi=a,this.h("click",b,a))}); -w.defineProperty(D,{Ht:"doubleClick"},function(){return this.Ei},function(a){var b=this.Ei;b!==a&&(null!==a&&w.j(a,"function",D,"doubleClick"),this.Ei=a,this.h("doubleClick",b,a))});w.defineProperty(D,{Uz:"contextClick"},function(){return this.yi},function(a){var b=this.yi;b!==a&&(null!==a&&w.j(a,"function",D,"contextClick"),this.yi=a,this.h("contextClick",b,a))}); -w.defineProperty(D,{JA:"mouseOver"},function(){return this.Vi},function(a){var b=this.Vi;b!==a&&(null!==a&&w.j(a,"function",D,"mouseOver"),this.Vi=a,this.h("mouseOver",b,a))});w.defineProperty(D,{IA:"mouseHover"},function(){return this.Ui},function(a){var b=this.Ui;b!==a&&(null!==a&&w.j(a,"function",D,"mouseHover"),this.Ui=a,this.h("mouseHover",b,a))}); -w.defineProperty(D,{HA:"mouseHold"},function(){return this.Ti},function(a){var b=this.Ti;b!==a&&(null!==a&&w.j(a,"function",D,"mouseHold"),this.Ti=a,this.h("mouseHold",b,a))});w.defineProperty(D,{VI:"mouseDragOver"},function(){return this.bw},function(a){var b=this.bw;b!==a&&(null!==a&&w.j(a,"function",D,"mouseDragOver"),this.bw=a,this.h("mouseDragOver",b,a))}); -w.defineProperty(D,{GA:"mouseDrop"},function(){return this.Si},function(a){var b=this.Si;b!==a&&(null!==a&&w.j(a,"function",D,"mouseDrop"),this.Si=a,this.h("mouseDrop",b,a))});w.defineProperty(D,{nB:"toolTip"},function(){return this.dj},function(a){var b=this.dj;b!==a&&(this.dj=a,this.h("toolTip",b,a))});w.defineProperty(D,{contextMenu:"contextMenu"},function(){return this.zi},function(a){var b=this.zi;b!==a&&(this.zi=a,this.h("contextMenu",b,a))}); -w.defineProperty(D,{ob:"commandHandler"},function(){return this.Fy},function(a){var b=this.Fy;b!==a&&(w.G(a,og,D,"commandHandler"),null!==a.g&&w.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Pc(null),this.Fy=a,a.Pc(this))});w.defineProperty(D,{ab:"toolManager"},function(){return this.Ez},function(a){var b=this.Ez;b!==a&&(w.G(a,bh,D,"toolManager"),null!==a.g&&w.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Pc(null),this.Ez=a,a.Pc(this))}); -w.defineProperty(D,{Ft:"defaultTool"},function(){return this.Ly},function(a){var b=this.Ly;b!==a&&(w.G(a,ng,D,"defaultTool"),this.Ly=a,this.Za===b&&(this.Za=a))});w.defineProperty(D,{Za:"currentTool"},function(){return this.Iy},function(a){var b=this.Iy;null!==b&&(b.sa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.Ft);null!==a&&(w.G(a,ng,D,"currentTool"),this.Iy=a,a.Pc(this),a.doStart())});w.u(D,{selection:"selection"},function(){return this.vw}); -w.defineProperty(D,{LI:"maxSelectionCount"},function(){return this.Yv},function(a){var b=this.Yv;if(b!==a)if(w.j(a,"number",D,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Yv=a,this.h("maxSelectionCount",b,a),!this.oa.fb&&(a=this.selection.count-a,0= 0",D,"maxSelectionCount")}); -w.defineProperty(D,{YI:"nodeSelectionAdornmentTemplate"},function(){return this.cw},function(a){var b=this.cw;b!==a&&(w.G(a,dh,D,"nodeSelectionAdornmentTemplate"),this.cw=a,this.h("nodeSelectionAdornmentTemplate",b,a))});w.defineProperty(D,{bI:"groupSelectionAdornmentTemplate"},function(){return this.Bv},function(a){var b=this.Bv;b!==a&&(w.G(a,dh,D,"groupSelectionAdornmentTemplate"),this.Bv=a,this.h("groupSelectionAdornmentTemplate",b,a))}); -w.defineProperty(D,{FI:"linkSelectionAdornmentTemplate"},function(){return this.Tv},function(a){var b=this.Tv;b!==a&&(w.G(a,dh,D,"linkSelectionAdornmentTemplate"),this.Tv=a,this.h("linkSelectionAdornmentTemplate",b,a))});w.u(D,{Ul:"highlighteds"},function(){return this.Fv}); -w.defineProperty(D,{ni:"isModified"},function(){var a=this.oa;return a.isEnabled?null!==a.kj?!0:this.Mv&&this.dh!==a.pj:this.Mv},function(a){if(this.Mv!==a){w.j(a,"boolean",D,"isModified");this.Mv=a;var b=this.oa;!a&&b.isEnabled&&(this.dh=b.pj);a||Wm(this)}});function Wm(a){var b=a.ni;a.VD!==b&&(a.VD=b,a.Ba("Modified"))} -w.defineProperty(D,{ba:"model"},function(){return this.ke},function(a){var b=this.ke;if(b!==a){w.G(a,F,D,"model");this.Za.doCancel();null!==b&&b.oa!==a.oa&&b.oa.jF&&w.k("Do not replace a Diagram.model while a transaction is in progress.");this.Pa.pi();this.Sw();this.eh=!1;this.Go=!0;this.dh=-2;this.Mf=!1;var c=this.Xd;this.Xd=!0;this.Pa.Sn("Model");null!==b&&(null!==this.gh&&this.gh.each(function(a){b.xu(a)}),b.xu(this.aD),b instanceof P&&Xm(this,b.Mg),Xm(this,b.cg));this.ke=a;a.fn(this.$C);Ym(this, -a.cg);a instanceof P&&Zm(this,a.Mg);a.xu(this.$C);a.fn(this.aD);null!==this.gh&&this.gh.each(function(b){a.fn(b)});this.Xd=c;this.Rc||this.na();null!==b&&(a.oa.isEnabled=b.oa.isEnabled)}});w.defineProperty(D,{Ua:null},function(){return this.SC},function(a){this.SC=a});w.u(D,{Hx:null},function(){return this.GG}); -function sl(a,b){if(b.ba===a.ba){var c=b.xc,d=b.propertyName;if(c===Nf&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.ab,c.af.each(function(b){b.Pc(a)}),c.Zf.each(function(b){b.Pc(a)}),c.$f.each(function(b){b.Pc(a)}),a.Xd||a.eh||(a.rv=!0,a.Go&&(a.Mf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Pa;e.kf&&!a.wb&&e.pi();a.Ba("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Pa,e.kf&&!a.wb&&e.pi());else if(a.Ua){a.Ua=!1;try{var f=b.nf;if(""!==f)if(c===Mf){if("linkFromKey"===f){var h= -b.object,k=a.Qf(h);if(null!==k){var l=b.newValue,m=a.Ie(l);k.W=m}}else if("linkToKey"===f)h=b.object,k=a.Qf(h),null!==k&&(l=b.newValue,m=a.Ie(l),k.$=m);else if("linkFromPortId"===f){if(h=b.object,k=a.Qf(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.Jg=n)}}else if("linkToPortId"===f)h=b.object,k=a.Qf(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Eh=n));else if("nodeGroupKey"===f){var h=b.object,p=a.vh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Ie(q);p.Ka=r instanceof U?r: -null}else p.Ka=null}}else if("linkLabelKeys"===f){if(h=b.object,k=a.Qf(h),null!==k){var s=b.oldValue,u=b.newValue;if(w.isArray(s))for(var t=w.Ya(s),x=0;xl)){var m=l;fn(k)&&m++;k.jf(m);gn(k,m,l)}}}}function Km(a,b){var c=b.Zj;if(w.isArray(c)){var d=a.Em.ka(c);if(null===d)d=[],d.push(b),a.Em.add(c,d);else{for(c=0;cthis.scale&&(this.scale=a)):w.Ea(a,"> 0",D,"minScale"))}); -w.defineProperty(D,{xh:"maxScale"},function(){return this.Xv},function(a){w.Ed(a,D,"maxScale");var b=this.Xv;b!==a&&(0 0",D,"maxScale"))});w.defineProperty(D,{lm:"zoomPoint"},function(){return this.Iw},function(a){this.Iw.L(a)||(w.G(a,z,D,"zoomPoint"),this.Iw=a=a.S())}); -w.defineProperty(D,{qE:"contentAlignment"},function(){return this.ro},function(a){var b=this.ro;b.L(a)||(w.G(a,L,D,"contentAlignment"),this.ro=a=a.S(),this.h("contentAlignment",b,a),Kl(this,!1))});w.defineProperty(D,{TK:"initialContentAlignment"},function(){return this.Lo},function(a){var b=this.Lo;b.L(a)||(w.G(a,L,D,"initialContentAlignment"),this.Lo=a=a.S(),this.h("initialContentAlignment",b,a))}); -w.defineProperty(D,{padding:"padding"},function(){return this.ff},function(a){"number"===typeof a?a=new eb(a):w.G(a,eb,D,"padding");var b=this.ff;b.L(a)||(this.ff=a=a.S(),this.qc(),this.h("padding",b,a))});w.u(D,{dg:"nodes"},function(){return this.ep.i});w.u(D,{links:"links"},function(){return this.Yo.i});w.u(D,{Hk:"parts"},function(){return this.zb.i}); -D.prototype.findTopLevelNodesAndLinks=function(){for(var a=new J(S),b=this.ep.i;b.next();){var c=b.value;c.cq&&a.add(c)}for(b=this.Yo.i;b.next();)c=b.value,c.cq&&a.add(c);return a.i};D.prototype.findTopLevelGroups=function(){return this.wl.i};w.defineProperty(D,{Rb:"layout"},function(){return this.ie},function(a){var b=this.ie;b!==a&&(w.G(a,pg,D,"layout"),null!==b&&(b.g=null,b.group=null),this.ie=a,a.g=this,a.group=null,this.bv=!0,this.h("layout",b,a),this.Le())}); -D.prototype.layoutDiagram=function(a){Ai(this);a&&mn(this,!0);Zl(this,!1)};function mn(a,b){for(var c=a.wl.i;c.next();)un(a,c.value,b);null!==a.Rb&&(b?a.Rb.yf=!1:a.Rb.J())}function un(a,b,c){if(null!==b){for(var d=b.bp.i;d.next();)un(a,d.value,c);null!==b.Rb&&(c?b.Rb.yf=!1:b.Rb.J())}} -function Zl(a,b){if(!a.My){var c=a.Rb,d=a.Ua;a.Ua=!0;try{var e=a.oa.Fh;0===e&&a.Tb("Layout");var f=a.Pa;1!==a.oa.Fh||f.kf||f.oc||b||f.Sn("Layout");for(var h=a.wl.i;h.next();)vn(a,h.value,b);c.yf||b&&!c.nF&&0!==e||(c.doLayout(a),Ai(a),c.yf=!0)}finally{0===e&&a.Fd("Layout"),a.bv=!c.yf,a.Ua=d}}}function vn(a,b,c){if(null!==b){for(var d=b.bp.i;d.next();)vn(a,d.value,c);d=b.Rb;null===d||d.yf||c&&!d.nF||(b.Qn=!b.location.H(),d.doLayout(b),b.J(wn),d.yf=!0,em(a,b))}} -w.defineProperty(D,{Od:"isTreePathToChildren"},function(){return this.Pv},function(a){var b=this.Pv;if(b!==a&&(w.j(a,"boolean",D,"isTreePathToChildren"),this.Pv=a,this.h("isTreePathToChildren",b,a),!this.oa.fb))for(a=this.dg;a.next();)xn(a.value)});D.prototype.findTreeRoots=function(){for(var a=new I(T),b=this.dg;b.next();){var c=b.value;c.cq&&null===c.vn()&&a.add(c)}return a.i}; -w.defineProperty(D,{sB:"treeCollapsePolicy"},function(){return this.Dw},function(a){var b=this.Dw;b!==a&&(a!==ql&&a!==Um&&a!==Vm&&w.k("Unknown Diagram.treeCollapsePolicy: "+a),this.Dw=a,this.h("treeCollapsePolicy",b,a))});w.defineProperty(D,{wh:null},function(){return this.HC},function(a){this.HC=a}); -function pl(a){function b(a){var b=a.toLowerCase(),h=new I("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ka("string",I),d=new ka("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified"); -b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.Oy=c;a.Ny=d} -function oa(a,b){var c=a.Ny.ka(b);return null!==c?c:a.Ny.ka(b.toLowerCase())}function yn(a,b){var c=a.Oy.ka(b);if(null!==c)return c;c=a.Oy.ka(b.toLowerCase());if(null!==c)return c;w.k("Unknown DiagramEvent name: "+b);return null}D.prototype.addDiagramListener=D.prototype.Lz=function(a,b){w.j(a,"string",D,"addDiagramListener:name");w.j(b,"function",D,"addDiagramListener:listener");var c=yn(this,a);null!==c&&c.add(b)}; -D.prototype.removeDiagramListener=D.prototype.MF=function(a,b){w.j(a,"string",D,"removeDiagramListener:name");w.j(b,"function",D,"addDiagramListener:listener");var c=yn(this,a);null!==c&&c.remove(b)};D.prototype.raiseDiagramEvent=D.prototype.Ba=function(a,b,c){var d=yn(this,a),e=new Cf;e.g=this;a=oa(this,a);null!==a&&(e.name=a);void 0!==b&&(e.jB=b);void 0!==c&&(e.OA=c);b=d.length;if(1===b)d=d.da(0),d(e);else if(0!==b)for(c=d.dc(),a=0;a=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.sb,f=a.scale,e=w.Vg(0,0,e.width*f,e.height*f),h=w.xb(0,0);if(b.x>=e.x&&b.xe.x+e.width-d.right&&(k=Math.max(a.Cu,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.ye.y+e.height-d.bottom&&(k=Math.max(a.Du,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Ic(bd)||(c=new z(c.x+h.x/f,c.y+h.y/f));w.Gb(e);w.v(h);return c}D.prototype.makeSvg=D.prototype.makeSVG=function(a){void 0===a&&(a=new sa);a.context="svg";a=Hn(this,a);return null!==a?a.gm:null}; -D.prototype.makeImage=function(a){void 0===a&&(a=new sa);var b=(a.document||document).createElement("img");b.src=this.GI(a);return b}; -D.prototype.makeImageData=D.prototype.GI=function(a){void 0===a&&(a=new sa);var b=Hn(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.wk.getImageData(0,0,b.width,b.height);case "blob":b=b.Gd;c=a.callback;if("function"!==typeof c){w.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.toBlob)return b.toBlob(c,a.type,a.details),"toBlob";if("function"=== -typeof b.msToBlob)return c(b.msToBlob()),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var In=!1; -function Hn(a,b){a.Pa.pi();a.Yf();if(null===a.Eb)return null;"object"!==typeof b&&w.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var f=b.maxSize;void 0===b.maxSize&&(c=!0,f="svg"===b.context?new ha(Infinity,Infinity):new ha(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r= -b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new eb(l):l instanceof eb||(l=new eb(0));l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.Co=!1;a.qf.Ee(!0);var s=new Tc(null,p),u=s.wk;if(!(d||e||k||h)){s.width=a.Ib+Math.ceil(l.left+l.right);s.height=a.Lb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return u=new Lc(s.Gd,p,q),Em(a,u,l,new ha(s.width, -s.height),a.tb,a.hb,k,m,r,n),a.Co=!0,u;Em(a,u,l,new ha(s.width,s.height),a.tb,a.hb,k,m,r,n);a.Co=!0;return s}var t=a.ob.Yw,x=new z(0,0),v=a.qe.copy();v.EJ(a.padding);if(r)for(var B=!0,B=a.$b.n,y=B.length,H=0;Ht?(e=t,h=v.width,$=v.height):(h=f.width,$=f.height)):(h=v.width*e,$=v.height*e):(e=t,h=v.width,$=v.height);null!==l?(h+=Q,$+=B):l=new eb(0);null!==f&&(d=f.width,f=f.height,"svg"!==b.context&&c&&!In&&(h>d||$>f)&&(w.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil($)+" vs 2000x2000) Consider increasing the max size."), -In=!0),isNaN(d)&&(d=2E3),isNaN(f)&&(f=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(f)&&($=Math.min($,f)));s.width=Math.ceil(h);s.height=Math.ceil($);if("svg"===b.context)return u=new Lc(s.Gd,p,q),Em(a,u,l,new ha(Math.ceil(h),Math.ceil($)),e,x,k,m,r,n),a.Co=!0,u;Em(a,u,l,new ha(Math.ceil(h),Math.ceil($)),e,x,k,m,r,n);a.Co=!0;return s}D.inherit=function(a,b){w.j(a,"function",D,"inherit");w.j(b,"function",D,"inherit");b.PG&&w.k("Cannot inherit from "+w.hf(b));w.La(a,b)}; -function yl(){this.CD=null;this.RG="63ad05bbe23a1786468a4c741b6d2";this.Fi=this.RG===this._tk?!0:null} -function Jn(a){var b="f",c=window[w.Gg("76a715b2f73f148a")][w.Gg("72ba13b5")],d=w.Gg;if(window[d("7da7")]&&window[d("7da7")][d("76a115b6ed251eaf4692")]){a.Fi=!0;var e=window[d("7da7")][d("76a115b6ed251eaf4692")],e=d(e).split(d("39e9"));if(6>e.length)return;var f=d(e[1]).split(".");if("7da71ca0"!==e[4])return;var h=d(w[d("6cae19")]).split(".");if(f[0]>h[0]||f[0]===h[0]&&f[1]>=h[1]){f=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h +D.prototype.Zp=function(a){if(a instanceof T){if(this.gp.add(a),a instanceof U){var b=a.Ka;null===b?this.yl.add(a):b.dp.add(a);b=a.Sb;null!==b&&(b.g=this)}}else a instanceof W?this.$o.add(a):a instanceof hh||this.zb.add(a);var c=this;Km(a,function(a){Lm(c,a)});(a instanceof hh||a instanceof U&&null!==a.Kb)&&a.I();b=a.data;null!==b&&(a instanceof hh||(a instanceof W?this.Lj.add(b,a):this.Ai.add(b,a)),Km(a,function(a){Mm(c,a)}));!0!==Bm(a)&&!0!==Cm(a)||this.sg.add(a);Nm(a,!0,this);Om(a)?(a.W.H()&&this.na(ml(a, +a.W)),this.rc()):a.isVisible()&&a.W.H()&&this.na(ml(a,a.W));this.Le()}; +D.prototype.jf=function(a){a.Bt();if(a instanceof T){if(this.gp.remove(a),a instanceof U){var b=a.Ka;null===b?this.yl.remove(a):b.dp.remove(a);b=a.Sb;null!==b&&(b.g=null)}}else a instanceof W?this.$o.remove(a):a instanceof hh||this.zb.remove(a);var c=this;Km(a,function(a){Pm(c,a)});b=a.data;null!==b&&(a instanceof hh||(a instanceof W?this.Lj.remove(b):this.Ai.remove(b)),Km(a,function(a){Qm(c,a)}));this.sg.remove(a);Om(a)?(a.W.H()&&this.na(ml(a,a.W)),this.rc()):a.isVisible()&&a.W.H()&&this.na(ml(a, +a.W));this.Le()};D.prototype.remove=D.prototype.remove=function(a){w.G(a,S,D,"remove:part");Rm(this,a,!0)};function Rm(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.fb=!1,b.Mg=!1,b.J(Sm),c&&b.vn(),c=d.jf(-1,b,!1),0<=c&&a.Xc(Pf,"parts",d,b,null,c,null),a=b.Cx,null!==a&&a(b,d,null))} +D.prototype.removeParts=D.prototype.XA=function(a,b){if(w.isArray(a))for(var c=w.Ya(a),d=0;dd&&this.rc()}; +D.prototype.addLayerAfter=function(a,b){Tm(this,a,b);a.Qc(this);var c=this.ac,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ke&&this.Xc(Pf,"layers",this,a,null,d,null));for(var e=c.count,f=0;fd&&this.rc()}; +D.prototype.removeLayer=function(a){w.G(a,og,D,"removeLayer:layer");a.g!==this&&w.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.ac,c=b.indexOf(a);if(b.remove(a)){for(b=a.zb.copy().i;b.next();){var d=b.value,e=d.Xf;d.Xf=e!==a.name?e:""}null!==this.ke&&this.Xc(Pf,"layers",this,a,null,c,null);this.na();this.rc()}}};D.prototype.findLayer=D.prototype.Kt=function(a){for(var b=this.Dx;b.next();){var c=b.value;if(c.name===a)return c}return null}; +D.prototype.addModelChangedListener=D.prototype.dH=function(a){w.j(a,"function",D,"addModelChangedListener:listener");null===this.gh&&(this.gh=new I("function"));this.gh.add(a);this.ba.fn(a)};D.prototype.removeModelChangedListener=function(a){w.j(a,"function",D,"removeModelChangedListener:listener");null!==this.gh&&(this.gh.remove(a),0===this.gh.count&&(this.gh=null));this.ba.wu(a)}; +D.prototype.addChangedListener=D.prototype.fn=function(a){w.j(a,"function",D,"addChangedListener:listener");null===this.vi&&(this.vi=new I("function"));this.vi.add(a)};D.prototype.removeChangedListener=D.prototype.wu=function(a){w.j(a,"function",D,"removeChangedListener:listener");null!==this.vi&&(this.vi.remove(a),0===this.vi.count&&(this.vi=null))}; +D.prototype.Qw=function(a){this.wb||this.oa.$E(a);a.yc!==Nf&&(this.ni=!0);if(null!==this.vi){var b=this.vi,c=b.length;if(1===c)b=b.da(0),b(a);else if(0!==c)for(var d=b.ec(),e=0;ea.xh&&(c=a.xh);e=w.xb(a.ib.x+h/b-h/c,a.ib.y+k/b-k/c);a.position=e;w.v(e);a.tb=c;a.tu(d,a.pb,b,c,!1);a.Sc=!1;Nl(a, +!1);c=a.Pa;c.pc&&hl(c,b,a.tb);a.na();Yl(a)}} +D.prototype.tu=function(a,b,c,d,e){a.L(b)||(void 0===e&&(e=!1),e||Yl(this),Ll(this),d=this.Sb,null===d||!d.zx||this.Gl!==mh||e||a.width===b.width&&a.height===b.height||d.J(),d=this.Za,!0===this.Cm&&d instanceof fh&&(this.R.ca=this.vB(this.R.bf),Ak(d,this)),this.Sc||this.eF(a,b),am(this),this.nh.scale=c,this.nh.position.x=a.x,this.nh.position.y=a.y,this.nh.bounds.set(a),this.nh.isScroll=e,this.Aa("ViewportBoundsChanged",this.nh,a),this.BA&&this.links.each(function(a){a.sj&&a.W.Tf(b)&&a.Yb()}))}; +function am(a,b){void 0===b&&(b=null);var c=a.pd;if(null!==c&&c.visible){for(var d=w.im(),e=1,f=1,h=c.xa.n,k=h.length,l=0;ln||(Vm(m.Cb)?f=f*n/ye(f,n):e=e*n/ye(e,n))}h=c.ox;d.m(f*h.width,e*h.height);h=f=l=k=0;if(null!==b)k=b.width,l=b.height,f=b.x,h=b.y;else{e=w.Ef();f=a.pb;e.m(f.x,f.y,f.width,f.height);for(h=a.gw.i;h.next();)f=h.value.pb,f.H()&&ab(e,f.x,f.y,f.width,f.height);if(!e.H()){w.Db(e);return}k=e.width;l=e.height;f=e.x;h=e.y;w.Db(e)}c.width=k+2*d.width;c.height= +l+2*d.height;e=w.K();Ka(f,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);w.Ak(d);c.U.location=e;w.v(e)}}D.prototype.clearSelection=D.prototype.Rw=function(){var a=0a&&w.Ea(a,">= 0",D,"scrollHorizontalLineChange"),this.ow=a,this.h("scrollHorizontalLineChange",b,a))}); +w.defineProperty(D,{Cu:"scrollVerticalLineChange"},function(){return this.sw},function(a){var b=this.sw;b!==a&&(w.j(a,"number",D,"scrollVerticalLineChange"),0>a&&w.Ea(a,">= 0",D,"scrollVerticalLineChange"),this.sw=a,this.h("scrollVerticalLineChange",b,a))});w.defineProperty(D,{R:"lastInput"},function(){return this.Pb},function(a){this.Pb=a});w.defineProperty(D,{zc:"firstInput"},function(){return this.Hi},function(a){this.Hi=a}); +w.defineProperty(D,{cc:"currentCursor"},function(){return this.jv},function(a){""===a&&(a=this.ir);var b=this.jv;if(b!==a){w.j(a,"string",D,"currentCursor");var c=this.Fb,d=this.Mb;null!==c&&(this.jv=a,c.style.cursor=a,d.style.cursor=a,c.style.cursor===b&&(c.style.cursor="-webkit-"+a,d.style.cursor="-webkit-"+a,c.style.cursor===b&&(c.style.cursor="-moz-"+a,d.style.cursor="-moz-"+a,c.style.cursor===b&&(c.style.cursor=a,d.style.cursor=a))))}}); +w.defineProperty(D,{FK:"defaultCursor"},function(){return this.ir},function(a){""===a&&(a="auto");var b=this.ir;b!==a&&(w.j(a,"string",D,"defaultCursor"),this.ir=a,this.h("defaultCursor",b,a))});w.defineProperty(D,{click:"click"},function(){return this.wi},function(a){var b=this.wi;b!==a&&(null!==a&&w.j(a,"function",D,"click"),this.wi=a,this.h("click",b,a))}); +w.defineProperty(D,{Gt:"doubleClick"},function(){return this.Ei},function(a){var b=this.Ei;b!==a&&(null!==a&&w.j(a,"function",D,"doubleClick"),this.Ei=a,this.h("doubleClick",b,a))});w.defineProperty(D,{Wz:"contextClick"},function(){return this.yi},function(a){var b=this.yi;b!==a&&(null!==a&&w.j(a,"function",D,"contextClick"),this.yi=a,this.h("contextClick",b,a))}); +w.defineProperty(D,{NA:"mouseOver"},function(){return this.Vi},function(a){var b=this.Vi;b!==a&&(null!==a&&w.j(a,"function",D,"mouseOver"),this.Vi=a,this.h("mouseOver",b,a))});w.defineProperty(D,{MA:"mouseHover"},function(){return this.Ui},function(a){var b=this.Ui;b!==a&&(null!==a&&w.j(a,"function",D,"mouseHover"),this.Ui=a,this.h("mouseHover",b,a))}); +w.defineProperty(D,{LA:"mouseHold"},function(){return this.Ti},function(a){var b=this.Ti;b!==a&&(null!==a&&w.j(a,"function",D,"mouseHold"),this.Ti=a,this.h("mouseHold",b,a))});w.defineProperty(D,{YI:"mouseDragOver"},function(){return this.bw},function(a){var b=this.bw;b!==a&&(null!==a&&w.j(a,"function",D,"mouseDragOver"),this.bw=a,this.h("mouseDragOver",b,a))}); +w.defineProperty(D,{KA:"mouseDrop"},function(){return this.Si},function(a){var b=this.Si;b!==a&&(null!==a&&w.j(a,"function",D,"mouseDrop"),this.Si=a,this.h("mouseDrop",b,a))});w.defineProperty(D,{rB:"toolTip"},function(){return this.dj},function(a){var b=this.dj;b!==a&&(this.dj=a,this.h("toolTip",b,a))});w.defineProperty(D,{contextMenu:"contextMenu"},function(){return this.zi},function(a){var b=this.zi;b!==a&&(this.zi=a,this.h("contextMenu",b,a))}); +w.defineProperty(D,{ob:"commandHandler"},function(){return this.Ey},function(a){var b=this.Ey;b!==a&&(w.G(a,qg,D,"commandHandler"),null!==a.g&&w.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Qc(null),this.Ey=a,a.Qc(this))});w.defineProperty(D,{ab:"toolManager"},function(){return this.Gz},function(a){var b=this.Gz;b!==a&&(w.G(a,fh,D,"toolManager"),null!==a.g&&w.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Qc(null),this.Gz=a,a.Qc(this))}); +w.defineProperty(D,{Et:"defaultTool"},function(){return this.Ky},function(a){var b=this.Ky;b!==a&&(w.G(a,pg,D,"defaultTool"),this.Ky=a,this.Za===b&&(this.Za=a))});w.defineProperty(D,{Za:"currentTool"},function(){return this.Hy},function(a){var b=this.Hy;null!==b&&(b.sa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.Et);null!==a&&(w.G(a,pg,D,"currentTool"),this.Hy=a,a.Qc(this),a.doStart())});w.u(D,{selection:"selection"},function(){return this.uw}); +w.defineProperty(D,{OI:"maxSelectionCount"},function(){return this.Yv},function(a){var b=this.Yv;if(b!==a)if(w.j(a,"number",D,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Yv=a,this.h("maxSelectionCount",b,a),!this.oa.gb&&(a=this.selection.count-a,0= 0",D,"maxSelectionCount")}); +w.defineProperty(D,{aJ:"nodeSelectionAdornmentTemplate"},function(){return this.cw},function(a){var b=this.cw;b!==a&&(w.G(a,hh,D,"nodeSelectionAdornmentTemplate"),this.cw=a,this.h("nodeSelectionAdornmentTemplate",b,a))});w.defineProperty(D,{eI:"groupSelectionAdornmentTemplate"},function(){return this.Av},function(a){var b=this.Av;b!==a&&(w.G(a,hh,D,"groupSelectionAdornmentTemplate"),this.Av=a,this.h("groupSelectionAdornmentTemplate",b,a))}); +w.defineProperty(D,{II:"linkSelectionAdornmentTemplate"},function(){return this.Tv},function(a){var b=this.Tv;b!==a&&(w.G(a,hh,D,"linkSelectionAdornmentTemplate"),this.Tv=a,this.h("linkSelectionAdornmentTemplate",b,a))});w.u(D,{Vl:"highlighteds"},function(){return this.Ev}); +w.defineProperty(D,{ni:"isModified"},function(){var a=this.oa;return a.isEnabled?null!==a.lj?!0:this.Lv&&this.dh!==a.qj:this.Lv},function(a){if(this.Lv!==a){w.j(a,"boolean",D,"isModified");this.Lv=a;var b=this.oa;!a&&b.isEnabled&&(this.dh=b.qj);a||Ym(this)}});function Ym(a){var b=a.ni;a.YD!==b&&(a.YD=b,a.Aa("Modified"))} +w.defineProperty(D,{ba:"model"},function(){return this.ke},function(a){var b=this.ke;if(b!==a){w.G(a,F,D,"model");this.Za.doCancel();null!==b&&b.oa!==a.oa&&b.oa.mF&&w.k("Do not replace a Diagram.model while a transaction is in progress.");this.Pa.pi();this.Rw();this.eh=!1;this.Io=!0;this.dh=-2;this.Nf=!1;var c=this.Xd;this.Xd=!0;this.Pa.Un("Model");null!==b&&(null!==this.gh&&this.gh.each(function(a){b.wu(a)}),b.wu(this.dD),b instanceof P&&Zm(this,b.Ng),Zm(this,b.dg));this.ke=a;a.fn(this.cD);$m(this, +a.dg);a instanceof P&&an(this,a.Ng);a.wu(this.cD);a.fn(this.dD);null!==this.gh&&this.gh.each(function(b){a.fn(b)});this.Xd=c;this.Sc||this.na();null!==b&&(a.oa.isEnabled=b.oa.isEnabled)}});w.defineProperty(D,{Ua:null},function(){return this.VC},function(a){this.VC=a});w.u(D,{Gx:null},function(){return this.JG}); +function vl(a,b){if(b.ba===a.ba){var c=b.yc,d=b.propertyName;if(c===Nf&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.ab,c.af.each(function(b){b.Qc(a)}),c.$f.each(function(b){b.Qc(a)}),c.ag.each(function(b){b.Qc(a)}),a.Xd||a.eh||(a.qv=!0,a.Io&&(a.Nf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Pa;e.kf&&!a.wb&&e.pi();a.Aa("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Pa,e.kf&&!a.wb&&e.pi());else if(a.Ua){a.Ua=!1;try{var f=b.nf;if(""!==f)if(c===Mf){if("linkFromKey"===f){var h= +b.object,k=a.Rf(h);if(null!==k){var l=b.newValue,m=a.Ie(l);k.Y=m}}else if("linkToKey"===f)h=b.object,k=a.Rf(h),null!==k&&(l=b.newValue,m=a.Ie(l),k.$=m);else if("linkFromPortId"===f){if(h=b.object,k=a.Rf(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.Lg=n)}}else if("linkToPortId"===f)h=b.object,k=a.Rf(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Eh=n));else if("nodeGroupKey"===f){var h=b.object,p=a.vh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Ie(q);p.Ka=r instanceof U?r: +null}else p.Ka=null}}else if("linkLabelKeys"===f){if(h=b.object,k=a.Rf(h),null!==k){var s=b.oldValue,u=b.newValue;if(w.isArray(s))for(var t=w.Ya(s),x=0;xl)){var m=l;hn(k)&&m++;k.jf(m);jn(k,m,l)}}}}function Mm(a,b){var c=b.$j;if(w.isArray(c)){var d=a.Em.ja(c);if(null===d)d=[],d.push(b),a.Em.add(c,d);else{for(c=0;cthis.scale&&(this.scale=a)):w.Ea(a,"> 0",D,"minScale"))});w.defineProperty(D,{xh:"maxScale"},function(){return this.Xv},function(a){w.Fd(a,D,"maxScale");var b=this.Xv;b!==a&&(0 0",D,"maxScale"))}); +w.defineProperty(D,{lm:"zoomPoint"},function(){return this.Hw},function(a){this.Hw.L(a)||(w.G(a,z,D,"zoomPoint"),this.Hw=a=a.S())});w.defineProperty(D,{tE:"contentAlignment"},function(){return this.to},function(a){var b=this.to;b.L(a)||(w.G(a,L,D,"contentAlignment"),this.to=a=a.S(),this.h("contentAlignment",b,a),Nl(this,!1))}); +w.defineProperty(D,{WK:"initialContentAlignment"},function(){return this.No},function(a){var b=this.No;b.L(a)||(w.G(a,L,D,"initialContentAlignment"),this.No=a=a.S(),this.h("initialContentAlignment",b,a))});w.defineProperty(D,{padding:"padding"},function(){return this.ff},function(a){"number"===typeof a?a=new db(a):w.G(a,db,D,"padding");var b=this.ff;b.L(a)||(this.ff=a=a.S(),this.rc(),this.h("padding",b,a))});w.u(D,{eg:"nodes"},function(){return this.gp.i});w.u(D,{links:"links"},function(){return this.$o.i}); +w.u(D,{Jk:"parts"},function(){return this.zb.i});D.prototype.findTopLevelNodesAndLinks=function(){for(var a=new J(S),b=this.gp.i;b.next();){var c=b.value;c.bq&&a.add(c)}for(b=this.$o.i;b.next();)c=b.value,c.bq&&a.add(c);return a.i};D.prototype.findTopLevelGroups=function(){return this.yl.i}; +w.defineProperty(D,{Sb:"layout"},function(){return this.ie},function(a){var b=this.ie;b!==a&&(w.G(a,rg,D,"layout"),null!==b&&(b.g=null,b.group=null),this.ie=a,a.g=this,a.group=null,this.av=!0,this.h("layout",b,a),this.Le())});D.prototype.layoutDiagram=function(a){Hi(this);a&&on(this,!0);bm(this,!1)};function on(a,b){for(var c=a.yl.i;c.next();)wn(a,c.value,b);null!==a.Sb&&(b?a.Sb.zf=!1:a.Sb.J())} +function wn(a,b,c){if(null!==b){for(var d=b.dp.i;d.next();)wn(a,d.value,c);null!==b.Sb&&(c?b.Sb.zf=!1:b.Sb.J())}}function bm(a,b){if(!a.Ly){var c=a.Sb,d=a.Ua;a.Ua=!0;try{var e=a.oa.Fh;0===e&&a.Ub("Layout");var f=a.Pa;1!==a.oa.Fh||f.kf||f.pc||b||f.Un("Layout");for(var h=a.yl.i;h.next();)xn(a,h.value,b);c.zf||b&&!c.qF&&0!==e||(c.doLayout(a),Hi(a),c.zf=!0)}finally{0===e&&a.Gd("Layout"),a.av=!c.zf,a.Ua=d}}} +function xn(a,b,c){if(null!==b){for(var d=b.dp.i;d.next();)xn(a,d.value,c);d=b.Sb;null===d||d.zf||c&&!d.qF||(b.Sn=!b.location.H(),d.doLayout(b),b.J(yn),d.zf=!0,em(a,b))}}w.defineProperty(D,{Pd:"isTreePathToChildren"},function(){return this.Ov},function(a){var b=this.Ov;if(b!==a&&(w.j(a,"boolean",D,"isTreePathToChildren"),this.Ov=a,this.h("isTreePathToChildren",b,a),!this.oa.gb))for(a=this.eg;a.next();)zn(a.value)}); +D.prototype.findTreeRoots=function(){for(var a=new I(T),b=this.eg;b.next();){var c=b.value;c.bq&&null===c.xn()&&a.add(c)}return a.i};w.defineProperty(D,{wB:"treeCollapsePolicy"},function(){return this.Cw},function(a){var b=this.Cw;b!==a&&(a!==tl&&a!==Wm&&a!==Xm&&w.k("Unknown Diagram.treeCollapsePolicy: "+a),this.Cw=a,this.h("treeCollapsePolicy",b,a))});w.defineProperty(D,{wh:null},function(){return this.KC},function(a){this.KC=a}); +function sl(a){function b(a){var b=a.toLowerCase(),h=new I("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ka("string",I),d=new ka("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified"); +b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.Ny=c;a.My=d} +function oa(a,b){var c=a.My.ja(b);return null!==c?c:a.My.ja(b.toLowerCase())}function An(a,b){var c=a.Ny.ja(b);if(null!==c)return c;c=a.Ny.ja(b.toLowerCase());if(null!==c)return c;w.k("Unknown DiagramEvent name: "+b);return null}D.prototype.addDiagramListener=D.prototype.Nz=function(a,b){w.j(a,"string",D,"addDiagramListener:name");w.j(b,"function",D,"addDiagramListener:listener");var c=An(this,a);null!==c&&c.add(b)}; +D.prototype.removeDiagramListener=D.prototype.PF=function(a,b){w.j(a,"string",D,"removeDiagramListener:name");w.j(b,"function",D,"addDiagramListener:listener");var c=An(this,a);null!==c&&c.remove(b)};D.prototype.raiseDiagramEvent=D.prototype.Aa=function(a,b,c){var d=An(this,a),e=new Af;e.g=this;a=oa(this,a);null!==a&&(e.name=a);void 0!==b&&(e.nB=b);void 0!==c&&(e.SA=c);b=d.length;if(1===b)d=d.da(0),d(e);else if(0!==b)for(c=d.ec(),a=0;a=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.pb,f=a.scale,e=w.hg(0,0,e.width*f,e.height*f),h=w.xb(0,0);if(b.x>=e.x&&b.xe.x+e.width-d.right&&(k=Math.max(a.Bu,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.ye.y+e.height-d.bottom&&(k=Math.max(a.Cu,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Ic(dd)||(c=new z(c.x+h.x/f,c.y+h.y/f));w.Db(e);w.v(h);return c}D.prototype.makeSvg=D.prototype.makeSVG=function(a){void 0===a&&(a=new sa);a.context="svg";a=In(this,a);return null!==a?a.gm:null}; +D.prototype.makeImage=function(a){void 0===a&&(a=new sa);var b=(a.document||document).createElement("img");b.src=this.JI(a);return b}; +D.prototype.makeImageData=D.prototype.JI=function(a){void 0===a&&(a=new sa);var b=In(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.xk.getImageData(0,0,b.width,b.height);case "blob":b=b.Hd;c=a.callback;if("function"!==typeof c){w.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.toBlob)return b.toBlob(c,a.type,a.details),"toBlob";if("function"=== +typeof b.msToBlob)return c(b.msToBlob()),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var Jn=!1; +function In(a,b){a.Pa.pi();a.Zf();if(null===a.Fb)return null;"object"!==typeof b&&w.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var f=b.maxSize;void 0===b.maxSize&&(c=!0,f="svg"===b.context?new ha(Infinity,Infinity):new ha(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r= +b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new db(l):l instanceof db||(l=new db(0));l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.Eo=!1;a.qf.Ee(!0);var s=new Vc(null,p),u=s.xk;if(!(d||e||k||h)){s.width=a.Ib+Math.ceil(l.left+l.right);s.height=a.Lb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return u=new Nc(s.Hd,p,q),Gm(a,u,l,new ha(s.width, +s.height),a.tb,a.ib,k,m,r,n),a.Eo=!0,u;Gm(a,u,l,new ha(s.width,s.height),a.tb,a.ib,k,m,r,n);a.Eo=!0;return s}var t=a.ob.Xw,x=new z(0,0),v=a.qe.copy();v.HJ(a.padding);if(r)for(var B=!0,B=a.ac.n,y=B.length,H=0;Ht?(e=t,h=v.width,$=v.height):(h=f.width,$=f.height)):(h=v.width*e,$=v.height*e):(e=t,h=v.width,$=v.height);null!==l?(h+=Q,$+=B):l=new db(0);null!==f&&(d=f.width,f=f.height,"svg"!==b.context&&c&&!Jn&&(h>d||$>f)&&(w.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil($)+" vs 2000x2000) Consider increasing the max size."), +Jn=!0),isNaN(d)&&(d=2E3),isNaN(f)&&(f=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(f)&&($=Math.min($,f)));s.width=Math.ceil(h);s.height=Math.ceil($);if("svg"===b.context)return u=new Nc(s.Hd,p,q),Gm(a,u,l,new ha(Math.ceil(h),Math.ceil($)),e,x,k,m,r,n),a.Eo=!0,u;Gm(a,u,l,new ha(Math.ceil(h),Math.ceil($)),e,x,k,m,r,n);a.Eo=!0;return s}D.inherit=function(a,b){w.j(a,"function",D,"inherit");w.j(b,"function",D,"inherit");b.SG&&w.k("Cannot inherit from "+w.hf(b));w.La(a,b)}; +function Bl(){this.FD=null;this.UG="63ad05bbe23a1786468a4c741b6d2";this.Fi=this.UG===this._tk?!0:null} +function Kn(a){var b="f",c=window[w.Ig("76a715b2f73f148a")][w.Ig("72ba13b5")],d=w.Ig;if(window[d("7da7")]&&window[d("7da7")][d("76a115b6ed251eaf4692")]){a.Fi=!0;var e=window[d("7da7")][d("76a115b6ed251eaf4692")],e=d(e).split(d("39e9"));if(6>e.length)return;var f=d(e[1]).split(".");if("7da71ca0"!==e[4])return;var h=d(w[d("6cae19")]).split(".");if(f[0]>h[0]||f[0]===h[0]&&f[1]>=h[1]){f=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h f&&d(e[2])!==d("7da71ca0ad381e90")&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));0>f&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Fi=!(0<=f&&ff&&d(w.adym)!==d("7da71ca0ad381e90")&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Fi=!(0<=f&&fb.timeStamp-a.Gm)b.preventDefault();else if(a.gl)b.preventDefault();else{a.Tc=a.Pb;a.Pb=c;Ql(a,a,b,c,!0);c.Nl=!0;c.Fe=b.detail;if(w.gF||w.hF)b.timeStamp-a.Gmb.timeStamp-a.Gm){b.preventDefault();return}a.Gm=b.timeStamp}if(w.Dn&&null!==a.Zs)a.Zs=null,b.preventDefault();else{a.Tc=a.Pb;a.Pb=c;Ql(a,a,b,c, -!0);c.up=!0;c.Fe=b.detail;if(w.gF||w.hF)c.Fe=a.jl;c.bubbles=b.bubbles;b.target.Z&&(c.Ug=b.target.Z);a.simulatedMouseUp(b,null,new z,c.Ug)||(a.doMouseUp(),Ph(a),Ul(c,b))}}};a.Ng=function(b){if(a.isEnabled){var c=a.Tc;a.Tc=a.Pb;a.Pb=c;Ql(a,a,b,c,!0);c.bubbles=!0;c.Ml=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();Ul(c,b)}};a.On=function(){if(a.isEnabled){a.Cm=!1;var b=a.Za;b.cancelWaitAfter();b instanceof bh&&b.hideToolTip()}};a.qB=function(b){if(a.isEnabled){a.ht=!1;a.gl=!0;var c= -a.Tc;a.Tc=a.Pb;a.Pb=c;Sl(a,b,b.targetTouches[0],c,1a.kw)){var c=a.Zi; -c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.Tc,a.Tc=a.Pb,a.Pb=c,Tl(a,b,b,c,!0),a.simulatedMouseMove(b,null,c.Ug)||(a.doMouseMove(),Ul(c,b)))}};a.FF=function(b){if("touch"===b.pointerType){var c=a.pD;void 0!==c[b.pointerId]&&(a.kw--,delete c[b.pointerId],c=a.Zi,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};d.Ee(!0);Cl(a)} -function Kn(a){1a)&&w.Ea(a,"0 <= loc <= 1",ga,"addColorStop:loc");w.j(b,"string",ga,"addColorStop:color");null===this.ah&&(this.ah=new ka("number","string"));this.ah.add(a,b);this.ma===kg&&(this.type=lg);this.bh=null}; -w.defineProperty(ga,{type:"type"},function(){return this.ma},function(a){this.Q&&w.la(this,a);w.mb(a,ga,ga,"type");this.ma=a;this.start.Nd()&&(a===lg?this.start=wb:a===$c&&(this.start=Fb));this.end.Nd()&&(a===lg?this.end=Jb:a===$c&&(this.end=Fb));this.bh=null});w.defineProperty(ga,{color:"color"},function(){return this.po},function(a){this.Q&&w.la(this,a);this.po=a;this.bh=null}); -w.defineProperty(ga,{start:"start"},function(){return this.qp},function(a){this.Q&&w.la(this,a);w.G(a,L,ga,"start");this.qp=a.S();this.bh=null});w.defineProperty(ga,{end:"end"},function(){return this.Eo},function(a){this.Q&&w.la(this,a);w.G(a,L,ga,"end");this.Eo=a.S();this.bh=null});w.defineProperty(ga,{Ku:"startRadius"},function(){return this.yw},function(a){this.Q&&w.la(this,a);w.Ed(a,ga,"startRadius");0>a&&w.Ea(a,">= zero",ga,"startRadius");this.yw=a;this.bh=null}); -w.defineProperty(ga,{It:"endRadius"},function(){return this.wv},function(a){this.Q&&w.la(this,a);w.Ed(a,ga,"endRadius");0>a&&w.Ea(a,">= zero",ga,"endRadius");this.wv=a;this.bh=null});w.defineProperty(ga,{tk:"colorStops"},function(){return this.ah},function(a){this.Q&&w.la(this,a);this.ah=a;this.bh=null});w.defineProperty(ga,{pattern:"pattern"},function(){return this.jw},function(a){this.Q&&w.la(this,a);this.jw=a;this.bh=null}); -ga.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a),d=Math.floor(a+Math.random()*c).toString(16),e=Math.floor(a+Math.random()*c).toString(16),c=Math.floor(a+Math.random()*c).toString(16);2>d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+d+e+c};var Un=(new Tc(null)).wk,fa; -ga.isValidColor=fa=function(a){if("black"===a)return!0;if(""===a)return!1;Un.fillStyle="#000000";var b=Un.fillStyle;Un.fillStyle=a;if(Un.fillStyle!==b)return!0;Un.fillStyle="#FFFFFF";b=Un.fillStyle;Un.fillStyle=a;return Un.fillStyle!==b};var Vn=new Qn,Wn=new Qn,Xn=new Qn,Yn=new Qn;ga.lighten=function(a){return Zn(a)}; -ga.prototype.lightenBy=function(a,b){this.Q&&w.la(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Sn:b;if(this.type===kg)$n(this.color),this.color=ao(c,d);else if((this.type===lg||this.type===$c)&&null!==this.tk)for(var e=this.tk.i;e.next();)$n(e.value),this.addColorStop(e.key,ao(c,d));return this};var Zn;ga.lightenBy=Zn=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Sn:c;$n(a);return ao(b,c)};ga.darken=function(a){return bo(a)}; -ga.prototype.darkenBy=function(a,b){this.Q&&w.la(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Sn:b;if(this.type===kg)$n(this.color),this.color=ao(-c,d);else if((this.type===lg||this.type===$c)&&null!==this.tk)for(var e=this.tk.i;e.next();)$n(e.value),this.addColorStop(e.key,ao(-c,d));return this};var bo;ga.darkenBy=bo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Sn:c;$n(a);return ao(-b,c)}; -function ao(a,b){switch(b){case Sn:var c=100*co(Vn.Bc),d=100*co(Vn.vd),e=100*co(Vn.Vc);Xn.Bc=.4124564*c+.3575761*d+.1804375*e;Xn.vd=.2126729*c+.7151522*d+.072175*e;Xn.Vc=.0193339*c+.119192*d+.9503041*e;Xn.bg=Vn.bg;c=eo(Xn.Bc/fo[0]);d=eo(Xn.vd/fo[1]);e=eo(Xn.Vc/fo[2]);Yn.Bc=116*d-16;Yn.vd=500*(c-d);Yn.Vc=200*(d-e);Yn.bg=Xn.bg;Yn.Bc=Math.min(100,Math.max(0,Yn.Bc+100*a));c=(Yn.Bc+16)/116;d=c-Yn.Vc/200;Xn.Bc=fo[0]*ho(Yn.vd/500+c);Xn.vd=fo[1]*(Yn.Bc>io*jo?Math.pow(c,3):Yn.Bc/io);Xn.Vc=fo[2]*ho(d);Xn.bg= -Yn.bg;c=-.969266*Xn.Bc+1.8760108*Xn.vd+.041556*Xn.Vc;d=.0556434*Xn.Bc+-.2040259*Xn.vd+1.0572252*Xn.Vc;Vn.Bc=255*ko((3.2404542*Xn.Bc+-1.5371385*Xn.vd+-.4985314*Xn.Vc)/100);Vn.vd=255*ko(c/100);Vn.Vc=255*ko(d/100);Vn.bg=Xn.bg;Vn.Bc=Math.round(Vn.Bc);255Vn.Bc&&(Vn.Bc=0);Vn.vd=Math.round(Vn.vd);255Vn.vd&&(Vn.vd=0);Vn.Vc=Math.round(Vn.Vc);255Vn.Vc&&(Vn.Vc=0);return"rgba("+Vn.Bc+", "+Vn.vd+", "+Vn.Vc+", "+Vn.bg+")";case Tn:var e=Vn.Bc/255,f=Vn.vd/ -255,h=Vn.Vc/255,k=Math.max(e,f,h),d=Math.min(e,f,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(f-h)/l%6;break;case f:c=(h-e)/l+2;break;case h:c=(e-f)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}Wn.Bc=Math.round(c);Wn.vd=Math.round(100*e);Wn.Vc=Math.round(100*d);Wn.bg=Vn.bg;Wn.Vc=Math.min(100,Math.max(0,Wn.Vc+100*a));return"hsla("+Wn.Bc+", "+Wn.vd+"%, "+Wn.Vc+"%, "+Wn.bg+")";default:return w.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}} -function $n(a){Un.clearRect(0,0,1,1);Un.fillStyle="#000000";var b=Un.fillStyle;Un.fillStyle=a;Un.fillStyle!==b?(Un.fillRect(0,0,1,1),a=Un.getImageData(0,0,1,1).data,Vn.Bc=a[0],Vn.vd=a[1],Vn.Vc=a[2],Vn.bg=a[3]/255):(Un.fillStyle="#FFFFFF",Un.fillStyle=a,Vn.Bc=0,Vn.vd=0,Vn.Vc=0,Vn.bg=1)}function co(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function ko(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var jo=216/24389,io=24389/27,fo=[95.047,100,108.883]; -function eo(a){return a>jo?Math.pow(a,1/3):(io*a+16)/116}function ho(a){var b=a*a*a;return b>jo?b:(116*a-16)/io} -function G(){w.lc(this);this.P=4225027;this.vc=1;this.lh=null;this.Qb="";this.Zb=this.Db=null;this.hb=(new z(NaN,NaN)).freeze();this.Re=Dd;this.Vh=nd;this.Uh=Bd;this.cd=new ia;this.om=new ia;this.Qi=new ia;this.tb=this.Bo=1;this.gg=0;this.Ag=lo;this.Lm=dd;this.od=(new A(NaN,NaN,NaN,NaN)).freeze();this.mc=(new A(NaN,NaN,NaN,NaN)).freeze();this.Sc=(new A(0,0,NaN,NaN)).freeze();this.V=this.As=this.Bs=null;this.nm=this.ge=oc;this.Ns=0;this.aj=1;this.Uq=0;this.xi=1;this.ct=null;this.Rs=-Infinity;this.Wm= -0;this.Xm=bd;this.Ym=dj;this.cr="";this.sc=this.ha=null;this.no=-1;this.bn=this.jg=this.Yk=this.pp=null;this.rz=gj;this.Sm=null}w.ji(G);w.fa("GraphObject",G); -G.prototype.cloneProtected=function(a){a.P=this.P|6144;a.vc=this.vc;a.Qb=this.Qb;a.Db=this.Db;a.Zb=this.Zb;a.hb.assign(this.hb);a.Re=this.Re.S();a.Vh=this.Vh.S();a.Uh=this.Uh.S();a.Qi=this.Qi.copy();a.tb=this.tb;a.gg=this.gg;a.Ag=this.Ag;a.Lm=this.Lm.S();a.od.assign(this.od);a.mc.assign(this.mc);a.Sc.assign(this.Sc);a.As=this.As;null!==this.V&&(a.V=this.V.copy());a.ge=this.ge.S();a.nm=this.nm.S();a.Ns=this.Ns;a.aj=this.aj;a.Uq=this.Uq;a.xi=this.xi;a.ct=this.ct;a.Rs=this.Rs;a.Wm=this.Wm;a.Xm=this.Xm.S(); -a.Ym=this.Ym;a.cr=this.cr;null!==this.ha&&(a.ha=this.ha.copy());a.sc=this.sc;a.no=this.no;null!==this.Yk&&(a.Yk=w.Hl(this.Yk));null!==this.jg&&(a.jg=this.jg.copy());a.bn=this.bn};G.prototype.addCopyProperty=G.prototype.YG=function(a){var b=this.Yk;if(w.isArray(b))for(var c=0;ck;)k+=f[n++%l],p=!p;q=!1}else k=f[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}} -G.prototype.raiseChangedEvent=G.prototype.Wc=function(a,b,c,d,e,f,h){var k=this.U;if(null!==k&&(k.Tn(a,b,c,d,e,f,h),wo(this)&&c===this&&a===Mf&&xo(this,k,b),c===k&&0!==(k.P&16777216)&&null!==k.data))for(a=this.wa.n,c=a.length,d=0;da&&(a+=360));return a};G.prototype.getDocumentScale=G.prototype.nj=function(){if(0!==(this.P&4096)===!1)return this.Bo;var a=this.tb;return null!==this.O?a*this.O.nj():a};G.prototype.getLocalPoint=G.prototype.OE=function(a,b){void 0===b&&(b=new z);b.assign(a);this.ph.li(b);return b}; -G.prototype.getNearestIntersectionPoint=G.prototype.PE=function(a,b,c){return this.zn(a.x,a.y,b.x,b.y,c)};g=G.prototype;g.zn=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy);if(null!==this.jn)return f=this.Y,oe(f.left,f.top,f.right,f.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.l(0,0);d=this.Ia;c=oe(0,0,d.width,d.height,h,a,b,c,e);e.transform(f);return c}; -function rk(a,b,c,d,e){if(!1!==ym(a)){var f=a.margin,h=f.right+f.left,f=f.top+f.bottom;b=Math.max(b-h,0);c=Math.max(c-f,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-f,0);var h=a.angle,f=0,f=a.Aa,k=0;a instanceof X&&(k=a.kb);90===h||270===h?(b=isFinite(f.height)?f.height+k:b,c=isFinite(f.width)?f.width+k:c):(b=isFinite(f.width)?f.width+k:b,c=isFinite(f.height)?f.height+k:c);var f=d||0,k=e||0,l=a instanceof C;switch(Bo(a,!0)){case Ij:k=f=0;l&&(c=b=Infinity);break;case Ie:isFinite(b)&&b>d&&(f=b);isFinite(c)&& -c>e&&(k=c);break;case no:isFinite(b)&&b>d&&(f=b);k=0;l&&(c=Infinity);break;case mo:isFinite(c)&&c>e&&(k=c),f=0,l&&(b=Infinity)}var l=a.Af,m=a.zh;f>l.width&&m.widthl.height&&m.heighta.height||this.Oi.ef>a.width))&&(c=!0);this.P=c?this.P|256:this.P&-257;this.mc.H()|| -w.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.mc.toString());this.Lx(f,this.mc);Co(this,!1);w.Gb(f)};g.hj=function(){}; -function Do(a,b,c,d,e){var f=a.Y;f.x=b;f.y=c;f.width=d;f.height=e;if(!a.Aa.H()){f=a.od;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=f.width+b;f=f.height+h;d+=b;e+=h;b=Bo(a,!0);c===d&&f===e&&(b=Ij);switch(b){case Ij:if(c>d||f>e)Xl(a,!0),rk(a,c>d?d:c,f>e?e:f);break;case Ie:Xl(a,!0);rk(a,d,e,0,0);break;case no:Xl(a,!0);rk(a,d,f,0,0);break;case mo:Xl(a,!0),rk(a,c,e,0,0)}}} -g.Lx=function(a,b){var c=this.U;null!==c&&null!==c.g&&(c.Eu!==this&&c.SF!==this&&c.VF!==this||Eo(c,!0),this.na(),Qa(a,b)||(c.Vl(),this.dw(c)))};g.dw=function(a){null!==this.Pd&&(Eo(a,!0),a instanceof T&&Fo(a,this))};w.defineProperty(G,{vq:"shadowVisible"},function(){return this.bn},function(a){var b=this.bn;b!==a&&(this.bn=a,this.na(),this.h("shadowVisible",b,a))}); -G.prototype.se=function(a,b){if(this.visible){var c=this.mc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.opacity,e=1;if(1!==d){if(0===d)return;e=a.globalAlpha;a.globalAlpha=e*d}if(a instanceof Lc)a:{if(this.visible){var f=null,h=a.Bx;if(this instanceof C&&(this.type===Go||this.type===Ho))Io(this,a,b);else{var k=this.mc;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.O;0!==(this.P&4096)===!0&&Jo(this);var c=0!==(this.P&256),n=!1;this instanceof -Ch&&(a.font=this.font);if(c){n=m.Yg()?m.Ia:m.Y;if(null!==this.jg)var p=this.jg,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(k.x,n.x),r=Math.max(k.y,n.y),s=Math.min(k.right,n.right)-q,p=Math.min(k.bottom,n.bottom)-r;if(q>k.width+k.x||k.x>n.width+n.x||r>k.height+k.y||k.y>n.height+n.y)break a;n=!0;Nc(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.rj()){var u=this;if(!u.isVisible())break a}a.uh.Sb=[1,0,0,1,0,0];q=!1;this.rj()&&this.Zl&&b.oj("drawShadows")&&(r=this.an,a.hB(r.x* -b.scale*b.zd,r.y*b.scale*b.zd,u.zg),a.Xn(),a.shadowColor=u.$m);u=!1;this.U&&b.oj("drawShadows")&&(u=this.U.Zl);!0===this.vq?(a.Xn(),!1===q&&u&&(Nc(a,1,0,0,1,0,0),a.$a(),q=!0)):!1===this.vq&&a.Wn();null!==this.Zb&&(Ko(this,a,this.Zb,!0,!0),!1===q&&u&&(Nc(a,1,0,0,1,0,0),a.$a(),q=!0),this.Zb instanceof ga&&this.Zb.type===$c?(a.beginPath(),a.rect(k.x,k.y,k.width,k.height),a.Hg(this.Zb)):a.fillRect(k.x,k.y,k.width,k.height));this instanceof C?Nc(a,l.m11,l.m12,l.m21,l.m22,l.dx,l.dy):a.uh.Sb=[l.m11,l.m12, -l.m21,l.m22,l.dx,l.dy];null!==this.Db&&(!1===q&&u&&(Nc(a,1,0,0,1,0,0),a.$a(),q=!0),s=this.Ia,l=k=0,r=s.width,s=s.height,p=0,this instanceof X&&(s=this.gb.jb,k=s.x,l=s.y,r=s.width,s=s.height,p=this.fi),Ko(this,a,this.Db,!0,!1),this.Db instanceof ga&&this.Db.type===$c?(a.beginPath(),a.rect(k-p/2,l-p/2,r+p,s+p),a.Hg(this.Db)):a.fillRect(k-p/2,l-p/2,r+p,s+p));u&&(null!==this.Db||null!==this.Zb||null!==m&&0!==(m.P&512)||null!==m&&(m.type===Bl||m.type===Gj)&&m.Hd()!==this)?(Lo(this,!0),null===this.vq&& -a.Wn()):Lo(this,!1);this.xk(a,b);u&&0!==(this.P&512)===!0&&a.Xn();this.rj()&&u&&a.Wn();c&&(a.restore(),n&&a.wf.pop());this instanceof C&&(f=a.wf.pop());!0===q&&a.wf.pop();null!==a.BE&&(null===f&&(h===a.Bx?(Nc(a,1,0,0,1,0,0),f=a.wf.pop()):f=a.Bx),a.BE(this,f))}}}}else{if(this instanceof C&&(this.type===Go||this.type===Ho)){Io(this,a,b);1!==d&&(a.globalAlpha=e);return}this instanceof W&&this.lu(!1);f=this.transform;h=this.O;0!==(this.P&4096)===!0&&Jo(this);m=0!==(this.P&256);a.Kp&&(m=!1);this instanceof -Ch&&(a.font=this.font);if(m){n=h.Yg()?h.Ia:h.Y;null!==this.jg?(q=this.jg,k=q.x,l=q.y,u=q.width,q=q.height):(k=Math.max(c.x,n.x),l=Math.max(c.y,n.y),u=Math.min(c.right,n.right)-k,q=Math.min(c.bottom,n.bottom)-l);if(k>c.width+c.x||c.x>n.width+n.x||l>c.height+c.y||c.y>n.height+n.y){1!==d&&(a.globalAlpha=e);return}a.save();a.beginPath();a.rect(k,l,u,q);a.clip()}if(this.rj()){if(!this.isVisible()){1!==d&&(a.globalAlpha=e);return}this.Zl&&b.oj("drawShadows")&&(n=this.an,a.hB(n.x*b.scale*b.zd,n.y*b.scale* -b.zd,this.zg),a.Xn(),a.shadowColor=this.$m)}n=!1;this.U&&b.oj("drawShadows")&&(n=this.U.Zl);!0===this.vq?a.Xn():!1===this.vq&&a.Wn();null!==this.Zb&&(Ko(this,a,this.Zb,!0,!0),this.Zb instanceof ga&&this.Zb.type===$c?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Hg(this.Zb)):a.fillRect(c.x,c.y,c.width,c.height));f.cu()||a.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);null!==this.Db&&(u=this.Ia,k=c=0,l=u.width,u=u.height,q=0,this instanceof X&&(u=this.gb.jb,c=u.x,k=u.y,l=u.width,u=u.height,q=this.fi), -Ko(this,a,this.Db,!0,!1),this.Db instanceof ga&&this.Db.type===$c?(a.beginPath(),a.rect(c-q/2,k-q/2,l+q,u+q),a.Hg(this.Db)):a.fillRect(c-q/2,k-q/2,l+q,u+q));n&&(null!==this.Db||null!==this.Zb||null!==h&&0!==(h.P&512)||null!==h&&(h.type===Bl||h.type===Gj)&&h.Hd()!==this)?(Lo(this,!0),null===this.vq&&a.Wn()):Lo(this,!1);this.xk(a,b);n&&0!==(this.P&512)===!0&&a.Xn();this.rj()&&n&&a.Wn();m?(a.restore(),this instanceof C?a.Ee(!0):a.Ee(!1)):f.cu()||(h=1/(f.m11*f.m22-f.m12*f.m21),a.transform(f.m22*h,-f.m12* +c=d("02cncncn"),"."===c[0]&&(c=c[d("69bd14a0f724128a44")](1)),b[d("79a417a0f0181a8946")]=c,window.document[d("78a712aa")]?(window.document[d("78a712aa")][d("7bb806b6ed32388c4a875b")](b),c=window[d("7dad0290ec3b0b91578e5b40007031bf")](b)[d("7dad0283f1390b81519f4645156528bf")](d("78a704b7e62456904c9b12701b6532a8")),window.document[d("78a712aa")][d("68ad1bbcf533388c4a875b")](b),c&&-1!==c.indexOf(d(w.qH))&&-1!==c.indexOf(d(w.rH))&&(a.Fi=!1)):(a.Fi=null,a.Fi=!1))} +Bl.prototype.km=function(a){a.qf.setTransform(a.Ad,0,0,a.Ad,0,0);null===this.Fi&&Kn(this);return 0b.timeStamp-a.Gm)b.preventDefault();else if(a.il)b.preventDefault();else{a.Uc=a.Pb;a.Pb=c;Tl(a,a,b,c,!0);c.Ol=!0;c.Fe=b.detail;if(w.jF||w.kF)b.timeStamp-a.Gmb.timeStamp-a.Gm){b.preventDefault();return}a.Gm=b.timeStamp}if(w.Fn&&null!==a.Zs)a.Zs=null,b.preventDefault();else{a.Uc=a.Pb;a.Pb=c;Tl(a, +a,b,c,!0);c.up=!0;c.Fe=b.detail;if(w.jF||w.kF)c.Fe=a.ll;c.bubbles=b.bubbles;b.target.Z&&(c.Vg=b.target.Z);a.simulatedMouseUp(b,null,new z,c.Vg)||(a.doMouseUp(),Uh(a),Xl(c,b))}}};a.Og=function(b){if(a.isEnabled){var c=a.Uc;a.Uc=a.Pb;a.Pb=c;Tl(a,a,b,c,!0);c.bubbles=!0;c.Nl=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();Xl(c,b)}};a.Qn=function(){if(a.isEnabled){a.Cm=!1;var b=a.Za;b.cancelWaitAfter();b instanceof fh&&b.hideToolTip()}};a.uB=function(b){if(a.isEnabled){a.gt=!1;a.il=!0; +var c=a.Uc;a.Uc=a.Pb;a.Pb=c;Vl(a,b,b.targetTouches[0],c,1a.jw)){var c=a.Zi;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.Uc,a.Uc=a.Pb,a.Pb=c,Wl(a,b,b,c,!0),a.simulatedMouseMove(b,null,c.Vg)||(a.doMouseMove(),Xl(c,b)))}};a.IF=function(b){if("touch"===b.pointerType){var c=a.sD;void 0!==c[b.pointerId]&&(a.jw--,delete c[b.pointerId],c=a.Zi,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};d.Ee(!0);Fl(a)} +function Ln(a){1a)&&w.Ea(a,"0 <= loc <= 1",ga,"addColorStop:loc");w.j(b,"string",ga,"addColorStop:color");null===this.ah&&(this.ah=new ka("number","string"));this.ah.add(a,b);this.ma===mg&&(this.type=ng);this.bh=null}; +w.defineProperty(ga,{type:"type"},function(){return this.ma},function(a){this.Q&&w.la(this,a);w.mb(a,ga,ga,"type");this.ma=a;this.start.Od()&&(a===ng?this.start=yb:a===bd&&(this.start=Gb));this.end.Od()&&(a===ng?this.end=Kb:a===bd&&(this.end=Gb));this.bh=null});w.defineProperty(ga,{color:"color"},function(){return this.ro},function(a){this.Q&&w.la(this,a);this.ro=a;this.bh=null}); +w.defineProperty(ga,{start:"start"},function(){return this.rp},function(a){this.Q&&w.la(this,a);w.G(a,L,ga,"start");this.rp=a.S();this.bh=null});w.defineProperty(ga,{end:"end"},function(){return this.Go},function(a){this.Q&&w.la(this,a);w.G(a,L,ga,"end");this.Go=a.S();this.bh=null});w.defineProperty(ga,{Ju:"startRadius"},function(){return this.xw},function(a){this.Q&&w.la(this,a);w.Fd(a,ga,"startRadius");0>a&&w.Ea(a,">= zero",ga,"startRadius");this.xw=a;this.bh=null}); +w.defineProperty(ga,{Ht:"endRadius"},function(){return this.vv},function(a){this.Q&&w.la(this,a);w.Fd(a,ga,"endRadius");0>a&&w.Ea(a,">= zero",ga,"endRadius");this.vv=a;this.bh=null});w.defineProperty(ga,{uk:"colorStops"},function(){return this.ah},function(a){this.Q&&w.la(this,a);this.ah=a;this.bh=null});w.defineProperty(ga,{pattern:"pattern"},function(){return this.iw},function(a){this.Q&&w.la(this,a);this.iw=a;this.bh=null}); +ga.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a),d=Math.floor(a+Math.random()*c).toString(16),e=Math.floor(a+Math.random()*c).toString(16),c=Math.floor(a+Math.random()*c).toString(16);2>d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+d+e+c};var Vn=(new Vc(null)).xk,fa; +ga.isValidColor=fa=function(a){if("black"===a)return!0;if(""===a)return!1;Vn.fillStyle="#000000";var b=Vn.fillStyle;Vn.fillStyle=a;if(Vn.fillStyle!==b)return!0;Vn.fillStyle="#FFFFFF";b=Vn.fillStyle;Vn.fillStyle=a;return Vn.fillStyle!==b};var Wn=new Rn,Xn=new Rn,Yn=new Rn,Zn=new Rn;ga.lighten=function(a){return $n(a)}; +ga.prototype.lightenBy=function(a,b){this.Q&&w.la(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Tn:b;if(this.type===mg)ao(this.color),this.color=bo(c,d);else if((this.type===ng||this.type===bd)&&null!==this.uk)for(var e=this.uk.i;e.next();)ao(e.value),this.addColorStop(e.key,bo(c,d));return this};var $n;ga.lightenBy=$n=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Tn:c;ao(a);return bo(b,c)};ga.darken=function(a){return co(a)}; +ga.prototype.darkenBy=function(a,b){this.Q&&w.la(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Tn:b;if(this.type===mg)ao(this.color),this.color=bo(-c,d);else if((this.type===ng||this.type===bd)&&null!==this.uk)for(var e=this.uk.i;e.next();)ao(e.value),this.addColorStop(e.key,bo(-c,d));return this};var co;ga.darkenBy=co=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Tn:c;ao(a);return bo(-b,c)}; +function bo(a,b){switch(b){case Tn:var c=100*eo(Wn.Bc),d=100*eo(Wn.xd),e=100*eo(Wn.Wc);Yn.Bc=.4124564*c+.3575761*d+.1804375*e;Yn.xd=.2126729*c+.7151522*d+.072175*e;Yn.Wc=.0193339*c+.119192*d+.9503041*e;Yn.cg=Wn.cg;c=fo(Yn.Bc/ho[0]);d=fo(Yn.xd/ho[1]);e=fo(Yn.Wc/ho[2]);Zn.Bc=116*d-16;Zn.xd=500*(c-d);Zn.Wc=200*(d-e);Zn.cg=Yn.cg;Zn.Bc=Math.min(100,Math.max(0,Zn.Bc+100*a));c=(Zn.Bc+16)/116;d=c-Zn.Wc/200;Yn.Bc=ho[0]*io(Zn.xd/500+c);Yn.xd=ho[1]*(Zn.Bc>jo*ko?Math.pow(c,3):Zn.Bc/jo);Yn.Wc=ho[2]*io(d);Yn.cg= +Zn.cg;c=-.969266*Yn.Bc+1.8760108*Yn.xd+.041556*Yn.Wc;d=.0556434*Yn.Bc+-.2040259*Yn.xd+1.0572252*Yn.Wc;Wn.Bc=255*lo((3.2404542*Yn.Bc+-1.5371385*Yn.xd+-.4985314*Yn.Wc)/100);Wn.xd=255*lo(c/100);Wn.Wc=255*lo(d/100);Wn.cg=Yn.cg;Wn.Bc=Math.round(Wn.Bc);255Wn.Bc&&(Wn.Bc=0);Wn.xd=Math.round(Wn.xd);255Wn.xd&&(Wn.xd=0);Wn.Wc=Math.round(Wn.Wc);255Wn.Wc&&(Wn.Wc=0);return"rgba("+Wn.Bc+", "+Wn.xd+", "+Wn.Wc+", "+Wn.cg+")";case Un:var e=Wn.Bc/255,f=Wn.xd/ +255,h=Wn.Wc/255,k=Math.max(e,f,h),d=Math.min(e,f,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(f-h)/l%6;break;case f:c=(h-e)/l+2;break;case h:c=(e-f)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}Xn.Bc=Math.round(c);Xn.xd=Math.round(100*e);Xn.Wc=Math.round(100*d);Xn.cg=Wn.cg;Xn.Wc=Math.min(100,Math.max(0,Xn.Wc+100*a));return"hsla("+Xn.Bc+", "+Xn.xd+"%, "+Xn.Wc+"%, "+Xn.cg+")";default:return w.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}} +function ao(a){Vn.clearRect(0,0,1,1);Vn.fillStyle="#000000";var b=Vn.fillStyle;Vn.fillStyle=a;Vn.fillStyle!==b?(Vn.fillRect(0,0,1,1),a=Vn.getImageData(0,0,1,1).data,Wn.Bc=a[0],Wn.xd=a[1],Wn.Wc=a[2],Wn.cg=a[3]/255):(Vn.fillStyle="#FFFFFF",Vn.fillStyle=a,Wn.Bc=0,Wn.xd=0,Wn.Wc=0,Wn.cg=1)}function eo(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function lo(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var ko=216/24389,jo=24389/27,ho=[95.047,100,108.883]; +function fo(a){return a>ko?Math.pow(a,1/3):(jo*a+16)/116}function io(a){var b=a*a*a;return b>ko?b:(116*a-16)/jo} +function G(){w.mc(this);this.P=4225027;this.wc=1;this.lh=null;this.Qb="";this.$b=this.Eb=null;this.ib=(new z(NaN,NaN)).freeze();this.Re=Dd;this.Vh=od;this.Uh=Bd;this.dd=new ia;this.om=new ia;this.Qi=new ia;this.tb=this.Do=1;this.ig=0;this.Cg=mo;this.Lm=fd;this.qd=(new A(NaN,NaN,NaN,NaN)).freeze();this.nc=(new A(NaN,NaN,NaN,NaN)).freeze();this.Tc=(new A(0,0,NaN,NaN)).freeze();this.V=this.As=this.Bs=null;this.nm=this.ge=rc;this.Ns=0;this.aj=1;this.Tq=0;this.xi=1;this.ct=null;this.Rs=-Infinity;this.Wm= +0;this.Xm=dd;this.Ym=kj;this.br="";this.tc=this.ha=null;this.po=-1;this.bn=this.lg=this.$k=this.qp=null;this.uz=nj;this.Sm=null}w.ji(G);w.fa("GraphObject",G); +G.prototype.cloneProtected=function(a){a.P=this.P|6144;a.wc=this.wc;a.Qb=this.Qb;a.Eb=this.Eb;a.$b=this.$b;a.ib.assign(this.ib);a.Re=this.Re.S();a.Vh=this.Vh.S();a.Uh=this.Uh.S();a.Qi=this.Qi.copy();a.tb=this.tb;a.ig=this.ig;a.Cg=this.Cg;a.Lm=this.Lm.S();a.qd.assign(this.qd);a.nc.assign(this.nc);a.Tc.assign(this.Tc);a.As=this.As;null!==this.V&&(a.V=this.V.copy());a.ge=this.ge.S();a.nm=this.nm.S();a.Ns=this.Ns;a.aj=this.aj;a.Tq=this.Tq;a.xi=this.xi;a.ct=this.ct;a.Rs=this.Rs;a.Wm=this.Wm;a.Xm=this.Xm.S(); +a.Ym=this.Ym;a.br=this.br;null!==this.ha&&(a.ha=this.ha.copy());a.tc=this.tc;a.po=this.po;null!==this.$k&&(a.$k=w.Il(this.$k));null!==this.lg&&(a.lg=this.lg.copy());a.bn=this.bn};G.prototype.addCopyProperty=G.prototype.aH=function(a){var b=this.$k;if(w.isArray(b))for(var c=0;ck;)k+=f[n++%l],p=!p;q=!1}else k=f[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}} +G.prototype.raiseChangedEvent=G.prototype.Xc=function(a,b,c,d,e,f,h){var k=this.U;if(null!==k&&(k.Vn(a,b,c,d,e,f,h),xo(this)&&c===this&&a===Mf&&yo(this,k,b),c===k&&0!==(k.P&16777216)&&null!==k.data))for(a=this.xa.n,c=a.length,d=0;da&&(a+=360));return a};G.prototype.getDocumentScale=G.prototype.oj=function(){if(0!==(this.P&4096)===!1)return this.Do;var a=this.tb;return null!==this.O?a*this.O.oj():a};G.prototype.getLocalPoint=G.prototype.RE=function(a,b){void 0===b&&(b=new z);b.assign(a);this.ph.li(b);return b}; +G.prototype.getNearestIntersectionPoint=G.prototype.SE=function(a,b,c){return this.Bn(a.x,a.y,b.x,b.y,c)};g=G.prototype;g.Bn=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy);if(null!==this.jn)return f=this.W,ke(f.left,f.top,f.right,f.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.m(0,0);d=this.Ia;c=ke(0,0,d.width,d.height,h,a,b,c,e);e.transform(f);return c}; +function wk(a,b,c,d,e){if(!1!==hm(a)){var f=a.margin,h=f.right+f.left,f=f.top+f.bottom;b=Math.max(b-h,0);c=Math.max(c-f,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-f,0);var h=a.angle,f=0,f=a.Ba,k=0;a instanceof X&&(k=a.kb);90===h||270===h?(b=isFinite(f.height)?f.height+k:b,c=isFinite(f.width)?f.width+k:c):(b=isFinite(f.width)?f.width+k:b,c=isFinite(f.height)?f.height+k:c);var f=d||0,k=e||0,l=a instanceof C;switch(Co(a,!0)){case Nj:k=f=0;l&&(c=b=Infinity);break;case De:isFinite(b)&&b>d&&(f=b);isFinite(c)&& +c>e&&(k=c);break;case oo:isFinite(b)&&b>d&&(f=b);k=0;l&&(c=Infinity);break;case no:isFinite(c)&&c>e&&(k=c),f=0,l&&(b=Infinity)}var l=a.Bf,m=a.zh;f>l.width&&m.widthl.height&&m.heighta.height||this.Oi.ef>a.width))&&(c=!0);this.P=c?this.P|256:this.P&-257;this.nc.H()|| +w.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.nc.toString());this.Kx(f,this.nc);Do(this,!1);w.Db(f)};g.ij=function(){}; +function Eo(a,b,c,d,e){var f=a.W;f.x=b;f.y=c;f.width=d;f.height=e;if(!a.Ba.H()){f=a.qd;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=f.width+b;f=f.height+h;d+=b;e+=h;b=Co(a,!0);c===d&&f===e&&(b=Nj);switch(b){case Nj:if(c>d||f>e)$l(a,!0),wk(a,c>d?d:c,f>e?e:f);break;case De:$l(a,!0);wk(a,d,e,0,0);break;case oo:$l(a,!0);wk(a,d,f,0,0);break;case no:$l(a,!0),wk(a,c,e,0,0)}}} +g.Kx=function(a,b){var c=this.U;null!==c&&null!==c.g&&(c.Du!==this&&c.VF!==this&&c.YF!==this||Fo(c,!0),this.na(),Qa(a,b)||(c.Ek(),this.ss(c)))};g.ss=function(a){null!==this.Qd&&(Fo(a,!0),a instanceof T&&Go(a,this))};w.defineProperty(G,{uq:"shadowVisible"},function(){return this.bn},function(a){var b=this.bn;b!==a&&(this.bn=a,this.na(),this.h("shadowVisible",b,a))}); +G.prototype.se=function(a,b){if(this.visible){var c=this.nc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.opacity,e=1;if(1!==d){if(0===d)return;e=a.globalAlpha;a.globalAlpha=e*d}if(a instanceof Nc)a:{if(this.visible){var f=null,h=a.Ax;if(this instanceof C&&(this.type===Ho||this.type===Io))Jo(this,a,b);else{var k=this.nc;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.O;0!==(this.P&4096)===!0&&Ko(this);var c=0!==(this.P&256),n=!1;this instanceof +Hh&&(a.font=this.font);if(c){n=m.Yg()?m.Ia:m.W;if(null!==this.lg)var p=this.lg,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(k.x,n.x),r=Math.max(k.y,n.y),s=Math.min(k.right,n.right)-q,p=Math.min(k.bottom,n.bottom)-r;if(q>k.width+k.x||k.x>n.width+n.x||r>k.height+k.y||k.y>n.height+n.y)break a;n=!0;Pc(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.tj()){var u=this;if(!u.isVisible())break a}a.uh.Tb=[1,0,0,1,0,0];q=!1;this.tj()&&this.Zl&&b.pj("drawShadows")&&(r=this.an,a.lB(r.x* +b.scale*b.Ad,r.y*b.scale*b.Ad,u.Bg),a.Zn(),a.shadowColor=u.$m);u=!1;this.U&&b.pj("drawShadows")&&(u=this.U.Zl);!0===this.uq?(a.Zn(),!1===q&&u&&(Pc(a,1,0,0,1,0,0),a.$a(),q=!0)):!1===this.uq&&a.Yn();null!==this.$b&&(Lo(this,a,this.$b,!0,!0),!1===q&&u&&(Pc(a,1,0,0,1,0,0),a.$a(),q=!0),this.$b instanceof ga&&this.$b.type===bd?(a.beginPath(),a.rect(k.x,k.y,k.width,k.height),a.Jg(this.$b)):a.fillRect(k.x,k.y,k.width,k.height));this instanceof C?Pc(a,l.m11,l.m12,l.m21,l.m22,l.dx,l.dy):a.uh.Tb=[l.m11,l.m12, +l.m21,l.m22,l.dx,l.dy];null!==this.Eb&&(!1===q&&u&&(Pc(a,1,0,0,1,0,0),a.$a(),q=!0),s=this.Ia,l=k=0,r=s.width,s=s.height,p=0,this instanceof X&&(s=this.hb.cb,k=s.x,l=s.y,r=s.width,s=s.height,p=this.fi),Lo(this,a,this.Eb,!0,!1),this.Eb instanceof ga&&this.Eb.type===bd?(a.beginPath(),a.rect(k-p/2,l-p/2,r+p,s+p),a.Jg(this.Eb)):a.fillRect(k-p/2,l-p/2,r+p,s+p));u&&(null!==this.Eb||null!==this.$b||null!==m&&0!==(m.P&512)||null!==m&&(m.type===El||m.type===Lj)&&m.Jd()!==this)?(Mo(this,!0),null===this.uq&& +a.Yn()):Mo(this,!1);this.yk(a,b);u&&0!==(this.P&512)===!0&&a.Zn();this.tj()&&u&&a.Yn();c&&(a.restore(),n&&a.wf.pop());this instanceof C&&(f=a.wf.pop());!0===q&&a.wf.pop();null!==a.EE&&(null===f&&(h===a.Ax?(Pc(a,1,0,0,1,0,0),f=a.wf.pop()):f=a.Ax),a.EE(this,f))}}}}else{if(this instanceof C&&(this.type===Ho||this.type===Io)){Jo(this,a,b);1!==d&&(a.globalAlpha=e);return}this instanceof W&&this.ku(!1);f=this.transform;h=this.O;0!==(this.P&4096)===!0&&Ko(this);m=0!==(this.P&256);a.Jp&&(m=!1);this instanceof +Hh&&(a.font=this.font);if(m){n=h.Yg()?h.Ia:h.W;null!==this.lg?(q=this.lg,k=q.x,l=q.y,u=q.width,q=q.height):(k=Math.max(c.x,n.x),l=Math.max(c.y,n.y),u=Math.min(c.right,n.right)-k,q=Math.min(c.bottom,n.bottom)-l);if(k>c.width+c.x||c.x>n.width+n.x||l>c.height+c.y||c.y>n.height+n.y){1!==d&&(a.globalAlpha=e);return}a.save();a.beginPath();a.rect(k,l,u,q);a.clip()}if(this.tj()){if(!this.isVisible()){1!==d&&(a.globalAlpha=e);return}this.Zl&&b.pj("drawShadows")&&(n=this.an,a.lB(n.x*b.scale*b.Ad,n.y*b.scale* +b.Ad,this.Bg),a.Zn(),a.shadowColor=this.$m)}n=!1;this.U&&b.pj("drawShadows")&&(n=this.U.Zl);!0===this.uq?a.Zn():!1===this.uq&&a.Yn();null!==this.$b&&(Lo(this,a,this.$b,!0,!0),this.$b instanceof ga&&this.$b.type===bd?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Jg(this.$b)):a.fillRect(c.x,c.y,c.width,c.height));f.bu()||a.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);null!==this.Eb&&(u=this.Ia,k=c=0,l=u.width,u=u.height,q=0,this instanceof X&&(u=this.hb.cb,c=u.x,k=u.y,l=u.width,u=u.height,q=this.fi), +Lo(this,a,this.Eb,!0,!1),this.Eb instanceof ga&&this.Eb.type===bd?(a.beginPath(),a.rect(c-q/2,k-q/2,l+q,u+q),a.Jg(this.Eb)):a.fillRect(c-q/2,k-q/2,l+q,u+q));n&&(null!==this.Eb||null!==this.$b||null!==h&&0!==(h.P&512)||null!==h&&(h.type===El||h.type===Lj)&&h.Jd()!==this)?(Mo(this,!0),null===this.uq&&a.Yn()):Mo(this,!1);this.yk(a,b);n&&0!==(this.P&512)===!0&&a.Zn();this.tj()&&n&&a.Yn();m?(a.restore(),this instanceof C?a.Ee(!0):a.Ee(!1)):f.bu()||(h=1/(f.m11*f.m22-f.m12*f.m21),a.transform(f.m22*h,-f.m12* h,-f.m21*h,f.m11*h,h*(f.m21*f.dy-f.m22*f.dx),h*(f.m12*f.dx-f.m11*f.dy)))}1!==d&&(a.globalAlpha=e)}}}; -function Io(a,b,c){var d=a.mc;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.Zb&&(Ko(a,b,a.Zb,!0,!0),a.Zb instanceof ga&&a.Zb.type===$c?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Hg(a.Zb)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Db&&(Ko(a,b,a.Db,!0,!1),a.Db instanceof ga&&a.Db.type===$c?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Hg(a.Db)):b.fillRect(d.x,d.y,d.width,d.height)),a.xk(b,c))}G.prototype.xk=function(){}; -function Ko(a,b,c,d,e){if(null!==c){var f=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===kg)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Ia,f=h.width,h=h.height;if(e)var l=a.Y,f=l.width,h=l.height;var m=b instanceof Uc;if(m&&c.bh&&(c.type===Rn||c.qo===f&&c.Gy===h))k=c.bh;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.Y,f=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*f+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*f+c.end.offsetX;q=c.end.y*h+c.end.offsetY; -l+=r;p+=r;n+=s;q+=s;if(c.type===lg)k=b.createLinearGradient(l,n,p,q);else if(c.type===$c)s=isNaN(c.It)?Math.max(f,h)/2:c.It,isNaN(c.Ku)?(r=0,s=Math.max(f,h)/2):r=c.Ku,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===Rn)try{k=b.createPattern(c.pattern,"repeat")}catch(u){k=null}else w.wd(c.type,"Brush type");if(c.type!==Rn&&(e=c.tk,null!==e))for(e=e.i;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.bh=k,null!==k&&(c.qo=f,c.Gy=h),null===k&&c.type===Rn&&-1!==c.qo)){c.qo=-1;var t=a.g;null!==t&& --1===c.qo&&w.setTimeout(function(){t.Sx()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}G.prototype.isContainedBy=G.prototype.Xl=function(a){if(a instanceof C)a:{if(this!==a&&null!==a)for(var b=this.O;null!==b;){if(b===a){a=!0;break a}b=b.O}a=!1}else a=!1;return a};G.prototype.isVisibleObject=G.prototype.vj=function(){if(!this.visible)return!1;var a=this.O;return null!==a?a.vj():!0}; -G.prototype.isEnabledObject=G.prototype.au=function(){for(var a=this instanceof C?this:this.O;null!==a&&a.isEnabled;)a=a.O;return null===a};w.defineProperty(G,{CE:"enabledChanged"},function(){return null!==this.ha?this.ha.sr:null},function(a){ro(this);var b=this.ha.sr;b!==a&&(null!==a&&w.j(a,"function",G,"enabledChanged"),this.ha.sr=a,this.h("enabledChanged",b,a))}); -function Jo(a){if(0!==(a.P&2048)===!0){var b=a.cd;b.reset();if(!a.mc.H()||!a.od.H()){Mo(a,!1);return}b.translate(a.mc.x,a.mc.y);b.translate(-a.za.x,-a.za.y);var c=a.Ia;zo(a,b,c.x,c.y,c.width,c.height);Mo(a,!1);No(a,!0)}0!==(a.P&4096)===!0&&(b=a.O,null===b?(a.om.set(a.cd),a.Bo=a.scale,No(a,!1)):null!==b.ph&&(c=a.om,c.reset(),b.Yg()?c.multiply(b.om):null!==b.O&&c.multiply(b.O.om),c.multiply(a.cd),a.Bo=a.scale*b.Bo,No(a,!1)))} -function zo(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=Fb;a.rj()&&a.zf.fd()&&(h=a.zf);var k=w.K();if(a instanceof S&&a.Xf!==a)for(c=a.Xf,d=c.Ia,k.Hu(d.x,d.y,d.width,d.height,h),c.Qi.nb(k),k.offset(-c.za.x,-c.za.y),h=c.O;null!==h&&h!==a;)h.Qi.nb(k),k.offset(-h.za.x,-h.za.y),h=h.O;else k.Hu(c,d,e,f,h);b.rotate(a.angle,k.x,k.y);w.v(k)}}g=G.prototype;g.I=function(a){void 0===a&&(a=!1);if(!0!==ym(this)){Xl(this,!0);Co(this,!0);var b=this.O;null===b||a||b.I()}}; -g.bq=function(){!0!==ym(this)&&(Xl(this,!0),Co(this,!0))};function Oo(a){if(!1===zm(a)){var b=a.O;null!==b?b.I():a.rj()&&(b=a.g,null!==b&&(b.qg.add(a),a instanceof T&&a.Tf(),b.Le()));Co(a,!0)}}g.Ii=function(){0!==(this.P&2048)===!1&&(Mo(this,!0),No(this,!0))};g.uA=function(){No(this,!0)};g.na=function(){var a=this.U;null!==a&&a.na()}; -function Bo(a,b){var c=a.stretch,d=a.O;if(null!==d&&d.ma===Po)return Qo(a,d.be(a.Yb),d.ae(a.column),b);if(null!==d&&d.ma===Bl&&d.Hd()===a)return Ro(a,Ie,b);if(c===lo){if(null!==d){if(d.ma===Gj&&d.Hd()===a)return Ro(a,Ie,b);c=d.Zd;return c===lo?Ro(a,Ij,b):Ro(a,c,b)}return Ro(a,Ij,b)}return Ro(a,c,b)} -function Qo(a,b,c,d){var e=a.stretch;if(e!==lo)return Ro(a,e,d);var f=e=null;switch(b.stretch){case mo:f=!0;break;case Ie:f=!0}switch(c.stretch){case no:e=!0;break;case Ie:e=!0}b=a.O.Zd;null===e&&(e=b===no||b===Ie);null===f&&(f=b===mo||b===Ie);return!0===e&&!0===f?Ro(a,Ie,d):!0===e?Ro(a,no,d):!0===f?Ro(a,mo,d):Ro(a,Ij,d)} -function Ro(a,b,c){if(c)return b;if(b===Ij)return Ij;c=a.Aa;if(c.H())return Ij;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===no)return Ij;if(b===Ie)return mo}else{if(b===mo)return Ij;if(b===Ie)return no}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===mo)return Ij;if(b===Ie)return no}else{if(b===no)return Ij;if(b===Ie)return mo}return b} -w.defineProperty(G,{rq:"segmentOrientation"},function(){return this.Ym},function(a){var b=this.Ym;b!==a&&(this.Ym=a,this.I(),this.h("segmentOrientation",b,a),a===dj&&(this.angle=0))});w.defineProperty(G,{Me:"segmentIndex"},function(){return this.Rs},function(a){a=Math.round(a);var b=this.Rs;b!==a&&(this.Rs=a,this.I(),this.h("segmentIndex",b,a))}); -w.defineProperty(G,{XA:"segmentFraction"},function(){return this.Wm},function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&w.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.tb=a,this.Ii(),this.I(),this.h("scale",b,a))});w.defineProperty(G,{angle:"angle"},function(){return this.gg},function(a){var b=this.gg;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.gg=a,this.I(),this.Ii(),this.h("angle",b,a)))}); -w.defineProperty(G,{Aa:"desiredSize"},function(){return this.Re},function(a){var b=a.width,c=a.height,d=this.Re,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Re=a=a.S(),this.I(),this instanceof X&&this.Ke(),this.h("desiredSize",d,a),wo(this)&&(a=this.U,null!==a&&(xo(this,a,"width"),xo(this,a,"height"))))}); -w.defineProperty(G,{width:"width"},function(){return this.Re.width},function(a){var b=this.Re.width;b===a||isNaN(b)&&isNaN(a)||(b=this.Re,this.Re=a=(new ha(a,this.Re.height)).freeze(),this.I(),this instanceof X&&this.Ke(),this.h("desiredSize",b,a),wo(this)&&(a=this.U,null!==a&&xo(this,a,"width")))}); -w.defineProperty(G,{height:"height"},function(){return this.Re.height},function(a){var b=this.Re.height;b===a||isNaN(b)&&isNaN(a)||(b=this.Re,this.Re=a=(new ha(this.Re.width,a)).freeze(),this.I(),this instanceof X&&this.Ke(),this.h("desiredSize",b,a),wo(this)&&(a=this.U,null!==a&&xo(this,a,"height")))}); -w.defineProperty(G,{zh:"minSize"},function(){return this.Vh},function(a){var b=this.Vh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Vh=a,this.I(),this.h("minSize",b,a))});w.defineProperty(G,{Af:"maxSize"},function(){return this.Uh},function(a){var b=this.Uh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Uh=a,this.I(),this.h("maxSize",b,a))});w.u(G,{za:"measuredBounds"},function(){return this.od}); -w.u(G,{Ia:"naturalBounds"},function(){return this.Sc},{configurable:!0});w.defineProperty(G,{margin:"margin"},function(){return this.Lm},function(a){"number"===typeof a&&(a=new eb(a));var b=this.Lm;b.L(a)||(this.Lm=a=a.S(),this.I(),this.h("margin",b,a))});w.u(G,{transform:null},function(){0!==(this.P&2048)===!0&&Jo(this);return this.cd});w.u(G,{ph:null},function(){0!==(this.P&4096)===!0&&Jo(this);return this.om}); -w.defineProperty(G,{alignment:"alignment"},function(){return this.ge},function(a){var b=this.ge;b.L(a)||(a.Nd()&&!a.Uc()&&w.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.ge=a=a.S(),Oo(this),this.h("alignment",b,a))});w.defineProperty(G,{column:"column"},function(){return this.Uq},function(a){a=Math.round(a);var b=this.Uq;b!==a&&(0>a&&w.Ea(a,">= 0",G,"column"),this.Uq=a,this.I(),this.h("column",b,a))}); -w.defineProperty(G,{qH:"columnSpan"},function(){return this.xi},function(a){a=Math.round(a);var b=this.xi;b!==a&&(1>a&&w.Ea(a,">= 1",G,"columnSpan"),this.xi=a,this.I(),this.h("columnSpan",b,a))});w.defineProperty(G,{Yb:"row"},function(){return this.Ns},function(a){a=Math.round(a);var b=this.Ns;b!==a&&(0>a&&w.Ea(a,">= 0",G,"row"),this.Ns=a,this.I(),this.h("row",b,a))}); -w.defineProperty(G,{rowSpan:"rowSpan"},function(){return this.aj},function(a){a=Math.round(a);var b=this.aj;b!==a&&(1>a&&w.Ea(a,">= 1",G,"rowSpan"),this.aj=a,this.I(),this.h("rowSpan",b,a))});w.defineProperty(G,{iy:"spanAllocation"},function(){return this.ct},function(a){var b=this.ct;b!==a&&(null!==a&&w.j(a,"function",G,"spanAllocation"),this.ct=a,this.I(),this.h("spanAllocation",b,a))}); -w.defineProperty(G,{oh:"alignmentFocus"},function(){return this.nm},function(a){var b=this.nm;b.L(a)||(!a.Nd()||a.Uc()||a.L(sb)&&this instanceof T||w.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.nm=a=a.S(),this.I(),this.h("alignmentFocus",b,a))}); -w.defineProperty(G,{Pd:"portId"},function(){return this.As},function(a){var b=this.As;if(b!==a){var c=this.U;null===c||c instanceof T||(w.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&Uo(c,this);this.As=a;if(null!==a&&c){c.Ck=!0;null===c.le&&Vo(c);var d=this.Pd;null!==d&&c.le.add(d,this)}this.h("portId",b,a)}});function Wo(a){var b=a.U;if(b instanceof T&&(null!==a.Pd||a===b.port)){var c=b.g;null===c||c.oa.fb||Fo(b,a)}} -function So(a){var b=a.g;null===b||b.oa.fb||(a instanceof C?a instanceof T?a.Tf():Xo(a,a,function(a){Wo(a)}):Wo(a))}w.defineProperty(G,{Bb:"toSpot"},function(){return null!==this.V?this.V.ok:sb},function(a){this.Kd();var b=this.V.ok;b.L(a)||(a=a.S(),this.V.ok=a,this.h("toSpot",b,a),Wo(this))}); -w.defineProperty(G,{jm:"toEndSegmentLength"},function(){return null!==this.V?this.V.mk:10},function(a){this.Kd();var b=this.V.mk;b!==a&&(0>a&&w.Ea(a,">= 0",G,"toEndSegmentLength"),this.V.mk=a,this.h("toEndSegmentLength",b,a),Wo(this))});w.defineProperty(G,{Lu:"toEndSegmentDirection"},function(){return null!==this.V?this.V.lk:uo},function(a){this.Kd();var b=this.V.lk;b!==a&&(w.Gt("GraphObject.toEndSegmentDirection","2.0"),this.V.lk=a,this.h("toEndSegmentDirection",b,a),Wo(this))}); -w.defineProperty(G,{Mu:"toShortLength"},function(){return null!==this.V?this.V.nk:0},function(a){this.Kd();var b=this.V.nk;b!==a&&(this.V.nk=a,this.h("toShortLength",b,a),Wo(this))});w.defineProperty(G,{mG:"toLinkable"},function(){return null!==this.V?this.V.lt:null},function(a){this.Kd();var b=this.V.lt;b!==a&&(this.V.lt=a,this.h("toLinkable",b,a))}); -w.defineProperty(G,{KJ:"toMaxLinks"},function(){return null!==this.V?this.V.mt:Infinity},function(a){this.Kd();var b=this.V.mt;b!==a&&(0>a&&w.Ea(a,">= 0",G,"toMaxLinks"),this.V.mt=a,this.h("toMaxLinks",b,a))});w.defineProperty(G,{Ab:"fromSpot"},function(){return null!==this.V?this.V.Rj:sb},function(a){this.Kd();var b=this.V.Rj;b.L(a)||(a=a.S(),this.V.Rj=a,this.h("fromSpot",b,a),Wo(this))}); -w.defineProperty(G,{Rl:"fromEndSegmentLength"},function(){return null!==this.V?this.V.Pj:10},function(a){this.Kd();var b=this.V.Pj;b!==a&&(0>a&&w.Ea(a,">= 0",G,"fromEndSegmentLength"),this.V.Pj=a,this.h("fromEndSegmentLength",b,a),Wo(this))});w.defineProperty(G,{St:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.Oj:uo},function(a){this.Kd();var b=this.V.Oj;b!==a&&(w.Gt("GraphObject.fromEndSegmentDirection","2.0"),this.V.Oj=a,this.h("fromEndSegmentDirection",b,a),Wo(this))}); -w.defineProperty(G,{Tt:"fromShortLength"},function(){return null!==this.V?this.V.Qj:0},function(a){this.Kd();var b=this.V.Qj;b!==a&&(this.V.Qj=a,this.h("fromShortLength",b,a),Wo(this))});w.defineProperty(G,{ME:"fromLinkable"},function(){return null!==this.V?this.V.vr:null},function(a){this.Kd();var b=this.V.vr;b!==a&&(this.V.vr=a,this.h("fromLinkable",b,a))}); -w.defineProperty(G,{jA:"fromMaxLinks"},function(){return null!==this.V?this.V.wr:Infinity},function(a){this.Kd();var b=this.V.wr;b!==a&&(0>a&&w.Ea(a,">= 0",G,"fromMaxLinks"),this.V.wr=a,this.h("fromMaxLinks",b,a))});w.defineProperty(G,{cursor:"cursor"},function(){return this.cr},function(a){var b=this.cr;b!==a&&(w.j(a,"string",G,"cursor"),this.cr=a,this.h("cursor",b,a))}); -w.defineProperty(G,{click:"click"},function(){return null!==this.ha?this.ha.wi:null},function(a){ro(this);var b=this.ha.wi;b!==a&&(null!==a&&w.j(a,"function",G,"click"),this.ha.wi=a,this.h("click",b,a))});w.defineProperty(G,{Ht:"doubleClick"},function(){return null!==this.ha?this.ha.Ei:null},function(a){ro(this);var b=this.ha.Ei;b!==a&&(null!==a&&w.j(a,"function",G,"doubleClick"),this.ha.Ei=a,this.h("doubleClick",b,a))}); -w.defineProperty(G,{Uz:"contextClick"},function(){return null!==this.ha?this.ha.yi:null},function(a){ro(this);var b=this.ha.yi;b!==a&&(null!==a&&w.j(a,"function",G,"contextClick"),this.ha.yi=a,this.h("contextClick",b,a))});w.defineProperty(G,{nu:"mouseEnter"},function(){return null!==this.ha?this.ha.ls:null},function(a){ro(this);var b=this.ha.ls;b!==a&&(null!==a&&w.j(a,"function",G,"mouseEnter"),this.ha.ls=a,this.h("mouseEnter",b,a))}); -w.defineProperty(G,{ou:"mouseLeave"},function(){return null!==this.ha?this.ha.ms:null},function(a){ro(this);var b=this.ha.ms;b!==a&&(null!==a&&w.j(a,"function",G,"mouseLeave"),this.ha.ms=a,this.h("mouseLeave",b,a))});w.defineProperty(G,{JA:"mouseOver"},function(){return null!==this.ha?this.ha.Vi:null},function(a){ro(this);var b=this.ha.Vi;b!==a&&(null!==a&&w.j(a,"function",G,"mouseOver"),this.ha.Vi=a,this.h("mouseOver",b,a))}); -w.defineProperty(G,{IA:"mouseHover"},function(){return null!==this.ha?this.ha.Ui:null},function(a){ro(this);var b=this.ha.Ui;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHover"),this.ha.Ui=a,this.h("mouseHover",b,a))});w.defineProperty(G,{HA:"mouseHold"},function(){return null!==this.ha?this.ha.Ti:null},function(a){ro(this);var b=this.ha.Ti;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHold"),this.ha.Ti=a,this.h("mouseHold",b,a))}); -w.defineProperty(G,{TI:"mouseDragEnter"},function(){return null!==this.ha?this.ha.js:null},function(a){ro(this);var b=this.ha.js;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragEnter"),this.ha.js=a,this.h("mouseDragEnter",b,a))});w.defineProperty(G,{UI:"mouseDragLeave"},function(){return null!==this.ha?this.ha.ks:null},function(a){ro(this);var b=this.ha.ks;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragLeave"),this.ha.ks=a,this.h("mouseDragLeave",b,a))}); -w.defineProperty(G,{GA:"mouseDrop"},function(){return null!==this.ha?this.ha.Si:null},function(a){ro(this);var b=this.ha.Si;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDrop"),this.ha.Si=a,this.h("mouseDrop",b,a))});w.defineProperty(G,{ZD:"actionDown"},function(){return null!==this.ha?this.ha.Cq:null},function(a){ro(this);var b=this.ha.Cq;b!==a&&(null!==a&&w.j(a,"function",G,"actionDown"),this.ha.Cq=a,this.h("actionDown",b,a))}); -w.defineProperty(G,{$D:"actionMove"},function(){return null!==this.ha?this.ha.Dq:null},function(a){ro(this);var b=this.ha.Dq;b!==a&&(null!==a&&w.j(a,"function",G,"actionMove"),this.ha.Dq=a,this.h("actionMove",b,a))});w.defineProperty(G,{aE:"actionUp"},function(){return null!==this.ha?this.ha.Eq:null},function(a){ro(this);var b=this.ha.Eq;b!==a&&(null!==a&&w.j(a,"function",G,"actionUp"),this.ha.Eq=a,this.h("actionUp",b,a))}); -w.defineProperty(G,{YD:"actionCancel"},function(){return null!==this.ha?this.ha.Bq:null},function(a){ro(this);var b=this.ha.Bq;b!==a&&(null!==a&&w.j(a,"function",G,"actionCancel"),this.ha.Bq=a,this.h("actionCancel",b,a))});w.defineProperty(G,{nB:"toolTip"},function(){return null!==this.ha?this.ha.dj:null},function(a){ro(this);var b=this.ha.dj;b!==a&&(this.ha.dj=a,this.h("toolTip",b,a))}); -w.defineProperty(G,{contextMenu:"contextMenu"},function(){return null!==this.ha?this.ha.zi:null},function(a){ro(this);var b=this.ha.zi;b!==a&&(this.ha.zi=a,this.h("contextMenu",b,a))});G.prototype.bind=G.prototype.bind=function(a){a.Bg=this;var b=this.Pl();null!==b&&Yo(b)&&w.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.sc&&(this.sc=new I(Vg));this.sc.add(a)}; -G.prototype.findTemplateBinder=G.prototype.Pl=function(){for(var a=this instanceof C?this:this.O;null!==a;){if(null!==a.Wk)return a;a=a.O}return null};G.prototype.setProperties=function(a){w.Fu(this,a)};var Zo; -G.make=Zo=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var f=$o.ka(a);"function"===typeof f?(c=w.Hl(arguments),d=f(c),w.Qa(d)||w.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=da[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||w.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);f=1;if(d instanceof D&&1e)&&w.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.ve=!0, -a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&w.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.ve=!1,a.index=e);e=new sa;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);w.Fu(a,e)}else w.Fu(a,b);else w.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var $o=new ka("string","function"); -G.getBuilders=function(){var a=new ka("string","function"),b;for(b in $o)if(b!==b.toLowerCase()){var c=$o[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};var bp;G.defineBuilder=bp=function(a,b){w.j(a,"string",G,"defineBuilder:name");w.j(b,"function",G,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||w.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);$o.add(a,b)};var cp; -G.takeBuilderArgument=cp=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b}; -bp("Button",function(){var a=new ga(lg);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new ga(lg);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=Zo(C,Bl,{sx:!0,CE:function(a,b){var e=a.sd("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},Zo(X,{name:"ButtonBorder",Cb:"Rectangle",A:new L(0,0,2.761423749153968,2.761423749153968), -B:new L(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.nu=function(a,b){if(b.au()){var e=b.sd("ButtonBorder");if(e instanceof X){var f=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=f;f=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=f}}};a.ou=function(a,b){if(b.au()){var e=b.sd("ButtonBorder");e instanceof X&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a}); -bp("TreeExpanderButton",function(){var a=Zo("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Zo(X,{name:"ButtonIcon",Cb:"MinusLine",Aa:yd},(new Vg("figure","isTreeExpanded",function(a,c){var d=c.O;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).Kx()),{visible:!1},(new Vg("visible","isTreeLeaf",function(a){return!a})).Kx());a.click=function(a,c){var d=c.U;d instanceof dh&&(d=d.Nf);if(d instanceof T){var e=d.g;if(null!==e){e=e.ob;if(d.gd){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return; +function Jo(a,b,c){var d=a.nc;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.$b&&(Lo(a,b,a.$b,!0,!0),a.$b instanceof ga&&a.$b.type===bd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Jg(a.$b)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Eb&&(Lo(a,b,a.Eb,!0,!1),a.Eb instanceof ga&&a.Eb.type===bd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Jg(a.Eb)):b.fillRect(d.x,d.y,d.width,d.height)),a.yk(b,c))}G.prototype.yk=function(){}; +function Lo(a,b,c,d,e){if(null!==c){var f=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===mg)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Ia,f=h.width,h=h.height;if(e)var l=a.W,f=l.width,h=l.height;var m=b instanceof Wc;if(m&&c.bh&&(c.type===Sn||c.so===f&&c.Fy===h))k=c.bh;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.W,f=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*f+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*f+c.end.offsetX;q=c.end.y*h+c.end.offsetY; +l+=r;p+=r;n+=s;q+=s;if(c.type===ng)k=b.createLinearGradient(l,n,p,q);else if(c.type===bd)s=isNaN(c.Ht)?Math.max(f,h)/2:c.Ht,isNaN(c.Ju)?(r=0,s=Math.max(f,h)/2):r=c.Ju,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===Sn)try{k=b.createPattern(c.pattern,"repeat")}catch(u){k=null}else w.yd(c.type,"Brush type");if(c.type!==Sn&&(e=c.uk,null!==e))for(e=e.i;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.bh=k,null!==k&&(c.so=f,c.Fy=h),null===k&&c.type===Sn&&-1!==c.so)){c.so=-1;var t=a.g;null!==t&& +-1===c.so&&w.setTimeout(function(){t.Rx()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}G.prototype.isContainedBy=G.prototype.Xl=function(a){if(a instanceof C)a:{if(this!==a&&null!==a)for(var b=this.O;null!==b;){if(b===a){a=!0;break a}b=b.O}a=!1}else a=!1;return a};G.prototype.isVisibleObject=G.prototype.xj=function(){if(!this.visible)return!1;var a=this.O;return null!==a?a.xj():!0}; +G.prototype.isEnabledObject=G.prototype.$t=function(){for(var a=this instanceof C?this:this.O;null!==a&&a.isEnabled;)a=a.O;return null===a};w.defineProperty(G,{FE:"enabledChanged"},function(){return null!==this.ha?this.ha.rr:null},function(a){so(this);var b=this.ha.rr;b!==a&&(null!==a&&w.j(a,"function",G,"enabledChanged"),this.ha.rr=a,this.h("enabledChanged",b,a))}); +function Ko(a){if(0!==(a.P&2048)===!0){var b=a.dd;b.reset();if(!a.nc.H()||!a.qd.H()){No(a,!1);return}b.translate(a.nc.x,a.nc.y);b.translate(-a.za.x,-a.za.y);var c=a.Ia;Ao(a,b,c.x,c.y,c.width,c.height);No(a,!1);Oo(a,!0)}0!==(a.P&4096)===!0&&(b=a.O,null===b?(a.om.set(a.dd),a.Do=a.scale,Oo(a,!1)):null!==b.ph&&(c=a.om,c.reset(),b.Yg()?c.multiply(b.om):null!==b.O&&c.multiply(b.O.om),c.multiply(a.dd),a.Do=a.scale*b.Do,Oo(a,!1)))} +function Ao(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=Gb;a.tj()&&a.Af.fd()&&(h=a.Af);var k=w.K();if(a instanceof S&&a.Yf!==a)for(c=a.Yf,d=c.Ia,k.Gu(d.x,d.y,d.width,d.height,h),c.Qi.nb(k),k.offset(-c.za.x,-c.za.y),h=c.O;null!==h&&h!==a;)h.Qi.nb(k),k.offset(-h.za.x,-h.za.y),h=h.O;else k.Gu(c,d,e,f,h);b.rotate(a.angle,k.x,k.y);w.v(k)}}g=G.prototype;g.I=function(a){void 0===a&&(a=!1);if(!0!==hm(this)){$l(this,!0);Do(this,!0);var b=this.O;null===b||a||b.I()}}; +g.aq=function(){!0!==hm(this)&&($l(this,!0),Do(this,!0))};function Po(a){if(!1===Bm(a)){var b=a.O;null!==b?b.I():a.tj()&&(b=a.g,null!==b&&(b.sg.add(a),a instanceof T&&a.Uf(),b.Le()));Do(a,!0)}}g.Ii=function(){0!==(this.P&2048)===!1&&(No(this,!0),Oo(this,!0))};g.wA=function(){Oo(this,!0)};g.na=function(){var a=this.U;null!==a&&a.na()}; +function Co(a,b){var c=a.stretch,d=a.O;if(null!==d&&d.ma===Qo)return Ro(a,d.be(a.Zb),d.ae(a.column),b);if(null!==d&&d.ma===El&&d.Jd()===a)return So(a,De,b);if(c===mo){if(null!==d){if(d.ma===Lj&&d.Jd()===a)return So(a,De,b);c=d.Zd;return c===mo?So(a,Nj,b):So(a,c,b)}return So(a,Nj,b)}return So(a,c,b)} +function Ro(a,b,c,d){var e=a.stretch;if(e!==mo)return So(a,e,d);var f=e=null;switch(b.stretch){case no:f=!0;break;case De:f=!0}switch(c.stretch){case oo:e=!0;break;case De:e=!0}b=a.O.Zd;null===e&&(e=b===oo||b===De);null===f&&(f=b===no||b===De);return!0===e&&!0===f?So(a,De,d):!0===e?So(a,oo,d):!0===f?So(a,no,d):So(a,Nj,d)} +function So(a,b,c){if(c)return b;if(b===Nj)return Nj;c=a.Ba;if(c.H())return Nj;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===oo)return Nj;if(b===De)return no}else{if(b===no)return Nj;if(b===De)return oo}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===no)return Nj;if(b===De)return oo}else{if(b===oo)return Nj;if(b===De)return no}return b} +w.defineProperty(G,{qq:"segmentOrientation"},function(){return this.Ym},function(a){var b=this.Ym;b!==a&&(this.Ym=a,this.I(),this.h("segmentOrientation",b,a),a===kj&&(this.angle=0))});w.defineProperty(G,{Me:"segmentIndex"},function(){return this.Rs},function(a){a=Math.round(a);var b=this.Rs;b!==a&&(this.Rs=a,this.I(),this.h("segmentIndex",b,a))}); +w.defineProperty(G,{aB:"segmentFraction"},function(){return this.Wm},function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&w.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.tb=a,this.Ii(),this.I(),this.h("scale",b,a))});w.defineProperty(G,{angle:"angle"},function(){return this.ig},function(a){var b=this.ig;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.ig=a,this.I(),this.Ii(),this.h("angle",b,a)))}); +w.defineProperty(G,{Ba:"desiredSize"},function(){return this.Re},function(a){var b=a.width,c=a.height,d=this.Re,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Re=a=a.S(),this.I(),this instanceof X&&this.Ke(),this.h("desiredSize",d,a),xo(this)&&(a=this.U,null!==a&&(yo(this,a,"width"),yo(this,a,"height"))))}); +w.defineProperty(G,{width:"width"},function(){return this.Re.width},function(a){var b=this.Re.width;b===a||isNaN(b)&&isNaN(a)||(b=this.Re,this.Re=a=(new ha(a,this.Re.height)).freeze(),this.I(),this instanceof X&&this.Ke(),this.h("desiredSize",b,a),xo(this)&&(a=this.U,null!==a&&yo(this,a,"width")))}); +w.defineProperty(G,{height:"height"},function(){return this.Re.height},function(a){var b=this.Re.height;b===a||isNaN(b)&&isNaN(a)||(b=this.Re,this.Re=a=(new ha(this.Re.width,a)).freeze(),this.I(),this instanceof X&&this.Ke(),this.h("desiredSize",b,a),xo(this)&&(a=this.U,null!==a&&yo(this,a,"height")))}); +w.defineProperty(G,{zh:"minSize"},function(){return this.Vh},function(a){var b=this.Vh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Vh=a,this.I(),this.h("minSize",b,a))});w.defineProperty(G,{Bf:"maxSize"},function(){return this.Uh},function(a){var b=this.Uh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Uh=a,this.I(),this.h("maxSize",b,a))});w.u(G,{za:"measuredBounds"},function(){return this.qd}); +w.u(G,{Ia:"naturalBounds"},function(){return this.Tc},{configurable:!0});w.defineProperty(G,{margin:"margin"},function(){return this.Lm},function(a){"number"===typeof a&&(a=new db(a));var b=this.Lm;b.L(a)||(this.Lm=a=a.S(),this.I(),this.h("margin",b,a))});w.u(G,{transform:null},function(){0!==(this.P&2048)===!0&&Ko(this);return this.dd});w.u(G,{ph:null},function(){0!==(this.P&4096)===!0&&Ko(this);return this.om}); +w.defineProperty(G,{alignment:"alignment"},function(){return this.ge},function(a){var b=this.ge;b.L(a)||(a.Od()&&!a.Vc()&&w.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.ge=a=a.S(),Po(this),this.h("alignment",b,a))});w.defineProperty(G,{column:"column"},function(){return this.Tq},function(a){a=Math.round(a);var b=this.Tq;b!==a&&(0>a&&w.Ea(a,">= 0",G,"column"),this.Tq=a,this.I(),this.h("column",b,a))}); +w.defineProperty(G,{tH:"columnSpan"},function(){return this.xi},function(a){a=Math.round(a);var b=this.xi;b!==a&&(1>a&&w.Ea(a,">= 1",G,"columnSpan"),this.xi=a,this.I(),this.h("columnSpan",b,a))});w.defineProperty(G,{Zb:"row"},function(){return this.Ns},function(a){a=Math.round(a);var b=this.Ns;b!==a&&(0>a&&w.Ea(a,">= 0",G,"row"),this.Ns=a,this.I(),this.h("row",b,a))}); +w.defineProperty(G,{rowSpan:"rowSpan"},function(){return this.aj},function(a){a=Math.round(a);var b=this.aj;b!==a&&(1>a&&w.Ea(a,">= 1",G,"rowSpan"),this.aj=a,this.I(),this.h("rowSpan",b,a))});w.defineProperty(G,{hy:"spanAllocation"},function(){return this.ct},function(a){var b=this.ct;b!==a&&(null!==a&&w.j(a,"function",G,"spanAllocation"),this.ct=a,this.I(),this.h("spanAllocation",b,a))}); +w.defineProperty(G,{oh:"alignmentFocus"},function(){return this.nm},function(a){var b=this.nm;b.L(a)||(!a.Od()||a.Vc()||a.L(tb)&&this instanceof T||w.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.nm=a=a.S(),this.I(),this.h("alignmentFocus",b,a))}); +w.defineProperty(G,{Qd:"portId"},function(){return this.As},function(a){var b=this.As;if(b!==a){var c=this.U;null===c||c instanceof T||(w.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&Vo(c,this);this.As=a;if(null!==a&&c){c.Dk=!0;null===c.le&&Wo(c);var d=this.Qd;null!==d&&c.le.add(d,this)}this.h("portId",b,a)}});function Xo(a){var b=a.U;if(b instanceof T&&(null!==a.Qd||a===b.port)){var c=b.g;null===c||c.oa.gb||Go(b,a)}} +function To(a){var b=a.g;null===b||b.oa.gb||(a instanceof C?a instanceof T?a.Uf():Yo(a,a,function(a){Xo(a)}):Xo(a))}w.defineProperty(G,{Bb:"toSpot"},function(){return null!==this.V?this.V.pk:tb},function(a){this.Ld();var b=this.V.pk;b.L(a)||(a=a.S(),this.V.pk=a,this.h("toSpot",b,a),Xo(this))}); +w.defineProperty(G,{jm:"toEndSegmentLength"},function(){return null!==this.V?this.V.nk:10},function(a){this.Ld();var b=this.V.nk;b!==a&&(0>a&&w.Ea(a,">= 0",G,"toEndSegmentLength"),this.V.nk=a,this.h("toEndSegmentLength",b,a),Xo(this))});w.defineProperty(G,{Ku:"toEndSegmentDirection"},function(){return null!==this.V?this.V.mk:vo},function(a){this.Ld();var b=this.V.mk;b!==a&&(w.Ft("GraphObject.toEndSegmentDirection","2.0"),this.V.mk=a,this.h("toEndSegmentDirection",b,a),Xo(this))}); +w.defineProperty(G,{Lu:"toShortLength"},function(){return null!==this.V?this.V.ok:0},function(a){this.Ld();var b=this.V.ok;b!==a&&(this.V.ok=a,this.h("toShortLength",b,a),Xo(this))});w.defineProperty(G,{pG:"toLinkable"},function(){return null!==this.V?this.V.kt:null},function(a){this.Ld();var b=this.V.kt;b!==a&&(this.V.kt=a,this.h("toLinkable",b,a))}); +w.defineProperty(G,{NJ:"toMaxLinks"},function(){return null!==this.V?this.V.lt:Infinity},function(a){this.Ld();var b=this.V.lt;b!==a&&(0>a&&w.Ea(a,">= 0",G,"toMaxLinks"),this.V.lt=a,this.h("toMaxLinks",b,a))});w.defineProperty(G,{Ab:"fromSpot"},function(){return null!==this.V?this.V.Sj:tb},function(a){this.Ld();var b=this.V.Sj;b.L(a)||(a=a.S(),this.V.Sj=a,this.h("fromSpot",b,a),Xo(this))}); +w.defineProperty(G,{Sl:"fromEndSegmentLength"},function(){return null!==this.V?this.V.Qj:10},function(a){this.Ld();var b=this.V.Qj;b!==a&&(0>a&&w.Ea(a,">= 0",G,"fromEndSegmentLength"),this.V.Qj=a,this.h("fromEndSegmentLength",b,a),Xo(this))});w.defineProperty(G,{Rt:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.Pj:vo},function(a){this.Ld();var b=this.V.Pj;b!==a&&(w.Ft("GraphObject.fromEndSegmentDirection","2.0"),this.V.Pj=a,this.h("fromEndSegmentDirection",b,a),Xo(this))}); +w.defineProperty(G,{St:"fromShortLength"},function(){return null!==this.V?this.V.Rj:0},function(a){this.Ld();var b=this.V.Rj;b!==a&&(this.V.Rj=a,this.h("fromShortLength",b,a),Xo(this))});w.defineProperty(G,{PE:"fromLinkable"},function(){return null!==this.V?this.V.ur:null},function(a){this.Ld();var b=this.V.ur;b!==a&&(this.V.ur=a,this.h("fromLinkable",b,a))}); +w.defineProperty(G,{lA:"fromMaxLinks"},function(){return null!==this.V?this.V.vr:Infinity},function(a){this.Ld();var b=this.V.vr;b!==a&&(0>a&&w.Ea(a,">= 0",G,"fromMaxLinks"),this.V.vr=a,this.h("fromMaxLinks",b,a))});w.defineProperty(G,{cursor:"cursor"},function(){return this.br},function(a){var b=this.br;b!==a&&(w.j(a,"string",G,"cursor"),this.br=a,this.h("cursor",b,a))}); +w.defineProperty(G,{click:"click"},function(){return null!==this.ha?this.ha.wi:null},function(a){so(this);var b=this.ha.wi;b!==a&&(null!==a&&w.j(a,"function",G,"click"),this.ha.wi=a,this.h("click",b,a))});w.defineProperty(G,{Gt:"doubleClick"},function(){return null!==this.ha?this.ha.Ei:null},function(a){so(this);var b=this.ha.Ei;b!==a&&(null!==a&&w.j(a,"function",G,"doubleClick"),this.ha.Ei=a,this.h("doubleClick",b,a))}); +w.defineProperty(G,{Wz:"contextClick"},function(){return null!==this.ha?this.ha.yi:null},function(a){so(this);var b=this.ha.yi;b!==a&&(null!==a&&w.j(a,"function",G,"contextClick"),this.ha.yi=a,this.h("contextClick",b,a))});w.defineProperty(G,{mu:"mouseEnter"},function(){return null!==this.ha?this.ha.ks:null},function(a){so(this);var b=this.ha.ks;b!==a&&(null!==a&&w.j(a,"function",G,"mouseEnter"),this.ha.ks=a,this.h("mouseEnter",b,a))}); +w.defineProperty(G,{nu:"mouseLeave"},function(){return null!==this.ha?this.ha.ls:null},function(a){so(this);var b=this.ha.ls;b!==a&&(null!==a&&w.j(a,"function",G,"mouseLeave"),this.ha.ls=a,this.h("mouseLeave",b,a))});w.defineProperty(G,{NA:"mouseOver"},function(){return null!==this.ha?this.ha.Vi:null},function(a){so(this);var b=this.ha.Vi;b!==a&&(null!==a&&w.j(a,"function",G,"mouseOver"),this.ha.Vi=a,this.h("mouseOver",b,a))}); +w.defineProperty(G,{MA:"mouseHover"},function(){return null!==this.ha?this.ha.Ui:null},function(a){so(this);var b=this.ha.Ui;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHover"),this.ha.Ui=a,this.h("mouseHover",b,a))});w.defineProperty(G,{LA:"mouseHold"},function(){return null!==this.ha?this.ha.Ti:null},function(a){so(this);var b=this.ha.Ti;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHold"),this.ha.Ti=a,this.h("mouseHold",b,a))}); +w.defineProperty(G,{WI:"mouseDragEnter"},function(){return null!==this.ha?this.ha.hs:null},function(a){so(this);var b=this.ha.hs;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragEnter"),this.ha.hs=a,this.h("mouseDragEnter",b,a))});w.defineProperty(G,{XI:"mouseDragLeave"},function(){return null!==this.ha?this.ha.js:null},function(a){so(this);var b=this.ha.js;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragLeave"),this.ha.js=a,this.h("mouseDragLeave",b,a))}); +w.defineProperty(G,{KA:"mouseDrop"},function(){return null!==this.ha?this.ha.Si:null},function(a){so(this);var b=this.ha.Si;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDrop"),this.ha.Si=a,this.h("mouseDrop",b,a))});w.defineProperty(G,{bE:"actionDown"},function(){return null!==this.ha?this.ha.Bq:null},function(a){so(this);var b=this.ha.Bq;b!==a&&(null!==a&&w.j(a,"function",G,"actionDown"),this.ha.Bq=a,this.h("actionDown",b,a))}); +w.defineProperty(G,{cE:"actionMove"},function(){return null!==this.ha?this.ha.Cq:null},function(a){so(this);var b=this.ha.Cq;b!==a&&(null!==a&&w.j(a,"function",G,"actionMove"),this.ha.Cq=a,this.h("actionMove",b,a))});w.defineProperty(G,{dE:"actionUp"},function(){return null!==this.ha?this.ha.Dq:null},function(a){so(this);var b=this.ha.Dq;b!==a&&(null!==a&&w.j(a,"function",G,"actionUp"),this.ha.Dq=a,this.h("actionUp",b,a))}); +w.defineProperty(G,{aE:"actionCancel"},function(){return null!==this.ha?this.ha.Aq:null},function(a){so(this);var b=this.ha.Aq;b!==a&&(null!==a&&w.j(a,"function",G,"actionCancel"),this.ha.Aq=a,this.h("actionCancel",b,a))});w.defineProperty(G,{rB:"toolTip"},function(){return null!==this.ha?this.ha.dj:null},function(a){so(this);var b=this.ha.dj;b!==a&&(this.ha.dj=a,this.h("toolTip",b,a))}); +w.defineProperty(G,{contextMenu:"contextMenu"},function(){return null!==this.ha?this.ha.zi:null},function(a){so(this);var b=this.ha.zi;b!==a&&(this.ha.zi=a,this.h("contextMenu",b,a))});G.prototype.bind=G.prototype.bind=function(a){a.Dg=this;var b=this.Ql();null!==b&&Zo(b)&&w.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.tc&&(this.tc=new I(Zg));this.tc.add(a)}; +G.prototype.findTemplateBinder=G.prototype.Ql=function(){for(var a=this instanceof C?this:this.O;null!==a;){if(null!==a.Yk)return a;a=a.O}return null};G.prototype.setProperties=function(a){w.Eu(this,a)};var $o; +G.make=$o=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var f=ap.ja(a);"function"===typeof f?(c=w.Il(arguments),d=f(c),w.Qa(d)||w.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=da[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||w.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);f=1;if(d instanceof D&&1e)&&w.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.ve=!0, +a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&w.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.ve=!1,a.index=e);e=new sa;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);w.Eu(a,e)}else w.Eu(a,b);else w.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var ap=new ka("string","function"); +G.getBuilders=function(){var a=new ka("string","function"),b;for(b in ap)if(b!==b.toLowerCase()){var c=ap.ja(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};var cp;G.defineBuilder=cp=function(a,b){w.j(a,"string",G,"defineBuilder:name");w.j(b,"function",G,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||w.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);ap.add(a,b)};var dp; +G.takeBuilderArgument=dp=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b}; +cp("Button",function(){var a=new ga(ng);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new ga(ng);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=$o(C,El,{qx:!0,FE:function(a,b){var e=a.ud("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},$o(X,{name:"ButtonBorder",Cb:"Rectangle",A:new L(0,0,2.761423749153968,2.761423749153968), +B:new L(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.mu=function(a,b){if(b.$t()){var e=b.ud("ButtonBorder");if(e instanceof X){var f=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=f;f=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=f}}};a.nu=function(a,b){if(b.$t()){var e=b.ud("ButtonBorder");e instanceof X&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a}); +cp("TreeExpanderButton",function(){var a=$o("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},$o(X,{name:"ButtonIcon",Cb:"MinusLine",Ba:yd},(new Zg("figure","isTreeExpanded",function(a,c){var d=c.O;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).Jx()),{visible:!1},(new Zg("visible","isTreeLeaf",function(a){return!a})).Jx());a.click=function(a,c){var d=c.U;d instanceof hh&&(d=d.Of);if(d instanceof T){var e=d.g;if(null!==e){e=e.ob;if(d.gd){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return; a.Ac=!0;d.gd?e.collapseTree(d):e.expandTree(d)}}};return a}); -bp("SubGraphExpanderButton",function(){var a=Zo("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Zo(X,{name:"ButtonIcon",Cb:"MinusLine",Aa:yd},(new Vg("figure","isSubGraphExpanded",function(a,c){var d=c.O;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).Kx()));a.click=function(a,c){var d=c.U;d instanceof dh&&(d=d.Nf);if(d instanceof U){var e=d.g;if(null!==e){e=e.ob;if(d.we){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Ac= -!0;d.we?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});bp("ContextMenuButton",function(){var a=Zo("Button");a.stretch=no;var b=a.sd("ButtonBorder");b instanceof X&&(b.Cb="Rectangle",b.A=new L(0,0,2,3),b.B=new L(1,1,-2,-2));return a}); -bp("PanelExpanderButton",function(a){var b=cp(a,"COLLAPSIBLE"),c=Zo("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},Zo(X,"TriangleUp",{name:"ButtonIcon",Aa:new ha(6,4)},(new Vg("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Kx(b)));a=c.sd("ButtonBorder");a instanceof X&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var f=c.g;if(null!==f&&!f.cb){var h=c.Pl();null===h&&(h=c.U);null!==h&&(h=h.sd(b),null!==h&& -(f.Tb("Collapse/Expand Panel"),h.visible=!h.visible,f.Fd("Collapse/Expand Panel")))}};return c}); -bp("CheckBoxButton",function(a){var b=cp(a);a=Zo("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},Zo(X,{name:"ButtonIcon",SH:"M0 4 L3 9 9 0",kb:2,stretch:Ie,kA:Kj,visible:!1},""!==b?(new Vg("visible",b)).HI():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.cb||""!==b&&e.ba.cb)){a.Ac=!0;var f=d.sd("ButtonIcon");e.Tb("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.Fd("checkbox")}};return a}); -bp("CheckBox",function(a){a=cp(a);a=Zo("CheckBoxButton",a,{name:"Button",margin:new eb(0,1,0,0)});var b=Zo(C,"Horizontal",a,{sx:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,nu:a.nu,ou:a.ou,click:a.click,_buttonClick:a.click});a.nu=null;a.ou=null;a.click=null;return b}); -function so(){this.sr=this.zi=this.dj=this.Bq=this.Eq=this.Dq=this.Cq=this.Si=this.ks=this.js=this.Ti=this.Ui=this.Vi=this.ms=this.ls=this.yi=this.Ei=this.wi=null}so.prototype.copy=function(){var a=new so;a.wi=this.wi;a.Ei=this.Ei;a.yi=this.yi;a.ls=this.ls;a.ms=this.ms;a.Vi=this.Vi;a.Ui=this.Ui;a.Ti=this.Ti;a.js=this.js;a.ks=this.ks;a.Si=this.Si;a.Cq=this.Cq;a.Dq=this.Dq;a.Eq=this.Eq;a.Bq=this.Bq;a.dj=this.dj;a.zi=this.zi;a.sr=this.sr;return a}; -function C(a){G.call(this);void 0===a?this.ma=Nj:(w.mb(a,C,C,"type"),this.ma=a);this.wa=new I(G);this.ff=dd;this.ma===El&&(this.En=!0);this.gr=oc;this.Ci=lo;this.ma===Po&&dp(this);this.Cp=Kj;this.Er=Ad;this.Fr=bd;this.Br=0;this.Ar=100;this.Dr=10;this.Cr=0;this.Wk=this.Vd=this.Sj=this.xm=this.zm=null;this.Rr=NaN;this.sg=this.Zj=null;this.To="category";this.rg=null;this.fj=new A(NaN,NaN,NaN,NaN);this.kk=this.Os=this.dn=null;this.Hj=""}w.La(C,G);w.ji(C);w.fa("Panel",C); -function dp(a){a.Lj=dd;a.Mh=1;a.Bi=null;a.um=null;a.Lh=1;a.Kh=null;a.tm=null;a.Yd=[];a.Td=[];a.Vm=ep;a.sm=ep;a.ej=0;a.Ni=0} -C.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.ma=this.ma;a.ff=this.ff.S();a.gr=this.gr.S();a.Ci=this.Ci;if(a.ma===Po){a.Lj=this.Lj.S();a.Mh=this.Mh;a.Bi=this.Bi;a.um=this.um;a.Lh=this.Lh;a.Kh=this.Kh;a.tm=this.tm;var b=[];if(0a&&w.Ea(a,">= 0",C,"padding"),a=new eb(a)):(w.G(a,eb,C,"padding"),0>a.left&&w.Ea(a.left,">= 0",C,"padding:value.left"),0>a.right&&w.Ea(a.right,">= 0",C,"padding:value.right"),0>a.top&&w.Ea(a.top,">= 0",C,"padding:value.top"),0>a.bottom&&w.Ea(a.bottom,">= 0",C,"padding:value.bottom"));var b=this.ff;b.L(a)||(this.ff=a=a.S(),this.I(),this.h("padding",b,a))}); -w.defineProperty(C,{Ll:"defaultAlignment"},function(){return this.gr},function(a){var b=this.gr;b.L(a)||(this.gr=a=a.S(),this.I(),this.h("defaultAlignment",b,a))});w.defineProperty(C,{Zd:"defaultStretch"},function(){return this.Ci},function(a){var b=this.Ci;b!==a&&(w.mb(a,G,C,"defaultStretch"),this.Ci=a,this.I(),this.h("defaultStretch",b,a))}); -w.defineProperty(C,{IK:"defaultSeparatorPadding"},function(){return void 0===this.Lj?dd:this.Lj},function(a){if(void 0!==this.Lj){"number"===typeof a&&(a=new eb(a));var b=this.Lj;b.L(a)||(this.Lj=a=a.S(),this.I(),this.h("defaultSeparatorPadding",b,a))}}); -w.defineProperty(C,{GK:"defaultRowSeparatorStroke"},function(){return void 0===this.Bi?null:this.Bi},function(a){var b=this.Bi;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.Bi=a,this.na(),this.h("defaultRowSeparatorStroke",b,a))}); -w.defineProperty(C,{HK:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.Mh?1:this.Mh},function(a){if(void 0!==this.Mh){var b=this.Mh;b!==a&&isFinite(a)&&0<=a&&(this.Mh=a,this.I(),this.h("defaultRowSeparatorStrokeWidth",b,a))}}); -w.defineProperty(C,{FK:"defaultRowSeparatorDashArray"},function(){return void 0===this.um?null:this.um},function(a){if(void 0!==this.um){var b=this.um;if(b!==a){null===a||Array.isArray(a)||w.wd(a,"Array",C,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e=c&&(c=1);var d=this.px,e=d.width,d=d.height,f=this.Ia,h=f.width,f=f.height,k=Math.ceil(h/e),l=Math.ceil(f/d),m=this.VE;a.save();a.beginPath();a.rect(0,0,h,f);a.clip();for(var n=[],p=this.wa.n,q=p.length,r=0;r -e*u*c))){var s=n[r],t=!1,B=!0,y=v.jG;null!==y&&(t=!0,B=a.dA(y,v.sf));if("LineV"===v.Cb){a.lineWidth=v.kb;Ko(this,a,v.stroke,!1,!1);a.beginPath();for(var H=x=Math.floor(-m.x/e);H<=x+k;H++){var E=H*e+m.x;0<=E&&E=e&&(e=1);d=c.Y;h=this.wa.n;f=this.zm;k=h.length;for(l=0;lthis.oA*q.interval*e))for(r=q.za,u=q.kb*q.scale,s=q.oh,s.Nd()&&(s=wb),p=0;pf.height)continue}else if(l.position>f.width)continue;var m=l.tq;isNaN(m)&&(m=c?a.Mh:a.Lh);var n=l.sq;null===n&&(n=c?a.Bi:a.Kh);0!==m&&null!==n&&(Ko(a,b,n,!1,!1),b.beginPath(),n=l.position+m,c?n>f.height&&(m-=n-f.height):n>f.width&&(m-=n-f.width),l=l.position+m/2,b.lineWidth=m,n=a.padding,c?(l+=n.top,m=n.left,n=f.width-n.right,b.moveTo(m,l),b.lineTo(n,l)):(l+= +cp("SubGraphExpanderButton",function(){var a=$o("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},$o(X,{name:"ButtonIcon",Cb:"MinusLine",Ba:yd},(new Zg("figure","isSubGraphExpanded",function(a,c){var d=c.O;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).Jx()));a.click=function(a,c){var d=c.U;d instanceof hh&&(d=d.Of);if(d instanceof U){var e=d.g;if(null!==e){e=e.ob;if(d.we){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Ac= +!0;d.we?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});cp("ContextMenuButton",function(){var a=$o("Button");a.stretch=oo;var b=a.ud("ButtonBorder");b instanceof X&&(b.Cb="Rectangle",b.A=new L(0,0,2,3),b.B=new L(1,1,-2,-2));return a}); +cp("PanelExpanderButton",function(a){var b=dp(a,"COLLAPSIBLE"),c=$o("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},$o(X,"TriangleUp",{name:"ButtonIcon",Ba:new ha(6,4)},(new Zg("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Jx(b)));a=c.ud("ButtonBorder");a instanceof X&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var f=c.g;if(null!==f&&!f.eb){var h=c.Ql();null===h&&(h=c.U);null!==h&&(h=h.ud(b),null!==h&& +(f.Ub("Collapse/Expand Panel"),h.visible=!h.visible,f.Gd("Collapse/Expand Panel")))}};return c}); +cp("CheckBoxButton",function(a){var b=dp(a);a=$o("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},$o(X,{name:"ButtonIcon",VH:"M0 4 L3 9 9 0",kb:2,stretch:De,mA:Pj,visible:!1},""!==b?(new Zg("visible",b)).KI():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.eb||""!==b&&e.ba.eb)){a.Ac=!0;var f=d.ud("ButtonIcon");e.Ub("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.Gd("checkbox")}};return a}); +cp("CheckBox",function(a){a=dp(a);a=$o("CheckBoxButton",a,{name:"Button",margin:new db(0,1,0,0)});var b=$o(C,"Horizontal",a,{qx:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,mu:a.mu,nu:a.nu,click:a.click,_buttonClick:a.click});a.mu=null;a.nu=null;a.click=null;return b}); +function to(){this.rr=this.zi=this.dj=this.Aq=this.Dq=this.Cq=this.Bq=this.Si=this.js=this.hs=this.Ti=this.Ui=this.Vi=this.ls=this.ks=this.yi=this.Ei=this.wi=null}to.prototype.copy=function(){var a=new to;a.wi=this.wi;a.Ei=this.Ei;a.yi=this.yi;a.ks=this.ks;a.ls=this.ls;a.Vi=this.Vi;a.Ui=this.Ui;a.Ti=this.Ti;a.hs=this.hs;a.js=this.js;a.Si=this.Si;a.Bq=this.Bq;a.Cq=this.Cq;a.Dq=this.Dq;a.Aq=this.Aq;a.dj=this.dj;a.zi=this.zi;a.rr=this.rr;return a}; +function C(a){G.call(this);void 0===a?this.ma=Sj:(w.mb(a,C,C,"type"),this.ma=a);this.xa=new I(G);this.ff=fd;this.ma===Hl&&(this.Gn=!0);this.fr=rc;this.Ci=mo;this.ma===Qo&&ep(this);this.Dp=Pj;this.Dr=Ad;this.Er=dd;this.Ar=0;this.zr=100;this.Cr=10;this.Br=0;this.Yk=this.Vd=this.Tj=this.xm=this.zm=null;this.Qr=NaN;this.ug=this.$j=null;this.Vo="category";this.tg=null;this.fj=new A(NaN,NaN,NaN,NaN);this.lk=this.Os=this.dn=null;this.Ij=""}w.La(C,G);w.ji(C);w.fa("Panel",C); +function ep(a){a.Mj=fd;a.Mh=1;a.Bi=null;a.um=null;a.Lh=1;a.Kh=null;a.tm=null;a.Yd=[];a.Td=[];a.Vm=fp;a.sm=fp;a.ej=0;a.Ni=0} +C.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.ma=this.ma;a.ff=this.ff.S();a.fr=this.fr.S();a.Ci=this.Ci;if(a.ma===Qo){a.Mj=this.Mj.S();a.Mh=this.Mh;a.Bi=this.Bi;a.um=this.um;a.Lh=this.Lh;a.Kh=this.Kh;a.tm=this.tm;var b=[];if(0a&&w.Ea(a,">= 0",C,"padding"),a=new db(a)):(w.G(a,db,C,"padding"),0>a.left&&w.Ea(a.left,">= 0",C,"padding:value.left"),0>a.right&&w.Ea(a.right,">= 0",C,"padding:value.right"),0>a.top&&w.Ea(a.top,">= 0",C,"padding:value.top"),0>a.bottom&&w.Ea(a.bottom,">= 0",C,"padding:value.bottom"));var b=this.ff;b.L(a)||(this.ff=a=a.S(),this.I(),this.h("padding",b,a))}); +w.defineProperty(C,{Ml:"defaultAlignment"},function(){return this.fr},function(a){var b=this.fr;b.L(a)||(this.fr=a=a.S(),this.I(),this.h("defaultAlignment",b,a))});w.defineProperty(C,{Zd:"defaultStretch"},function(){return this.Ci},function(a){var b=this.Ci;b!==a&&(w.mb(a,G,C,"defaultStretch"),this.Ci=a,this.I(),this.h("defaultStretch",b,a))}); +w.defineProperty(C,{LK:"defaultSeparatorPadding"},function(){return void 0===this.Mj?fd:this.Mj},function(a){if(void 0!==this.Mj){"number"===typeof a&&(a=new db(a));var b=this.Mj;b.L(a)||(this.Mj=a=a.S(),this.I(),this.h("defaultSeparatorPadding",b,a))}}); +w.defineProperty(C,{JK:"defaultRowSeparatorStroke"},function(){return void 0===this.Bi?null:this.Bi},function(a){var b=this.Bi;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.Bi=a,this.na(),this.h("defaultRowSeparatorStroke",b,a))}); +w.defineProperty(C,{KK:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.Mh?1:this.Mh},function(a){if(void 0!==this.Mh){var b=this.Mh;b!==a&&isFinite(a)&&0<=a&&(this.Mh=a,this.I(),this.h("defaultRowSeparatorStrokeWidth",b,a))}}); +w.defineProperty(C,{IK:"defaultRowSeparatorDashArray"},function(){return void 0===this.um?null:this.um},function(a){if(void 0!==this.um){var b=this.um;if(b!==a){null===a||Array.isArray(a)||w.yd(a,"Array",C,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e=c&&(c=1);var d=this.ox,e=d.width,d=d.height,f=this.Ia,h=f.width,f=f.height,k=Math.ceil(h/e),l=Math.ceil(f/d),m=this.YE;a.save();a.beginPath();a.rect(0,0,h,f);a.clip();for(var n=[],p=this.xa.n,q=p.length,r=0;r +e*u*c))){var s=n[r],t=!1,B=!0,y=v.mG;null!==y&&(t=!0,B=a.fA(y,v.sf));if("LineV"===v.Cb){a.lineWidth=v.kb;Lo(this,a,v.stroke,!1,!1);a.beginPath();for(var H=x=Math.floor(-m.x/e);H<=x+k;H++){var E=H*e+m.x;0<=E&&E=e&&(e=1);d=c.W;h=this.xa.n;f=this.zm;k=h.length;for(l=0;lthis.qA*q.interval*e))for(r=q.za,u=q.kb*q.scale,s=q.oh,s.Od()&&(s=yb),p=0;pf.height)continue}else if(l.position>f.width)continue;var m=l.sq;isNaN(m)&&(m=c?a.Mh:a.Lh);var n=l.rq;null===n&&(n=c?a.Bi:a.Kh);0!==m&&null!==n&&(Lo(a,b,n,!1,!1),b.beginPath(),n=l.position+m,c?n>f.height&&(m-=n-f.height):n>f.width&&(m-=n-f.width),l=l.position+m/2,b.lineWidth=m,n=a.padding,c?(l+=n.top,m=n.left,n=f.width-n.right,b.moveTo(m,l),b.lineTo(n,l)):(l+= n.left,m=n.top,n=f.height-n.bottom,b.moveTo(l,m),b.lineTo(l,n)),b.stroke())}}} -function Fp(a,b,c,d,e){for(var f=d.length,h=a.Y,k=0;km)){var n=l.Xe(),p=l.tq;isNaN(p)&&(p=c?a.Mh:a.Lh);var q=l.sq;null===q&&(q=c?a.Bi:a.Kh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Ja;p+n>m&&(n=m-p);0>=n||(m=a.padding,Ko(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}} -function gp(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;dm&&e.set(s),w.v(s));w.v(n);f&&e.transform(h)}return c}; -g.I=function(a){G.prototype.I.call(this,a);if(this.ma===Bl||this.ma===aj)a=this.Hd(),null!==a&&a.I(!0);a=this.wa.n;for(var b=a.length,c=0;cId&&(Jd=Math.max(Id-Ld,0));var Bc=0===Z.Ja;Z.Ja+=Jd;Id=Math.max(Id-(Jd+(Bc?Ld:0)),0)}1!==aa.xi||Kc!==Ij&&Kc!==mo||(Z=this.ae(hc),Ld=Z.Xe(),Jd=Math.max(Rb-Z.Ja,0),Jd+Ld>Yc&&(Jd=Math.max(Yc-Ld,0)),Bc=0===Z.Ja,Z.Ja+=Jd,Yc=Math.max(Yc-(Jd+(Bc?Ld:0)),0));ei&&aa.bq()}}}w.va(cf);for(var ee=0,ud=0,Db=this.Lp,ma=0;ma=this.qq);nb++)Z=this.be(aa.Yb+nb),Hf.height+=Math.max(Z.xj,isNaN(Z.gf)?Z.mf:Math.min(Z.gf,Z.mf));for(nb=1;nb=this.Lp);nb++)Z=this.ae(aa.column+nb),Hf.width+=Math.max(Z.xj,isNaN(Z.gf)?Z.mf:Math.min(Z.gf,Z.mf));Va.width+=Hf.width;Va.height+= -Hf.height;tc=aa.margin;xe=tc.right+tc.left;td=tc.top+tc.bottom;rk(aa,Va.width,Va.height,kj,lj);for(var Gf=aa.za,Rb=Math.max(Gf.width+xe,0),Kd=Math.max(Gf.height+td,0),gf=0,nb=0;nb=this.qq);nb++)Z=this.be(aa.Yb+nb),gf+=Z.total||0;if(gf=hd)&&!(aa.Yb+nb>=this.qq);nb++){var Z=this.be(aa.Yb+nb),Cc=Z.Sa||0,hi=hf(aa,Z,Cg);Z.Ja=Math.min(Z.mf,Cc+hi);Z.Sa!==Cc&&(hd-=Z.Sa-Cc)}for(;0Cc&&(Z.Ja=Math.min(Z.mf,Cc+hd),Z.Sa!==Cc&&(hd-=Z.Sa-Cc));if(0===Z.index)break;Z=this.be(Z.index-1)}}for(var Re=0,nb=0;nb=this.Lp);nb++)Z=this.ae(aa.column+nb),Re+=Z.total||0;if(Re=hd)&&!(aa.column+nb>=this.Lp);nb++)Z=this.ae(aa.column+nb),Cc=Z.Sa||0,hi=hf(aa,Z,Cg),Z.Ja=Math.min(Z.mf,Cc+hi),Z.Sa!==Cc&&(hd-=Z.Sa-Cc);for(;0Cc&&(Z.Ja=Math.min(Z.mf,Cc+hd),Z.Sa!==Cc&& -(hd-=Z.Sa-Cc));if(0===Z.index)break;Z=this.ae(Z.index-1)}}}w.va(Qe);w.zk(Hf);w.zk(Va);for(var Dg=0,Eg=0,Kc=Bo(this,!0),oj=this.Aa,Hk=this.Af,ye=ud=ee=0,Zc=0,Db=this.Lp,ma=0;maki)rk(Xb,Infinity,Infinity),ze=Xb.za,kf.Gh(ze),this.$g.add(ze);else{var vd=Xb.Me,rt=Xb.XA,ip=Xb.oh;ip.Nd()&&(ip=Fb);var fg=Xb.rq,bw=Xb.YA,Nk=0,Ok=0, -lm=0;if(vd<-ki||vd>=ki){var st=Lk.wF,If=Lk.vF;fg!==dj&&(lm=Lk.computeAngle(Xb,fg,If),Xb.gg=lm);Nk=st.x-Fg.x;Ok=st.y-Fg.y}else{var Od,lf;if(0<=vd)Od=vh.da(vd),lf=vdut+10?0<=vd?mi.yc(Od):Od.yc(mi):ut>tt+10?0<=vd?lf.yc(ni):ni.yc(lf):0<=vd?mi.yc(ni):ni.yc(mi)}else If= -0<=vd?Od.yc(lf):lf.yc(Od);fg!==dj&&(lm=Lk.computeAngle(Xb,fg,If),Xb.gg=lm);Nk=Od.x+(lf.x-Od.x)*rt-Fg.x;Ok=Od.y+(lf.y-Od.y)*rt-Fg.y}rk(Xb,Infinity,Infinity);var ze=Xb.za,jm=Xb.Ia,Pk=0;Xb instanceof X&&(Pk=Xb.kb);var oi=jm.width+Pk,qj=jm.height+Pk;Gg.reset();Gg.translate(-ze.x,-ze.y);Gg.scale(Xb.scale,Xb.scale);Gg.rotate(fg===dj?Xb.angle:If,oi/2,qj/2);fg!==Np&&fg!==Op||Gg.rotate(90,oi/2,qj/2);fg!==Pp&&fg!==Qp||Gg.rotate(-90,oi/2,qj/2);fg===Rp&&(45If||225If)&&Gg.rotate(-If,oi/2,qj/ -2);var vj=new A(0,0,oi,qj);Mk.Vn(vj,ip);Gg.nb(Mk);var cw=-Mk.x+Pk/2,dw=-Mk.y+Pk/2;Hg.assign(bw);isNaN(Hg.x)&&(Hg.x=0<=vd?oi/2+3:-(oi/2+3));isNaN(Hg.y)&&(Hg.y=-(qj/2+3));Hg.rotate(If);Nk+=Hg.x;Ok+=Hg.y;vj.set(ze);vj.x=Nk+cw;vj.y=Ok+dw;this.$g.add(vj);kf.Gh(vj)}}if(this instanceof W)for(var vt=this.Vf;vt.next();)rk(vt.value,Infinity,Infinity);this.fj=kf;var jp=this.Ri;jp.l(jp.x+kf.x,jp.y+kf.y);Pa(e,kf.width||0,kf.height||0);w.ue(Gg);w.v(Mk);w.v(Hg)}}}break;case "Grid":break;case "Graduated":var ew= -a,fw=b,gw=c,hw=d,Ig=this.Hd();this.xm=[];var wj=Ig.margin,iw=wj.right+wj.left,jw=wj.top+wj.bottom;rk(Ig,ew,fw,gw,hw);var wt=Ig.za,kw=wt.height,lw=Math.max(wt.width+iw,0),mw=Math.max(kw+jw,0),xt=new A(-wj.left,-wj.top,lw,mw);this.xm.push(xt);e.assign(xt);for(var Rk=Ig.vf,yt=Ig.kb,kp=Rk.gA,xj=Rk.lx,pi=Rk.hA,nw=kp.length,lp=0,mp=0,yj=w.lb(),np=0;np -wd&&(wd+=360);zt.push(wd)}lp=At;mp=Bt}yj.push(zt)}var Ct;if(null===this.Sj){for(var Dt=[],pp=this.wa.n,Et=pp.length,qp=0;qppw&&Ft.push(Gt)}}}this.Sj=Dt}Ct=this.Sj;var Ht=this.wa.n,qw=Ht.length,wh=0,It=0,Jt=pi;this.zm=[];for(var mm=[],nm=0;nmLt*Kt*pi/this.ox)){var fe=this.UE,Mt=Ct[nm],qi=xj[0][0],Jf=0,xd=0,It=pi*xh.TE-1E-4,Jt=pi*xh.RE+1E-4,Aj=Lt*Kt;if(fethis.Bk+Aj&&(ri=Math.floor((fe-this.Bk)/Aj),fe-=ri*Aj);for(;fe<=this.nA;){var sp;a:{for(var rw=Mt.length,tp=0;tppi&&(wh=pi),It<=wh&& -wh<=Jt)){for(var wd=yj[Jf][xd],Bj=xj[Jf][xd];Jfqi&&xdom?0tm;tm++){switch(tm){case 0:ge.l(qm,rm);break;case 1:ge.l(qm+yp,rm);break;case 2:ge.l(qm,rm+zp);break;case 3:ge.l(qm+yp,rm+zp)}ge.rotate(Ut+yh.angle);ge.offset(St,Tt);0===sm&&0===tm?ti.l(ge.x,ge.y,0,0):ti.ri(ge);ge.offset(-St,-Tt);ge.rotate(-Ut- -yh.angle)}w.v(ge);this.xm.push(ti);bb(uw,ti.x,ti.y,ti.width,ti.height)}else if(si instanceof Ch){var Uk=si,Vt=wp,xw=e;null===this.kk&&(this.kk=new Ch);var Kf=this.kk;Ep(Uk,Kf);var Bp=Uk.oh;Bp.Nd()&&(Bp=wb);for(var zh=Uk.rq,yw=Uk.YA,ui=null,um=0,vm=0,Jg=0,Cp=0,zw=Vt.length,wm=0;wmJg||225Jg)&&Kg.rotate(-Jg,Ej/2,Fj/2);var Wt=w.Vg(0,0,Ej,Fj),Vk=w.K();Vk.Vn(Wt,Bp);Kg.nb(Vk);var Aw=-Vk.x,Bw=-Vk.y,Lg=w.K();Lg.assign(yw);isNaN(Lg.x)&&(Lg.x=Ej/2+3);isNaN(Lg.y)&&(Lg.y=-(Fj/2+3));Lg.rotate(Jg);var um=um+(Lg.x+Aw),vm=vm+(Lg.y+Bw),Dp=new A(um,vm,Ah.width,Ah.height),Cw=new A(Ah.x,Ah.y,Ah.width,Ah.height), -Dw=new A(Dj.x,Dj.y,Dj.width,Dj.height),Xt=new Sp;Xt.Mp(Kf.Oi);hg.push(Cp);hg.push(Kf.je);hg.push(Xt);hg.push(Dp);hg.push(Cw);hg.push(Dw);0===wm?ui=Dp.copy():ui.Gh(Dp);w.v(Lg);w.v(Vk);w.Gb(Wt);w.ue(Kg)}this.xm.push(ui);bb(xw,ui.x,ui.y,ui.width,ui.height)}Xl(si,!1)}}break;case "TableRow":case "TableColumn":w.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:w.k("Unknown panel type: "+n)}}var mf=e.width,nf=e.height, -xm=this.padding,Ew=xm.top+xm.bottom,mf=mf+(xm.left+xm.right),nf=nf+Ew;isFinite(f.width)&&(mf=f.width);isFinite(f.height)&&(nf=f.height);mf=Math.min(k.width,mf);nf=Math.min(k.height,nf);mf=Math.max(h.width,mf);nf=Math.max(h.height,nf);mf=Math.max(c,mf);nf=Math.max(d,nf);e.width=mf;e.height=nf;Pa(this.Sc,mf,nf);yo(this,0,0,mf,nf)}; -C.prototype.findMainElement=C.prototype.Hd=function(){if(null===this.dn){var a=this.wa.n,b=a.length;if(0===b)return null;for(var c=0;cc||p>d)this.I(),rk(this,n>c?c:n,p>d?d:p);break;case Ie:this.I(!0);rk(this,c+r,d+s,0,0);break;case no:this.I(!0);rk(this,c+r,p+s,0,0);break;case mo:this.I(!0),rk(this,n+r,d+s,0,0)}}k=this.Y;k.x=a;k.y=b; -k.width=c;k.height=d;var u=this.ma.Qb;switch(u){case "Position":for(var t=f.length,x=e.x-this.padding.left,v=e.y-this.padding.top,B=0;B=this.qq);Pe++){var ai=this.be(Ta+Pe);Oe.height+=ai.total}for(Pe=1;Pe=this.Lp);Pe++){var bi=this.ae(Hd+Pe);Oe.width+=bi.total}var kj=lh.Sa+Oe.width,lj=kh.Sa+Oe.height;h.x=Wb;h.y=Ac;h.width=kj;h.height=lj;var Db=Wb,nh=Ac,oh=kj,ma=lj;Wb+kj>e.width&&(oh=Math.max(e.width-Wb,0));Ac+lj>e.height&&(ma=Math.max(e.height-Ac,0));var aa=zb.alignment,de=0,cg=0,ci=0,hc=0;if(aa.Uc()){aa=this.Ll;aa.fd()||(aa=Fb);var de=aa.x,cg=aa.y,ci=aa.offsetX,hc=aa.offsetY,di=lh.alignment, -ic=kh.alignment;di.fd()&&(de=di.x,ci=di.offsetX);ic.fd()&&(cg=ic.y,hc=ic.offsetY)}else de=aa.x,cg=aa.y,ci=aa.offsetX,hc=aa.offsetY;if(isNaN(de)||isNaN(cg))cg=de=.5,hc=ci=0;var cf=ce.width,Qe=ce.height,df=zb.margin,ve=df.left+df.right,we=df.top+df.bottom,Yc=Qo(zb,kh,lh,!1);!isNaN(zb.Aa.width)||Yc!==Ie&&Yc!==no||(cf=Math.max(kj-ve,0));!isNaN(zb.Aa.height)||Yc!==Ie&&Yc!==mo||(Qe=Math.max(lj-we,0));var Id=zb.Af,ph=zb.zh,cf=Math.min(Id.width,cf),Qe=Math.min(Id.height,Qe),cf=Math.max(ph.width,cf),Qe=Math.max(ph.height, -Qe),Z=Qe+we;h.x+=h.width*de-(cf+ve)*de+ci+df.left;h.y+=h.height*cg-Z*cg+hc+df.top;zb.visible&&(db(Db,nh,oh,ma,h.x,h.y,ce.width,ce.height)?zb.gc(h.x,h.y,cf,Qe):zb.gc(h.x,h.y,cf,Qe,new A(Db,nh,oh,ma)))}else{zb.Ii();zb.mc.Ra();var ef=zb.mc;ef.x=gd.type===Go?Ne:Wb;ef.y=gd.type===Ho?ec:Ac;ef.width=ce.width;ef.height=ce.height;zb.mc.freeze();Co(zb,!1)}}}}w.zk(Oe);for(Ta=0;Ta=Kd){var gi=this.wF,eg=this.vF;Bg!==dj&&(fi=this.computeAngle(Rb,Bg,eg),Rb.angle=fi);sh=gi.x;th=gi.y}else{var jc=void 0,Va=void 0;if(0<=Bc)jc=Ld.n[Bc],Va=Bcnb+10?0<=Bc?Nd.yc(jc):jc.yc(Nd):nb>Hf+10?0<=Bc?Va.yc(ff):ff.yc(Va):0<=Bc?Nd.yc(ff): -ff.yc(Nd)}else eg=0<=Bc?jc.yc(Va):Va.yc(jc);Bg!==dj&&(fi=this.computeAngle(Rb,Bg,eg),Rb.angle=fi);sh=jc.x+(Va.x-jc.x)*ee;th=jc.y+(Va.y-jc.y)*ee}if(ud.L(sb))Rb.location=new z(sh,th);else{ud.Nd()&&(ud=Fb);var gf=w.Ef();gf.reset();gf.scale(Rb.scale,Rb.scale);gf.rotate(Rb.angle,0,0);var hd=Rb.Ia,Cg=w.Vg(0,0,hd.width,hd.height),hf=w.K();hf.Vn(Cg,ud);gf.nb(hf);var Cc=-hf.x,hi=-hf.y,Re=nj.copy();isNaN(Re.x)&&(Re.x=0<=Bc?hf.x+3:-(hf.x+3));isNaN(Re.y)&&(Re.y=-(hf.y+3));Re.rotate(eg);sh+=Re.x;th+=Re.y;gf.sG(Cg); -var Cc=Cc+Cg.x,hi=hi+Cg.y,Dg=w.xb(sh+Cc,th+hi);Rb.move(Dg);w.v(Dg);w.v(hf);w.Gb(Cg);w.ue(gf)}}this.lu(!1)}break;case "Grid":break;case "Graduated":if(null!==this.xm){var Eg=this.Hd(),oj=this.zm,Hk=this.xm,ye=0,Zc=Hk[ye];ye++;Eg.gc(Zc.x-e.x,Zc.y-e.y,Zc.width,Zc.height);for(var Ik=f.length,uh=0;uhm)){var n=l.Xe(),p=l.sq;isNaN(p)&&(p=c?a.Mh:a.Lh);var q=l.rq;null===q&&(q=c?a.Bi:a.Kh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Ja;p+n>m&&(n=m-p);0>=n||(m=a.padding,Lo(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}} +function hp(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;dm&&e.set(s),w.v(s));w.v(n);f&&e.transform(h)}return c}; +g.I=function(a){G.prototype.I.call(this,a);if(this.ma===El||this.ma===hj)a=this.Jd(),null!==a&&a.I(!0);a=this.xa.n;for(var b=a.length,c=0;cId&&(ad=Math.max(Id-lc,0));var fg=0===Z.Ja;Z.Ja+=ad;Id=Math.max(Id-(ad+(fg?lc:0)),0)}1!==aa.xi||kc!==Nj&&kc!==no||(Z=this.ae(ic),lc=Z.Xe(),ad=Math.max(bf-Z.Ja,0),ad+lc>$c&&(ad=Math.max($c-lc,0)),fg=0===Z.Ja,Z.Ja+=ad,$c=Math.max($c-(ad+(fg?lc:0)),0));li&&aa.aq()}}}w.wa(Ye);for(var Ec=0,wb=0,Eb=this.Kp,ma=0;ma=this.pq);Za++)Z=this.be(aa.Zb+Za),Jd.height+=Math.max(Z.zj,isNaN(Z.gf)?Z.mf:Math.min(Z.gf,Z.mf));for(Za=1;Za=this.Kp);Za++)Z=this.ae(aa.column+Za),Jd.width+=Math.max(Z.zj,isNaN(Z.gf)?Z.mf:Math.min(Z.gf,Z.mf));kb.width+=Jd.width;kb.height+= +Jd.height;wc=aa.margin;Ff=wc.right+wc.left;eg=wc.top+wc.bottom;wk(aa,kb.width,kb.height,qj,rj);for(var Gf=aa.za,bf=Math.max(Gf.width+Ff,0),cf=Math.max(Gf.height+eg,0),yh=0,Za=0;Za=this.pq);Za++)Z=this.be(aa.Zb+Za),yh+=Z.total||0;if(yh=jd)&&!(aa.Zb+Za>=this.pq);Za++){var Z=this.be(aa.Zb+Za),mc=Z.Sa||0,ef=tj(aa,Z,gg);Z.Ja=Math.min(Z.mf,mc+ef);Z.Sa!==mc&&(jd-=Z.Sa-mc)}for(;0mc&&(Z.Ja=Math.min(Z.mf,mc+jd),Z.Sa!==mc&&(jd-=Z.Sa-mc));if(0===Z.index)break;Z=this.be(Z.index-1)}}for(var Ig=0,Za=0;Za=this.Kp);Za++)Z=this.ae(aa.column+Za),Ig+=Z.total||0;if(Ig=jd)&&!(aa.column+Za>=this.Kp);Za++)Z=this.ae(aa.column+Za),mc=Z.Sa||0,ef=tj(aa,Z,gg),Z.Ja=Math.min(Z.mf,mc+ef),Z.Sa!==mc&&(jd-=Z.Sa-mc);for(;0mc&&(Z.Ja=Math.min(Z.mf,mc+jd),Z.Sa!==mc&& +(jd-=Z.Sa-mc));if(0===Z.index)break;Z=this.ae(Z.index-1)}}}w.wa(Le);w.Ak(Jd);w.Ak(kb);for(var hg=0,te=0,kc=Co(this,!0),ni=this.Ba,Lk=this.Bf,If=wb=Ec=0,ff=0,Eb=this.Kp,ma=0;maqi)wk(Yb,Infinity,Infinity),ue=Yb.za,hf.Gh(ue),this.$g.add(ue);else{var vd=Yb.Me,rt=Yb.aB,np=Yb.oh;np.Od()&&(np=Gb);var ig=Yb.qq,cw=Yb.bB,Qk=0,Rk=0, +om=0;if(vd<-qi||vd>=qi){var st=Ok.zF,Jf=Ok.yF;ig!==kj&&(om=Ok.computeAngle(Yb,ig,Jf),Yb.ig=om);Qk=st.x-Kg.x;Rk=st.y-Kg.y}else{var Ld,jf;if(0<=vd)Ld=Bh.da(vd),jf=vdut+10?0<=vd?si.Rb(Ld):Ld.Rb(si):ut>tt+10?0<=vd?jf.Rb(ti):ti.Rb(jf):0<=vd?si.Rb(ti):ti.Rb(si)}else Jf= +0<=vd?Ld.Rb(jf):jf.Rb(Ld);ig!==kj&&(om=Ok.computeAngle(Yb,ig,Jf),Yb.ig=om);Qk=Ld.x+(jf.x-Ld.x)*rt-Kg.x;Rk=Ld.y+(jf.y-Ld.y)*rt-Kg.y}wk(Yb,Infinity,Infinity);var ue=Yb.za,mm=Yb.Ia,Sk=0;Yb instanceof X&&(Sk=Yb.kb);var ui=mm.width+Sk,uj=mm.height+Sk;Lg.reset();Lg.translate(-ue.x,-ue.y);Lg.scale(Yb.scale,Yb.scale);Lg.rotate(ig===kj?Yb.angle:Jf,ui/2,uj/2);ig!==Pp&&ig!==Qp||Lg.rotate(90,ui/2,uj/2);ig!==Rp&&ig!==Sp||Lg.rotate(-90,ui/2,uj/2);ig===Tp&&(45Jf||225Jf)&&Lg.rotate(-Jf,ui/2,uj/ +2);var zj=new A(0,0,ui,uj);Pk.Xn(zj,np);Lg.nb(Pk);var dw=-Pk.x+Sk/2,ew=-Pk.y+Sk/2;Mg.assign(cw);isNaN(Mg.x)&&(Mg.x=0<=vd?ui/2+3:-(ui/2+3));isNaN(Mg.y)&&(Mg.y=-(uj/2+3));Mg.rotate(Jf);Qk+=Mg.x;Rk+=Mg.y;zj.set(ue);zj.x=Qk+dw;zj.y=Rk+ew;this.$g.add(zj);hf.Gh(zj)}}if(this instanceof W)for(var vt=this.Wf;vt.next();)wk(vt.value,Infinity,Infinity);this.fj=hf;var op=this.Ri;op.m(op.x+hf.x,op.y+hf.y);Pa(e,hf.width||0,hf.height||0);w.ue(Lg);w.v(Pk);w.v(Mg)}}}break;case "Grid":break;case "Graduated":var fw= +a,gw=b,hw=c,iw=d,Ng=this.Jd();this.xm=[];var Aj=Ng.margin,jw=Aj.right+Aj.left,kw=Aj.top+Aj.bottom;wk(Ng,fw,gw,hw,iw);var wt=Ng.za,lw=wt.height,mw=Math.max(wt.width+jw,0),nw=Math.max(lw+kw,0),xt=new A(-Aj.left,-Aj.top,mw,nw);this.xm.push(xt);e.assign(xt);for(var Uk=Ng.vf,yt=Ng.kb,pp=Uk.iA,Bj=Uk.kx,vi=Uk.jA,ow=pp.length,qp=0,rp=0,Cj=w.lb(),sp=0;sp +wd&&(wd+=360);zt.push(wd)}qp=At;rp=Bt}Cj.push(zt)}var Ct;if(null===this.Tj){for(var Dt=[],up=this.xa.n,Et=up.length,vp=0;vpqw&&Ft.push(Gt)}}}this.Tj=Dt}Ct=this.Tj;var Ht=this.xa.n,rw=Ht.length,Ch=0,It=0,Jt=vi;this.zm=[];for(var pm=[],qm=0;qmLt*Kt*vi/this.nx)){var be=this.XE,Mt=Ct[qm],wi=Bj[0][0],Kf=0,xd=0,It=vi*Dh.WE-1E-4,Jt=vi*Dh.UE+1E-4,Ej=Lt*Kt;if(bethis.Ck+Ej&&(xi=Math.floor((be-this.Ck)/Ej),be-=xi*Ej);for(;be<=this.pA;){var xp;a:{for(var sw=Mt.length,yp=0;ypvi&&(Ch=vi),It<=Ch&& +Ch<=Jt)){for(var wd=Cj[Kf][xd],Fj=Bj[Kf][xd];Kfwi&&xdrm?0wm;wm++){switch(wm){case 0:ce.m(tm,um);break;case 1:ce.m(tm+Dp,um);break;case 2:ce.m(tm,um+Ep);break;case 3:ce.m(tm+Dp,um+Ep)}ce.rotate(Ut+Eh.angle);ce.offset(St,Tt);0===vm&&0===wm?zi.m(ce.x,ce.y,0,0):zi.ri(ce);ce.offset(-St,-Tt);ce.rotate(-Ut- +Eh.angle)}w.v(ce);this.xm.push(zi);ab(vw,zi.x,zi.y,zi.width,zi.height)}else if(yi instanceof Hh){var Xk=yi,Vt=Bp,yw=e;null===this.lk&&(this.lk=new Hh);var Lf=this.lk;ip(Xk,Lf);var Gp=Xk.oh;Gp.Od()&&(Gp=yb);for(var Fh=Xk.qq,zw=Xk.bB,Ai=null,xm=0,ym=0,Og=0,Hp=0,Aw=Vt.length,zm=0;zmOg||225Og)&&Pg.rotate(-Og,Ij/2,Jj/2);var Wt=w.hg(0,0,Ij,Jj),Yk=w.K();Yk.Xn(Wt,Gp);Pg.nb(Yk);var Bw=-Yk.x,Cw=-Yk.y,Qg=w.K();Qg.assign(zw);isNaN(Qg.x)&&(Qg.x=Ij/2+3);isNaN(Qg.y)&&(Qg.y=-(Jj/2+3));Qg.rotate(Og);var xm=xm+(Qg.x+Bw),ym=ym+(Qg.y+Cw),Ip=new A(xm,ym,Gh.width,Gh.height),Dw=new A(Gh.x,Gh.y,Gh.width,Gh.height), +Ew=new A(Hj.x,Hj.y,Hj.width,Hj.height),Xt=new Up;Xt.Lp(Lf.Oi);kg.push(Hp);kg.push(Lf.je);kg.push(Xt);kg.push(Ip);kg.push(Dw);kg.push(Ew);0===zm?Ai=Ip.copy():Ai.Gh(Ip);w.v(Qg);w.v(Yk);w.Db(Wt);w.ue(Pg)}this.xm.push(Ai);ab(yw,Ai.x,Ai.y,Ai.width,Ai.height)}$l(yi,!1)}}break;case "TableRow":case "TableColumn":w.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:w.k("Unknown panel type: "+n)}}var kf=e.width,lf=e.height, +Am=this.padding,Fw=Am.top+Am.bottom,kf=kf+(Am.left+Am.right),lf=lf+Fw;isFinite(f.width)&&(kf=f.width);isFinite(f.height)&&(lf=f.height);kf=Math.min(k.width,kf);lf=Math.min(k.height,lf);kf=Math.max(h.width,kf);lf=Math.max(h.height,lf);kf=Math.max(c,kf);lf=Math.max(d,lf);e.width=kf;e.height=lf;Pa(this.Tc,kf,lf);zo(this,0,0,kf,lf)}; +C.prototype.findMainElement=C.prototype.Jd=function(){if(null===this.dn){var a=this.xa.n,b=a.length;if(0===b)return null;for(var c=0;cc||p>d)this.I(),wk(this,n>c?c:n,p>d?d:p);break;case De:this.I(!0);wk(this,c+r,d+s,0,0);break;case oo:this.I(!0);wk(this,c+r,p+s,0,0);break;case no:this.I(!0),wk(this,n+r,d+s,0,0)}}k=this.W;k.x=a;k.y=b; +k.width=c;k.height=d;var u=this.ma.Qb;switch(u){case "Position":for(var t=f.length,x=e.x-this.padding.left,v=e.y-this.padding.top,B=0;B=this.pq);Ke++){var gi=this.be(Ta+Ke);Je.height+=gi.total}for(Ke=1;Ke=this.Kp);Ke++){var hi=this.ae(Hd+Ke);Je.width+=hi.total}var qj=qh.Sa+Je.width,rj=ph.Sa+Je.height;h.x=Xb;h.y=Dc;h.width=qj;h.height=rj;var Eb=Xb,sh=Dc,th=qj,ma=rj;Xb+qj>e.width&&(th=Math.max(e.width-Xb,0));Dc+rj>e.height&&(ma=Math.max(e.height-Dc,0));var aa=pb.alignment,ae=0,dg=0,ii=0,ic=0;if(aa.Vc()){aa=this.Ml;aa.fd()||(aa=Gb);var ae=aa.x,dg=aa.y,ii=aa.offsetX,ic=aa.offsetY,ji=qh.alignment, +jc=ph.alignment;ji.fd()&&(ae=ji.x,ii=ji.offsetX);jc.fd()&&(dg=jc.y,ic=jc.offsetY)}else ae=aa.x,dg=aa.y,ii=aa.offsetX,ic=aa.offsetY;if(isNaN(ae)||isNaN(dg))dg=ae=.5,ic=ii=0;var Ye=$d.width,Le=$d.height,Ze=pb.margin,re=Ze.left+Ze.right,se=Ze.top+Ze.bottom,$c=Ro(pb,ph,qh,!1);!isNaN(pb.Ba.width)||$c!==De&&$c!==oo||(Ye=Math.max(qj-re,0));!isNaN(pb.Ba.height)||$c!==De&&$c!==no||(Le=Math.max(rj-se,0));var Id=pb.Bf,uh=pb.zh,Ye=Math.min(Id.width,Ye),Le=Math.min(Id.height,Le),Ye=Math.max(uh.width,Ye),Le=Math.max(uh.height, +Le),Z=Le+se;h.x+=h.width*ae-(Ye+re)*ae+ii+Ze.left;h.y+=h.height*dg-Z*dg+ic+Ze.top;pb.visible&&(cb(Eb,sh,th,ma,h.x,h.y,$d.width,$d.height)?pb.hc(h.x,h.y,Ye,Le):pb.hc(h.x,h.y,Ye,Le,new A(Eb,sh,th,ma)))}else{pb.Ii();pb.nc.Ra();var ud=pb.nc,vh=w.hg(ud.x,ud.y,ud.width,ud.height);ud.x=id.type===Ho?Ie:Xb;ud.y=id.type===Io?fc:Dc;ud.width=$d.width;ud.height=$d.height;pb.nc.freeze();Do(pb,!1);if(!Qa(vh,ud)){var ki=pb.U;null!==ki&&(ki.Ek(),pb.ss(ki))}w.Db(vh)}}}}w.Ak(Je);for(Ta=0;Ta=fg){var Hg=this.zF,kb=this.yF;sj!==kj&&(Gg=this.computeAngle(lc,sj,kb),lc.angle=Gg);Fg=Hg.x;Hf=Hg.y}else{var Sb=void 0,Fc=void 0;if(0<=wb)Sb=Ec.n[wb],Fc=wb +jd+10?0<=wb?Jd.Rb(Sb):Sb.Rb(Jd):jd>yh+10?0<=wb?Fc.Rb(Za):Za.Rb(Fc):0<=wb?Jd.Rb(Za):Za.Rb(Jd)}else kb=0<=wb?Sb.Rb(Fc):Fc.Rb(Sb);sj!==kj&&(Gg=this.computeAngle(lc,sj,kb),lc.angle=Gg);Fg=Sb.x+(Fc.x-Sb.x)*mi;Hf=Sb.y+(Fc.y-Sb.y)*mi}if(Eg.L(tb))lc.location=new z(Fg,Hf);else{Eg.Od()&&(Eg=Gb);var gg=w.Ff();gg.reset();gg.scale(lc.scale,lc.scale);gg.rotate(lc.angle,0,0);var tj=lc.Ia,mc=w.hg(0,0,tj.width,tj.height),ef=w.K();ef.Xn(mc,Eg);gg.nb(ef);var Ig=-ef.x,hg=-ef.y,te=lp.copy();isNaN(te.x)&&(te.x=0<=wb?ef.x+ +3:-(ef.x+3));isNaN(te.y)&&(te.y=-(ef.y+3));te.rotate(kb);Fg+=te.x;Hf+=te.y;gg.vG(mc);var Ig=Ig+mc.x,hg=hg+mc.y,ni=w.xb(Fg+Ig,Hf+hg);lc.move(ni);w.v(ni);w.v(ef);w.Db(mc);w.ue(gg)}}this.ku(!1)}break;case "Grid":break;case "Graduated":if(null!==this.xm){var Lk=this.Jd(),If=this.zm,ff=this.xm,zh=0,Me=ff[zh];zh++;Lk.hc(Me.x-e.x,Me.y-e.y,Me.width,Me.height);for(var Kd=f.length,Jg=0;Jgq.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof C?n:null;q=w.Ef();q.set(h);if(null!==n?n.yk(a,b,c,d,e,q):Ao(p,a,d, -q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);w.ue(q)}}}void 0===f&&w.ue(h);return d}void 0===f&&w.ue(h);return!1};function Xp(a,b,c,d){for(var e=a.wa.n,f=e.length;f--;){var h=e[f];if(h.visible){var k=h.Y,l=a.Ia;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof C&&Xp(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}} -g.un=function(a,b,c,d,e,f){if(!1===this.Sg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ia,k=this.Yg(),l=k?a:La(w.xb(a.x,a.y),this.transform),m=k?b:La(w.xb(b.x,b.y),this.transform),n=l.uf(m),p=0u.width||s.y>u.height||0>s.x+s.width||0>s.y+s.height||(r.Yg()?(s=r.transform,La(k.set(a),s),La(l.set(b),s)):(k.set(a),l.set(b)),s=r,r=r instanceof C?r:null,null!==r?!r.un(k,l,c,d,e,f):!s.JE(k,l,e))||(null!==c&&(s=c(s)),null===s||null!==d&&!d(s)||f.add(s))}}w.v(k);w.v(l)}return e? -p:h}return!1};function Ip(a){var b=null;a instanceof X&&(b=a.A,b===oc&&(b=null),a=a.vf,null!==a&&null===b&&(b=a.A));null===b&&(b=vb);return b}function Jp(a){var b=null;a instanceof X&&(b=a.B,b===oc&&(b=null),a=a.vf,null!==a&&null===b&&(b=a.B));null===b&&(b=Kb);return b}C.prototype.add=C.prototype.add=function(a){w.G(a,G,C,"add:element");this.Ld(this.wa.count,a)};C.prototype.elt=C.prototype.da=function(a){return this.wa.da(a)}; -C.prototype.insertAt=C.prototype.Ld=function(a,b){b instanceof S&&w.k("Cannot add a Part to a Panel: "+b);if(this===b||this.Xl(b))this===b&&w.k("Cannot make a Panel contain itself: "+this.toString()),w.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.O;null!==c&&c!==this&&w.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+ -this.toString());this.ma!==El||b instanceof X||w.k("Can only add Shapes to a Grid Panel, not: "+b);this.ma!==fp||b instanceof X||b instanceof Ch||w.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.em(this);b.Sm=null;if(null!==this.eq){var d=b.data;null!==d&&"object"===typeof d&&(null===this.rg&&(this.rg=new ka(Object,C)),this.rg.add(d,b))}var e=this.wa,d=-1;if(c===this){for(var f=-1,h=this.wa.n,k=h.length,l=0;l=e.count&& -a>=e.count)return;e.Xc(f);d=f}else w.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Ld(a,b);this.I();b.I();null!==b.Pd?this.Ck=!0:b instanceof C&&!0===b.Ck&&(this.Ck=!0);this.Sj=null;c=this.U;null!==c&&(c.Nm=null,c.bk=NaN,this.Ck&&c instanceof T&&(c.Ck=!0),c.Ck&&c instanceof T&&(c.le=null),e=this.g,null!==e&&e.oa.fb||(-1!==d&&c.Wc(Pf,"elements",this,b,null,d,null),c.Wc(Of,"elements",this,null,b,null,a),this.au()||Yp(this,b,!1)))}; -w.defineProperty(C,{Ck:null},function(){return 0!==(this.P&8388608)},function(a){0!==(this.P&8388608)!==a&&(this.P^=8388608)});function Zp(a,b){a.P=b?a.P|16777216:a.P&-16777217}C.prototype.remove=C.prototype.remove=function(a){w.G(a,G,C,"remove:element");for(var b=this.wa.n,c=b.length,d=-1,e=0;ea&&w.Ea(a,">= 0",C,"getRowDefinition:idx");a=Math.round(a);var b=this.Yd;if(void 0===b[a]){var c=new Pg;c.em(this);c.ve=!0;c.index=a;b[a]=c}return b[a]};C.prototype.removeRowDefinition=C.prototype.OF=function(a){0>a&&w.Ea(a,">= 0",C,"removeRowDefinition:idx");a=Math.round(a);var b=this.Yd;this.Wc(Pf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.I()};w.u(C,{Lp:"columnCount"},function(){return void 0===this.Td?0:this.Td.length}); -C.prototype.getColumnDefinition=C.prototype.ae=function(a){0>a&&w.Ea(a,">= 0",C,"getColumnDefinition:idx");a=Math.round(a);var b=this.Td;if(void 0===b[a]){var c=new Pg;c.em(this);c.ve=!1;c.index=a;b[a]=c}return b[a]};C.prototype.removeColumnDefinition=C.prototype.LF=function(a){0>a&&w.Ea(a,">= 0",C,"removeColumnDefinition:idx");a=Math.round(a);var b=this.Td;this.Wc(Pf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.I()}; -w.defineProperty(C,{rJ:"rowSizing"},function(){return void 0===this.Vm?ep:this.Vm},function(a){if(void 0!==this.Vm){var b=this.Vm;b!==a&&(a!==ep&&a!==Lp&&w.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Vm=a,this.I(),this.h("rowSizing",b,a))}}); -w.defineProperty(C,{pH:"columnSizing"},function(){return void 0===this.sm?ep:this.sm},function(a){if(void 0!==this.sm){var b=this.sm;b!==a&&(a!==ep&&a!==Lp&&w.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.sm=a,this.I(),this.h("columnSizing",b,a))}}); -w.defineProperty(C,{OL:"topIndex"},function(){return void 0===this.ej?0:this.ej},function(a){if(void 0!==this.ej){var b=this.ej;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.ej=a,this.I(),this.h("topIndex",b,a))}}); -w.defineProperty(C,{aL:"leftIndex"},function(){return void 0===this.Ni?0:this.Ni},function(a){if(void 0!==this.Ni){var b=this.Ni;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.Ni=a,this.I(),this.h("leftIndex",b,a))}});C.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==Po)return NaN;for(var b=0,c=this.Yd,d=c.length,e=this.ej;ea)return-1;if(this.type!==Po)return NaN;for(var b=0,c=this.Td,d=c.length,e=this.Ni;ea;)this.jf(this.wa.length-1);a=this.eq;if(null!==a)for(var b=w.Ya(a),c=0;cc)){var d;d=$p(a,b);var e=a.wI,f=null;null!==e&&(f=e.ka(d));null===f&&(aq||(aq=!0,w.trace('No item template Panel found for category "'+d+'" on '+a),w.trace(" Using default item template."),d=new C,e=new Ch,e.bind(new Vg("text","",Qf)),d.add(e),bq=d),f=bq);d=f;null!==d&&(fh(d),d=d.copy(),0!==(d.P&16777216)&&(e=a.Pl(),null!==e&&Zp(e,!0)),"object"===typeof b&&(null===a.rg&&(a.rg=new ka(Object,C)),a.rg.add(b,d)),e=c,fn(a)&&e++,a.Ld(e,d),d.Vd=b,gn(a,e, -c),d.Vd=null,d.data=b)}}function gn(a,b,c){for(a=a.wa;ba&&w.Ea(a,">= 0",Pg,"height"),this.gf=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.bd("height",b,a))});w.defineProperty(Pg,{width:"width"},function(){return this.gf},function(a){var b=this.gf;b!==a&&(0>a&&w.Ea(a,">= 0",Pg,"width"),this.gf=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.bd("width",b,a))}); -w.defineProperty(Pg,{xj:"minimum"},function(){return this.dk},function(a){var b=this.dk;b!==a&&((0>a||!isFinite(a))&&w.Ea(a,">= 0",Pg,"minimum"),this.dk=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.bd("minimum",b,a))});w.defineProperty(Pg,{mf:"maximum"},function(){return this.ck},function(a){var b=this.ck;b!==a&&(0>a&&w.Ea(a,">= 0",Pg,"maximum"),this.ck=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.bd("maximum",b,a))}); -w.defineProperty(Pg,{alignment:"alignment"},function(){return this.ge},function(a){var b=this.ge;b.L(a)||(this.ge=a.S(),null!==this.O&&this.O.I(),this.bd("alignment",b,a))});w.defineProperty(Pg,{stretch:"stretch"},function(){return this.Ag},function(a){var b=this.Ag;b!==a&&(this.Ag=a,null!==this.O&&this.O.I(),this.bd("stretch",b,a))}); -w.defineProperty(Pg,{aG:"separatorPadding"},function(){return this.hk},function(a){"number"===typeof a&&(a=new eb(a));var b=this.hk;null!==a&&null!==b&&b.L(a)||(null!==a&&(a=a.S()),this.hk=a,null!==this.O&&this.O.I(),this.bd("separatorPadding",b,a))});w.defineProperty(Pg,{sq:"separatorStroke"},function(){return this.Vs},function(a){var b=this.Vs;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.Vs=a,null!==this.O&&this.O.I(),this.bd("separatorStroke",b,a))}); -w.defineProperty(Pg,{tq:"separatorStrokeWidth"},function(){return this.Ws},function(a){var b=this.Ws;b!==a&&(this.Ws=a,null!==this.O&&this.O.I(),this.bd("separatorStrokeWidth",b,a))}); -w.defineProperty(Pg,{CL:"separatorDashArray"},function(){return this.Xh},function(a){var b=this.Xh;if(b!==a){null===a||Array.isArray(a)||w.wd(a,"Array",Pg,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ee)){for(var f=d.za,h=Math.max(1,f.width),f=f.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,u=q=0,t=w.lb(),x=2;xp&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,x=0,q=t[x],p=q[0],s=q[1],r=q[2],q=q[3],v=0;.1<=u;){0===v&&(n?(e=c,e-=m,u-=m,n=!1):e=c,0===e&&(e=1));if(e>u){w.va(t);return}e> -q?(v=e-q,e=q):v=0;var B=Math.sqrt(e*e/(1+r*r));0>p&&(B=-B);k+=B;l+=r*B;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(f/2));0===v&&d.xk(a,b);a.translate(h/2,f/2);a.rotate(-s);a.translate(-k,-l);u-=e;q-=e;if(0!==v){x++;if(x===t.length){w.va(t);return}q=t[x];p=q[0];s=q[1];r=q[2];q=q[3];e=v}}w.va(t)}} -X.prototype.xk=function(a,b){if(null!==this.pc||null!==this.yd){null!==this.yd&&Ko(this,a,this.yd,!0,!1);null!==this.pc&&Ko(this,a,this.pc,!1,!1);var c=this.fi;if(0===c){var d=this.U;d instanceof dh&&d.type===aj&&"Selection"===d.rd&&d.qb instanceof X&&d.Nf.Hd()===d.qb&&(c=d.qb.kb)}a.lineWidth=c;a.lineJoin=this.vp;a.lineCap=this.sp;a.miterLimit=this.cn;var e=!1;this.U&&b.oj("drawShadows")&&(e=this.U.Zl);var f=!0;null!==this.pc&&null===this.yd&&(f=!1);var d=!1,h=!0,k=this.jG;null!==k&&(d=!0,h=a.dA(k, -this.sf));var l=this.gb;if(null!==l){if(l.ma===Je)a.beginPath(),d&&!h?vo(a,l.wc,l.Gc,l.yb,l.Fb,k,this.sf):(a.moveTo(l.wc,l.Gc),a.lineTo(l.yb,l.Fb)),null!==this.yd&&a.Hg(this.yd),0!==c&&null!==this.pc&&a.Cj();else if(l.ma===Ke){var m=l.wc,n=l.Gc,p=l.yb,q=l.Fb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.yd&&(a.beginPath(),a.rect(l,r,m,n),a.Hg(this.yd));if(null!==this.pc){var s=p=0,u=0;f&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= -0,a.shadowBlur=0);d&&!h?(h=w.lb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),eq(a,h,k,this.sf),a.Cj(),w.va(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.Cj());f&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.ma===Se)m=l.wc,n=l.Gc,p=l.yb,q=l.Fb,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+ad*l,n-r,m+l,n-ad*r,m+l,n),a.bezierCurveTo(m+ -l,n+ad*r,m+ad*l,n+r,m,n+r),a.bezierCurveTo(m-ad*l,n+r,m-l,n+ad*r,m-l,n),a.bezierCurveTo(m-l,n-ad*r,m-ad*l,n-r,m,n-r),a.closePath(),null!==this.yd&&a.Hg(this.yd),d&&!h&&(h=w.lb(),$d(m,n-r,m+ad*l,n-r,m+l,n-ad*r,m+l,n,.5,h),$d(m+l,n,m+l,n+ad*r,m+ad*l,n+r,m,n+r,.5,h),$d(m,n+r,m-ad*l,n+r,m-l,n+ad*r,m-l,n,.5,h),$d(m-l,n,m-l,n-ad*r,m-ad*l,n-r,m,n-r,.5,h),a.beginPath(),eq(a,h,k,this.sf),w.va(h)),0!==c&&null!==this.pc&&(f&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= -0,a.shadowBlur=0,a.Cj(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u):a.Cj());else if(l.ma===Ge){r=l.Nj;n=r.length;for(q=0;qx.of);else{var t=tf(x,m),v=t.length;if(0===v){a.lineTo(x.ja,x.ra);break}for(var B=0;Be)){var f=.001,h=c.length,k=b[0],l=b[1];if(4===e)vo(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=f=0,n=0,p=0,q=0,r=p=0,s=w.lb(),u=2;ur&&(f=r);f>p?(t=f-p,f=p):t=0;var x=Math.sqrt(f*f/(1+q*q));0>n&&(x=-x);k+=x;l+= -q*x;e?a.lineTo(k,l):a.moveTo(k,l);r-=f;p-=f;if(0!==t){u++;if(u===s.length){w.va(s);return}p=s[u];n=p[0];q=p[1];p=p[2];f=t}else e=!e}w.va(s)}}}X.prototype.getDocumentPoint=X.prototype.Wa=function(a,b){void 0===b&&(b=new z);if(a instanceof L){a.Nd()&&w.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ia,d=this.kb;b.l(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.ph.nb(b);return b}; -X.prototype.uk=function(a,b){var c=this.vf;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.jb,e=this.kb/2;c.type!==Je||b||(e+=2);var f=w.Df();f.assign(d);f.Sf(e+2,e+2);if(!f.Ha(a))return w.Gb(f),!1;d=e+1E-4;if(c.type===Je){if(null===this.stroke)return!1;d=(c.D-c.ia)*(a.x-c.ia)+(c.F-c.ga)*(a.y-c.ga);if(0>(c.ia-c.D)*(a.x-c.D)+(c.ga-c.F)*(a.y-c.F)||0>d)return!1;w.Gb(f);return Xd(c.ia,c.ga,c.D,c.F,e,a.x,a.y)}if(c.type===Ke){var h=c.ia,k=c.ga,l=c.D,m=c.F;f.x=Math.min(h,l);f.y=Math.min(k, -m);f.width=Math.abs(l-h);f.height=Math.abs(m-k);if(null===this.fill){f.Sf(-d,-d);if(f.Ha(a))return w.Gb(f),!1;f.Sf(d,d)}null!==this.stroke&&f.Sf(e,e);e=f.Ha(a);w.Gb(f);return e}if(c.type===Se){var h=c.ia,k=c.ga,l=c.D,m=c.F,c=Math.min(h,l),n=Math.min(k,m),h=Math.abs(l-h)/2,k=Math.abs(m-k)/2,c=a.x-(c+h),n=a.y-(n+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=c*c/(h*h)+n*n/(k*k))return w.Gb(f),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);w.Gb(f);return 0>=h||0>=k?!1:1>=c*c/(h*h)+n*n/(k*k)}if(c.type=== -Ge)return w.Gb(f),null===this.fill?wf(c,a.x,a.y,e):c.Ha(a,e,1=this.kb)n=ne(p.wc,p.Gc,p.yb,p.Fb,f,h,k,l,e);else{var r=0,s=0;p.wc===p.yb?(r=m,s=0):(b=(p.Fb-p.Gc)/(p.yb-p.wc),s=m/Math.sqrt(1+b*b),r=s*b);d=w.lb();b=new z;ne(p.wc+ -r,p.Gc+s,p.yb+r,p.Fb+s,f,h,k,l,b)&&d.push(b);b=new z;ne(p.wc-r,p.Gc-s,p.yb-r,p.Fb-s,f,h,k,l,b)&&d.push(b);b=new z;ne(p.wc+r,p.Gc+s,p.wc-r,p.Gc-s,f,h,k,l,b)&&d.push(b);b=new z;ne(p.yb+r,p.Fb+s,p.yb-r,p.Fb-s,f,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return w.va(d),!1;n=!0;s=Infinity;for(r=0;rMath.abs(c)){n=h-b-c*(f-d);if(0>a*a*c*c+t*t-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+t*t-n*n);k=(-(a*a*c*n)+a*t*m)/(t*t+a*a*c*c)+d;a=(-(a*a*c*n)-a*t*m)/(t*t+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((f-k)*(f-k))+Math.abs((h-l)*(h-l));h=Math.abs((f-a)*(f-a))+Math.abs((h-b)*(h- -b));dk){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);dc?a-c:c-a)<(b>d?b-d:d-b)?(e=be||Xa(l.y,e))&&(l.ye||Xa(l.x,e))&&(l.x=h&&d<=a}a=h&&f<=a} -X.prototype.JE=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.uk(a,!0))return!0;var e=a.uf(b);b=e;1.5=e||Na(b,f,0,-p)>=e||Na(b,f,0,p)>=e||Na(b,f,n,0)>= -e?!1:!0}else if(f.type===Ge){h=f.jb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.xh&&a.ye&&Ma(a.x,a.y,k,l,m,l)>e&&Ma(a.x,a.y,m,h,k,h)>e&&Ma(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?wf(f,a.x,a.y,b):f.Ha(a,b,!0))return!0}else{c=f.cc;for(b=0;be)return!1;l=k.vb.n;m=l.length;for(h=0;he)return!1;break;case pf:f=w.lb(); -$d(n,p,q.rc,q.Oc,q.Ah,q.Bh,q.D,q.F,.8,f);n=d(f,a);w.va(f);if(n)return!1;n=q.D;p=q.F;if(a.Sp(n,p)>e)return!1;break;case qf:f=w.lb();ke(n,p,q.rc,q.Oc,q.D,q.F,.8,f);n=d(f,a);w.va(f);if(n)return!1;n=q.D;p=q.F;if(a.Sp(n,p)>e)return!1;break;case rf:case sf:var r=q.type===rf?tf(q,k):uf(q,k,n,p),s=r.length;if(0===s){n=q.ja;p=q.ra;if(a.Sp(n,p)>e)return!1;break}q=null;f=w.lb();for(b=0;b= 0",X,"strokeWidth:value")});w.defineProperty(X,{HL:"strokeCap"},function(){return this.sp},function(a){var b=this.sp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?w.Ea(a,'"butt", "round", or "square"',X,"strokeCap"):(this.sp=a,this.na(),this.h("strokeCap",b,a)))}); -w.defineProperty(X,{JL:"strokeJoin"},function(){return this.vp},function(a){var b=this.vp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?w.Ea(a,'"miter", "bevel", or "round"',X,"strokeJoin"):(this.vp=a,this.na(),this.h("strokeJoin",b,a)))});w.defineProperty(X,{KL:"strokeMiterLimit"},function(){return this.cn},function(a){var b=this.cn;if(b!==a)if(1<=a){this.cn=a;this.na();var c=this.U;null!==c&&(c.bk=NaN);this.h("strokeMiterLimit",b,a)}else w.Ea(a,"value >= 1",X,"strokeWidth:value")}); -w.defineProperty(X,{jG:"strokeDashArray"},function(){return this.tp},function(a){var b=this.tp;if(b!==a){null===a||Array.isArray(a)||w.wd(a,"Array",X,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;eq.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof C?n:null;q=w.Ff();q.set(h);if(null!==n?n.zk(a,b,c,d,e,q):Bo(p,a,d, +q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);w.ue(q)}}}void 0===f&&w.ue(h);return d}void 0===f&&w.ue(h);return!1};function Zp(a,b,c,d){for(var e=a.xa.n,f=e.length;f--;){var h=e[f];if(h.visible){var k=h.W,l=a.Ia;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof C&&Zp(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}} +g.wn=function(a,b,c,d,e,f){if(!1===this.Tg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ia,k=this.Yg(),l=k?a:La(w.xb(a.x,a.y),this.transform),m=k?b:La(w.xb(b.x,b.y),this.transform),n=l.uf(m),p=0u.width||s.y>u.height||0>s.x+s.width||0>s.y+s.height||(r.Yg()?(s=r.transform,La(k.set(a),s),La(l.set(b),s)):(k.set(a),l.set(b)),s=r,r=r instanceof C?r:null,null!==r?!r.wn(k,l,c,d,e,f):!s.ME(k,l,e))||(null!==c&&(s=c(s)),null===s||null!==d&&!d(s)||f.add(s))}}w.v(k);w.v(l)}return e? +p:h}return!1};function Kp(a){var b=null;a instanceof X&&(b=a.A,b===rc&&(b=null),a=a.vf,null!==a&&null===b&&(b=a.A));null===b&&(b=xb);return b}function Lp(a){var b=null;a instanceof X&&(b=a.B,b===rc&&(b=null),a=a.vf,null!==a&&null===b&&(b=a.B));null===b&&(b=Lb);return b}C.prototype.add=C.prototype.add=function(a){w.G(a,G,C,"add:element");this.Md(this.xa.count,a)};C.prototype.elt=C.prototype.da=function(a){return this.xa.da(a)}; +C.prototype.insertAt=C.prototype.Md=function(a,b){b instanceof S&&w.k("Cannot add a Part to a Panel: "+b);if(this===b||this.Xl(b))this===b&&w.k("Cannot make a Panel contain itself: "+this.toString()),w.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.O;null!==c&&c!==this&&w.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+ +this.toString());this.ma!==Hl||b instanceof X||w.k("Can only add Shapes to a Grid Panel, not: "+b);this.ma!==gp||b instanceof X||b instanceof Hh||w.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.dm(this);b.Sm=null;if(null!==this.dq){var d=b.data;null!==d&&"object"===typeof d&&(null===this.tg&&(this.tg=new ka(Object,C)),this.tg.add(d,b))}var e=this.xa,d=-1;if(c===this){for(var f=-1,h=this.xa.n,k=h.length,l=0;l=e.count&& +a>=e.count)return;e.Yc(f);d=f}else w.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Md(a,b);this.I();b.I();null!==b.Qd?this.Dk=!0:b instanceof C&&!0===b.Dk&&(this.Dk=!0);this.Tj=null;c=this.U;null!==c&&(c.Nm=null,c.ck=NaN,this.Dk&&c instanceof T&&(c.Dk=!0),c.Dk&&c instanceof T&&(c.le=null),e=this.g,null!==e&&e.oa.gb||(-1!==d&&c.Xc(Pf,"elements",this,b,null,d,null),c.Xc(Of,"elements",this,null,b,null,a),this.$t()||$p(this,b,!1)))}; +w.defineProperty(C,{Dk:null},function(){return 0!==(this.P&8388608)},function(a){0!==(this.P&8388608)!==a&&(this.P^=8388608)});function aq(a,b){a.P=b?a.P|16777216:a.P&-16777217}C.prototype.remove=C.prototype.remove=function(a){w.G(a,G,C,"remove:element");for(var b=this.xa.n,c=b.length,d=-1,e=0;ea&&w.Ea(a,">= 0",C,"getRowDefinition:idx");a=Math.round(a);var b=this.Yd;if(void 0===b[a]){var c=new Tg;c.dm(this);c.ve=!0;c.index=a;b[a]=c}return b[a]};C.prototype.removeRowDefinition=C.prototype.RF=function(a){0>a&&w.Ea(a,">= 0",C,"removeRowDefinition:idx");a=Math.round(a);var b=this.Yd;this.Xc(Pf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.I()};w.u(C,{Kp:"columnCount"},function(){return void 0===this.Td?0:this.Td.length}); +C.prototype.getColumnDefinition=C.prototype.ae=function(a){0>a&&w.Ea(a,">= 0",C,"getColumnDefinition:idx");a=Math.round(a);var b=this.Td;if(void 0===b[a]){var c=new Tg;c.dm(this);c.ve=!1;c.index=a;b[a]=c}return b[a]};C.prototype.removeColumnDefinition=C.prototype.OF=function(a){0>a&&w.Ea(a,">= 0",C,"removeColumnDefinition:idx");a=Math.round(a);var b=this.Td;this.Xc(Pf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.I()}; +w.defineProperty(C,{uJ:"rowSizing"},function(){return void 0===this.Vm?fp:this.Vm},function(a){if(void 0!==this.Vm){var b=this.Vm;b!==a&&(a!==fp&&a!==Np&&w.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Vm=a,this.I(),this.h("rowSizing",b,a))}}); +w.defineProperty(C,{sH:"columnSizing"},function(){return void 0===this.sm?fp:this.sm},function(a){if(void 0!==this.sm){var b=this.sm;b!==a&&(a!==fp&&a!==Np&&w.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.sm=a,this.I(),this.h("columnSizing",b,a))}}); +w.defineProperty(C,{RL:"topIndex"},function(){return void 0===this.ej?0:this.ej},function(a){if(void 0!==this.ej){var b=this.ej;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.ej=a,this.I(),this.h("topIndex",b,a))}}); +w.defineProperty(C,{dL:"leftIndex"},function(){return void 0===this.Ni?0:this.Ni},function(a){if(void 0!==this.Ni){var b=this.Ni;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.Ni=a,this.I(),this.h("leftIndex",b,a))}});C.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==Qo)return NaN;for(var b=0,c=this.Yd,d=c.length,e=this.ej;ea)return-1;if(this.type!==Qo)return NaN;for(var b=0,c=this.Td,d=c.length,e=this.Ni;ea;)this.jf(this.xa.length-1);a=this.dq;if(null!==a)for(var b=w.Ya(a),c=0;cc)){var d;d=bq(a,b);var e=a.zI,f=null;null!==e&&(f=e.ja(d));null===f&&(cq||(cq=!0,w.trace('No item template Panel found for category "'+d+'" on '+a),w.trace(" Using default item template."),d=new C,e=new Hh,e.bind(new Zg("text","",Qf)),d.add(e),dq=d),f=dq);d=f;null!==d&&(jh(d),d=d.copy(),0!==(d.P&16777216)&&(e=a.Ql(),null!==e&&aq(e,!0)),"object"===typeof b&&(null===a.tg&&(a.tg=new ka(Object,C)),a.tg.add(b,d)),e=c,hn(a)&&e++,a.Md(e,d),d.Vd=b,jn(a,e, +c),d.Vd=null,d.data=b)}}function jn(a,b,c){for(a=a.xa;ba&&w.Ea(a,">= 0",Tg,"height"),this.gf=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.cd("height",b,a))});w.defineProperty(Tg,{width:"width"},function(){return this.gf},function(a){var b=this.gf;b!==a&&(0>a&&w.Ea(a,">= 0",Tg,"width"),this.gf=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.cd("width",b,a))}); +w.defineProperty(Tg,{zj:"minimum"},function(){return this.ek},function(a){var b=this.ek;b!==a&&((0>a||!isFinite(a))&&w.Ea(a,">= 0",Tg,"minimum"),this.ek=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.cd("minimum",b,a))});w.defineProperty(Tg,{mf:"maximum"},function(){return this.dk},function(a){var b=this.dk;b!==a&&(0>a&&w.Ea(a,">= 0",Tg,"maximum"),this.dk=a,this.Ja=this.Sa,null!==this.O&&this.O.I(),this.cd("maximum",b,a))}); +w.defineProperty(Tg,{alignment:"alignment"},function(){return this.ge},function(a){var b=this.ge;b.L(a)||(this.ge=a.S(),null!==this.O&&this.O.I(),this.cd("alignment",b,a))});w.defineProperty(Tg,{stretch:"stretch"},function(){return this.Cg},function(a){var b=this.Cg;b!==a&&(this.Cg=a,null!==this.O&&this.O.I(),this.cd("stretch",b,a))}); +w.defineProperty(Tg,{dG:"separatorPadding"},function(){return this.ik},function(a){"number"===typeof a&&(a=new db(a));var b=this.ik;null!==a&&null!==b&&b.L(a)||(null!==a&&(a=a.S()),this.ik=a,null!==this.O&&this.O.I(),this.cd("separatorPadding",b,a))});w.defineProperty(Tg,{rq:"separatorStroke"},function(){return this.Vs},function(a){var b=this.Vs;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.Vs=a,null!==this.O&&this.O.I(),this.cd("separatorStroke",b,a))}); +w.defineProperty(Tg,{sq:"separatorStrokeWidth"},function(){return this.Ws},function(a){var b=this.Ws;b!==a&&(this.Ws=a,null!==this.O&&this.O.I(),this.cd("separatorStrokeWidth",b,a))}); +w.defineProperty(Tg,{FL:"separatorDashArray"},function(){return this.Xh},function(a){var b=this.Xh;if(b!==a){null===a||Array.isArray(a)||w.yd(a,"Array",Tg,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ee)){for(var f=d.za,h=Math.max(1,f.width),f=f.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,u=q=0,t=w.lb(),x=2;xp&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,x=0,q=t[x],p=q[0],s=q[1],r=q[2],q=q[3],v=0;.1<=u;){0===v&&(n?(e=c,e-=m,u-=m,n=!1):e=c,0===e&&(e=1));if(e>u){w.wa(t);return}e> +q?(v=e-q,e=q):v=0;var B=Math.sqrt(e*e/(1+r*r));0>p&&(B=-B);k+=B;l+=r*B;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(f/2));0===v&&d.yk(a,b);a.translate(h/2,f/2);a.rotate(-s);a.translate(-k,-l);u-=e;q-=e;if(0!==v){x++;if(x===t.length){w.wa(t);return}q=t[x];p=q[0];s=q[1];r=q[2];q=q[3];e=v}}w.wa(t)}} +X.prototype.yk=function(a,b){if(null!==this.qc||null!==this.zd){null!==this.zd&&Lo(this,a,this.zd,!0,!1);null!==this.qc&&Lo(this,a,this.qc,!1,!1);var c=this.fi;if(0===c){var d=this.U;d instanceof hh&&d.type===hj&&"Selection"===d.td&&d.rb instanceof X&&d.Of.Jd()===d.rb&&(c=d.rb.kb)}a.lineWidth=c;a.lineJoin=this.wp;a.lineCap=this.tp;a.miterLimit=this.cn;var e=!1;this.U&&b.pj("drawShadows")&&(e=this.U.Zl);var f=!0;null!==this.qc&&null===this.zd&&(f=!1);var d=!1,h=!0,k=this.mG;null!==k&&(d=!0,h=a.fA(k, +this.sf));var l=this.hb;if(null!==l){if(l.ma===Ee)a.beginPath(),d&&!h?wo(a,l.xc,l.Gc,l.yb,l.Gb,k,this.sf):(a.moveTo(l.xc,l.Gc),a.lineTo(l.yb,l.Gb)),null!==this.zd&&a.Jg(this.zd),0!==c&&null!==this.qc&&a.Ej();else if(l.ma===Fe){var m=l.xc,n=l.Gc,p=l.yb,q=l.Gb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.zd&&(a.beginPath(),a.rect(l,r,m,n),a.Jg(this.zd));if(null!==this.qc){var s=p=0,u=0;f&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= +0,a.shadowBlur=0);d&&!h?(h=w.lb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),gq(a,h,k,this.sf),a.Ej(),w.wa(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.Ej());f&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.ma===Ne)m=l.xc,n=l.Gc,p=l.yb,q=l.Gb,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+cd*l,n-r,m+l,n-cd*r,m+l,n),a.bezierCurveTo(m+ +l,n+cd*r,m+cd*l,n+r,m,n+r),a.bezierCurveTo(m-cd*l,n+r,m-l,n+cd*r,m-l,n),a.bezierCurveTo(m-l,n-cd*r,m-cd*l,n-r,m,n-r),a.closePath(),null!==this.zd&&a.Jg(this.zd),d&&!h&&(h=w.lb(),Xd(m,n-r,m+cd*l,n-r,m+l,n-cd*r,m+l,n,.5,h),Xd(m+l,n,m+l,n+cd*r,m+cd*l,n+r,m,n+r,.5,h),Xd(m,n+r,m-cd*l,n+r,m-l,n+cd*r,m-l,n,.5,h),Xd(m-l,n,m-l,n-cd*r,m-cd*l,n-r,m,n-r,.5,h),a.beginPath(),gq(a,h,k,this.sf),w.wa(h)),0!==c&&null!==this.qc&&(f&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= +0,a.shadowBlur=0,a.Ej(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u):a.Ej());else if(l.ma===Be){r=l.Oj;n=r.length;for(q=0;qx.of);else{var t=rf(x,m),v=t.length;if(0===v){a.lineTo(x.ka,x.ra);break}for(var B=0;Be)){var f=.001,h=c.length,k=b[0],l=b[1];if(4===e)wo(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=f=0,n=0,p=0,q=0,r=p=0,s=w.lb(),u=2;ur&&(f=r);f>p?(t=f-p,f=p):t=0;var x=Math.sqrt(f*f/(1+q*q));0>n&&(x=-x);k+=x;l+= +q*x;e?a.lineTo(k,l):a.moveTo(k,l);r-=f;p-=f;if(0!==t){u++;if(u===s.length){w.wa(s);return}p=s[u];n=p[0];q=p[1];p=p[2];f=t}else e=!e}w.wa(s)}}}X.prototype.getDocumentPoint=X.prototype.Wa=function(a,b){void 0===b&&(b=new z);if(a instanceof L){a.Od()&&w.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ia,d=this.kb;b.m(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.ph.nb(b);return b}; +X.prototype.vk=function(a,b){var c=this.vf;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.cb,e=this.kb/2;c.type!==Ee||b||(e+=2);var f=w.Ef();f.assign(d);f.xf(e+2,e+2);if(!f.Ha(a))return w.Db(f),!1;d=e+1E-4;if(c.type===Ee){if(null===this.stroke)return!1;d=(c.D-c.ia)*(a.x-c.ia)+(c.F-c.ga)*(a.y-c.ga);if(0>(c.ia-c.D)*(a.x-c.D)+(c.ga-c.F)*(a.y-c.F)||0>d)return!1;w.Db(f);return Ud(c.ia,c.ga,c.D,c.F,e,a.x,a.y)}if(c.type===Fe){var h=c.ia,k=c.ga,l=c.D,m=c.F;f.x=Math.min(h,l);f.y=Math.min(k, +m);f.width=Math.abs(l-h);f.height=Math.abs(m-k);if(null===this.fill){f.xf(-d,-d);if(f.Ha(a))return w.Db(f),!1;f.xf(d,d)}null!==this.stroke&&f.xf(e,e);e=f.Ha(a);w.Db(f);return e}if(c.type===Ne){var h=c.ia,k=c.ga,l=c.D,m=c.F,c=Math.min(h,l),n=Math.min(k,m),h=Math.abs(l-h)/2,k=Math.abs(m-k)/2,c=a.x-(c+h),n=a.y-(n+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=c*c/(h*h)+n*n/(k*k))return w.Db(f),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);w.Db(f);return 0>=h||0>=k?!1:1>=c*c/(h*h)+n*n/(k*k)}if(c.type=== +Be)return w.Db(f),null===this.fill?uf(c,a.x,a.y,e):c.Ha(a,e,1=this.kb)n=je(p.xc,p.Gc,p.yb,p.Gb,f,h,k,l,e);else{var r=0,s=0;p.xc===p.yb?(r=m,s=0):(b=(p.Gb-p.Gc)/(p.yb-p.xc),s=m/Math.sqrt(1+b*b),r=s*b);d=w.lb();b=new z;je(p.xc+ +r,p.Gc+s,p.yb+r,p.Gb+s,f,h,k,l,b)&&d.push(b);b=new z;je(p.xc-r,p.Gc-s,p.yb-r,p.Gb-s,f,h,k,l,b)&&d.push(b);b=new z;je(p.xc+r,p.Gc+s,p.xc-r,p.Gc-s,f,h,k,l,b)&&d.push(b);b=new z;je(p.yb+r,p.Gb+s,p.yb-r,p.Gb-s,f,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return w.wa(d),!1;n=!0;s=Infinity;for(r=0;rMath.abs(c)){n=h-b-c*(f-d);if(0>a*a*c*c+t*t-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+t*t-n*n);k=(-(a*a*c*n)+a*t*m)/(t*t+a*a*c*c)+d;a=(-(a*a*c*n)-a*t*m)/(t*t+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((f-k)*(f-k))+Math.abs((h-l)*(h-l));h=Math.abs((f-a)*(f-a))+Math.abs((h-b)*(h- +b));dk){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);dc?a-c:c-a)<(b>d?b-d:d-b)?(e=be||Va(l.y,e))&&(l.ye||Va(l.x,e))&&(l.x=h&&d<=a}a=h&&f<=a} +X.prototype.ME=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.vk(a,!0))return!0;var e=a.uf(b);b=e;1.5=e||Na(b,f,0,-p)>=e||Na(b,f,0,p)>=e||Na(b,f,n,0)>= +e?!1:!0}else if(f.type===Be){h=f.cb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.xh&&a.ye&&Ma(a.x,a.y,k,l,m,l)>e&&Ma(a.x,a.y,m,h,k,h)>e&&Ma(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?uf(f,a.x,a.y,b):f.Ha(a,b,!0))return!0}else{c=f.dc;for(b=0;be)return!1;l=k.vb.n;m=l.length;for(h=0;he)return!1;break;case nf:f=w.lb(); +Xd(n,p,q.sc,q.Pc,q.Ah,q.Bh,q.D,q.F,.8,f);n=d(f,a);w.wa(f);if(n)return!1;n=q.D;p=q.F;if(a.Rp(n,p)>e)return!1;break;case of:f=w.lb();ge(n,p,q.sc,q.Pc,q.D,q.F,.8,f);n=d(f,a);w.wa(f);if(n)return!1;n=q.D;p=q.F;if(a.Rp(n,p)>e)return!1;break;case pf:case qf:var r=q.type===pf?rf(q,k):sf(q,k,n,p),s=r.length;if(0===s){n=q.ka;p=q.ra;if(a.Rp(n,p)>e)return!1;break}q=null;f=w.lb();for(b=0;b= 0",X,"strokeWidth:value")});w.defineProperty(X,{KL:"strokeCap"},function(){return this.tp},function(a){var b=this.tp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?w.Ea(a,'"butt", "round", or "square"',X,"strokeCap"):(this.tp=a,this.na(),this.h("strokeCap",b,a)))}); +w.defineProperty(X,{ML:"strokeJoin"},function(){return this.wp},function(a){var b=this.wp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?w.Ea(a,'"miter", "bevel", or "round"',X,"strokeJoin"):(this.wp=a,this.na(),this.h("strokeJoin",b,a)))});w.defineProperty(X,{NL:"strokeMiterLimit"},function(){return this.cn},function(a){var b=this.cn;if(b!==a)if(1<=a){this.cn=a;this.na();var c=this.U;null!==c&&(c.ck=NaN);this.h("strokeMiterLimit",b,a)}else w.Ea(a,"value >= 1",X,"strokeWidth:value")}); +w.defineProperty(X,{mG:"strokeDashArray"},function(){return this.vp},function(a){var b=this.vp;if(b!==a){null===a||Array.isArray(a)||w.yd(a,"Array",X,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1a?a=0:1a?a=0:1n*l*l&&(h=!0);b.qf!==a&&(h=!1);!1===b.oj("textGreeking")&&(h=!1);n=this.bi;l=this.ci;switch(this.Pt){case po:a.translate(c, -0);a.scale(-1,1);break;case oo:a.translate(0,d);a.scale(1,-1);break;case qo:a.translate(c,d),a.scale(-1,-1)}var m=this.je,p=(n+e+l)*m;d>p&&(k=this.yl,k=k.y*d-k.y*p+k.offsetY);for(var p=this.Oi,q=0;qc&&(r=c);var k=k+n,u=s,s=a,t=k,x=c,v=e,B=f,y=0;h?("left"===B?y=0:"right"===B?y=x-r:"center"===B&&(y=(x-r)/2),s.fillRect(0+y,t+.25*v,r,1)):("left"===B?y=0:"right"===B?y=x:"center"===B&&(y=x/2),s.fillText(u,0+y,t+v-.25*v),u=v/20|0,0===u&&(u=1),"right"===B?y-=r:"center"=== -B&&(y-=r/2),this.Yj&&(s.beginPath(),s.lineWidth=u,s.moveTo(0+y,t+v-.2*v),s.lineTo(0+y+r,t+v-.2*v),s.stroke()),this.Xj&&(s.beginPath(),s.lineWidth=u,t=t+v-v/2.2|0,0!==u%2&&(t+=.5),s.moveTo(0+y,t),s.lineTo(0+y+r,t),s.stroke()));k+=e+l}switch(this.Pt){case po:a.scale(-1,1);a.translate(-c,0);break;case oo:a.scale(1,-1);a.translate(0,-d);break;case qo:a.scale(-1,-1),a.translate(-c,-d)}}}; -Ch.prototype.computeAngle=function(a,b){var c=0;switch(a){default:case dj:c=0;break;case lq:c=b;break;case Np:c=b+90;break;case Pp:c=b-90;break;case Dq:c=b+180;break;case Eq:c=Be(b);90c&&(c-=180);break;case Op:c=Be(b+90);90c&&(c-=180);break;case Qp:c=Be(b-90);90c&&(c-=180);break;case Rp:c=Be(b);if(45c||225c)return 0;90c&&(c-=180)}return Be(c)}; -Ch.prototype.Ln=function(a,b,c,d){this.Wo=a;var e=this.Oi;e.reset();var f=0,h=0;if(isNaN(this.Aa.width)){f=this.Dd.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===f.length)f=0;else if(this.yx){for(var k=h=0,l=!1;!l;){var m=f.indexOf("\n",k);-1===m&&(m=f.length,l=!0);k=Fq(f.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.lg);k>h&&(h=k);k=m+1}f=h}else h=f.indexOf("\n",0),0<=h&&(f=f.substr(0,h)),f=k=Fq(f,this.lg);f=Math.min(f,a/this.scale);f=Math.max(8,f)}else f=this.Aa.width;null!==this.O&&(f=Math.min(f, -this.O.Af.width),f=Math.max(f,this.O.zh.width));h=Bq(this,f,e);m=h=isNaN(this.Aa.height)?Math.min(h,b/this.scale):this.Aa.height;if(0!==e.ef&&1!==e.Qe.length&&this.Xi===zq&&(b=this.lg,l=this.Xi===zq?Gq(b):0,k=this.bi+this.ci,k=Math.max(0,Cq(this)+k),m=Math.min(this.JI-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Qe.length))){k=e.Qe[m];for(a=Math.max(1,a-l);Fq(k,b)>a&&1=a.fh)return new ha(0,l);if(a.qk===xq){c.gj=1;f=Fq(b,k);if(0===h||f<=d)return c.ef=f,c.pf.push(c.ef),c.Qe.push(b),new ha(f,l);var m=Hq(b);b=b.substr(m.length);for(var n=Hq(b),f=Fq(m+n,k);0d&&1d;){n=1;f=Fq(m.substr(0,n),k);for(h=0;f<=d;)n++,h=f,f=Fq(m.substr(0,n),k);1===n?(c.pf[a.je+p]=f,e=Math.max(e,f)):(c.pf[a.je+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Qe[a.je+p]=m.substr(0,n);p++;m=m.substr(n);if(a.je+p>a.fh)break}n=Hq(b);for(f=Fq(m+n,k);0a.fh))break}c.gj=Math.min(a.fh,p);c.ef=Math.max(c.ef,e);return new ha(c.ef,l*c.gj)}function Hq(a){for(var b=a.length,c=0;c=b?a:a.substr(0,c)} -function Fq(a,b){vq!==b&&(vq=wq.font=b);return wq.measureText(a).width}function Cq(a){if(null!==a.wm)return a.wm;var b=a.lg;vq!==b&&(vq=wq.font=b);var c=0;void 0!==qq[b]&&5E3>rq?c=qq[b]:(c=1.3*wq.measureText("M").width,qq[b]=c,rq++);return a.wm=c}function Gq(a){vq!==a&&(vq=wq.font=a);var b=0;void 0!==sq[a]&&5E3>tq?b=sq[a]:(b=wq.measureText(uq).width,sq[a]=b,tq++);return b} -function Bq(a,b,c){var d=a.Dd.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.bi+a.ci,e=Math.max(0,Cq(a)+e);if(0===d.length)return c.ef=0,a.je=1,e;if(!a.yx){var f=d.indexOf("\n",0);0<=f&&(d=d.substr(0,f))}for(var f=0,h=a.je=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.qk!==xq?(c.gj=0,h=Aq(a,h,c,b),f+=h.height,a.je+=c.gj):(Aq(a,h,c,b),f+=e,a.je++),a.je===a.fh&&(l=!0)),h=k+1;return a.Wv=f} -w.defineProperty(Ch,{lB:"textValidation"},function(){return this.vl},function(a){var b=this.vl;b!==a&&(null!==a&&w.j(a,"function",Ch,"textValidation"),this.vl=a,this.h("textValidation",b,a))});w.defineProperty(Ch,{kG:"textEdited"},function(){return this.jt},function(a){var b=this.jt;b!==a&&(null!==a&&w.j(a,"function",Ch,"textEdited"),this.jt=a,this.h("textEdited",b,a))}); -w.defineProperty(Ch,{EL:"spacingAbove"},function(){return this.bi},function(a){var b=this.bi;b!==a&&(this.bi=a,this.h("spacingAbove",b,a))});w.defineProperty(Ch,{FL:"spacingBelow"},function(){return this.ci},function(a){var b=this.ci;b!==a&&(this.ci=a,this.h("spacingBelow",b,a))});w.defineProperty(Ch,{JI:"maxLines"},function(){return this.fh},function(a){var b=this.fh;b!==a&&(a=Math.floor(a),0>=a&&w.Ea(a,"> 0",Ch,"maxLines"),this.fh=a,this.h("maxLines",b,a),this.I())});w.u(Ch,{iL:"metrics"},function(){return this.Oi}); -w.defineProperty(Ch,{uK:"choices"},function(){return this.Sq},function(a){var b=this.Sq;b!==a&&(null===a||Array.isArray(a)||w.wd(a,"Array",Ch,"choices:value"),this.Sq=a,this.h("choices",b,a))});function Sp(){this.ef=this.gj=0;this.pf=[];this.Qe=[]}Sp.prototype.reset=function(){this.ef=this.gj=0;this.pf=[];this.Qe=[]};Sp.prototype.Mp=function(a){this.gj=a.gj;this.ef=a.ef;this.pf=w.Hl(a.pf);this.Qe=w.Hl(a.Qe)};w.u(Sp,{qK:"arrSize"},function(){return this.pf});w.u(Sp,{rK:"arrText"},function(){return this.Qe}); -w.u(Sp,{hL:"maxLineWidth"},function(){return this.ef});function tl(){G.call(this);this.Se=null;this.bt="";this.ik=Qd;this.Ko=Ie;this.gi=this.Te=null;this.Jo=Fb;this.kg=Ij;this.wp=null;this.ez=!1;this.yv=!0;this.Uv=!1;this.np=null}w.La(tl,G);w.fa("Picture",tl);tl.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.element=this.Se;a.bt=this.bt;a.ik=this.ik.S();a.Ko=this.Ko;a.kg=this.kg;a.Te=this.Te;a.gi=this.gi;a.Jo=this.Jo.S();a.yv=this.yv;a.np=this.np}; -tl.prototype.fc=function(a){a===Ij||a===Kj||a===Lj?this.hI=a:G.prototype.fc.call(this,a)};tl.prototype.toString=function(){return"Picture("+this.source+")#"+w.Jd(this)};var Iq=new sa,Jq=0,nl=[];function Kq(){var a=nl;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d=d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(f=f+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case Ie:n=d.width;p=d.height;break;case Kj:case Lj:var s=0;q===Kj?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===Lj&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(f=(f+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height), -n=d.width,p=d.height)}var q=this.nj()*b.scale,u=k*h/(n*q*p*q),s=Iq[this.source],q=null;if(void 0!==s&&16s.Fp.length&&(Pq(s,4,l,m),Pq(s,16,l,m));for(var l=s.Fp,m=l.length,q=l[0],t=0;te;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.2,.22);b.B=new L(.8, -.9);w.q(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=Tq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.07,.25);b.B=new L(.93,.75);w.q(a);return b},Heptagon:function(a,b,c){var d=Tq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.2,.15);b.B=new L(.8,.85);w.q(a);return b},Octagon:function(a,b,c){var d=Tq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0); -for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.85);w.q(a);return b},Nonagon:function(a,b,c){var d=Tq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.17,.13);b.B=new L(.82,.82);w.q(a);return b},Decagon:function(a,b,c){var d=Tq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b}, -Dodecagon:function(a,b,c){var d=Tq(12);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b},FivePointedStar:function(a,b,c){var d=Sq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.312,.383);b.B=new L(.693,.765);w.q(a);return b},SixPointedStar:function(a,b,c){var d=Sq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x* -b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.17,.251);b.B=new L(.833,.755);w.q(a);return b},SevenPointedStar:function(a,b,c){var d=Sq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.363,.361);b.B=new L(.641,.709);w.q(a);return b},EightPointedStar:function(a,b,c){var d=Sq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.252,.255);b.B=new L(.75,.75);w.q(a);return b},NinePointedStar:function(a, -b,c){var d=Sq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.355,.361);b.B=new L(.645,.651);w.q(a);return b},TenPointedStar:function(a,b,c){var d=Sq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.va(d);O(a);b=a.o;b.A=new L(.281,.261);b.B=new L(.723,.748);w.q(a);return b},FivePointedBurst:function(a,b,c){var d=Rq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;ea?a=0:1a?a=0:1a?a=0:1a?a=0:1n*l*l&&(h=!0);b.qf!==a&&(h=!1);!1===b.pj("textGreeking")&&(h=!1);n=this.bi;l=this.ci;switch(this.Ot){case qo:a.translate(c, +0);a.scale(-1,1);break;case po:a.translate(0,d);a.scale(1,-1);break;case ro:a.translate(c,d),a.scale(-1,-1)}var m=this.je,p=(n+e+l)*m;d>p&&(k=this.Al,k=k.y*d-k.y*p+k.offsetY);for(var p=this.Oi,q=0;qc&&(r=c);var k=k+n,u=s,s=a,t=k,x=c,v=e,B=f,y=0;h?("left"===B?y=0:"right"===B?y=x-r:"center"===B&&(y=(x-r)/2),s.fillRect(0+y,t+.25*v,r,1)):("left"===B?y=0:"right"===B?y=x:"center"===B&&(y=x/2),s.fillText(u,0+y,t+v-.25*v),u=v/20|0,0===u&&(u=1),"right"===B?y-=r:"center"=== +B&&(y-=r/2),this.Zj&&(s.beginPath(),s.lineWidth=u,s.moveTo(0+y,t+v-.2*v),s.lineTo(0+y+r,t+v-.2*v),s.stroke()),this.Yj&&(s.beginPath(),s.lineWidth=u,t=t+v-v/2.2|0,0!==u%2&&(t+=.5),s.moveTo(0+y,t),s.lineTo(0+y+r,t),s.stroke()));k+=e+l}switch(this.Ot){case qo:a.scale(-1,1);a.translate(-c,0);break;case po:a.scale(1,-1);a.translate(0,-d);break;case ro:a.scale(-1,-1),a.translate(-c,-d)}}}; +Hh.prototype.computeAngle=function(a,b){var c=0;switch(a){default:case kj:c=0;break;case nq:c=b;break;case Pp:c=b+90;break;case Rp:c=b-90;break;case Fq:c=b+180;break;case Gq:c=we(b);90c&&(c-=180);break;case Qp:c=we(b+90);90c&&(c-=180);break;case Sp:c=we(b-90);90c&&(c-=180);break;case Tp:c=we(b);if(45c||225c)return 0;90c&&(c-=180)}return we(c)}; +Hh.prototype.Nn=function(a,b,c,d){this.Yo=a;var e=this.Oi;e.reset();var f=0,h=0;if(isNaN(this.Ba.width)){f=this.Ed.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===f.length)f=0;else if(this.xx){for(var k=h=0,l=!1;!l;){var m=f.indexOf("\n",k);-1===m&&(m=f.length,l=!0);k=Hq(f.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.ng);k>h&&(h=k);k=m+1}f=h}else h=f.indexOf("\n",0),0<=h&&(f=f.substr(0,h)),f=k=Hq(f,this.ng);f=Math.min(f,a/this.scale);f=Math.max(8,f)}else f=this.Ba.width;null!==this.O&&(f=Math.min(f, +this.O.Bf.width),f=Math.max(f,this.O.zh.width));h=Dq(this,f,e);m=h=isNaN(this.Ba.height)?Math.min(h,b/this.scale):this.Ba.height;if(0!==e.ef&&1!==e.Qe.length&&this.Xi===Bq&&(b=this.ng,l=this.Xi===Bq?Iq(b):0,k=this.bi+this.ci,k=Math.max(0,Eq(this)+k),m=Math.min(this.MI-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Qe.length))){k=e.Qe[m];for(a=Math.max(1,a-l);Hq(k,b)>a&&1=a.fh)return new ha(0,l);if(a.rk===zq){c.gj=1;f=Hq(b,k);if(0===h||f<=d)return c.ef=f,c.pf.push(c.ef),c.Qe.push(b),new ha(f,l);var m=Jq(b);b=b.substr(m.length);for(var n=Jq(b),f=Hq(m+n,k);0d&&1d;){n=1;f=Hq(m.substr(0,n),k);for(h=0;f<=d;)n++,h=f,f=Hq(m.substr(0,n),k);1===n?(c.pf[a.je+p]=f,e=Math.max(e,f)):(c.pf[a.je+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Qe[a.je+p]=m.substr(0,n);p++;m=m.substr(n);if(a.je+p>a.fh)break}n=Jq(b);for(f=Hq(m+n,k);0a.fh))break}c.gj=Math.min(a.fh,p);c.ef=Math.max(c.ef,e);return new ha(c.ef,l*c.gj)}function Jq(a){for(var b=a.length,c=0;c=b?a:a.substr(0,c)} +function Hq(a,b){xq!==b&&(xq=yq.font=b);return yq.measureText(a).width}function Eq(a){if(null!==a.wm)return a.wm;var b=a.ng;xq!==b&&(xq=yq.font=b);var c=0;void 0!==sq[b]&&5E3>tq?c=sq[b]:(c=1.3*yq.measureText("M").width,sq[b]=c,tq++);return a.wm=c}function Iq(a){xq!==a&&(xq=yq.font=a);var b=0;void 0!==uq[a]&&5E3>vq?b=uq[a]:(b=yq.measureText(wq).width,uq[a]=b,vq++);return b} +function Dq(a,b,c){var d=a.Ed.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.bi+a.ci,e=Math.max(0,Eq(a)+e);if(0===d.length)return c.ef=0,a.je=1,e;if(!a.xx){var f=d.indexOf("\n",0);0<=f&&(d=d.substr(0,f))}for(var f=0,h=a.je=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.rk!==zq?(c.gj=0,h=Cq(a,h,c,b),f+=h.height,a.je+=c.gj):(Cq(a,h,c,b),f+=e,a.je++),a.je===a.fh&&(l=!0)),h=k+1;return a.Wv=f} +w.defineProperty(Hh,{pB:"textValidation"},function(){return this.xl},function(a){var b=this.xl;b!==a&&(null!==a&&w.j(a,"function",Hh,"textValidation"),this.xl=a,this.h("textValidation",b,a))});w.defineProperty(Hh,{nG:"textEdited"},function(){return this.it},function(a){var b=this.it;b!==a&&(null!==a&&w.j(a,"function",Hh,"textEdited"),this.it=a,this.h("textEdited",b,a))}); +w.defineProperty(Hh,{HL:"spacingAbove"},function(){return this.bi},function(a){var b=this.bi;b!==a&&(this.bi=a,this.h("spacingAbove",b,a))});w.defineProperty(Hh,{IL:"spacingBelow"},function(){return this.ci},function(a){var b=this.ci;b!==a&&(this.ci=a,this.h("spacingBelow",b,a))});w.defineProperty(Hh,{MI:"maxLines"},function(){return this.fh},function(a){var b=this.fh;b!==a&&(a=Math.floor(a),0>=a&&w.Ea(a,"> 0",Hh,"maxLines"),this.fh=a,this.h("maxLines",b,a),this.I())});w.u(Hh,{lL:"metrics"},function(){return this.Oi}); +w.defineProperty(Hh,{xK:"choices"},function(){return this.Rq},function(a){var b=this.Rq;b!==a&&(null===a||Array.isArray(a)||w.yd(a,"Array",Hh,"choices:value"),this.Rq=a,this.h("choices",b,a))});function Up(){this.ef=this.gj=0;this.pf=[];this.Qe=[]}Up.prototype.reset=function(){this.ef=this.gj=0;this.pf=[];this.Qe=[]};Up.prototype.Lp=function(a){this.gj=a.gj;this.ef=a.ef;this.pf=w.Il(a.pf);this.Qe=w.Il(a.Qe)};w.u(Up,{tK:"arrSize"},function(){return this.pf});w.u(Up,{uK:"arrText"},function(){return this.Qe}); +w.u(Up,{kL:"maxLineWidth"},function(){return this.ef});function wl(){G.call(this);this.Se=null;this.bt="";this.jk=Nd;this.Mo=De;this.gi=this.Te=null;this.Lo=Gb;this.mg=Nj;this.xp=null;this.ez=!1;this.xv=!0;this.Uv=!1;this.op=null}w.La(wl,G);w.fa("Picture",wl);wl.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.element=this.Se;a.bt=this.bt;a.jk=this.jk.S();a.Mo=this.Mo;a.mg=this.mg;a.Te=this.Te;a.gi=this.gi;a.Lo=this.Lo.S();a.xv=this.xv;a.op=this.op}; +wl.prototype.gc=function(a){a===Nj||a===Pj||a===Qj?this.kI=a:G.prototype.gc.call(this,a)};wl.prototype.toString=function(){return"Picture("+this.source+")#"+w.Kd(this)};var Kq=new sa,Lq=0,ql=[];function Mq(){var a=ql;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d=d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(f=f+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case De:n=d.width;p=d.height;break;case Pj:case Qj:var s=0;q===Pj?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===Qj&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(f=(f+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height), +n=d.width,p=d.height)}var q=this.oj()*b.scale,u=k*h/(n*q*p*q),s=Kq[this.source],q=null;if(void 0!==s&&16s.Gp.length&&(Rq(s,4,l,m),Rq(s,16,l,m));for(var l=s.Gp,m=l.length,q=l[0],t=0;te;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.2,.22);b.B=new L(.8, +.9);w.q(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=Vq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.07,.25);b.B=new L(.93,.75);w.q(a);return b},Heptagon:function(a,b,c){var d=Vq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.2,.15);b.B=new L(.8,.85);w.q(a);return b},Octagon:function(a,b,c){var d=Vq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0); +for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.85);w.q(a);return b},Nonagon:function(a,b,c){var d=Vq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.17,.13);b.B=new L(.82,.82);w.q(a);return b},Decagon:function(a,b,c){var d=Vq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b}, +Dodecagon:function(a,b,c){var d=Vq(12);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b},FivePointedStar:function(a,b,c){var d=Uq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.312,.383);b.B=new L(.693,.765);w.q(a);return b},SixPointedStar:function(a,b,c){var d=Uq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x* +b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.17,.251);b.B=new L(.833,.755);w.q(a);return b},SevenPointedStar:function(a,b,c){var d=Uq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.363,.361);b.B=new L(.641,.709);w.q(a);return b},EightPointedStar:function(a,b,c){var d=Uq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.252,.255);b.B=new L(.75,.75);w.q(a);return b},NinePointedStar:function(a, +b,c){var d=Uq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.355,.361);b.B=new L(.645,.651);w.q(a);return b},TenPointedStar:function(a,b,c){var d=Uq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.wa(d);O(a);b=a.o;b.A=new L(.281,.261);b.B=new L(.723,.748);w.q(a);return b},FivePointedBurst:function(a,b,c){var d=Tq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;ea&&(a=.15);var d=w.s(),e=.2*ad;M(d,0,.2*c,!0);N(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);N(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);N(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);N(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c); -M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.$a(!1);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},DividedProcess:function(a,b,c){a=a?a.Cc:NaN;if(isNaN(a)||.1>a)a=.1;var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.$a(!1);b=d.o;b.A=new L(0,a);b.B=Kb;w.q(d);return b},Document:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);b=a.o;b.A=vb;b.B=new L(1,.6);w.q(a); +w.s();var d=.5*cd,e=.1*cd;M(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);N(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);N(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);M(a,1*b,.1*c,!1);N(a,1*b,(.1+e)*c,(.5+d)*b,.2*c,.5*b,.2*c);N(a,(.5-d)*b,.2*c,0,(.1+e)*c,0,.1*c);a.moveTo(1*b,.2*c);N(a,1*b,(.2+e)*c,(.5+d)*b,.3*c,.5*b,.3*c);N(a,(.5-d)*b,.3*c,0,(.2+e)*c,0,.2*c);a.$a(!1);b=a.o;b.A=new L(0,.3);b.B=new L(1,.9);w.q(a);return b},Display:function(a, +b,c){a=w.s();M(a,.25*b,0,!0);a.lineTo(.75*b,0);N(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);O(a);b=a.o;b.A=new L(.25,0);b.B=new L(.75,1);w.q(a);return b},DividedEvent:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=w.s(),e=.2*cd;M(d,0,.2*c,!0);N(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);N(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);N(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);N(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c); +M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.$a(!1);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},DividedProcess:function(a,b,c){a=a?a.Cc:NaN;if(isNaN(a)||.1>a)a=.1;var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.$a(!1);b=d.o;b.A=new L(0,a);b.B=Lb;w.q(d);return b},Document:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);b=a.o;b.A=xb;b.B=new L(1,.6);w.q(a); return b},ExternalOrganization:function(a,b,c){a=a?a.Cc:NaN;if(isNaN(a)||.2>a)a=.2;var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.$a(!1);b=d.o;b.A=new L(a/2,a/2);b.B=new L(1-a/2,1-a/2);w.q(d);return b},ExternalProcess:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);O(a); -M(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.$a(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.75);w.q(a);return b},File:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);O(a);M(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.$a(!1);b=a.o;b.A=new L(0,.25);b.B=Kb;w.q(a);return b},Interrupt:function(a,b,c){a=w.s();M(a,1*b, -.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},InternalStorage:function(a,b,c){var d=a?a.Cc:NaN;a=a?a.vu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);O(e);M(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.$a(!1);b=e.o;b.A=new L(d,a);b.B=Kb;w.q(e);return b},Junction:function(a,b, -c){a=w.s();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,f=.5*ad;M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.5+f)*b,1*c,.5*b,1*c);N(a,(.5-f)*b,1*c,0,(.5+f)*c,0,.5*c);N(a,0,(.5-f)*c,(.5-f)*b,0,.5*b,0);N(a,(.5+f)*b,0,1*b,(.5-f)*c,1*b,.5*c);M(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.$a(!1);b=a.o;b.Zd=Kj;w.q(a);return b},LinedDocument:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);M(a,.1* -b,0,!1);a.lineTo(.1*b,.75*c);a.$a(!1);b=a.o;b.A=new L(.1,0);b.B=new L(1,.6);w.q(a);return b},LoopLimit:function(a,b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=Kb;w.q(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=w.s();var d=.5*ad;M(a,.5*b,1*c,!0);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+ -d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.8);w.q(a);return b},ManualInput:function(a,b,c){a=w.s();M(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);O(a);b=a.o;b.A=new L(0,.25);b.B=Kb;w.q(a);return b},MessageFromUser:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.7);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=vb;b.B=new L(a,1);w.q(d);return b}, +M(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.$a(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.75);w.q(a);return b},File:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);O(a);M(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.$a(!1);b=a.o;b.A=new L(0,.25);b.B=Lb;w.q(a);return b},Interrupt:function(a,b,c){a=w.s();M(a,1*b, +.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},InternalStorage:function(a,b,c){var d=a?a.Cc:NaN;a=a?a.uu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);O(e);M(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.$a(!1);b=e.o;b.A=new L(d,a);b.B=Lb;w.q(e);return b},Junction:function(a,b, +c){a=w.s();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,f=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.5+f)*b,1*c,.5*b,1*c);N(a,(.5-f)*b,1*c,0,(.5+f)*c,0,.5*c);N(a,0,(.5-f)*c,(.5-f)*b,0,.5*b,0);N(a,(.5+f)*b,0,1*b,(.5-f)*c,1*b,.5*c);M(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.$a(!1);b=a.o;b.Zd=Pj;w.q(a);return b},LinedDocument:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);M(a,.1* +b,0,!1);a.lineTo(.1*b,.75*c);a.$a(!1);b=a.o;b.A=new L(.1,0);b.B=new L(1,.6);w.q(a);return b},LoopLimit:function(a,b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=Lb;w.q(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=w.s();var d=.5*cd;M(a,.5*b,1*c,!0);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+ +d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.8);w.q(a);return b},ManualInput:function(a,b,c){a=w.s();M(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);O(a);b=a.o;b.A=new L(0,.25);b.B=Lb;w.q(a);return b},MessageFromUser:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.7);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=xb;b.B=new L(a,1);w.q(d);return b}, MicroformProcessing:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.25);var d=w.s();M(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},MicroformRecording:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=new L(1,.75);w.q(a);return b},MultiDocument:function(a,b,c){c/=.8;a=w.s(); M(a,b,0,!0);a.lineTo(b,.5*c);N(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);N(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);N(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);O(a);M(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.$a(!1);b=a.o;b.A=new L(0,.25);b.B=new L(.8,.77);w.q(a);return b},MultiProcess:function(a,b,c){a=w.s(); M(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);O(a);M(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.9*c);a.$a(!1);b=a.o;b.A=new L(0,.2);b.B=new L(.8,1);w.q(a);return b},OfflineStorage:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=w.s();M(e,0,0,!0);e.lineTo(1* -b,0);e.lineTo(.5*b,1*c);O(e);M(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.$a(!1);b=e.o;b.A=new L(d/4+.5*a,a);b.B=new L(3*d/4+.5*a,a+.5*d);w.q(e);return b},OffPageConnector:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=vb;b.B=new L(.75,1);w.q(a);return b},Or:function(a,b,c){a=w.s();var d=.5*ad;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a, -(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.$a(!1);b=a.o;b.Zd=Kj;w.q(a);return b},PaperTape:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,.3*c);N(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);b=a.o;b.A=new L(0,.49);b.B=new L(1,.75);w.q(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Cc:NaN;a=a?a.vu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1- -a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);O(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Cc:NaN;a=a?a.vu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);O(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0, -1*c);O(d);M(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.$a(!1);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);w.q(d);return b},Process:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,a*b,0,!1);d.lineTo(a*b,1*c);d.$a(!1);b=d.o;b.A=new L(a,0);b.B=Kb;w.q(d);return b},Sort:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);O(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5* +b,0);e.lineTo(.5*b,1*c);O(e);M(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.$a(!1);b=e.o;b.A=new L(d/4+.5*a,a);b.B=new L(3*d/4+.5*a,a+.5*d);w.q(e);return b},OffPageConnector:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=xb;b.B=new L(.75,1);w.q(a);return b},Or:function(a,b,c){a=w.s();var d=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a, +(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.$a(!1);b=a.o;b.Zd=Pj;w.q(a);return b},PaperTape:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,.3*c);N(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);b=a.o;b.A=new L(0,.49);b.B=new L(1,.75);w.q(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Cc:NaN;a=a?a.uu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1- +a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);O(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Cc:NaN;a=a?a.uu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);O(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0, +1*c);O(d);M(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.$a(!1);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);w.q(d);return b},Process:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,a*b,0,!1);d.lineTo(a*b,1*c);d.$a(!1);b=d.o;b.A=new L(a,0);b.B=Lb;w.q(d);return b},Sort:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);O(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5* c);a.$a(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.5);w.q(a);return b},Start:function(a,b,c){a=w.s();M(a,.25*b,0,!0);M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);M(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.$a(!1);b=a.o;b.A=new L(.25,0);b.B=new L(.75,1);w.q(a);return b},Terminator:function(a,b,c){a=w.s();M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.o;b.A=new L(.23,0); -b.B=new L(.77,1);w.q(a);return b},TransmittalTape:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);O(d);b=d.o;b.A=vb;b.B=new L(1,1-a);w.q(d);return b},AndGate:function(a,b,c){a=w.s();var d=.5*ad;M(a,0,0,!0);a.lineTo(.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=vb;b.B=new L(.55,1);w.q(a);return b},Buffer:function(a,b,c){a=w.s();M(a, -0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Clock:function(a,b,c){a=w.s();var d=.5*ad;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);M(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2* -b,.75*c);a.$a(!1);b=a.o;b.Zd=Kj;w.q(a);return b},Ground:function(a,b,c){a=w.s();M(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.o;w.q(a);return b},Inverter:function(a,b,c){a=w.s();var d=.1*ad;M(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);N(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);N(a,.8*b,(.5-d)*c,(.9-d)*b,.4* -c,.9*b,.4*c);N(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(0,.25);b.B=new L(.4,.75);w.q(a);return b},NandGate:function(a,b,c){a=w.s();var d=.5*ad,e=.4*ad,f=.1*ad;M(a,.8*b,.5*c,!0);N(a,.8*b,(.5+e)*c,(.4+d)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);N(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.9+f)*b,.6*c,.9*b,.6*c);N(a,(.9-f)*b,.6*c,.8*b,(.5+f)*c,.8*b,.5*c);N(a,.8*b,(.5-f)*c,(.9-f)*b,.4*c,.9*b,.4*c);N(a,(.9+f)*b,.4*c,1*b,(.5-f)*c,1*b,.5* -c);b=a.o;b.A=new L(0,.05);b.B=new L(.55,.95);w.q(a);return b},NorGate:function(a,b,c){a=w.s();var d=.5,e=ad*d,f=0,h=.5;M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);N(a,(f+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*ad;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A= -new L(.2,.25);b.B=new L(.6,.75);w.q(a);return b},OrGate:function(a,b,c){a=w.s();var d=.5*ad;M(a,0,0,!0);N(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);N(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);O(a);b=a.o;b.A=new L(.2,.25);b.B=new L(.75,.75);w.q(a);return b},XnorGate:function(a,b,c){a=w.s();var d=.5,e=ad*d,f=.2,h=.5;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);N(a,(f+e)* -b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*ad;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A=new L(.4,.25);b.B=new L(.65,.75);w.q(a);return b},XorGate:function(a,b,c){a=w.s();var d=.5*ad;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.2*b,0,!0);N(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);N(a,.9*b,(.5+d)* -c,(.2+d)*b,1*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);O(a);b=a.o;b.A=new L(.4,.25);b.B=new L(.8,.75);w.q(a);return b},Capacitor:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Resistor:function(a,b,c){a=w.s();M(a,0,.5*c,!1);a.lineTo(.1*b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.o;w.q(a);return b},Inductor:function(a,b,c){a=w.s();var d=.1*ad,e=.1;M(a,(e-.5* -d)*b,c,!1);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;N(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.o;w.q(a);return b},ACvoltageSource:function(a,b,c){a=w.s();var d=.5*ad;M(a,0*b,.5*c,!1);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)* -c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);N(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.o;b.Zd=Kj;w.q(a);return b},DCvoltageSource:function(a,b,c){a=w.s();M(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Diode:function(a,b,c){a=w.s();M(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Wifi:function(a,b,c){var d=b,e=c; -b*=.38;c*=.6;a=w.s();var f=.8*ad,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);O(a);f=.4*ad;h=.4;k=.2;l=.5;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k* -b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);O(a);f=.2*ad;h=.2;l=k=.5;M(a,(k-h)*b+d,l*c+e,!0);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);f=.4*ad;h=.4;k=.8;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l- -h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);O(a);f=.8*ad;h=.8;k=1;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+ +b.B=new L(.77,1);w.q(a);return b},TransmittalTape:function(a,b,c){a=a?a.Cc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);O(d);b=d.o;b.A=xb;b.B=new L(1,1-a);w.q(d);return b},AndGate:function(a,b,c){a=w.s();var d=.5*cd;M(a,0,0,!0);a.lineTo(.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=xb;b.B=new L(.55,1);w.q(a);return b},Buffer:function(a,b,c){a=w.s();M(a, +0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Clock:function(a,b,c){a=w.s();var d=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);M(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2* +b,.75*c);a.$a(!1);b=a.o;b.Zd=Pj;w.q(a);return b},Ground:function(a,b,c){a=w.s();M(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.o;w.q(a);return b},Inverter:function(a,b,c){a=w.s();var d=.1*cd;M(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);N(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);N(a,.8*b,(.5-d)*c,(.9-d)*b,.4* +c,.9*b,.4*c);N(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(0,.25);b.B=new L(.4,.75);w.q(a);return b},NandGate:function(a,b,c){a=w.s();var d=.5*cd,e=.4*cd,f=.1*cd;M(a,.8*b,.5*c,!0);N(a,.8*b,(.5+e)*c,(.4+d)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);N(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.9+f)*b,.6*c,.9*b,.6*c);N(a,(.9-f)*b,.6*c,.8*b,(.5+f)*c,.8*b,.5*c);N(a,.8*b,(.5-f)*c,(.9-f)*b,.4*c,.9*b,.4*c);N(a,(.9+f)*b,.4*c,1*b,(.5-f)*c,1*b,.5* +c);b=a.o;b.A=new L(0,.05);b.B=new L(.55,.95);w.q(a);return b},NorGate:function(a,b,c){a=w.s();var d=.5,e=cd*d,f=0,h=.5;M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);N(a,(f+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*cd;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A= +new L(.2,.25);b.B=new L(.6,.75);w.q(a);return b},OrGate:function(a,b,c){a=w.s();var d=.5*cd;M(a,0,0,!0);N(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);N(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);O(a);b=a.o;b.A=new L(.2,.25);b.B=new L(.75,.75);w.q(a);return b},XnorGate:function(a,b,c){a=w.s();var d=.5,e=cd*d,f=.2,h=.5;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);N(a,(f+e)* +b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*cd;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A=new L(.4,.25);b.B=new L(.65,.75);w.q(a);return b},XorGate:function(a,b,c){a=w.s();var d=.5*cd;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.2*b,0,!0);N(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);N(a,.9*b,(.5+d)* +c,(.2+d)*b,1*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);O(a);b=a.o;b.A=new L(.4,.25);b.B=new L(.8,.75);w.q(a);return b},Capacitor:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Resistor:function(a,b,c){a=w.s();M(a,0,.5*c,!1);a.lineTo(.1*b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.o;w.q(a);return b},Inductor:function(a,b,c){a=w.s();var d=.1*cd,e=.1;M(a,(e-.5* +d)*b,c,!1);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;N(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.o;w.q(a);return b},ACvoltageSource:function(a,b,c){a=w.s();var d=.5*cd;M(a,0*b,.5*c,!1);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)* +c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);N(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.o;b.Zd=Pj;w.q(a);return b},DCvoltageSource:function(a,b,c){a=w.s();M(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Diode:function(a,b,c){a=w.s();M(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Wifi:function(a,b,c){var d=b,e=c; +b*=.38;c*=.6;a=w.s();var f=.8*cd,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);O(a);f=.4*cd;h=.4;k=.2;l=.5;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k* +b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);O(a);f=.2*cd;h=.2;l=k=.5;M(a,(k-h)*b+d,l*c+e,!0);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);f=.4*cd;h=.4;k=.8;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l- +h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);O(a);f=.8*cd;h=.8;k=1;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+ e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);O(a);b=a.o;w.q(a);return b},Email:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);O(a);M(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.$a(!1);b=a.o;w.q(a);return b},Ethernet:function(a,b,c){a=w.s();M(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);O(a);M(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c); -a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);O(a);M(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);O(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.$a(!1);b=a.o;w.q(a);return b},Power:function(a,b,c){a=w.s();var d=.4*ad,e=.4,f=w.K(),h=w.K(),k=w.K(),l=w.K();he(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);var m=w.xb(h.x, -h.y);M(a,h.x*b,h.y*c,!0);N(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);he(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);N(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*ad;e=.3;he(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);a.lineTo(h.x*b,h.y*c);N(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);N(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+ -e)*b,.5*c);he(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);N(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);O(a);M(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);O(a);w.v(f);w.v(h);w.v(k);w.v(l);w.v(m);b=a.o;b.A=new L(.25,.55);b.B=new L(.75,.8);w.q(a);return b},Fallout:function(a,b,c){a=w.s();var d=.5*ad;M(a,0*b,.5*c,!0);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b, -.5*c);var e=d=0;M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;O(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;O(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);O(a);b=a.o;b.Zd=Kj;w.q(a);return b},IrritationHazard:function(a,b,c){a=w.s();M(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8* +a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);O(a);M(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);O(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.$a(!1);b=a.o;w.q(a);return b},Power:function(a,b,c){a=w.s();var d=.4*cd,e=.4,f=w.K(),h=w.K(),k=w.K(),l=w.K();de(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);var m=w.xb(h.x, +h.y);M(a,h.x*b,h.y*c,!0);N(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);de(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);N(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*cd;e=.3;de(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);a.lineTo(h.x*b,h.y*c);N(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);N(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+ +e)*b,.5*c);de(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);N(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);O(a);M(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);O(a);w.v(f);w.v(h);w.v(k);w.v(l);w.v(m);b=a.o;b.A=new L(.25,.55);b.B=new L(.75,.8);w.q(a);return b},Fallout:function(a,b,c){a=w.s();var d=.5*cd;M(a,0*b,.5*c,!0);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b, +.5*c);var e=d=0;M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;O(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;O(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);O(a);b=a.o;b.Zd=Pj;w.q(a);return b},IrritationHazard:function(a,b,c){a=w.s();M(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8* b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);O(a);b=a.o;b.A=new L(.3,.3);b.B=new L(.7,.7);w.q(a);return b},ElectricalHazard:function(a,b,c){a=w.s();M(a,.37*b,0*c,!0);a.lineTo(.5*b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65* b,.56*c);a.lineTo(0*b,.68*c);O(a);b=a.o;w.q(a);return b},FireHazard:function(a,b,c){a=w.s();M(a,.1*b,1*c,!0);N(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);N(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);N(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);N(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);N(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);N(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);O(a);b=a.o;b.A=new L(.05,.645);b.B=new L(.884,.908);w.q(a);return b},BpmnActivityLoop:function(a,b,c){a=w.s();var d=4*(Math.SQRT2-1)/3*.5;M(a,.65*b,1*c, !1);N(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);N(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);N(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);N(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.o;w.q(a);return b},BpmnActivityParallel:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},BpmnActivitySequential:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(1* @@ -1466,8 +1469,8 @@ b,c){a=w.s();M(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8* BpmnTaskUser:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);N(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);N(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*b,.405*c);var d=.5-.285,e=Math.PI/4,f=4*(1-Math.cos(e))/(3*Math.sin(e)),e=f*d,f=f*d;N(a,(.5-(e+d)/2)*b,(d+(d+f)/2)*c,(.5-d)*b,(d+f)*c,(.5-d)*b,d*c);N(a,(.5-d)*b,(d-f)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c); N(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-f)*c,(.5+d)*b,d*c);N(a,(.5+d)*b,(d+f)*c,(.5+(e+d)/2)*b,(d+(d+f)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);M(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);M(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.o;w.q(a);return b},BpmnEventConditional:function(a,b,c){a=w.s();M(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);O(a);M(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8* b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.$a(!1);b=a.o;w.q(a);return b},BpmnEventError:function(a,b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);O(a);b=a.o;w.q(a);return b},BpmnEventEscalation:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,1*b,1*c,!1);M(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);O(a);b=a.o;w.q(a);return b},BpmnEventTimer:function(a,b,c){a= -w.s();var d=.5*ad;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.$a(!1);b=a.o;b.Zd=Kj;w.q(a);return b}},Uq;for(Uq in fq)fq[Uq.toLowerCase()]=Uq; -var mq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", +w.s();var d=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.$a(!1);b=a.o;b.Zd=Pj;w.q(a);return b}},Wq;for(Wq in hq)hq[Wq.toLowerCase()]=Wq; +var oq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4", BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", @@ -1476,174 +1479,174 @@ DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z", OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"}; -function jq(a){var b=Ud[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Ud[c];if(void 0===b){var d=null,e;for(e in mq)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=We(mq[d],!1),Ud[d]=a,c!==d&&(Ud[c]=d),d}}return"string"===typeof b?b:b instanceof Fe?a:null} -function S(a){C.call(this,a);this.N=2408959;this.kl=this.ui="";this.Js=this.Gs=this.Ss=this.Tr=null;this.Us="";this.si=this.Gr=this.Ts=this.Zm=null;this.Is="";this.ip=null;this.Hs=Dd;this.Ks="";this.kp=null;this.Dd="";this.Rv=this.Vq=this.Xk=null;this.Ri=(new z(NaN,NaN)).freeze();this.Yr="";this.nl=null;this.Zr=vb;this.gs=ld;this.$r=md;this.or=null;this.Ur=Vq;this.an=kd;this.$m="gray";this.zg=4;this.VC=-1;this.tt=NaN;this.DG=new A;this.Nm=null;this.bk=NaN}w.La(S,C);w.fa("Part",S); -S.prototype.cloneProtected=function(a){C.prototype.cloneProtected.call(this,a);a.N=this.N&-4097|49152;a.ui=this.ui;a.kl=this.kl;a.Tr=this.Tr;a.Ss=this.Ss;a.Gs=this.Gs;a.Js=this.Js;a.Us=this.Us;a.Ts=this.Ts;a.Gr=this.Gr;a.si=null;a.Is=this.Is;a.Hs=this.Hs.S();a.Ks=this.Ks;a.Dd=this.Dd;a.Vq=this.Vq;a.Ri.assign(this.Ri);a.Yr=this.Yr;a.Zr=this.Zr.S();a.gs=this.gs.S();a.$r=this.$r.S();a.or=this.or;a.Ur=this.Ur;a.an=this.an.S();a.$m=this.$m;a.zg=this.zg;a.tt=this.tt}; -S.prototype.ki=function(a){C.prototype.ki.call(this,a);a.Vl();a.Zm=null;a.ip=null;a.kp=null;a.nl=null;a.Nm=null};S.prototype.toString=function(){var a=w.hf(Object.getPrototypeOf(this))+"#"+w.Jd(this);null!==this.data&&(a+="("+Qf(this.data)+")");return a};S.LayoutNone=0;var Hm;S.LayoutAdded=Hm=1;var Qm;S.LayoutRemoved=Qm=2;S.LayoutShown=4;S.LayoutHidden=8;S.LayoutNodeSized=16;var wn;S.LayoutGroupLayout=wn=32;S.LayoutNodeReplaced=64;var Vq;S.LayoutStandard=Vq=Hm|Qm|28|wn|64;S.LayoutAll=16777215; -S.prototype.Tn=function(a,b,c,d,e,f,h){var k=this.g;null!==k&&(a===Of&&"elements"===b?e instanceof C?Im(e,function(a){Km(k,a);Jm(k,a)}):e instanceof tl&&hn(k,e):a===Pf&&"elements"===b&&(e instanceof C?Im(e,function(a){Om(k,a);Nm(k,a)}):e instanceof tl&&jn(k,e)),k.Wc(a,b,c,d,e,f,h))};S.prototype.updateTargetBindings=S.prototype.Hb=function(a){C.prototype.Hb.call(this,a);if(null!==this.data){a=this.wa.n;for(var b=a.length,c=0;ch&&a.y>k&&a.righth&&b.y>k&&b.right=c.LI)){this.N^=4096;var d=!1;if(null!==c){d=c.wb;c.wb=!0;var e=c.selection;e.Ra();a?e.add(this):e.remove(this);e.freeze()}this.h("isSelected",b,a);this.ce();a=this.vJ;null!==a&&a(this);null!==c&&(c.Le(),c.wb=d)}}}); -w.defineProperty(S,{Lg:"isHighlighted"},function(){return 0!==(this.N&524288)},function(a){var b=0!==(this.N&524288);if(b!==a){this.N^=524288;var c=this.g;null!==c&&(c=c.Ul,c.Ra(),a?c.add(this):c.remove(this),c.freeze());this.h("isHighlighted",b,a);this.na();a=this.fI;null!==a&&a(this)}});w.defineProperty(S,{Zl:"isShadowed"},function(){return 0!==(this.N&8192)},function(a){var b=0!==(this.N&8192);b!==a&&(this.N^=8192,this.h("isShadowed",b,a),this.na())});function Am(a){return 0!==(a.N&32768)} -function Yq(a,b){a.N=b?a.N|32768:a.N&-32769}function Eo(a,b){a.N=b?a.N|65536:a.N&-65537}function fl(a){return 0!==(a.N&131072)}S.prototype.Bf=function(a){this.N=a?this.N|131072:this.N&-131073};function gr(a,b){a.N=b?a.N|1048576:a.N&-1048577}w.defineProperty(S,{cF:"isAnimated"},function(){return 0!==(this.N&262144)},function(a){var b=0!==(this.N&262144);b!==a&&(this.N^=262144,this.h("isAnimated",b,a))}); -w.defineProperty(S,{fI:"highlightedChanged"},function(){return this.Gr},function(a){var b=this.Gr;b!==a&&(null!==a&&w.j(a,"function",S,"highlightedChanged"),this.Gr=a,this.h("highlightedChanged",b,a))});w.defineProperty(S,{ZA:"selectionObjectName"},function(){return this.Us},function(a){var b=this.Us;b!==a&&(this.Us=a,this.Zm=null,this.h("selectionObjectName",b,a))}); -w.defineProperty(S,{uJ:"selectionAdornmentTemplate"},function(){return this.Ss},function(a){var b=this.Ss;b!==a&&(this instanceof W&&(a.type=aj),this.Ss=a,this.h("selectionAdornmentTemplate",b,a))});w.u(S,{Eu:"selectionObject"},function(){if(null===this.Zm){var a=this.ZA;null!==a&&""!==a?(a=this.sd(a),this.Zm=null!==a?a:this):this instanceof W?(a=this.path,this.Zm=null!==a?a:this):this.Zm=this}return this.Zm}); -w.defineProperty(S,{vJ:"selectionChanged"},function(){return this.Ts},function(a){var b=this.Ts;b!==a&&(null!==a&&w.j(a,"function",S,"selectionChanged"),this.Ts=a,this.h("selectionChanged",b,a))});w.defineProperty(S,{RF:"resizeAdornmentTemplate"},function(){return this.Gs},function(a){var b=this.Gs;b!==a&&(this.Gs=a,this.h("resizeAdornmentTemplate",b,a))}); -w.defineProperty(S,{TF:"resizeObjectName"},function(){return this.Is},function(a){var b=this.Is;b!==a&&(this.Is=a,this.ip=null,this.h("resizeObjectName",b,a))});w.u(S,{SF:"resizeObject"},function(){if(null===this.ip){var a=this.TF;null!==a&&""!==a?(a=this.sd(a),this.ip=null!==a?a:this):this.ip=this}return this.ip});w.defineProperty(S,{kJ:"resizeCellSize"},function(){return this.Hs},function(a){var b=this.Hs;b.L(a)||(this.Hs=a=a.S(),this.h("resizeCellSize",b,a))}); -w.defineProperty(S,{nJ:"rotateAdornmentTemplate"},function(){return this.Js},function(a){var b=this.Js;b!==a&&(this.Js=a,this.h("rotateAdornmentTemplate",b,a))});w.defineProperty(S,{oJ:"rotateObjectName"},function(){return this.Ks},function(a){var b=this.Ks;b!==a&&(this.Ks=a,this.kp=null,this.h("rotateObjectName",b,a))});w.u(S,{VF:"rotateObject"},function(){if(null===this.kp){var a=this.oJ;null!==a&&""!==a?(a=this.sd(a),this.kp=null!==a?a:this):this.kp=this}return this.kp}); -w.defineProperty(S,{text:"text"},function(){return this.Dd},function(a){var b=this.Dd;b!==a&&(this.Dd=a,this.h("text",b,a))}); -w.defineProperty(S,{Ka:"containingGroup"},function(){return this.Xk},function(a){if(this.de()){var b=this.Xk;if(b!==a){null===a||this!==a&&!a.mi(this)||(this===a&&w.k("Cannot make a Group a member of itself: "+this.toString()),w.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.J(Qm);var c=this.g;null!==b?hr(b,this):this instanceof U&&null!==c&&c.wl.remove(this);this.Xk=a;null!==a?ir(a,this):this instanceof U&&null!==c&&c.wl.add(this);this.J(Hm); -if(null!==c){var d=this.data,e=c.ba;null!==d&&e instanceof P&&e.bB(d,e.ub(null!==a?a.data:null))}d=this.pE;null!==d&&(e=!0,null!==c&&(e=c.Ua,c.Ua=!0),d(this,b,a),null!==c&&(c.Ua=e));if(this instanceof U)for(c=new J(S),ch(c,this,!0,0,!0),c=c.i;c.next();)if(d=c.value,d instanceof T)for(d=d.fe;d.next();)ln(d.value);if(this instanceof T)for(d=this.fe;d.next();)ln(d.value);this.h("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&kl(b,-1,a))}}else w.k("cannot set the Part.containingGroup of a Link or Adornment")}); -g=S.prototype;g.Vl=function(){var a=this.Ka;null!==a&&(a.I(),null!==a.Kb&&a.Kb.I(),a.Tf())};g.na=function(){var a=this.g;null!==a&&!zm(this)&&!Am(this)&&this.isVisible()&&this.mc.H()&&a.na(jl(this,this.mc))};g.I=function(){C.prototype.I.call(this);var a=this.g;null!==a&&(a.qg.add(this),this instanceof T&&null!==this.Lc&&Oo(this.Lc),a.Le(!0))};g.Wt=function(a){a||(a=this.Xk,null!==a&&ir(a,this))};g.Xt=function(a){a||(a=this.Xk,null!==a&&hr(a,this))}; -g.tn=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.ba,null!==b&&b.Xx(a))}};w.defineProperty(S,{pE:"containingGroupChanged"},function(){return this.Vq},function(a){var b=this.Vq;b!==a&&(null!==a&&w.j(a,"function",S,"containingGroupChanged"),this.Vq=a,this.h("containingGroupChanged",b,a))});S.prototype.findSubGraphLevel=function(){return jr(this,this)};function jr(a,b){var c=b.Ka;return null!==c?1+jr(a,c):b instanceof T&&(c=b.Lc,null!==c)?jr(a,c):0} -S.prototype.findTopLevelPart=function(){return kr(this,this)};function kr(a,b){var c=b.Ka;return null!==c?kr(a,c):b instanceof T&&(c=b.Lc,null!==c)?kr(a,c):b}w.u(S,{cq:"isTopLevel"},function(){return null!==this.Ka||this instanceof T&&this.lf?!1:!0});S.prototype.isMemberOf=S.prototype.mi=function(a){return a instanceof U?lr(this,this,a):!1};function lr(a,b,c){if(b===c||null===c)return!1;var d=b.Ka;return null===d||d!==c&&!lr(a,d,c)?b instanceof T&&(b=b.Lc,null!==b)?lr(a,b,c):!1:!0} -S.prototype.findCommonContainingGroup=S.prototype.MH=function(a){if(null===a)return null;if(this===a)return this.Ka;for(var b=this;null!==b;)b instanceof U&&gr(b,!0),b=b.Ka;for(var c=null,b=a;null!==b;){if(0!==(b.N&1048576)){c=b;break}b=b.Ka}for(b=this;null!==b;)b instanceof U&&gr(b,!1),b=b.Ka;return c};w.defineProperty(S,{AI:"layoutConditions"},function(){return this.Ur},function(a){var b=this.Ur;b!==a&&(this.Ur=a,this.h("layoutConditions",b,a))}); -S.prototype.canLayout=function(){if(!this.lF||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Jc||this instanceof T&&this.lf?!1:!0};S.prototype.invalidateLayout=S.prototype.J=function(a){void 0===a&&(a=16777215);var b;this.lF&&0!==(a&this.AI)?(b=this.layer,null!==b&&b.Jc||this instanceof T&&this.lf?b=!1:(b=this.g,b=null!==b&&b.oa.fb?!1:!0)):b=!1;if(b)if(b=this.Xk,null!==b){var c=b.Rb;null!==c?c.J():b.J(a)}else a=this.g,null!==a&&(c=a.Rb,null!==c&&c.J())}; -function Mm(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Jc?!1:!0}w.defineProperty(S,{AE:"dragComputation"},function(){return this.or},function(a){var b=this.or;b!==a&&(null!==a&&w.j(a,"function",S,"dragComputation"),this.or=a,this.h("dragComputation",b,a))});w.defineProperty(S,{yJ:"shadowOffset"},function(){return this.an},function(a){var b=this.an;b.L(a)||(this.an=a=a.S(),this.na(),this.h("shadowOffset",b,a))}); -w.defineProperty(S,{shadowColor:"shadowColor"},function(){return this.$m},function(a){var b=this.$m;b!==a&&(this.$m=a,this.na(),this.h("shadowColor",b,a))});w.defineProperty(S,{shadowBlur:"shadowBlur"},function(){return this.zg},function(a){var b=this.zg;b!==a&&(this.zg=a,this.na(),this.h("shadowBlur",b,a))});function dh(a){0===arguments.length?S.call(this,Nj):S.call(this,a);this.N&=-257;this.kl="Adornment";this.Dc=null;this.fD=0;this.WD=!1;this.Kb=this.$g=null}w.La(dh,S);w.fa("Adornment",dh); -dh.prototype.toString=function(){var a=this.Nf;return"Adornment("+this.rd+")"+(null!==a?a.toString():"")};dh.prototype.updateRelationshipsFromData=function(){};dh.prototype.lu=function(a){var b=this.qb.U,c=this.qb;if(b instanceof W&&c instanceof X){var d=b.path,c=d.vf;b.lu(a);c=d.vf;a=this.wa.n;b=a.length;for(d=0;da&&(a=1);var b=this.g;if(null!==b&&!b.wh){b.wh=!0;var c=new J(T);c.add(this);xr(this,c,b.Od,a,b.Pa,this,b.sB===ql);b.wh=!1}}; -function xr(a,b,c,d,e,f,h){if(1a&&(a=2);var b=this.g;if(null!==b&&!b.wh){b.wh=!0;var c=new J(T);c.add(this);zr(this,c,b.Od,a,b.Pa,this,b.sB===ql);b.wh=!1}};function zr(a,b,c,d,e,f,h){for(var k=f===a?!1:a.gd,l=c?a.ix():a.Ig();l.next();){var m=l.value;m.Kc&&(k||m.Zg||m.Xb(),m=m.mA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.td(!0),m.Vl(),h&&bl(e,m,f)),2a&&(a-=180);break;case Op:a=Be(c+90);90a&&(a-=180);break;case Qp:a=Be(c-90);90a&&(a-=180);break;case Rp:a=Be(c);if(45a||225a)return 0;90a&&(a-=180)}return Be(a)}; -w.defineProperty(W,{W:"fromNode"},function(){return this.mg},function(a){var b=this.mg;if(b!==a){var c=this.ed;null!==b&&(this.Cg!==b&&ur(b,this,c),Fr(this),this.J(Qm));this.mg=a;null!==a&&this.td(a.isVisible());this.Gi=null;this.Xb();var d=this.g;if(null!==d){var e=this.data,f=d.ba;if(null!==e)if(f instanceof P){var h=null!==a?a.data:null;f.$A(e,f.ub(h))}else f instanceof Zf&&(h=null!==a?a.data:null,d.Od?f.oi(e,f.ub(h)):(null!==b&&f.oi(b.data,void 0),f.oi(h,f.ub(null!==this.Cg?this.Cg.data:null))))}e= -this.ed;f=this.NE;null!==f&&(h=!0,null!==d&&(h=d.Ua,d.Ua=!0),f(this,c,e),null!==d&&(d.Ua=h));null!==a&&(this.Cg!==a&&tr(a,this,e),Gr(this),this.J(Hm));this.h("fromNode",b,a);ln(this)}}); -w.defineProperty(W,{Jg:"fromPortId"},function(){return this.Nh},function(a){var b=this.Nh;if(b!==a){var c=this.ed;null!==c&&sr(this.W,c);Fr(this);this.Nh=a;var d=this.ed;null!==d&&sr(this.W,d);var e=this.g;if(null!==e){var f=this.data,h=e.ba;null!==f&&h instanceof P&&h.aB(f,a)}c!==d&&(this.Gi=null,this.Xb(),f=this.NE,null!==f&&(h=!0,null!==e&&(h=e.Ua,e.Ua=!0),f(this,c,d),null!==e&&(e.Ua=h)));Gr(this);this.h("fromPortId",b,a)}});w.u(W,{ed:"fromPort"},function(){var a=this.mg;return null===a?null:a.Ol(this.Nh)}); -w.defineProperty(W,{NE:"fromPortChanged"},function(){return this.xr},function(a){var b=this.xr;b!==a&&(null!==a&&w.j(a,"function",W,"fromPortChanged"),this.xr=a,this.h("fromPortChanged",b,a))}); -w.defineProperty(W,{$:"toNode"},function(){return this.Cg},function(a){var b=this.Cg;if(b!==a){var c=this.Sd;null!==b&&(this.mg!==b&&ur(b,this,c),Fr(this),this.J(Qm));this.Cg=a;null!==a&&this.td(a.isVisible());this.Gi=null;this.Xb();var d=this.g;if(null!==d){var e=this.data,f=d.ba;if(null!==e)if(f instanceof P){var h=null!==a?a.data:null;f.fB(e,f.ub(h))}else f instanceof Zf&&(h=null!==a?a.data:null,d.Od?(null!==b&&f.oi(b.data,void 0),f.oi(h,f.ub(null!==this.mg?this.mg.data:null))):f.oi(e,f.ub(h)))}e= -this.Sd;f=this.nG;null!==f&&(h=!0,null!==d&&(h=d.Ua,d.Ua=!0),f(this,c,e),null!==d&&(d.Ua=h));null!==a&&(this.mg!==a&&tr(a,this,e),Gr(this),this.J(Hm));this.h("toNode",b,a);ln(this)}}); -w.defineProperty(W,{Eh:"toPortId"},function(){return this.hi},function(a){var b=this.hi;if(b!==a){var c=this.Sd;null!==c&&sr(this.$,c);Fr(this);this.hi=a;var d=this.Sd;null!==d&&sr(this.$,d);var e=this.g;if(null!==e){var f=this.data,h=e.ba;null!==f&&h instanceof P&&h.gB(f,a)}c!==d&&(this.Gi=null,this.Xb(),f=this.nG,null!==f&&(h=!0,null!==e&&(h=e.Ua,e.Ua=!0),f(this,c,d),null!==e&&(e.Ua=h)));Gr(this);this.h("toPortId",b,a)}});w.u(W,{Sd:"toPort"},function(){var a=this.Cg;return null===a?null:a.Ol(this.hi)}); -w.defineProperty(W,{nG:"toPortChanged"},function(){return this.nt},function(a){var b=this.nt;b!==a&&(null!==a&&w.j(a,"function",W,"toPortChanged"),this.nt=a,this.h("toPortChanged",b,a))});w.defineProperty(W,{Ab:"fromSpot"},function(){return null!==this.V?this.V.Rj:oc},function(a){this.Kd();var b=this.V.Rj;b.L(a)||(a=a.S(),this.V.Rj=a,this.h("fromSpot",b,a),this.Xb())}); -w.defineProperty(W,{Rl:"fromEndSegmentLength"},function(){return null!==this.V?this.V.Pj:NaN},function(a){this.Kd();var b=this.V.Pj;b!==a&&(0>a&&w.Ea(a,">= 0",W,"fromEndSegmentLength"),this.V.Pj=a,this.h("fromEndSegmentLength",b,a),this.Xb())});w.defineProperty(W,{St:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.Oj:nr},function(a){this.Kd();var b=this.V.Oj;b!==a&&(w.Gt("Link.fromEndSegmentDirection","2.0"),this.V.Oj=a,this.h("fromEndSegmentDirection",b,a),this.Xb())}); -w.defineProperty(W,{Tt:"fromShortLength"},function(){return null!==this.V?this.V.Qj:NaN},function(a){this.Kd();var b=this.V.Qj;b!==a&&(this.V.Qj=a,this.h("fromShortLength",b,a),this.Xb())});w.defineProperty(W,{Bb:"toSpot"},function(){return null!==this.V?this.V.ok:oc},function(a){this.Kd();var b=this.V.ok;b.L(a)||(a=a.S(),this.V.ok=a,this.h("toSpot",b,a),this.Xb())}); -w.defineProperty(W,{jm:"toEndSegmentLength"},function(){return null!==this.V?this.V.mk:NaN},function(a){this.Kd();var b=this.V.mk;b!==a&&(0>a&&w.Ea(a,">= 0",W,"toEndSegmentLength"),this.V.mk=a,this.h("toEndSegmentLength",b,a),this.Xb())});w.defineProperty(W,{Lu:"toEndSegmentDirection"},function(){return null!==this.V?this.V.lk:nr},function(a){this.Kd();var b=this.V.lk;b!==a&&(w.Gt("Link.toEndSegmentDirection","2.0"),this.V.lk=a,this.h("toEndSegmentDirection",b,a),this.Xb())}); -w.defineProperty(W,{Mu:"toShortLength"},function(){return null!==this.V?this.V.nk:NaN},function(a){this.Kd();var b=this.V.nk;b!==a&&(this.V.nk=a,this.h("toShortLength",b,a),this.Xb())});function ln(a){var b=a.W,c=a.$;null!==b?null!==c?Hr(a,b.MH(c)):Hr(a,null):Hr(a,null)}function Hr(a,b){var c=a.Xk;if(c!==b){null!==c&&hr(c,a);a.Xk=b;null!==b&&ir(b,a);var d=a.pE;if(null!==d){var e=!0,f=a.g;null!==f&&(e=f.Ua,f.Ua=!0);d(a,c,b);null!==f&&(f.Ua=e)}!a.Zg||a.FD!==c&&a.GD!==c||a.Xb()}} -W.prototype.Vl=function(){var a=this.Ka;null!==a&&this.W!==a&&this.$!==a&&a.Tw&&S.prototype.Vl.call(this)};W.prototype.getOtherNode=W.prototype.mA=function(a){var b=this.W;return a===b?this.$:b};W.prototype.getOtherPort=function(a){var b=this.ed;return a===b?this.Sd:b};w.u(W,{VK:"isLabeledLink"},function(){return null===this.rf?!1:0=d&&(h=d-1);var l=this.m(h-1),f=this.m(h);Zd(e.x,e.y,k.x,k.y,l.x,l.y,f.x,f.y,.5,a);b=Math.min(f.x,b);c=Math.min(f.y,c);e=f}else for(e=this.m(0),f=this.m(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.l(e.x,e.y,0,0),a.ri(f),h=2;hc&&(c=-c)):Xa(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.uf(d)),f.push(c),e+=c;for(d=h=c=0;ce/2)break;c+=d;h++}w.va(f);b=this.m(h);f=this.m(h+1);b.x===f.x?b.y>f.y?a.l(b.x,b.y-(e/2-c)):a.l(b.x,b.y+(e/2-c)):b.y===f.y?b.x>f.x?a.l(b.x-(e/2-c),b.y):a.l(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.l(b.x+c*(f.x-b.x),b.y+c*(f.y-b.y)));return a};w.u(W,{vF:"midAngle"},function(){this.ao();return this.computeMidAngle()}); -W.prototype.computeMidAngle=function(){var a=this.qa;if(2>a)return NaN;if(this.computeCurve()===sj&&4<=a&&!this.ic){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.m(c),d=this.m(c+1),a=this.m(c+2),c=this.m(c+3),e=d.x,d=d.y,f=a.x,a=a.y,h=(e+f)/2,k=(d+a)/2;return Oa(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(f+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0e+10))?e>c+10?d.yc(a):b.yc(a):b.yc(d);b=this.m(c-1);d=this.m(c);a=this.m(c+1);c=b.uf(d);e=d.uf(a);return c>e+10?b.yc(d):e>c+10?d.yc(a):b.yc(a)}; -w.defineProperty(W,{points:"points"},function(){return this.ad},function(a){var b=this.ad;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;em&&(p=-p),u=(0>l?-1:1)*p+r,t=n*(u- -r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,x=r,v=s;K(l,0)?v=0l?-1:1)*p+r,v=n*(x-r)+s);this.Jp();this.ii(h);this.Bl(u,t);this.Bl(x,v);this.ii(q);this.Tg(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.Tg(3,this.getLinkPoint(e,f,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,f),a=this.getLinkPoint(e,f,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,f=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,K(e,0)?k=0f&&(h=-h),h=(0>e?-1:1)*h+b, -k=q*(h-b)+c),this.ii(d),this.Bl(h,k)):this.ii(d),this.ii(a)}else{p=this.Dk;q&&(n&&p||m)&&this.Jp();var B=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,f),r=u=s=0;if(n||!k||m)if(t=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,f),m&&(k||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>B&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(t+=Math.abs(B)*(n?1:2)),0===r?s=t:90===r?u=t:180===r?s=-t:270===r?u=-t:(s=t*Math.cos(r*Math.PI/180),u=t*Math.sin(r*Math.PI/ -180)),d.Nd()&&m){var y=c.Wa(Fb,w.K()),H=w.xb(y.x+1E3*s,y.y+1E3*u);this.getLinkPointFromPoint(b,c,y,H,!0,p);w.v(y);w.v(H)}var t=this.getLinkPoint(e,f,a,!1,n,b,c),E=v=x=0;if(n||!l||m)y=this.computeEndSegmentLength(e,f,a,!1),E=this.getLinkDirection(e,f,t,a,!1,n,b,c),m&&(l||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(E+=n?0:30,0>B&&(E+=180)),0>E?E+=360:360<=E&&(E-=360),m&&(y+=Math.abs(B)*(n?1:2)),0===E?x=y:90===E?v=y:180===E?x=-y:270===E?v=-y:(x=y*Math.cos(E*Math.PI/180),v=y*Math.sin(E*Math.PI/180)),a.Nd()&& -m&&(y=f.Wa(Fb,w.K()),H=w.xb(y.x+1E3*x,y.y+1E3*v),this.getLinkPointFromPoint(e,f,y,H,!1,t),w.v(y),w.v(H));a=p;if(n||!k||m)a=new z(p.x+s,p.y+u);d=t;if(n||!l||m)d=new z(t.x+x,t.y+v);!q&&!n&&k&&3Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b} -W.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new z);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.O;null===e||e.Yg()||(e=e.O);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.ph;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.zn(e,h,k,l, -f);null!==a&&f.transform(a);return f};function Or(a,b){var c=b.Bs;null===c&&(c=new Pr,c.port=b,c.Nc=b.U,b.Bs=c);return Qr(c,a)} -W.prototype.getLinkPoint=function(a,b,c,d,e,f,h,k){void 0===k&&(k=new z);if(c.fd())return b.Wa(c,k),k;if(c.sj()){var l=Or(this,b);if(null!==l){k.assign(l.fq);if(e&&this.Zx===Er){var m=Or(this,h);if(null!==m&&l.rn=n.y&&a.y<=n.y+n.height?k.y=a.y:(c.qj(Sb)||c.qj(Vb))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);w.v(l);w.v(m)}}return k}}c=b.Wa(Fb,w.K());l=f=null;this.qa> -(e?6:2)?(l=d?this.m(1):this.m(this.qa-2),e&&(l=Nr(c,l.copy()))):(f=w.K(),l=h.Wa(Fb,f),e&&(l=Nr(c,l)),w.v(f));this.getLinkPointFromPoint(a,b,c,l,d,k);w.v(c);return k}; -W.prototype.getLinkDirection=function(a,b,c,d,e,f,h,k){a:if(d.fd())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(f?6:2)?(n=e?this.m(1):this.m(this.qa-2),n=f?Nr(l,n.copy()):c):(m=w.K(),n=k.Wa(Fb,m),w.v(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y- -l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;w.v(l)}d.Nd()&&h.mi(a)&&(c+=180,360<=c&&(c-=360));a=nr;a=e?this.St:this.Lu;a===nr&&(a=e?b.St:b.Lu);switch(a){case or:b=b.xn();c+=b;360<=c&&(c-=360);break;case nr:case uo:b=b.xn();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c}; -W.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.sj()&&(a=Or(this,b),null!==a))return a.bx;a=NaN;a=d?this.Rl:this.jm;null!==b&&isNaN(a)&&(a=d?b.Rl:b.jm);isNaN(a)&&(a=10);return a};W.prototype.computeSpot=function(a){return a?Lr(this,this.ed):Mr(this,this.Sd)};function Lr(a,b){if(null===b)return Fb;var c=a.Ab;c.Uc()&&null!==b&&(c=b.Ab);return c===oc?sb:c}function Mr(a,b){if(null===b)return Fb;var c=a.Bb;c.Uc()&&null!==b&&(c=b.Bb);return c===oc?sb:c} -W.prototype.computeOtherPoint=function(a,b){var c=b.Wa(Fb),d;d=b.Bs;d=null!==d?Qr(d,this):null;null!==d&&(c=d.fq);return c};W.prototype.computeShortLength=function(a){if(a){if(a=this.Tt,isNaN(a)){var b=this.ed;null!==b&&(a=b.Tt)}}else a=this.Mu,isNaN(a)&&(b=this.Sd,null!==b&&(a=b.Mu));return isNaN(a)?0:a}; -W.prototype.yk=function(a,b,c,d,e,f){if(!1===this.Sg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=f;void 0===f&&(h=w.Ef(),h.reset());h.multiply(this.transform);if(this.on(a,h))return Xp(this,b,c,e),void 0===f&&w.ue(h),!0;if(this.Kg(a,h)){var k=!1;if(!this.En)for(var l=this.wa.n,m=l.length;m--;){var n=l[m];if(n.visible||n===this.Xf){var p=n.Y,q=this.Ia;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=w.Ef();p.set(h);if(n instanceof C)k=n.yk(a,b,c,d,e,p);else if(this.path=== -n){if(n instanceof X){var k=n,r=a,s=d,q=p;if(!1===k.Sg)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,t=q;if(k.on(u,t))k=!0;else{if(void 0===t&&(t=k.transform,u.vk(k.Y))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,x=w.K(),v=w.K(),B=w.K(),y=w.Ef();y.set(t);y.yF(k.transform);y.qx();v.x=r;v.y=s;v.transform(y);x.x=q;x.y=s;x.transform(y);t=!1;iq(k,x,v,B)?t=!0:(x.x=r,x.y=u,x.transform(y),iq(k,x,v,B)?t=!0:(v.x=q,v.y=u,v.transform(y),iq(k,x,v,B)?t=!0:(x.x=q,x.y=s,x.transform(y),iq(k,x,v,B)&& -(t=!0))));w.ue(y);w.v(x);w.v(v);w.v(B);k=t}}else k=k.on(r,q)}}else k=Ao(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof J&&e.add(n),e instanceof I&&e.add(n)));w.ue(p)}}}void 0===f&&w.ue(h);return k||null!==this.background||null!==this.jn}void 0===f&&w.ue(h);return!1};w.u(W,{ic:"isOrthogonal"},function(){return 2===(this.Um.value&2)});w.u(W,{Dk:"isAvoiding"},function(){return 4===(this.Um.value&4)}); -W.prototype.computeCurve=function(){if(null===this.Gi){var a=this.ed,b=this.ic;this.Gi=null!==a&&a===this.Sd&&!b}return this.Gi?sj:this.Ye};W.prototype.computeCorner=function(){if(this.Ye===sj)return 0;var a=this.Yz;if(isNaN(a)||0>a)a=10;return a};W.prototype.findMidLabel=function(){for(var a=this.path,b=this.wa.n,c=b.length,d=0;dl?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;Xa(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.Tg(a,b);for(a+= -1;al?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ea(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.Tg(c,d)}}return!0;case Dr:f=this.m(a);p=this.m(c);if(!f.Ic(b)||!p.Ic(d)){var e=f.x,f=f.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-f)*(p-f),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.Tg(a,b);for(a+=1;ab?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.Y.copy(),k=f.Y.copy();if(h.H()&&k.H()){h.Sf(8,8);k.Sf(8,8);h.ri(a);k.ri(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l=new z(c.x,a.y),m=new z(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xh&&a.y>k&&a.righth&&b.y>k&&b.right=c.OI)){this.N^=4096;var d=!1;if(null!==c){d=c.wb;c.wb=!0;var e=c.selection;e.Ra();a?e.add(this):e.remove(this);e.freeze()}this.h("isSelected",b,a);this.ce();a=this.yJ;null!==a&&a(this);null!==c&&(c.Le(),c.wb=d)}}}); +w.defineProperty(S,{Mg:"isHighlighted"},function(){return 0!==(this.N&524288)},function(a){var b=0!==(this.N&524288);if(b!==a){this.N^=524288;var c=this.g;null!==c&&(c=c.Vl,c.Ra(),a?c.add(this):c.remove(this),c.freeze());this.h("isHighlighted",b,a);this.na();a=this.iI;null!==a&&a(this)}});w.defineProperty(S,{Zl:"isShadowed"},function(){return 0!==(this.N&8192)},function(a){var b=0!==(this.N&8192);b!==a&&(this.N^=8192,this.h("isShadowed",b,a),this.na())});function Cm(a){return 0!==(a.N&32768)} +function $q(a,b){a.N=b?a.N|32768:a.N&-32769}function Fo(a,b){a.N=b?a.N|65536:a.N&-65537}function il(a){return 0!==(a.N&131072)}S.prototype.Cf=function(a){this.N=a?this.N|131072:this.N&-131073};function ir(a,b){a.N=b?a.N|1048576:a.N&-1048577}w.defineProperty(S,{fF:"isAnimated"},function(){return 0!==(this.N&262144)},function(a){var b=0!==(this.N&262144);b!==a&&(this.N^=262144,this.h("isAnimated",b,a))}); +w.defineProperty(S,{iI:"highlightedChanged"},function(){return this.Fr},function(a){var b=this.Fr;b!==a&&(null!==a&&w.j(a,"function",S,"highlightedChanged"),this.Fr=a,this.h("highlightedChanged",b,a))});w.defineProperty(S,{cB:"selectionObjectName"},function(){return this.Us},function(a){var b=this.Us;b!==a&&(this.Us=a,this.Zm=null,this.h("selectionObjectName",b,a))}); +w.defineProperty(S,{xJ:"selectionAdornmentTemplate"},function(){return this.Ss},function(a){var b=this.Ss;b!==a&&(this instanceof W&&(a.type=hj),this.Ss=a,this.h("selectionAdornmentTemplate",b,a))});w.u(S,{Du:"selectionObject"},function(){if(null===this.Zm){var a=this.cB;null!==a&&""!==a?(a=this.ud(a),this.Zm=null!==a?a:this):this instanceof W?(a=this.path,this.Zm=null!==a?a:this):this.Zm=this}return this.Zm}); +w.defineProperty(S,{yJ:"selectionChanged"},function(){return this.Ts},function(a){var b=this.Ts;b!==a&&(null!==a&&w.j(a,"function",S,"selectionChanged"),this.Ts=a,this.h("selectionChanged",b,a))});w.defineProperty(S,{UF:"resizeAdornmentTemplate"},function(){return this.Gs},function(a){var b=this.Gs;b!==a&&(this.Gs=a,this.h("resizeAdornmentTemplate",b,a))}); +w.defineProperty(S,{WF:"resizeObjectName"},function(){return this.Is},function(a){var b=this.Is;b!==a&&(this.Is=a,this.kp=null,this.h("resizeObjectName",b,a))});w.u(S,{VF:"resizeObject"},function(){if(null===this.kp){var a=this.WF;null!==a&&""!==a?(a=this.ud(a),this.kp=null!==a?a:this):this.kp=this}return this.kp});w.defineProperty(S,{nJ:"resizeCellSize"},function(){return this.Hs},function(a){var b=this.Hs;b.L(a)||(this.Hs=a=a.S(),this.h("resizeCellSize",b,a))}); +w.defineProperty(S,{qJ:"rotateAdornmentTemplate"},function(){return this.Js},function(a){var b=this.Js;b!==a&&(this.Js=a,this.h("rotateAdornmentTemplate",b,a))});w.defineProperty(S,{rJ:"rotateObjectName"},function(){return this.Ks},function(a){var b=this.Ks;b!==a&&(this.Ks=a,this.lp=null,this.h("rotateObjectName",b,a))});w.u(S,{YF:"rotateObject"},function(){if(null===this.lp){var a=this.rJ;null!==a&&""!==a?(a=this.ud(a),this.lp=null!==a?a:this):this.lp=this}return this.lp}); +w.defineProperty(S,{text:"text"},function(){return this.Ed},function(a){var b=this.Ed;b!==a&&(this.Ed=a,this.h("text",b,a))}); +w.defineProperty(S,{Ka:"containingGroup"},function(){return this.Zk},function(a){if(this.de()){var b=this.Zk;if(b!==a){null===a||this!==a&&!a.mi(this)||(this===a&&w.k("Cannot make a Group a member of itself: "+this.toString()),w.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.J(Sm);var c=this.g;null!==b?jr(b,this):this instanceof U&&null!==c&&c.yl.remove(this);this.Zk=a;null!==a?kr(a,this):this instanceof U&&null!==c&&c.yl.add(this);this.J(Jm); +if(null!==c){var d=this.data,e=c.ba;null!==d&&e instanceof P&&e.fB(d,e.ub(null!==a?a.data:null))}d=this.sE;null!==d&&(e=!0,null!==c&&(e=c.Ua,c.Ua=!0),d(this,b,a),null!==c&&(c.Ua=e));if(this instanceof U)for(c=new J(S),gh(c,this,!0,0,!0),c=c.i;c.next();)if(d=c.value,d instanceof T)for(d=d.fe;d.next();)nn(d.value);if(this instanceof T)for(d=this.fe;d.next();)nn(d.value);this.h("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&nl(b,-1,a))}}else w.k("cannot set the Part.containingGroup of a Link or Adornment")}); +g=S.prototype;g.Ek=function(){var a=this.Ka;null!==a&&(a.I(),null!==a.Kb&&a.Kb.I(),a.Uf())};g.na=function(){var a=this.g;null!==a&&!Bm(this)&&!Cm(this)&&this.isVisible()&&this.nc.H()&&a.na(ml(this,this.nc))};g.I=function(){C.prototype.I.call(this);var a=this.g;null!==a&&(a.sg.add(this),this instanceof T&&null!==this.Mc&&Po(this.Mc),a.Le(!0))};g.Vt=function(a){a||(a=this.Zk,null!==a&&kr(a,this))};g.Wt=function(a){a||(a=this.Zk,null!==a&&jr(a,this))}; +g.vn=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.ba,null!==b&&b.Wx(a))}};w.defineProperty(S,{sE:"containingGroupChanged"},function(){return this.Uq},function(a){var b=this.Uq;b!==a&&(null!==a&&w.j(a,"function",S,"containingGroupChanged"),this.Uq=a,this.h("containingGroupChanged",b,a))});S.prototype.findSubGraphLevel=function(){return lr(this,this)};function lr(a,b){var c=b.Ka;return null!==c?1+lr(a,c):b instanceof T&&(c=b.Mc,null!==c)?lr(a,c):0} +S.prototype.findTopLevelPart=function(){return mr(this,this)};function mr(a,b){var c=b.Ka;return null!==c?mr(a,c):b instanceof T&&(c=b.Mc,null!==c)?mr(a,c):b}w.u(S,{bq:"isTopLevel"},function(){return null!==this.Ka||this instanceof T&&this.lf?!1:!0});S.prototype.isMemberOf=S.prototype.mi=function(a){return a instanceof U?nr(this,this,a):!1};function nr(a,b,c){if(b===c||null===c)return!1;var d=b.Ka;return null===d||d!==c&&!nr(a,d,c)?b instanceof T&&(b=b.Mc,null!==b)?nr(a,b,c):!1:!0} +S.prototype.findCommonContainingGroup=S.prototype.PH=function(a){if(null===a)return null;if(this===a)return this.Ka;for(var b=this;null!==b;)b instanceof U&&ir(b,!0),b=b.Ka;for(var c=null,b=a;null!==b;){if(0!==(b.N&1048576)){c=b;break}b=b.Ka}for(b=this;null!==b;)b instanceof U&&ir(b,!1),b=b.Ka;return c};w.defineProperty(S,{DI:"layoutConditions"},function(){return this.Tr},function(a){var b=this.Tr;b!==a&&(this.Tr=a,this.h("layoutConditions",b,a))}); +S.prototype.canLayout=function(){if(!this.oF||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Kc||this instanceof T&&this.lf?!1:!0};S.prototype.invalidateLayout=S.prototype.J=function(a){void 0===a&&(a=16777215);var b;this.oF&&0!==(a&this.DI)?(b=this.layer,null!==b&&b.Kc||this instanceof T&&this.lf?b=!1:(b=this.g,b=null!==b&&b.oa.gb?!1:!0)):b=!1;if(b)if(b=this.Zk,null!==b){var c=b.Sb;null!==c?c.J():b.J(a)}else a=this.g,null!==a&&(c=a.Sb,null!==c&&c.J())}; +function Om(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Kc?!1:!0}w.defineProperty(S,{DE:"dragComputation"},function(){return this.nr},function(a){var b=this.nr;b!==a&&(null!==a&&w.j(a,"function",S,"dragComputation"),this.nr=a,this.h("dragComputation",b,a))});w.defineProperty(S,{BJ:"shadowOffset"},function(){return this.an},function(a){var b=this.an;b.L(a)||(this.an=a=a.S(),this.na(),this.h("shadowOffset",b,a))}); +w.defineProperty(S,{shadowColor:"shadowColor"},function(){return this.$m},function(a){var b=this.$m;b!==a&&(this.$m=a,this.na(),this.h("shadowColor",b,a))});w.defineProperty(S,{shadowBlur:"shadowBlur"},function(){return this.Bg},function(a){var b=this.Bg;b!==a&&(this.Bg=a,this.na(),this.h("shadowBlur",b,a))});function hh(a){0===arguments.length?S.call(this,Sj):S.call(this,a);this.N&=-257;this.ml="Adornment";this.Dc=null;this.iD=0;this.ZD=!1;this.Kb=this.$g=null}w.La(hh,S);w.fa("Adornment",hh); +hh.prototype.toString=function(){var a=this.Of;return"Adornment("+this.td+")"+(null!==a?a.toString():"")};hh.prototype.updateRelationshipsFromData=function(){};hh.prototype.ku=function(a){var b=this.rb.U,c=this.rb;if(b instanceof W&&c instanceof X){var d=b.path,c=d.vf;b.ku(a);c=d.vf;a=this.xa.n;b=a.length;for(d=0;da&&(a=1);var b=this.g;if(null!==b&&!b.wh){b.wh=!0;var c=new J(T);c.add(this);zr(this,c,b.Pd,a,b.Pa,this,b.wB===tl);b.wh=!1}}; +function zr(a,b,c,d,e,f,h){if(1a&&(a=2);var b=this.g;if(null!==b&&!b.wh){b.wh=!0;var c=new J(T);c.add(this);Br(this,c,b.Pd,a,b.Pa,this,b.wB===tl);b.wh=!1}};function Br(a,b,c,d,e,f,h){for(var k=f===a?!1:a.gd,l=c?a.hx():a.Kg();l.next();){var m=l.value;m.Lc&&(k||m.Zg||m.Yb(),m=m.oA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.vd(!0),m.Ek(),h&&el(e,m,f)),2a&&(a-=180);break;case Qp:a=we(c+90);90a&&(a-=180);break;case Sp:a=we(c-90);90a&&(a-=180);break;case Tp:a=we(c);if(45a||225a)return 0;90a&&(a-=180)}return we(a)}; +w.defineProperty(W,{Y:"fromNode"},function(){return this.og},function(a){var b=this.og;if(b!==a){var c=this.Jc;null!==b&&(this.Eg!==b&&wr(b,this,c),Hr(this),this.J(Sm));this.og=a;null!==a&&this.vd(a.isVisible());this.Gi=null;this.Yb();var d=this.g;if(null!==d){var e=this.data,f=d.ba;if(null!==e)if(f instanceof P){var h=null!==a?a.data:null;f.dB(e,f.ub(h))}else f instanceof Zf&&(h=null!==a?a.data:null,d.Pd?f.oi(e,f.ub(h)):(null!==b&&f.oi(b.data,void 0),f.oi(h,f.ub(null!==this.Eg?this.Eg.data:null))))}e= +this.Jc;f=this.QE;null!==f&&(h=!0,null!==d&&(h=d.Ua,d.Ua=!0),f(this,c,e),null!==d&&(d.Ua=h));null!==a&&(this.Eg!==a&&vr(a,this,e),Ir(this),this.J(Jm));this.h("fromNode",b,a);nn(this)}}); +w.defineProperty(W,{Lg:"fromPortId"},function(){return this.Nh},function(a){var b=this.Nh;if(b!==a){var c=this.Jc;null!==c&&ur(this.Y,c);Hr(this);this.Nh=a;var d=this.Jc;null!==d&&ur(this.Y,d);var e=this.g;if(null!==e){var f=this.data,h=e.ba;null!==f&&h instanceof P&&h.eB(f,a)}c!==d&&(this.Gi=null,this.Yb(),f=this.QE,null!==f&&(h=!0,null!==e&&(h=e.Ua,e.Ua=!0),f(this,c,d),null!==e&&(e.Ua=h)));Ir(this);this.h("fromPortId",b,a)}});w.u(W,{Jc:"fromPort"},function(){var a=this.og;return null===a?null:a.Pl(this.Nh)}); +w.defineProperty(W,{QE:"fromPortChanged"},function(){return this.wr},function(a){var b=this.wr;b!==a&&(null!==a&&w.j(a,"function",W,"fromPortChanged"),this.wr=a,this.h("fromPortChanged",b,a))}); +w.defineProperty(W,{$:"toNode"},function(){return this.Eg},function(a){var b=this.Eg;if(b!==a){var c=this.jd;null!==b&&(this.og!==b&&wr(b,this,c),Hr(this),this.J(Sm));this.Eg=a;null!==a&&this.vd(a.isVisible());this.Gi=null;this.Yb();var d=this.g;if(null!==d){var e=this.data,f=d.ba;if(null!==e)if(f instanceof P){var h=null!==a?a.data:null;f.jB(e,f.ub(h))}else f instanceof Zf&&(h=null!==a?a.data:null,d.Pd?(null!==b&&f.oi(b.data,void 0),f.oi(h,f.ub(null!==this.og?this.og.data:null))):f.oi(e,f.ub(h)))}e= +this.jd;f=this.qG;null!==f&&(h=!0,null!==d&&(h=d.Ua,d.Ua=!0),f(this,c,e),null!==d&&(d.Ua=h));null!==a&&(this.og!==a&&vr(a,this,e),Ir(this),this.J(Jm));this.h("toNode",b,a);nn(this)}}); +w.defineProperty(W,{Eh:"toPortId"},function(){return this.hi},function(a){var b=this.hi;if(b!==a){var c=this.jd;null!==c&&ur(this.$,c);Hr(this);this.hi=a;var d=this.jd;null!==d&&ur(this.$,d);var e=this.g;if(null!==e){var f=this.data,h=e.ba;null!==f&&h instanceof P&&h.kB(f,a)}c!==d&&(this.Gi=null,this.Yb(),f=this.qG,null!==f&&(h=!0,null!==e&&(h=e.Ua,e.Ua=!0),f(this,c,d),null!==e&&(e.Ua=h)));Ir(this);this.h("toPortId",b,a)}});w.u(W,{jd:"toPort"},function(){var a=this.Eg;return null===a?null:a.Pl(this.hi)}); +w.defineProperty(W,{qG:"toPortChanged"},function(){return this.mt},function(a){var b=this.mt;b!==a&&(null!==a&&w.j(a,"function",W,"toPortChanged"),this.mt=a,this.h("toPortChanged",b,a))});w.defineProperty(W,{Ab:"fromSpot"},function(){return null!==this.V?this.V.Sj:rc},function(a){this.Ld();var b=this.V.Sj;b.L(a)||(a=a.S(),this.V.Sj=a,this.h("fromSpot",b,a),this.Yb())}); +w.defineProperty(W,{Sl:"fromEndSegmentLength"},function(){return null!==this.V?this.V.Qj:NaN},function(a){this.Ld();var b=this.V.Qj;b!==a&&(0>a&&w.Ea(a,">= 0",W,"fromEndSegmentLength"),this.V.Qj=a,this.h("fromEndSegmentLength",b,a),this.Yb())});w.defineProperty(W,{Rt:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.Pj:pr},function(a){this.Ld();var b=this.V.Pj;b!==a&&(w.Ft("Link.fromEndSegmentDirection","2.0"),this.V.Pj=a,this.h("fromEndSegmentDirection",b,a),this.Yb())}); +w.defineProperty(W,{St:"fromShortLength"},function(){return null!==this.V?this.V.Rj:NaN},function(a){this.Ld();var b=this.V.Rj;b!==a&&(this.V.Rj=a,this.h("fromShortLength",b,a),this.Yb())});w.defineProperty(W,{Bb:"toSpot"},function(){return null!==this.V?this.V.pk:rc},function(a){this.Ld();var b=this.V.pk;b.L(a)||(a=a.S(),this.V.pk=a,this.h("toSpot",b,a),this.Yb())}); +w.defineProperty(W,{jm:"toEndSegmentLength"},function(){return null!==this.V?this.V.nk:NaN},function(a){this.Ld();var b=this.V.nk;b!==a&&(0>a&&w.Ea(a,">= 0",W,"toEndSegmentLength"),this.V.nk=a,this.h("toEndSegmentLength",b,a),this.Yb())});w.defineProperty(W,{Ku:"toEndSegmentDirection"},function(){return null!==this.V?this.V.mk:pr},function(a){this.Ld();var b=this.V.mk;b!==a&&(w.Ft("Link.toEndSegmentDirection","2.0"),this.V.mk=a,this.h("toEndSegmentDirection",b,a),this.Yb())}); +w.defineProperty(W,{Lu:"toShortLength"},function(){return null!==this.V?this.V.ok:NaN},function(a){this.Ld();var b=this.V.ok;b!==a&&(this.V.ok=a,this.h("toShortLength",b,a),this.Yb())});function nn(a){var b=a.Y,c=a.$;null!==b?null!==c?Jr(a,b.PH(c)):Jr(a,null):Jr(a,null)}function Jr(a,b){var c=a.Zk;if(c!==b){null!==c&&jr(c,a);a.Zk=b;null!==b&&kr(b,a);var d=a.sE;if(null!==d){var e=!0,f=a.g;null!==f&&(e=f.Ua,f.Ua=!0);d(a,c,b);null!==f&&(f.Ua=e)}!a.Zg||a.JD!==c&&a.KD!==c||a.Yb()}} +W.prototype.Ek=function(){var a=this.Ka;null!==a&&this.Y!==a&&this.$!==a&&a.Sw&&S.prototype.Ek.call(this)};W.prototype.getOtherNode=W.prototype.oA=function(a){var b=this.Y;return a===b?this.$:b};W.prototype.getOtherPort=function(a){var b=this.Jc;return a===b?this.jd:b};w.u(W,{YK:"isLabeledLink"},function(){return null===this.rf?!1:0=d&&(h=d-1);var l=this.l(h-1),f=this.l(h);Wd(e.x,e.y,k.x,k.y,l.x,l.y,f.x,f.y,.5,a);b=Math.min(f.x,b);c=Math.min(f.y,c);e=f}else for(e=this.l(0),f=this.l(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.m(e.x,e.y,0,0),a.ri(f),h=2;hc&&(c=-c)):Va(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.uf(d)),f.push(c),e+=c;for(d=h=c=0;ce/2)break;c+=d;h++}w.wa(f);b=this.l(h);f=this.l(h+1);b.x===f.x?b.y>f.y?a.m(b.x,b.y-(e/2-c)):a.m(b.x,b.y+(e/2-c)):b.y===f.y?b.x>f.x?a.m(b.x-(e/2-c),b.y):a.m(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.m(b.x+c*(f.x-b.x),b.y+c*(f.y-b.y)));return a};w.u(W,{yF:"midAngle"},function(){this.co();return this.computeMidAngle()}); +W.prototype.computeMidAngle=function(){var a=this.qa;if(2>a)return NaN;if(this.computeCurve()===xj&&4<=a&&!this.jc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.l(c),d=this.l(c+1),a=this.l(c+2),c=this.l(c+3),e=d.x,d=d.y,f=a.x,a=a.y,h=(e+f)/2,k=(d+a)/2;return Oa(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(f+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0e+10))?e>c+10?d.Rb(a):b.Rb(a):b.Rb(d);b=this.l(c-1);d=this.l(c);a=this.l(c+1);c=b.uf(d);e=d.uf(a);return c>e+10?b.Rb(d):e>c+10?d.Rb(a):b.Rb(a)}; +w.defineProperty(W,{points:"points"},function(){return this.bd},function(a){var b=this.bd;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;em&&(p=-p),u=(0>l?-1:1)*p+r,t=n*(u- +r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,x=r,v=s;K(l,0)?v=0l?-1:1)*p+r,v=n*(x-r)+s);this.Ip();this.ii(h);this.hj(u,t);this.hj(x,v);this.ii(q);this.Ug(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.Ug(3,this.getLinkPoint(e,f,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,f),a=this.getLinkPoint(e,f,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,f=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,K(e,0)?k=0f&&(h=-h),h=(0>e?-1:1)*h+b, +k=q*(h-b)+c),this.ii(d),this.hj(h,k)):this.ii(d),this.ii(a)}else{p=this.sj;q&&(n&&p||m)&&this.Ip();var B=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,f),r=u=s=0;if(n||!k||m)if(t=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,f),m&&(k||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>B&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(t+=Math.abs(B)*(n?1:2)),0===r?s=t:90===r?u=t:180===r?s=-t:270===r?u=-t:(s=t*Math.cos(r*Math.PI/180),u=t*Math.sin(r*Math.PI/ +180)),d.Od()&&m){var y=c.Wa(Gb,w.K()),H=w.xb(y.x+1E3*s,y.y+1E3*u);this.getLinkPointFromPoint(b,c,y,H,!0,p);w.v(y);w.v(H)}var t=this.getLinkPoint(e,f,a,!1,n,b,c),E=v=x=0;if(n||!l||m)y=this.computeEndSegmentLength(e,f,a,!1),E=this.getLinkDirection(e,f,t,a,!1,n,b,c),m&&(l||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(E+=n?0:30,0>B&&(E+=180)),0>E?E+=360:360<=E&&(E-=360),m&&(y+=Math.abs(B)*(n?1:2)),0===E?x=y:90===E?v=y:180===E?x=-y:270===E?v=-y:(x=y*Math.cos(E*Math.PI/180),v=y*Math.sin(E*Math.PI/180)),a.Od()&& +m&&(y=f.Wa(Gb,w.K()),H=w.xb(y.x+1E3*x,y.y+1E3*v),this.getLinkPointFromPoint(e,f,y,H,!1,t),w.v(y),w.v(H));a=p;if(n||!k||m)a=new z(p.x+s,p.y+u);d=t;if(n||!l||m)d=new z(t.x+x,t.y+v);!q&&!n&&k&&3Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b} +W.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new z);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.O;null===e||e.Yg()||(e=e.O);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.ph;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Bn(e,h,k,l, +f);null!==a&&f.transform(a);return f};function Qr(a,b){var c=b.Bs;null===c&&(c=new Rr,c.port=b,c.Oc=b.U,b.Bs=c);return Sr(c,a)} +W.prototype.getLinkPoint=function(a,b,c,d,e,f,h,k){void 0===k&&(k=new z);if(c.fd())return b.Wa(c,k),k;if(c.uj()){var l=Qr(this,b);if(null!==l){k.assign(l.eq);if(e&&this.Yx===Gr){var m=Qr(this,h);if(null!==m&&l.tn=n.y&&a.y<=n.y+n.height?k.y=a.y:(c.rj(Tb)||c.rj(Wb))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);w.v(l);w.v(m)}}return k}}c=b.Wa(Gb,w.K());l=f=null;this.qa> +(e?6:2)?(l=d?this.l(1):this.l(this.qa-2),e&&(l=Pr(c,l.copy()))):(f=w.K(),l=h.Wa(Gb,f),e&&(l=Pr(c,l)),w.v(f));this.getLinkPointFromPoint(a,b,c,l,d,k);w.v(c);return k}; +W.prototype.getLinkDirection=function(a,b,c,d,e,f,h,k){a:if(d.fd())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(f?6:2)?(n=e?this.l(1):this.l(this.qa-2),n=f?Pr(l,n.copy()):c):(m=w.K(),n=k.Wa(Gb,m),w.v(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y- +l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;w.v(l)}d.Od()&&h.mi(a)&&(c+=180,360<=c&&(c-=360));a=pr;a=e?this.Rt:this.Ku;a===pr&&(a=e?b.Rt:b.Ku);switch(a){case qr:b=b.zn();c+=b;360<=c&&(c-=360);break;case pr:case vo:b=b.zn();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c}; +W.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.uj()&&(a=Qr(this,b),null!==a))return a.ax;a=NaN;a=d?this.Sl:this.jm;null!==b&&isNaN(a)&&(a=d?b.Sl:b.jm);isNaN(a)&&(a=10);return a};W.prototype.computeSpot=function(a){return a?Nr(this,this.Jc):Or(this,this.jd)};function Nr(a,b){if(null===b)return Gb;var c=a.Ab;c.Vc()&&null!==b&&(c=b.Ab);return c===rc?tb:c}function Or(a,b){if(null===b)return Gb;var c=a.Bb;c.Vc()&&null!==b&&(c=b.Bb);return c===rc?tb:c} +W.prototype.computeOtherPoint=function(a,b){var c=b.Wa(Gb),d;d=b.Bs;d=null!==d?Sr(d,this):null;null!==d&&(c=d.eq);return c};W.prototype.computeShortLength=function(a){if(a){if(a=this.St,isNaN(a)){var b=this.Jc;null!==b&&(a=b.St)}}else a=this.Lu,isNaN(a)&&(b=this.jd,null!==b&&(a=b.Lu));return isNaN(a)?0:a}; +W.prototype.zk=function(a,b,c,d,e,f){if(!1===this.Tg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=f;void 0===f&&(h=w.Ff(),h.reset());h.multiply(this.transform);if(this.qn(a,h))return Zp(this,b,c,e),void 0===f&&w.ue(h),!0;if(this.Tf(a,h)){var k=!1;if(!this.Gn)for(var l=this.xa.n,m=l.length;m--;){var n=l[m];if(n.visible||n===this.Yf){var p=n.W,q=this.Ia;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=w.Ff();p.set(h);if(n instanceof C)k=n.zk(a,b,c,d,e,p);else if(this.path=== +n){if(n instanceof X){var k=n,r=a,s=d,q=p;if(!1===k.Tg)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,t=q;if(k.qn(u,t))k=!0;else{if(void 0===t&&(t=k.transform,u.wk(k.W))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,x=w.K(),v=w.K(),B=w.K(),y=w.Ff();y.set(t);y.BF(k.transform);y.px();v.x=r;v.y=s;v.transform(y);x.x=q;x.y=s;x.transform(y);t=!1;kq(k,x,v,B)?t=!0:(x.x=r,x.y=u,x.transform(y),kq(k,x,v,B)?t=!0:(v.x=q,v.y=u,v.transform(y),kq(k,x,v,B)?t=!0:(x.x=q,x.y=s,x.transform(y),kq(k,x,v,B)&& +(t=!0))));w.ue(y);w.v(x);w.v(v);w.v(B);k=t}}else k=k.qn(r,q)}}else k=Bo(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof J&&e.add(n),e instanceof I&&e.add(n)));w.ue(p)}}}void 0===f&&w.ue(h);return k||null!==this.background||null!==this.jn}void 0===f&&w.ue(h);return!1};w.u(W,{jc:"isOrthogonal"},function(){return 2===(this.Um.value&2)});w.u(W,{sj:"isAvoiding"},function(){return 4===(this.Um.value&4)}); +W.prototype.computeCurve=function(){if(null===this.Gi){var a=this.Jc,b=this.jc;this.Gi=null!==a&&a===this.jd&&!b}return this.Gi?xj:this.Ye};W.prototype.computeCorner=function(){if(this.Ye===xj)return 0;var a=this.$z;if(isNaN(a)||0>a)a=10;return a};W.prototype.findMidLabel=function(){for(var a=this.path,b=this.xa.n,c=b.length,d=0;dl?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;Va(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.Ug(a,b);for(a+= +1;al?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ea(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.Ug(c,d)}}return!0;case Fr:f=this.l(a);p=this.l(c);if(!f.Ic(b)||!p.Ic(d)){var e=f.x,f=f.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-f)*(p-f),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.Ug(a,b);for(a+=1;ab?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.W.copy(),k=f.W.copy();if(h.H()&&k.H()){h.xf(8,8);k.xf(8,8);h.ri(a);k.ri(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l=new z(c.x,a.y),m=new z(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.Ha(a)||h.Ha(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l=new z(Math.max((a.x+c.x)/2,a.x),a.y),m=new z(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,k.right,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.yh.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l=new z(a.x,Math.max((a.y+c.y)/2,a.y)),m=new z(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.y,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.y,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.Ha(a)||h.Ha(c))?l.x=this.computeMidOrthoPosition(a.x, c.x,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l=new z(a.x,Math.min((a.y+c.y)/2,a.y)),m=new z(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xk&&0!==Sr(e,c.x,c.y)){Tr(this,e,c.x,c.y,d,!0);d=this.m(2);if(4>this.qa)0===b||180===b?(d.x=a.x,d.y=c.y):(d.x=c.x,d.y=a.y),this.ea(2,d.x,d.y),this.w(3,d.x,d.y);else if(c=this.m(3),0===b|| -180===b)K(d.x,c.x)?(b=0===b?Math.max(d.x,a.x):Math.min(d.x,a.x),this.ea(2,b,a.y),this.ea(3,b,c.y)):K(d.y,c.y)?(Math.abs(a.y-d.y)<=e.Gp/2&&(this.ea(2,d.x,a.y),this.ea(3,c.x,a.y)),this.w(2,d.x,a.y)):this.ea(2,a.x,d.y);else if(90===b||270===b)K(d.y,c.y)?(b=90===b?Math.max(d.y,a.y):Math.min(d.y,a.y),this.ea(2,a.x,b),this.ea(3,c.x,b)):K(d.x,c.x)?(Math.abs(a.x-d.x)<=e.Ip/2&&(this.ea(2,a.x,d.y),this.ea(3,a.x,c.y)),this.w(2,a.x,d.y)):this.ea(2,d.x,a.y);a=!0}else a=!1}else a=!1;a||(this.ii(l),this.ii(m))}}; -W.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};function Eh(a){if(null===a.g||!a.Dk)return!1;var b=a.points.n,c=b.length;if(4>c)return!1;a=zn(a.g,!0,a.Ka,null);for(var d=1;da)return new Fe(Je);var b=!1,c=this.g;null!==c&&Ir(this)&&c.Zk.contains(this)&&null!==this.mw&&(b=!0);var d=c=0,e=this.m(0).copy(),f=e.copy(),c=this.ad.n,h=this.computeCurve();if(h===sj&&3<=a&&!Xa(this.wq,0))if(3===a)var k=this.m(1),c=Math.min(e.x,k.x),d=Math.min(e.y,k.y),k=this.m(2),c=Math.min(c,k.x),d=Math.min(d,k.y);else{if(this.ic)for(k=0;k=a&&(k=a-1),c=this.m(k), -f.x=Math.min(c.x,f.x),f.y=Math.min(c.y,f.y);c=f.x;d=f.y}else{for(k=0;kx?r>q?(u.x=v-y,u.y=q-y,t.x=v+s,t.y=q+s):(u.x=v-y,u.y=q+y,t.x=v+s,t.y=q-s):r>q?(u.x=v+y,u.y=q-y,t.x=v-s,t.y=q+s):(u.x=v+y,u.y=q+y,t.x=v-s,t.y=q-s));Xa(x,v)&&Xa(q,r)&&(q>p?(B>v?(u.x= -v-y,u.y=q-y,t.x=v+s):(u.x=v+y,u.y=q-y,t.x=v-s),t.y=q+s):(B>v?(u.x=v-y,u.y=q+y,t.x=v+s):(u.x=v+y,u.y=q+y,t.x=v-s),t.y=q-s));if(Xa(x,v)&&Xa(v,B)||Xa(p,q)&&Xa(q,r))x=.5*(x+B),p=.5*(p+r),u.x=x,u.y=p,t.x=x,t.y=p;1===k?(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y)):2===k&&Xa(b.x,this.m(0).x)&&Xa(b.y,this.m(0).y)&&(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y));N(l,e.x-c,e.y-d,h.x-c,h.y-d,m.x-c,m.y-d);f.set(h);e.set(a);b=m}}k=b.x;b=b.y;f=this.m(this.qa-1);0!==this.computeShortLength(!1)&&(f=Ur(this,f.copy(),!1,bd));k=.5*(k+f.x); -b=.5*(b+f.y);N(l,a.x-c,a.y-d,k-c,b-d,f.x-c,f.y-d)}else for(k=3;k=a&&(k=a-1),f=this.m(k-1),e=this.m(k),k===a-1&&0!==this.computeShortLength(!1)&&(e=Ur(this,e.copy(),!1,bd)),N(l,b.x-c,b.y-d,f.x-c,f.y-d,e.x-c,e.y-d);else{f=w.K();f.assign(this.m(0));for(k=1;k=a-1){f!==u&&(0!==this.computeShortLength(!1)&&(u=Ur(this,u.copy(),!1,bd)),Xr(this,l,-c,-d,f,u,b));break}k=Vr(this,u,k+1,kn.x?u.x-s:u.x+s,y=t.y>u.y?u.y+v:u.y-v,Xr(this,e,h,m,n,new z(q,B),p),Xe(e,u.x+h,u.y+m,r+h,y+m),x.l(r,y))):K(n.x,u.x)&&K(u.y,t.y)?(s=this.computeCorner(),v=Math.min(s,Math.abs(u.y-n.y)/2),v=s=Math.min(v,Math.abs(t.x-u.x)/2),K(s,0)?(Xr(this,e,h,m,n,u,p),x.assign(u)):(q=u.x,y=B=u.y,B=u.y>n.y?u.y-v:u.y+v,r=t.x>u.x?u.x+s:u.x-s,Xr(this,e, -h,m,n,new z(q,B),p),Xe(e,u.x+h,u.y+m,r+h,y+m),x.l(r,y))):(Xr(this,e,h,m,n,u,p),x.assign(u))}w.v(f)}c=l.o;w.q(l)}else l=this.m(1).copy(),l.x-=c,l.y-=d,0!==this.computeShortLength(!0)&&(e=Ur(this,e,!0,f)),0!==this.computeShortLength(!1)&&(l=Ur(this,l,!1,f)),c=new Fe(Je),c.ia=e.x,c.ga=e.y,c.D=l.x,c.F=l.y;return c}; -function Wr(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return Xa(a,0)?b:Xa(b,0)?a:Math.sqrt(a*a+b*b)} -function Ur(a,b,c,d){var e=a.qa;if(2>e)return b;if(c){var f=a.m(1);c=f.x-d.x;d=f.y-d.y;f=Wr(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!0);a>e&&(a=e);c=a*(c-b.x)/f;a=a*(d-b.y)/f;b.x+=c;b.y+=a}else{f=a.m(e-2);c=f.x-d.x;d=f.y-d.y;f=Wr(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!1);a>e&&(a=e);c=a*(b.x-c)/f;a=a*(b.y-d)/f;b.x-=c;b.y-=a}return b} -function Vr(a,b,c,d){for(var e=a.qa,f=b;Xa(b.x,f.x)&&Xa(b.y,f.y);){if(c>=e)return e-1;f=a.m(c++)}if(!Xa(b.x,f.x)&&!Xa(b.y,f.y))return c-1;for(var h=f;Xa(b.x,f.x)&&Xa(f.x,h.x)&&(!d||(b.y>=f.y?f.y>=h.y:f.y<=h.y))||Xa(b.y,f.y)&&Xa(f.y,h.y)&&(!d||(b.x>=f.x?f.x>=h.x:f.x<=h.x));){if(c>=e)return e-1;h=a.m(c++)}return c-2} -function Xr(a,b,c,d,e,f,h){if(!h&&Ir(a)){h=[];var k=0;a.isVisible()&&(k=Yr(a,e,f,h));var l=e.x,l=e.y;if(0p-10)m--,p=Math.max(q-5,f.x);else break;q=f.y-10+d;n=p+c;p=f.y+d;a.Ye===cj?M(b,n,p,!1,!1):N(b,l,q,n,q,n,p)}else if(K(e.x,f.x))if(e.yp-10)m--,p=Math.max(q-5,f.y);else break;q=f.x-10+c;n=f.x+c;p+=d;a.Ye===cj?M(b,n,p,!1,!1):N(b,q,l,q,p,n,p)}}b.lineTo(f.x+c,f.y+d)} -function Yr(a,b,c,d){var e=a.g;if(null===e||b.L(c))return 0;for(e=e.Ex;e.next();){var f=e.value;if(null!==f&&f.visible)for(var f=f.zb.n,h=f.length,k=0;kh.x&&n.x>m.x||m.xh.y&&n.y>m.y||m.yu&&Math.min(h,x)q&&!K(h,x)){n.x=u;n.y=q;n=!0;break a}}else if(!K(q,s)&&K(h,x)&&Math.min(q,s)h&&Math.min(u,t)p&&!K(u,t)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}w.v(k)}w.u(W,{Ot:"firstPickIndex"},function(){var a;2>=this.qa?a=0:((a=this.ic)||(a=this.computeSpot(!0)!==sb),a=a?1:0);return a});w.u(W,{Cx:"lastPickIndex"},function(){var a=this.qa;if(0===a)a=0;else if(2>=a)a-=1;else{var b;(b=this.ic)||(b=this.computeSpot(!1)!==sb);a=b?a-2:a-1}return a});function Ir(a){a=a.Ye;return a===bj||a===cj} -function Kr(a,b){if(b||Ir(a)){var c=a.g;null===c||c.Zk.contains(a)||null===a.mw||c.Zk.add(a,a.mw)}}function ej(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Jc){var d=c.g;if(null!==d)for(var e=!1,d=d.Ex;d.next();){var f=d.value;if(f.visible)if(f===c)for(var e=!0,h=!1,f=f.zb.n,k=f.length,l=0;l=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.vg=Math.floor((a.x-this.ze)/this.ze)*this.ze;this.wg=Math.floor((b-this.Ae)/this.Ae)*this.Ae;this.as=Math.ceil((c+2*this.ze)/this.ze)*this.ze;this.bs=Math.ceil((d+2*this.Ae)/this.Ae)*this.Ae;a=1+(Math.ceil((this.as-this.vg)/this.ze)|0);b=1+(Math.ceil((this.bs-this.wg)/this.Ae)|0);if(null===this.xd||this.Apthis.as||a+cthis.bs||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.Ap)|0;for(c=Math.min(b+e-1,this.Bp)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.xd[a][e])return!1;return!0}; -function bs(a,b,c,d,e,f,h,k,l){if(!(bh||cl)){var m,n;m=b|0;n=c|0;var p=a.xd[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;f<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.xd[m][n]);)a.xd[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0m;c+=d)bs(a,b,c,1,!e,f,h,k,l),bs(a,b,c,-1,!e,f,h,k,l);else if(0m;b+=d)bs(a,b,c,1,!e,f,h,k,l),bs(a,b,c,-1,!e,f,h, -k,l)}}function cs(a,b,c,d,e,f,h,k,l){b|=0;c|=0;var m=0,n=1;for(a.xd[b][c]=n;0===m&&b>f&&bk&&cf&&bk&&c=Math.abs(h-b)&&1>=Math.abs(k-d))a.abort=!0;else{var l=f.x,m=f.y,n=f.x+f.width,p=f.y+f.height,l=l-a.vg,l=l/a.ze,m=m-a.wg,m=m/a.Ae,n=n-a.vg,n=n/a.ze,p=p-a.wg,p=p/a.Ae;f=Math.max(0,Math.min(a.Ap,l|0));n=Math.min(a.Ap,Math.max(0,n|0));m=Math.max(0,Math.min(a.Bp,m|0));p=Math.min(a.Bp,Math.max(0,p|0));h|=0;k|=0;b|=0;d|=0;l=90===c|| -270===c;cs(a,h,k,0===c||90===c?1:-1,l,f,n,m,p);cs(a,h,k,1,!l,f,n,m,p);cs(a,h,k,-1,!l,f,n,m,p);ds(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,n,m,p);ds(a,b,d,1,!(90===e||270===e),f,n,m,p);ds(a,b,d,-1,!(90===e||270===e),f,n,m,p);a.abort||(bs(a,h,k,1,!1,f,n,m,p),bs(a,h,k,-1,!1,f,n,m,p),bs(a,h,k,1,!0,f,n,m,p),bs(a,h,k,-1,!0,f,n,m,p))}}}function Pr(){w.lc(this);this.port=this.Nc=null;this.ag=[];this.hq=!1}w.$d(Pr,{Nc:!0,port:!0,ag:!0,hq:!0}); -Pr.prototype.toString=function(){for(var a=this.ag,b=this.Nc.toString()+" "+a.length.toString()+":",c=0;c=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case w.Qc|w.jd:return c>a&&c<=180+a?180:270;case w.jd|w.Zc:return c>180-a&&c<=360-a?270:0;case w.Zc|w.Yc:return c>a&&c<=180+a?90:0;case w.Yc|w.Qc:return c>180-a&&c<=360-a?180:90;case w.Qc|w.jd|w.Zc:return 90180+a&&c<=360- -a?270:0;case w.jd|w.Zc|w.Yc:return 180a&&180>=c?90:0;case w.Zc|w.Yc|w.Qc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case w.Yc|w.Qc|w.jd:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(w.Qc|w.jd|w.Zc|w.Yc)&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}Pr.prototype.aq=function(){this.ag.length=0}; -function Qr(a,b){var c=a.ag;if(0===c.length){a:if(!a.hq){c=a.hq;a.hq=!0;var d,e=null,f=a.Nc,f=f instanceof U?f:null;if(null===f||f.we)d=a.Nc.FE(a.port.Pd);else{if(!f.Y.H()){a.hq=c;break a}e=f;d=e.EE()}var h=a.ag.length=0,k=a.port.Wa(vb,w.K()),l=a.port.Wa(Kb,w.K()),f=w.Vg(k.x,k.y,0,0);f.ri(l);w.v(k);w.v(l);k=w.xb(f.x+f.width/2,f.y+f.height/2);for(d=d.i;d.next();)if(l=d.value,l.isVisible()){var m=l.ed===a.port||l.W.mi(e),n=l.computeSpot(m);if(n.sj()&&(m=m?l.Sd:l.ed,null!==m)){var p=m.U;if(null!==p){var m= -l.computeOtherPoint(p,m),p=k.yc(m),n=es(f,n,p,l.ic),q=0;0===n?(q=w.Zc,180Math.abs(E)?(B=Math.abs(E)/ -q,q=Math.abs(E)):B=1;break;case w.Qc:r>Math.abs(H)?(B=Math.abs(H)/r,r=Math.abs(H)):B=1;break;case w.jd:m>Math.abs(E)?(B=Math.abs(E)/m,m=Math.abs(E)):B=1;break;default:case w.Zc:p>Math.abs(H)?(B=Math.abs(H)/p,p=Math.abs(H)):B=1}v=0}var V=u.fq;if(e===pr){t=u.link.computeThickness();t*=B;V.set(y);switch(x){case w.Yc:V.x=y.x+E/2+q/2-v-t/2;break;case w.Qc:V.y=y.y+H/2+r/2-v-t/2;break;case w.jd:V.x=y.x+E/2-m/2+v+t/2;break;default:case w.Zc:V.y=y.y+H/2-p/2+v+t/2}v+=t}else t=.5,e===mr&&(t=(u.Zp+1)/(u.rn+1)), -V.x=y.x+E*t,V.y=y.y+H*t}w.v(k);w.v(d);w.v(l);w.v(n);y=a.ag;for(E=0;Eb.xe?1:a.angleb.angle?1:0}; -Pr.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Nc,this.port,sb,b.ed===this.port),d=a.Zp;if(0>d)return c;var e=a.rn;if(1>=e||!b.ic)return c;var b=a.Mx,f=a.fq;if(a.xe===w.Qc||a.xe===w.Yc)d=e-1-d;return((a=a.xe===w.Qc||a.xe===w.Zc)?b.ye&&(e=k.right);k.bottom>f&&(f=k.bottom)}}isFinite(c)&&isFinite(d)?a.l(c,d,e-c,f-d):(b=b.location,c=this.padding,a.l(b.x+c.left,b.y+c.top,0,0));return a}; -w.defineProperty(Hj,{padding:"padding"},function(){return this.ff},function(a){"number"===typeof a?a=new eb(a):w.G(a,eb,Hj,"padding");var b=this.ff;b.L(a)||(this.ff=a=a.S(),this.h("padding",b,a))});function pg(){0=c-1?(h=0,e=d,f+=k+20,k=0):h++}null!==a&&a.Fd("Layout")}this.yf=!0};pg.prototype.Qn=function(a){return!a.location.H()||a instanceof U&&a.Qn?!0:!1}; -function is(a,b,c,d,e,f,h,k){for(c=c.i;c.next();){var l=c.value;d&&!l.cq||null!==e&&!e(l)||!l.canLayout()||(f&&l instanceof T?l.lf||(l instanceof U?null===l.Rb?is(a,b,l.Mc,!1,e,f,h,k):(js(l),b.add(l)):(js(l),b.add(l))):h&&l instanceof W?b.add(l):!k||!l.de()||l instanceof T||(js(l),b.add(l)))}}function js(a){var b=a.Y;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Ze()} -pg.prototype.collectParts=pg.prototype.mH=function(a){var b=new J(S);a instanceof D?(is(this,b,a.dg,!0,null,!0,!0,!0),is(this,b,a.links,!0,null,!0,!0,!0),is(this,b,a.Hk,!0,null,!0,!0,!0)):a instanceof U?is(this,b,a.Mc,!1,null,!0,!0,!0):is(this,b,a.i,!1,null,!0,!0,!0);return b};w.defineProperty(pg,{oe:"arrangementOrigin"},function(){return this.Kq},function(a){w.G(a,z,pg,"arrangementOrigin");this.Kq.L(a)||(this.Kq.assign(a),this.J())}); -pg.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.Wa(vb),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a}; -function qg(){w.lc(this);this.ie=null;if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new J(ks);this.edges=new J(ls);this.Jx=new ka(T,ks);this.Fx=new ka(W,ls)}w.fa("LayoutNetwork",qg); -qg.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new J(ks);this.edges=new J(ls);this.Jx=new ka(T,ks);this.Fx=new ka(W,ls)}; -qg.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Rb?"("+this.Rb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1d?1:0):1:null!==d?-1:0}; -ks.smartComparer=function(a,b){if(null!==a){if(null!==b){var c=a.pd,d=b.pd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=f&&0>=h&&(f=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.Tb("Layout");d=[];switch(this.alignment){case zs:var k=a,l=c,m=Math.max(this.Hp.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0h)d.push(new A(0,x,h+k,B)),v=0,t=u,x+=B,B=0;B=Math.max(B,H);H=0;switch(s){case ys:H=-q.width;break;default:H=0}p.moveTo(t+H,x);switch(s){case ys:t-=y;break; -default:t+=y}v++}d.push(new A(0,x,h+k,B));break;case rs:k=f;l=a;m=c;n=Math.max(this.Hp.width,1);p=x=y=0;q=w.K();for(f=0;f=y&&(h-=y);for(var y=H=0,E=Math.max(this.Hp.height,1),ba=p=0,Q=!0,$=w.K(),f=0;fk-1||0h){d.push(new A(0,Q?v-p:v,h+l,ba+p+m));for(V=0;Vy&&(e.width+=e.x-y,e.x=y)}for(k=f=h=e=0;kd?1:0}; -Ln.smartComparer=function(a,b){if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=a.count)1===a.count&&(a=a.first(),a.ja=0,a.ra=0);else{var b=new I(Ss);b.Hc(a.i);a=new I(Ss);var c=new I(Ss),d;d=this.sort(b);var e=this.Sy,f=this.yC,h=this.Wd,k=this.Do,l=this.Ty,m=this.qr,b=this.$k,n=this.PD,p=this.Eg,q=this.iv,e=this.Of,f=this.Ix,h=this.cJ;if(!isFinite(h)|| -0>=h)h=NaN;k=this.fH;if(!isFinite(k)||0>=k)k=1;l=this.ye;isFinite(l)||(l=0);m=this.of;if(!isFinite(m)||360m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Ps&&f===Qs?e=Bs:e===Ps&&f!==Qs&&(f=Qs,e=this.Of);if((this.direction===Ks||this.direction===Ls)&&this.sorting!==Es){for(var r=0;!(r>=d.length);r+=2){a.add(d.da(r));if(r+1>=d.length)break;c.add(d.da(r+1))}this.direction===Ks?(this.Of===Ps&&a.reverse(),d=new I(Ss),d.Hc(a),d.Hc(c)):(this.Of===Ps&&c.reverse(),d=new I(Ss),d.Hc(c),d.Hc(a))}for(var s= -d.length,u=n=0,r=0;rm&&(0===r||r===d.length-1)&&(t/=2);n+=t;u++}if(isNaN(h)||e===Ps){isNaN(b)&&(b=6);if(e!==Bs&&e!==Ps){t=-Infinity;for(r=0;rh?(h=r,p=h*k):q=u/(360<=m?s:s-1)}this.Sy=e;this.yC=f;this.Wd=h;this.Do=k;this.Ty=l;this.qr=m;this.$k=b;this.PD=n;this.Eg=p;this.iv=q;b=d;d=this.Sy;e=this.Wd;f=this.Ty;k=this.qr;l=this.$k;m=this.Eg;n=this.iv;if(this.direction!==Ks&&this.direction!==Ls||d!==Ps)if(this.direction===Ks||this.direction===Ls){h=0;switch(d){case Os:h=180*Ws(this,e,m,f,n)/Math.PI;break;case Bs:n=b=0;h=a.first();null!==h&&(b=Ts(h,Math.PI/2));h=c.first();null!==h&&(n=Ts(h,Math.PI/2));h=180*Ws(this,e,m,f,l+(b+ -n)/2)/Math.PI;break;case Ns:h=k/b.length}if(this.direction===Ks){switch(d){case Os:Xs(this,a,f,Ms);break;case Bs:Ys(this,a,f,Ms);break;case Ns:Zs(this,a,k/2,f,Ms)}switch(d){case Os:Xs(this,c,f+h,Ds);break;case Bs:Ys(this,c,f+h,Ds);break;case Ns:Zs(this,c,k/2,f+h,Ds)}}else{switch(d){case Os:Xs(this,c,f,Ms);break;case Bs:Ys(this,c,f,Ms);break;case Ns:Zs(this,c,k/2,f,Ms)}switch(d){case Os:Xs(this,a,f+h,Ds);break;case Bs:Ys(this,a,f+h,Ds);break;case Ns:Zs(this,a,k/2,f+h,Ds)}}}else switch(d){case Os:Xs(this, -b,f,this.direction);break;case Bs:Ys(this,b,f,this.direction);break;case Ns:Zs(this,b,k,f,this.direction);break;case Ps:$s(this,b,k,f,this.direction)}else $s(this,b,k,f-k/2,Ds)}this.updateParts();this.network=null;this.yf=!0}; -function Zs(a,b,c,d,e){var f=a.qr,h=a.Wd;a=a.Eg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;lc){for(f=d+(e===Ds?f:-f);0>f;)f+=360;f%=360;180=n.length-1)break;ct(a,l,m,n,p,e,f)||dt(a,l,m,n,p,e,f);l=f.x;m=f.y}w.v(f);a.Qm++;if(!(23Math.abs(r)?Math.abs(l-f)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0Math.abs(q)?0:q;q=!1;q=Math.abs(f)>Math.abs(p)?0p:0a.Qm?a.Wd-h/(2*Math.PI):5>n.length&&10=p.length-1)break;ct(a,l,m,p,q,e,n)||dt(a,l,m,p,q,e,n);l=n.x;m=n.y}w.v(n);a.Qm++;if(!(23a.Qm?a.Wd-f/(2*Math.PI):a.Wd-(0k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0} -function dt(a,b,c,d,e,f,h){var k=a.Wd,l=a.Eg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.$k;d=!1;if(0<=b!==(f===Ds)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}As.prototype.commitLayout=function(){this.commitNodes();this.eu&&this.commitLinks()}; -As.prototype.commitNodes=function(){for(var a=this.VG,b=this.network.vertexes.i;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};As.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()}; -function Vs(a,b,c,d,e){var f=a.MG;if(.001>Math.abs(a.Do-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1)),l=0,m=0;m<=f;m++)l=void 0!==d&&void 0!==e?d+m*e/f:m*Math.PI/(2*f),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function Us(a,b,c,d,e){var f=0,f=void 0!==d&&void 0!==e?Vs(a,1,c,d,e):Vs(a,1,c);return b/f} -function Ws(a,b,c,d,e){if(.001>Math.abs(a.Do-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-f*f*l*l)*a;if(h>=e)return k*a}} -As.prototype.sort=function(a){switch(this.sorting){case Is:break;case Js:a.reverse();break;case Gs:a.sort(this.comparer);break;case Hs:a.sort(this.comparer);a.reverse();break;case Es:for(var b=[],c=0;ce&&(e=k,f=h)}else for(h=0;he&&(e=k,f=h);d.add(a.da(f));b[f]=-1;f=a.da(f);e=0;for(h=f.kc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&& -b[e]++;for(f=f.hc;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(f=0;fa[f].indexOf(l)&&a[f].push(l);for(b=b.kc;b.next();)l=d.indexOf(b.value.fromVertex),l!==f&&0>a[f].indexOf(l)&&a[f].push(l)}h=[];for(f=0;fk&&0!==Vr(s,c.x,c.y)){Wr(this,s,c.x,c.y,d,!0);h=this.l(2);if(4>this.qa)0===b||180=== +b?(h.x=a.x,h.y=c.y):(h.x=c.x,h.y=a.y),this.ea(2,h.x,h.y),this.w(3,h.x,h.y);else if(c=this.l(3),0===b||180===b)K(h.x,c.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.ea(2,h,a.y),this.ea(3,h,c.y)):K(h.y,c.y)?(Math.abs(a.y-h.y)<=s.ln/2&&(this.ea(2,h.x,a.y),this.ea(3,c.x,a.y)),this.w(2,h.x,a.y)):this.ea(2,a.x,h.y);else if(90===b||270===b)K(h.y,c.y)?(h=90===b?Math.max(h.y,a.y):Math.min(h.y,a.y),this.ea(2,a.x,h),this.ea(3,c.x,h)):K(h.x,c.x)?(Math.abs(a.x-h.x)<=s.mn/2&&(this.ea(2,a.x,h.y),this.ea(3, +a.x,c.y)),this.w(2,a.x,h.y)):this.ea(2,h.x,a.y);null!==r&&(a=this.l(1),c=this.l(2),a.x!==c.x&&a.y!==c.y?0===b||180===b?this.w(2,a.x,c.y):this.w(2,c.x,a.y):0===b||180===b?this.w(2,e.x,r.y):this.w(2,r.x,e.y));null!==u&&(0===d||180===d?this.hj(f.x,u.y):this.hj(u.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ii(l),this.ii(m))}};W.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2}; +function Bi(a){if(null===a.g||!a.sj)return!1;var b=a.points.n,c=b.length;if(4>c)return!1;a=Bn(a.g,!0,a.Ka,null);for(var d=1;da)return new Ae(Ee);var b=!1,c=this.g;null!==c&&Kr(this)&&c.al.contains(this)&&null!==this.lw&&(b=!0);var d=c=0,e=this.l(0).copy(),f=e.copy(),c=this.bd.n,h=this.computeCurve();if(h===xj&&3<=a&&!Va(this.vq,0))if(3===a)var k=this.l(1),c=Math.min(e.x,k.x),d=Math.min(e.y,k.y),k=this.l(2),c=Math.min(c,k.x),d=Math.min(d,k.y);else{if(this.jc)for(k=0;k=a&&(k=a-1),c=this.l(k), +f.x=Math.min(c.x,f.x),f.y=Math.min(c.y,f.y);c=f.x;d=f.y}else{for(k=0;kx?r>q?(u.x=v-y,u.y=q-y,t.x=v+s,t.y=q+s):(u.x=v-y,u.y=q+y,t.x=v+s,t.y=q-s):r>q?(u.x=v+y,u.y=q-y,t.x=v-s,t.y=q+s):(u.x=v+y,u.y=q+y,t.x=v-s,t.y=q-s));Va(x,v)&&Va(q,r)&&(q>p?(B>v?(u.x= +v-y,u.y=q-y,t.x=v+s):(u.x=v+y,u.y=q-y,t.x=v-s),t.y=q+s):(B>v?(u.x=v-y,u.y=q+y,t.x=v+s):(u.x=v+y,u.y=q+y,t.x=v-s),t.y=q-s));if(Va(x,v)&&Va(v,B)||Va(p,q)&&Va(q,r))x=.5*(x+B),p=.5*(p+r),u.x=x,u.y=p,t.x=x,t.y=p;1===k?(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y)):2===k&&Va(b.x,this.l(0).x)&&Va(b.y,this.l(0).y)&&(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y));N(l,e.x-c,e.y-d,h.x-c,h.y-d,m.x-c,m.y-d);f.set(h);e.set(a);b=m}}k=b.x;b=b.y;f=this.l(this.qa-1);0!==this.computeShortLength(!1)&&(f=Xr(this,f.copy(),!1,dd));k=.5*(k+f.x); +b=.5*(b+f.y);N(l,a.x-c,a.y-d,k-c,b-d,f.x-c,f.y-d)}else for(k=3;k=a&&(k=a-1),f=this.l(k-1),e=this.l(k),k===a-1&&0!==this.computeShortLength(!1)&&(e=Xr(this,e.copy(),!1,dd)),N(l,b.x-c,b.y-d,f.x-c,f.y-d,e.x-c,e.y-d);else{f=w.K();f.assign(this.l(0));for(k=1;k=a-1){f!==u&&(0!==this.computeShortLength(!1)&&(u=Xr(this,u.copy(),!1,dd)),$r(this,l,-c,-d,f,u,b));break}k=Yr(this,u,k+1,kn.x?u.x-s:u.x+s,y=t.y>u.y?u.y+v:u.y-v,$r(this,e,h,m,n,new z(q,B),p),Se(e,u.x+h,u.y+m,r+h,y+m),x.m(r,y))):K(n.x,u.x)&&K(u.y,t.y)?(s=this.computeCorner(),v=Math.min(s,Math.abs(u.y-n.y)/2),v=s=Math.min(v,Math.abs(t.x-u.x)/2),K(s,0)?($r(this,e,h,m,n,u,p),x.assign(u)):(q=u.x,y=B=u.y,B=u.y>n.y?u.y-v:u.y+v,r=t.x>u.x?u.x+s:u.x-s,$r(this,e, +h,m,n,new z(q,B),p),Se(e,u.x+h,u.y+m,r+h,y+m),x.m(r,y))):($r(this,e,h,m,n,u,p),x.assign(u))}w.v(f)}c=l.o;w.q(l)}else l=this.l(1).copy(),l.x-=c,l.y-=d,0!==this.computeShortLength(!0)&&(e=Xr(this,e,!0,f)),0!==this.computeShortLength(!1)&&(l=Xr(this,l,!1,f)),c=new Ae(Ee),c.ia=e.x,c.ga=e.y,c.D=l.x,c.F=l.y;return c}; +function Zr(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return Va(a,0)?b:Va(b,0)?a:Math.sqrt(a*a+b*b)} +function Xr(a,b,c,d){var e=a.qa;if(2>e)return b;if(c){var f=a.l(1);c=f.x-d.x;d=f.y-d.y;f=Zr(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!0);a>e&&(a=e);c=a*(c-b.x)/f;a=a*(d-b.y)/f;b.x+=c;b.y+=a}else{f=a.l(e-2);c=f.x-d.x;d=f.y-d.y;f=Zr(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!1);a>e&&(a=e);c=a*(b.x-c)/f;a=a*(b.y-d)/f;b.x-=c;b.y-=a}return b} +function Yr(a,b,c,d){for(var e=a.qa,f=b;Va(b.x,f.x)&&Va(b.y,f.y);){if(c>=e)return e-1;f=a.l(c++)}if(!Va(b.x,f.x)&&!Va(b.y,f.y))return c-1;for(var h=f;Va(b.x,f.x)&&Va(f.x,h.x)&&(!d||(b.y>=f.y?f.y>=h.y:f.y<=h.y))||Va(b.y,f.y)&&Va(f.y,h.y)&&(!d||(b.x>=f.x?f.x>=h.x:f.x<=h.x));){if(c>=e)return e-1;h=a.l(c++)}return c-2} +function $r(a,b,c,d,e,f,h){if(!h&&Kr(a)){h=[];var k=0;a.isVisible()&&(k=as(a,e,f,h));var l=e.x,l=e.y;if(0p-10)m--,p=Math.max(q-5,f.x);else break;q=f.y-10+d;n=p+c;p=f.y+d;a.Ye===jj?M(b,n,p,!1,!1):N(b,l,q,n,q,n,p)}else if(K(e.x,f.x))if(e.yp-10)m--,p=Math.max(q-5,f.y);else break;q=f.x-10+c;n=f.x+c;p+=d;a.Ye===jj?M(b,n,p,!1,!1):N(b,q,l,q,p,n,p)}}b.lineTo(f.x+c,f.y+d)} +function as(a,b,c,d){var e=a.g;if(null===e||b.L(c))return 0;for(e=e.Dx;e.next();){var f=e.value;if(null!==f&&f.visible)for(var f=f.zb.n,h=f.length,k=0;kh.x&&n.x>m.x||m.xh.y&&n.y>m.y||m.yu&&Math.min(h,x)q&&!K(h,x)){n.x=u;n.y=q;n=!0;break a}}else if(!K(q,s)&&K(h,x)&&Math.min(q,s)h&&Math.min(u,t)p&&!K(u,t)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}w.v(k)}w.u(W,{Nt:"firstPickIndex"},function(){var a;2>=this.qa?a=0:((a=this.jc)||(a=this.computeSpot(!0)!==tb),a=a?1:0);return a});w.u(W,{Bx:"lastPickIndex"},function(){var a=this.qa;if(0===a)a=0;else if(2>=a)a-=1;else{var b;(b=this.jc)||(b=this.computeSpot(!1)!==tb);a=b?a-2:a-1}return a});function Kr(a){a=a.Ye;return a===ij||a===jj} +function Mr(a,b){if(b||Kr(a)){var c=a.g;null===c||c.al.contains(a)||null===a.lw||c.al.add(a,a.lw)}}function lj(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Kc){var d=c.g;if(null!==d)for(var e=!1,d=d.Dx;d.next();){var f=d.value;if(f.visible)if(f===c)for(var e=!0,h=!1,f=f.zb.n,k=f.length,l=0;l=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.xg=Math.floor((a.x-this.ze)/this.ze)*this.ze;this.yg=Math.floor((b-this.Ae)/this.Ae)*this.Ae;this.$r=Math.ceil((c+2*this.ze)/this.ze)*this.ze;this.as=Math.ceil((d+2*this.Ae)/this.Ae)*this.Ae;a=1+(Math.ceil((this.$r-this.xg)/this.ze)|0);b=1+(Math.ceil((this.as-this.yg)/this.Ae)|0);if(null===this.md||this.Bpthis.$r||a+cthis.as||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.Bp)|0;for(c=Math.min(b+e-1,this.Cp)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.md[a][e])return!1;return!0}; +function ds(a,b,c,d,e,f,h,k,l){if(!(bh||cl)){var m,n;m=b|0;n=c|0;var p=a.md[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;f<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.md[m][n]);)a.md[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0m;c+=d)ds(a,b,c,1,!e,f,h,k,l),ds(a,b,c,-1,!e,f,h,k,l);else if(0m;b+=d)ds(a,b,c,1,!e,f,h,k,l),ds(a,b,c,-1,!e,f,h, +k,l)}}function es(a,b,c,d,e,f,h,k,l){b|=0;c|=0;var m=0,n=1;for(a.md[b][c]=n;0===m&&b>f&&bk&&cf&&bk&&c=Math.abs(h-b)&&1>=Math.abs(k-d))a.abort=!0;else{var l=f.x,m=f.y,n=f.x+f.width,p=f.y+f.height,l=l-a.xg,l=l/a.ze,m=m-a.yg,m=m/a.Ae,n=n-a.xg,n=n/a.ze,p=p-a.yg,p=p/a.Ae;f=Math.max(0,Math.min(a.Bp,l|0));n=Math.min(a.Bp,Math.max(0,n|0));m=Math.max(0,Math.min(a.Cp,m|0));p=Math.min(a.Cp,Math.max(0,p|0));h|=0;k|=0;b|=0;d|=0;l=0===c|| +90===c?1:-1;c=90===c||270===c;0===a.md[h][k]?(es(a,h,k,l,c,f,n,m,p),es(a,h,k,1,!c,f,n,m,p),es(a,h,k,-1,!c,f,n,m,p)):es(a,h,k,l,c,h,k,h,k);0===a.md[b][d]?(fs(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,n,m,p),fs(a,b,d,1,!(90===e||270===e),f,n,m,p),fs(a,b,d,-1,!(90===e||270===e),f,n,m,p)):fs(a,b,d,l,c,b,d,b,d);a.abort||(ds(a,h,k,1,!1,f,n,m,p),ds(a,h,k,-1,!1,f,n,m,p),ds(a,h,k,1,!0,f,n,m,p),ds(a,h,k,-1,!0,f,n,m,p))}}}function Rr(){w.mc(this);this.port=this.Oc=null;this.bg=[];this.gq=!1} +w.$d(Rr,{Oc:!0,port:!0,bg:!0,gq:!0});Rr.prototype.toString=function(){for(var a=this.bg,b=this.Oc.toString()+" "+a.length.toString()+":",c=0;c=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case w.Rc|w.kd:return c>a&&c<=180+a?180:270;case w.kd|w.$c:return c>180-a&&c<=360-a?270:0;case w.$c|w.Zc:return c>a&&c<=180+a?90:0;case w.Zc|w.Rc:return c>180-a&&c<=360-a?180:90;case w.Rc|w.kd|w.$c:return 90180+a&&c<=360- +a?270:0;case w.kd|w.$c|w.Zc:return 180a&&180>=c?90:0;case w.$c|w.Zc|w.Rc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case w.Zc|w.Rc|w.kd:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(w.Rc|w.kd|w.$c|w.Zc)&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}Rr.prototype.$p=function(){this.bg.length=0}; +function Sr(a,b){var c=a.bg;if(0===c.length){a:if(!a.gq){c=a.gq;a.gq=!0;var d,e=null,f=a.Oc,f=f instanceof U?f:null;if(null===f||f.we)d=a.Oc.IE(a.port.Qd);else{if(!f.W.H()){a.gq=c;break a}e=f;d=e.HE()}var h=a.bg.length=0,k=a.port.Wa(xb,w.K()),l=a.port.Wa(Lb,w.K()),f=w.hg(k.x,k.y,0,0);f.ri(l);w.v(k);w.v(l);k=w.xb(f.x+f.width/2,f.y+f.height/2);for(d=d.i;d.next();)if(l=d.value,l.isVisible()){var m=l.Jc===a.port||l.Y.mi(e),n=l.computeSpot(m);if(n.uj()&&(m=m?l.jd:l.Jc,null!==m)){var p=m.U;if(null!==p){var m= +l.computeOtherPoint(p,m),p=k.Rb(m),n=gs(f,n,p,l.jc),q=0;0===n?(q=w.$c,180Math.abs(E)?(B=Math.abs(E)/ +q,q=Math.abs(E)):B=1;break;case w.Rc:r>Math.abs(H)?(B=Math.abs(H)/r,r=Math.abs(H)):B=1;break;case w.kd:m>Math.abs(E)?(B=Math.abs(E)/m,m=Math.abs(E)):B=1;break;default:case w.$c:p>Math.abs(H)?(B=Math.abs(H)/p,p=Math.abs(H)):B=1}v=0}var V=u.eq;if(e===rr){t=u.link.computeThickness();t*=B;V.set(y);switch(x){case w.Zc:V.x=y.x+E/2+q/2-v-t/2;break;case w.Rc:V.y=y.y+H/2+r/2-v-t/2;break;case w.kd:V.x=y.x+E/2-m/2+v+t/2;break;default:case w.$c:V.y=y.y+H/2-p/2+v+t/2}v+=t}else t=.5,e===or&&(t=(u.Yp+1)/(u.tn+1)), +V.x=y.x+E*t,V.y=y.y+H*t}w.v(k);w.v(d);w.v(l);w.v(n);y=a.bg;for(E=0;Eb.xe?1:a.angleb.angle?1:0}; +Rr.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Oc,this.port,tb,b.Jc===this.port),d=a.Yp;if(0>d)return c;var e=a.tn;if(1>=e||!b.jc)return c;var b=a.Lx,f=a.eq;if(a.xe===w.Rc||a.xe===w.Zc)d=e-1-d;return((a=a.xe===w.Rc||a.xe===w.$c)?b.ye&&(e=k.right);k.bottom>f&&(f=k.bottom)}}isFinite(c)&&isFinite(d)?a.m(c,d,e-c,f-d):(b=b.location,c=this.padding,a.m(b.x+c.left,b.y+c.top,0,0));return a}; +w.defineProperty(Mj,{padding:"padding"},function(){return this.ff},function(a){"number"===typeof a?a=new db(a):w.G(a,db,Mj,"padding");var b=this.ff;b.L(a)||(this.ff=a=a.S(),this.h("padding",b,a))});function rg(){0=c-1?(h=0,e=d,f+=k+20,k=0):h++}null!==a&&a.Gd("Layout")}this.zf=!0};rg.prototype.Sn=function(a){return!a.location.H()||a instanceof U&&a.Sn?!0:!1}; +function ks(a,b,c,d,e,f,h,k){for(c=c.i;c.next();){var l=c.value;d&&!l.bq||null!==e&&!e(l)||!l.canLayout()||(f&&l instanceof T?l.lf||(l instanceof U?null===l.Sb?ks(a,b,l.Nc,!1,e,f,h,k):(ls(l),b.add(l)):(ls(l),b.add(l))):h&&l instanceof W?b.add(l):!k||!l.de()||l instanceof T||(ls(l),b.add(l)))}}function ls(a){var b=a.W;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Ze()} +rg.prototype.collectParts=rg.prototype.pH=function(a){var b=new J(S);a instanceof D?(ks(this,b,a.eg,!0,null,!0,!0,!0),ks(this,b,a.links,!0,null,!0,!0,!0),ks(this,b,a.Jk,!0,null,!0,!0,!0)):a instanceof U?ks(this,b,a.Nc,!1,null,!0,!0,!0):ks(this,b,a.i,!1,null,!0,!0,!0);return b};w.defineProperty(rg,{oe:"arrangementOrigin"},function(){return this.Jq},function(a){w.G(a,z,rg,"arrangementOrigin");this.Jq.L(a)||(this.Jq.assign(a),this.J())}); +rg.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.Wa(xb),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a}; +function sg(){w.mc(this);this.ie=null;if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new J(ms);this.edges=new J(ns);this.Ix=new ka(T,ms);this.Ex=new ka(W,ns)}w.fa("LayoutNetwork",sg); +sg.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new J(ms);this.edges=new J(ns);this.Ix=new ka(T,ms);this.Ex=new ka(W,ns)}; +sg.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Sb?"("+this.Sb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1d?1:0):1:null!==d?-1:0}; +ms.smartComparer=function(a,b){if(null!==a){if(null!==b){var c=a.rd,d=b.rd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=f&&0>=h&&(f=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.Ub("Layout");d=[];switch(this.alignment){case Bs:var k=a,l=c,m=Math.max(this.Hp.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0h)d.push(new A(0,x,h+k,B)),v=0,t=u,x+=B,B=0;B=Math.max(B,H);H=0;switch(s){case As:H=-q.width;break;default:H=0}p.moveTo(t+H,x);switch(s){case As:t-=y;break; +default:t+=y}v++}d.push(new A(0,x,h+k,B));break;case ts:k=f;l=a;m=c;n=Math.max(this.Hp.width,1);p=x=y=0;q=w.K();for(f=0;f=y&&(h-=y);for(var y=H=0,E=Math.max(this.Hp.height,1),ba=p=0,Q=!0,$=w.K(),f=0;fk-1||0h){d.push(new A(0,Q?v-p:v,h+l,ba+p+m));for(V=0;Vy&&(e.width+=e.x-y,e.x=y)}for(k=f=h=e=0;kd?1:0}; +Mn.smartComparer=function(a,b){if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=a.count)1===a.count&&(a=a.first(),a.ka=0,a.ra=0);else{var b=new I(Us);b.Hc(a.i);a=new I(Us);var c=new I(Us),d;d=this.sort(b);var e=this.Sy,f=this.BC,h=this.Wd,k=this.Fo,l=this.Ty,m=this.pr,b=this.bl,n=this.SD,p=this.Gg,q=this.hv,e=this.Pf,f=this.Hx,h=this.fJ;if(!isFinite(h)|| +0>=h)h=NaN;k=this.iH;if(!isFinite(k)||0>=k)k=1;l=this.ye;isFinite(l)||(l=0);m=this.of;if(!isFinite(m)||360m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Rs&&f===Ss?e=Ds:e===Rs&&f!==Ss&&(f=Ss,e=this.Pf);if((this.direction===Ms||this.direction===Ns)&&this.sorting!==Gs){for(var r=0;!(r>=d.length);r+=2){a.add(d.da(r));if(r+1>=d.length)break;c.add(d.da(r+1))}this.direction===Ms?(this.Pf===Rs&&a.reverse(),d=new I(Us),d.Hc(a),d.Hc(c)):(this.Pf===Rs&&c.reverse(),d=new I(Us),d.Hc(c),d.Hc(a))}for(var s= +d.length,u=n=0,r=0;rm&&(0===r||r===d.length-1)&&(t/=2);n+=t;u++}if(isNaN(h)||e===Rs){isNaN(b)&&(b=6);if(e!==Ds&&e!==Rs){t=-Infinity;for(r=0;rh?(h=r,p=h*k):q=u/(360<=m?s:s-1)}this.Sy=e;this.BC=f;this.Wd=h;this.Fo=k;this.Ty=l;this.pr=m;this.bl=b;this.SD=n;this.Gg=p;this.hv=q;b=d;d=this.Sy;e=this.Wd;f=this.Ty;k=this.pr;l=this.bl;m=this.Gg;n=this.hv;if(this.direction!==Ms&&this.direction!==Ns||d!==Rs)if(this.direction===Ms||this.direction===Ns){h=0;switch(d){case Qs:h=180*Ys(this,e,m,f,n)/Math.PI;break;case Ds:n=b=0;h=a.first();null!==h&&(b=Vs(h,Math.PI/2));h=c.first();null!==h&&(n=Vs(h,Math.PI/2));h=180*Ys(this,e,m,f,l+(b+ +n)/2)/Math.PI;break;case Ps:h=k/b.length}if(this.direction===Ms){switch(d){case Qs:Zs(this,a,f,Os);break;case Ds:$s(this,a,f,Os);break;case Ps:at(this,a,k/2,f,Os)}switch(d){case Qs:Zs(this,c,f+h,Fs);break;case Ds:$s(this,c,f+h,Fs);break;case Ps:at(this,c,k/2,f+h,Fs)}}else{switch(d){case Qs:Zs(this,c,f,Os);break;case Ds:$s(this,c,f,Os);break;case Ps:at(this,c,k/2,f,Os)}switch(d){case Qs:Zs(this,a,f+h,Fs);break;case Ds:$s(this,a,f+h,Fs);break;case Ps:at(this,a,k/2,f+h,Fs)}}}else switch(d){case Qs:Zs(this, +b,f,this.direction);break;case Ds:$s(this,b,f,this.direction);break;case Ps:at(this,b,k,f,this.direction);break;case Rs:bt(this,b,k,f,this.direction)}else bt(this,b,k,f-k/2,Fs)}this.updateParts();this.network=null;this.zf=!0}; +function at(a,b,c,d,e){var f=a.pr,h=a.Wd;a=a.Gg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;lc){for(f=d+(e===Fs?f:-f);0>f;)f+=360;f%=360;180=n.length-1)break;et(a,l,m,n,p,e,f)||ft(a,l,m,n,p,e,f);l=f.x;m=f.y}w.v(f);a.Qm++;if(!(23Math.abs(r)?Math.abs(l-f)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0Math.abs(q)?0:q;q=!1;q=Math.abs(f)>Math.abs(p)?0p:0a.Qm?a.Wd-h/(2*Math.PI):5>n.length&&10=p.length-1)break;et(a,l,m,p,q,e,n)||ft(a,l,m,p,q,e,n);l=n.x;m=n.y}w.v(n);a.Qm++;if(!(23a.Qm?a.Wd-f/(2*Math.PI):a.Wd-(0k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0} +function ft(a,b,c,d,e,f,h){var k=a.Wd,l=a.Gg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.bl;d=!1;if(0<=b!==(f===Fs)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}Cs.prototype.commitLayout=function(){this.commitNodes();this.du&&this.commitLinks()}; +Cs.prototype.commitNodes=function(){for(var a=this.YG,b=this.network.vertexes.i;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};Cs.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()}; +function Xs(a,b,c,d,e){var f=a.PG;if(.001>Math.abs(a.Fo-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1)),l=0,m=0;m<=f;m++)l=void 0!==d&&void 0!==e?d+m*e/f:m*Math.PI/(2*f),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function Ws(a,b,c,d,e){var f=0,f=void 0!==d&&void 0!==e?Xs(a,1,c,d,e):Xs(a,1,c);return b/f} +function Ys(a,b,c,d,e){if(.001>Math.abs(a.Fo-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-f*f*l*l)*a;if(h>=e)return k*a}} +Cs.prototype.sort=function(a){switch(this.sorting){case Ks:break;case Ls:a.reverse();break;case Is:a.sort(this.comparer);break;case Js:a.sort(this.comparer);a.reverse();break;case Gs:for(var b=[],c=0;ce&&(e=k,f=h)}else for(h=0;he&&(e=k,f=h);d.add(a.da(f));b[f]=-1;f=a.da(f);e=0;for(h=f.lc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&& +b[e]++;for(f=f.ic;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(f=0;fa[f].indexOf(l)&&a[f].push(l);for(b=b.lc;b.next();)l=d.indexOf(b.value.fromVertex),l!==f&&0>a[f].indexOf(l)&&a[f].push(l)}h=[];for(f=0;fa[b[p]].indexOf(b[p===b.length-1?0:p+1])&&u.push(p===b.length-1?0:p+1);if(0===u.length)for(p=0;pH.indexOf(Q)||$H.indexOf(Q)|| $=t?l+1:l)),v+=l=t&&l++,y>=t&&y++,l>y&&(H=y,y=l,l=H),y-l<(b.length+2)/2===(lq||q===l||(s=q>l?q-l:l-q,p+=qh-s?1:-1);b.splice(0>p?l:l+1,0,m);c.splice(k,1);k--}else f=!1;if(f)break;else b.push(c[0]),c.splice(0,1)}for(f=0;f=a?a:360,this.J())}); -w.defineProperty(As,{Of:"arrangement"},function(){return this.kd},function(a){this.kd!==a&&(w.mb(a,As,As,"arrangement"),a===Ps||a===Bs||a===Os||a===Ns)&&(this.kd=a,this.J())});w.defineProperty(As,{direction:"direction"},function(){return this.aa},function(a){this.aa!==a&&(w.mb(a,As,As,"direction"),a===Ds||a===Ms||a===Ks||a===Ls)&&(this.aa=a,this.J())}); -w.defineProperty(As,{sorting:"sorting"},function(){return this.$h},function(a){this.$h!==a&&(w.mb(a,As,As,"sorting"),a===Is||a===Js||a===Gs||Hs||a===Es)&&(this.$h=a,this.J())});w.defineProperty(As,{comparer:"comparer"},function(){return this.Jh},function(a){this.Jh!==a&&(w.j(a,"function",As,"comparer"),this.Jh=a,this.J())});w.defineProperty(As,{spacing:"spacing"},function(){return this.ai},function(a){this.ai!==a&&(w.j(a,"number",As,"spacing"),this.ai=a,this.J())}); -w.defineProperty(As,{Ix:"nodeDiameterFormula"},function(){return this.ss},function(a){this.ss!==a&&(w.mb(a,As,As,"nodeDiameterFormula"),a===Fs||a===Qs)&&(this.ss=a,this.J())});w.u(As,{WG:"actualXRadius"},function(){return this.Wd});w.u(As,{XG:"actualYRadius"},function(){return this.Eg});w.u(As,{UJ:"actualSpacing"},function(){return this.$k});w.u(As,{VG:"actualCenter"},function(){return isNaN(this.oe.x)||isNaN(this.oe.y)?new z(0,0):new z(this.oe.x+this.WG,this.oe.y+this.XG)});var Bs; -As.ConstantSpacing=Bs=w.p(As,"ConstantSpacing",0);var Os;As.ConstantDistance=Os=w.p(As,"ConstantDistance",1);var Ns;As.ConstantAngle=Ns=w.p(As,"ConstantAngle",2);var Ps;As.Packed=Ps=w.p(As,"Packed",3);var Ds;As.Clockwise=Ds=w.p(As,"Clockwise",4);var Ms;As.Counterclockwise=Ms=w.p(As,"Counterclockwise",5);var Ks;As.BidirectionalLeft=Ks=w.p(As,"BidirectionalLeft",6);var Ls;As.BidirectionalRight=Ls=w.p(As,"BidirectionalRight",7);var Is;As.Forwards=Is=w.p(As,"Forwards",8);var Js; -As.Reverse=Js=w.p(As,"Reverse",9);var Gs;As.Ascending=Gs=w.p(As,"Ascending",10);var Hs;As.Descending=Hs=w.p(As,"Descending",11);var Es;As.Optimized=Es=w.p(As,"Optimized",12);var Fs;As.Pythagorean=Fs=w.p(As,"Pythagorean",13);var Qs;As.Circular=Qs=w.p(As,"Circular",14);function Cs(){this.Wp=-Infinity;this.Aq=this.co=null} -Cs.prototype.compare=function(a,b){if(0this.Wp||Math.abs(a)a&&0f?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new z(n.x+n.width+d.width,n.y),l[1]=new z(n.x,n.y+n.height+d.height),f=2):(p=Yt(l,f,e,k,n.width,n.height,d),q=l[p],r=new z(q.x+n.width+d.width, -q.y),s=new z(q.x,q.y+n.height+d.height),p+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().jb,d=this.network.vertexes.i;d.next();){if(d.value.jb.Kg(c)&&(a++,2a.network.vertexes.count)return!1;null===a.Dg?a.Dg=new I(cu):a.Dg.clear();a.Dg.Hc(a.network.vertexes);var c=a.Dg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.eg-a.eg});for(var d=c.count-1;0<=d&&1>=c.da(d).eg;)d--;return 1=h))){for(var m=0,n=0,p=l.count-h;ps&&(s=1);m=Wd((m+s+n*n*4/(h*h))/ -s);h=(m-1)*p/2;m=(m-1)*q/2;f.jb=new A(k-r.x-h,l-r.y-m,p+2*h,q+2*m);f.focus=new z(r.x+h,r.y+m)}a.network=d;return c}function bu(a,b){for(var c=a.network.vertexes.i;c.next();){var d=c.value;d.network=b;if(null!==d.Dh){var e=d.Dh.da(d.VA);d.eg=e.qy;var f=e.BB,h=e.CB;d.jb=new A(d.ja-f,d.ra-h,e.sy,e.py);d.focus=new z(f,h);d.VA--}}for(c=a.network.edges.i;c.next();)c.value.network=b;a.network=b} -function du(a,b){var c=b.nn;if(null!==c&&0!==c.count){var d=b.ja,e=b.ra,f=b.width,h=b.height;null!==b.Dh&&0=p.eg?l++:(k=!0,m++,h+=Math.atan2(b.ra-p.ra,b.ja-p.ja))}if(0!==l)for(0>1)+n)*(0===k%2?1:-1);l.ja=d+p*Math.cos(q);l.ra=e+p*Math.sin(q);k++}}}function Yt(a,b,c,d,e,f,h){var k=9E19,l=-1,m=0;a:for(;mn.y&&a[q].x-n.xn.x&&a[q].y-n.yl+h?(d=d+f-k,e=e-l-h,Wd(d*d+e*e)):e+ck+m?e>l+h?(d=d-k-m,e=e-l-h,Wd(d*d+e*e)):e+cl+h?e-(l+h):e+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.ja,e=d,f=c.ra,h=f,c=1;ch-f)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.ja-b.ja}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.ra-b.ra});for(var h=a.Oh,m=0,n=0,p=0,c=0;ch||p-d>h){if(f)break}else if(l-r>h||r-l>h){if(!f)break}else{var s=fu(k,e);1>s?(n=a.Rx,null===n&&(a.Rx=n=new ta(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.M.right-k.M.x),n=(1+n)*m):dr?(p=Math.abs(e.M.bottom-k.M.y),p=(1+p)*s):ds?(n=a.Rx,null===n&&(a.Rx=n=new ta(0)),m=n.random(),s= -n.random(),n=(d>p?1:-1)*(1+(e.width>k.width?e.width:k.width))*m,p=(l>r?1:-1)*(1+(e.height>k.height?e.height:k.height))*s):(m=f.stiffness*(s-f.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=Math.max(a.Oh/20,50);for(e=0;ed&&(f=d),h<-d?h=-d:h>d&&(h=d),k.ja+=f,k.ra+=h,c=Math.max(c,f*f+h*h));return c>a.DE*a.DE}ft.prototype.moveFixedVertex=function(){}; -ft.prototype.commitLayout=function(){this.cB();this.commitNodes();this.eu&&this.commitLinks()};ft.prototype.cB=function(){if(this.uq)for(var a=this.network.edges.i;a.next();){var b=a.value.link;null!==b&&(b.Ab=oc,b.Bb=oc)}};ft.prototype.commitNodes=function(){var a=0,b=0;if(this.eH){var c=w.Df();this.sh(this.network,c);b=this.oe;a=b.x-c.x;b=b.y-c.y;w.Gb(c)}for(var c=w.Df(),d=this.network.vertexes.i;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.jb),c.x+=a,c.y+=b,e.jb=c;e.commit()}w.Gb(c)}; -ft.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};ft.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.zo:a};ft.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.yo:a};ft.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.wo:a};ft.prototype.electricalFieldX=function(){return 0};ft.prototype.electricalFieldY=function(){return 0}; -ft.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.xo:a};ft.prototype.gravitationalFieldX=function(){return 0};ft.prototype.gravitationalFieldY=function(){return 0};ft.prototype.isFixed=function(a){return a.isFixed};w.u(ft,{yK:"currentIteration"},function(){return this.Sr});w.defineProperty(ft,{iE:"arrangementSpacing"},function(){return this.hg},function(a){w.G(a,ha,ft,"arrangementSpacing");this.hg.L(a)||(this.hg.assign(a),this.J())}); -w.defineProperty(ft,{eH:"arrangesToOrigin"},function(){return this.Lq},function(a){this.Lq!==a&&(w.j(a,"boolean",ft,"arrangesToOrigin"),this.Lq=a,this.J())});w.defineProperty(ft,{uq:"setsPortSpots"},function(){return this.Zh},function(a){this.Zh!==a&&(w.j(a,"boolean",ft,"setsPortSpots"),this.Zh=a,this.J())});w.defineProperty(ft,{comments:"comments"},function(){return this.Ih},function(a){this.Ih!==a&&(w.j(a,"boolean",ft,"comments"),this.Ih=a,this.J())}); -w.defineProperty(ft,{EA:"maxIterations"},function(){return this.ap},function(a){this.ap!==a&&(w.j(a,"number",ft,"maxIterations"),0<=a&&(this.ap=a,this.J()))});w.defineProperty(ft,{DE:"epsilonDistance"},function(){return this.tr},function(a){this.tr!==a&&(w.j(a,"number",ft,"epsilonDistance"),0b.toVertex.index&&(a.Yx(b),b.rev=!0);break;case ju:for(d=this.network.vertexes.i;d.next();)a=d.value,a.Rp=-1,a.finish=-1;for(a=this.network.edges.i;a.next();)a.value.forest=!1;this.os=0;for(d.reset();d.next();)b=d.value,0===b.kc.count&&tu(this,b);for(d.reset();d.next();)b=d.value,-1===b.Rp&&tu(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,f=e.finish,e.Rpu&&0u&&0d[this.Kf]&&(this.Vv=d[b]-1,this.Kf=b),d[b]h)for(var p=h+1;pn;p--)l=d[p],l.near===m&&l.kn===m.kn||k++;var m=0,q,r=q=p=l=0,s,u=0,t=0;s=0;var x;if(0<=c)for(n=d[h].Oe,m=0;mq||q===l||(s=q>l?q-l:l-q,p+=qh-s?1:-1);b.splice(0>p?l:l+1,0,m);c.splice(k,1);k--}else f=!1;if(f)break;else b.push(c[0]),c.splice(0,1)}for(f=0;f=a?a:360,this.J())}); +w.defineProperty(Cs,{Pf:"arrangement"},function(){return this.ld},function(a){this.ld!==a&&(w.mb(a,Cs,Cs,"arrangement"),a===Rs||a===Ds||a===Qs||a===Ps)&&(this.ld=a,this.J())});w.defineProperty(Cs,{direction:"direction"},function(){return this.aa},function(a){this.aa!==a&&(w.mb(a,Cs,Cs,"direction"),a===Fs||a===Os||a===Ms||a===Ns)&&(this.aa=a,this.J())}); +w.defineProperty(Cs,{sorting:"sorting"},function(){return this.$h},function(a){this.$h!==a&&(w.mb(a,Cs,Cs,"sorting"),a===Ks||a===Ls||a===Is||Js||a===Gs)&&(this.$h=a,this.J())});w.defineProperty(Cs,{comparer:"comparer"},function(){return this.Jh},function(a){this.Jh!==a&&(w.j(a,"function",Cs,"comparer"),this.Jh=a,this.J())});w.defineProperty(Cs,{spacing:"spacing"},function(){return this.ai},function(a){this.ai!==a&&(w.j(a,"number",Cs,"spacing"),this.ai=a,this.J())}); +w.defineProperty(Cs,{Hx:"nodeDiameterFormula"},function(){return this.rs},function(a){this.rs!==a&&(w.mb(a,Cs,Cs,"nodeDiameterFormula"),a===Hs||a===Ss)&&(this.rs=a,this.J())});w.u(Cs,{ZG:"actualXRadius"},function(){return this.Wd});w.u(Cs,{$G:"actualYRadius"},function(){return this.Gg});w.u(Cs,{XJ:"actualSpacing"},function(){return this.bl});w.u(Cs,{YG:"actualCenter"},function(){return isNaN(this.oe.x)||isNaN(this.oe.y)?new z(0,0):new z(this.oe.x+this.ZG,this.oe.y+this.$G)});var Ds; +Cs.ConstantSpacing=Ds=w.p(Cs,"ConstantSpacing",0);var Qs;Cs.ConstantDistance=Qs=w.p(Cs,"ConstantDistance",1);var Ps;Cs.ConstantAngle=Ps=w.p(Cs,"ConstantAngle",2);var Rs;Cs.Packed=Rs=w.p(Cs,"Packed",3);var Fs;Cs.Clockwise=Fs=w.p(Cs,"Clockwise",4);var Os;Cs.Counterclockwise=Os=w.p(Cs,"Counterclockwise",5);var Ms;Cs.BidirectionalLeft=Ms=w.p(Cs,"BidirectionalLeft",6);var Ns;Cs.BidirectionalRight=Ns=w.p(Cs,"BidirectionalRight",7);var Ks;Cs.Forwards=Ks=w.p(Cs,"Forwards",8);var Ls; +Cs.Reverse=Ls=w.p(Cs,"Reverse",9);var Is;Cs.Ascending=Is=w.p(Cs,"Ascending",10);var Js;Cs.Descending=Js=w.p(Cs,"Descending",11);var Gs;Cs.Optimized=Gs=w.p(Cs,"Optimized",12);var Hs;Cs.Pythagorean=Hs=w.p(Cs,"Pythagorean",13);var Ss;Cs.Circular=Ss=w.p(Cs,"Circular",14);function Es(){this.Vp=-Infinity;this.zq=this.fo=null} +Es.prototype.compare=function(a,b){if(0this.Vp||Math.abs(a)a&&0f?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new z(n.x+n.width+d.width,n.y),l[1]=new z(n.x,n.y+n.height+d.height),f=2):(p=Zt(l,f,e,k,n.width,n.height,d),q=l[p],r=new z(q.x+n.width+d.width, +q.y),s=new z(q.x,q.y+n.height+d.height),p+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().cb,d=this.network.vertexes.i;d.next();){if(d.value.cb.Tf(c)&&(a++,2a.network.vertexes.count)return!1;null===a.Fg?a.Fg=new I(du):a.Fg.clear();a.Fg.Hc(a.network.vertexes);var c=a.Fg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.fg-a.fg});for(var d=c.count-1;0<=d&&1>=c.da(d).fg;)d--;return 1=h))){for(var m=0,n=0,p=l.count-h;ps&&(s=1);m=Td((m+s+n*n*4/(h*h))/ +s);h=(m-1)*p/2;m=(m-1)*q/2;f.cb=new A(k-r.x-h,l-r.y-m,p+2*h,q+2*m);f.focus=new z(r.x+h,r.y+m)}a.network=d;return c}function cu(a,b){for(var c=a.network.vertexes.i;c.next();){var d=c.value;d.network=b;if(null!==d.Dh){var e=d.Dh.da(d.ZA);d.fg=e.py;var f=e.FB,h=e.GB;d.cb=new A(d.ka-f,d.ra-h,e.qy,e.oy);d.focus=new z(f,h);d.ZA--}}for(c=a.network.edges.i;c.next();)c.value.network=b;a.network=b} +function eu(a,b){var c=b.pn;if(null!==c&&0!==c.count){var d=b.ka,e=b.ra,f=b.width,h=b.height;null!==b.Dh&&0=p.fg?l++:(k=!0,m++,h+=Math.atan2(b.ra-p.ra,b.ka-p.ka))}if(0!==l)for(0>1)+n)*(0===k%2?1:-1);l.ka=d+p*Math.cos(q);l.ra=e+p*Math.sin(q);k++}}}function Zt(a,b,c,d,e,f,h){var k=9E19,l=-1,m=0;a:for(;mn.y&&a[q].x-n.xn.x&&a[q].y-n.yl+h?(d=d+f-k,e=e-l-h,Td(d*d+e*e)):e+ck+m?e>l+h?(d=d-k-m,e=e-l-h,Td(d*d+e*e)):e+cl+h?e-(l+h):e+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.ka,e=d,f=c.ra,h=f,c=1;ch-f)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.ka-b.ka}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.ra-b.ra});for(var h=a.Oh,m=0,n=0,p=0,c=0;ch||p-d>h){if(f)break}else if(l-r>h||r-l>h){if(!f)break}else{var s=gu(k,e);1>s?(n=a.Qx,null===n&&(a.Qx=n=new ta(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.M.right-k.M.x),n=(1+n)*m):dr?(p=Math.abs(e.M.bottom-k.M.y),p=(1+p)*s):ds?(n=a.Qx,null===n&&(a.Qx=n=new ta(0)),m=n.random(),s= +n.random(),n=(d>p?1:-1)*(1+(e.width>k.width?e.width:k.width))*m,p=(l>r?1:-1)*(1+(e.height>k.height?e.height:k.height))*s):(m=f.stiffness*(s-f.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=Math.max(a.Oh/20,50);for(e=0;ed&&(f=d),h<-d?h=-d:h>d&&(h=d),k.ka+=f,k.ra+=h,c=Math.max(c,f*f+h*h));return c>a.GE*a.GE}ht.prototype.moveFixedVertex=function(){}; +ht.prototype.commitLayout=function(){this.gB();this.commitNodes();this.du&&this.commitLinks()};ht.prototype.gB=function(){if(this.tq)for(var a=this.network.edges.i;a.next();){var b=a.value.link;null!==b&&(b.Ab=rc,b.Bb=rc)}};ht.prototype.commitNodes=function(){var a=0,b=0;if(this.hH){var c=w.Ef();this.sh(this.network,c);b=this.oe;a=b.x-c.x;b=b.y-c.y;w.Db(c)}for(var c=w.Ef(),d=this.network.vertexes.i;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.cb),c.x+=a,c.y+=b,e.cb=c;e.commit()}w.Db(c)}; +ht.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};ht.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Bo:a};ht.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Ao:a};ht.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.yo:a};ht.prototype.electricalFieldX=function(){return 0};ht.prototype.electricalFieldY=function(){return 0}; +ht.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.zo:a};ht.prototype.gravitationalFieldX=function(){return 0};ht.prototype.gravitationalFieldY=function(){return 0};ht.prototype.isFixed=function(a){return a.isFixed};w.u(ht,{BK:"currentIteration"},function(){return this.Rr});w.defineProperty(ht,{lE:"arrangementSpacing"},function(){return this.jg},function(a){w.G(a,ha,ht,"arrangementSpacing");this.jg.L(a)||(this.jg.assign(a),this.J())}); +w.defineProperty(ht,{hH:"arrangesToOrigin"},function(){return this.Kq},function(a){this.Kq!==a&&(w.j(a,"boolean",ht,"arrangesToOrigin"),this.Kq=a,this.J())});w.defineProperty(ht,{tq:"setsPortSpots"},function(){return this.Zh},function(a){this.Zh!==a&&(w.j(a,"boolean",ht,"setsPortSpots"),this.Zh=a,this.J())});w.defineProperty(ht,{comments:"comments"},function(){return this.Ih},function(a){this.Ih!==a&&(w.j(a,"boolean",ht,"comments"),this.Ih=a,this.J())}); +w.defineProperty(ht,{IA:"maxIterations"},function(){return this.cp},function(a){this.cp!==a&&(w.j(a,"number",ht,"maxIterations"),0<=a&&(this.cp=a,this.J()))});w.defineProperty(ht,{GE:"epsilonDistance"},function(){return this.sr},function(a){this.sr!==a&&(w.j(a,"number",ht,"epsilonDistance"),0b.toVertex.index&&(a.Xx(b),b.rev=!0);break;case ku:for(d=this.network.vertexes.i;d.next();)a=d.value,a.Qp=-1,a.finish=-1;for(a=this.network.edges.i;a.next();)a.value.forest=!1;this.ns=0;for(d.reset();d.next();)b=d.value,0===b.lc.count&&uu(this,b);for(d.reset();d.next();)b=d.value,-1===b.Qp&&uu(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,f=e.finish,e.Qpu&&0u&&0d[this.Lf]&&(this.Vv=d[b]-1,this.Lf=b),d[b]h)for(var p=h+1;pn;p--)l=d[p],l.near===m&&l.kn===m.kn||k++;var m=0,q,r=q=p=l=0,s,u=0,t=0;s=0;var x;if(0<=c)for(n=d[h].Oe,m=0;mu||l===u&&q>s)&&k++,tl||u===l&&s>q)&&k++);if(0>=c)for(n=d[h].He,m=0;mu||l===u&&p>t)&&k++,sl||u===l&&t>p)&&k++);f[h*e+h]=k;for(n=h+1;n=c)for(k=d[h].He,x=d[n].He,m=0;m=c&&(l=k.Oe);var m=null;0<=c&&(m=k.He);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q=c&&(l=k.Oe);var m=null;0<=c&&(m=k.He);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q>1,f[h]=0!==(n&1)?p[m]:p[m-1]+p[m]>>1)}xu(a,b,d);return f}function Fu(a,b,c,d,e,f){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.hc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Fu(a,m,c,d,e,f)}if(f)for(l=b.kc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Fu(a,m,c,d,e,f)}} -function Gu(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var h=b.hc;h.next();)Gu(a,h.value.toVertex,c,d,e,f);if(f)for(b=b.kc;b.next();)Gu(a,b.value.fromVertex,c,d,e,f)}}function qu(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid)return b}return null}function ru(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.hc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null} -function su(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.kc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function tu(a,b){b.Rp=a.os;a.os++;for(var c=b.hc;c.next();){var d=c.value,e=d.toVertex;-1===e.Rp&&(d.forest=!0,tu(a,e))}b.finish=a.os;a.os++} -iu.prototype.assignLayers=function(){switch(this.Xo){case Hu:Iu(this);break;case Ju:for(var a=0,b=this.network.vertexes.i;b.next();)a=Ku(this,b.value),this.pb=Math.max(a,this.pb);for(b.reset();b.next();)a=b.value,a.layer=this.pb-a.layer;break;default:case ku:Iu(this);for(b=this.network.vertexes.i;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.kc.count&&Lu(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.pb=-1;for(b.reset();b.next();){var c=b.value;c.layer-= -a;this.pb=Math.max(this.pb,c.layer)}}};function Iu(a){for(var b=a.network.vertexes.i;b.next();){var c=Mu(a,b.value);a.pb=Math.max(c,a.pb)}}function Mu(a,b){var c=0;if(-1===b.layer){for(var d=b.hc;d.next();)var e=d.value,f=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Mu(a,f)+e);b.layer=c}else c=b.layer;return c}function Ku(a,b){var c=0;if(-1===b.layer){for(var d=b.kc;d.next();)var e=d.value,f=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Ku(a,f)+e);b.layer=c}else c=b.layer;return c} -function Lu(a,b){if(!b.valid){b.valid=!0;for(var c=b.hc;c.next();)Lu(a,c.value.toVertex);for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(var d=b.Oe.n,e=d.length,f=0;fh&&Fu(a,k,0,-1,!0,!1)}for(Fu(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.i;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Oe.n,e=s.length,f=0;f=c&&(l=k.Oe);var m=null;0<=c&&(m=k.He);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q=c&&(l=k.Oe);var m=null;0<=c&&(m=k.He);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q>1,f[h]=0!==(n&1)?p[m]:p[m-1]+p[m]>>1)}yu(a,b,d);return f}function Gu(a,b,c,d,e,f){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.ic;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Gu(a,m,c,d,e,f)}if(f)for(l=b.lc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Gu(a,m,c,d,e,f)}} +function Hu(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var h=b.ic;h.next();)Hu(a,h.value.toVertex,c,d,e,f);if(f)for(b=b.lc;b.next();)Hu(a,b.value.fromVertex,c,d,e,f)}}function ru(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid)return b}return null}function su(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.ic;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null} +function tu(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.lc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function uu(a,b){b.Qp=a.ns;a.ns++;for(var c=b.ic;c.next();){var d=c.value,e=d.toVertex;-1===e.Qp&&(d.forest=!0,uu(a,e))}b.finish=a.ns;a.ns++} +ju.prototype.assignLayers=function(){switch(this.Zo){case Iu:Ju(this);break;case Ku:for(var a=0,b=this.network.vertexes.i;b.next();)a=Lu(this,b.value),this.qb=Math.max(a,this.qb);for(b.reset();b.next();)a=b.value,a.layer=this.qb-a.layer;break;default:case lu:Ju(this);for(b=this.network.vertexes.i;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.lc.count&&Mu(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.qb=-1;for(b.reset();b.next();){var c=b.value;c.layer-= +a;this.qb=Math.max(this.qb,c.layer)}}};function Ju(a){for(var b=a.network.vertexes.i;b.next();){var c=Nu(a,b.value);a.qb=Math.max(c,a.qb)}}function Nu(a,b){var c=0;if(-1===b.layer){for(var d=b.ic;d.next();)var e=d.value,f=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Nu(a,f)+e);b.layer=c}else c=b.layer;return c}function Lu(a,b){var c=0;if(-1===b.layer){for(var d=b.lc;d.next();)var e=d.value,f=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Lu(a,f)+e);b.layer=c}else c=b.layer;return c} +function Mu(a,b){if(!b.valid){b.valid=!0;for(var c=b.ic;c.next();)Mu(a,c.value.toVertex);for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(var d=b.Oe.n,e=d.length,f=0;fh&&Gu(a,k,0,-1,!0,!1)}for(Gu(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.i;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Oe.n,e=s.length,f=0;fd)&&!n&&(h=l,d=m)}if(0>f){for(c.reset();c.next();)f=c.value,1===f.component&&(f.layer-=e);b.component=0}else h.component=0}}} -function vu(a,b,c){return 90===a.aa?c&&!b.rev||!c&&b.rev?270:90:180===a.aa?c&&!b.rev||!c&&b.rev?0:180:270===a.aa?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} -iu.prototype.initializeIndices=function(){switch(this.Mo){default:case Nu:for(var a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;b.index=this.he[c];this.he[c]++}break;case lu:a=this.network.vertexes.i;for(b=this.pb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Ou(this,c);break;case Pu:for(a=this.network.vertexes.i,b=0;b<=this.pb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Qu(this,c)}}; -function Ou(a,b){var c=b.layer;b.index=a.he[c];a.he[c]++;for(var c=b.He.dc(),d=!0;d;)for(var d=!1,e=0;eh.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;eh.portToColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;e=h;d--)f=Su(this,d,-1)||f;e=this.countCrossings();e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Su(this,d,1)||f;e=this.countCrossings();e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Su(this,d,1)||f;e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1, -d=h;d<=c;d++)f=Su(this,d,-1)||f;e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Su(this,d,0)||f;e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Su(this,d,0)||f;e>=a?Au(this,b):(a=e,b=zu(this))}break;default:case mu:for(c=this.pb,h=0,k=a+1;(d=this.countCrossings())=h;d--)f=Su(this,d,-1)||f;e=this.countCrossings();e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Su(this,d,1)||f;e=this.countCrossings(); -e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Su(this,d,1)||f;e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Su(this,d,-1)||f;e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Su(this,d,0)||f;e>=a?Au(this,b):(a=e,b=zu(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Su(this,d,0)||f;e>=a?Au(this,b):(a=e,b=zu(this))}}Au(this,b)}; -function Ru(a,b,c){var d=0,e=wu(a,b),f=a.he[b],h=Eu(a,b,c);c=Du(a,b,c);for(d=0;df+1&&(q+=4*(v-f),r+=4*(v-(f+1)))}y=d[f].hc.i;for(y.reset();y.next();)if(v=y.value,B=v.toVertex,v.valid&&B.layer===b){for(v=0;d[v]!==B;)v++;v===f+1&&(r+=1)}y=d[f+1].kc.i;for(y.reset();y.next();)if(v=y.value,B=v.fromVertex,v.valid&&B.layer===b){for(v=0;d[v]!==B;)v++;vf+1&&(q+=4*(v-(f+1)),r+=4*(v-f))}y=d[f+1].hc.i;for(y.reset();y.next();)if(v=y.value,B=v.toVertex,v.valid&& -B.layer===b){for(v=0;d[v]!==B;)v++;v===f&&(q+=1)}var v=B=0,y=h[d[f].index],H=k[d[f].index],E=h[d[f+1].index],V=k[d[f+1].index];-1!==y&&(B+=Math.abs(y-s),v+=Math.abs(y-x));-1!==H&&(B+=Math.abs(H-s),v+=Math.abs(H-x));-1!==E&&(B+=Math.abs(E-u),v+=Math.abs(E-t));-1!==V&&(B+=Math.abs(V-u),v+=Math.abs(V-t));if(r>1)+8*d;this.Jb*=8}if(0!==(this.Yi&Wu))for(b=!0;b;){b=!1;for(a=this.Kf+1;a<=this.pb;a++)b=Xu(this,a,1)||b; -for(a=this.Kf-1;0<=a;a--)b=Xu(this,a,-1)||b;b=Xu(this,this.Kf,0)||b}if(0!==(this.Yi&Yu)){for(a=this.Kf+1;a<=this.pb;a++)Zu(this,a,1);for(a=this.Kf-1;0<=a;a--)Zu(this,a,-1);Zu(this,this.Kf,0)}c&&($u(this,-1),$u(this,1));if(0!==(this.Yi&Wu))for(b=!0;b;){b=!1;b=Xu(this,this.Kf,0)||b;for(a=this.Kf+1;a<=this.pb;a++)b=Xu(this,a,0)||b;for(a=this.Kf-1;0<=a;a--)b=Xu(this,a,0)||b}};function Xu(a,b,c){for(var d=!1;av(a,b,c);)d=!0;return d} -function av(a,b,c){var d=0,e=wu(a,b),f=a.he[b],h=Du(a,b,-1);if(0c)for(d=0;dd-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=f||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=0,u=0,t=0,x=0,v=0;if(0>=c)for(var B=e[d].kc.i;B.next();){var v=B.value,y=v.fromVertex;v.valid&& -y.layer!==b&&(t=yu(v),x=v.portFromColOffset,v=v.portToColOffset,y=y.column,q+=(Math.abs(n+v-(y+x))+1)*t,s+=(Math.abs(r+v-(y+x))+1)*t,u+=(Math.abs(p+v-(y+x))+1)*t)}if(0<=c)for(B=e[d].hc.i;B.next();)v=B.value,y=v.toVertex,v.valid&&y.layer!==b&&(t=yu(v),x=v.portFromColOffset,v=v.portToColOffset,y=y.column,q+=(Math.abs(n+x-(y+v))+1)*t,s+=(Math.abs(r+x-(y+v))+1)*t,u+=(Math.abs(p+x-(y+v))+1)*t);v=x=t=0;B=h[e[d].index];y=k[e[d].index];-1!==B&&(t+=Math.abs(B-n),x+=Math.abs(B-r),v+=Math.abs(B-p));-1!==y&& -(t+=Math.abs(y-n),x+=Math.abs(y-r),v+=Math.abs(y-p));if(s=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}xu(a,b,e);a.normalize()} -function bv(a,b){for(var c=!0,d=a.network.vertexes.i;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e} -function cv(a,b){for(var c=b,c=b+1,d=0,e=[],f=[],d=0;d<=a.pb;d++)e[d]=!1,f[d]=!1;for(var h=a.network.vertexes.i;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(f[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.pb;d++)k=k&&!(e[d]&&f[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c} -function $u(a,b){for(var c=0;c<=a.Jb;c++)for(;bv(a,c););a.normalize();for(c=0;ce?Au(a,d):hb)for(c=a.Jb;0<=c;c--)for(d=zu(a),e=Cu(a),f=e+1;ee?Au(a,d):hc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.xg);a.xg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Gu(a,b,a.xg,-1,!0,!0),a.xg++);var f=0;b=[];for(f=0;fc)for(k=a.Jb;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} -iu.prototype.commitLayout=function(){if(this.uq)for(var a=uu(this,!0),b=uu(this,!1),c=this.network.edges.i;c.next();){var d=c.value.link;null!==d&&(d.Ab=a,d.Bb=b)}this.commitNodes();this.Sz();this.eu&&this.commitLinks()};function uu(a,b){return 270===a.aa?b?Dc:Gc:90===a.aa?b?Gc:Dc:180===a.aa?b?Ec:Fc:b?Fc:Ec} -iu.prototype.commitNodes=function(){this.tg=[];this.Jf=[];this.If=[];this.Nb=[];for(var a=0;a<=this.pb;a++)this.tg[a]=0,this.Jf[a]=0,this.If[a]=0,this.Nb[a]=0;for(a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;this.tg[c]=Math.max(this.tg[c],this.nodeMinLayerSpace(b,!0));this.Jf[c]=Math.max(this.Jf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.Hm,c=0;c<=this.pb;c++){var e=d;0>=this.tg[c]+this.Jf[c]&&(e=0);0=m.M.bottom?(za=m.M.y+m.M.height,b.w(R++,na,za+fb),b.w(R++,na,za),b.w(R++,na,za-jb)):(b.w(R++,na,la+fb),b.w(R++, -na,la),b.w(R++,na,la-jb)):270===this.aa?la<=m.M.y?(za=m.M.y,b.w(R++,na,za-jb),b.w(R++,na,za),b.w(R++,na,za+fb)):(b.w(R++,na,la-jb),b.w(R++,na,la),b.w(R++,na,la+fb)):0===this.aa&&(na>=m.M.right?(za=m.M.x+m.M.width,b.w(R++,za+fb,la),b.w(R++,za,la),b.w(R++,za-jb,la)):(b.w(R++,na+fb,la),b.w(R++,na,la),b.w(R++,na-jb,la)));else{b.w(R++,Wa,lb);var ae=0;if(180===this.aa||0===this.aa){if(180===this.aa?na>=m.M.right:na<=m.M.x)ae=(0===this.aa?-jb:fb)/2;b.w(R++,Wa+ae,la)}else{if(270===this.aa?la>=m.M.bottom: -la<=m.M.y)ae=(90===this.aa?-jb:fb)/2;b.w(R++,na,lb+ae)}b.w(R++,na,la)}else jb=Math.max(10,this.tg[qa.layer]),fb=Math.max(10,this.Jf[qa.layer]),180===this.aa?(Q&&b.w(R++,na-jb,la),b.w(R++,na,la),Q&&b.w(R++,na+fb,la)):90===this.aa?(Q&&b.w(R++,na,la+fb),b.w(R++,na,la),Q&&b.w(R++,na,la-jb)):270===this.aa?(Q&&b.w(R++,na,la-jb),b.w(R++,na,la),Q&&b.w(R++,na,la+fb)):(Q&&b.w(R++,na+fb,la),b.w(R++,na,la),Q&&b.w(R++,na-jb,la));m=qa}if(null===k||b.computeSpot(!1)!==sb||$)if(Wa=b.m(R-1).x,lb=b.m(R-1).y,na=b.m(R).x, -la=b.m(R).y,$){var pd=this.Jf[l.layer],rc=0;180===this.aa||0===this.aa?(rc=lb,rc>=l.M.y&&rc<=l.M.bottom&&(180===this.aa?na>=l.M.x:na<=l.M.right)&&(za=l.ja+(180===this.aa?-pd:pd),rc=rc=l.M.x&&rc<=l.M.right&&(270===this.aa?la>=l.M.y:la<=l.M.bottom)&&(za=l.ra+(270===this.aa?-pd:pd),rc=rc=l.M.x?(za=l.M.x+l.M.width,b.ea(R-2,za,lb),b.ea(R-1,za+fb,lb)):90===this.aa&&la<=l.M.bottom?(za=l.M.y,b.ea(R-2,Wa,za),b.ea(R-1,Wa,za-jb)):270===this.aa&&la>=l.M.y?(za=l.M.y+l.M.height,b.ea(R-2,Wa,za),b.ea(R-1,Wa,za+fb)):0===this.aa&&na<=l.M.right&&(za=l.M.x,b.ea(R-2,za,lb),b.ea(R-1,za-jb,lb));else{jb=Math.max(10,this.tg[l.layer]);fb=Math.max(10,this.Jf[l.layer]);ae=0;if(180===this.aa||0=== -this.aa){if(180===this.aa?na<=l.M.x:na>=l.M.right)ae=(0===this.aa?fb:-jb)/2;b.w(R++,na+ae,lb)}else{if(270===this.aa?la<=l.M.y:la>=l.M.bottom)ae=(90===this.aa?fb:-jb)/2;b.w(R++,Wa,la+ae)}b.w(R++,na,la)}}else{for(;null!==l&&l!==m;){Ja=qa=null;for(var xg=l.hc.i;xg.next();){var Df=xg.value;if(Df.link===c.link&&(qa=Df.toVertex,Ja=Df.fromVertex,null!==Ja.pd&&(Ja=null),null===qa.pd))break}var Wa=0,lb=0,na=0,la=0,ib=0,jb=0,fb=0;if(qa!==m)if(Wa=b.m(R-1).x,lb=b.m(R-1).y,na=qa.ja,la=qa.ra,$)if(180===this.aa|| -0===this.aa){var se=null!==Ja?Ja.ra:lb;se!==la&&(ib=this.Nb[qa.layer],2===R&&(ib=0===this.aa?Math.max(ib,Wa):Math.min(ib,Wa)),b.w(R++,ib,lb),b.w(R++,ib,la))}else{var Ed=null!==Ja?Ja.ja:Wa;Ed!==na&&(ib=this.Nb[qa.layer],2===R&&(ib=90===this.aa?Math.max(ib,lb):Math.min(ib,lb)),b.w(R++,Wa,ib),b.w(R++,na,ib))}else jb=Math.max(10,this.tg[qa.layer]),fb=Math.max(10,this.Jf[qa.layer]),180===this.aa?(b.w(R++,na+fb,la),Q&&b.w(R++,na,la),b.w(R++,na-jb,la)):90===this.aa?(b.w(R++,na,la-jb),Q&&b.w(R++,na,la),b.w(R++, -na,la+fb)):270===this.aa?(b.w(R++,na,la+fb),Q&&b.w(R++,na,la),b.w(R++,na,la-jb)):(b.w(R++,na-jb,la),Q&&b.w(R++,na,la),b.w(R++,na+fb,la));l=qa}$&&(Wa=b.m(R-1).x,lb=b.m(R-1).y,na=b.m(R).x,la=b.m(R).y,180===this.aa||0===this.aa?lb!==la&&(ib=0===this.aa?Math.min(Math.max((na+Wa)/2,this.Nb[m.layer]),na):Math.max(Math.min((na+Wa)/2,this.Nb[m.layer]),na),b.w(R++,ib,lb),b.w(R++,ib,la)):Wa!==na&&(ib=90===this.aa?Math.min(Math.max((la+lb)/2,this.Nb[m.layer]),la):Math.max(Math.min((la+lb)/2,this.Nb[m.layer]), -la),b.w(R++,Wa,ib),b.w(R++,na,ib)))}if(null!==d&&Q){if(null!==h){if(b.computeSpot(!0)===sb){var tb=b.m(0),Le=b.m(2);tb.L(Le)||b.ea(1,(tb.x+Le.x)/2,(tb.y+Le.y)/2)}ba=b.getLinkPoint(e,h,sb,!0,!1,f,k);ba.H()||ba.set(e.Y.Gl);b.ea(0,ba.x,ba.y)}null!==k&&(b.computeSpot(!1)===sb&&(tb=b.m(b.qa-1),Le=b.m(b.qa-3),tb.L(Le)||b.ea(b.qa-2,(tb.x+Le.x)/2,(tb.y+Le.y)/2)),ba=b.getLinkPoint(f,k,sb,!1,!1,e,h),ba.H()||ba.set(f.Y.Gl),b.ea(b.qa-1,ba.x,ba.y))}b.ij();c.commit()}}}for(var ed=new I(W),ag=this.network.edges.i;ag.next();){var Ef= -ag.value.link;null!==Ef&&Ef.ic&&!ed.contains(Ef)&&ed.add(Ef)}if(0wc.y&&(Ff=Jc.y>wc.y?0:qd.xQb.x&&(pb=Yh.x>Qb.x?0:fd.yb.layer?1:a.Web.We?1:a.peb.pe?1:0:0};iu.prototype.YF=function(a,b){return a instanceof ev&&b instanceof ev&&a!==b?a.firstb.first||a.qib.qi||a.Web.We?1:a.peb.pe?1:0:0}; -iu.prototype.$x=function(a,b){return a instanceof ev&&b instanceof ev&&a!==b?a.eeb.ee||a.qib.qi||a.Web.We?1:a.peb.pe?1:0:0};function fv(a,b){var c=a-b;return-1c}function wu(a,b){var c,d=a.he[b];if(d>=a.hh.length){c=[];for(var e=0;ea&&(this.Yi=a,this.J()))});w.defineProperty(iu,{uq:"setsPortSpots"},function(){return this.Zh},function(a){this.Zh!==a&&(w.j(a,"boolean",iu,"setsPortSpots"),this.Zh=a,this.J())});w.defineProperty(iu,{sF:"linkSpacing"},function(){return this.Xr},function(a){this.Xr!==a&&(w.j(a,"number",iu,"linkSpacing"),0<=a&&(this.Xr=a,this.J()))});w.u(iu,{II:"maxLayer"},function(){return this.pb}); -w.u(iu,{fL:"maxIndex"},function(){return this.Vv});w.u(iu,{eL:"maxColumn"},function(){return this.Jb});w.u(iu,{kL:"minIndexLayer"},function(){return this.fs});w.u(iu,{gL:"maxIndexLayer"},function(){return this.Kf});var ju;iu.CycleDepthFirst=ju=w.p(iu,"CycleDepthFirst",0);var pu;iu.CycleGreedy=pu=w.p(iu,"CycleGreedy",1);var ku;iu.LayerOptimalLinkLength=ku=w.p(iu,"LayerOptimalLinkLength",0);var Hu;iu.LayerLongestPathSink=Hu=w.p(iu,"LayerLongestPathSink",1);var Ju; -iu.LayerLongestPathSource=Ju=w.p(iu,"LayerLongestPathSource",2);var lu;iu.InitDepthFirstOut=lu=w.p(iu,"InitDepthFirstOut",0);var Pu;iu.InitDepthFirstIn=Pu=w.p(iu,"InitDepthFirstIn",1);var Nu;iu.InitNaive=Nu=w.p(iu,"InitNaive",2);var Tu;iu.AggressiveNone=Tu=w.p(iu,"AggressiveNone",0);var mu;iu.AggressiveLess=mu=w.p(iu,"AggressiveLess",1);var Uu;iu.AggressiveMore=Uu=w.p(iu,"AggressiveMore",2);iu.PackNone=0;var Vu;iu.PackExpand=Vu=1;var Wu;iu.PackStraighten=Wu=2;var Yu;iu.PackMedian=Yu=4;var nu; -iu.PackAll=nu=7;function ev(){this.index=this.pe=this.We=this.ee=this.first=this.layer=0;this.link=null;this.qi=0}w.$d(ev,{layer:!0,first:!0,ee:!0,We:!0,pe:!0,index:!0,link:!0,qi:!0});function ou(){qg.call(this)}w.La(ou,qg);w.fa("LayeredDigraphNetwork",ou);ou.prototype.createVertex=function(){return new gv};ou.prototype.createEdge=function(){return new hv}; -function gv(){ks.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.Rp=NaN;this.kn=0;this.KA=this.LA=null}w.La(gv,ks);w.fa("LayeredDigraphVertex",gv);function hv(){ls.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}w.La(hv,ls);w.fa("LayeredDigraphEdge",hv); -function Y(){0b.level)return!1;a.removeChild(c.parent,c)}return!0}Y.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ef?Yv(a,k,qa,B,y):Zv(a,k,qa,B,y);qa=y.x;B=y.width;y=y.height;break;case Mv:for(m=0;ms&&($za&&(Iw(a,-za,0,hb,m-1),Jw(E,-za,0),Jw(V,-za,0),za=0)}n.pa.l(za,ca);B=Math.max(B,ba);y=Math.max(y,H+(0===R?0:x)+Ja.height);$=ba}else{0s&&(caza&&(Iw(a,0,-za,hb,m-1),Jw(E,0,-za),Jw(V,0,-za),za=0);n.pa.l($,za);y=Math.max(y,Q);B=Math.max(B,H+(0===R?0:x)+Ja.width);ca=Q}Ra++}0q&&(q=0),135v&&(v=0),p===Nv&&(l+=u/2+a.T.y),k+=d+c):b?(null===a.comments?d>B&&(p=Nw(p,d-B,0),k=p.x,l=p.y,B=d,q=0):B=Lw(a,B,q),0>q&&(k-=q,q=0),135y&&(p=Nw(p,0,e-y),k=p.x,l=p.y,y=e,v=0):y=Mw(a,y,v),0>v&&(l-=v,v=0),k+=d+c);if(0f[0].x?f[2].assign(f[1]):f[1].assign(f[2])),f[3].yf[0].x?f[3].assign(f[2]):f[2].assign(f[3])),p[0].l(q+d,0),p[1].l(p[0].x,e),p[2].yf[0].y?f[2].assign(f[1]):f[1].assign(f[2])),f[3].xf[0].y?f[3].assign(f[2]):f[2].assign(f[3])),p[0].l(0,v+e),p[1].l(d,p[0].y),p[2].xh.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;eh.portToColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;e=h;d--)f=Tu(this,d,-1)||f;e=this.countCrossings();e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,1)||f;e=this.countCrossings();e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1, +d=h;d<=c;d++)f=Tu(this,d,-1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this))}break;default:case nu:for(c=this.qb,h=0,k=a+1;(d=this.countCrossings())=h;d--)f=Tu(this,d,-1)||f;e=this.countCrossings();e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,1)||f;e=this.countCrossings(); +e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,-1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this))}}Bu(this,b)}; +function Su(a,b,c){var d=0,e=xu(a,b),f=a.he[b],h=Fu(a,b,c);c=Eu(a,b,c);for(d=0;df+1&&(q+=4*(v-f),r+=4*(v-(f+1)))}y=d[f].ic.i;for(y.reset();y.next();)if(v=y.value,B=v.toVertex,v.valid&&B.layer===b){for(v=0;d[v]!==B;)v++;v===f+1&&(r+=1)}y=d[f+1].lc.i;for(y.reset();y.next();)if(v=y.value,B=v.fromVertex,v.valid&&B.layer===b){for(v=0;d[v]!==B;)v++;vf+1&&(q+=4*(v-(f+1)),r+=4*(v-f))}y=d[f+1].ic.i;for(y.reset();y.next();)if(v=y.value,B=v.toVertex,v.valid&& +B.layer===b){for(v=0;d[v]!==B;)v++;v===f&&(q+=1)}var v=B=0,y=h[d[f].index],H=k[d[f].index],E=h[d[f+1].index],V=k[d[f+1].index];-1!==y&&(B+=Math.abs(y-s),v+=Math.abs(y-x));-1!==H&&(B+=Math.abs(H-s),v+=Math.abs(H-x));-1!==E&&(B+=Math.abs(E-u),v+=Math.abs(E-t));-1!==V&&(B+=Math.abs(V-u),v+=Math.abs(V-t));if(r>1)+8*d;this.Jb*=8}if(0!==(this.Yi&Xu))for(b=!0;b;){b=!1;for(a=this.Lf+1;a<=this.qb;a++)b=Yu(this,a,1)||b; +for(a=this.Lf-1;0<=a;a--)b=Yu(this,a,-1)||b;b=Yu(this,this.Lf,0)||b}if(0!==(this.Yi&Zu)){for(a=this.Lf+1;a<=this.qb;a++)$u(this,a,1);for(a=this.Lf-1;0<=a;a--)$u(this,a,-1);$u(this,this.Lf,0)}c&&(av(this,-1),av(this,1));if(0!==(this.Yi&Xu))for(b=!0;b;){b=!1;b=Yu(this,this.Lf,0)||b;for(a=this.Lf+1;a<=this.qb;a++)b=Yu(this,a,0)||b;for(a=this.Lf-1;0<=a;a--)b=Yu(this,a,0)||b}};function Yu(a,b,c){for(var d=!1;bv(a,b,c);)d=!0;return d} +function bv(a,b,c){var d=0,e=xu(a,b),f=a.he[b],h=Eu(a,b,-1);if(0c)for(d=0;dd-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=f||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=0,u=0,t=0,x=0,v=0;if(0>=c)for(var B=e[d].lc.i;B.next();){var v=B.value,y=v.fromVertex;v.valid&& +y.layer!==b&&(t=zu(v),x=v.portFromColOffset,v=v.portToColOffset,y=y.column,q+=(Math.abs(n+v-(y+x))+1)*t,s+=(Math.abs(r+v-(y+x))+1)*t,u+=(Math.abs(p+v-(y+x))+1)*t)}if(0<=c)for(B=e[d].ic.i;B.next();)v=B.value,y=v.toVertex,v.valid&&y.layer!==b&&(t=zu(v),x=v.portFromColOffset,v=v.portToColOffset,y=y.column,q+=(Math.abs(n+x-(y+v))+1)*t,s+=(Math.abs(r+x-(y+v))+1)*t,u+=(Math.abs(p+x-(y+v))+1)*t);v=x=t=0;B=h[e[d].index];y=k[e[d].index];-1!==B&&(t+=Math.abs(B-n),x+=Math.abs(B-r),v+=Math.abs(B-p));-1!==y&& +(t+=Math.abs(y-n),x+=Math.abs(y-r),v+=Math.abs(y-p));if(s=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}yu(a,b,e);a.normalize()} +function cv(a,b){for(var c=!0,d=a.network.vertexes.i;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e} +function dv(a,b){for(var c=b,c=b+1,d=0,e=[],f=[],d=0;d<=a.qb;d++)e[d]=!1,f[d]=!1;for(var h=a.network.vertexes.i;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(f[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.qb;d++)k=k&&!(e[d]&&f[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c} +function av(a,b){for(var c=0;c<=a.Jb;c++)for(;cv(a,c););a.normalize();for(c=0;ce?Bu(a,d):hb)for(c=a.Jb;0<=c;c--)for(d=Au(a),e=Du(a),f=e+1;ee?Bu(a,d):hc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.zg);a.zg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Hu(a,b,a.zg,-1,!0,!0),a.zg++);var f=0;b=[];for(f=0;fc)for(k=a.Jb;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} +ju.prototype.commitLayout=function(){if(this.tq)for(var a=vu(this,!0),b=vu(this,!1),c=this.network.edges.i;c.next();){var d=c.value.link;null!==d&&(d.Ab=a,d.Bb=b)}this.commitNodes();this.Uz();this.du&&this.commitLinks()};function vu(a,b){return 270===a.aa?b?Gc:Jc:90===a.aa?b?Jc:Gc:180===a.aa?b?Hc:Ic:b?Ic:Hc} +ju.prototype.commitNodes=function(){this.vg=[];this.Kf=[];this.Jf=[];this.Nb=[];for(var a=0;a<=this.qb;a++)this.vg[a]=0,this.Kf[a]=0,this.Jf[a]=0,this.Nb[a]=0;for(a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;this.vg[c]=Math.max(this.vg[c],this.nodeMinLayerSpace(b,!0));this.Kf[c]=Math.max(this.Kf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.Hm,c=0;c<=this.qb;c++){var e=d;0>=this.vg[c]+this.Kf[c]&&(e=0);0=m.M.bottom?(za=m.M.y+m.M.height,b.w(R++,na,za+eb),b.w(R++,na,za),b.w(R++,na,za-ib)):(b.w(R++,na,la+eb),b.w(R++, +na,la),b.w(R++,na,la-ib)):270===this.aa?la<=m.M.y?(za=m.M.y,b.w(R++,na,za-ib),b.w(R++,na,za),b.w(R++,na,za+eb)):(b.w(R++,na,la-ib),b.w(R++,na,la),b.w(R++,na,la+eb)):0===this.aa&&(na>=m.M.right?(za=m.M.x+m.M.width,b.w(R++,za+eb,la),b.w(R++,za,la),b.w(R++,za-ib,la)):(b.w(R++,na+eb,la),b.w(R++,na,la),b.w(R++,na-ib,la)));else{b.w(R++,Ua,lb);var Yd=0;if(180===this.aa||0===this.aa){if(180===this.aa?na>=m.M.right:na<=m.M.x)Yd=(0===this.aa?-ib:eb)/2;b.w(R++,Ua+Yd,la)}else{if(270===this.aa?la>=m.M.bottom: +la<=m.M.y)Yd=(90===this.aa?-ib:eb)/2;b.w(R++,na,lb+Yd)}b.w(R++,na,la)}else ib=Math.max(10,this.vg[qa.layer]),eb=Math.max(10,this.Kf[qa.layer]),180===this.aa?(Q&&b.w(R++,na-ib,la),b.w(R++,na,la),Q&&b.w(R++,na+eb,la)):90===this.aa?(Q&&b.w(R++,na,la+eb),b.w(R++,na,la),Q&&b.w(R++,na,la-ib)):270===this.aa?(Q&&b.w(R++,na,la-ib),b.w(R++,na,la),Q&&b.w(R++,na,la+eb)):(Q&&b.w(R++,na+eb,la),b.w(R++,na,la),Q&&b.w(R++,na-ib,la));m=qa}if(null===k||b.computeSpot(!1)!==tb||$)if(Ua=b.l(R-1).x,lb=b.l(R-1).y,na=b.l(R).x, +la=b.l(R).y,$){var qd=this.Kf[l.layer],uc=0;180===this.aa||0===this.aa?(uc=lb,uc>=l.M.y&&uc<=l.M.bottom&&(180===this.aa?na>=l.M.x:na<=l.M.right)&&(za=l.ka+(180===this.aa?-qd:qd),uc=uc=l.M.x&&uc<=l.M.right&&(270===this.aa?la>=l.M.y:la<=l.M.bottom)&&(za=l.ra+(270===this.aa?-qd:qd),uc=uc=l.M.x?(za=l.M.x+l.M.width,b.ea(R-2,za,lb),b.ea(R-1,za+eb,lb)):90===this.aa&&la<=l.M.bottom?(za=l.M.y,b.ea(R-2,Ua,za),b.ea(R-1,Ua,za-ib)):270===this.aa&&la>=l.M.y?(za=l.M.y+l.M.height,b.ea(R-2,Ua,za),b.ea(R-1,Ua,za+eb)):0===this.aa&&na<=l.M.right&&(za=l.M.x,b.ea(R-2,za,lb),b.ea(R-1,za-ib,lb));else{ib=Math.max(10,this.vg[l.layer]);eb=Math.max(10,this.Kf[l.layer]);Yd=0;if(180===this.aa||0=== +this.aa){if(180===this.aa?na<=l.M.x:na>=l.M.right)Yd=(0===this.aa?eb:-ib)/2;b.w(R++,na+Yd,lb)}else{if(270===this.aa?la<=l.M.y:la>=l.M.bottom)Yd=(90===this.aa?eb:-ib)/2;b.w(R++,Ua,la+Yd)}b.w(R++,na,la)}}else{for(;null!==l&&l!==m;){Ja=qa=null;for(var Ag=l.ic.i;Ag.next();){var Cf=Ag.value;if(Cf.link===c.link&&(qa=Cf.toVertex,Ja=Cf.fromVertex,null!==Ja.rd&&(Ja=null),null===qa.rd))break}var Ua=0,lb=0,na=0,la=0,hb=0,ib=0,eb=0;if(qa!==m)if(Ua=b.l(R-1).x,lb=b.l(R-1).y,na=qa.ka,la=qa.ra,$)if(180===this.aa|| +0===this.aa){var oe=null!==Ja?Ja.ra:lb;oe!==la&&(hb=this.Nb[qa.layer],2===R&&(hb=0===this.aa?Math.max(hb,Ua):Math.min(hb,Ua)),b.w(R++,hb,lb),b.w(R++,hb,la))}else{var Ed=null!==Ja?Ja.ka:Ua;Ed!==na&&(hb=this.Nb[qa.layer],2===R&&(hb=90===this.aa?Math.max(hb,lb):Math.min(hb,lb)),b.w(R++,Ua,hb),b.w(R++,na,hb))}else ib=Math.max(10,this.vg[qa.layer]),eb=Math.max(10,this.Kf[qa.layer]),180===this.aa?(b.w(R++,na+eb,la),Q&&b.w(R++,na,la),b.w(R++,na-ib,la)):90===this.aa?(b.w(R++,na,la-ib),Q&&b.w(R++,na,la),b.w(R++, +na,la+eb)):270===this.aa?(b.w(R++,na,la+eb),Q&&b.w(R++,na,la),b.w(R++,na,la-ib)):(b.w(R++,na-ib,la),Q&&b.w(R++,na,la),b.w(R++,na+eb,la));l=qa}$&&(Ua=b.l(R-1).x,lb=b.l(R-1).y,na=b.l(R).x,la=b.l(R).y,180===this.aa||0===this.aa?lb!==la&&(hb=0===this.aa?Math.min(Math.max((na+Ua)/2,this.Nb[m.layer]),na):Math.max(Math.min((na+Ua)/2,this.Nb[m.layer]),na),b.w(R++,hb,lb),b.w(R++,hb,la)):Ua!==na&&(hb=90===this.aa?Math.min(Math.max((la+lb)/2,this.Nb[m.layer]),la):Math.max(Math.min((la+lb)/2,this.Nb[m.layer]), +la),b.w(R++,Ua,hb),b.w(R++,na,hb)))}if(null!==d&&Q){if(null!==h){if(b.computeSpot(!0)===tb){var ub=b.l(0),Ge=b.l(2);ub.L(Ge)||b.ea(1,(ub.x+Ge.x)/2,(ub.y+Ge.y)/2)}ba=b.getLinkPoint(e,h,tb,!0,!1,f,k);ba.H()||ba.set(e.W.Hl);b.ea(0,ba.x,ba.y)}null!==k&&(b.computeSpot(!1)===tb&&(ub=b.l(b.qa-1),Ge=b.l(b.qa-3),ub.L(Ge)||b.ea(b.qa-2,(ub.x+Ge.x)/2,(ub.y+Ge.y)/2)),ba=b.getLinkPoint(f,k,tb,!1,!1,e,h),ba.H()||ba.set(f.W.Hl),b.ea(b.qa-1,ba.x,ba.y))}b.jj();c.commit()}}}for(var gd=new I(W),bg=this.network.edges.i;bg.next();){var Df= +bg.value.link;null!==Df&&Df.jc&&!gd.contains(Df)&&gd.add(Df)}if(0zc.y&&(Ef=Mc.y>zc.y?0:rd.xRb.x&&(ob=di.x>Rb.x?0:hd.yb.layer?1:a.Web.We?1:a.peb.pe?1:0:0};ju.prototype.aG=function(a,b){return a instanceof fv&&b instanceof fv&&a!==b?a.firstb.first||a.qib.qi||a.Web.We?1:a.peb.pe?1:0:0}; +ju.prototype.Zx=function(a,b){return a instanceof fv&&b instanceof fv&&a!==b?a.eeb.ee||a.qib.qi||a.Web.We?1:a.peb.pe?1:0:0};function gv(a,b){var c=a-b;return-1c}function xu(a,b){var c,d=a.he[b];if(d>=a.hh.length){c=[];for(var e=0;ea&&(this.Yi=a,this.J()))});w.defineProperty(ju,{tq:"setsPortSpots"},function(){return this.Zh},function(a){this.Zh!==a&&(w.j(a,"boolean",ju,"setsPortSpots"),this.Zh=a,this.J())});w.defineProperty(ju,{vF:"linkSpacing"},function(){return this.Wr},function(a){this.Wr!==a&&(w.j(a,"number",ju,"linkSpacing"),0<=a&&(this.Wr=a,this.J()))});w.u(ju,{LI:"maxLayer"},function(){return this.qb}); +w.u(ju,{iL:"maxIndex"},function(){return this.Vv});w.u(ju,{hL:"maxColumn"},function(){return this.Jb});w.u(ju,{nL:"minIndexLayer"},function(){return this.es});w.u(ju,{jL:"maxIndexLayer"},function(){return this.Lf});var ku;ju.CycleDepthFirst=ku=w.p(ju,"CycleDepthFirst",0);var qu;ju.CycleGreedy=qu=w.p(ju,"CycleGreedy",1);var lu;ju.LayerOptimalLinkLength=lu=w.p(ju,"LayerOptimalLinkLength",0);var Iu;ju.LayerLongestPathSink=Iu=w.p(ju,"LayerLongestPathSink",1);var Ku; +ju.LayerLongestPathSource=Ku=w.p(ju,"LayerLongestPathSource",2);var mu;ju.InitDepthFirstOut=mu=w.p(ju,"InitDepthFirstOut",0);var Qu;ju.InitDepthFirstIn=Qu=w.p(ju,"InitDepthFirstIn",1);var Ou;ju.InitNaive=Ou=w.p(ju,"InitNaive",2);var Uu;ju.AggressiveNone=Uu=w.p(ju,"AggressiveNone",0);var nu;ju.AggressiveLess=nu=w.p(ju,"AggressiveLess",1);var Vu;ju.AggressiveMore=Vu=w.p(ju,"AggressiveMore",2);ju.PackNone=0;var Wu;ju.PackExpand=Wu=1;var Xu;ju.PackStraighten=Xu=2;var Zu;ju.PackMedian=Zu=4;var ou; +ju.PackAll=ou=7;function fv(){this.index=this.pe=this.We=this.ee=this.first=this.layer=0;this.link=null;this.qi=0}w.$d(fv,{layer:!0,first:!0,ee:!0,We:!0,pe:!0,index:!0,link:!0,qi:!0});function pu(){sg.call(this)}w.La(pu,sg);w.fa("LayeredDigraphNetwork",pu);pu.prototype.createVertex=function(){return new hv};pu.prototype.createEdge=function(){return new iv}; +function hv(){ms.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.Qp=NaN;this.kn=0;this.OA=this.PA=null}w.La(hv,ms);w.fa("LayeredDigraphVertex",hv);function iv(){ns.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}w.La(iv,ns);w.fa("LayeredDigraphEdge",iv); +function Y(){0b.level)return!1;a.removeChild(c.parent,c)}return!0}Y.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ef?Zv(a,k,qa,B,y):$v(a,k,qa,B,y);qa=y.x;B=y.width;y=y.height;break;case Nv:for(m=0;ms&&($za&&(Jw(a,-za,0,gb,m-1),Kw(E,-za,0),Kw(V,-za,0),za=0)}n.pa.m(za,ca);B=Math.max(B,ba);y=Math.max(y,H+(0===R?0:x)+Ja.height);$=ba}else{0s&&(caza&&(Jw(a,0,-za,gb,m-1),Kw(E,0,-za),Kw(V,0,-za),za=0);n.pa.m($,za);y=Math.max(y,Q);B=Math.max(B,H+(0===R?0:x)+Ja.width);ca=Q}Ra++}0q&&(q=0),135v&&(v=0),p===Ov&&(l+=u/2+a.T.y),k+=d+c):b?(null===a.comments?d>B&&(p=Ow(p,d-B,0),k=p.x,l=p.y,B=d,q=0):B=Mw(a,B,q),0>q&&(k-=q,q=0),135y&&(p=Ow(p,0,e-y),k=p.x,l=p.y,y=e,v=0):y=Nw(a,y,v),0>v&&(l-=v,v=0),k+=d+c);if(0f[0].x?f[2].assign(f[1]):f[1].assign(f[2])),f[3].yf[0].x?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(q+d,0),p[1].m(p[0].x,e),p[2].yf[0].y?f[2].assign(f[1]):f[1].assign(f[2])),f[3].xf[0].y?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(0,v+e),p[1].m(d,p[0].y),p[2].xc?Yv(b,e,Ra,H,E):Zv(b,e,Ra,H,E);Ra=E.x;H=E.width;E=E.height;break;case Mv:for(k=0;kr&&(bar&&(Qp&&(p=0),135B&&(B=0));b.Oa.l(p,B);b.ib.l(H,E)}} -function Yv(a,b,c,d,e){var f=b.length;if(0===f)return new A(c,0,d,e);if(1===f){var h=b[0];d=h.ib.width;e=h.ib.height;return new A(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===Tv(a),n=0,p=0,q=0,r=0;rm&&(d-=m),e=Math.max(e,Math.max(v, -q)+b+s.height),0>h.pa.x&&(c=Rw(a,h.pa.x,!1,c,k))):(h.pa.l(d+b,c+k/2-h.T.y-h.Oa.y),d=Math.max(d,Math.max(x,p)+b+s.width),m=c+k/2-h.T.y-h.Oa.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.pa.y&&(c=Rw(a,h.pa.y,!0,c,k))));return new A(c,0,d,e)} -function Zv(a,b,c,d,e){var f=b.length;if(0===f)return new A(c,0,d,e);if(1===f){var h=b[0];d=h.ib.width;e=h.ib.height;return new A(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===Tv(a),n=0,p=0,q=0,r=0;rp&&(d-=p),e=Math.max(e,Math.abs(Math.min(v, -q))+l+s.height),0>h.pa.x&&(c=Rw(a,h.pa.x,!1,c,k))):(h.pa.l(-d-s.width-l,c+k/2-h.T.y-h.Oa.y),d=Math.max(d,Math.abs(Math.min(x,p))+l+s.width),p=c+k/2-h.T.y-h.Oa.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.pa.y&&(c=Rw(a,h.pa.y,!0,c,k))));for(r=0;rd&&(d=c+a.width);0>c&&(d-=c);return d;case Uv:return a.width>b?a.width:b;case Vv:return 2*a.T.x>b?a.width:b+a.width-2*a.T.x;case Lv:case Av:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Mv:return a.width-a.T.x+a.nodeSpacing/2+b;case Nv:return Math.max(a.width,a.T.x+a.nodeSpacing/2+b);default:return b}} -function Mw(a,b,c){switch(a.alignment){case Jv:case Kw:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case Uv:return a.height>b?a.height:b;case Vv:return 2*a.T.y>b?a.height:b+a.height-2*a.T.y;case Lv:case Av:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Mv:return a.height-a.T.y+a.nodeSpacing/2+b;case Nv:return Math.max(a.height,a.T.y+a.nodeSpacing/2+b);default:return b}} -function Nw(a,b,c){switch(a){case Kw:b/=2;c/=2;break;case Jv:b/=2;c/=2;break;case Uv:c=b=0;break;case Vv:break;default:w.k("Unhandled alignment value "+a.toString())}return new z(b,c)}function Fw(a,b,c,d,e,f){b=Nw(b,c,d);Iw(a,b.x,b.y,e,f)}function Iw(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].pa;f.x+=b;f.y+=c}} -function Gw(a,b,c,d){var e=b.parent;switch(a.Hf){case jv:for(a=b.kc;a.next();)b=a.value,b.fromVertex===e&&b.Fs.l(c,d);break;case qv:for(a=b.hc;a.next();)b=a.value,b.toVertex===e&&b.Fs.l(c,d);break;default:w.k("Unhandled path value "+a.Hf.toString())}}function Jw(a,b,c){for(var d=0;dp.length||null===q||2>q.length))for(m=l=0;lt&&e.ye.y&&tb.length||null===l||2>l.length)d=null;else{n=$v(a,b.length+l.length);for(d=f=e=0;fe;)t=l[f++],n[d++].l(t.x+m,t.y);l=$v(a,d);for(e=0;ep.length||null===f||2>f.length)e=null;else{n=$v(a,p.length+f.length);for(m=x=l=0;lf;)e=p[l++],n[m++].l(e.x,e.y);e=$v(a,m);for(l=0;lp.length||null===q||2>q.length))for(m=l=0;lf&&e.xe.x&&fb.length||null===l||2>l.length)d=null;else{n=$v(a, -b.length+l.length);for(d=f=e=0;fe;)t=l[f++],n[d++].l(t.x,t.y+m);l=$v(a,d);for(e=0;ep.length||null===f||2>f.length)e=null;else{n=$v(a,p.length+f.length);for(m=x=l=0;lf;)e=p[l++],n[m++].l(e.x,e.y);e=$v(a,m);for(l=0;lc?Zv(b,e,Ra,H,E):$v(b,e,Ra,H,E);Ra=E.x;H=E.width;E=E.height;break;case Nv:for(k=0;kr&&(bar&&(Qp&&(p=0),135B&&(B=0));b.Oa.m(p,B);b.jb.m(H,E)}} +function Zv(a,b,c,d,e){var f=b.length;if(0===f)return new A(c,0,d,e);if(1===f){var h=b[0];d=h.jb.width;e=h.jb.height;return new A(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===Uv(a),n=0,p=0,q=0,r=0;rm&&(d-=m),e=Math.max(e,Math.max(v, +q)+b+s.height),0>h.pa.x&&(c=Sw(a,h.pa.x,!1,c,k))):(h.pa.m(d+b,c+k/2-h.T.y-h.Oa.y),d=Math.max(d,Math.max(x,p)+b+s.width),m=c+k/2-h.T.y-h.Oa.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.pa.y&&(c=Sw(a,h.pa.y,!0,c,k))));return new A(c,0,d,e)} +function $v(a,b,c,d,e){var f=b.length;if(0===f)return new A(c,0,d,e);if(1===f){var h=b[0];d=h.jb.width;e=h.jb.height;return new A(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===Uv(a),n=0,p=0,q=0,r=0;rp&&(d-=p),e=Math.max(e,Math.abs(Math.min(v, +q))+l+s.height),0>h.pa.x&&(c=Sw(a,h.pa.x,!1,c,k))):(h.pa.m(-d-s.width-l,c+k/2-h.T.y-h.Oa.y),d=Math.max(d,Math.abs(Math.min(x,p))+l+s.width),p=c+k/2-h.T.y-h.Oa.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.pa.y&&(c=Sw(a,h.pa.y,!0,c,k))));for(r=0;rd&&(d=c+a.width);0>c&&(d-=c);return d;case Vv:return a.width>b?a.width:b;case Wv:return 2*a.T.x>b?a.width:b+a.width-2*a.T.x;case Mv:case Bv:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Nv:return a.width-a.T.x+a.nodeSpacing/2+b;case Ov:return Math.max(a.width,a.T.x+a.nodeSpacing/2+b);default:return b}} +function Nw(a,b,c){switch(a.alignment){case Kv:case Lw:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case Vv:return a.height>b?a.height:b;case Wv:return 2*a.T.y>b?a.height:b+a.height-2*a.T.y;case Mv:case Bv:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Nv:return a.height-a.T.y+a.nodeSpacing/2+b;case Ov:return Math.max(a.height,a.T.y+a.nodeSpacing/2+b);default:return b}} +function Ow(a,b,c){switch(a){case Lw:b/=2;c/=2;break;case Kv:b/=2;c/=2;break;case Vv:c=b=0;break;case Wv:break;default:w.k("Unhandled alignment value "+a.toString())}return new z(b,c)}function Gw(a,b,c,d,e,f){b=Ow(b,c,d);Jw(a,b.x,b.y,e,f)}function Jw(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].pa;f.x+=b;f.y+=c}} +function Hw(a,b,c,d){var e=b.parent;switch(a.If){case kv:for(a=b.lc;a.next();)b=a.value,b.fromVertex===e&&b.Fs.m(c,d);break;case rv:for(a=b.ic;a.next();)b=a.value,b.toVertex===e&&b.Fs.m(c,d);break;default:w.k("Unhandled path value "+a.If.toString())}}function Kw(a,b,c){for(var d=0;dp.length||null===q||2>q.length))for(m=l=0;lt&&e.ye.y&&tb.length||null===l||2>l.length)d=null;else{n=aw(a,b.length+l.length);for(d=f=e=0;fe;)t=l[f++],n[d++].m(t.x+m,t.y);l=aw(a,d);for(e=0;ep.length||null===f||2>f.length)e=null;else{n=aw(a,p.length+f.length);for(m=x=l=0;lf;)e=p[l++],n[m++].m(e.x,e.y);e=aw(a,m);for(l=0;lp.length||null===q||2>q.length))for(m=l=0;lf&&e.xe.x&&fb.length||null===l||2>l.length)d=null;else{n=aw(a, +b.length+l.length);for(d=f=e=0;fe;)t=l[f++],n[d++].m(t.x,t.y+m);l=aw(a,d);for(e=0;ep.length||null===f||2>f.length)e=null;else{n=aw(a,p.length+f.length);for(m=x=l=0;lf;)e=p[l++],n[m++].m(e.x,e.y);e=aw(a,m);for(l=0;l=a?0:135>=a?90:225>=a?180:315>=a?270:0} -function Wv(a){var b=Tv(a),b=90===b||270===b,c=a.layerSpacing;if(0=a&&(this.ta.nodeIndentPastParent=a,this.J()))}); -w.defineProperty(Y,{nodeSpacing:"nodeSpacing"},function(){return this.ta.nodeSpacing},function(a){this.ta.nodeSpacing!==a&&(w.j(a,"number",Y,"nodeSpacing"),this.ta.nodeSpacing=a,this.J())});w.defineProperty(Y,{layerSpacing:"layerSpacing"},function(){return this.ta.layerSpacing},function(a){this.ta.layerSpacing!==a&&(w.j(a,"number",Y,"layerSpacing"),this.ta.layerSpacing=a,this.J())}); -w.defineProperty(Y,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.ta.layerSpacingParentOverlap},function(a){this.ta.layerSpacingParentOverlap!==a&&(w.j(a,"number",Y,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.ta.layerSpacingParentOverlap=a,this.J()))});w.defineProperty(Y,{compaction:"compaction"},function(){return this.ta.compaction},function(a){this.ta.compaction!==a&&(w.mb(a,Y,Y,"compaction"),a===Qv||a===Sv)&&(this.ta.compaction=a,this.J())}); -w.defineProperty(Y,{breadthLimit:"breadthLimit"},function(){return this.ta.breadthLimit},function(a){this.ta.breadthLimit!==a&&(w.j(a,"number",Y,"breadthLimit"),0<=a&&(this.ta.breadthLimit=a,this.J()))});w.defineProperty(Y,{rowSpacing:"rowSpacing"},function(){return this.ta.rowSpacing},function(a){this.ta.rowSpacing!==a&&(w.j(a,"number",Y,"rowSpacing"),this.ta.rowSpacing=a,this.J())}); -w.defineProperty(Y,{rowIndent:"rowIndent"},function(){return this.ta.rowIndent},function(a){this.ta.rowIndent!==a&&(w.j(a,"number",Y,"rowIndent"),0<=a&&(this.ta.rowIndent=a,this.J()))});w.defineProperty(Y,{commentSpacing:"commentSpacing"},function(){return this.ta.commentSpacing},function(a){this.ta.commentSpacing!==a&&(w.j(a,"number",Y,"commentSpacing"),this.ta.commentSpacing=a,this.J())}); -w.defineProperty(Y,{commentMargin:"commentMargin"},function(){return this.ta.commentMargin},function(a){this.ta.commentMargin!==a&&(w.j(a,"number",Y,"commentMargin"),this.ta.commentMargin=a,this.J())});w.defineProperty(Y,{setsPortSpot:"setsPortSpot"},function(){return this.ta.setsPortSpot},function(a){this.ta.setsPortSpot!==a&&(w.j(a,"boolean",Y,"setsPortSpot"),this.ta.setsPortSpot=a,this.J())}); -w.defineProperty(Y,{portSpot:"portSpot"},function(){return this.ta.portSpot},function(a){w.G(a,L,Y,"portSpot");this.ta.portSpot.L(a)||(this.ta.portSpot=a,this.J())});w.defineProperty(Y,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.ta.setsChildPortSpot},function(a){this.ta.setsChildPortSpot!==a&&(w.j(a,"boolean",Y,"setsChildPortSpot"),this.ta.setsChildPortSpot=a,this.J())}); -w.defineProperty(Y,{childPortSpot:"childPortSpot"},function(){return this.ta.childPortSpot},function(a){w.G(a,L,Y,"childPortSpot");this.ta.childPortSpot.L(a)||(this.ta.childPortSpot=a,this.J())});w.defineProperty(Y,{oK:"alternateSorting"},function(){return this.ua.sorting},function(a){this.ua.sorting!==a&&(w.mb(a,Y,Y,"alternateSorting"),a===Fv||a===Gv||a===Hv||Iv)&&(this.ua.sorting=a,this.J())}); -w.defineProperty(Y,{cK:"alternateComparer"},function(){return this.ua.comparer},function(a){this.ua.comparer!==a&&(w.j(a,"function",Y,"alternateComparer"),this.ua.comparer=a,this.J())});w.defineProperty(Y,{XJ:"alternateAngle"},function(){return this.ua.angle},function(a){this.ua.angle!==a&&(w.j(a,"number",Y,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.ua.angle=a,this.J())}); -w.defineProperty(Y,{WJ:"alternateAlignment"},function(){return this.ua.alignment},function(a){this.ua.alignment!==a&&(w.mb(a,Y,Y,"alternateAlignment"),this.ua.alignment=a,this.J())});w.defineProperty(Y,{gK:"alternateNodeIndent"},function(){return this.ua.nodeIndent},function(a){this.ua.nodeIndent!==a&&(w.j(a,"number",Y,"alternateNodeIndent"),0<=a&&(this.ua.nodeIndent=a,this.J()))}); -w.defineProperty(Y,{hK:"alternateNodeIndentPastParent"},function(){return this.ua.nodeIndentPastParent},function(a){this.ua.nodeIndentPastParent!==a&&(w.j(a,"number",Y,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.ua.nodeIndentPastParent=a,this.J()))});w.defineProperty(Y,{iK:"alternateNodeSpacing"},function(){return this.ua.nodeSpacing},function(a){this.ua.nodeSpacing!==a&&(w.j(a,"number",Y,"alternateNodeSpacing"),this.ua.nodeSpacing=a,this.J())}); -w.defineProperty(Y,{eK:"alternateLayerSpacing"},function(){return this.ua.layerSpacing},function(a){this.ua.layerSpacing!==a&&(w.j(a,"number",Y,"alternateLayerSpacing"),this.ua.layerSpacing=a,this.J())});w.defineProperty(Y,{fK:"alternateLayerSpacingParentOverlap"},function(){return this.ua.layerSpacingParentOverlap},function(a){this.ua.layerSpacingParentOverlap!==a&&(w.j(a,"number",Y,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.ua.layerSpacingParentOverlap=a,this.J()))}); -w.defineProperty(Y,{bK:"alternateCompaction"},function(){return this.ua.compaction},function(a){this.ua.compaction!==a&&(w.mb(a,Y,Y,"alternateCompaction"),a===Qv||a===Sv)&&(this.ua.compaction=a,this.J())});w.defineProperty(Y,{YJ:"alternateBreadthLimit"},function(){return this.ua.breadthLimit},function(a){this.ua.breadthLimit!==a&&(w.j(a,"number",Y,"alternateBreadthLimit"),0<=a&&(this.ua.breadthLimit=a,this.J()))}); -w.defineProperty(Y,{lK:"alternateRowSpacing"},function(){return this.ua.rowSpacing},function(a){this.ua.rowSpacing!==a&&(w.j(a,"number",Y,"alternateRowSpacing"),this.ua.rowSpacing=a,this.J())});w.defineProperty(Y,{kK:"alternateRowIndent"},function(){return this.ua.rowIndent},function(a){this.ua.rowIndent!==a&&(w.j(a,"number",Y,"alternateRowIndent"),0<=a&&(this.ua.rowIndent=a,this.J()))}); -w.defineProperty(Y,{aK:"alternateCommentSpacing"},function(){return this.ua.commentSpacing},function(a){this.ua.commentSpacing!==a&&(w.j(a,"number",Y,"alternateCommentSpacing"),this.ua.commentSpacing=a,this.J())});w.defineProperty(Y,{$J:"alternateCommentMargin"},function(){return this.ua.commentMargin},function(a){this.ua.commentMargin!==a&&(w.j(a,"number",Y,"alternateCommentMargin"),this.ua.commentMargin=a,this.J())}); -w.defineProperty(Y,{nK:"alternateSetsPortSpot"},function(){return this.ua.setsPortSpot},function(a){this.ua.setsPortSpot!==a&&(w.j(a,"boolean",Y,"alternateSetsPortSpot"),this.ua.setsPortSpot=a,this.J())});w.defineProperty(Y,{jK:"alternatePortSpot"},function(){return this.ua.portSpot},function(a){w.G(a,L,Y,"alternatePortSpot");this.ua.portSpot.L(a)||(this.ua.portSpot=a,this.J())}); -w.defineProperty(Y,{mK:"alternateSetsChildPortSpot"},function(){return this.ua.setsChildPortSpot},function(a){this.ua.setsChildPortSpot!==a&&(w.j(a,"boolean",Y,"alternateSetsChildPortSpot"),this.ua.setsChildPortSpot=a,this.J())});w.defineProperty(Y,{ZJ:"alternateChildPortSpot"},function(){return this.ua.childPortSpot},function(a){w.G(a,L,Y,"alternateChildPortSpot");this.ua.childPortSpot.L(a)||(this.ua.childPortSpot=a,this.J())});var iv;Y.PathDefault=iv=w.p(Y,"PathDefault",-1);var jv; -Y.PathDestination=jv=w.p(Y,"PathDestination",0);var qv;Y.PathSource=qv=w.p(Y,"PathSource",1);var Fv;Y.SortingForwards=Fv=w.p(Y,"SortingForwards",10);var Gv;Y.SortingReverse=Gv=w.p(Y,"SortingReverse",11);var Hv;Y.SortingAscending=Hv=w.p(Y,"SortingAscending",12);var Iv;Y.SortingDescending=Iv=w.p(Y,"SortingDescending",13);var Kw;Y.AlignmentCenterSubtrees=Kw=w.p(Y,"AlignmentCenterSubtrees",20);var Jv;Y.AlignmentCenterChildren=Jv=w.p(Y,"AlignmentCenterChildren",21);var Uv; -Y.AlignmentStart=Uv=w.p(Y,"AlignmentStart",22);var Vv;Y.AlignmentEnd=Vv=w.p(Y,"AlignmentEnd",23);var Lv;Y.AlignmentBus=Lv=w.p(Y,"AlignmentBus",24);var Av;Y.AlignmentBusBranching=Av=w.p(Y,"AlignmentBusBranching",25);var Mv;Y.AlignmentTopLeftBus=Mv=w.p(Y,"AlignmentTopLeftBus",26);var Nv;Y.AlignmentBottomRightBus=Nv=w.p(Y,"AlignmentBottomRightBus",27);var Qv;Y.CompactionNone=Qv=w.p(Y,"CompactionNone",30);var Sv;Y.CompactionBlock=Sv=w.p(Y,"CompactionBlock",31);var kv; -Y.StyleLayered=kv=w.p(Y,"StyleLayered",40);var Ev;Y.StyleLastParents=Ev=w.p(Y,"StyleLastParents",41);var Dv;Y.StyleAlternating=Dv=w.p(Y,"StyleAlternating",42);var Cv;Y.StyleRootOnly=Cv=w.p(Y,"StyleRootOnly",43);var mv;Y.ArrangementVertical=mv=w.p(Y,"ArrangementVertical",50);var Tw;Y.ArrangementHorizontal=Tw=w.p(Y,"ArrangementHorizontal",51);var pv;Y.ArrangementFixedRoots=pv=w.p(Y,"ArrangementFixedRoots",52);var lv;Y.LayerIndividual=lv=w.p(Y,"LayerIndividual",60);var yv; -Y.LayerSiblings=yv=w.p(Y,"LayerSiblings",61);var xv;Y.LayerUniform=xv=w.p(Y,"LayerUniform",62);function ov(){qg.call(this)}w.La(ov,qg);w.fa("TreeNetwork",ov);ov.prototype.createVertex=function(){return new nv};ov.prototype.createEdge=function(){return new Vw}; -function nv(){ks.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.pa=new z(0,0);this.ib=new ha(0,0);this.Oa=new z(0,0);this.pq=this.oq=this.qJ=!1;this.Bu=this.gu=null;this.sorting=Fv;this.comparer=qs;this.angle=0;this.alignment=Jv;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=Sv;this.breadthLimit= -0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=oc;this.setsChildPortSpot=!0;this.childPortSpot=oc}w.La(nv,ks);w.fa("TreeVertex",nv); -nv.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing, -this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};w.u(nv,{mn:"childrenCount"},function(){return this.children.length});w.defineProperty(nv,{zL:"relativePosition"},function(){return this.pa},function(a){this.pa.set(a)});w.defineProperty(nv,{ML:"subtreeSize"},function(){return this.ib},function(a){this.ib.set(a)}); -w.defineProperty(nv,{LL:"subtreeOffset"},function(){return this.Oa},function(a){this.Oa.set(a)});function Vw(){ls.call(this);this.Fs=new z(0,0)}w.La(Vw,ls);w.fa("TreeEdge",Vw); -Vw.prototype.commit=function(){var a=this.link;if(null!==a&&!a.Dk){var b=this.network.Rb,c=null,d=null;switch(b.Hf){case jv:c=this.fromVertex;d=this.toVertex;break;case qv:c=this.toVertex;d=this.fromVertex;break;default:w.k("Unhandled path value "+b.Hf.toString())}if(null!==c&&null!==d)if(b=this.Fs,0!==b.x||0!==b.y||c.qJ){var d=c.jb,e=Tv(c),f=Wv(c),h=c.rowSpacing;a.ao();var k=a.Ye===sj,l=a.ic,m=0,n,p;a.fm();if(l||k){for(m=2;4q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Xv(c))))):c.alignment===Uv?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Xv(c))))):c.alignment===Uv?(r=d.left+b.x,0===b.x&&n.xq.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Xv(c))))):c.alignment===Uv?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Xv(c))))):c.alignment===Uv?(r=d.left+b.x,0===b.x&&n.x=a?0:135>=a?90:225>=a?180:315>=a?270:0} +function Xv(a){var b=Uv(a),b=90===b||270===b,c=a.layerSpacing;if(0=a&&(this.ua.nodeIndentPastParent=a,this.J()))}); +w.defineProperty(Y,{nodeSpacing:"nodeSpacing"},function(){return this.ua.nodeSpacing},function(a){this.ua.nodeSpacing!==a&&(w.j(a,"number",Y,"nodeSpacing"),this.ua.nodeSpacing=a,this.J())});w.defineProperty(Y,{layerSpacing:"layerSpacing"},function(){return this.ua.layerSpacing},function(a){this.ua.layerSpacing!==a&&(w.j(a,"number",Y,"layerSpacing"),this.ua.layerSpacing=a,this.J())}); +w.defineProperty(Y,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.ua.layerSpacingParentOverlap},function(a){this.ua.layerSpacingParentOverlap!==a&&(w.j(a,"number",Y,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.ua.layerSpacingParentOverlap=a,this.J()))});w.defineProperty(Y,{compaction:"compaction"},function(){return this.ua.compaction},function(a){this.ua.compaction!==a&&(w.mb(a,Y,Y,"compaction"),a===Rv||a===Tv)&&(this.ua.compaction=a,this.J())}); +w.defineProperty(Y,{breadthLimit:"breadthLimit"},function(){return this.ua.breadthLimit},function(a){this.ua.breadthLimit!==a&&(w.j(a,"number",Y,"breadthLimit"),0<=a&&(this.ua.breadthLimit=a,this.J()))});w.defineProperty(Y,{rowSpacing:"rowSpacing"},function(){return this.ua.rowSpacing},function(a){this.ua.rowSpacing!==a&&(w.j(a,"number",Y,"rowSpacing"),this.ua.rowSpacing=a,this.J())}); +w.defineProperty(Y,{rowIndent:"rowIndent"},function(){return this.ua.rowIndent},function(a){this.ua.rowIndent!==a&&(w.j(a,"number",Y,"rowIndent"),0<=a&&(this.ua.rowIndent=a,this.J()))});w.defineProperty(Y,{commentSpacing:"commentSpacing"},function(){return this.ua.commentSpacing},function(a){this.ua.commentSpacing!==a&&(w.j(a,"number",Y,"commentSpacing"),this.ua.commentSpacing=a,this.J())}); +w.defineProperty(Y,{commentMargin:"commentMargin"},function(){return this.ua.commentMargin},function(a){this.ua.commentMargin!==a&&(w.j(a,"number",Y,"commentMargin"),this.ua.commentMargin=a,this.J())});w.defineProperty(Y,{setsPortSpot:"setsPortSpot"},function(){return this.ua.setsPortSpot},function(a){this.ua.setsPortSpot!==a&&(w.j(a,"boolean",Y,"setsPortSpot"),this.ua.setsPortSpot=a,this.J())}); +w.defineProperty(Y,{portSpot:"portSpot"},function(){return this.ua.portSpot},function(a){w.G(a,L,Y,"portSpot");this.ua.portSpot.L(a)||(this.ua.portSpot=a,this.J())});w.defineProperty(Y,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.ua.setsChildPortSpot},function(a){this.ua.setsChildPortSpot!==a&&(w.j(a,"boolean",Y,"setsChildPortSpot"),this.ua.setsChildPortSpot=a,this.J())}); +w.defineProperty(Y,{childPortSpot:"childPortSpot"},function(){return this.ua.childPortSpot},function(a){w.G(a,L,Y,"childPortSpot");this.ua.childPortSpot.L(a)||(this.ua.childPortSpot=a,this.J())});w.defineProperty(Y,{rK:"alternateSorting"},function(){return this.va.sorting},function(a){this.va.sorting!==a&&(w.mb(a,Y,Y,"alternateSorting"),a===Gv||a===Hv||a===Iv||Jv)&&(this.va.sorting=a,this.J())}); +w.defineProperty(Y,{fK:"alternateComparer"},function(){return this.va.comparer},function(a){this.va.comparer!==a&&(w.j(a,"function",Y,"alternateComparer"),this.va.comparer=a,this.J())});w.defineProperty(Y,{$J:"alternateAngle"},function(){return this.va.angle},function(a){this.va.angle!==a&&(w.j(a,"number",Y,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.va.angle=a,this.J())}); +w.defineProperty(Y,{ZJ:"alternateAlignment"},function(){return this.va.alignment},function(a){this.va.alignment!==a&&(w.mb(a,Y,Y,"alternateAlignment"),this.va.alignment=a,this.J())});w.defineProperty(Y,{jK:"alternateNodeIndent"},function(){return this.va.nodeIndent},function(a){this.va.nodeIndent!==a&&(w.j(a,"number",Y,"alternateNodeIndent"),0<=a&&(this.va.nodeIndent=a,this.J()))}); +w.defineProperty(Y,{kK:"alternateNodeIndentPastParent"},function(){return this.va.nodeIndentPastParent},function(a){this.va.nodeIndentPastParent!==a&&(w.j(a,"number",Y,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.va.nodeIndentPastParent=a,this.J()))});w.defineProperty(Y,{lK:"alternateNodeSpacing"},function(){return this.va.nodeSpacing},function(a){this.va.nodeSpacing!==a&&(w.j(a,"number",Y,"alternateNodeSpacing"),this.va.nodeSpacing=a,this.J())}); +w.defineProperty(Y,{hK:"alternateLayerSpacing"},function(){return this.va.layerSpacing},function(a){this.va.layerSpacing!==a&&(w.j(a,"number",Y,"alternateLayerSpacing"),this.va.layerSpacing=a,this.J())});w.defineProperty(Y,{iK:"alternateLayerSpacingParentOverlap"},function(){return this.va.layerSpacingParentOverlap},function(a){this.va.layerSpacingParentOverlap!==a&&(w.j(a,"number",Y,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.va.layerSpacingParentOverlap=a,this.J()))}); +w.defineProperty(Y,{eK:"alternateCompaction"},function(){return this.va.compaction},function(a){this.va.compaction!==a&&(w.mb(a,Y,Y,"alternateCompaction"),a===Rv||a===Tv)&&(this.va.compaction=a,this.J())});w.defineProperty(Y,{aK:"alternateBreadthLimit"},function(){return this.va.breadthLimit},function(a){this.va.breadthLimit!==a&&(w.j(a,"number",Y,"alternateBreadthLimit"),0<=a&&(this.va.breadthLimit=a,this.J()))}); +w.defineProperty(Y,{oK:"alternateRowSpacing"},function(){return this.va.rowSpacing},function(a){this.va.rowSpacing!==a&&(w.j(a,"number",Y,"alternateRowSpacing"),this.va.rowSpacing=a,this.J())});w.defineProperty(Y,{nK:"alternateRowIndent"},function(){return this.va.rowIndent},function(a){this.va.rowIndent!==a&&(w.j(a,"number",Y,"alternateRowIndent"),0<=a&&(this.va.rowIndent=a,this.J()))}); +w.defineProperty(Y,{dK:"alternateCommentSpacing"},function(){return this.va.commentSpacing},function(a){this.va.commentSpacing!==a&&(w.j(a,"number",Y,"alternateCommentSpacing"),this.va.commentSpacing=a,this.J())});w.defineProperty(Y,{cK:"alternateCommentMargin"},function(){return this.va.commentMargin},function(a){this.va.commentMargin!==a&&(w.j(a,"number",Y,"alternateCommentMargin"),this.va.commentMargin=a,this.J())}); +w.defineProperty(Y,{qK:"alternateSetsPortSpot"},function(){return this.va.setsPortSpot},function(a){this.va.setsPortSpot!==a&&(w.j(a,"boolean",Y,"alternateSetsPortSpot"),this.va.setsPortSpot=a,this.J())});w.defineProperty(Y,{mK:"alternatePortSpot"},function(){return this.va.portSpot},function(a){w.G(a,L,Y,"alternatePortSpot");this.va.portSpot.L(a)||(this.va.portSpot=a,this.J())}); +w.defineProperty(Y,{pK:"alternateSetsChildPortSpot"},function(){return this.va.setsChildPortSpot},function(a){this.va.setsChildPortSpot!==a&&(w.j(a,"boolean",Y,"alternateSetsChildPortSpot"),this.va.setsChildPortSpot=a,this.J())});w.defineProperty(Y,{bK:"alternateChildPortSpot"},function(){return this.va.childPortSpot},function(a){w.G(a,L,Y,"alternateChildPortSpot");this.va.childPortSpot.L(a)||(this.va.childPortSpot=a,this.J())});var jv;Y.PathDefault=jv=w.p(Y,"PathDefault",-1);var kv; +Y.PathDestination=kv=w.p(Y,"PathDestination",0);var rv;Y.PathSource=rv=w.p(Y,"PathSource",1);var Gv;Y.SortingForwards=Gv=w.p(Y,"SortingForwards",10);var Hv;Y.SortingReverse=Hv=w.p(Y,"SortingReverse",11);var Iv;Y.SortingAscending=Iv=w.p(Y,"SortingAscending",12);var Jv;Y.SortingDescending=Jv=w.p(Y,"SortingDescending",13);var Lw;Y.AlignmentCenterSubtrees=Lw=w.p(Y,"AlignmentCenterSubtrees",20);var Kv;Y.AlignmentCenterChildren=Kv=w.p(Y,"AlignmentCenterChildren",21);var Vv; +Y.AlignmentStart=Vv=w.p(Y,"AlignmentStart",22);var Wv;Y.AlignmentEnd=Wv=w.p(Y,"AlignmentEnd",23);var Mv;Y.AlignmentBus=Mv=w.p(Y,"AlignmentBus",24);var Bv;Y.AlignmentBusBranching=Bv=w.p(Y,"AlignmentBusBranching",25);var Nv;Y.AlignmentTopLeftBus=Nv=w.p(Y,"AlignmentTopLeftBus",26);var Ov;Y.AlignmentBottomRightBus=Ov=w.p(Y,"AlignmentBottomRightBus",27);var Rv;Y.CompactionNone=Rv=w.p(Y,"CompactionNone",30);var Tv;Y.CompactionBlock=Tv=w.p(Y,"CompactionBlock",31);var lv; +Y.StyleLayered=lv=w.p(Y,"StyleLayered",40);var Fv;Y.StyleLastParents=Fv=w.p(Y,"StyleLastParents",41);var Ev;Y.StyleAlternating=Ev=w.p(Y,"StyleAlternating",42);var Dv;Y.StyleRootOnly=Dv=w.p(Y,"StyleRootOnly",43);var nv;Y.ArrangementVertical=nv=w.p(Y,"ArrangementVertical",50);var Uw;Y.ArrangementHorizontal=Uw=w.p(Y,"ArrangementHorizontal",51);var qv;Y.ArrangementFixedRoots=qv=w.p(Y,"ArrangementFixedRoots",52);var mv;Y.LayerIndividual=mv=w.p(Y,"LayerIndividual",60);var zv; +Y.LayerSiblings=zv=w.p(Y,"LayerSiblings",61);var yv;Y.LayerUniform=yv=w.p(Y,"LayerUniform",62);function pv(){sg.call(this)}w.La(pv,sg);w.fa("TreeNetwork",pv);pv.prototype.createVertex=function(){return new ov};pv.prototype.createEdge=function(){return new Ww}; +function ov(){ms.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.pa=new z(0,0);this.jb=new ha(0,0);this.Oa=new z(0,0);this.oq=this.nq=this.tJ=!1;this.Au=this.fu=null;this.sorting=Gv;this.comparer=ss;this.angle=0;this.alignment=Kv;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=Tv;this.breadthLimit= +0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=rc;this.setsChildPortSpot=!0;this.childPortSpot=rc}w.La(ov,ms);w.fa("TreeVertex",ov); +ov.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing, +this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};w.u(ov,{on:"childrenCount"},function(){return this.children.length});w.defineProperty(ov,{CL:"relativePosition"},function(){return this.pa},function(a){this.pa.set(a)});w.defineProperty(ov,{PL:"subtreeSize"},function(){return this.jb},function(a){this.jb.set(a)}); +w.defineProperty(ov,{OL:"subtreeOffset"},function(){return this.Oa},function(a){this.Oa.set(a)});function Ww(){ns.call(this);this.Fs=new z(0,0)}w.La(Ww,ns);w.fa("TreeEdge",Ww); +Ww.prototype.commit=function(){var a=this.link;if(null!==a&&!a.sj){var b=this.network.Sb,c=null,d=null;switch(b.If){case kv:c=this.fromVertex;d=this.toVertex;break;case rv:c=this.toVertex;d=this.fromVertex;break;default:w.k("Unhandled path value "+b.If.toString())}if(null!==c&&null!==d)if(b=this.Fs,0!==b.x||0!==b.y||c.tJ){var d=c.cb,e=Uv(c),f=Xv(c),h=c.rowSpacing;a.co();var k=a.Ye===xj,l=a.jc,m=0,n,p;a.em();if(l||k){for(m=2;4q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Yv(c))))):c.alignment===Vv?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Yv(c))))):c.alignment===Vv?(r=d.left+b.x,0===b.x&&n.xq.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Yv(c))))):c.alignment===Vv?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Yv(c))))):c.alignment===Vv?(r=d.left+b.x,0===b.x&&n.xTool Extensions:

  • GeometryReshaping.html, using GeometryReshapingTool.js
  • GuidedDragging.html, using GuidedDraggingTool.js
  • LinkLabelDragging.html, using LinkLabelDraggingTool.js +
  • LinkLabelOnPathDragging.html, using LinkLabelOnPathDraggingTool.js
  • LinkShifting.html, using LinkShiftingTool.js
  • NodeLabelDragging.html, using NodeLabelDraggingTool.js
  • OrthogonalLinkReshaping.html, using OrthogonalLinkReshapingTool.js diff --git a/samples/indexList.js b/samples/indexList.js index a9ffaefbc..d1d8ba690 100644 --- a/samples/indexList.js +++ b/samples/indexList.js @@ -1130,7 +1130,15 @@ arr.push([ "Link Label Dragging", "A custom Tool that lets the user drag a label on a Link and that keeps its relative position to the link.", "LinkLabelDragging", - ["tools", "buttons", "extensions"] + ["tools", "extensions"] +]); + +arr.push([ + "../extensions/LinkLabelOnPathDragging", + "Link Label On Path Dragging", + "A custom Tool that lets the user drag a label on a Link and that keeps the label along the path of the link.", + "LinkLabelOnPathDragging", + ["tools", "extensions"] ]); arr.push([ @@ -1138,7 +1146,7 @@ arr.push([ "Node Label Dragging", "A custom Tool that lets the user drag a label in a Spot Panel of a Node.", "NodeLabelDragging", - ["tools", "buttons", "extensions"] + ["tools", "extensions"] ]); arr.push([ diff --git a/samples/treeMapper.html b/samples/treeMapper.html index 6e8da6762..0e16151cd 100644 --- a/samples/treeMapper.html +++ b/samples/treeMapper.html @@ -32,8 +32,6 @@ function MappingLink() { go.Link.call(this); - this.isTreeLink = false; - this.isLayoutPositioned = false; } go.Diagram.inherit(MappingLink, go.Link); @@ -91,7 +89,9 @@ new go.Binding("fromLinkable", "group", function(k) { return k === -1; }), new go.Binding("toLinkable", "group", function(k) { return k === -2; }), $("TreeExpanderButton", // support expanding/collapsing subtrees - { width: 14, height: 14, + { + width: 14, height: 14, + portId: "", "ButtonIcon.stroke": "white", "ButtonIcon.strokeWidth": 2, "ButtonBorder.fill": "goldenrod", @@ -119,19 +119,21 @@ myDiagram.linkTemplate = // with lines $(go.Link, - { selectable: false, + { + selectable: false, routing: go.Link.Orthogonal, fromEndSegmentLength: 4, toEndSegmentLength: 4, - fromSpot: new go.Spot(0.001, 1, 7, 0), - toSpot: go.Spot.Left }, + fromSpot: go.Spot.Bottom, + toSpot: go.Spot.Left + }, $(go.Shape, { stroke: "lightgray" })); // These are the blue links connecting a tree node on the left side with one on the right side. myDiagram.linkTemplateMap.add("Mapping", $(MappingLink, - { layerName: "Foreground" }, + { isTreeLink: false, isLayoutPositioned: false, layerName: "Foreground" }, { fromSpot: go.Spot.Right, toSpot: go.Spot.Left }, { relinkableFrom: true, relinkableTo: true }, $(go.Shape, { stroke: "blue", strokeWidth: 2 }) @@ -141,6 +143,7 @@ $(go.Group, "Auto", new go.Binding("position", "xy", go.Point.parse).makeTwoWay(go.Point.stringify), { + deletable: false, layout: $(go.TreeLayout, { @@ -174,14 +177,15 @@ { from: 6, to: 1012, category: "Mapping" }, { from: 4, to: 1006, category: "Mapping" }, { from: 9, to: 1004, category: "Mapping" }, - { from: 1, to: 1009, category: "Mapping" } + { from: 1, to: 1009, category: "Mapping" }, + { from: 14, to: 1010, category: "Mapping" } ]; // initialize tree on left side var root = { key: 0, group: -1 }; nodeDataArray.push(root); for (var i = 0; i < 11; ) { - i = makeTree(3, i, 11, nodeDataArray, linkDataArray, root, -1, root.key); + i = makeTree(3, i, 17, nodeDataArray, linkDataArray, root, -1, root.key); } // initialize tree on right side diff --git a/samples/virtualized.html b/samples/virtualized.html index 7c6eb76db..d5bf18709 100644 --- a/samples/virtualized.html +++ b/samples/virtualized.html @@ -99,7 +99,9 @@ $(go.GraphLinksModel); // must match the model, above // for now, we have to implement virtualization ourselves + myDiagram.isVirtualized = true; myDiagram.addDiagramListener("ViewportBoundsChanged", onViewportChanged); + myDiagram.addModelChangedListener(onModelChanged); myDiagram.model.makeUniqueKeyFunction = virtualUniqueKey; // ensure uniqueness in myWholeModel myDiagram.commandHandler.selectAll = function() { }; // make Select All command a no-op diff --git a/samples/virtualizedForceLayout.html b/samples/virtualizedForceLayout.html index 6b533dc14..fe7673be5 100644 --- a/samples/virtualizedForceLayout.html +++ b/samples/virtualizedForceLayout.html @@ -74,6 +74,7 @@ $(go.GraphLinksModel); // must match the model, above // for now, we have to implement virtualization ourselves + myDiagram.isVirtualized = true; myDiagram.addDiagramListener("ViewportBoundsChanged", onViewportChanged); // once the layout has finished we can decide where to position the viewport diff --git a/samples/virtualizedTree.html b/samples/virtualizedTree.html index 2d28d9b25..31d03141f 100644 --- a/samples/virtualizedTree.html +++ b/samples/virtualizedTree.html @@ -81,6 +81,7 @@ $(go.TreeModel); // must match the model, above // for now, we have to implement virtualization ourselves + myDiagram.isVirtualized = true; myDiagram.addDiagramListener("ViewportBoundsChanged", onViewportChanged); // This is a status message diff --git a/samples/virtualizedTreeLayout.html b/samples/virtualizedTreeLayout.html index fba234264..3799b735f 100644 --- a/samples/virtualizedTreeLayout.html +++ b/samples/virtualizedTreeLayout.html @@ -83,6 +83,7 @@ $(go.TreeModel); // must match the model, above // for now, we have to implement virtualization ourselves + myDiagram.isVirtualized = true; myDiagram.addDiagramListener("ViewportBoundsChanged", onViewportChanged); // This is a status message