Bridge.assembly("OrgChart.Layout",function($asm){"use strict";Bridge.define("OrgChart.Annotations.CanBeNullAttribute",{inherits:[System.Attribute]});Bridge.define("OrgChart.Annotations.ContractAnnotationAttribute",{inherits:[System.Attribute],config:{properties:{Contract:null,ForceFullStates:!1}},ctor:function(contract){OrgChart.Annotations.ContractAnnotationAttribute.$ctor1.call(this,contract,!1)},$ctor1:function(contract,forceFullStates){this.$initialize();System.Attribute.ctor.call(this);this.setContract(contract);this.setForceFullStates(forceFullStates)}});Bridge.define("OrgChart.Annotations.NotNullAttribute",{inherits:[System.Attribute]});Bridge.define("OrgChart.Annotations.PureAttribute",{inherits:[System.Attribute]});Bridge.define("OrgChart.Layout.Boundary",{Left:null,Right:null,m_spacerMerger:null,config:{properties:{BoundingRect:null},init:function(){this.BoundingRect=new OrgChart.Layout.Rect}},ctor:function(){OrgChart.Layout.Boundary.$ctor1.call(this,!0)},$ctor1:function(frompublic){this.$initialize();this.Left=new(System.Collections.Generic.List$1(OrgChart.Layout.Boundary.Step));this.Right=new(System.Collections.Generic.List$1(OrgChart.Layout.Boundary.Step));frompublic&&(this.m_spacerMerger=new OrgChart.Layout.Boundary.$ctor1(!1))},PrepareForHorizontalLayout:function(node){if(this.Prepare(node),!node.getElement().DisableCollisionDetection){var rect=node.getState();this.Left.add(new OrgChart.Layout.Boundary.Step.$ctor1(node,rect.getLeft(),rect.getTop(),rect.getBottom()));this.Right.add(new OrgChart.Layout.Boundary.Step.$ctor1(node,rect.getRight(),rect.getTop(),rect.getBottom()))}},Prepare:function(node){this.Left.clear();this.Right.clear();this.setBoundingRect(new OrgChart.Layout.Rect.$ctor1(node.getState().TopLeft,node.getState().Size))},VerticalMergeFrom:function(other){this.setBoundingRect(OrgChart.Layout.Rect.op_Addition(this.getBoundingRect(),other.getBoundingRect()))},MergeFrom:function(other){var merge,my,th,theirWins;if(other.getBoundingRect().getTop()>=other.getBoundingRect().getBottom())throw new System.ArgumentException("Cannot merge boundary of height "+System.Double.format(other.getBoundingRect().getBottom()-other.getBoundingRect().getTop(),"G"));for(merge=114;merge!==0;){for(var mySteps=merge===114?this.Right:this.Left,theirSteps=merge===114?other.Right:other.Left,i=0,k=0;k=th.X;OrgChart.Layout.LayoutAlgorithm.IsEqual(my.Top,th.Top)?OrgChart.Layout.LayoutAlgorithm.IsEqual(my.Bottom,th.Bottom)?(theirWins&&mySteps.setItem(i,th),i=i+1|0,k=k+1|0,this.ValidateState()):my.Bottomth.Bottom?(theirWins&&(mySteps.setItem(i,my.ChangeBottom(th.Top)),mySteps.insert(i+1|0,th),mySteps.insert(i+2|0,my.ChangeTop(th.Bottom)),i=i+2|0),k=k+1|0,this.ValidateState()):my.Bottom>th.Bottom?(theirWins?(mySteps.setItem(i,my.ChangeTop(th.Bottom)),mySteps.insert(i,th)):mySteps.insert(i,th.ChangeBottom(my.Top)),i=i+1|0,k=k+1|0,this.ValidateState()):(theirWins?mySteps.setItem(i,th.ChangeBottom(my.Bottom)):(mySteps.insert(i,th.ChangeBottom(my.Top)),i=i+1|0),theirSteps.setItem(k,th.ChangeTop(my.Bottom)),i=i+1|0,this.ValidateState())}if(i===mySteps.getCount())while(koffense&&(offense=diff)),my.Bottom>=th.Bottom&&(k=k+1|0),th.Bottom>=my.Bottom&&(i=i+1|0));return offense},ReloadFromBranch:function(branchRoot){for(var left,newLeft,i1,right,newRight,leftmost=System.Double.max,rightmost=System.Double.min,i=0;i=0)||!(box.Size.Width<=1e9)||!(box.Size.Height>=0)||!(box.Size.Width<=1e9))throw new System.InvalidOperationException(System.String.format("Box {0} has invalid size: {1}x{2}",box.Id,box.Size.Width,box.Size.Height));},PreprocessVisualTree:function(state,visualTree){var defaultStrategy=state.getDiagram().getLayoutSettings().RequireDefaultLayoutStrategy(),defaultAssistantsStrategy=state.getDiagram().getLayoutSettings().RequireDefaultAssistantLayoutStrategy(),regular=new(System.Collections.Generic.Stack$1(OrgChart.Layout.LayoutStrategyBase).ctor),assistants;regular.push(defaultStrategy);assistants=new(System.Collections.Generic.Stack$1(OrgChart.Layout.LayoutStrategyBase).ctor);assistants.push(defaultAssistantsStrategy);visualTree.IterateParentFirst(function(node){var strategy,suggestedStrategyId;return node.getState().IsHidden?!1:(strategy=null,Bridge.staticEquals(state.getLayoutOptimizerFunc(),null)||(suggestedStrategyId=state.getLayoutOptimizerFunc()(node),System.String.isNullOrEmpty(suggestedStrategyId)||(strategy=state.getDiagram().getLayoutSettings().getLayoutStrategies().get(suggestedStrategyId))),node.getIsAssistantRoot()?(strategy==null&&(strategy=node.getParentNode().getElement().AssistantLayoutStrategyId!=null?state.getDiagram().getLayoutSettings().getLayoutStrategies().get(node.getParentNode().getElement().AssistantLayoutStrategyId):assistants.peek()),assistants.push(strategy)):(strategy==null&&(strategy=node.getElement().LayoutStrategyId!=null?state.getDiagram().getLayoutSettings().getLayoutStrategies().get(node.getElement().LayoutStrategyId):regular.peek()),regular.push(strategy),strategy.getSupportsAssistants()||node.SuppressAssistants()),node.getState().setEffectiveLayoutStrategy(strategy),node.getState().RequireLayoutStrategy().PreProcessThisNode(state,node),!node.getElement().IsCollapsed&&node.getChildCount()>0||node.getAssistantsRoot()!=null)},function(node){node.getState().IsHidden||(node.getIsAssistantRoot()?assistants.pop():regular.pop())})},HorizontalLayout:function(state,branchRoot){if(branchRoot.getState().IsHidden)throw new System.InvalidOperationException(System.String.format("Branch root {0} does not affect layout",branchRoot.getElement().Id));var level=state.PushLayoutLevel(branchRoot);try{(branchRoot.getLevel()===0||(branchRoot.getState().NumberOfSiblings>0||branchRoot.getAssistantsRoot()!=null)&&!branchRoot.getElement().IsCollapsed)&&branchRoot.getState().RequireLayoutStrategy().ApplyHorizontalLayout(state,level)}finally{state.PopLayoutLevel()}},VerticalLayout:function(state,branchRoot){if(branchRoot.getState().IsHidden)throw new System.InvalidOperationException(System.String.format("Branch root {0} does not affect layout",branchRoot.getElement().Id));var level=state.PushLayoutLevel(branchRoot);try{(branchRoot.getLevel()===0||(branchRoot.getState().NumberOfSiblings>0||branchRoot.getAssistantsRoot()!=null)&&!branchRoot.getElement().IsCollapsed)&&branchRoot.getState().RequireLayoutStrategy().ApplyVerticalLayout(state,level)}finally{state.PopLayoutLevel()}},RouteConnectors:function(state,visualTree){visualTree.IterateParentFirst(function(node){return node.getElement().IsCollapsed||node.getState().NumberOfSiblings===0&&node.getAssistantsRoot()==null?!1:node.getLevel()===0?!0:!node.getElement().IsSpecial||node.getIsAssistantRoot()?(node.getState().RequireLayoutStrategy().RouteConnectors(state,node),!0):!1})},MoveChildrenOnly:function(state,layoutLevel,offset){var $t,children=layoutLevel.BranchRoot.getChildren(),action,child;if(children==null||System.Array.getCount(children,OrgChart.Layout.BoxTree.Node)===0)throw new System.InvalidOperationException("Should never be invoked when children not set");for(action=function(node){return node.getState().IsHidden||(node.getState().TopLeft=node.getState().TopLeft.MoveH(offset),node.getState().BranchExterior=node.getState().BranchExterior.MoveH(offset)),!0},$t=Bridge.getEnumerator(children,OrgChart.Layout.BoxTree.Node);$t.moveNext();)child=$t.getCurrent(),child.IterateChildFirst(action);layoutLevel.Boundary.ReloadFromBranch(layoutLevel.BranchRoot);layoutLevel.BranchRoot.getState().BranchExterior=layoutLevel.Boundary.getBoundingRect()},MoveOneChild:function(state,root,offset){root.IterateChildFirst(function(node){return node.getState().IsHidden||(node.getState().TopLeft=node.getState().TopLeft.MoveH(offset),node.getState().BranchExterior=node.getState().BranchExterior.MoveH(offset)),!0})},MoveBranch:function(state,layoutLevel,offset){OrgChart.Layout.LayoutAlgorithm.MoveOneChild(state,layoutLevel.BranchRoot,offset);layoutLevel.Boundary.ReloadFromBranch(layoutLevel.BranchRoot);layoutLevel.BranchRoot.getState().BranchExterior=layoutLevel.Boundary.getBoundingRect()},AlignHorizontalCenters:function(state,level,subset){for(var $t1,center=System.Double.min,child,c,leftmost,rightmost,diff,$t=Bridge.getEnumerator(subset,OrgChart.Layout.BoxTree.Node);$t.moveNext();)child=$t.getCurrent(),c=child.getState().getCenterH(),c>center&&(center=c);for(leftmost=System.Double.max,rightmost=System.Double.min,$t1=Bridge.getEnumerator(subset,OrgChart.Layout.BoxTree.Node);$t1.moveNext();){var child1=$t1.getCurrent(),frame=child1.getState(),c1=frame.getCenterH();OrgChart.Layout.LayoutAlgorithm.IsEqual(c1,center)||(diff=center-c1,OrgChart.Layout.LayoutAlgorithm.MoveOneChild(state,child1,diff));leftmost=Math.min(leftmost,child1.getState().BranchExterior.getLeft());rightmost=Math.max(rightmost,child1.getState().BranchExterior.getRight())}return level.Boundary.ReloadFromBranch(level.BranchRoot),new OrgChart.Layout.Dimensions.$ctor1(leftmost,rightmost)},CopyExteriorFrom:function(state,other){state.TopLeft=other.TopLeft;state.Size=other.Size;state.BranchExterior=other.BranchExterior;state.SiblingsRowV=other.SiblingsRowV},IsMinValue:function(value){return value<=System.Double.min+494065645841247e-338},IsMaxValue:function(value){return value>=System.Double.max-494065645841247e-338},IsZero:function(value){return value<=494065645841247e-338&&value>=-494065645841247e-338},IsEqual:function(value,other){return Math.abs(value-other)<=494065645841247e-338},MoveTo:function(state,x,y){state.TopLeft=new OrgChart.Layout.Point.$ctor1(x,y)},AdjustSpacer:function(state,x,y,w,h){state.TopLeft=new OrgChart.Layout.Point.$ctor1(x,y);state.Size=new OrgChart.Layout.Size.$ctor1(w,h);state.BranchExterior=new OrgChart.Layout.Rect.$ctor3(x,y,w,h)}}});Bridge.ns("OrgChart.Layout.LayoutAlgorithm",$asm.$);Bridge.apply($asm.$.OrgChart.Layout.LayoutAlgorithm,{f1:function(node){return node.getState().IsHidden=node.getParentNode()!=null&&(node.getParentNode().getState().IsHidden||node.getParentNode().getElement().IsCollapsed),!0},f2:function(x){return x.getIsDataBound()},f3:function(node){return OrgChart.Layout.LayoutAlgorithm.MoveTo(node.getState(),0,0),node.getState().Size=node.getElement().Size,node.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor1(new OrgChart.Layout.Point.$ctor1(0,0),node.getElement().Size),!0}});Bridge.define("OrgChart.Layout.LayoutState",{m_layoutStack:null,m_pooledBoundaries:null,m_currentOperation:0,config:{events:{BoundaryChanged:null,OperationChanged:null},properties:{Diagram:null,BoxSizeFunc:null,LayoutOptimizerFunc:null},init:function(){this.m_layoutStack=new(System.Collections.Generic.Stack$1(OrgChart.Layout.LayoutState.LayoutLevel).ctor);this.m_pooledBoundaries=new(System.Collections.Generic.Stack$1(OrgChart.Layout.Boundary).ctor)}},ctor:function(diagram){this.$initialize();this.setDiagram(diagram)},getCurrentOperation:function(){return this.m_currentOperation},setCurrentOperation:function(value){this.m_currentOperation=value;Bridge.staticEquals(this.OperationChanged,null)?null:this.OperationChanged(this,new OrgChart.Layout.LayoutStateOperationChangedEventArgs(this))},AttachVisualTree:function(tree){while(this.m_pooledBoundaries.getCount()0){higherLevel=this.m_layoutStack.peek();switch(this.getCurrentOperation()){case OrgChart.Layout.LayoutState.Operation.VerticalLayout:higherLevel.Boundary.VerticalMergeFrom(innerLevel.Boundary);higherLevel.BranchRoot.getState().BranchExterior=higherLevel.Boundary.getBoundingRect();break;case OrgChart.Layout.LayoutState.Operation.HorizontalLayout:Bridge.referenceEquals(higherLevel.BranchRoot.getAssistantsRoot(),innerLevel.BranchRoot)||(strategy=higherLevel.BranchRoot.getState().RequireLayoutStrategy(),overlap=higherLevel.Boundary.ComputeOverlap(innerLevel.Boundary,strategy.SiblingSpacing,this.getDiagram().getLayoutSettings().getBranchSpacing()),overlap>0&&(OrgChart.Layout.LayoutAlgorithm.MoveBranch(this,innerLevel,overlap),Bridge.staticEquals(this.BoundaryChanged,null)?null:this.BoundaryChanged(this,new OrgChart.Layout.BoundaryChangedEventArgs(innerLevel.Boundary,innerLevel,this))));higherLevel.Boundary.MergeFrom(innerLevel.Boundary);higherLevel.BranchRoot.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor3(higherLevel.Boundary.getBoundingRect().getLeft(),higherLevel.BranchRoot.getState().BranchExterior.getTop(),higherLevel.Boundary.getBoundingRect().Size.Width,higherLevel.BranchRoot.getState().BranchExterior.Size.Height);break;default:throw new System.InvalidOperationException("This operation can only be invoked when performing vertical or horizontal layouts");}Bridge.staticEquals(this.BoundaryChanged,null)?null:this.BoundaryChanged(this,new OrgChart.Layout.BoundaryChangedEventArgs(higherLevel.Boundary,higherLevel,this))}this.m_pooledBoundaries.push(innerLevel.Boundary)}});Bridge.define("OrgChart.Layout.LayoutState.LayoutLevel",{BranchRoot:null,Boundary:null,ctor:function(node,boundary){this.$initialize();this.BranchRoot=node;this.Boundary=boundary}});Bridge.define("OrgChart.Layout.LayoutState.Operation",{$kind:"enum",statics:{Idle:0,Preparing:1,PreprocessVisualTree:2,VerticalLayout:3,HorizontalLayout:4,ConnectorsLayout:5,Completed:6}});Bridge.define("OrgChart.Layout.LayoutStateOperationChangedEventArgs",{State:null,ctor:function(state){this.$initialize();this.State=state}});Bridge.define("OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter.GroupIterator",{m_numberOfSiblings:0,m_numberOfGroups:0,Group:0,FromIndex:0,Count:0,MaxOnLeft:0,ctor:function(numberOfSiblings,numberOfGroups){this.$initialize();this.m_numberOfSiblings=numberOfSiblings;this.m_numberOfGroups=numberOfGroups},CountInGroup:function(){for(var countInRow=this.m_numberOfGroups*2|0,result=0,countToThisGroup=(this.Group*2|0)+2|0,firstInRow=0,countInThisRow;;){if(countInThisRow=firstInRow>=(this.m_numberOfSiblings-countInRow|0)?this.m_numberOfSiblings-firstInRow|0:countInRow,countInThisRow>=countToThisGroup)result=result+2|0;else{countToThisGroup=countToThisGroup-1|0;countInThisRow>=countToThisGroup&&(result=result+1|0);break}firstInRow=firstInRow+countInRow|0}return result},NextGroup:function(){return this.FromIndex=this.FromIndex+this.Count|0,this.FromIndex>0&&(this.Group=this.Group+1|0),this.Count=this.CountInGroup(),this.MaxOnLeft=(Bridge.Int.div(this.Count,2)|0)+this.Count%2|0,this.Count!==0}});Bridge.define("OrgChart.Layout.NodeLayoutInfo",{IsHidden:!1,NumberOfSiblings:0,NumberOfSiblingRows:0,NumberOfSiblingColumns:0,Connector:null,m_effectiveLayoutStrategy:null,config:{init:function(){this.TopLeft=new OrgChart.Layout.Point;this.Size=new OrgChart.Layout.Size;this.BranchExterior=new OrgChart.Layout.Rect;this.SiblingsRowV=new OrgChart.Layout.Dimensions}},setEffectiveLayoutStrategy:function(value){this.m_effectiveLayoutStrategy=value},getLeft:function(){return this.TopLeft.X},getRight:function(){return this.TopLeft.X+this.Size.Width},getTop:function(){return this.TopLeft.Y},getBottom:function(){return this.TopLeft.Y+this.Size.Height},getCenterH:function(){return this.TopLeft.X+this.Size.Width/2},getCenterV:function(){return this.TopLeft.Y+this.Size.Height/2},RequireLayoutStrategy:function(){if(this.m_effectiveLayoutStrategy==null)throw new System.Exception("effectiveLayoutStrategy is not set");return this.m_effectiveLayoutStrategy}});Bridge.define("OrgChart.Layout.Point",{$kind:"struct",statics:{getDefaultValue:function(){return new OrgChart.Layout.Point}},X:0,Y:0,$ctor1:function(x,y){this.$initialize();this.X=x;this.Y=y},ctor:function(){this.$initialize()},MoveH:function(offsetX){return new OrgChart.Layout.Point.$ctor1(this.X+offsetX,this.Y)},getHashCode:function(){return Bridge.addHash([1852403652,this.X,this.Y])},equals:function(o){return Bridge.is(o,OrgChart.Layout.Point)?Bridge.equals(this.X,o.X)&&Bridge.equals(this.Y,o.Y):!1},$clone:function(to){var s=to||new OrgChart.Layout.Point;return s.X=this.X,s.Y=this.Y,s}});Bridge.define("OrgChart.Layout.Rect",{$kind:"struct",statics:{op_Addition:function(x,y){var left=Math.min(x.getLeft(),y.getLeft()),top=Math.min(x.getTop(),y.getTop()),right=Math.max(x.getRight(),y.getRight()),bottom=Math.max(x.getBottom(),y.getBottom());return new OrgChart.Layout.Rect.$ctor3(left,top,right-left,bottom-top)},getDefaultValue:function(){return new OrgChart.Layout.Rect}},config:{init:function(){this.TopLeft=new OrgChart.Layout.Point;this.Size=new OrgChart.Layout.Size}},$ctor3:function(x,y,w,h){if(this.$initialize(),w<0)throw new System.ArgumentOutOfRangeException("w");if(h<0)throw new System.ArgumentOutOfRangeException("h");this.TopLeft=new OrgChart.Layout.Point.$ctor1(x,y);this.Size=new OrgChart.Layout.Size.$ctor1(w,h)},$ctor1:function(topLeft,size){this.$initialize();this.TopLeft=topLeft;this.Size=size},$ctor2:function(size){this.$initialize();this.TopLeft=new OrgChart.Layout.Point.$ctor1(0,0);this.Size=size},ctor:function(){this.$initialize()},getBottomRight:function(){return new OrgChart.Layout.Point.$ctor1(this.TopLeft.X+this.Size.Width,this.TopLeft.Y+this.Size.Height)},getLeft:function(){return this.TopLeft.X},getRight:function(){return this.TopLeft.X+this.Size.Width},getCenterH:function(){return this.TopLeft.X+this.Size.Width/2},getCenterV:function(){return this.TopLeft.Y+this.Size.Height/2},getTop:function(){return this.TopLeft.Y},getBottom:function(){return this.TopLeft.Y+this.Size.Height},MoveH:function(offsetX){return new OrgChart.Layout.Rect.$ctor1(new OrgChart.Layout.Point.$ctor1(this.getLeft()+offsetX,this.getTop()),this.Size)},getHashCode:function(){return Bridge.addHash([1952671058,this.TopLeft,this.Size])},equals:function(o){return Bridge.is(o,OrgChart.Layout.Rect)?Bridge.equals(this.TopLeft,o.TopLeft)&&Bridge.equals(this.Size,o.Size):!1},$clone:function(to){var s=to||new OrgChart.Layout.Rect;return s.TopLeft=this.TopLeft,s.Size=this.Size,s}});Bridge.define("OrgChart.Layout.Size",{$kind:"struct",statics:{getDefaultValue:function(){return new OrgChart.Layout.Size}},Width:0,Height:0,$ctor1:function(w,h){this.$initialize();this.Width=w;this.Height=h},ctor:function(){this.$initialize()},getHashCode:function(){return Bridge.addHash([1702521171,this.Width,this.Height])},equals:function(o){return Bridge.is(o,OrgChart.Layout.Size)?Bridge.equals(this.Width,o.Width)&&Bridge.equals(this.Height,o.Height):!1},$clone:function(to){var s=to||new OrgChart.Layout.Size;return s.Width=this.Width,s.Height=this.Height,s}});Bridge.define("OrgChart.Layout.StackOrientation",{$kind:"enum",statics:{InvalidValue:0,SingleRowHorizontal:1,SingleColumnVertical:2}});Bridge.define("OrgChart.Test.TestDataGen",{statics:{GenerateBoxSizes:function(boxContainer){var $t,seed=0,random,box;for(System.Diagnostics.Debug.writeln(seed.toString()),random=new System.Random.$ctor1(seed),$t=Bridge.getEnumerator(boxContainer.getBoxesById().System$Collections$Generic$IDictionary$2$System$Int32$OrgChart$Layout$Box$getValues(),OrgChart.Layout.Box);$t.moveNext();)box=$t.getCurrent(),box.IsSpecial||(box.Size=new OrgChart.Layout.Size.$ctor1(50+random.next$1(50)|0,50+random.next$1(50)|0))}},GenerateDataItems:function(dataSource,count,percentAssistants){for(var item,$t=Bridge.getEnumerator(this.GenerateRandomDataItems(count,percentAssistants));$t.moveNext();)item=$t.getCurrent(),dataSource.Items.add(item.getId(),item)},GenerateRandomDataItems:function(itemCount,percentAssistants){var random,items,i,firstInLayer,prevLayerSize,layerSize,i1,parentIndex,i2,assistantCount,i3;if(itemCount<0)throw new System.ArgumentOutOfRangeException("itemCount","Count must be zero or positive",null,itemCount);for(random=new System.Random.$ctor1(0),items=new(System.Collections.Generic.List$1(OrgChart.Test.TestDataItem))(itemCount),i=0;i0)for(assistantCount=Math.min(items.getCount(),Bridge.Int.clip32(Math.ceil((items.getCount()*percentAssistants|0)/100))),i3=0;i30){node.getState().NumberOfSiblingColumns=1;node.getState().NumberOfSiblingRows=Bridge.Int.div(node.getState().NumberOfSiblings,2)|0;node.getState().NumberOfSiblings%2!=0&&(node.getState().NumberOfSiblingRows=node.getState().NumberOfSiblingRows+1|0);var spacer=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,node.getElement().Id,!1);node.AddRegularChild(spacer)}},ApplyVerticalLayout:function(state,level){var node=level.BranchRoot,prevRowBottom,maxOnLeft,i,rowExterior,i2,child2,frame2;if(node.getLevel()===0)throw new System.InvalidOperationException("Should never be invoked on root node");for(prevRowBottom=node.getState().SiblingsRowV.To,maxOnLeft=this.MaxOnLeft(node),i=0;iframe.getBottom()?OrgChart.Layout.LayoutAlgorithm.MoveTo(frame,frame.getLeft(),frame2.getCenterV()-frame.Size.Height/2):frame2.getBottom()0&&node.getState().NumberOfSiblings>0&&(carrier=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),desiredCenter=node.getState().getCenterH(),diff=desiredCenter-carrier,OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(state,level,diff))},RouteConnectors:function(state,node){var count=node.getState().NumberOfSiblings,i,to,y;if(count!==0){this.NeedCarrierProtector(node)&&(count=count+1|0);var segments=System.Array.init(count,function(){return new OrgChart.Layout.Edge}),ix=0,maxOnLeft=this.MaxOnLeft(node),carrier=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node).getState(),from=carrier.getCenterH(),isLeft=!0,countOnThisSide=0,bottomMost=System.Double.min;for(i=0;i0&&(node.getState().NumberOfSiblings=node.getElement().IsCollapsed?0:node.getChildCount(),node.getElement().IsCollapsed||(verticalSpacer=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,node.getElement().Id,!1),node.AddRegularChild(verticalSpacer),horizontalSpacer=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,node.getElement().Id,!1),node.AddRegularChild(horizontalSpacer)))},ApplyVerticalLayout:function(state,level){var node=level.BranchRoot,siblingsRowExterior,top,i,child,rect,i1,child1;if(node.getLevel()===0&&(node.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(node.getState().getTop(),node.getState().getBottom())),node.getAssistantsRoot()!=null&&(OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(node.getAssistantsRoot().getState(),node.getState()),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(state,node.getAssistantsRoot())),node.getState().NumberOfSiblings!==0){for(siblingsRowExterior=OrgChart.Layout.Dimensions.MinMax(),top=node.getAssistantsRoot()==null?node.getState().SiblingsRowV.To+this.ParentChildSpacing:node.getState().BranchExterior.getBottom()+this.ParentChildSpacing,i=0;i0&&node.getChildCount()>0){var rect=node.getState(),leftmost=System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),rightmost=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),desiredCenter=node.getState().NumberOfSiblings===1||this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Center?leftmost+(rightmost-leftmost)/2:this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Left?leftmost+this.ChildConnectorHookLength:rightmost-this.ChildConnectorHookLength,center=rect.getCenterH(),diff=center-desiredCenter;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(state,level,diff);verticalSpacer=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node);OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(verticalSpacer.getState(),center-this.ParentConnectorShield/2,rect.getBottom(),this.ParentConnectorShield,System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-rect.getBottom());state.MergeSpacer(verticalSpacer);firstInRow=System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState();horizontalSpacer=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings+1|0,OrgChart.Layout.BoxTree.Node);OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(horizontalSpacer.getState(),firstInRow.getLeft(),firstInRow.SiblingsRowV.From-this.ParentChildSpacing,System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight()-firstInRow.getLeft(),this.ParentChildSpacing);state.MergeSpacer(horizontalSpacer)}},RouteConnectors:function(state,node){var normalChildCount=node.getState().NumberOfSiblings,count=normalChildCount===0?0:normalChildCount===1?1:2+normalChildCount|0,space,i,childRect,childCenter;if(count===0){node.getState().Connector=null;return}var segments=System.Array.init(count,function(){return new OrgChart.Layout.Edge}),rootRect=node.getState(),center=rootRect.getCenterH();if(node.getChildren()==null)throw new System.Exception("State is present, but children not set");if(count===1)segments[0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(center,rootRect.getBottom()),new OrgChart.Layout.Point.$ctor1(center,System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getTop()));else{for(space=System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-rootRect.getBottom(),segments[0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(center,rootRect.getBottom()),new OrgChart.Layout.Point.$ctor1(center,rootRect.getBottom()+space-this.ChildConnectorHookLength)),i=0;iframe.getBottom()?OrgChart.Layout.LayoutAlgorithm.MoveTo(frame,frame.getLeft(),frame2.getCenterV()-frame.Size.Height/2):frame2.getBottom()0&&node.getLevel()>0){node.getState().NumberOfSiblingColumns=1;node.getState().NumberOfSiblingRows=node.getChildCount();var verticalSpacer=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,node.getElement().Id,!1);node.AddRegularChild(verticalSpacer)}},ApplyVerticalLayout:function(state,level){var node=level.BranchRoot,prevRowExterior,row,rowExterior,childBranchBottom;for(node.getLevel()===0&&(node.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(node.getState().getTop(),node.getState().getBottom())),node.getAssistantsRoot()!=null&&(OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(node.getAssistantsRoot().getState(),node.getState()),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(state,node.getAssistantsRoot())),prevRowExterior=new OrgChart.Layout.Dimensions.$ctor1(node.getState().SiblingsRowV.From,node.getAssistantsRoot()==null?node.getState().SiblingsRowV.To:node.getState().BranchExterior.getBottom()),row=0;row0&&node.getChildCount()>0){if(rect=node.getState(),this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Left)desiredLeft=rect.getCenterH()+this.ParentConnectorShield/2,diff=desiredLeft-edges.From;else if(this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Right)desiredRight=rect.getCenterH()-this.ParentConnectorShield/2,diff=desiredRight-edges.To;else throw new System.InvalidOperationException("Invalid ParentAlignment setting");OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(state,level,diff);verticalSpacer=node.getLevel()>0?System.Array.getItem(node.getChildren(),node.getChildCount()-1|0,OrgChart.Layout.BoxTree.Node):null;verticalSpacer!=null&&(spacerTop=node.getState().getBottom(),spacerBottom=System.Array.getItem(node.getChildren(),node.getChildCount()-2|0,OrgChart.Layout.BoxTree.Node).getState().getBottom(),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(verticalSpacer.getState(),rect.getCenterH()-this.ParentConnectorShield/2,spacerTop,this.ParentConnectorShield,spacerBottom-spacerTop),state.MergeSpacer(verticalSpacer))}},EnumerateColumn:function(branchRoot){for(var $yield=[],i=0;i0&&this.Orientation!==OrgChart.Layout.StackOrientation.SingleRowHorizontal&&this.Orientation!==OrgChart.Layout.StackOrientation.SingleColumnVertical)throw new System.InvalidOperationException("Unsupported value for orientation: "+System.Enum.toString(OrgChart.Layout.StackOrientation,this.Orientation));},ApplyVerticalLayout:function(state,level){var node=level.BranchRoot,siblingsRowExterior,top,i,child,rect,i1,child1,prevRowExterior,row,rowExterior,childBranchBottom;if(node.getLevel()===0&&(node.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(node.getState().getTop(),node.getState().getBottom())),node.getState().NumberOfSiblings!==0)if(siblingsRowExterior=OrgChart.Layout.Dimensions.MinMax(),this.Orientation===OrgChart.Layout.StackOrientation.SingleRowHorizontal){for(top=node.getAssistantsRoot()==null?node.getState().SiblingsRowV.To+this.ParentChildSpacing:node.getState().BranchExterior.getBottom()+this.ParentChildSpacing,i=0;i0)if(this.Orientation===OrgChart.Layout.StackOrientation.SingleRowHorizontal){width=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight()-System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getLeft();node.getState().Size=new OrgChart.Layout.Size.$ctor1(Math.max(node.getState().Size.Width,width),node.getState().Size.Height);var center=(System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getLeft()+System.Array.getItem(node.getChildren(),node.getChildCount()-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight())/2,desiredCenter=node.getState().getCenterH(),diff=desiredCenter-center;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(state,level,diff)}else if(this.Orientation===OrgChart.Layout.StackOrientation.SingleColumnVertical){OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(state,level,node.getChildren());var center1=System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),desiredCenter1=node.getState().getCenterH(),diff1=desiredCenter1-center1;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(state,level,diff1)}},RouteConnectors:function(){}});Bridge.define("OrgChart.Test.TestDataItem",{inherits:[OrgChart.Layout.IChartDataItem],config:{properties:{Id:null,IsAssistant:!1,ParentId:null,String1:null,String2:null,Date1:null},alias:["getId","OrgChart$Layout$IChartDataItem$getId","setId","OrgChart$Layout$IChartDataItem$setId","getIsAssistant","OrgChart$Layout$IChartDataItem$getIsAssistant","setIsAssistant","OrgChart$Layout$IChartDataItem$setIsAssistant"],init:function(){this.Date1=new Date(-864e13)}}});Bridge.define("OrgChart.Test.TestDataSource",{inherits:[OrgChart.Layout.IChartDataSource],Items:null,config:{alias:["getAllDataItemIds","OrgChart$Layout$IChartDataSource$getAllDataItemIds","getGetParentKeyFunc","OrgChart$Layout$IChartDataSource$getGetParentKeyFunc","getGetDataItemFunc","OrgChart$Layout$IChartDataSource$getGetDataItemFunc"],init:function(){this.Items=new(System.Collections.Generic.Dictionary$2(String,OrgChart.Test.TestDataItem))}},getAllDataItemIds:function(){return System.Linq.Enumerable.from(this.Items.getKeys()).orderBy($asm.$.OrgChart.Test.TestDataSource.f1)},getGetParentKeyFunc:function(){return Bridge.fn.bind(this,this.GetParentKey)},getGetDataItemFunc:function(){return Bridge.fn.bind(this,this.GetDataItem)},GetParentKey:function(itemId){return this.Items.get(itemId).getParentId()},GetDataItem:function(itemId){return this.Items.get(itemId)}});Bridge.ns("OrgChart.Test.TestDataSource",$asm.$);Bridge.apply($asm.$.OrgChart.Test.TestDataSource,{f1:function(x){return x}});Bridge.define("OrgChart.Layout.MultiLineFishboneLayoutStrategy",{inherits:[OrgChart.Layout.LinearLayoutStrategy],MaxGroups:4,getSupportsAssistants:function(){return!0},PreProcessThisNode:function(state,node){var parentSpacer,i,verticalSpacer,horizontalSpacer;if(this.MaxGroups<=0)throw new System.InvalidOperationException("MaxGroups must be a positive value");if(node.getChildCount()<=(this.MaxGroups*2|0)){OrgChart.Layout.LinearLayoutStrategy.prototype.PreProcessThisNode.call(this,state,node);return}if(node.getState().NumberOfSiblings=node.getChildCount(),node.getState().NumberOfSiblings>0){for(node.getState().NumberOfSiblingColumns=this.MaxGroups,node.getState().NumberOfSiblingRows=Bridge.Int.div(node.getState().NumberOfSiblings,this.MaxGroups*2|0)|0,node.getState().NumberOfSiblings%(this.MaxGroups*2|0)!=0&&(node.getState().NumberOfSiblingRows=node.getState().NumberOfSiblingRows+1|0),parentSpacer=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,node.getElement().Id,!1),node.AddRegularChild(parentSpacer),i=0;i1&&(horizontalSpacer=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,node.getElement().Id,!1),node.AddRegularChild(horizontalSpacer))}},ApplyVerticalLayout:function(state,level){var node=level.BranchRoot,adapter;if(node.getState().NumberOfSiblings<=(this.MaxGroups*2|0)){OrgChart.Layout.LinearLayoutStrategy.prototype.ApplyVerticalLayout.call(this,state,level);return}for(node.getLevel()===0&&(node.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(node.getState().getTop(),node.getState().getBottom())),node.getAssistantsRoot()!=null&&(OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(node.getAssistantsRoot().getState(),node.getState()),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(state,node.getAssistantsRoot())),adapter=new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter(node);adapter.NextGroup();)OrgChart.Layout.LayoutAlgorithm.VerticalLayout(state,adapter.SpecialRoot)},ApplyHorizontalLayout:function(state,level){var node=level.BranchRoot,adapter,rect,diff,carrier,desiredCenter1,ix,verticalSpacer;if(node.getState().NumberOfSiblings<=(this.MaxGroups*2|0)){OrgChart.Layout.LinearLayoutStrategy.prototype.ApplyHorizontalLayout.call(this,state,level);return}for(node.getLevel()===0&&(node.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(node.getState().getTop(),node.getState().getBottom())),node.getAssistantsRoot()!=null&&OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(state,node.getAssistantsRoot()),adapter=new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter(node);adapter.NextGroup();)OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(state,adapter.SpecialRoot);if(rect=node.getState(),node.getLevel()>0){if(node.getState().NumberOfSiblingColumns>1){var leftCarrier=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings+1|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),rightCarrier=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings+node.getState().NumberOfSiblingColumns|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),desiredCenter=node.getState().NumberOfSiblings===1||this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Center?leftCarrier+(rightCarrier-leftCarrier)/2:this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Left?leftCarrier+this.ChildConnectorHookLength:rightCarrier-this.ChildConnectorHookLength;diff=rect.getCenterH()-desiredCenter}else carrier=System.Array.getItem(node.getChildren(),1+node.getState().NumberOfSiblings|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),desiredCenter1=rect.getCenterH(),diff=desiredCenter1-carrier;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(state,level,diff)}if(node.getLevel()>0&&(ix=node.getState().NumberOfSiblings,verticalSpacer=System.Array.getItem(node.getChildren(),ix,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(verticalSpacer.getState(),rect.getCenterH()-this.ParentConnectorShield/2,rect.getBottom(),this.ParentConnectorShield,System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-rect.getBottom()),state.MergeSpacer(verticalSpacer),ix=ix+1|0,ix=ix+node.getState().NumberOfSiblingColumns|0,node.getState().NumberOfSiblingColumns>1)){var horizontalSpacer=System.Array.getItem(node.getChildren(),ix,OrgChart.Layout.BoxTree.Node),leftmost=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings+1|0,OrgChart.Layout.BoxTree.Node).getState().TopLeft,rightmost=System.Array.getItem(node.getChildren(),ix-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight();OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(horizontalSpacer.getState(),leftmost.X,leftmost.Y-this.ParentChildSpacing,rightmost-leftmost.X,this.ParentChildSpacing);state.MergeSpacer(horizontalSpacer)}},RouteConnectors:function(state,node){var count,iterator,i,to,y,leftGroup,rightGroup;if(node.getState().NumberOfSiblings<=(this.MaxGroups*2|0)){OrgChart.Layout.LinearLayoutStrategy.prototype.RouteConnectors.call(this,state,node);return}count=(1+node.getState().NumberOfSiblings|0)+node.getState().NumberOfSiblingColumns|0;node.getState().NumberOfSiblingColumns>1&&(count=count+1|0);var segments=System.Array.init(count,function(){return new OrgChart.Layout.Edge}),rootRect=node.getState(),center=rootRect.getCenterH(),ix=0,space=System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-rootRect.getBottom();for(segments[Bridge.identity(ix,ix=ix+1|0)]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(center,rootRect.getBottom()),new OrgChart.Layout.Point.$ctor1(center,rootRect.getBottom()+space-this.ChildConnectorHookLength)),iterator=new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter.GroupIterator(node.getState().NumberOfSiblings,node.getState().NumberOfSiblingColumns);iterator.NextGroup();){var carrier=System.Array.getItem(node.getChildren(),(1+node.getState().NumberOfSiblings|0)+iterator.Group|0,OrgChart.Layout.BoxTree.Node).getState(),from=carrier.getCenterH(),isLeft=!0,countOnThisSide=0;for(i=iterator.FromIndex;i<(iterator.FromIndex+iterator.Count|0);i=i+1|0)to=isLeft?System.Array.getItem(node.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getRight():System.Array.getItem(node.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getLeft(),y=System.Array.getItem(node.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getCenterV(),segments[Bridge.identity(ix,ix=ix+1|0)]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(from,y),new OrgChart.Layout.Point.$ctor1(to,y)),(countOnThisSide=countOnThisSide+1|0)===iterator.MaxOnLeft&&(countOnThisSide=0,isLeft&&(segments[(1+node.getState().NumberOfSiblings|0)+iterator.Group|0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(carrier.getCenterH(),carrier.getTop()-this.ChildConnectorHookLength),new OrgChart.Layout.Point.$ctor1(carrier.getCenterH(),System.Array.getItem(node.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getCenterV()))),isLeft=!isLeft)}ix=ix+node.getState().NumberOfSiblingColumns|0;node.getState().NumberOfSiblingColumns>1&&(leftGroup=System.Array.getItem(node.getChildren(),1+node.getState().NumberOfSiblings|0,OrgChart.Layout.BoxTree.Node).getState(),rightGroup=System.Array.getItem(node.getChildren(),((1+node.getState().NumberOfSiblings|0)+node.getState().NumberOfSiblingColumns|0)-1|0,OrgChart.Layout.BoxTree.Node).getState(),segments[ix]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(leftGroup.getCenterH(),leftGroup.getTop()-this.ChildConnectorHookLength),new OrgChart.Layout.Point.$ctor1(rightGroup.getCenterH(),rightGroup.getTop()-this.ChildConnectorHookLength)));node.getState().Connector=new OrgChart.Layout.Connector(segments)}});Bridge.define("OrgChart.Layout.MultiLineHangerLayoutStrategy",{inherits:[OrgChart.Layout.LinearLayoutStrategy],MaxSiblingsPerRow:4,getSupportsAssistants:function(){return!0},PreProcessThisNode:function(state,node){var lastRowBoxCount,ix,siblingSpacer,verticalSpacer,i,horizontalSpacer;if(this.MaxSiblingsPerRow<=0||this.MaxSiblingsPerRow%2!=0)throw new System.InvalidOperationException("MaxSiblingsPerRow must be a positive even value");if(node.getChildCount()<=this.MaxSiblingsPerRow){OrgChart.Layout.LinearLayoutStrategy.prototype.PreProcessThisNode.call(this,state,node);return}if(node.getState().NumberOfSiblings=node.getChildCount(),node.getState().NumberOfSiblings>0){for(lastRowBoxCount=node.getChildCount()%this.MaxSiblingsPerRow,node.getState().NumberOfSiblingColumns=1+this.MaxSiblingsPerRow|0,node.getState().NumberOfSiblingRows=Bridge.Int.div(node.getChildCount(),this.MaxSiblingsPerRow)|0,lastRowBoxCount!==0&&(node.getState().NumberOfSiblingRows=node.getState().NumberOfSiblingRows+1|0),node.getState().NumberOfSiblings=node.getChildCount()+node.getState().NumberOfSiblingRows|0,lastRowBoxCount>0&&lastRowBoxCount<=(Bridge.Int.div(this.MaxSiblingsPerRow,2)|0)&&(node.getState().NumberOfSiblings=node.getState().NumberOfSiblings-1|0),ix=Bridge.Int.div(this.MaxSiblingsPerRow,2)|0;ix=node.getState().NumberOfSiblings)break;child=System.Array.getItem(node.getChildren(),ix,OrgChart.Layout.BoxTree.Node);OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(state,child)}OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(state,level,this.EnumerateColumn(node,col))}var rect=node.getState(),spacer=System.Array.getItem(node.getChildren(),Bridge.Int.div(node.getState().NumberOfSiblingColumns,2)|0,OrgChart.Layout.BoxTree.Node),desiredCenter=spacer.getState().getCenterH(),diff=rect.getCenterH()-desiredCenter;for(OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(state,level,diff),verticalSpacer=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(verticalSpacer.getState(),rect.getCenterH()-this.ParentConnectorShield/2,rect.getBottom(),this.ParentConnectorShield,System.Array.getItem(node.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-rect.getBottom()),state.MergeSpacer(verticalSpacer),spacing=this.ParentChildSpacing,firstInRowIndex=0;firstInRowIndex=verticalSpacer.getState().getRight()?lastInRow.getRight()-firstInRow.getLeft():verticalSpacer.getState().getRight()-firstInRow.getLeft();OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(horizontalSpacer.getState(),firstInRow.getLeft(),firstInRow.SiblingsRowV.From-spacing,width,spacing);state.MergeSpacer(horizontalSpacer);spacing=this.SiblingSpacing}},EnumerateColumn:function(branchRoot,col){for(var ix,$yield=[],row=0;row=branchRoot.getState().NumberOfSiblings)break;$yield.push(System.Array.getItem(branchRoot.getChildren(),ix,OrgChart.Layout.BoxTree.Node))}return System.Array.toEnumerable($yield)},RouteConnectors:function(state,node){var $t,count,child,ix,i,child1,childRect,childCenter,lastChildHookIndex,firstInRowIndex,firstInRow,lastInRow;if(node.getState().NumberOfSiblings<=this.MaxSiblingsPerRow){OrgChart.Layout.LinearLayoutStrategy.prototype.RouteConnectors.call(this,state,node);return}for(count=1+node.getState().NumberOfSiblingRows|0,$t=Bridge.getEnumerator(node.getChildren(),OrgChart.Layout.BoxTree.Node);$t.moveNext();)child=$t.getCurrent(),child.getElement().IsSpecial||(count=count+1|0);var segments=System.Array.init(count,function(){return new OrgChart.Layout.Edge}),rootRect=node.getState(),center=rootRect.getCenterH(),verticalCarrierHeight=System.Array.getItem(node.getChildren(),node.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-this.ChildConnectorHookLength-rootRect.getBottom();for(segments[0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(center,rootRect.getBottom()),new OrgChart.Layout.Point.$ctor1(center,rootRect.getBottom()+verticalCarrierHeight)),ix=1,i=0;i