You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__User__Detail__Topics__Ex...

1206 lines
1.8 MiB

(self.webpackChunk=self.webpackChunk||[]).push([[7043],{71749:function(){"use strict"},30483:function(){"use strict"},71736:function(un,Rn){"use strict";Rn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},18023:function(){"use strict";function un(Ft,et,nt,ht){nt===void 0&&(nt=0),ht===void 0&&(ht=1/0),this._name=Ft,this._defaultValue=et,this._minimum=nt,this._maximum=ht}Object.defineProperty(un.prototype,"name",{get:function(){return this._name},set:function(Ft){if(typeof Ft!="string"||Ft==="")throw new Error("Shape name must be a valid string.");this._name=Ft}}),Object.defineProperty(un.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Ft){if(typeof Ft!="number"||isNaN(Ft))throw new Error("The default value must be a real number, not: "+Ft);this._defaultValue=Ft}}),Object.defineProperty(un.prototype,"minimum",{get:function(){return this._minimum},set:function(Ft){if(typeof Ft!="number"||isNaN(Ft))throw new Error("Minimum must be a real number, not: "+Ft);this._minimum=Ft}}),Object.defineProperty(un.prototype,"maximum",{get:function(){return this._maximum},set:function(Ft){if(typeof Ft!="number"||isNaN(Ft))throw new Error("Maximum must be a real number, not: "+Ft);this._maximum=Ft}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Ft,et){var nt=go.Shape._FigureParameters[Ft];return nt?nt[et]:null},go.Shape.setFigureParameter=function(Ft,et,nt){if(!(nt instanceof un))throw new Error("Third argument to Shape.setFigureParameter is not FigureParameter: "+nt);if(nt.defaultValue<nt.minimum||nt.defaultValue>nt.maximum)throw new Error("defaultValue must be between minimum and maximum, not: "+nt.defaultValue);var ht=go.Shape._FigureParameters[Ft];ht||(ht=[],go.Shape._FigureParameters[Ft]=ht),ht[et]=nt};var Rn=[];function Vt(Ft,et){var nt=Rn.pop();return nt===void 0?new go.Point(Ft,et):(nt.x=Ft,nt.y=et,nt)}function wt(){var Ft=Rn.pop();return Ft===void 0?new go.Point:Ft}function ue(Ft){Rn.push(Ft)}function _e(Ft,et,nt,ht,lt,pt,vt,kt,Et){Et||(Et=new go.Point);var Ht=Ft-nt,Zt=lt-vt,ie=NaN,le=NaN;if(Ht===0)if(Zt===0)Ft===nt&&(ie=Ft,le=et);else{var re=(pt-kt)/Zt,Ge=pt-re*lt;ie=Ft,le=re*ie+Ge}else if(Zt===0){var fe=(et-ht)/Ht,Ke=et-fe*Ft;ie=lt,le=fe*ie+Ke}else{var fe=(et-ht)/Ht,re=(pt-kt)/Zt,Ke=et-fe*Ft,Ge=pt-re*lt;ie=(Ge-Ke)/(fe-re),le=fe*ie+Ke}return Et.x=ie,Et.y=le,Et}function $e(Ft,et,nt,ht,lt,pt,vt,kt,Et,Ht,Zt,ie,le,re){var Ge=1-Et,fe=Et,Ke=Ft*Ge+nt*fe,an=et*Ge+ht*fe,nn=nt*Ge+lt*fe,Si=ht*Ge+pt*fe,oi=lt*Ge+vt*fe,Bi=pt*Ge+kt*fe,so=Ke*Ge+nn*fe,Qt=an*Ge+Si*fe,zt=nn*Ge+oi*fe,He=Si*Ge+Bi*fe,En=so*Ge+zt*fe,Fn=Qt*Ge+He*fe;Ht.x=Ke,Ht.y=an,Zt.x=so,Zt.y=Qt,ie.x=En,ie.y=Fn,le.x=zt,le.y=He,re.x=oi,re.y=Bi}var ye=new go.Spot(.156,.156),oe=new go.Spot(.844,.844),Yt=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new un("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=5),ht=Math.min(ht,et/3),ht=Math.min(ht,nt/3);var lt=ht*Yt,pt=new go.Geometry().add(new go.PathFigure(ht,0,!0).add(new go.PathSegment(go.PathSegment.Line,et-ht,0)).add(new go.PathSegment(go.PathSegment.Bezier,et,ht,et-lt,0,et,lt)).add(new go.PathSegment(go.PathSegment.Line,et,nt-ht)).add(new go.PathSegment(go.PathSegment.Bezier,et-ht,nt,et,nt-lt,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,ht,nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ht,lt,nt,0,nt-lt)).add(new go.PathSegment(go.PathSegment.Line,0,ht)).add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,lt,lt,0).close()));return lt>1&&(pt.spot1=new go.Spot(0,0,lt,lt),pt.spot2=new go.Spot(1,1,-lt,-lt)),pt}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(0,.25,.5,.75)}),go.Shape.defineFigureGenerator("TriangleDown",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt).close())).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("TriangleLeft",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(et,nt).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,0).close())).setSpots(.5,.25,1,.75)}),go.Shape.defineFigureGenerator("TriangleUp",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(et,nt).add(new go.PathSegment(go.PathSegment.Line,0,nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,0).close())).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("Triangle","TriangleUp"),go.Shape.defineFigureGenerator("Diamond",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,0).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt).close())).setSpots(.25,.25,.75,.75)}),go.Shape.defineFigureGenerator("LineH",function(Ft,et,nt){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=nt/2,ht.endX=et,ht.endY=nt/2,ht}),go.Shape.defineFigureGenerator("LineV",function(Ft,et,nt){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=et/2,ht.startY=0,ht.endX=et/2,ht.endY=nt,ht}),go.Shape.defineFigureGenerator("BarH","Rectangle"),go.Shape.defineFigureGenerator("BarV","Rectangle"),go.Shape.defineFigureGenerator("MinusLine","LineH"),go.Shape.defineFigureGenerator("PlusLine",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt/2,!1).add(new go.PathSegment(go.PathSegment.Line,et,nt/2)).add(new go.PathSegment(go.PathSegment.Move,et/2,0)).add(new go.PathSegment(go.PathSegment.Line,et/2,nt)))}),go.Shape.defineFigureGenerator("XLine",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,0,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)))}),go.Shape.defineFigureGenerator("LineRight",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.25*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,.75*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.25*et,nt)))}),go.Shape.defineFigureGenerator("LineDown",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,.25*nt,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,.75*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)))}),go.Shape.defineFigureGenerator("LineLeft",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.75*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,.25*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.75*et,nt)))}),go.Shape.defineFigureGenerator("LineUp",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,.75*nt,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,.25*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)))}),go.Shape.defineFigureGenerator("AsteriskLine",function(Ft,et,nt){var ht=.2/Math.SQRT2;return new go.Geometry().add(new go.PathFigure(ht*et,(1-ht)*nt,!1).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*et,ht*nt)).add(new go.PathSegment(go.PathSegment.Move,ht*et,ht*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*et,(1-ht)*nt)).add(new go.PathSegment(go.PathSegment.Move,0,nt/2)).add(new go.PathSegment(go.PathSegment.Line,et,nt/2)).add(new go.PathSegment(go.PathSegment.Move,et/2,0)).add(new go.PathSegment(go.PathSegment.Line,et/2,nt)))}),go.Shape.defineFigureGenerator("CircleLine",function(Ft,et,nt){var ht=et/2,lt=new go.Geometry().add(new go.PathFigure(et,et/2,!1).add(new go.PathSegment(go.PathSegment.Arc,0,360,ht,ht,ht,ht).close()));return lt.spot1=ye,lt.spot2=oe,lt.defaultStretch=go.GraphObject.Uniform,lt}),go.Shape.defineFigureGenerator("Line1",function(Ft,et,nt){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=0,ht.endX=et,ht.endY=nt,ht}),go.Shape.defineFigureGenerator("Line2",function(Ft,et,nt){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=et,ht.startY=0,ht.endX=0,ht.endY=nt,ht}),go.Shape.defineFigureGenerator("Curve1",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,et,nt,Yt*et,0,et,(1-Yt)*nt)))}),go.Shape.defineFigureGenerator("Curve2",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,et,nt,0,Yt*nt,(1-Yt)*et,nt)))}),go.Shape.defineFigureGenerator("Curve3",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,Yt*nt,Yt*et,nt)))}),go.Shape.defineFigureGenerator("Curve4",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,(1-Yt)*et,0,0,(1-Yt)*nt)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(0,.5,.5,1)}),go.Shape.defineFigureGenerator("TriangleDownRight",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(.5,.5,1,1)}),go.Shape.defineFigureGenerator("TriangleUpLeft",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(0,0,.5,.5)}),go.Shape.defineFigureGenerator("TriangleUpRight",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt).close())).setSpots(.5,0,1,.5)}),go.Shape.defineFigureGenerator("RightTriangle","TriangleDownLeft"),go.Shape.setFigureParameter("Parallelogram1",0,new un("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)?ht=.1:ht<-1?ht=-1:ht>1&&(ht=1);var lt=Math.abs(ht)*et;if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new un("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)?ht=10:ht<-et?ht=-et:ht>et&&(ht=et);var lt=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.setFigureParameter("Trapezoid1",0,new un("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)?ht=.2:ht<.5?ht=-.5:ht>.5&&(ht=.5);var lt=Math.abs(ht)*et;if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new un("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)?ht=20:ht<-et?ht=-et/2:ht>et&&(ht=et/2);var lt=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.setFigureParameter("ManualOperation",0,new un("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)?ht=10:ht<-et?ht=-et/2:ht>et&&(ht=et/2);var lt=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())):pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}});var Ne=[];function ge(){var Ft=Ne.pop();return Ft===void 0?[]:Ft}function we(Ft){Ft.length=0,Ne.push(Ft)}function Ye(Ft){for(var et=ge(),nt=.5,ht=.5,lt=Math.PI*1.5,pt=0,vt=0;vt<Ft;vt++)pt=2*Math.PI/Ft*vt+lt,et[vt]=new go.Point(ht+nt*Math.cos(pt),ht+nt*Math.sin(pt));return et.push(et[0]),et}function Be(Ft){var et=on(Ft),nt=ge();nt[0]=et[0];for(var ht=1,lt=1;ht<et.length;ht+=2,lt+=3)nt[lt]=et[ht],nt[lt+1]=et[ht],nt[lt+2]=et[ht+1];return we(et),nt}function on(Ft){for(var et=Ye(Ft),nt=ge(),ht=Math.floor(et.length/2),lt=et.length-1,pt=Ft%2===0?2:1,vt=0;vt<lt;vt++){var kt=et[vt],Et=et[vt+1],Ht=et[(ht+vt-1)%lt],Zt=et[(ht+vt+pt)%lt];nt[vt*2]=kt,nt[vt*2+1]=_e(kt.x,kt.y,Ht.x,Ht.y,Et.x,Et.y,Zt.x,Zt.y,new go.Point)}return nt[nt.length]=nt[0],we(et),nt}go.Shape.defineFigureGenerator("Pentagon",function(Ft,et,nt){var ht=Ye(5),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<5;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.2,.22),lt.spot2=new go.Spot(.8,.9),lt}),go.Shape.defineFigureGenerator("Hexagon",function(Ft,et,nt){var ht=Ye(6),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<6;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.07,.25),lt.spot2=new go.Spot(.93,.75),lt}),go.Shape.defineFigureGenerator("Heptagon",function(Ft,et,nt){var ht=Ye(7),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<7;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.2,.15),lt.spot2=new go.Spot(.8,.85),lt}),go.Shape.defineFigureGenerator("Octagon",function(Ft,et,nt){var ht=Ye(8),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<8;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.15,.15),lt.spot2=new go.Spot(.85,.85),lt}),go.Shape.defineFigureGenerator("Nonagon",function(Ft,et,nt){var ht=Ye(9),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<9;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.17,.13),lt.spot2=new go.Spot(.82,.82),lt}),go.Shape.defineFigureGenerator("Decagon",function(Ft,et,nt){var ht=Ye(10),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("Dodecagon",function(Ft,et,nt){var ht=Ye(12),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("FivePointedStar",function(Ft,et,nt){var ht=on(5),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.266,.333),lt.spot2=new go.Spot(.733,.733),lt}),go.Shape.defineFigureGenerator("SixPointedStar",function(Ft,et,nt){var ht=on(6),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.17,.25),lt.spot2=new go.Spot(.83,.75),lt}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Ft,et,nt){var ht=on(7),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<14;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("EightPointedStar",function(Ft,et,nt){var ht=on(8),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<16;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.25,.25),lt.spot2=new go.Spot(.75,.75),lt}),go.Shape.defineFigureGenerator("NinePointedStar",function(Ft,et,nt){var ht=on(9),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<18;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("TenPointedStar",function(Ft,et,nt){var ht=on(10),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<20;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*et,ht[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*et,ht[0].y*nt).close()),we(ht),lt.spot1=new go.Spot(.281,.261),lt.spot2=new go.Spot(.723,.748),lt}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Ft,et,nt){var ht=Be(5),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*et,ht[vt+2].y*nt,ht[vt].x*et,ht[vt].y*nt,ht[vt+1].x*et,ht[vt+1].y*nt));return pt.segments.last().close(),we(ht),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Ft,et,nt){var ht=Be(6),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*et,ht[vt+2].y*nt,ht[vt].x*et,ht[vt].y*nt,ht[vt+1].x*et,ht[vt+1].y*nt));return pt.segments.last().close(),we(ht),lt.spot1=new go.Spot(.17,.222),lt.spot2=new go.Spot(.833,.777),lt}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Ft,et,nt){var ht=Be(7),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*et,ht[vt+2].y*nt,ht[vt].x*et,ht[vt].y*nt,ht[vt+1].x*et,ht[vt+1].y*nt));return pt.segments.last().close(),we(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Ft,et,nt){var ht=Be(8),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*et,ht[vt+2].y*nt,ht[vt].x*et,ht[vt].y*nt,ht[vt+1].x*et,ht[vt+1].y*nt));return pt.segments.last().close(),we(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Ft,et,nt){var ht=Be(9),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*et,ht[vt+2].y*nt,ht[vt].x*et,ht[vt].y*nt,ht[vt+1].x*et,ht[vt+1].y*nt));return pt.segments.last().close(),we(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Ft,et,nt){var ht=Be(10),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*et,ht[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*et,ht[vt+2].y*nt,ht[vt].x*et,ht[vt].y*nt,ht[vt+1].x*et,ht[vt+1].y*nt));return pt.segments.last().close(),we(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.setFigureParameter("FramedRectangle",0,new un("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new un("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN,lt=Ft?Ft.parameter2:NaN;isNaN(ht)&&(ht=8),isNaN(lt)&&(lt=8);var pt=new go.Geometry,vt=new go.PathFigure(0,0,!0);return pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht<et/2&&lt<nt/2&&(vt.add(new go.PathSegment(go.PathSegment.Move,ht,lt)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Line,et-ht,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Line,et-ht,lt).close())),pt.setSpots(0,0,1,1,ht,lt,-ht,-lt),pt}),go.Shape.setFigureParameter("Ring",0,new un("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=8);var lt=et/2,pt=new go.Geometry,vt=new go.PathFigure(et,et/2,!0);pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Arc,0,360,lt,lt,lt,lt).close());var kt=Math.max(lt-ht,0);return kt>0&&(vt.add(new go.PathSegment(go.PathSegment.Move,et/2+kt,et/2)),vt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,lt,lt,kt,kt).close())),pt.spot1=ye,pt.spot2=oe,pt.defaultStretch=go.GraphObject.Uniform,pt}),go.Shape.defineFigureGenerator("Cloud",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.08034461*et,.1944299*nt,!0).add(new go.PathSegment(go.PathSegment.Bezier,.2008615*et,.05349299*nt,-.09239631*et,.07836421*nt,.1406031*et,-.0542823*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.4338609*et,.074219*nt,.2450511*et,-.00697547*nt,.3776197*et,-.01112067*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.6558228*et,.07004196*nt,.4539471*et,0,.6066018*et,-.02526587*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.8921095*et,.08370865*nt,.6914277*et,-.01904177*nt,.8921095*et,-.01220843*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.9147671*et,.3194596*nt,1.036446*et,.04105738*nt,1.020377*et,.3022052*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.9082935*et,.562044*nt,1.04448*et,.360238*nt,.992256*et,.5219009*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.9212406*et,.8217117*nt,1.032337*et,.5771781*nt,1.018411*et,.8120651*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.7592566*et,.9156953*nt,1.028411*et,.9571472*nt,.8556702*et,1.052487*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5101666*et,.9310455*nt,.7431877*et,1.009325*nt,.5624123*et,1.021761*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.2609328*et,.9344623*nt,.4820677*et,1.031761*nt,.3030112*et,1.002796*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*et,.870098*nt,.2329994*et,1.01518*nt,.03213784*et,1.01518*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.06829292*et,.6545475*nt,-.02812061*et,.9032597*nt,-.01205169*et,.6835638*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.06427569*et,.4265613*nt,-.01812061*et,.6089503*nt,-.00606892*et,.4555777*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*et,.1944299*nt,-.01606892*et,.3892545*nt,-.01205169*et,.1944299*nt))).setSpots(.1,.1,.9,.9)}),go.Shape.defineFigureGenerator("StopSign",function(Ft,et,nt){var ht=1/(Math.SQRT2+2);return new go.Geometry().add(new go.PathFigure(ht*et,0,!0).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*et,0)).add(new go.PathSegment(go.PathSegment.Line,et,ht*nt)).add(new go.PathSegment(go.PathSegment.Line,et,(1-ht)*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*et,nt)).add(new go.PathSegment(go.PathSegment.Line,ht*et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*nt)).add(new go.PathSegment(go.PathSegment.Line,0,ht*nt).close())).setSpots(ht/2,ht/2,1-ht/2,1-ht/2)}),go.Shape.setFigureParameter("Pie",0,new un("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new un("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN,lt=Ft?Ft.parameter2:NaN;isNaN(ht)&&(ht=0),isNaN(lt)&&(lt=315);var pt=ht%360;pt<0&&(pt+=360);var vt=lt%360,kt=Math.min(et,nt)/2;return new go.Geometry().add(new go.PathFigure(kt,kt).add(new go.PathSegment(go.PathSegment.Arc,pt,vt,kt,kt,kt,kt).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Ft,et,nt){var ht=Yt/Math.SQRT2*.5,lt=Math.SQRT2/2,pt=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(et,nt,!0).add(new go.PathSegment(go.PathSegment.Bezier,lt*et,pt*nt,et,(1-ht)*nt,(lt+ht)*et,(pt+ht)*nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close()))}),go.Shape.setFigureParameter("ThickCross",0,new un("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30);var lt=Math.min(ht,et)/2,pt=et/2,vt=nt/2;return new go.Geometry().add(new go.PathFigure(pt-lt,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+lt,0)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt-lt).close()))}),go.Shape.setFigureParameter("ThinCross",0,new un("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var lt=Math.min(ht,et)/2,pt=et/2,vt=nt/2;return new go.Geometry().add(new go.PathFigure(pt-lt,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+lt,0)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt-lt).close()))}),go.Shape.setFigureParameter("ThickX",0,new un("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;if((isNaN(ht)||ht<0)&&(ht=30),et===0||nt===0){var lt=new go.Geometry(go.Geometry.Rectangle);return lt.startX=0,lt.startY=0,lt.endX=et,lt.endY=nt,lt}else{var pt=et/2,vt=nt/2,kt=Math.atan2(nt,et),Et=ht-Math.min(Math.cos(kt)*ht/2,pt),Ht=ht-Math.min(Math.sin(kt)*ht/2,vt),lt=new go.Geometry,Zt=new go.PathFigure(Et,0,!0);return lt.add(Zt),Zt.add(new go.PathSegment(go.PathSegment.Line,pt,.2*nt)),Zt.add(new go.PathSegment(go.PathSegment.Line,et-Et,0)),Zt.add(new go.PathSegment(go.PathSegment.Line,et,Ht)),Zt.add(new go.PathSegment(go.PathSegment.Line,.8*et,vt)),Zt.add(new go.PathSegment(go.PathSegment.Line,et,nt-Ht)),Zt.add(new go.PathSegment(go.PathSegment.Line,et-Et,nt)),Zt.add(new go.PathSegment(go.PathSegment.Line,pt,.8*nt)),Zt.add(new go.PathSegment(go.PathSegment.Line,Et,nt)),Zt.add(new go.PathSegment(go.PathSegment.Line,0,nt-Ht)),Zt.add(new go.PathSegment(go.PathSegment.Line,.2*et,vt)),Zt.add(new go.PathSegment(go.PathSegment.Line,0,Ht).close()),lt}}),go.Shape.setFigureParameter("ThinX",0,new un("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var lt=new go.Geometry,pt=new go.PathFigure(.1*et,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.9*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt).close()),lt}),go.Shape.setFigureParameter("SquareIBeam",0,new un("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.2);var lt=new go.Geometry,pt=new go.PathFigure(0,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,ht*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*et,ht*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*et,(1-ht)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,(1-ht)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*et,(1-ht)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*et,ht*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*nt).close()),lt}),go.Shape.setFigureParameter("RoundedIBeam",0,new un("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.5);var lt=new go.Geometry,pt=new go.PathFigure(0,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,nt,Math.abs(1-ht)*et,.25*nt,Math.abs(1-ht)*et,.75*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*et,.75*nt,ht*et,.25*nt).close()),lt}),go.Shape.defineFigureGenerator("HalfEllipse",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,Yt*et,0,et,(.5-Yt/2)*nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,(.5+Yt/2)*nt,Yt*et,nt).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,0,et,nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.5*et,.75*nt,.5*et,.25*nt).close())).setSpots(.311,.266,.744,.744)}),go.Shape.defineFigureGenerator("Heart",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,nt,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,.3*nt,.1*et,.8*nt,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,0,0,.45*et,0)).add(new go.PathSegment(go.PathSegment.Bezier,et,.3*nt,.55*et,0,et,0)).add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,.5*nt,.9*et,.8*nt).close())).setSpots(.14,.29,.86,.78)}),go.Shape.defineFigureGenerator("Spade",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,0,!0).add(new go.PathSegment(go.PathSegment.Line,.51*et,.01*nt)).add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,.6*et,.2*nt,et,.25*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.55*et,.7*nt,et,.8*nt,.6*et,.8*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.75*et,nt,.5*et,.75*nt,.55*et,.95*nt)).add(new go.PathSegment(go.PathSegment.Line,.25*et,nt)).add(new go.PathSegment(go.PathSegment.Bezier,.45*et,.7*nt,.45*et,.95*nt,.5*et,.75*nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,.4*et,.8*nt,0,.8*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.49*et,.01*nt,0,.25*nt,.4*et,.2*nt).close())).setSpots(.14,.26,.86,.78)}),go.Shape.defineFigureGenerator("Club",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.4*et,.6*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.15*et,nt,.5*et,.75*nt,.45*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.6*et,.6*nt,.55*et,.95*nt,.5*et,.75*nt));var pt=.2,vt=.3,kt=0,Et=pt*Yt;return lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5+pt+kt)*nt,(.5-pt+vt)*et,(.5+Et+kt)*nt,(.5-Et+vt)*et,(.5+pt+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*et,(.5+kt)*nt,(.5+Et+vt)*et,(.5+pt+kt)*nt,(.5+pt+vt)*et,(.5+Et+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+kt)*nt,(1-.5+pt+vt)*et,(.5-Et+kt)*nt,(.5+Et+vt)*et,(.5-pt+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.65*et,.36771243*nt,(.5-Et+vt)*et,(.5-pt+kt)*nt,(.5-pt+vt+.05)*et,(.5-Et+kt-.02)*nt)),pt=.2,vt=0,kt=-.3,Et=pt*Yt,lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*et,(.5+kt)*nt,(.5+Et+vt)*et,(.5+pt+kt)*nt,(.5+pt+vt)*et,(.5+Et+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+kt)*nt,(1-.5+pt+vt)*et,(.5-Et+kt)*nt,(.5+Et+vt)*et,(.5-pt+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*et,(.5+kt)*nt,(.5-Et+vt)*et,(.5-pt+kt)*nt,(.5-pt+vt)*et,(.5-Et+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Et+vt)*et,(.5+pt+kt)*nt,(.5-pt+vt)*et,(.5+Et+kt)*nt,(.5-Et+vt)*et,(.5+pt+kt)*nt)),pt=.2,vt=-.3,kt=0,Et=pt*Yt,lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+kt)*nt,(1-.5+pt+vt-.05)*et,(.5-Et+kt-.02)*nt,(.5+Et+vt)*et,(.5-pt+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*et,(.5+kt)*nt,(.5-Et+vt)*et,(.5-pt+kt)*nt,(.5-pt+vt)*et,(.5-Et+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5+pt+kt)*nt,(.5-pt+vt)*et,(.5+Et+kt)*nt,(.5-Et+vt)*et,(.5+pt+kt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,.6*nt,(.5+Et+vt)*et,(.5+pt+kt)*nt,(.5+pt+vt)*et,(.5+Et+kt)*nt).close()),ht.setSpots(.06,.33,.93,.68),ht}),go.Shape.defineFigureGenerator("YinYang",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*.5,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,et*.5,et*.5,et*.5,et*.5)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,-180,et*.5,et*.75,et*.25,et*.25)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,180,et*.5,et*.25,et*.25,et*.25));var pt=.1,vt=.5,kt=.25;return lt.add(new go.PathSegment(go.PathSegment.Move,(vt+pt)*et,kt*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,et*vt,nt*kt,pt*et,pt*et).close()),lt=new go.PathFigure(et*.5,0,!1),ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,et*.5,et*.5,et*.5,et*.5)),kt=.75,lt=new go.PathFigure((vt+pt)*et,kt*nt,!0),ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,0,360,et*vt,nt*kt,pt*et,pt*et).close()),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Peace",function(Ft,et,nt){var ht=.8535533905932737,lt=.5*et,pt=.5*nt;return new go.Geometry().add(new go.PathFigure(lt,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,lt,pt,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt)).add(new go.PathSegment(go.PathSegment.Move,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*et,ht*nt)).add(new go.PathSegment(go.PathSegment.Move,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,ht*et,ht*nt)))}),go.Shape.defineFigureGenerator("NotAllowed",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=.5,vt=.5,kt=.5,Et=new go.PathFigure(vt*et,(kt-pt)*nt);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-pt)*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt)),pt=.4,lt=Yt*.4;var Ht=wt(),Zt=wt(),ie=wt(),le=wt();$e(vt,kt-pt,vt+lt,kt-pt,vt+pt,kt-lt,vt+pt,kt,.42,Ht,Zt,ie,le,le);var re=wt(),Ge=wt(),fe=wt();$e(vt,kt-pt,vt+lt,kt-pt,vt+pt,kt-lt,vt+pt,kt,.58,le,le,fe,re,Ge);var Ke=wt(),an=wt(),nn=wt();$e(vt,kt+pt,vt-lt,kt+pt,vt-pt,kt+lt,vt-pt,kt,.42,Ke,an,nn,le,le);var Si=wt(),oi=wt(),Bi=wt();return $e(vt,kt+pt,vt-lt,kt+pt,vt-pt,kt+lt,vt-pt,kt,.58,le,le,Bi,Si,oi),Et.add(new go.PathSegment(go.PathSegment.Move,Bi.x*et,Bi.y*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,Si.x*et,Si.y*nt,oi.x*et,oi.y*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,ie.x*et,ie.y*nt,Ht.x*et,Ht.y*nt,Zt.x*et,Zt.y*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,Bi.x*et,Bi.y*nt).close()),Et.add(new go.PathSegment(go.PathSegment.Move,nn.x*et,nn.y*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,fe.x*et,fe.y*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,re.x*et,re.y*nt,Ge.x*et,Ge.y*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,nn.x*et,nn.y*nt,Ke.x*et,Ke.y*nt,an.x*et,an.y*nt).close()),ue(Ht),ue(Zt),ue(ie),ue(le),ue(re),ue(Ge),ue(fe),ue(Ke),ue(an),ue(nn),ue(Si),ue(oi),ue(Bi),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Fragile",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.25*et,0)).add(new go.PathSegment(go.PathSegment.Line,.2*et,.15*nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.25*nt)).add(new go.PathSegment(go.PathSegment.Line,.29*et,.33*nt)).add(new go.PathSegment(go.PathSegment.Line,.35*et,.25*nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.15*nt)).add(new go.PathSegment(go.PathSegment.Line,.4*et,0)).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Bezier,.55*et,.5*nt,et,.25*nt,.75*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.55*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.45*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.45*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.5*nt,0,.25*nt).close()))}),go.Shape.setFigureParameter("HourGlass",0,new un("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30),ht>et&&(ht=et);var lt=(et-ht)/2,pt=lt+ht;return new go.Geometry().add(new go.PathFigure(pt,.5*nt).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,0,0)).add(new go.PathSegment(go.PathSegment.Line,et,0).close()))}),go.Shape.defineFigureGenerator("Lightning",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,.55*nt).add(new go.PathSegment(go.PathSegment.Line,.6*et,0)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.45*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.45*nt)).add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.55*nt).close()))}),go.Shape.defineFigureGenerator("GenderMale",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.4,pt=.4,vt=.5,kt=.5,Et=wt(),Ht=wt(),Zt=wt(),ie=wt(),le=new go.PathFigure((vt-pt)*et,kt*nt,!1);ht.add(le),le.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt)),$e(vt,kt-pt,vt+lt,kt-pt,vt+pt,kt-lt,vt+pt,kt,.44,Zt,ie,Ht,Et,Et),le.add(new go.PathSegment(go.PathSegment.Bezier,Ht.x*et,Ht.y*nt,Zt.x*et,Zt.y*nt,ie.x*et,ie.y*nt));var re=Vt(Ht.x,Ht.y);$e(vt,kt-pt,vt+lt,kt-pt,vt+pt,kt-lt,vt+pt,kt,.56,Et,Et,Ht,Zt,ie);var Ge=Vt(Ht.x,Ht.y);le.add(new go.PathSegment(go.PathSegment.Line,(re.x*.1+.95*.9)*et,re.y*.1*nt)),le.add(new go.PathSegment(go.PathSegment.Line,.85*et,re.y*.1*nt)),le.add(new go.PathSegment(go.PathSegment.Line,.85*et,0)),le.add(new go.PathSegment(go.PathSegment.Line,et,0)),le.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),le.add(new go.PathSegment(go.PathSegment.Line,(Ge.x*.1+.9)*et,.15*nt)),le.add(new go.PathSegment(go.PathSegment.Line,(Ge.x*.1+.9)*et,(Ge.y*.1+.05*.9)*nt)),le.add(new go.PathSegment(go.PathSegment.Line,Ge.x*et,Ge.y*nt)),le.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,Zt.x*et,Zt.y*nt,ie.x*et,ie.y*nt)),le.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt)),le.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,(vt-lt)*et,(kt+pt)*nt,(vt-pt)*et,(kt+lt)*nt)),pt=.35,lt=Yt*.35;var fe=new go.PathFigure(vt*et,(kt-pt)*nt,!1);ht.add(fe),fe.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),fe.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt)),fe.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),fe.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-pt)*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt));var Ke=new go.PathFigure((vt-pt)*et,kt*nt,!1);return ht.add(Ke),ue(Et),ue(Ht),ue(Zt),ue(ie),ue(re),ue(Ge),ht.spot1=new go.Spot(.202,.257),ht.spot2=new go.Spot(.792,.739),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("GenderFemale",function(Ft,et,nt){var ht=new go.Geometry,lt=.375,pt=0,vt=-.125,kt=lt*Yt,Et=new go.PathFigure((.525+pt)*et,(.5+lt+vt)*nt,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*et,(.5+vt)*nt,(.5+kt+pt)*et,(.5+lt+vt)*nt,(.5+lt+pt)*et,(.5+kt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5-lt+vt)*nt,(1-.5+lt+pt)*et,(.5-kt+vt)*nt,(.5+kt+pt)*et,(.5-lt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-kt+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-kt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.475+pt)*et,(.5+lt+vt)*nt,(.5-lt+pt)*et,(.5+kt+vt)*nt,(.5-kt+pt)*et,(.5+lt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*et,.85*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*et,.85*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*et,.9*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*et,.9*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*et,nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*et,nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*et,.9*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*et,.9*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*et,.85*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*et,.85*nt).close()),lt=.325,pt=0,vt=-.125,kt=lt*Yt;var Et=new go.PathFigure((1-.5+lt+pt)*et,(.5+vt)*nt,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5+lt+vt)*nt,(.5+lt+pt)*et,(.5+kt+vt)*nt,(.5+kt+pt)*et,(.5+lt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-kt+pt)*et,(.5+lt+vt)*nt,(.5-lt+pt)*et,(.5+kt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-kt+vt)*nt,(.5-kt+pt)*et,(.5-lt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*et,(.5+vt)*nt,(.5+kt+pt)*et,(.5-lt+vt)*nt,(1-.5+lt+pt)*et,(.5-kt+vt)*nt));var Et=new go.PathFigure((.525+pt)*et,(.5+lt+vt)*nt,!1);return ht.add(Et),ht.spot1=new go.Spot(.232,.136),ht.spot2=new go.Spot(.682,.611),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicImplies",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*et,nt)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt))).setSpots(0,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicIff",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*et,nt)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Move,ht*et,0)).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,ht*et,nt))).setSpots(.2,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicNot",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)))}),go.Shape.defineFigureGenerator("LogicAnd",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt))).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("LogicOr",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,et,0))).setSpots(.219,0,.78,.409)}),go.Shape.defineFigureGenerator("LogicXor",function(Ft,et,nt){var ht=new go.Geometry().add(new go.PathFigure(.5*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Arc,0,360,.5*et,.5*nt,.5*et,.5*nt)));return ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicTruth",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,.5*et,0)).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)))}),go.Shape.defineFigureGenerator("LogicFalsity",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Move,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,0)))}),go.Shape.defineFigureGenerator("LogicThereExists",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Move,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt)))}),go.Shape.defineFigureGenerator("LogicForAll",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,.25*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.75*et,.5*nt))).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("LogicIsDefinedAs",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Move,0,nt)).add(new go.PathSegment(go.PathSegment.Line,et,nt))).setSpots(.01,.01,.99,.49)}),go.Shape.defineFigureGenerator("LogicIntersect",function(Ft,et,nt){var ht=.5;return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,0,ht*nt)).add(new go.PathSegment(go.PathSegment.Arc,180,180,ht*et,ht*nt,ht*et,ht*nt)).add(new go.PathSegment(go.PathSegment.Line,et,nt))).setSpots(0,.5,1,1)}),go.Shape.defineFigureGenerator("LogicUnion",function(Ft,et,nt){var ht=.5;return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,ht*nt)).add(new go.PathSegment(go.PathSegment.Arc,0,180,ht*et,ht*nt,ht*et,ht*nt)).add(new go.PathSegment(go.PathSegment.Line,0,0))).setSpots(0,0,1,.5)}),go.Shape.setFigureParameter("Arrow",0,new un("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new un("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=.3);var pt=(1-ht)*et,vt=(.5-lt/2)*nt,kt=(.5+lt/2)*nt,Et=new go.Geometry,Ht=new go.PathFigure(0,vt,!0);Et.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,0)),Ht.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,kt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,kt).close()),Et.spot1=new go.Spot(0,vt/nt);var Zt=_e(0,kt/nt,1,kt/nt,pt/et,1,1,.5,wt());return Et.spot2=new go.Spot(Zt.x,Zt.y),ue(Zt),Et}),go.Shape.setFigureParameter("Arrow2",0,new un("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new un("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=30),ht>et&&(ht=et);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=30),lt=Math.min(lt,nt/2);var pt=et-ht,vt=(nt-lt)/2,kt=vt+lt,Et=new go.Geometry,Ht=new go.PathFigure(0,vt,!0);Et.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,0)),Ht.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,kt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,kt).close()),Et.spot1=new go.Spot(0,vt/nt);var Zt=_e(0,kt/nt,1,kt/nt,pt/et,1,1,.5,wt());return Et.spot2=new go.Spot(Zt.x,Zt.y),ue(Zt),Et}),go.Shape.defineFigureGenerator("Chevron",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt).close()),ht}),go.Shape.defineFigureGenerator("DoubleArrow",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.214*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,1*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.786*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,1*nt).close()),ht}),go.Shape.setFigureParameter("DoubleEndArrow",0,new un("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=(.5-ht/2)*nt,pt=(.5+ht/2)*nt,vt=new go.Geometry,kt=new go.PathFigure(et,.5*nt,!0);vt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,.3*et,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,.3*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0)),kt.add(new go.PathSegment(go.PathSegment.Line,.3*et,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close());var Et=_e(0,.5,.3,0,0,lt/nt,.1,lt/nt,wt());return vt.spot1=new go.Spot(Et.x,Et.y),Et=_e(.7,1,1,.5,0,pt/nt,1,pt/nt,Et),vt.spot2=new go.Spot(Et.x,Et.y),ue(Et),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new un("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new un("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=40);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(nt-ht)/2,vt=pt+ht,kt=(nt-lt)/2,Et=kt+lt;(ht>nt||lt>nt)&&(lt>ht?(ht=ht*nt/lt,pt=(nt-ht)/2,vt=pt+ht,kt=0,Et=nt):(pt=0,vt=nt,kt=0,Et=nt));var Ht=new go.Geometry,Zt=new go.PathFigure(et,.5*nt,!0);Ht.add(Zt),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,Et)),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,vt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.3*et,vt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.3*et,Et)),Zt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.3*et,kt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.3*et,pt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,kt).close());var ie=_e(0,.5,.3,kt/nt,0,pt/nt,1,pt/nt,wt());return Ht.spot1=new go.Spot(ie.x,ie.y),ie=_e(.7,Et/nt,1,.5,0,vt/nt,1,vt/nt,ie),Ht.spot2=new go.Spot(ie.x,ie.y),ue(ie),Ht}),go.Shape.setFigureParameter("IBeamArrow",0,new un("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=(.5-ht/2)*nt,pt=(.5+ht/2)*nt,vt=new go.Geometry,kt=new go.PathFigure(et,.5*nt,!0);vt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,.2*et,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,0)),kt.add(new go.PathSegment(go.PathSegment.Line,.2*et,0)),kt.add(new go.PathSegment(go.PathSegment.Line,.2*et,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(0,lt/nt);var Et=_e(.7,1,1,.5,0,pt/nt,1,pt/nt,wt());return vt.spot2=new go.Spot(Et.x,Et.y),ue(Et),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new un("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new un("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=40);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(nt-ht)/2,vt=pt+ht,kt=(nt-lt)/2,Et=kt+lt;(ht>nt||lt>nt)&&(lt>ht?(ht=ht*nt/lt,pt=(nt-ht)/2,vt=pt+ht,kt=0,Et=nt):(pt=0,vt=nt,kt=0,Et=nt));var Ht=new go.Geometry,Zt=new go.PathFigure(et,.5*nt,!0);Ht.add(Zt),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,Et)),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,vt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.2*et,vt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.2*et,Et)),Zt.add(new go.PathSegment(go.PathSegment.Line,0,Et)),Zt.add(new go.PathSegment(go.PathSegment.Line,0,kt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.2*et,kt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.2*et,pt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Zt.add(new go.PathSegment(go.PathSegment.Line,.7*et,kt).close()),Ht.spot1=new go.Spot(0,pt/nt);var ie=_e(.7,Et/nt,1,.5,0,vt/nt,1,vt/nt,wt());return Ht.spot2=new go.Spot(ie.x,ie.y),ue(ie),Ht}),go.Shape.setFigureParameter("Pointer",0,new un("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.1);var lt=new go.Geometry,pt=new go.PathFigure(et,.5*nt,!0);lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),lt.spot1=new go.Spot(ht,.35);var vt=_e(.2,.65,1,.65,0,1,1,.5,wt());return lt.spot2=new go.Spot(vt.x,vt.y),ue(vt),lt}),go.Shape.setFigureParameter("RoundedPointer",0,new un("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=new go.Geometry,pt=new go.PathFigure(et,.5*nt,!0);lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*et,.75*nt,ht*et,.25*nt).close()),lt.spot1=new go.Spot(ht,.35);var vt=_e(0,.65,1,.65,0,1,1,.5,wt());return lt.spot2=new go.Spot(vt.x,vt.y),ue(vt),lt}),go.Shape.setFigureParameter("SplitEndArrow",0,new un("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.4);var lt=(.5-ht/2)*nt,pt=(.5+ht/2)*nt,vt=new go.Geometry,kt=new go.PathFigure(et,.5*nt,!0);vt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(.2,.3);var Et=_e(.7,1,1,.5,0,pt/nt,1,pt/nt,wt());return vt.spot2=new go.Spot(Et.x,Et.y),ue(Et),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new un("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=50);var lt=(nt-ht)/2,pt=lt+ht;ht>nt&&(lt=0,pt=nt);var vt=new go.Geometry,kt=new go.PathFigure(et,.5*nt,!0);vt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(.2,lt/nt);var Et=_e(.7,1,1,.5,0,pt/nt,1,pt/nt,wt());return vt.spot2=new go.Spot(Et.x,Et.y),ue(Et),vt}),go.Shape.setFigureParameter("SquareArrow",0,new un("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.7);var lt=new go.Geometry,pt=new go.PathFigure(et,.5*nt,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,ht*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*et,0).close()),lt.spot1=go.Spot.TopLeft,lt.spot2=new go.Spot(ht,1),lt}),go.Shape.defineFigureGenerator("Cone1",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=Yt*.1,vt=new go.PathFigure(0,.9*nt,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.9+pt)*nt,(.5+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,(.5-lt)*et,nt,0,(.9+pt)*nt).close()),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.97),ht}),go.Shape.defineFigureGenerator("Cone2",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.9*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.9*nt,(1-.85/.9)*et,nt,.85/.9*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.9*nt).close());var pt=new go.PathFigure(0,.9*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,.9*nt,(1-.85/.9)*et,.8*nt,.85/.9*et,.8*nt)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.82),ht}),go.Shape.defineFigureGenerator("Cube1",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.85*nt).close());var pt=new go.PathFigure(.5*et,nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.15*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.5,.85),ht}),go.Shape.defineFigureGenerator("Cube2",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.3*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0).close());var pt=new go.PathFigure(0,.3*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Move,.7*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.7,1),ht}),go.Shape.defineFigureGenerator("Cylinder1",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var lt=new go.Geometry,pt=Yt*.5,vt=new go.PathFigure(0,ht,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,Yt*ht,(.5-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*et,ht,(.5+pt)*et,0,1*et,Yt*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,1*nt,1*et,nt-Yt*ht,(.5+pt)*et,1*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ht,(.5-pt)*et,1*nt,0,nt-Yt*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht));var kt=new go.PathFigure(et,ht,!1);return lt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,2*ht,1*et,2*ht-Yt*ht,(.5+pt)*et,2*ht)),kt.add(new go.PathSegment(go.PathSegment.Bezier,0,ht,(.5-pt)*et,2*ht,0,2*ht-Yt*ht)),lt.spot1=new go.Spot(0,0,0,2*ht),lt.spot2=new go.Spot(1,1),lt}),go.Shape.defineFigureGenerator("Cylinder2",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var lt=new go.Geometry,pt=Yt*.5,vt=new go.PathFigure(0,nt-ht,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,Yt*ht,(.5-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,ht,(.5+pt)*et,0,et,Yt*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,nt-Yt*ht,(.5+pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ht,(.5-pt)*et,nt,0,nt-Yt*ht));var kt=new go.PathFigure(0,nt-ht,!1);return lt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt-2*ht,0,nt-ht-Yt*ht,(.5-pt)*et,nt-2*ht)),kt.add(new go.PathSegment(go.PathSegment.Bezier,et,nt-ht,(.5+pt)*et,nt-2*ht,et,nt-ht-Yt*ht)),lt.spot1=new go.Spot(0,0),lt.spot2=new go.Spot(1,1,0,-2*ht),lt}),go.Shape.defineFigureGenerator("Cylinder3",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var lt=new go.Geometry,pt=Yt*.5,vt=new go.PathFigure(ht,0,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et-ht,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,et-Yt*ht,0,et,(.5-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-ht,nt,et,(.5+pt)*nt,et-Yt*ht,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,Yt*ht,nt,0,(.5+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*nt,Yt*ht,0));var kt=new go.PathFigure(ht,0,!1);return lt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Bezier,2*ht,.5*nt,ht+Yt*ht,0,2*ht,(.5-pt)*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,ht,nt,2*ht,(.5+pt)*nt,ht+Yt*ht,nt)),lt.spot1=new go.Spot(0,0,2*ht,0),lt.spot2=new go.Spot(1,1),lt}),go.Shape.defineFigureGenerator("Cylinder4",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var lt=new go.Geometry,pt=Yt*.5,vt=new go.PathFigure(et-ht,0,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,et-Yt*ht,0,et,(.5-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-ht,nt,et,(.5+pt)*nt,et-Yt*ht,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,Yt*ht,nt,0,(.5+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*nt,Yt*ht,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et-ht,0));var kt=new go.PathFigure(et-ht,0,!1);return lt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Bezier,et-2*ht,.5*nt,et-ht-Yt*ht,0,et-2*ht,(.5-pt)*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,et-ht,nt,et-2*ht,(.5+pt)*nt,et-ht-Yt*ht,nt)),lt.spot1=new go.Spot(0,0),lt.spot2=new go.Spot(1,1,-2*ht,0),lt}),go.Shape.defineFigureGenerator("Prism1",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.25*et,.25*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(.25*et,.25*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),ht.spot1=new go.Spot(.408,.172),ht.spot2=new go.Spot(.833,.662),ht}),go.Shape.defineFigureGenerator("Prism2",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.25*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(0,nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,0,.25*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.5*nt)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("Pyramid1",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*nt).close());var pt=new go.PathFigure(.5*et,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Pyramid2",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.85*nt).close());var pt=new go.PathFigure(.5*et,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.7*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.85*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.7*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Actor",function(Ft,et,nt){var ht=new go.Geometry,lt=.2,pt=.1,vt=Yt*lt,kt=Yt*pt,Et=.5,Ht=.1,Zt=new go.PathFigure(Et*et,(Ht+pt)*nt,!0);ht.add(Zt),Zt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-lt)*et,Ht*nt,(Et-vt)*et,(Ht+pt)*nt,(Et-lt)*et,(Ht+kt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-pt)*nt,(Et-lt)*et,(Ht-kt)*nt,(Et-vt)*et,(Ht-pt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+lt)*et,Ht*nt,(Et+vt)*et,(Ht-pt)*nt,(Et+lt)*et,(Ht-kt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht+pt)*nt,(Et+lt)*et,(Ht+kt)*nt,(Et+vt)*et,(Ht+pt)*nt));var ie=.05,le=Yt*ie;Et=.05,Ht=.25;var re=new go.PathFigure(.5*et,.2*nt,!0);return ht.add(re),re.add(new go.PathSegment(go.PathSegment.Line,.95*et,.2*nt)),Et=.95,Ht=.25,re.add(new go.PathSegment(go.PathSegment.Bezier,(Et+ie)*et,Ht*nt,(Et+le)*et,(Ht-ie)*nt,(Et+ie)*et,(Ht-le)*nt)),re.add(new go.PathSegment(go.PathSegment.Line,et,.6*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.85*et,.6*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.85*et,.35*nt)),ie=.025,le=Yt*ie,Et=.825,Ht=.35,re.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-ie)*nt,(Et+ie)*et,(Ht-le)*nt,(Et+le)*et,(Ht-ie)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Et-ie)*et,Ht*nt,(Et-le)*et,(Ht-ie)*nt,(Et-ie)*et,(Ht-le)*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),re.add(new go.PathSegment(go.PathSegment.Line,.55*et,nt)),re.add(new go.PathSegment(go.PathSegment.Line,.55*et,.7*nt)),ie=.05,le=Yt*ie,Et=.5,Ht=.7,re.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-ie)*nt,(Et+ie)*et,(Ht-le)*nt,(Et+le)*et,(Ht-ie)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Et-ie)*et,Ht*nt,(Et-le)*et,(Ht-ie)*nt,(Et-ie)*et,(Ht-le)*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.45*et,nt)),re.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),re.add(new go.PathSegment(go.PathSegment.Line,.2*et,.35*nt)),ie=.025,le=Yt*ie,Et=.175,Ht=.35,re.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-ie)*nt,(Et+ie)*et,(Ht-le)*nt,(Et+le)*et,(Ht-ie)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Et-ie)*et,Ht*nt,(Et-le)*et,(Ht-ie)*nt,(Et-ie)*et,(Ht-le)*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.15*et,.6*nt)),re.add(new go.PathSegment(go.PathSegment.Line,0,.6*nt)),re.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),ie=.05,le=Yt*ie,Et=.05,Ht=.25,re.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-ie)*nt,(Et-ie)*et,(Ht-le)*nt,(Et-le)*et,(Ht-ie)*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.5*et,.2*nt)),ht.spot1=new go.Spot(.2,.2),ht.spot2=new go.Spot(.8,.65),ht}),go.Shape.setFigureParameter("Card",0,new un("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;isNaN(ht)&&(ht=.2);var lt=new go.Geometry,pt=new go.PathFigure(et,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*et,0).close()),lt.spot1=new go.Spot(0,ht),lt.spot2=go.Spot.BottomRight,lt}),go.Shape.defineFigureGenerator("Collate",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,.5*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt));var pt=new go.PathFigure(.5*et,.5*nt,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,.25),ht}),go.Shape.defineFigureGenerator("CreateRequest",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(0,lt*nt,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,lt*nt)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,(1-lt)*nt)),ht}),go.Shape.defineFigureGenerator("Database",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=Yt*.1,vt=new go.PathFigure(et,.1*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.9+pt)*nt,(.5+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,(.5-lt)*et,nt,0,(.9+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,(.1-pt)*nt,(.5-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.1*nt,(.5+lt)*et,0,et,(.1-pt)*nt));var kt=new go.PathFigure(et,.1*nt,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,et,(.1+pt)*nt,(.5+lt)*et,.2*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*nt,(.5-lt)*et,.2*nt,0,(.1+pt)*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,et,.2*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,et,(.2+pt)*nt,(.5+lt)*et,.3*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*nt,(.5-lt)*et,.3*nt,0,(.2+pt)*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,et,.3*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.4*nt,et,(.3+pt)*nt,(.5+lt)*et,.4*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*nt,(.5-lt)*et,.4*nt,0,(.3+pt)*nt)),ht.spot1=new go.Spot(0,.4),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("DataStorage",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*et,nt,et,0,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.9*nt,.25*et,.1*nt).close()),ht.spot1=new go.Spot(.226,0),ht.spot2=new go.Spot(.81,1),ht}),go.Shape.defineFigureGenerator("DiskStorage",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=Yt*.1,vt=new go.PathFigure(et,.1*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.9+pt)*nt,(.5+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,(.5-lt)*et,nt,0,(.9+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,(.1-pt)*nt,(.5-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.1*nt,(.5+lt)*et,0,et,(.1-pt)*nt));var kt=new go.PathFigure(et,.1*nt,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,et,(.1+pt)*nt,(.5+lt)*et,.2*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*nt,(.5-lt)*et,.2*nt,0,(.1+pt)*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,et,.2*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,et,(.2+pt)*nt,(.5+lt)*et,.3*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*nt,(.5-lt)*et,.3*nt,0,(.2+pt)*nt)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("Display",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.25*et,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*et,nt,et,0,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt).close()),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("DividedEvent",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)?lt=.2:lt<.15&&(lt=.15);var pt=Yt*.2,vt=new go.PathFigure(0,.2*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,0,0,(.2-pt)*nt,(.2-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.8*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.2*nt,(.8+pt)*et,0,et,(.2-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,nt,et,(.8+pt)*nt,(.8+pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*nt,(.2-pt)*et,nt,0,(.8+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt));var kt=new go.PathFigure(0,lt*nt,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et,lt*nt)),ht}),go.Shape.defineFigureGenerator("DividedProcess",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;(isNaN(lt)||lt<.1)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(0,lt*nt,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,lt*nt)),ht}),go.Shape.defineFigureGenerator("Document",function(Ft,et,nt){var ht=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(0,.7*nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.5*et,.4*nt,.5*et,nt).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("ExternalOrganization",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;(isNaN(lt)||lt<.2)&&(lt=.2);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(lt*et,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,lt*nt)),vt.add(new go.PathSegment(go.PathSegment.Move,et,lt*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,(1-lt)*nt)),ht}),go.Shape.defineFigureGenerator("ExternalProcess",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt).close());var pt=new go.PathFigure(.1*et,.4*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.9*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.6*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.4*et,.9*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.9*nt)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("File",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(.75*et,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.25*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Interrupt",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et,.5*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt));var pt=new go.PathFigure(et,.5*nt,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt));var vt=new go.PathFigure(et,.5*nt,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("InternalStorage",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN,pt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.1);var vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var kt=new go.PathFigure(lt*et,0,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Move,0,pt*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,et,pt*nt)),ht}),go.Shape.defineFigureGenerator("Junction",function(Ft,et,nt){var ht=new go.Geometry,lt=1/Math.SQRT2,pt=(1-1/Math.SQRT2)/2,vt=Yt*.5,kt=.5,Et=new go.PathFigure(et,kt*nt,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,kt*et,nt,et,(kt+vt)*nt,(kt+vt)*et,nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,kt*nt,(kt-vt)*et,nt,0,(kt+vt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,kt*et,0,0,(kt-vt)*nt,(kt-vt)*et,0)),Et.add(new go.PathSegment(go.PathSegment.Bezier,et,kt*nt,(kt+vt)*et,0,et,(kt-vt)*nt));var Ht=new go.PathFigure((pt+lt)*et,(pt+lt)*nt,!1);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,pt*et,pt*nt)),Ht.add(new go.PathSegment(go.PathSegment.Move,pt*et,(pt+lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,(pt+lt)*et,pt*nt)),ht}),go.Shape.defineFigureGenerator("LinedDocument",function(Ft,et,nt){var ht=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(0,.7*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.5*et,.4*nt,.5*et,nt).close());var pt=new go.PathFigure(.1*et,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.75*nt)),ht.spot1=new go.Spot(.1,0),ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("LoopLimit",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MagneticTape",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=.5,vt=new go.PathFigure(.5*et,nt,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*nt,(pt-lt)*et,nt,0,(pt+lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,0,0,(pt-lt)*nt,(pt-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,pt*nt,(pt+lt)*et,0,et,(pt-lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,(pt+.1)*et,.9*nt,et,(pt+lt)*nt,(pt+lt)*et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),ht.spot1=new go.Spot(.15,.15),ht.spot2=new go.Spot(.85,.8),ht}),go.Shape.defineFigureGenerator("ManualInput",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MessageFromUser",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.7);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,lt*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("MicroformProcessing",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.25);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,lt*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,(1-lt)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht}),go.Shape.defineFigureGenerator("MicroformRecording",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("MultiDocument",function(Ft,et,nt){var ht=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(et,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,.44*nt,.96*et,.47*nt,.93*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.54*nt,.86*et,.57*nt,.83*et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.4*et,.4*nt,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,0).close());var pt=new go.PathFigure(.1*et,.2*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.54*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.44*nt)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.8,.77),ht}),go.Shape.defineFigureGenerator("MultiProcess",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.1*et,.1*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.2*nt).close());var pt=new go.PathFigure(.2*et,.1*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.1*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.9*nt)),ht.spot1=new go.Spot(0,.2),ht.spot2=new go.Spot(.8,1),ht}),go.Shape.defineFigureGenerator("OfflineStorage",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=1-lt,vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt).close());var kt=new go.PathFigure(.5*lt*et,lt*nt,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,(1-.5*lt)*et,lt*nt)),ht}),go.Shape.defineFigureGenerator("OffPageConnector",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("Or",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=.5,vt=new go.PathFigure(et,pt*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,nt,et,(pt+lt)*nt,(pt+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*nt,(pt-lt)*et,nt,0,(pt+lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,0,0,(pt-lt)*nt,(pt-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,pt*nt,(pt+lt)*et,0,et,(pt-lt)*nt));var kt=new go.PathFigure(et,.5*nt,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,.5*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),ht}),go.Shape.defineFigureGenerator("PaperTape",function(Ft,et,nt){var ht=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(0,.7*nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.3*nt,.5*et,.6*nt,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.5*et,.4*nt,.5*et,nt).close()),ht.spot1=new go.Spot(0,.49),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("PrimitiveFromCall",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN,pt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN,pt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht}),go.Shape.defineFigureGenerator("Procedure",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure((1-lt)*et,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Move,lt*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),ht}),go.Shape.defineFigureGenerator("Process",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(lt*et,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Sort",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt).close());var pt=new go.PathFigure(0,.5*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.5),ht}),go.Shape.defineFigureGenerator("Start",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.25);var pt=new go.PathFigure(lt*et,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*et,.5*nt,.25*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*et,.5*nt,.25*et,.5*nt));var vt=new go.PathFigure(lt*et,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*et,nt)),ht.spot1=new go.Spot(lt,0),ht.spot2=new go.Spot(1-lt,1),ht}),go.Shape.defineFigureGenerator("Terminator",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.25*et,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*et,.5*nt,.25*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*et,.5*nt,.25*et,.5*nt)),ht.spot1=new go.Spot(.23,0),ht.spot2=new go.Spot(.77,1),ht}),go.Shape.defineFigureGenerator("TransmittalTape",function(Ft,et,nt){var ht=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*et,(1-lt)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-lt)*nt).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("AndGate",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(.5+lt)*et,0,et,(.5-lt)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.5+lt)*nt,(.5+lt)*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.55,1),ht}),go.Shape.defineFigureGenerator("Buffer",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Clock",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=.5,vt=new go.PathFigure(et,pt*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,nt,et,(pt+lt)*nt,(pt+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*nt,(pt-lt)*et,nt,0,(pt+lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,0,0,(pt-lt)*nt,(pt-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,pt*nt,(pt+lt)*et,0,et,(pt-lt)*nt));var kt=new go.PathFigure(et,pt*nt,!1);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et,pt*nt));var Et=new go.PathFigure(.8*et,.75*nt,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,.8*et,.25*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*et,.25*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*et,.75*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*et,.75*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*et,.25*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*et,.25*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*et,.75*nt)),ht}),go.Shape.defineFigureGenerator("Ground",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.3*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,nt)),ht}),go.Shape.defineFigureGenerator("Inverter",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.1,pt=.1,vt=.9,kt=.5,Et=new go.PathFigure(.8*et,.5*nt,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,0,nt)),Et.add(new go.PathSegment(go.PathSegment.Line,0,0)),Et.add(new go.PathSegment(go.PathSegment.Line,.8*et,.5*nt));var Ht=new go.PathFigure((vt+pt)*et,kt*nt,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,(vt-lt)*et,(kt+pt)*nt,(vt-pt)*et,(kt+lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,(vt+lt)*et,(kt-pt)*nt,(vt+pt)*et,(kt-lt)*nt)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.4,.75),ht}),go.Shape.defineFigureGenerator("NandGate",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=Yt*.4,vt=Yt*.1,kt=.1,Et=.9,Ht=.5,Zt=new go.PathFigure(.8*et,.5*nt,!0);ht.add(Zt),Zt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,nt,.8*et,(.5+pt)*nt,(.4+lt)*et,nt)),Zt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),Zt.add(new go.PathSegment(go.PathSegment.Line,0,0)),Zt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(.4+lt)*et,0,.8*et,(.5-pt)*nt));var ie=new go.PathFigure((Et+kt)*et,Ht*nt,!0);return ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht+kt)*nt,(Et+kt)*et,(Ht+vt)*nt,(Et+vt)*et,(Ht+kt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et-kt)*et,Ht*nt,(Et-vt)*et,(Ht+kt)*nt,(Et-kt)*et,(Ht+vt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-kt)*nt,(Et-kt)*et,(Ht-vt)*nt,(Et-vt)*et,(Ht-kt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et+kt)*et,Ht*nt,(Et+vt)*et,(Ht-kt)*nt,(Et+kt)*et,(Ht-vt)*nt)),ht.spot1=new go.Spot(0,.05),ht.spot2=new go.Spot(.55,.95),ht}),go.Shape.defineFigureGenerator("NorGate",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=Yt*lt,vt=0,kt=.5,Et=new go.PathFigure(.8*et,.5*nt,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.7*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.75*nt,.25*et,.25*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(vt+pt)*et,(kt-lt)*nt,.7*et,(kt-pt)*nt)),lt=.1,pt=Yt*.1,vt=.9,kt=.5;var Ht=new go.PathFigure((vt-lt)*et,kt*nt,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,kt*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,kt*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt)),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.6,.75),ht}),go.Shape.defineFigureGenerator("OrGate",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=Yt*lt,vt=0,kt=.5,Et=new go.PathFigure(0,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(vt+pt+pt)*et,(kt-lt)*nt,.8*et,(kt-pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.8*et,(kt+pt)*nt,(vt+pt+pt)*et,(kt+lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.75*nt,.25*et,.25*nt).close()),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("XnorGate",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=Yt*lt,vt=.2,kt=.5,Et=new go.PathFigure(.1*et,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,nt,.35*et,.25*nt,.35*et,.75*nt));var Ht=new go.PathFigure(.8*et,.5*nt,!0);ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,nt,.7*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,0,.45*et,.75*nt,.45*et,.25*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(vt+pt)*et,(kt-lt)*nt,.7*et,(kt-pt)*nt)),lt=.1,pt=Yt*.1,vt=.9,kt=.5;var Zt=new go.PathFigure((vt-lt)*et,kt*nt,!0);return ht.add(Zt),Zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,kt*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,kt*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt)),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.65,.75),ht}),go.Shape.defineFigureGenerator("XorGate",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=Yt*lt,vt=.2,kt=.5,Et=new go.PathFigure(.1*et,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,nt,.35*et,.25*nt,.35*et,.75*nt));var Ht=new go.PathFigure(.2*et,0,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(vt+pt)*et,(kt-lt)*nt,.9*et,(kt-pt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,nt,.9*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,0,.45*et,.75*nt,.45*et,.25*nt).close()),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.8,.75),ht}),go.Shape.defineFigureGenerator("Capacitor",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ht}),go.Shape.defineFigureGenerator("Resistor",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.5*nt)),ht}),go.Shape.defineFigureGenerator("Inductor",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.1,pt=.1,vt=.1,kt=.5,Et=new go.PathFigure((vt-lt*.5)*et,nt,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.3,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.5,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.7,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.9,Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt*.5)*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),ht}),go.Shape.defineFigureGenerator("ACvoltageSource",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.5,pt=.5,vt=.5,kt=.5,Et=new go.PathFigure((vt-pt)*et,kt*nt,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,(vt+lt)*et,(kt-pt)*nt,(vt+pt)*et,(kt-lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,(vt-lt)*et,(kt+pt)*nt,(vt-pt)*et,(kt+lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Move,(vt-pt+.1)*et,kt*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt-.1)*et,kt*nt,vt*et,(kt-pt)*nt,vt*et,(kt+pt)*nt)),ht}),go.Shape.defineFigureGenerator("DCvoltageSource",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.75*nt,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ht}),go.Shape.defineFigureGenerator("Diode",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Wifi",function(Ft,et,nt){var ht=new go.Geometry,lt=et,pt=nt;et=et*.38,nt=nt*.6;var vt=Yt*.8,kt=.8,Et=0,Ht=.5,Zt=(lt-et)/2,ie=(pt-nt)/2,le=new go.PathFigure(Et*et+Zt,(Ht+kt)*nt+ie,!0);ht.add(le),le.add(new go.PathSegment(go.PathSegment.Bezier,(Et-kt)*et+Zt,Ht*nt+ie,(Et-vt)*et+Zt,(Ht+kt)*nt+ie,(Et-kt)*et+Zt,(Ht+vt)*nt+ie)),le.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht-kt)*nt+ie,(Et-kt)*et+Zt,(Ht-vt)*nt+ie,(Et-vt)*et+Zt,(Ht-kt)*nt+ie)),le.add(new go.PathSegment(go.PathSegment.Bezier,(Et-kt+vt*.5)*et+Zt,Ht*nt+ie,Et*et+Zt,(Ht-kt)*nt+ie,(Et-kt+vt*.5)*et+Zt,(Ht-vt)*nt+ie)),le.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht+kt)*nt+ie,(Et-kt+vt*.5)*et+Zt,(Ht+vt)*nt+ie,Et*et+Zt,(Ht+kt)*nt+ie).close()),vt=Yt*.4,kt=.4,Et=.2,Ht=.5;var re=new go.PathFigure(Et*et+Zt,(Ht+kt)*nt+ie,!0);ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,(Et-kt)*et+Zt,Ht*nt+ie,(Et-vt)*et+Zt,(Ht+kt)*nt+ie,(Et-kt)*et+Zt,(Ht+vt)*nt+ie)),re.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht-kt)*nt+ie,(Et-kt)*et+Zt,(Ht-vt)*nt+ie,(Et-vt)*et+Zt,(Ht-kt)*nt+ie)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Et-kt+vt*.5)*et+Zt,Ht*nt+ie,Et*et+Zt,(Ht-kt)*nt+ie,(Et-kt+vt*.5)*et+Zt,(Ht-vt)*nt+ie)),re.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht+kt)*nt+ie,(Et-kt+vt*.5)*et+Zt,(Ht+vt)*nt+ie,Et*et+Zt,(Ht+kt)*nt+ie).close()),vt=Yt*.2,kt=.2,Et=.5,Ht=.5;var Ge=new go.PathFigure((Et-kt)*et+Zt,Ht*nt+ie,!0);ht.add(Ge),Ge.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht-kt)*nt+ie,(Et-kt)*et+Zt,(Ht-vt)*nt+ie,(Et-vt)*et+Zt,(Ht-kt)*nt+ie)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(Et+kt)*et+Zt,Ht*nt+ie,(Et+vt)*et+Zt,(Ht-kt)*nt+ie,(Et+kt)*et+Zt,(Ht-vt)*nt+ie)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht+kt)*nt+ie,(Et+kt)*et+Zt,(Ht+vt)*nt+ie,(Et+vt)*et+Zt,(Ht+kt)*nt+ie)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(Et-kt)*et+Zt,Ht*nt+ie,(Et-vt)*et+Zt,(Ht+kt)*nt+ie,(Et-kt)*et+Zt,(Ht+vt)*nt+ie)),vt=Yt*.4,kt=.4,Et=.8,Ht=.5;var fe=new go.PathFigure(Et*et+Zt,(Ht-kt)*nt+ie,!0);ht.add(fe),fe.add(new go.PathSegment(go.PathSegment.Bezier,(Et+kt)*et+Zt,Ht*nt+ie,(Et+vt)*et+Zt,(Ht-kt)*nt+ie,(Et+kt)*et+Zt,(Ht-vt)*nt+ie)),fe.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht+kt)*nt+ie,(Et+kt)*et+Zt,(Ht+vt)*nt+ie,(Et+vt)*et+Zt,(Ht+kt)*nt+ie)),fe.add(new go.PathSegment(go.PathSegment.Bezier,(Et+kt-vt*.5)*et+Zt,Ht*nt+ie,Et*et+Zt,(Ht+kt)*nt+ie,(Et+kt-vt*.5)*et+Zt,(Ht+vt)*nt+ie)),fe.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht-kt)*nt+ie,(Et+kt-vt*.5)*et+Zt,(Ht-vt)*nt+ie,Et*et+Zt,(Ht-kt)*nt+ie).close()),vt=Yt*.8,kt=.8,Et=1,Ht=.5;var Ke=new go.PathFigure(Et*et+Zt,(Ht-kt)*nt+ie,!0);return ht.add(Ke),Ke.add(new go.PathSegment(go.PathSegment.Bezier,(Et+kt)*et+Zt,Ht*nt+ie,(Et+vt)*et+Zt,(Ht-kt)*nt+ie,(Et+kt)*et+Zt,(Ht-vt)*nt+ie)),Ke.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht+kt)*nt+ie,(Et+kt)*et+Zt,(Ht+vt)*nt+ie,(Et+vt)*et+Zt,(Ht+kt)*nt+ie)),Ke.add(new go.PathSegment(go.PathSegment.Bezier,(Et+kt-vt*.5)*et+Zt,Ht*nt+ie,Et*et+Zt,(Ht+kt)*nt+ie,(Et+kt-vt*.5)*et+Zt,(Ht+vt)*nt+ie)),Ke.add(new go.PathSegment(go.PathSegment.Bezier,Et*et+Zt,(Ht-kt)*nt+ie,(Et+kt-vt*.5)*et+Zt,(Ht-vt)*nt+ie,Et*et+Zt,(Ht-kt)*nt+ie).close()),ht}),go.Shape.defineFigureGenerator("Email",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Move,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.54*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.54*nt)),ht}),go.Shape.defineFigureGenerator("Ethernet",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.35*et,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,0).close());var pt=new go.PathFigure(.1*et,nt,!0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,nt).close());var vt=new go.PathFigure(.6*et,nt,!0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.6*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.6*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*et,nt).close());var kt=new go.PathFigure(0,.5*nt,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.4*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,.75*et,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.6*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,.25*et,.5*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.6*nt)),ht}),go.Shape.defineFigureGenerator("Power",function(Ft,et,nt){var ht=new go.Geometry,lt=Yt*.4,pt=.4,vt=.5,kt=.5,Et=wt(),Ht=wt(),Zt=wt(),ie=wt();$e(vt,kt-pt,vt+lt,kt-pt,vt+pt,kt-lt,vt+pt,kt,.5,Et,Et,Ht,Zt,ie);var le=Vt(Ht.x,Ht.y),re=new go.PathFigure(Ht.x*et,Ht.y*nt,!0);ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,Zt.x*et,Zt.y*nt,ie.x*et,ie.y*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,(vt-lt)*et,(kt+pt)*nt,(vt-pt)*et,(kt+lt)*nt)),$e(vt-pt,kt,vt-pt,kt-lt,vt-lt,kt-pt,vt,kt-pt,.5,Zt,ie,Ht,Et,Et),re.add(new go.PathSegment(go.PathSegment.Bezier,Ht.x*et,Ht.y*nt,Zt.x*et,Zt.y*nt,ie.x*et,ie.y*nt)),lt=Yt*.3,pt=.3,$e(vt-pt,kt,vt-pt,kt-lt,vt-lt,kt-pt,vt,kt-pt,.5,Zt,ie,Ht,Et,Et),re.add(new go.PathSegment(go.PathSegment.Line,Ht.x*et,Ht.y*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,kt*nt,ie.x*et,ie.y*nt,Zt.x*et,Zt.y*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+pt)*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,kt*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),$e(vt,kt-pt,vt+lt,kt-pt,vt+pt,kt-lt,vt+pt,kt,.5,Et,Et,Ht,Zt,ie),re.add(new go.PathSegment(go.PathSegment.Bezier,Ht.x*et,Ht.y*nt,ie.x*et,ie.y*nt,Zt.x*et,Zt.y*nt).close());var re=new go.PathFigure(.45*et,0,!0);return ht.add(re),re.add(new go.PathSegment(go.PathSegment.Line,.45*et,.5*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.55*et,.5*nt)),re.add(new go.PathSegment(go.PathSegment.Line,.55*et,0).close()),ue(Et),ue(Ht),ue(Zt),ue(ie),ue(le),ht.spot1=new go.Spot(.25,.45),ht.spot2=new go.Spot(.75,.8),ht}),go.Shape.defineFigureGenerator("Fallout",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt/2,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,180,360,et/2,nt/2,et/2,nt/2));function pt(vt,kt,Et){vt.add(new go.PathSegment(go.PathSegment.Move,(.3+kt)*et,(.8+Et)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.5+kt)*et,(.5+Et)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.1+kt)*et,(.5+Et)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.3+kt)*et,(.8+Et)*nt).close())}return pt(lt,0,0),pt(lt,.4,0),pt(lt,.2,-.3),ht}),go.Shape.defineFigureGenerator("IrritationHazard",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.2*et,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt).close()),ht.spot1=new go.Spot(.3,.3),ht.spot2=new go.Spot(.7,.7),ht}),go.Shape.defineFigureGenerator("ElectricalHazard",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.37*et,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.11*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.77*et,.04*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,.49*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.37*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.63*et,.86*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.77*et,.91*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.34*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.34*et,.78*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.44*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.56*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.68*nt).close()),ht}),go.Shape.defineFigureGenerator("FireHazard",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.1*et,nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.29*et,0,-.25*et,.63*nt,.45*et,.44*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.51*et,.42*nt,.48*et,.17*nt,.54*et,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.59*et,.18*nt,.59*et,.29*nt,.58*et,.28*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*et,.6*nt,.8*et,.34*nt,.88*et,.43*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.88*et,.31*nt,.87*et,.48*nt,.88*et,.43*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,nt,1.17*et,.76*nt,.82*et,.8*nt).close()),ht.spot1=new go.Spot(.07,.445),ht.spot2=new go.Spot(.884,.958),ht}),go.Shape.defineFigureGenerator("BpmnActivityLoop",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=0,vt=0,kt=lt*Yt,Et=.4*Math.SQRT2/2+.5,Ht=.5-.5*Math.SQRT2/2,Zt=1,ie=.5,le=.5,re=0,Ge=new go.PathFigure(Et*et,(1-Ht)*nt,!1);return ht.add(Ge),Ge.add(new go.PathSegment(go.PathSegment.Bezier,Zt*et,ie*nt,Zt*et,.7*nt,Zt*et,ie*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(le+pt)*et,(re+pt)*nt,(.5+lt+pt)*et,(.5-kt+pt)*nt,(.5+kt+pt)*et,(.5-lt+pt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-kt+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-kt+vt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(.35+pt)*et,.9*nt,(.5-lt+pt)*et,(.5+kt+vt)*nt,(.5-kt+pt)*et,.9*nt)),Ge.add(new go.PathSegment(go.PathSegment.Move,(.25+pt)*et,.8*nt)),Ge.add(new go.PathSegment(go.PathSegment.Line,(.35+pt)*et,.9*nt)),Ge.add(new go.PathSegment(go.PathSegment.Line,(.2+pt)*et,.95*nt)),ht}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ht}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ht}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt);var pt=new go.PathFigure(et,nt,!1);ht.add(pt);var vt=new go.PathFigure(0,.5*nt,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.5*nt,.2*et,.35*nt,.3*et,.35*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,.7*et,.65*nt,.8*et,.65*nt)),ht}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt).close()),ht}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.2*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt).close());var lt=new go.PathFigure(0,.2*nt,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),ht}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.7*et,nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,0,.6*et,.5*nt,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*et,nt,.4*et,.5*nt,et,.5*nt).close());var pt=new go.PathFigure(.45*et,.73*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.73*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.38*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.63*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.31*et,.27*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.56*et,.27*nt)),ht}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt);var pt=new go.PathFigure(.335*et,(1-.555)*nt,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.335*et,(1-.405)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.405)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.555)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,.68*nt,(1-.12)*et,.46*nt,(1-.02)*et,.54*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.68*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.335*et,(1-.555)*nt,.02*et,.54*nt,.12*et,.46*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.365*et,(1-.595)*nt));var vt=.5-.285,kt=.5,Et=vt,Ht=Math.PI/4,Zt=4*(1-Math.cos(Ht))/(3*Math.sin(Ht)),ie=Zt*.5,le=vt,re=vt,Ge=Zt*le,fe=Zt*re;pt.add(new go.PathSegment(go.PathSegment.Bezier,(kt-le)*et,Et*nt,(kt-(Ge+le)/2)*et,(Et+(re+fe)/2)*nt,(kt-le)*et,(Et+fe)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,kt*et,(Et-re)*nt,(kt-le)*et,(Et-fe)*nt,(kt-Ge)*et,(Et-re)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(kt+le)*et,Et*nt,(kt+Ge)*et,(Et-re)*nt,(kt+le)*et,(Et-fe)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*et,(1-.595)*nt,(kt+le)*et,(Et+fe)*nt,(kt+(Ge+le)/2)*et,(Et+(re+fe)/2)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*et,(1-.595)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.555)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.405)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.335*et,(1-.405)*nt));var Ke=new go.PathFigure(.2*et,nt,!1);ht.add(Ke),Ke.add(new go.PathSegment(go.PathSegment.Line,.2*et,.8*nt));var an=new go.PathFigure(.8*et,nt,!1);return ht.add(an),an.add(new go.PathSegment(go.PathSegment.Line,.8*et,.8*nt)),ht}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.1*et,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,nt).close());var pt=new go.PathFigure(.2*et,.2*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.8*nt)),ht}),go.Shape.defineFigureGenerator("BpmnEventError",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,.5*nt).close()),ht}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt);var pt=new go.PathFigure(et,nt,!1);ht.add(pt);var vt=new go.PathFigure(.1*et,nt,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt).close()),ht}),go.Shape.defineFigureGenerator("Caution",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.05*et,nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,.8*nt,0,nt,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.55*et,.1*nt,.5*et,0,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.95*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,nt,et,nt,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*et,nt));var pt=.05;return lt.add(new go.PathSegment(go.PathSegment.Move,(.5-pt)*et,.875*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*et,.875*nt,pt*et,pt*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.325*nt,.575*et,.725*nt,.625*et,.375*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.75*nt,.375*et,.375*nt,.425*et,.725*nt)),ht}),go.Shape.defineFigureGenerator("Recycle",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.45*et,.95*nt,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.185*et,.85*nt,.17*et,.95*nt,.15*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.235*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.625*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.275*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*et,.575*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1875*et,.95*nt,0,.675*nt,0,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.45*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.775*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.22*et,.775*nt));var pt=new go.PathFigure(.475*et,.2*nt,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.225*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.275*et,.175*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.325*et,.05*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,.05*nt,.35*et,0,.375*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.375*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.475*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.315*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.32*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.05*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.575*et,0,.65*et,.05*nt,.625*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.38*et,.0105*nt));var vt=new go.PathFigure(.675*et,.575*nt,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.875*et,.525*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.85*et,.95*nt,et,.8*nt,et,.85*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.95*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.85*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.725*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Move,.675*et,.575*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.775*et,.775*nt)),ht}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=Yt*.5,vt=new go.PathFigure(et,lt*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt*et,nt,et,(lt+pt)*nt,(lt+pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,lt*nt,(lt-pt)*et,nt,0,(lt+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt*et,0,0,(lt-pt)*nt,(lt-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,lt*nt,(lt+pt)*et,0,et,(lt-pt)*nt));var kt=new go.PathFigure(lt*et,0,!1);return ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,lt*et,.15*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,lt*et,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,lt*et,.85*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,0,lt*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.15*et,lt*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,et,lt*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.85*et,lt*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,lt*et,lt*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.58*et,.1*nt)),kt.add(new go.PathSegment(go.PathSegment.Move,lt*et,lt*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.78*et,.54*nt)),ht}),go.Shape.defineFigureGenerator("Package",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.15*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(0,.15*nt,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.15*nt).close()),ht.spot1=new go.Spot(0,.1),ht.spot2=new go.Spot(1,1),ht}),go.Shape.defineFigureGenerator("Class",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*nt,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt).close());var vt=new go.PathFigure(0,.5*nt,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt).close()),ht}),go.Shape.defineFigureGenerator("Component",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et,nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt).close());var pt=new go.PathFigure(0,.2*nt,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt).close());var vt=new go.PathFigure(0,.6*nt,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.6*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.6*nt).close()),ht}),go.Shape.defineFigureGenerator("Boat Shipment",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.15*et,.6*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.6*nt));var pt=new go.PathFigure(.15*et,.6*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.6*nt)),ht}),go.Shape.defineFigureGenerator("Customer/Supplier",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et,nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt).close()),ht}),go.Shape.defineFigureGenerator("Workcell",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ht}),go.Shape.defineFigureGenerator("Supermarket",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.66*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.66*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,.66*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),ht}),go.Shape.defineFigureGenerator("TruckShipment",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(et,.8*nt,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt).close());var vt=.1,kt=Yt*.1,Et=.2,Ht=.9,Zt=new go.PathFigure((Et-vt)*et,Ht*nt,!0);ht.add(Zt),Zt.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-vt)*nt,(Et-vt)*et,(Ht-kt)*nt,(Et-kt)*et,(Ht-vt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*et,Ht*nt,(Et+kt)*et,(Ht-vt)*nt,(Et+vt)*et,(Ht-kt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht+vt)*nt,(Et+vt)*et,(Ht+kt)*nt,(Et+kt)*et,(Ht+vt)*nt)),Zt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*et,Ht*nt,(Et-kt)*et,(Ht+vt)*nt,(Et-vt)*et,(Ht+kt)*nt).close()),vt=.1,kt=Yt*.1,Et=.8,Ht=.9;var ie=new go.PathFigure((Et-vt)*et,Ht*nt,!0);return ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht-vt)*nt,(Et-vt)*et,(Ht-kt)*nt,(Et-kt)*et,(Ht-vt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*et,Ht*nt,(Et+kt)*et,(Ht-vt)*nt,(Et+vt)*et,(Ht-kt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*et,(Ht+vt)*nt,(Et+vt)*et,(Ht+kt)*nt,(Et+kt)*et,(Ht+vt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*et,Ht*nt,(Et-kt)*et,(Ht+vt)*nt,(Et-vt)*et,(Ht+kt)*nt).close()),ht}),go.Shape.defineFigureGenerator("KanbanPost",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.2*et,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),ht}),go.Shape.defineFigureGenerator("Forklift",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0));var pt=new go.PathFigure(0,.5*nt,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt));var vt=new go.PathFigure(.5*et,.8*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.8*nt));var kt=new go.PathFigure(.5*et,.7*nt,!1);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt));var Et=.1,Ht=Yt*.1,Zt=.1,ie=.9,le=new go.PathFigure((Zt-Et)*et,ie*nt,!0);ht.add(le),le.add(new go.PathSegment(go.PathSegment.Bezier,Zt*et,(ie-Et)*nt,(Zt-Et)*et,(ie-Ht)*nt,(Zt-Ht)*et,(ie-Et)*nt)),le.add(new go.PathSegment(go.PathSegment.Bezier,(Zt+Et)*et,ie*nt,(Zt+Ht)*et,(ie-Et)*nt,(Zt+Et)*et,(ie-Ht)*nt)),le.add(new go.PathSegment(go.PathSegment.Bezier,Zt*et,(ie+Et)*nt,(Zt+Et)*et,(ie+Ht)*nt,(Zt+Ht)*et,(ie+Et)*nt)),le.add(new go.PathSegment(go.PathSegment.Bezier,(Zt-Et)*et,ie*nt,(Zt-Ht)*et,(ie+Et)*nt,(Zt-Et)*et,(ie+Ht)*nt)),Et=.1,Ht=Yt*.1,Zt=.4,ie=.9;var re=new go.PathFigure((Zt-Et)*et,ie*nt,!0);return ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,Zt*et,(ie-Et)*nt,(Zt-Et)*et,(ie-Ht)*nt,(Zt-Ht)*et,(ie-Et)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Zt+Et)*et,ie*nt,(Zt+Ht)*et,(ie-Et)*nt,(Zt+Et)*et,(ie-Ht)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,Zt*et,(ie+Et)*nt,(Zt+Et)*et,(ie+Ht)*nt,(Zt+Ht)*et,(ie+Et)*nt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Zt-Et)*et,ie*nt,(Zt-Ht)*et,(ie+Et)*nt,(Zt-Et)*et,(ie+Ht)*nt)),ht}),go.Shape.defineFigureGenerator("RailShipment",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.1*et,.4*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.4*nt).close());var pt=new go.PathFigure(.45*et,.7*nt,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.7*nt));var vt=new go.PathFigure(.55*et,.4*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.4*nt).close());var Zt=.05,ie=Yt*.05,le=.175,re=.95,kt=new go.PathFigure((le-Zt)*et,re*nt,!0);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re-Zt)*nt,(le-Zt)*et,(re-ie)*nt,(le-ie)*et,(re-Zt)*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,(le+Zt)*et,re*nt,(le+ie)*et,(re-Zt)*nt,(le+Zt)*et,(re-ie)*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re+Zt)*nt,(le+Zt)*et,(re+ie)*nt,(le+ie)*et,(re+Zt)*nt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,(le-Zt)*et,re*nt,(le-ie)*et,(re+Zt)*nt,(le-Zt)*et,(re+ie)*nt));var Zt=.05,ie=Yt*.05,le=.375,re=.95,Et=new go.PathFigure((le-Zt)*et,re*nt,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re-Zt)*nt,(le-Zt)*et,(re-ie)*nt,(le-ie)*et,(re-Zt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(le+Zt)*et,re*nt,(le+ie)*et,(re-Zt)*nt,(le+Zt)*et,(re-ie)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re+Zt)*nt,(le+Zt)*et,(re+ie)*nt,(le+ie)*et,(re+Zt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(le-Zt)*et,re*nt,(le-ie)*et,(re+Zt)*nt,(le-Zt)*et,(re+ie)*nt));var Zt=.05,ie=Yt*.05,le=.625,re=.95,Ht=new go.PathFigure((le-Zt)*et,re*nt,!0);ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re-Zt)*nt,(le-Zt)*et,(re-ie)*nt,(le-ie)*et,(re-Zt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(le+Zt)*et,re*nt,(le+ie)*et,(re-Zt)*nt,(le+Zt)*et,(re-ie)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re+Zt)*nt,(le+Zt)*et,(re+ie)*nt,(le+ie)*et,(re+Zt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(le-Zt)*et,re*nt,(le-ie)*et,(re+Zt)*nt,(le-Zt)*et,(re+ie)*nt));var Zt=.05,ie=Yt*.05,le=.825,re=.95,Ge=new go.PathFigure((le-Zt)*et,re*nt,!0);ht.add(Ge),Ge.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re-Zt)*nt,(le-Zt)*et,(re-ie)*nt,(le-ie)*et,(re-Zt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(le+Zt)*et,re*nt,(le+ie)*et,(re-Zt)*nt,(le+Zt)*et,(re-ie)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,le*et,(re+Zt)*nt,(le+Zt)*et,(re+ie)*nt,(le+ie)*et,(re+Zt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(le-Zt)*et,re*nt,(le-ie)*et,(re+Zt)*nt,(le-Zt)*et,(re+ie)*nt).close());var fe=new go.PathFigure(0,nt,!1);return ht.add(fe),fe.add(new go.PathSegment(go.PathSegment.Line,et,nt).close()),ht}),go.Shape.defineFigureGenerator("Warehouse",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*nt,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt).close());var vt=new go.PathFigure(.15*et,nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.15*et,nt).close());var kt=.05,Et=Yt*.05,Ht=.35,Zt=.775,ie=new go.PathFigure((Ht-kt)*et,Zt*nt,!0);return ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,Ht*et,(Zt-kt)*nt,(Ht-kt)*et,(Zt-Et)*nt,(Ht-Et)*et,(Zt-kt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Ht+kt)*et,Zt*nt,(Ht+Et)*et,(Zt-kt)*nt,(Ht+kt)*et,(Zt-Et)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,Ht*et,(Zt+kt)*nt,(Ht+kt)*et,(Zt+Et)*nt,(Ht+Et)*et,(Zt+kt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Ht-kt)*et,Zt*nt,(Ht-Et)*et,(Zt+kt)*nt,(Ht-kt)*et,(Zt+Et)*nt).close()),ht}),go.Shape.defineFigureGenerator("ControlCenter",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.1*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt).close()),ht}),go.Shape.defineFigureGenerator("Bluetooth",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.75*nt,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.4*nt)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.4*nt)),ht}),go.Shape.defineFigureGenerator("Globe",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,.75*et,0,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,.75*nt,.75*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,.25*et,nt,0,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,.25*nt,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,.15*et,.25*nt,.15*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,.85*et,.75*nt,.85*et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.1675*et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8325*et,.15*nt,.35*et,.3*nt,.65*et,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.1675*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8325*et,.85*nt,.35*et,.7*nt,.65*et,.7*nt)),ht}),go.Shape.defineFigureGenerator("Wave",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.25*nt,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.25*nt,.1*et,0,.2*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*et,.25*nt,.425*et,.5*nt,.575*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.25*nt,.8*et,0,.9*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.75*nt,.1*et,.5*nt,.2*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*et,.75*nt,.425*et,nt,.575*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.75*nt,.8*et,.5*nt,.9*et,.5*nt)),ht}),go.Shape.defineFigureGenerator("Operator",function(Ft,et,nt){var ht=new go.Geometry,lt=.3,pt=Yt*.3,vt=.5,kt=.7,Et=new go.PathFigure((vt-lt)*et,kt*nt,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,kt*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,kt*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt));var Ht=new go.PathFigure(0,.7*nt,!1);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,et,.7*nt,0,0,et,0)),ht}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.65*nt,.65*et,.3*nt,.65*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,.35*et,.5*nt,.35*et,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.3*et,.6*nt,.1*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.65*nt,.2*et,nt,.35*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,nt,.7*et,.6*nt,.9*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.65*nt,.8*et,nt,.65*et,.95*nt)),ht}),go.Shape.defineFigureGenerator("CentrifugalPump",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,0,.075*nt,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,nt,0,nt,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.4*nt,.8*et,nt,.85*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),ht}),go.Shape.defineFigureGenerator("Battery",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.4*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.1*nt));var pt=new go.PathFigure(0,.6*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,0,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.4*nt)),ht}),go.Shape.defineFigureGenerator("Delete",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=Yt*.5,vt=.5,kt=.5,Et=new go.PathFigure((vt-lt)*et,kt*nt,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,kt*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,kt*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt));var Ht=new go.PathFigure(.15*et,.5*nt,!1);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,.85*et,.5*nt)),ht}),go.Shape.defineFigureGenerator("Flag",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.1*nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.1*nt,.15*et,0,.35*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.1*nt,.65*et,.2*nt,.85*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.5*nt,.85*et,.6*nt,.65*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,.35*et,.4*nt,.15*et,.4*nt).close()),ht}),go.Shape.defineFigureGenerator("Help",function(Ft,et,nt){var ht=new go.Geometry,lt=.5,pt=Yt*.5,vt=.5,kt=.5,Et=new go.PathFigure((vt-lt)*et,kt*nt,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,kt*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,kt*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt).close()),lt=.05,pt=Yt*.05,vt=.5,kt=.8;var Ht=new go.PathFigure((vt-lt)*et,kt*nt,!1);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt-lt)*nt,(vt-lt)*et,(kt-pt)*nt,(vt-pt)*et,(kt-lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,kt*nt,(vt+pt)*et,(kt-lt)*nt,(vt+lt)*et,(kt-pt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(kt+lt)*nt,(vt+lt)*et,(kt+pt)*nt,(vt+pt)*et,(kt+lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,kt*nt,(vt-pt)*et,(kt+lt)*nt,(vt-lt)*et,(kt+pt)*nt).close()),Ht.add(new go.PathSegment(go.PathSegment.Move,.5*et,.7*nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,.75*et,.475*nt,.75*et,.225*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.35*nt,.4*et,.2*nt,.3*et,.25*nt)),ht}),go.Shape.defineFigureGenerator("Location",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,nt,!0).add(new go.PathSegment(go.PathSegment.Line,.75*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,.975*et,.025*nt,.5*et,0)).add(new go.PathSegment(go.PathSegment.Bezier,.25*et,.5*nt,.5*et,0,.025*et,.025*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.5*et,.2*nt)).add(new go.PathSegment(go.PathSegment.Arc,270,360,.5*et,.3*nt,.1*et,.1*nt).close()))}),go.Shape.defineFigureGenerator("Lock",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt));var pt=new go.PathFigure(.2*et,.5*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.3*nt,.25*et,0,.75*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.3*nt)),ht}),go.Shape.defineFigureGenerator("Unlocked",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt));var pt=new go.PathFigure(.2*et,.5*nt,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.3*nt,.25*et,0,.75*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.35*nt)),ht}),go.Shape.defineFigureGenerator("Gear",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(.9375*et,.56246875*nt,!0).add(new go.PathSegment(go.PathSegment.Line,.9375*et,.4375*nt)).add(new go.PathSegment(go.PathSegment.Line,.80621875*et,.4375*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.763*et,.3316875*nt,.79840625*et,.39915625*nt,.7834375*et,.3635*nt)).add(new go.PathSegment(go.PathSegment.Line,.8566875*et,.23796875*nt)).add(new go.PathSegment(go.PathSegment.Line,.76825*et,.14959375*nt)).add(new go.PathSegment(go.PathSegment.Line,.67596875*et,.24184375*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5625*et,.19378125*nt,.64228125*et,.2188125*nt,.603875*et,.2021875*nt)).add(new go.PathSegment(go.PathSegment.Line,.5625*et,.0625*nt)).add(new go.PathSegment(go.PathSegment.Line,.4375*et,.0625*nt)).add(new go.PathSegment(go.PathSegment.Line,.4375*et,.19378125*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.32775*et,.239375*nt,.39759375*et,.20190625*nt,.36053125*et,.2176875*nt)).add(new go.PathSegment(go.PathSegment.Line,.2379375*et,.14959375*nt)).add(new go.PathSegment(go.PathSegment.Line,.14953125*et,.2379375*nt)).add(new go.PathSegment(go.PathSegment.Line,.23934375*et,.3278125*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.19378125*et,.4375*nt,.21765625*et,.36059375*nt,.201875*et,.397625*nt)).add(new go.PathSegment(go.PathSegment.Line,.0625*et,.4375*nt)).add(new go.PathSegment(go.PathSegment.Line,.0625*et,.5625*nt)).add(new go.PathSegment(go.PathSegment.Line,.1938125*et,.5625*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.241875*et,.67596875*nt,.20221875*et,.603875*nt,.21884375*et,.64228125*nt)).add(new go.PathSegment(go.PathSegment.Line,.1495625*et,.76825*nt)).add(new go.PathSegment(go.PathSegment.Line,.238*et,.8566875*nt)).add(new go.PathSegment(go.PathSegment.Line,.3316875*et,.76296875*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.43753125*et,.80621875*nt,.36353125*et,.78340625*nt,.3991875*et,.79840625*nt)).add(new go.PathSegment(go.PathSegment.Line,.43753125*et,.9375*nt)).add(new go.PathSegment(go.PathSegment.Line,.5625*et,.9375*nt)).add(new go.PathSegment(go.PathSegment.Line,.5625*et,.80621875*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.67225*et,.760625*nt,.602375*et,.79809375*nt,.63946875*et,.78234375*nt)).add(new go.PathSegment(go.PathSegment.Line,.76828125*et,.8566875*nt)).add(new go.PathSegment(go.PathSegment.Line,.85671875*et,.76825*nt)).add(new go.PathSegment(go.PathSegment.Line,.76065625*et,.67221875*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.80621875*et,.56246875*nt,.78234375*et,.63940625*nt,.798125*et,.602375*nt)).add(new go.PathSegment(go.PathSegment.Line,.9375*et,.56246875*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.5*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Arc,90,360,.5*et,.5*nt,.1*et,.1*nt).close()))}),go.Shape.defineFigureGenerator("Hand",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,.3*nt,0,.375*nt,.05*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.45*et,.075*nt,.3*et,.225*nt,.4*et,.175*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.525*et,.075*nt,.46*et,.05*nt,.525*et,.05*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.4*nt,.525*et,.275*nt,.475*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,.55*nt,et,.4*nt,et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.425*et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.6*et,.7*nt,.675*et,.55*nt,.675*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.575*et,.85*nt,.65*et,.7*nt,.65*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.535*et,nt,.61*et,.85*nt,.61*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,.435*et,nt,0,nt).close()),ht}),go.Shape.defineFigureGenerator("Map",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,.2*nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),lt.add(new go.PathSegment(go.PathSegment.Move,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.8*nt)),ht}),go.Shape.defineFigureGenerator("Eject",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.7)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.7).close());var pt=new go.PathFigure(0,nt*.6,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0).close()),ht}),go.Shape.defineFigureGenerator("Pencil",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.2*et,.1*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.1*et,.2*nt).close()))}),go.Shape.defineFigureGenerator("Building",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*1,nt*1,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*et,nt*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*et,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*et,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*et,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*et,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*et,nt*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.85).close());var pt=new go.PathFigure(.126*et,.85*nt,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.126*et,.45*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*et,.45*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*et,.85*nt).close());var vt=new go.PathFigure(.402*et,.85*nt,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.402*et,.45*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*et,.45*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*et,.85*nt).close());var kt=new go.PathFigure(.678*et,.85*nt,!1);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,.678*et,.45*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.874*et,.45*nt)),kt.add(new go.PathSegment(go.PathSegment.Line,.874*et,.85*nt).close());var Et=new go.PathFigure(.5*et,.1*nt,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*et,.3*nt)),Et.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*et,.3*nt).close()),ht}),go.Shape.defineFigureGenerator("Staircase",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt*1,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*.8)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.8)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.6)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.6)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.4)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*.4)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*.2)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.2)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.15)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.15)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.95).close()),ht}),go.Shape.defineFigureGenerator("5Bars",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,nt*1,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.184,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.184,nt*(1-.184)).close());var pt=new go.PathFigure(et*.204,nt,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.204,nt*(1-.184))),pt.add(new go.PathSegment(go.PathSegment.Line,et*.388,nt*(1-.184*2))),pt.add(new go.PathSegment(go.PathSegment.Line,et*.388,nt*1).close());var vt=new go.PathFigure(et*.408,nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.408,nt*(1-.184*2))),vt.add(new go.PathSegment(go.PathSegment.Line,et*.592,nt*(1-.184*3))),vt.add(new go.PathSegment(go.PathSegment.Line,et*.592,nt*1).close());var kt=new go.PathFigure(et*.612,nt,!0);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et*.612,nt*(1-.184*3))),kt.add(new go.PathSegment(go.PathSegment.Line,et*.796,nt*(1-.184*4))),kt.add(new go.PathSegment(go.PathSegment.Line,et*.796,nt*1).close());var Et=new go.PathFigure(et*.816,nt,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,et*.816,nt*(1-.184*4))),Et.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-.184*5))),Et.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1).close()),ht}),go.Shape.defineFigureGenerator("PC",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,0).close());var pt=new go.PathFigure(et*.055,.07*nt,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.07)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.055,nt*.1).close());var vt=new go.PathFigure(et*.055,.13*nt,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.13)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.16)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.055,nt*.16).close());var kt=new go.PathFigure(et*.055,.18*nt,!0);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.18)),kt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.21)),kt.add(new go.PathSegment(go.PathSegment.Line,et*.055,nt*.21).close());var Et=new go.PathFigure(et*1,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,et*.4,0)),Et.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.65)),Et.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.65).close()),ht}),go.Shape.defineFigureGenerator("Plane",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(.55*et,nt,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.475*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.35*et,.525*nt,0,.4*nt,.225*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.475*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,.2*nt,.975*et,0,et,.08*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.55*et,nt).close()),ht}),go.Shape.defineFigureGenerator("Key",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*1,nt*.5,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.9,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.85,.575*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.9,.6*nt).close()),lt.add(new go.PathSegment(go.PathSegment.Move,.17*et,.425*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*et,.5*nt,.075*et,.075*nt).close()),ht}),go.Shape.defineFigureGenerator("FilmTape",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,et*0,et*.3,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.08,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.08,nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*1),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*1),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*2),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*2),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*3),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*3),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*4),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*4),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*5),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*5),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*6),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*6),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*7),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*7),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*8),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*8),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*9),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*9),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*10),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*10),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*11),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*11),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*12),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*12),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*13),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*13),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*14),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*14),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*15),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*15),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1));var pt=new go.PathFigure(0,0,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*0)),pt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,et*1,et*.3,et*.055)),pt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1));var vt=new go.PathFigure(et*.11,nt*.1,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*1+.028*0),nt*.1)),vt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*1+.028*0),nt*.8)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.11,nt*.8).close());var kt=new go.PathFigure(et*(.11+.24133333*1+.028*1),nt*.1,!1);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*1),nt*.1)),kt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*1),nt*.8)),kt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*1+.028*1),nt*.8).close());var Et=new go.PathFigure(et*(.11+.24133333*2+.028*2),nt*.1,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*3+.028*2),nt*.1)),Et.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*3+.028*2),nt*.8)),Et.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*2),nt*.8).close()),ht}),go.Shape.defineFigureGenerator("FloppyDisk",function(Ft,et,nt){var ht=new go.Geometry,lt=8,pt=lt*Yt,vt=new go.PathFigure(lt,0,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.86,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.14)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-lt,nt,et,nt-pt,et-pt,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,lt,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-lt,pt,nt,0,nt-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt,0,0,pt,pt,0).close());var kt=new go.PathFigure(et*.83,0,!1);ht.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et*.83,nt*.3)),kt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*.3)),kt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*0).close());var Et=new go.PathFigure(et*.83,nt*1,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,et*.83,nt*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*1).close());var Ht=new go.PathFigure(et*.78,nt*.05,!1);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.05)),Ht.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.25)),Ht.add(new go.PathSegment(go.PathSegment.Line,et*.78,nt*.25).close()),ht}),go.Shape.defineFigureGenerator("SpeechBubble",function(Ft,et,nt){var ht=Ft?Ft.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=15),ht=Math.min(ht,et/3),ht=Math.min(ht,nt/3);var lt=ht*Yt,pt=nt*.8,vt=new go.Geometry,kt=new go.PathFigure(ht,0,!0);return vt.add(kt),kt.add(new go.PathSegment(go.PathSegment.Line,et-ht,0)),kt.add(new go.PathSegment(go.PathSegment.Bezier,et,ht,et-lt,0,et,lt)),kt.add(new go.PathSegment(go.PathSegment.Line,et,pt-ht)),kt.add(new go.PathSegment(go.PathSegment.Bezier,et-ht,pt,et,pt-lt,et-lt,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,et*.7,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt)),kt.add(new go.PathSegment(go.PathSegment.Line,et*.55,pt)),kt.add(new go.PathSegment(go.PathSegment.Line,ht,pt)),kt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt-ht,lt,pt,0,pt-lt)),kt.add(new go.PathSegment(go.PathSegment.Line,0,ht)),kt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,lt,lt,0).close()),lt>1?(vt.spot1=new go.Spot(0,0,lt,lt),vt.spot2=new go.Spot(1,.8,-lt,-lt)):(vt.spot1=go.Spot.TopLeft,vt.spot2=new go.Spot(1,.8)),vt}),go.Shape.defineFigureGenerator("Repeat",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*0,nt*.45,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*.45).close());var pt=new go.PathFigure(et*1,nt*.55,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*0)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*.55).close()),ht}),go.Shape.defineFigureGenerator("Windows",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close()).add(new go.PathSegment(go.PathSegment.Move,.4*et,.4*nt)).add(new go.PathSegment(go.PathSegment.Line,.4*et,.8*nt)).add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)).add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.2*et,.1*nt)).add(new go.PathSegment(go.PathSegment.Line,.2*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.1*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.1*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Line,.1*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt).close()))}),go.Shape.defineFigureGenerator("Terminal",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*0,nt*.1,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*.9).close());var pt=new go.PathFigure(et*.1,nt*.2,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.1,nt*.25)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.22,nt*.285)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.1,nt*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.1,nt*.37)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.275,nt*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.275,nt*.25).close());var vt=new go.PathFigure(et*.28,nt*.37,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.37)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.41)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.28,nt*.41).close()),ht}),go.Shape.defineFigureGenerator("Beaker",function(Ft,et,nt){var ht=new go.Geometry,lt=15,pt=lt*Yt,vt=new go.PathFigure(et*.62,nt*.475,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-lt,nt,et,nt-pt,et-pt,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,lt,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-lt,pt,nt,0,nt-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.38,nt*.475)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.38,nt*.03)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*0)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*0)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.62,nt*.03).close()),pt>1?(ht.spot1=new go.Spot(0,0,pt,pt),ht.spot2=new go.Spot(1,1,-pt,-pt)):(ht.spot1=go.Spot.TopLeft,ht.spot2=go.Spot.BottomRight),ht}),go.Shape.defineFigureGenerator("Download",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*0,nt*1,!0);ht.add(lt);var pt=.1/.3;lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.755,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.93,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.61,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.39,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.07,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.755),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.8),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*(1-pt)).close());var vt=new go.PathFigure(et*.4,nt*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.26,nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.66)),vt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.26),nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*0).close()),ht}),go.Shape.defineFigureGenerator("Bin",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*0,nt*1,!0);ht.add(lt);var pt=.1/.3;return lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.755,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.93,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.61,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.39,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.07,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.755),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.8),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*(1-pt)).close()),ht}),go.Shape.defineFigureGenerator("Upload",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*0,nt*1,!0);ht.add(lt);var pt=.1/.3;lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.755,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.93,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.61,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.39,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.07,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.755),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.8),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*(1-pt)).close());var vt=new go.PathFigure(et*.5,nt*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.26,nt*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.74,nt*.25).close()),ht}),go.Shape.defineFigureGenerator("EmptyDrink",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*.15,nt*0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.85,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*1).close()),ht}),go.Shape.defineFigureGenerator("Drink",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*.15,nt*0,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.85,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*1).close());var pt=new go.PathFigure(et*.235,nt*.28,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.765,nt*.28)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.655,nt*.97)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.345,nt*.97).close()),ht}),go.Shape.defineFigureGenerator("4Arrows",function(Ft,et,nt){var ht=new go.Geometry,lt=new go.PathFigure(et*.5,nt*0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,nt*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.5)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.65)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.65)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*.5)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.25).close()),ht}),go.Shape.defineFigureGenerator("Connector","Ellipse"),go.Shape.defineFigureGenerator("Alternative","TriangleUp"),go.Shape.defineFigureGenerator("Merge","TriangleUp"),go.Shape.defineFigureGenerator("Decision","Diamond"),go.Shape.defineFigureGenerator("DataTransmissions","Hexagon"),go.Shape.defineFigureGenerator("Gate","Crescent"),go.Shape.defineFigureGenerator("Delay","HalfEllipse"),go.Shape.defineFigureGenerator("Input","Parallelogram1"),go.Shape.defineFigureGenerator("ManualLoop","ManualOperation"),go.Shape.defineFigureGenerator("ISOProcess","Chevron"),go.Shape.defineFigureGenerator("MessageToUser","SquareArrow"),go.Shape.defineFigureGenerator("MagneticData","Cylinder1"),go.Shape.defineFigureGenerator("DirectData","Cylinder4"),go.Shape.defineFigureGenerator("StoredData","DataStorage"),go.Shape.defineFigureGenerator("SequentialData","MagneticTape"),go.Shape.defineFigureGenerator("Subroutine","Procedure")},61016:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var un={},Rn="5.0",Vt={},wt=null,ue=!1,_e=!1,$e=null,ye=!1,oe=null,Yt=null,Ne=0;Ne<arguments.length;Ne++){var ge=arguments[Ne];if(ge!==null)switch(typeof ge){case"number":Rn=ge.toFixed(1);break;case"string":ge.match(new RegExp("^[0-9]\\.[0-9]+$"))?Rn=ge:$e=ge;break;case"object":typeof ge.is3D!="undefined"?wt=ge:Vt=ge;break;case"boolean":ue=ge,_e=!0;break}}wt===null&&(wt={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},Vt.material_id!==void 0&&!_e&&(ue=!0)),$e!==null&&Vt.id===void 0&&(Vt.id=$e);var we="",Ye="",Be=!1,on=null,Ft=null,et=null,nt=!1,ht=null,lt=null,pt=null,vt=null,kt=null;Vt.height!==void 0&&(Vt.height=Math.round(Vt.height)),Vt.width!==void 0&&(Vt.width=Math.round(Vt.width));var Et=function(Te){return parseFloat(Te)>4?parseFloat(Te):5};un.setHTML5Codebase=function(Te,ln){Yt=Te,He(Te,ln)},un.setJavaCodebase=un.setJavaCodebaseVersion=un.isCompiledInstalled=un.setPreCompiledScriptPath=un.setPreCompiledResourcePath=function(){},un.setHTML5CodebaseVersion=function(Te,ln){var pn=parseFloat(Te);if(pn!==NaN&&pn<5){console.log("The GeoGebra HTML5 codebase version "+pn+" is deprecated. Using version latest instead.");return}oe=Te,zt(Te,ln)},un.getHTML5CodebaseVersion=function(){return Ft},un.getParameters=function(){return Vt},un.setFontsCSSURL=function(Te){vt=Te},un.setGiacJSURL=function(Te){},un.setJNLPFile=function(Te){we=Te},un.setJNLPBaseDir=function(Te){},un.inject=function(){function Te(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var ln="auto",pn=Vt.id,ni,Cn=!1,he=0;he<arguments.length;he++){var Ae=arguments[he];typeof Ae=="string"?(Ae=Ae.toLowerCase(),Ae.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?ln=Ae:pn=arguments[he]):typeof Ae=="boolean"?Cn=Ae:Ae instanceof HTMLElement&&(ni=Ae)}hn();function hn(){if(!ye){setTimeout(hn,200);return}ln=so(ln);var De=ni||document.getElementById(pn);if(!De){console.log("possibly bug on ajax loading? ");return}if(un.removeExistingApplet(De,!1),Vt.width===void 0&&De.clientWidth&&(Vt.width=De.clientWidth),Vt.height===void 0&&De.clientHeight&&(Vt.height=De.clientHeight),!(Vt.width&&Vt.height)&&ln==="html5"&&(delete Vt.width,delete Vt.height),on=ln,ln==="screenshot")an(De,Vt);else{var Rt=!1;Vt.hasOwnProperty("playButton")&&Vt.playButton||Vt.hasOwnProperty("clickToLoad")&&Vt.clickToLoad?Rt=!0:Vt.hasOwnProperty("playButtonAutoDecide")&&Vt.playButtonAutoDecide&&(Rt=(!Ht()||Te())&&Zt()),Rt?(on="screenshot",Si(De,Vt,Cn,ln)):Ke(De,Vt,Cn)}}};function Ht(){try{return window.self!==window.top}catch(Te){return!0}}function Zt(){return Vt.hasOwnProperty("screenshotGenerator")&&Vt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}un.getViews=function(){return wt},un.isJavaInstalled=function(){return!1};var ie=function(Te){var ln=function(he){var Ae=JSON.parse(he),hn=function(Lt){return Lt.type=="G"||Lt.type=="E"},De=Ae.elements?Ae.elements.filter(hn)[0]:Ae;if(!De||!De.url){pn();return}Vt.fileName=De.url,le(De.settings||{}),wt.is3D=!0;var Rt="https://www.geogebra.org/images/";un.setPreviewImage(ht||De.previewUrl,Rt+"GeoGebra_loading.png",Rt+"applet_play.png"),Te()},pn=function(){Vt.onError&&Vt.onError(),En("Error: Fetching material (id "+Vt.material_id+") failed.",Vt)},ni=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Cn="/materials/"+Vt.material_id+"?scope=basic";re("https://"+ni+"/api/proxy.php?path="+encodeURIComponent(Cn),ln,pn)};function le(Te){var ln=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(pn){Te[pn]=!!Te[pn]}),ln.forEach(function(pn){Vt[pn]===void 0&&Te[pn]!==void 0&&(Vt[pn]=Te[pn])}),Vt.showToolBarHelp===void 0&&(Vt.showToolBarHelp=Vt.showToolBar)}function re(Te,ln,pn){var ni=new XMLHttpRequest;ni.open("GET",Te),ni.onload=function(){ln(ni.responseText)},ni.onerror=pn,ni.send()}un.isHTML5Installed=function(){return!0},un.getLoadedAppletType=function(){return on},un.setPreviewImage=function(Te,ln,pn){ht=Te,lt=ln,pt=pn},un.removeExistingApplet=function(Te,ln){var pn;typeof Te=="string"&&(Te=document.getElementById(Te)),on=null;var ni=null;for(pn=0;pn<Te.childNodes.length;pn++){var Cn=Te.childNodes[pn],he=Cn.className;he==="applet_screenshot"?ln?(Cn.style.display="block",on="screenshot"):Cn.style.display="none":he!=="applet_scaler prerender"&&(Te.removeChild(Cn),ni=he&&he.indexOf("appletParameters")!=-1?Cn.id:null,pn--)}var Ae=Vt.id!==void 0?Vt.id:ni,hn=window[Ae];hn&&typeof hn.getBase64=="function"&&(hn.remove(),window[Ae]=null)},un.refreshHitPoints=function(){if(Et(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Te=un.getAppletObject();return Te&&typeof Te.recalculateEnvironments=="function"?(Te.recalculateEnvironments(),!0):!1},un.startAnimation=function(){var Te=un.getAppletObject();return Te&&typeof Te.startAnimation=="function"?(Te.startAnimation(),!0):!1},un.stopAnimation=function(){var Te=un.getAppletObject();return Te&&typeof Te.stopAnimation=="function"?(Te.stopAnimation(),!0):!1},un.getAppletObject=function(){var Te=Vt.id!==void 0?Vt.id:"ggbApplet";return window[Te]},un.resize=function(){};var Ge=function(Te,ln,pn){var ni=document.createElement("param");ni.setAttribute("name",ln),ni.setAttribute("value",pn),Te.appendChild(ni)},fe=function(Te){return Te&&Te!=="false"},Ke=function(Te,ln,pn){Et(Ft)<=4.2&&(pn=!0);var ni=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Ft||ggbHTML5LoadedCodebaseIsWebSimple&&!nt)&&(ni=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Cn=document.createElement("div");Cn.classList.add("appletParameters","notranslate");var he=ln.width,Ae=ln.height;if(ln.disableAutoScale=ln.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():ln.disableAutoScale,ln.width!==void 0)if(Et(Ft)<=4.4)fe(ln.showToolBar)&&(ln.height-=7),fe(ln.showAlgebraInput)&&(ln.height-=37),ln.width<605&&fe(ln.showToolBar)&&(ln.width=605,he=605);else{var hn=100;(fe(ln.showToolBar)||fe(ln.showMenuBar))&&(ln.hasOwnProperty("customToolBar")&&(ln.customToolbar=ln.customToolBar),hn=fe(ln.showMenuBar)?245:155),he<hn&&(ln.width=hn,he=hn)}Cn.style.border="none",Cn.style.display="inline-block";for(var De in ln)ln.hasOwnProperty(De)&&De!=="appletOnLoad"&&Cn.setAttribute("data-param-"+De,ln[De]);vt&&Cn.setAttribute("data-param-fontscssurl",vt),un.resize=function(){GGBAppletUtils.responsiveResize(Te,ln)},window.addEventListener("resize",function(Pn){un.resize()});var Rt=typeof ln.appletOnLoad=="function"?ln.appletOnLoad:function(){};if(!pn&&ln.width!==void 0){ln.hasOwnProperty("showSplash")||Cn.setAttribute("data-param-showSplash","false");var Lt=Te.querySelector(".applet_scaler.prerender"),Ct=Lt!==null;if(Ct)var Bt=Lt.querySelector(".ggb_preview");else{var Bt=Bi(he,Ae,ln.borderColor,!1);Lt=document.createElement("div"),Lt.className="applet_scaler",Lt.style.position="relative",Lt.style.display="block",Lt.style.width=he+"px",Lt.style.height=Ae+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Lt,"66%"),Et(Ft)>=5?(ln.appletOnLoad=function(Pn){var ki=Te.querySelector(".ggb_preview");ki&&ki.parentNode.removeChild(ki),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Lt),window.GGBT_wsf_view&&$(window).trigger("resize"),Rt(Pn)},Ct||Lt.appendChild(Bt)):Cn.appendChild(Bt),Lt.appendChild(Cn),Ct||Te.appendChild(Lt),setTimeout(function(){un.resize()},1)}else{var _t=document.createElement("div");_t.className="applet_scaler",_t.style.position="relative",_t.style.display="block",_t.appendChild(Cn),Te.appendChild(_t),ln.appletOnLoad=function(Pn){un.resize(),Rt(Pn)}}function Nt(Pn,ki){ki&&typeof ki.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Pn,ki.appletOnLoad):renderGGBElement(Pn),En("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",ki)}function Me(Pn,ki){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Pn,params:ki}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(ai){Nt(ai.article,ai.params)}),html5AppletsToProcess=null)},Et(Ft)<5&&(Pn.className+=" geogebraweb")):Nt(Pn,ki)}if(ni){scriptLoadStarted=!0;for(var wn=0;wn<Cn.childNodes.length;wn++){var pi=Cn.childNodes[wn].tagName;pi==="TABLE"&&(Cn.removeChild(Cn.childNodes[wn]),wn--)}if(ggbHTML5LoadedScript!==null){var Gn=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Gn!=null&&Gn.parentNode.removeChild(Gn)}var Yn=document.createElement("script"),Ci=function(){Me(Cn,ln)};Yn.src=Ye+et,ggbHTML5LoadedCodebaseIsWebSimple=nt,ggbHTML5LoadedCodebaseVersion=Ft,ggbHTML5LoadedScript=Yn.src,En("GeoGebra HTML5 codebase loaded: '"+Ye+"'.",ln),!Yt&&(!oe||oe=="5.0")?(nt?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Ci()):Ye.requirejs?__webpack_require__.e(12).then(function(){var Pn=[__webpack_require__(12)];Ci.apply(null,Pn)}.bind(this)).catch(__webpack_require__.oe):(Yn.onload=Ci,Te.appendChild(Yn))}else Me(Cn,ln);ln.height=Ae,ln.width=he},an=function(Te,ln,pn){var ni=Bi(ln.width,ln.height,ln.borderColor,pn),Cn=document.createElement("div");Cn.style.position="relative",Cn.style.display="block",Cn.style.width=ln.width+"px",Cn.style.height=ln.height+"px",Cn.className="applet_screenshot applet_scaler"+(pn?" applet_screenshot_play":""),Cn.appendChild(ni);var he=GGBAppletUtils.getScale(ln,Te,pn);pn?(Te.appendChild(oi()),window.GGBT_wsf_view||(Te.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Cn,"66%"),Te.appendChild(Cn),he!==1&&!isNaN(he)&&(GGBAppletUtils.scaleElement(Cn,he),Cn.style.width=ln.width+"px",Cn.style.height=ln.height+"px",Cn.parentNode.style.width=ln.width*he+"px",Cn.parentNode.style.height=ln.height*he+"px"),un.resize=function(){nn(Te,ni,Cn,pn)},window.addEventListener("resize",function(Ae){un.resize()}),un.resize()};function nn(Te,ln,pn,ni){if(Te.contains(ln)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Te.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Te)}var Cn=GGBAppletUtils.getScale(Vt,Te,ni);pn.parentNode!==null&&(!isNaN(Cn)&&Cn!==1?(GGBAppletUtils.scaleElement(pn,Cn),pn.parentNode.style.width=Vt.width*Cn+"px",pn.parentNode.style.height=Vt.height*Cn+"px"):(GGBAppletUtils.scaleElement(pn,1),pn.parentNode.style.width=Vt.width+"px",pn.parentNode.style.height=Vt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Te),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}un.onExitFullscreen=function(Te,ln){ln.appendChild(Te)};var Si=function(Te,ln,pn,ni){an(Te,ln,!0);for(var Cn=function(){var hn=[];for(Ae=0;Ae<Te.childNodes.length;Ae++)hn.push(Te.childNodes[Ae]);if(window.GGBT_wsf_view){var De=window.GGBT_wsf_view.renderFullScreen(Te,ln.id),Rt=document.getElementById("fullscreencontainer"),Lt=jQuery(Te).find(".fullscreencontent");Lt.length>0?(De.remove(),Lt.attr("id","fullscreencontent").show(),jQuery(Rt).append(Lt),window.dispatchEvent(new Event("resize"))):Ke(De,ln,!1),window.GGBT_wsf_view.launchFullScreen(Rt)}else on=ni,Ke(Te,ln,!1);if(!window.GGBT_wsf_view)for(Ae=0;Ae<hn.length;Ae++)Te.removeChild(hn[Ae])},he=Te.getElementsByClassName("ggb_preview_play"),Ae=0;Ae<he.length;Ae++)he[Ae].addEventListener("click",Cn,!1),he[Ae].addEventListener("ontouchstart",Cn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Te),Zt()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},oi=function(){var Te=document.createElement("div");if(Te.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var ln='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',pn=document.createElement("style");pn.styleSheet?pn.styleSheet.cssText=ln:pn.appendChild(document.createTextNode(ln)),document.getElementsByTagName("head")[0].appendChild(pn)}return Te},Bi=function(Te,ln,pn,ni){var Cn=document.createElement("div");Cn.className="ggb_preview",Cn.style.position="absolute",Cn.style.zIndex="90",Cn.style.width=Te-2+"px",Cn.style.height=ln-2+"px",Cn.style.top="0px",Cn.style.left="0px",Cn.style.overflow="hidden",Cn.style.backgroundColor="white";var he="lightgrey";pn!==void 0&&(pn==="none"?he="transparent":he=pn),Cn.style.border="1px solid "+he;var Ae=document.createElement("img");if(Ae.style.position="relative",Ae.style.zIndex="1000",Ae.style.top="-1px",Ae.style.left="-1px",ht!==null&&Ae.setAttribute("src",ht),Ae.style.opacity=.7,lt!==null){var hn,De,Rt;if(!ni){hn=document.createElement("img"),hn.style.position="absolute",hn.style.zIndex="1001",hn.style.opacity=1,Ae.style.opacity=.3,De=360,De>Te/4*3&&(De=Te/4*3),Rt=De/5.8,hn.setAttribute("src",lt),hn.setAttribute("width",De),hn.setAttribute("height",Rt);var Lt=(Te-De)/2,Ct=(ln-Rt)/2;hn.style.left=Lt+"px",hn.style.top=Ct+"px",Cn.appendChild(hn)}}return Cn.appendChild(Ae),Cn},so=function(Te){return Te=Te.toLowerCase(),Te==="html5"||Te==="screenshot"?Te:"html5"},Qt=["web","webSimple","web3d","tablet","tablet3d","phone"],zt=function(Te,ln){if(Ft=Te,ln){He(Ft,!0);return}var pn=!ue;if(pn){var ni=Et(Ft);!isNaN(ni)&&ni<4.4&&(pn=!1)}var Cn,he;window.location.protocol.substr(0,4)==="http"?Cn=window.location.protocol:Cn="http:";var Ae=Ft.indexOf("//");Ae>0?he=Ft:Ae===0?he=Cn+Ft:he="https://www.geogebra.org/apps/5.2.814.0/";for(var hn in Qt)if(Ft.slice(Qt[hn].length*-1)===Qt[hn]||Ft.slice((Qt[hn].length+1)*-1)===Qt[hn]+"/"){He(he,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&pn&&!wt.is3D&&!wt.AV&&!wt.SV&&!wt.CV&&!wt.EV2&&!wt.CP&&!wt.PC&&!wt.DA&&!wt.FI&&!wt.PV&&!fe(Vt.showToolBar)&&!fe(Vt.showMenuBar)&&!fe(Vt.showAlgebraInput)&&!fe(Vt.enableRightClick)&&(!Vt.appName||Vt.appName=="classic")?he+="webSimple/":he+="web3d/",He(he,!1)},He=function(Te,ln){if(Te.requirejs){Ye=Te;return}Te.slice(-1)!=="/"&&(Te+="/"),Ye=Te,ln===null&&(ln=Te.indexOf("http")===-1),Be=ln,et="web.nocache.js",nt=!1;var pn=Ye.split("/");pn.length>1&&(!ln&&pn[pn.length-2]==="webSimple"?(et="webSimple.nocache.js",nt=!0):Qt.indexOf(pn[pn.length-2])>=0&&(et=pn[pn.length-2]+".nocache.js")),pn=Te.split("/"),Ft=pn[pn.length-3],Ft.substr(0,4)==="test"?Ft=Ft.substr(4,1)+"."+Ft.substr(5,1):(Ft.substr(0,3)==="war"||Ft.substr(0,4)==="beta")&&(Ft="5.0");var ni=parseFloat(Ft);ni!==NaN&&ni<5&&Te.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+ni+" is deprecated. Using version latest instead."),zt("5.0",ln))},En=function(Te,ln){window.console&&window.console.log&&(!ln||typeof ln.showLogging=="undefined"||ln.showLogging&&ln.showLogging!=="false")&&console.log(Te)};Vt.material_id!==void 0?ie(Fn):Fn();function Fn(){var Te=Rn;oe!==null?Te=oe:parseFloat(Te)<5&&(Te="5.0"),zt(Te,!1),Yt!==null&&He(Yt,Be),ye=!0}return un},GGBAppletUtils=function(){"use strict";function un(){return window.GGBT_wsf_edit!==void 0}function Rn(ye,oe){oe!=1?(ye.style.transformOrigin="0% 0% 0px",ye.style.webkitTransformOrigin="0% 0% 0px",ye.style.transform="scale("+oe+","+oe+")",ye.style.webkitTransform="scale("+oe+","+oe+")",ye.style.maxWidth="initial",ye.querySelector(".ggb_preview")!==null&&(ye.querySelector(".ggb_preview").style.maxWidth="initial"),ye.querySelectorAll(".ggb_preview img")[0]!==void 0&&(ye.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),ye.querySelectorAll(".ggb_preview img")[1]!==void 0&&(ye.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(ye.style.transform="none",ye.style.webkitTransform="none")}function Vt(ye,oe,Yt,Ne,ge,we){var Ye=null;if(we!=null&&we!="")for(var Be=ye.parentNode;Be!=null;)if((" "+Be.className+" ").indexOf(" "+we+" ")>-1){Ye=Be;break}else Be=Be.parentNode;var on=0,Ft=0,et=0,nt=0,ht=0,lt=0,pt=0;if(Ye)on=Ye.offsetWidth,Ft=Math.max(Ne?Ye.offsetWidth:0,Ye.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(on=Math.min(window.innerWidth,document.documentElement.clientWidth),Ft=Math.min(window.innerHeight,document.documentElement.clientHeight),et=on):(on=window.innerWidth,Ft=window.innerHeight,et=window.innerWidth),ye){var vt=ye.getBoundingClientRect();vt.left>0&&vt.left<=on&&(ge===void 0||!ge)&&(document.dir==="rtl"?(ht=on-vt.width-vt.left,lt=et<=480?10:30):(lt=vt.left,ht=et<=480?10:30),nt=lt+ht)}if(ye&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var kt=ye.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(nt=40,pt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(nt=0,pt=40)}}return ye&&((Yt===void 0||!Yt)&&oe>0&&oe+nt<on?on=oe:on-=nt,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Yt===void 0||!Yt)&&(Ft-=pt)),{width:on,height:Ft}}function wt(ye,oe,Yt,Ne,ge){if(ye.isScreenshoGenerator)return 1;var we=Ne!==void 0&&Ne,Ye=ye.noScaleMargin!=null&&ye.noScaleMargin,Be=function(kt){return kt&&kt!=="false"},on=Be(ye.autoHeight),Ft=Vt(oe,ye.width,Yt,on,we&&window.GGBT_wsf_view||Ye,ge),et=parseInt(Ft.width),nt=ye.width,ht=ye.height;if(nt===void 0){var lt=oe.querySelector(".appletParameters");lt&&(nt=lt.offsetWidth,ht=lt.offsetHeight)}var pt=et/nt,vt=we?1:Ft.height/ht;return Yt!==void 0&&!Yt&&(pt=Math.min(1,pt),vt=Math.min(1,vt)),Math.min(pt,vt)}function ue(ye,oe,Yt){var Ne=1,ge,we=!1;if(ye.hasOwnProperty("allowUpscale")&&(we=ye.allowUpscale),ye.hasOwnProperty("scale")&&(Ne=parseFloat(ye.scale),(isNaN(Ne)||Ne===null||Ne===0)&&(Ne=1),Ne>1&&(we=!0)),oe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(we=!0),!(ye.hasOwnProperty("disableAutoScale")&&ye.disableAutoScale))ge=wt(ye,oe,we,Yt,ye.scaleContainerClass);else return Ne;return we&&(!ye.hasOwnProperty("scale")||Ne===1)?ge:Math.min(Ne,ge)}function _e(ye){var oe=Math.min(window.innerWidth,document.documentElement.clientWidth),Yt=Math.min(window.innerHeight,document.documentElement.clientHeight),Ne=ye.getBoundingClientRect(),ge=(oe-Ne.width)/2,we=(Yt-Ne.height)/2;we<0&&(we=0),ye.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ge<40?ye.style.left="40px":ye.style.left=ge+"px",ye.style.top=we+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(we<40?ye.style.top="40px":ye.style.top=we+"px",ye.style.left=ge+"px")}function $e(ye,oe){var Yt=ye.querySelector(".appletParameters");if(Yt){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(oe.id!==Yt.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(ye)}if(Yt.parentElement&&/fullscreen/.test(Yt.parentElement.className))return;var Ne=ue(oe,ye);un()&&Yt.setAttribute("data-param-scale",Ne);for(var ge=null,we=0;we<ye.childNodes.length;we++)if(ye.childNodes[we].className!==void 0&&ye.childNodes[we].className.match(/^applet_scaler/)){ge=ye.childNodes[we];break}if(ge!==null&&ge.querySelector(".noscale")!==null)return;var Ye=oe.id!==void 0?oe.id:"ggbApplet",Be=window[Ye];(Be==null||!Be.recalculateEnvironments)&&ge!==null&&!ge.className.match(/fullscreen/)&&(ge.parentNode.style.transform="",!isNaN(Ne)&&Ne!==1?(ge.parentNode.style.width=oe.width*Ne+"px",ge.parentNode.style.height=oe.height*Ne+"px",Rn(ge,Ne)):(Rn(ge,1),ge.parentNode.style.width=oe.width+"px",ge.parentNode.style.height=oe.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&_e(ye),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Yt).parents(".content-added-content"))}}return{responsiveResize:$e,isFlexibleWorksheetEditor:un,positionCenter:_e,getScale:ue,scaleElement:Rn}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var un=n.location.search;return un.indexOf(J)!=-1||un.indexOf(K)!=-1}function q(un,Rn){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(un){var Rn=s[L].bindings;s[L].bindings=function(){for(var Vt=Rn?Rn():{},wt=un[webModule.__softPermutationId],ue=O;ue<wt.length;ue++){var _e=wt[ue];Vt[_e[O]]=_e[P]}return Vt}};var t;function u(){return v(),t}function v(){if(!t){var un=o.createElement(Q);if(un.id=L,un.style.cssText=R+S,un.tabIndex=-1,o.body.appendChild(un),t=un.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Rn=document.compatMode==U?V:W;t.write(Rn+X),t.close()}}}function w(un){function Rn(wt){function ue(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var _e=ue();if(_e){wt();return}function $e(){if(!_e){if(!ue())return;_e=!0,wt(),o.removeEventListener&&o.removeEventListener(Z,$e,!1),ye&&clearInterval(ye)}}o.addEventListener&&o.addEventListener(Z,$e,!1);var ye=setInterval(function(){$e()},$)}function Vt(wt){var ue=u(),_e=ue.body,$e=ue.createElement(_);$e.language=ab,$e.crossOrigin=W,$e.src=wt,webModule.__errFn&&($e.onerror=function(){webModule.__errFn(L,new Error(bb+wt))}),_e.appendChild($e)}Rn(function(){Vt(un)})}webModule.__startLoadingFragment=function(un){return C(un)},webModule.__installRunAsyncCode=function(un){var Rn=u(),Vt=Rn.body,wt=Rn.createElement(_);wt.language=ab,wt.text=un,Vt.appendChild(wt),Vt.removeChild(wt)};function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(un){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(un){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(un){var Rn=c[un];return Rn==null?null:Rn},r=d,webModule.__errFn=e}function B(){function un(ye){var oe=ye.lastIndexOf(rb);oe==-1&&(oe=ye.length);var Yt=ye.indexOf(sb);Yt==-1&&(Yt=ye.length);var Ne=ye.lastIndexOf(tb,Math.min(Yt,oe));return Ne>=O?ye.substring(O,Ne+P):W}function Rn(ye){if(!ye.match(/^\w+:\/\//)){var oe=o.createElement(ub);oe.src=ye+vb,ye=un(oe.src)}return ye}function Vt(){var ye=__gwt_getMetaProperty(wb);return ye!=null?ye:W}function wt(){for(var ye=o.getElementsByTagName(_),oe=O;oe<ye.length;++oe)if(ye[oe].src.indexOf(xb)!=-1)return un(ye[oe].src);return W}function ue(){var ye=o.getElementsByTagName(yb);return ye.length>O?ye[ye.length-P].href:W}function _e(){var ye=o.location;return ye.href==ye.protocol+zb+ye.host+ye.pathname+ye.search+ye.hash}var $e=Vt();return $e==W&&($e=wt()),$e==W&&($e=ue()),$e==W&&_e()&&($e=un(o.location.href)),$e=Rn($e),$e}function C(un){return un.match(/^\//)||un.match(/^[a-zA-Z]+:\/\//)?un:webModule.__moduleBase+un}function D(){var un=[],Rn=O,Vt=[],wt=[];function ue(ye){var oe=wt[ye](),Yt=Vt[ye];if(oe in Yt)return oe;var Ne=[];for(var ge in Yt)Ne[Yt[ge]]=ge;throw r&&r(ye,Ne,oe),null}if(__gwt_isKnownPropertyValue=function(ye,oe){return oe in Vt[ye]},webModule.__getPropMap=function(){var ye={};for(var oe in Vt)Vt.hasOwnProperty(oe)&&(ye[oe]=ue(oe));return ye},webModule.__computePropValue=ue,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var _e;try{_e=Cb;var $e=_e.indexOf(Db);$e!=-1&&(Rn=parseInt(_e.substring($e+P),$),_e=_e.substring(O,$e))}catch(ye){}return webModule.__softPermutationId=Rn,C(_e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},15476:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Ax:function(){return $e},Ds:function(){return ye},KI:function(){return Yt},SI:function(){return _e},f1:function(){return ue}});var wt=Vt(11320);function ue(Ne){let ge=!0;if(Ne.length>0){for(let we=0;we<Ne.length;we++)if(Ne[we].compile_success==0||!Ne[we].compile_success){ge=!1;break}}else ge=!1;return ge}function _e(Ne,ge=""){let we=[];for(let Ye=0;Ye<Ne.length;Ye++){let Be=Ne[Ye],on=ge?`${ge}/${Be.name}`:`${Be.name}`;we.push({title:Be.name,type:Be.type,isLeaf:Be.type!=="tree",key:on})}return we}function $e(Ne,ge,we){for(let Ye=0;Ye<Ne.length;Ye++){let Be=Ne[Ye];if(Be.key===ge){Be.children=we;break}Be.children&&$e(Be.children,ge,we)}return Ne}function ye(Ne,ge,we){let Ye;return function(){let Be=this,on=arguments,Ft=function(){Ye=null,we||Ne.apply(Be,on)},et=we&&!Ye;clearTimeout(Ye),Ye=setTimeout(Ft,ge),et&&Ne.apply(Be,on)}}const oe=!0,Yt=wt.Z.API_SERVER},73646:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return ge}});var wt=Vt(67294),ue=Vt(28802),_e=Vt(66309),$e=Vt(2453),ye={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},oe=Vt(38308);const{TextArea:Yt}=ue.default;class Ne extends wt.Component{constructor(Ye){super(Ye),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Ye,onAnswerChange:Be,addChildAnswer:on,exerciseIsPublish:Ft,answers:et,activeOptionErrorIndex:nt,flex:ht="0 0 1000px"}=this.props;console.log("----",et);let{inputVisible:lt,EditInputIndex:pt}=this.state;return wt.createElement("div",{className:ye.flex},wt.createElement("div",{className:`${ye.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Ye+1,"):"),wt.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},et==null?void 0:et.map((vt,kt)=>wt.createElement(wt.Fragment,null,pt!==kt?(vt==null?void 0:vt.length)>0?wt.createElement(_e.default,{className:"edit-tag",key:vt,closable:!((et==null?void 0:et.length)===1&&kt===0),onClose:Et=>{Et.preventDefault(),(et==null?void 0:et.length)===1&&kt===0?this.props.deleteChildAnswermain(Ye,kt):this.props.deleteChildAnswer(Ye,kt)}},wt.createElement("span",{onDoubleClick:Et=>{this.setState({EditInputIndex:kt}),Et.preventDefault()}},vt)):wt.createElement(ue.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){$e.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}Be(Ye,kt,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):wt.createElement(ue.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){$e.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}Be(Ye,kt,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!lt&&wt.createElement(_e.default,{className:"site-tag-plus",onClick:()=>{on(Ye),this.setState({inputVisible:!0})}},wt.createElement(oe.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var ge=Ne},35566:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return Ft}});var wt=Vt(67294),ue=Vt(35567),_e=Object.defineProperty,$e=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable,ge=(et,nt,ht)=>nt in et?_e(et,nt,{enumerable:!0,configurable:!0,writable:!0,value:ht}):et[nt]=ht,we=(et,nt)=>{for(var ht in nt||(nt={}))Yt.call(nt,ht)&&ge(et,ht,nt[ht]);if(oe)for(var ht of oe(nt))Ne.call(nt,ht)&&ge(et,ht,nt[ht]);return et},Ye=(et,nt)=>$e(et,ye(nt)),Be=(et,nt,ht)=>ge(et,typeof nt!="symbol"?nt+"":nt,ht);const on="\u2581";class Ft extends wt.Component{constructor(){super(...arguments),Be(this,"getChCountBeforeCursor",(nt,ht)=>{const lt=ht.line;let pt=0;for(let kt=0;kt<lt;kt++)pt+=nt.getLine(kt).split(on).length-1;const vt=nt.getLine(lt).substring(0,ht.ch);return pt+=vt.split(on).length-1,pt}),Be(this,"onCMBeforeChange",(nt,ht)=>{const lt=nt.getRange(ht.from,ht.to);let pt=0;if(ht.text.forEach(vt=>{pt+=vt.split(on).length-1}),lt&&lt.indexOf(on)!=-1){const vt=lt.split(on).length-1,kt=this.getChCountBeforeCursor(nt,ht.from);console.log(`\u5220\u9664${vt}\u4E2A\uFF0C \u4E4B\u524D\u6709${kt}\u4E2A\uFF0C\u65B0\u589E${pt}\u4E2A`),this.props.deleteEmptyDisabled?ht.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(kt,vt,pt)}else if(pt){const vt=this.getChCountBeforeCursor(nt,ht.from);console.log(`\u65B0\u589E${pt}\u4E2A\uFF0C\u4E4B\u524D\u6709${vt}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(vt,0,pt)}})}render(){return wt.createElement(ue.Z,Ye(we({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},63205:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return Ye}});var wt=Vt(67294),ue={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},_e=Vt(94184),$e=Vt.n(_e),ye=Vt(74330),oe=Vt(15979),Yt=Vt(33170),Ne=Vt(28706),ge=(Be,on,Ft)=>new Promise((et,nt)=>{var ht=vt=>{try{pt(Ft.next(vt))}catch(kt){nt(kt)}},lt=vt=>{try{pt(Ft.throw(vt))}catch(kt){nt(kt)}},pt=vt=>vt.done?et(vt.value):Promise.resolve(vt.value).then(ht,lt);pt((Ft=Ft.apply(Be,on)).next())}),Ye=({data:Be,className:on,fullWidth:Ft,style:et={},onClose:nt,onOk:ht,showFullTools:lt,noAssociationId:pt})=>{const vt=(0,wt.useRef)(null),kt=(0,wt.useRef)(null),Et=(0,wt.useRef)(null),Ht=(0,wt.useRef)(null),[Zt,ie]=(0,wt.useState)(!1),[le,re]=(0,wt.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,wt.useEffect)(()=>(Et.current||(Et.current=document.createElement("style"),document.head.appendChild(Et.current)),Be!=null&&Be.visible?(document.body.setAttribute("data-custom","y-hidden"),Et.current.innerHTML=" html { overflow-y: hidden; }",Be!=null&&Be.src&&Ge()):(document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)),()=>{document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)}),[Be==null?void 0:Be.visible]);const Ge=()=>ge(void 0,null,function*(){ie(!0),re("\u6B63\u5728\u52A0\u8F7D\u4E2D");const nn=yield(0,Ne.ZJ)(Be==null?void 0:Be.src);vt.current.src="",vt.current.src=nn,vt.current.onload=function(){an()},ie(!1),re("")}),fe=nn=>ge(void 0,null,function*(){ie(!0),re("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Si=yield(0,Yt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Be.title,file:nn.dataUrl}});Si!=null&&Si.id&&!pt?(yield(0,Yt.ZP)(`/api/attachments/${Be.id}/add_subitem.json`,{method:"post",body:{subitem_id:Si==null?void 0:Si.id,settings:JSON.stringify(nn.state)}})).status===0&&ht():Si!=null&&Si.id&&ht(Si),ie(!1),re("")}),Ke=()=>{const nn=document.querySelector('a[href="https://markerjs.com/"]');nn&&nn.parentNode&&(nn.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(oi=>{const Bi=document.querySelector(oi.name);Bi&&Bi.setAttribute("title",oi.title)})},an=()=>{kt.current=new oe.hP(vt.current),kt.current.targetRoot=Ht.current,kt.current.addEventListener("render",fe),kt.current.addEventListener("beforeclose",nt),lt&&(kt.current.availableMarkerTypes=kt.current.ALL_MARKER_TYPES,kt.current.uiStyleSettings.redoButtonVisible=!0,kt.current.uiStyleSettings.notesButtonVisible=!0,kt.current.uiStyleSettings.zoomButtonVisible=!0,kt.current.uiStyleSettings.zoomOutButtonVisible=!0,kt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=kt.current.uiStyleSettings,kt.current.show(),Be!=null&&Be.snapshotData&&kt.current.restoreState(Be.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Ke()},300)};return wt.createElement(wt.Fragment,null,(Be==null?void 0:Be.visible)&&wt.createElement(ye.Z,{spinning:Zt,tip:le,style:{position:"absolute",width:"100vw"}},wt.createElement("div",{ref:Ht,className:$e()(ue.imageDimensions,on,Ft?ue.fullWidth:""),style:et},wt.createElement("img",{className:ue.img,ref:vt}))))}},36527:function(un,Rn,Vt){"use strict";var wt=Vt(67294),ue=Vt(71230),_e=Vt(15746),$e=Vt(55238),ye=Vt(85804),oe=Vt(65226),Yt=Vt(71736),Ne=Vt(84279),ge=Vt(67294);const we=(0,wt.forwardRef)(({callback:Ye,showSaveButton:Be,value:on=""},Ft)=>{const et=(0,wt.useRef)(),nt=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],ht=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
x=a + r\\text{cos}\\theta \\ \r
y=b + r\\text{sin}\\theta \r
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\left\\{\\begin{matrix} \r
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
\\end{matrix}\\right. \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
a \\perp \\alpha \\ \r
b \\perp \\alpha \r
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
a \\parallel \\partial ,b \\parallel \\partial \r
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
a \\perp m,a \\perp n \r
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
a^{2}+b^{2}=c^{2} \r
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
a,b \\in R^{+} \\ \r
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
a,b \\in R \\ \r
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
P \\left( \\emptyset \\right) =0 \\\\ \r
P \\left( S \\right) =1 \r
\\end{array}`},{value:`\\begin{array}{c} \r
\\forall A \\in S \\\\ \r
P \\left( A \\right) \\ge 0 \r
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
\\end{array}`},{value:`\\begin{array}{c} \r
P_{n}=n! \\\\ \r
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
\\end{array}`}]}]}],lt=kt=>{et.current.setValue(et.current.getValue()+" "+kt.value+" ")},pt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ge.createElement(ue.Z,{className:Yt.Z.lists,gutter:[10,10]},nt.map((kt,Et)=>ge.createElement(_e.Z,{flex:"110px",className:Yt.Z.item},ge.createElement("div",null,ge.createElement(oe.Z,{value:`$$${kt.value}$$`}),kt.name),ge.createElement("div",{className:Yt.Z.children},kt.children.map((Ht,Zt)=>ge.createElement("div",{key:Zt},ge.createElement("h1",null,Ht.name),ge.createElement(ue.Z,{gutter:[10,10]},Ht.data.map((ie,le)=>ge.createElement(_e.Z,{key:le,onClick:()=>lt(ie),className:Yt.Z.diamond},ge.createElement(oe.Z,{value:"`$$"+ie.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ge.createElement(ue.Z,{className:Yt.Z.lists,gutter:[10,10]},ht.map((kt,Et)=>ge.createElement(_e.Z,{flex:"110px",className:Yt.Z.item},ge.createElement("div",null,ge.createElement(oe.Z,{value:"`$$"+kt.value+"$$`"}),kt.name),ge.createElement("div",{className:Yt.Z.children},kt.children.map((Ht,Zt)=>ge.createElement("div",{key:Zt},Ht.name&&ge.createElement("h1",null,Ht.name),ge.createElement(ue.Z,{gutter:[10,10]},Ht.data.map((ie,le)=>ge.createElement(_e.Z,{key:le,onClick:()=>lt(ie),className:Yt.Z.diamond},ge.createElement(oe.Z,{value:"`$$"+ie.value+"$$`"}))))))))))}],vt=()=>{var kt=document.createElement("div");kt.innerHTML=et.current.getValue();var Et=kt.innerText;return Ye&&Ye(Et),Et};return(0,wt.useImperativeHandle)(Ft,()=>({getData:vt})),ge.createElement("div",{className:Yt.Z.mathWrap},ge.createElement($e.default,{defaultActiveKey:"1",items:pt}),ge.createElement("math-field",{locale:"zh_cn",className:Yt.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:et,style:{width:800,marginTop:30,fontSize:18}},on||""),Be&&ge.createElement("div",{className:Yt.Z.button},ge.createElement(ye.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Rn.Z=we},26194:function(un,Rn,Vt){"use strict";var wt=Vt(67294),ue=Vt(4977),_e=Vt(85804),$e=Object.defineProperty,ye=Object.defineProperties,oe=Object.getOwnPropertyDescriptors,Yt=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,we=(Ft,et,nt)=>et in Ft?$e(Ft,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):Ft[et]=nt,Ye=(Ft,et)=>{for(var nt in et||(et={}))Ne.call(et,nt)&&we(Ft,nt,et[nt]);if(Yt)for(var nt of Yt(et))ge.call(et,nt)&&we(Ft,nt,et[nt]);return Ft},Be=(Ft,et)=>ye(Ft,oe(et));const on=({img:Ft,buttonProps:et={},styles:nt={},customText:ht,ButtonText:lt,ButtonClick:pt,Buttonclass:vt,ButtonTwo:kt,imgStyles:Et,loading:Ht=!1,className:Zt=""})=>wt.createElement("section",{className:`tc animated fadeIn ${Zt}`,style:Ye({color:"#999",margin:"100px auto",visibility:Ht?"hidden":"visible"},nt)},wt.createElement("img",{src:Ft||ue,style:Be(Ye({},Et),{pointerEvents:"none",userSelect:"none"})}),wt.createElement("p",{className:"mt20 font14"},ht||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),lt&&wt.createElement(_e.ZP,Ye({className:vt,onClick:pt},et),lt),kt&&kt);Rn.Z=on},20819:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return vt}});var wt=Vt(67294),ue={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},_e=Vt(85804),$e=Vt(30153),ye=Vt(36295),oe=Vt(83062),Yt=Vt(28706),Ne=Vt(15835),ge=Vt(26194),we=Vt(11320),Ye=Vt(66540),Be=Vt(67294),on=Object.defineProperty,Ft=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ht=(kt,Et,Ht)=>Et in kt?on(kt,Et,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):kt[Et]=Ht,lt=(kt,Et)=>{for(var Ht in Et||(Et={}))et.call(Et,Ht)&&ht(kt,Ht,Et[Ht]);if(Ft)for(var Ht of Ft(Et))nt.call(Et,Ht)&&ht(kt,Ht,Et[Ht]);return kt},pt=(kt,Et,Ht)=>new Promise((Zt,ie)=>{var le=fe=>{try{Ge(Ht.next(fe))}catch(Ke){ie(Ke)}},re=fe=>{try{Ge(Ht.throw(fe))}catch(Ke){ie(Ke)}},Ge=fe=>fe.done?Zt(fe.value):Promise.resolve(fe.value).then(le,re);Ge((Ht=Ht.apply(kt,Et)).next())}),vt=({editOffice:kt="view",data:Et,issaver:Ht,onSaver:Zt,theme:ie,type:le,filename:re,monacoEditor:Ge,className:fe,style:Ke,close:an,onClose:nn,hasMask:Si,disabledDownload:oi,onImgDimensions:Bi,showNodata:so,recordInfo:Qt})=>{const[zt,He]=(0,wt.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[En,Fn]=(0,wt.useState)(""),[Te,ln]=(0,wt.useState)(),pn=window.ENV==="build"?"/react/build":"",ni=location.host.startsWith("localhost")?we.Z.PROXY_SERVER:we.Z.API_SERVER,he=10*(1024*1024),Ae=(0,wt.useRef)();Et!=null&&Et.startsWith("/api")&&le!=="txt"&&(Et=we.Z.API_SERVER+Et);const hn=Bt=>Bt.substring(Bt.lastIndexOf("/")+1).split(".").pop();re&&Ge&&(Ge.filename=re),(0,wt.useEffect)(()=>{var Bt,_t;const Nt=(_t=(Bt=document.cookie)==null?void 0:Bt.replace(/\s/g,""))==null?void 0:_t.split(";");Nt==null||Nt.map(Me=>{let wn=Me.split("=");wn[0]==="_educoder_session"&&Fn(wn[1])})},[]),(0,wt.useEffect)(()=>{le==="office"&&(Et.indexOf("bigfilescdn.")>-1||Et.indexOf("bigfiles1")>-1?ln({url:Et,fileType:hn(Et),model:Et.indexOf("model=edit")?"edit":"view"}):Rt())},[le,Et]);function De(Bt){return pt(this,null,function*(){Bt.data.type==="pdfdata"&&(Zt(Bt.data.data),window.removeEventListener("message",De,!1)),console.log("mess---:",Bt.data)})}const Rt=()=>pt(void 0,null,function*(){console.log("data:",Et);let Bt=Et;Et.startsWith("http")||(Bt=location.origin+Bt);let _t=new URL(Bt).pathname.split("/").pop();const Nt=yield(0,Ne.gJ)({attachment_id:_t});Nt.url=ni+Nt.url,ln(Nt)}),Lt=()=>{if(Et.startsWith("http")||Et.startsWith("blob:")){Ct();return}(0,Yt.Sv)(re||"educoder",Et,re)},Ct=()=>{Qt&&(0,Ye.fc)({id:Qt==null?void 0:Qt.id,watch_type:1,course_id:Qt==null?void 0:Qt.course_id}),(0,Yt.Nd)(re||"educoder",decodeURIComponent(Et))};return Be.createElement("div",{style:lt({},Ke||{}),className:`${Si&&ue.bgBlack} ${le?ue.wrp:"hide"}`},an&&Be.createElement("div",{className:ue.close,ref:Ae},!!Bi&&Be.createElement(oe.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Ae.current},Be.createElement("span",{onClick:()=>{nn(),Bi()}},Be.createElement("i",{className:"icon-yulanpizhu"}))),!oi&&Be.createElement(oe.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Ae.current},Be.createElement("span",{onClick:Ct},Be.createElement("i",{className:"icon-quxiaozhiding"}))),Ht&&Be.createElement(oe.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Ae.current},Be.createElement("span",{className:"",onClick:()=>{const Bt=document.getElementById("pdfiframe");window.addEventListener("message",De,!1),setTimeout(()=>{Bt.contentWindow.postMessage("getData","*")},300)}},Be.createElement("i",{className:"icon-baocun"}))),Be.createElement(oe.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Ae.current},Be.createElement("span",{className:"",onClick:()=>{nn()}},Be.createElement("i",{className:"icon-guanbi1"})))),Be.createElement("div",{className:`${ue[fe]} ${fe} ${ue.monaco} ${le==="txt"?"show":"hide"}`},le==="txt"&&Be.createElement(Be.Fragment,null,Be.createElement(ye.ZP,lt({},Ge)))),le==="audio"&&Be.createElement("audio",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Et}`,autoPlay:!0}),le==="video"&&Be.createElement(Be.Fragment,null,(Et==null?void 0:Et.indexOf("http"))>-1?Be.createElement("video",{controls:!0,src:`${Et}`,autoPlay:!0}):Be.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Et}`,autoPlay:!0})),le==="office"&&Te&&Be.createElement("iframe",{src:`${pn}/office.html?key=${Te.key}&url=${btoa(Te.url)}&callbackUrl=${ni+(Te.callbackUrl||"")}&fileType=${Te.fileType}&title=${Te.title||""}&model=${kt}&officeServer=${we.Z.ONLYOFFICE}&disabledDownload=${!!oi}`}),le==="html"&&Be.createElement("iframe",{src:Et+"&disposition=inline"}),le==="pdf"&&Be.createElement("iframe",{id:"pdfiframe",src:`${pn}/js/pdfview/index.html?filename=${re||"educoder.pdf"}&url=${encodeURIComponent(Et)}&disabledDownload=${!!oi}&model=${kt}`}),le==="image"&&Be.createElement("img",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Et}`}),(le==="other"||le==="download")&&Be.createElement(Be.Fragment,null,so?Be.createElement(ge.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:Be.createElement(_e.ZP,{icon:Be.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Lt,disabled:oi},"\u4E0B\u8F7D")}):Be.createElement(_e.ZP,{type:"primary",size:"middle",onClick:Lt,disabled:oi},Be.createElement($e.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},65226:function(un,Rn,Vt){"use strict";Vt.d(Rn,{z:function(){return le},Z:function(){return re}});var wt=Vt(67294),ue=Vt(81897),_e=Vt(51161),$e=Vt(11771),ye=Vt(67631),oe=Vt.n(ye),Yt=Vt(11320),Ne=Vt(28706),ge=Vt(20527),we=Vt(25934),Ye=Vt(20819),Be=Vt(67294),Ft=({html:Ge})=>{const fe=(0,wt.useRef)(null),Ke=(0,wt.useRef)(null),an=`.markdown-body p {
margin: 0 0 16px 0 !important;
line-height: 28px;
white-space: pre-wrap;
}
ol,
ul,
li {
list-style-type: none
}
ol,
ul,
dl {
margin-bottom: 0px;
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
overflow: hidden;
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
word-break: break-word;
font-size: 16px;
line-height: 1.6;
white-space: normal;
word-wrap: break-word;
position: relative;
}
.markdown-body ul>li {
list-style-type: disc;
}
.markdown-body ol>li {
list-style-type: decimal;
}
.markdown-body a {
background: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body * {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body input {
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4183c4;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
ul.linenums,
ol.linenums {
padding: 16px 0 0 56px !important;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .anchor {
position: absolute;
top: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote> :first-child {
margin-top: 0;
}
.markdown-body blockquote> :last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
text-align: revert;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
}
.markdown-body code:has(.katex) {
background-color: transparent;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-mdh,
.markdown-body .pl-mm,
.markdown-body .pl-mp,
.markdown-body .pl-mr,
.markdown-body .pl-s1 .pl-v,
.markdown-body .pl-s3,
.markdown-body .pl-sc,
.markdown-body .pl-sv {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s1 .pl-s2,
.markdown-body .pl-smi,
.markdown-body .pl-smp,
.markdown-body .pl-stj,
.markdown-body .pl-vo,
.markdown-body .pl-vpf {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k,
.markdown-body .pl-s,
.markdown-body .pl-st {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s1,
.markdown-body .pl-s1 .pl-pse .pl-s2,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-src {
color: #df5000;
}
.markdown-body .pl-mo,
.markdown-body .pl-v {
color: #1d3e81;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md,
.markdown-body .pl-mdhf {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mdht,
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
float: left;
margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4183c4;
}
/*! Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
.pln {
color: #000
}
/* plain text */
@media screen {
.str {
color: #080
}
/* string content */
.kwd {
color: #008
}
/* a keyword */
.com {
color: #800
}
/* a comment */
.typ {
color: #606
}
/* a type name */
.lit {
color: #066
}
/* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun,
.opn,
.clo {
color: #660
}
.tag {
color: #008
}
/* a markup tag name */
.atn {
color: #606
}
/* a markup attribute name */
.atv {
color: #080
}
/* a markup attribute value */
.dec,
.var {
color: #606
}
/* a declaration; a variable name */
.fun {
color: red
}
/* a function name */
}
/* Use higher contrast and text-weight for printable form. */
@media print,
projection {
.str {
color: #060
}
.kwd {
color: #006;
font-weight: bold
}
.com {
color: #600;
font-style: italic
}
.typ {
color: #404;
font-weight: bold
}
.lit {
color: #044
}
.pun,
.opn,
.clo {
color: #440
}
.tag {
color: #006;
font-weight: bold
}
.atn {
color: #404
}
.atv {
color: #060
}
}
/* Put a border around prettyprinted code snippets. */
pre.prettyprint {
padding: 2px;
/* border: 1px solid #888 */
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 {
list-style-type: none
}
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}`;return(0,wt.useEffect)(()=>{const nn=fe.current.attachShadow({mode:"open"});Ke.current=document.createElement("div"),Ke.current.className="markdown-body",Ke.current.innerHTML=Ge,nn.appendChild(Ke.current);const Si=document.createElement("style");return Si.textContent=an,nn.appendChild(Si),()=>{nn.innerHTML=""}},[]),(0,wt.useEffect)(()=>{Ke.current&&(Ke.current.innerHTML=Ge)},[Ge]),Be.createElement("div",{ref:fe})};function et(Ge){const fe=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],Ke=new RegExp(`\\b(${fe.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Ge.replace(Ke,"").trim()}var nt=Object.defineProperty,ht=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,vt=(Ge,fe,Ke)=>fe in Ge?nt(Ge,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):Ge[fe]=Ke,kt=(Ge,fe)=>{for(var Ke in fe||(fe={}))lt.call(fe,Ke)&&vt(Ge,Ke,fe[Ke]);if(ht)for(var Ke of ht(fe))pt.call(fe,Ke)&&vt(Ge,Ke,fe[Ke]);return Ge};const Et="@\u2581\u2581@",Ht="@\u2581@",Zt=/<pre[^>]*>/g;function ie(Ge){let fe=document.createElement("div");return fe.innerHTML=Ge,fe.childNodes.length===0?"":fe.childNodes[0].nodeValue}const le=(Ge,fe)=>{Ge=Ge||"";const Ke=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,an=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,nn=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Si=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return fe?Ge.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Ke,(oi,Bi,so,Qt,zt,He,En)=>{const Fn=Bi||Qt||He,Te=so||zt||En||"?";return Yt.Z.API_SERVER+"/api/attachments/"+Fn+Te+"&t="+(0,Ne.Jn)(Fn,Date.now())+(oi.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Ge=Ge.replace(Si,(oi,Bi,so,Qt,zt,He,En)=>{const Fn=Bi||Qt||He,Te=so||zt||En||"?";return Yt.Z.API_SERVER+"/attachments/download/"+Fn+Te+"&t="+(0,Ne.Jn)(Fn,Date.now())+(oi.indexOf(")")>-1?")":"&")}).replace(Ke,(oi,Bi,so,Qt,zt,He,En)=>{const Fn=Bi||Qt||He,Te=so||zt||En||"?";return Yt.Z.API_SERVER+"/api/attachments/"+Fn+Te+"&t="+(0,Ne.Jn)(Fn,Date.now())+(oi.indexOf(")")>-1?")":"&")}).replace(an,(oi,Bi,so,Qt,zt)=>{const He=Bi||Qt,En=so||zt||"";return'"'+Yt.Z.API_SERVER+"/api/attachments/"+He+En+He+En+"&t="+(0,Ne.Jn)(He,Date.now())}).replace(nn,(oi,Bi,so,Qt,zt)=>{const He=Bi||Qt,En=so||zt||"";return"("+Yt.Z.API_SERVER+"/files/uploads/"+He+En+He+En+"&t="+(0,Ne.Jn)(He,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Ge)};var re=({value:Ge="",className:fe,showTextOnly:Ke,showLines:an,style:nn={},stylesPrev:Si={},highlightKeywords:oi,showProgramFill:Bi,isProgramFill:so,disabledFill:Qt=!1,programFillValue:zt,onFillChange:He=Te=>{},onFillBlur:En=()=>{},onFillFocus:Fn=()=>{}})=>{let Te=et(String(Ge||""));const[ln,pn]=(0,wt.useState)(""),[ni,Cn]=(0,wt.useState)("office"),[he,Ae]=(0,wt.useState)([]),hn=(0,wt.useRef)("a"+(0,we.Z)()),De={},Rt=Pn=>/<style[\s\S]*?>/i.test(Pn||""),Lt=(Pn,ki,ai)=>{const eo=document.createElement(Pn===Ht?"input":"textarea");eo.style.width="100%",eo.style.height=Pn===Ht?"40px":"151px",eo.rows=5,eo.spellcheck=!1,eo.name="edu-program-fill",eo.placeholder="\u8BF7\u8F93\u5165",eo.dataset.id=ki;const ri=Object.keys(De).length;return De[ri]=eo,`<span class="edu-program-fill-wrap ${Pn===Ht?"":"show"}" style="width:${Pn===Ht?"600px":"100%"}" title=${ai||""}><span>${eo.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Ct(Pn){return Pn=Pn.replace(/!\[.*?\]\(.*?\)/g,""),Pn=Pn.replace(/\[.*?\]\(.*?\)/g,""),Pn=Pn.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Pn=Pn.replace(/<embed.*?>/g,""),Pn=Pn.replace(/<img.*?>/g,""),Pn=Pn.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Pn=Pn.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Pn=Pn.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Pn=Pn.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Pn}const Bt=Pn=>!Ke&&Rt(Te)?Pn:Pn.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(ki,ai){let eo=ai.replace(/(\n|\r)/g,"").split("}"),ri=[];return eo.map(Yo=>{Yo!=""&&ri.push(`.${hn.current} ${Yo}`)}),`<style>${ri.join("}")}</style>`}),_t=(0,wt.useMemo)(()=>{try{const eo=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,ri=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Yo=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Ro=/\(\/attachments\/download\//g;Te=Te.replace(Ro,"("+Yt.Z.API_SERVER+"/attachments/download/").replace(eo,"("+Yt.Z.API_SERVER+"/api/attachments/").replace(ri,'"'+Yt.Z.API_SERVER+"/api/attachments/").replace(Yo,'"'+Yt.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(eo){}if(Bi){let eo=-1;return Te=Te.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(ri,Yo,Ro){var mo;return++eo,Lt(ri,eo,(mo=zt==null?void 0:zt[eo])==null?void 0:mo.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${Bt(Te||"")}</pre>`}let Pn=Bt(Te);Pn=(0,_e.ZP)(Pn);const ki=(0,_e.ez)();Te.match(/\[TOC\]/)&&(Pn=Pn.replace("<p>[TOC]</p>",(0,_e.Qv)()),(0,_e.Iy)()),Pn=Pn.replace(/(__special_katext_id_\d+__)/g,(eo,ri)=>{const{type:Yo,expression:Ro}=ki[ri];return(0,ge.renderToString)(ie(Ro)||"",{displayMode:Yo==="block",throwOnError:!1,output:"html"})}),Pn=Pn.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,_e.AL)();const ai=document.createElement("div");if(ai.innerHTML=Pn,Ke)return ai.innerText;if(oi){const eo=oi.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return pi(ai,eo),ai.innerHTML}return setTimeout(()=>Ci(),500),ai.innerHTML},[Te,oi]);(0,wt.useEffect)(()=>{Gn.current&&Gn.current.querySelectorAll(["input","textarea"]).forEach(ki=>{ki.oninput=Nt,ki.onblur=Me,ki.onfocus=wn})},[he]),(0,wt.useEffect)(()=>{var Pn,ki,ai,eo,ri;if(zt!=null&&zt.length)try{const Yo=Gn.current.querySelectorAll(".edu-program-fill-score"),Ro=Gn.current.querySelectorAll('[name="edu-program-fill"]');for(const[mo,Ji]of Ro.entries())Ji.value=((Pn=zt==null?void 0:zt[mo])==null?void 0:Pn.value)||"",((ki=zt==null?void 0:zt[mo])==null?void 0:ki.type)==="warning"?Ji.className="program-fill-warning":((ai=zt==null?void 0:zt[mo])==null?void 0:ai.type)==="success"?Ji.className="program-fill-success":Ji.className="";for(const[mo,Ji]of Yo.entries())Ji.innerHTML=(eo=zt==null?void 0:zt[mo])!=null&&eo.score?`${(ri=zt==null?void 0:zt[mo])==null?void 0:ri.score}\u5206`:"";Ae(zt)}catch(Yo){console.log(Yo,"error")}},[zt]);const Nt=Pn=>{he[Pn.target.dataset.id]=he[Pn.target.dataset.id]||{},he[Pn.target.dataset.id].value=Pn.target.value,Ae([...he]),He(he,Pn.target.dataset.id)},Me=Pn=>{he[Pn.target.dataset.id]=he[Pn.target.dataset.id]||{},he[Pn.target.dataset.id].value=Pn.target.value,Ae([...he]),En(he,Pn.target.dataset.id)},wn=Pn=>{he[Pn.target.dataset.id]=he[Pn.target.dataset.id]||{},he[Pn.target.dataset.id].value=Pn.target.value,Ae([...he]),Fn(he,Pn.target.dataset.id)};function pi(Pn,ki){return Pn.childNodes.forEach(ai=>{var eo;if(ai.childNodes.length>0)pi(ai,ki);else if(ai.nodeName!=="IMG")if(ai.innerHTML)ai.innerHTML=(eo=ai.innerHTML)==null?void 0:eo.replace(new RegExp(ki,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const ri=document.createElement("span");ri.innerHTML=ai.textContent.replace(new RegExp(ki,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),ai.replaceWith(ri)}})}const Gn=(0,wt.useRef)();_e.jb.WebkitLineClamp=an,an&&(nn=kt(kt({},nn),_e.jb));function Yn(Pn){let ki=Pn.target;if(ki.tagName.toUpperCase()==="A"){let ai=ki.getAttribute("href");if(ai.indexOf("office")>-1)Pn.preventDefault(),pn(ai),Cn("office");else if(ai.indexOf("application/pdf")>-1)Pn.preventDefault(),pn(ai),Cn("pdf");else if(ai.indexOf("text/html")>-1)Pn.preventDefault(),pn(ai),Cn("html");else if(ai.startsWith("#")){Pn.preventDefault();let eo=document.getElementById(ai.replace("#",""));eo&&eo.scrollIntoView(!0)}}}const Ci=()=>{var Pn;const ki=(Pn=Gn.current)==null?void 0:Pn.querySelectorAll("video");ki==null||ki.forEach(ai=>{if(ai.oncontextmenu=()=>!1,ai.src.indexOf(".m3u8")>-1&&!ai.canPlayType("application/vnd.apple.mpegurl")){if(oe().isSupported()){var eo=new(oe());eo.loadSource(ai.src),eo.attachMedia(ai)}}})};return(0,wt.useEffect)(()=>{if(Gn.current&&_t&&_t.match(Zt)&&window.PR.prettyPrint(),Gn.current)return Gn.current.addEventListener("click",Yn),()=>{var Pn;(Pn=Gn.current)==null||Pn.removeEventListener("click",Yn),(0,_e.AL)(),(0,_e.Iy)()}},[_t,Gn.current,Yn]),(0,wt.useEffect)(()=>{var Pn;const ki=ai=>{ai.preventDefault(),ai.clipboardData.setData("text",window.getSelection().toString())};return(Pn=Gn.current)==null||Pn.addEventListener("copy",ki),()=>{var ai;(ai=Gn.current)==null||ai.removeEventListener("copy",ki)}},[Gn.current]),wt.createElement(wt.Fragment,null,Ke&&wt.createElement("div",{ref:Gn},_t),!Ke&&!Rt(_t)&&wt.createElement("div",{ref:Gn,style:kt({},nn),className:`${fe||""} ${Qt?"disabled-fill":""} markdown-body ${hn.current}`,dangerouslySetInnerHTML:{__html:_t}}),!Ke&&Rt(_t)&&wt.createElement(Ft,{html:_t}),wt.createElement(Ye.Z,{close:!0,data:ln,type:ln!=null&&ln.length?ni:"",style:kt({},Si),onClose:()=>pn("")}))}},57444:function(un,Rn,Vt){"use strict";Vt.d(Rn,{h:function(){return kt}});var wt=Vt(67294),ue=Vt(88044),_e=Vt(91773),$e=Vt(85804),ye=Vt(4631),oe=Vt.n(ye),Yt=Vt(71749),Ne=Vt(30483),ge=Object.defineProperty,we=Object.defineProperties,Ye=Object.getOwnPropertyDescriptors,Be=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,et=(Et,Ht,Zt)=>Ht in Et?ge(Et,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):Et[Ht]=Zt,nt=(Et,Ht)=>{for(var Zt in Ht||(Ht={}))on.call(Ht,Zt)&&et(Et,Zt,Ht[Zt]);if(Be)for(var Zt of Be(Ht))Ft.call(Ht,Zt)&&et(Et,Zt,Ht[Zt]);return Et},ht=(Et,Ht)=>we(Et,Ye(Ht));const lt=ue.default.Option,pt={labelCol:{span:4},wrapperCol:{span:20}},vt={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Rn.Z=({callback:Et,onCancel:Ht})=>{const[Zt,ie]=(0,wt.useState)("python");function le(Ge){ie(vt[Ge][1])}function re(Ge){Et(Ge)}return wt.createElement(_e.default,ht(nt({},pt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:re,style:{width:500}}),wt.createElement(_e.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},wt.createElement(ue.default,{getPopupContainer:Ge=>Ge.parentNode,onChange:le},Object.keys(vt).map(Ge=>wt.createElement(lt,{key:Ge,value:Ge},vt[Ge][0])))),wt.createElement(_e.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},wt.createElement(kt,{mode:Zt})),wt.createElement("div",{className:"flex-container flex-end"},wt.createElement($e.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),wt.createElement($e.ZP,{type:"ghost",onClick:Ht},"\u53D6\u6D88")))};function kt({value:Et,onChange:Ht,mode:Zt,options:ie={}}){const le=(0,wt.useRef)(),[re,Ge]=(0,wt.useState)();return(0,wt.useEffect)(()=>{if(re){let fe=function(Ke){const an=Ke.getValue();Ht&&Ht(an)};return re.on("change",fe),()=>{re.off("change",fe)}}},[re,Ht]),(0,wt.useEffect)(()=>{re&&re.setOption("mode",Zt)},[re,Zt]),(0,wt.useEffect)(()=>{re&&(Et!==re.getValue()||Et==="")&&setTimeout(()=>{re.setValue(Et||"")},300)},[re,Et]),(0,wt.useEffect)(()=>{if(le.current&&!re){const fe=oe().fromTextArea(le.current,nt({mode:Zt,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ie));Ge(fe)}},[le.current,re]),wt.createElement("div",{className:"my-codemirror-container"},wt.createElement("textarea",{ref:le}))}},35567:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return to}});var wt=Vt(67294),ue=Vt(4631),_e=Vt.n(ue),$e=Vt(91033),ye=Vt(71749),oe=Vt(57341),Yt=Vt(82801),Ne=Vt(88386),ge=Vt(49047),we=Vt(80785),Ye=Vt(65226),Be=({value:Ce="",className:Oe,showTextOnly:ee,showLines:Ie,style:Tn={}})=>{const Hn=(0,wt.useMemo)(()=>"",[Ce]);return wt.createElement(wt.Fragment,null,wt.createElement("div",{dangerouslySetInnerHTML:{__html:Hn}}))},on=Object.defineProperty,Ft=Object.defineProperties,et=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,pt=(Ce,Oe,ee)=>Oe in Ce?on(Ce,Oe,{enumerable:!0,configurable:!0,writable:!0,value:ee}):Ce[Oe]=ee,vt=(Ce,Oe)=>{for(var ee in Oe||(Oe={}))ht.call(Oe,ee)&&pt(Ce,ee,Oe[ee]);if(nt)for(var ee of nt(Oe))lt.call(Oe,ee)&&pt(Ce,ee,Oe[ee]);return Ce},kt=(Ce,Oe)=>Ft(Ce,et(Oe));let Et=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Ht({onActionCallback:Ce,title:Oe,icon:ee,actionName:Ie,className:Tn="",children:Hn}){function Bn(){Ce(Ie)}return wt.createElement("a",{title:Oe,className:Tn,onClick:Bn},wt.createElement("i",{className:`${ee}`}),Hn)}var Zt=({watch:Ce,showNullButton:Oe,showNullProgramButton:ee,onActionCallback:Ie,fullScreen:Tn,insertTemp:Hn,hidetoolBar:Bn,extraUse:me})=>{const Ze=[...Et,{title:`${Ce?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Ce?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return wt.createElement("ul",{className:"markdown-toolbar-container"},!Bn&&Ze.map((Xn,Ni)=>wt.createElement("li",{key:Ni},Xn.actionName?wt.createElement(Ht,kt(vt({},Xn),{onActionCallback:Ie})):wt.createElement("span",{className:"v-line"}))),Oe?wt.createElement("li",null,wt.createElement(Ht,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ie},wt.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ee?wt.createElement(wt.Fragment,null,wt.createElement("li",null,wt.createElement(Ht,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:Ie},wt.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),wt.createElement("li",null,wt.createElement(Ht,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:Ie},wt.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,Hn&&wt.createElement("li",null,wt.createElement(Ht,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Hn}`,onActionCallback:Ie},wt.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),me&&wt.createElement("li",null,me),wt.createElement("li",{className:"btn-full-screen"},wt.createElement(Ht,{icon:`${Tn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Tn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ie})))},ie=Vt(76621),le=Vt(91773),re=Vt(28802),Ge=Vt(85804),fe=Object.defineProperty,Ke=Object.defineProperties,an=Object.getOwnPropertyDescriptors,nn=Object.getOwnPropertySymbols,Si=Object.prototype.hasOwnProperty,oi=Object.prototype.propertyIsEnumerable,Bi=(Ce,Oe,ee)=>Oe in Ce?fe(Ce,Oe,{enumerable:!0,configurable:!0,writable:!0,value:ee}):Ce[Oe]=ee,so=(Ce,Oe)=>{for(var ee in Oe||(Oe={}))Si.call(Oe,ee)&&Bi(Ce,ee,Oe[ee]);if(nn)for(var ee of nn(Oe))oi.call(Oe,ee)&&Bi(Ce,ee,Oe[ee]);return Ce},Qt=(Ce,Oe)=>Ke(Ce,an(Oe));const zt={labelCol:{span:4},wrapperCol:{span:20}};var He=({callback:Ce,onCancel:Oe})=>{function ee(Ie){Ce(Ie)}return wt.createElement(le.default,Qt(so({},zt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ee,style:{width:500}}),wt.createElement(le.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},wt.createElement(re.default,null)),wt.createElement(le.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},wt.createElement(re.default,null)),wt.createElement("div",{className:"flex-container flex-end"},wt.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),wt.createElement(Ge.ZP,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},En=Vt(57444),Fn=Vt(70859),Te=Vt(62844),ln=Vt(71230),pn=Vt(63205),ni=Vt(67294),Cn=({callback:Ce,onCancel:Oe})=>{const ee=document.createElement("canvas"),Ie=ee.getContext("2d");ee.width=1e3,ee.height=800,Ie.fillStyle="#ffffff",Ie.fillRect(0,0,ee.width,ee.height);const Tn=ee.toDataURL("image/png");return ni.createElement(Te.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},ni.createElement(ln.Z,{style:{height:"100vh"}},ni.createElement(pn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Tn,visible:!0,title:String(Date.now())},onOk:Hn=>{Ce({src:Hn.url})},onClose:Oe})))},he=Vt(23495);function Ae(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(Ae,go.CommandHandler),Ae.prototype.canAlignSelection=function(){var Ce=this.diagram;return!(Ce===null||Ce.isReadOnly||Ce.isModelReadOnly||Ce.selection.count<2)},Ae.prototype.alignLeft=function(){var Ce=this.diagram;Ce.startTransaction("aligning left");var Oe=1/0;Ce.selection.each(function(ee){ee instanceof go.Link||(Oe=Math.min(ee.position.x,Oe))}),Ce.selection.each(function(ee){ee instanceof go.Link||ee.move(new go.Point(Oe,ee.position.y))}),Ce.commitTransaction("aligning left")},Ae.prototype.alignRight=function(){var Ce=this.diagram;Ce.startTransaction("aligning right");var Oe=-1/0;Ce.selection.each(function(ee){if(!(ee instanceof go.Link)){var Ie=ee.actualBounds.x+ee.actualBounds.width;Oe=Math.max(Ie,Oe)}}),Ce.selection.each(function(ee){ee instanceof go.Link||ee.move(new go.Point(Oe-ee.actualBounds.width,ee.position.y))}),Ce.commitTransaction("aligning right")},Ae.prototype.alignTop=function(){var Ce=this.diagram;Ce.startTransaction("alignTop");var Oe=1/0;Ce.selection.each(function(ee){ee instanceof go.Link||(Oe=Math.min(ee.position.y,Oe))}),Ce.selection.each(function(ee){ee instanceof go.Link||ee.move(new go.Point(ee.position.x,Oe))}),Ce.commitTransaction("alignTop")},Ae.prototype.alignBottom=function(){var Ce=this.diagram;Ce.startTransaction("aligning bottom");var Oe=-1/0;Ce.selection.each(function(ee){if(!(ee instanceof go.Link)){var Ie=ee.actualBounds.y+ee.actualBounds.height;Oe=Math.max(Ie,Oe)}}),Ce.selection.each(function(ee){ee instanceof go.Link||ee.move(new go.Point(ee.actualBounds.x,Oe-ee.actualBounds.height))}),Ce.commitTransaction("aligning bottom")},Ae.prototype.alignCenterX=function(){var Ce=this.diagram,Oe=Ce.selection.first();if(Oe){Ce.startTransaction("aligning Center X");var ee=Oe.actualBounds.x+Oe.actualBounds.width/2;Ce.selection.each(function(Ie){Ie instanceof go.Link||Ie.move(new go.Point(ee-Ie.actualBounds.width/2,Ie.actualBounds.y))}),Ce.commitTransaction("aligning Center X")}},Ae.prototype.alignCenterY=function(){var Ce=this.diagram,Oe=Ce.selection.first();if(Oe){Ce.startTransaction("aligning Center Y");var ee=Oe.actualBounds.y+Oe.actualBounds.height/2;Ce.selection.each(function(Ie){Ie instanceof go.Link||Ie.move(new go.Point(Ie.actualBounds.x,ee-Ie.actualBounds.height/2))}),Ce.commitTransaction("aligning Center Y")}},Ae.prototype.alignColumn=function(Ce){var Oe=this.diagram;Oe.startTransaction("align Column"),Ce===void 0&&(Ce=0),Ce=parseFloat(Ce);var ee=new Array;Oe.selection.each(function(me){me instanceof go.Link||ee.push(me)});for(var Ie=0;Ie<ee.length-1;Ie++){var Tn=ee[Ie],Hn=Tn.actualBounds.y+Tn.actualBounds.height+Ce,Bn=ee[Ie+1];Bn.move(new go.Point(Tn.actualBounds.x,Hn))}Oe.commitTransaction("align Column")},Ae.prototype.alignRow=function(Ce){Ce===void 0&&(Ce=0),Ce=parseFloat(Ce);var Oe=this.diagram;Oe.startTransaction("align Row");var ee=new Array;Oe.selection.each(function(me){me instanceof go.Link||ee.push(me)});for(var Ie=0;Ie<ee.length-1;Ie++){var Tn=ee[Ie],Hn=Tn.actualBounds.x+Tn.actualBounds.width+Ce,Bn=ee[Ie+1];Bn.move(new go.Point(Hn,Tn.actualBounds.y))}Oe.commitTransaction("align Row")},Ae.prototype.canRotate=function(Ce){var Oe=this.diagram;return!(Oe===null||Oe.isReadOnly||Oe.isModelReadOnly||Oe.selection.count<1)},Ae.prototype.rotate=function(Ce){Ce===void 0&&(Ce=90);var Oe=this.diagram;Oe.startTransaction("rotate "+Ce.toString());var Oe=this.diagram;Oe.selection.each(function(ee){ee instanceof go.Link||ee instanceof go.Group||(ee.angle+=Ce)}),Oe.commitTransaction("rotate "+Ce.toString())},Ae.prototype.pullToFront=function(){var Ce=this.diagram;Ce.startTransaction("pullToFront");var Oe=new go.Map;Ce.selection.each(function(ee){Oe.set(ee.layer,0)}),Oe.iteratorKeys.each(function(ee){var Ie=0;ee.parts.each(function(Tn){if(!Tn.isSelected){var Hn=Tn.zOrder;isNaN(Hn)?Tn.zOrder=0:Ie=Math.max(Ie,Hn)}}),Oe.set(ee,Ie)}),Ce.selection.each(function(ee){Ae._assignZOrder(ee,Oe.get(ee.layer)+1)}),Ce.commitTransaction("pullToFront")},Ae.prototype.pushToBack=function(){var Ce=this.diagram;Ce.startTransaction("pushToBack");var Oe=new go.Map;Ce.selection.each(function(ee){Oe.set(ee.layer,0)}),Oe.iteratorKeys.each(function(ee){var Ie=0;ee.parts.each(function(Tn){if(!Tn.isSelected){var Hn=Tn.zOrder;isNaN(Hn)?Tn.zOrder=0:Ie=Math.min(Ie,Hn)}}),Oe.set(ee,Ie)}),Ce.selection.each(function(ee){Ae._assignZOrder(ee,Oe.get(ee.layer)-1-Ae._findGroupDepth(ee))}),Ce.commitTransaction("pushToBack")},Ae._assignZOrder=function(Ce,Oe,ee){ee===void 0&&(ee=Ce),Ce.layer===ee.layer&&(Ce.zOrder=Oe),Ce instanceof go.Group&&Ce.memberParts.each(function(Ie){Ae._assignZOrder(Ie,Oe+1,ee)})},Ae._findGroupDepth=function(Ce){if(Ce instanceof go.Group){var Oe=0;return Ce.memberParts.each(function(ee){Oe=Math.max(Oe,Ae._findGroupDepth(ee))}),Oe+1}else return 0},Ae.prototype.doKeyDown=function(){var Ce=this.diagram;if(Ce!==null){var Oe=Ce.lastInput;if(Oe.key==="Up"||Oe.key==="Down"||Oe.key==="Left"||Oe.key==="Right"){var ee=this.arrowKeyBehavior;if(ee==="none")return;if(ee==="select"){this._arrowKeySelect();return}else if(ee==="move"){this._arrowKeyMove();return}else if(ee==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},Ae.prototype._getAllParts=function(){var Ce=new Array;return this.diagram.nodes.each(function(Oe){Ce.push(Oe)}),this.diagram.parts.each(function(Oe){Ce.push(Oe)}),Ce},Ae.prototype._arrowKeyMove=function(){var Ce=this.diagram,Oe=Ce.lastInput,ee=0,Ie=0;if(Oe.control||Oe.meta)ee=1,Ie=1;else if(Ce.grid!==null){var Tn=Ce.grid.gridCellSize;Ie=Tn.width,ee=Tn.height}Ce.startTransaction("arrowKeyMove"),Ce.selection.each(function(Hn){Oe.key==="Up"?Hn.move(new go.Point(Hn.actualBounds.x,Hn.actualBounds.y-ee)):Oe.key==="Down"?Hn.move(new go.Point(Hn.actualBounds.x,Hn.actualBounds.y+ee)):Oe.key==="Left"?Hn.move(new go.Point(Hn.actualBounds.x-Ie,Hn.actualBounds.y)):Oe.key==="Right"&&Hn.move(new go.Point(Hn.actualBounds.x+Ie,Hn.actualBounds.y))}),Ce.commitTransaction("arrowKeyMove")},Ae.prototype._arrowKeySelect=function(){var Ce=this.diagram,Oe=Ce.lastInput,ee=null;Oe.key==="Up"?ee=this._findNearestPartTowards(270):Oe.key==="Down"?ee=this._findNearestPartTowards(90):Oe.key==="Left"?ee=this._findNearestPartTowards(180):Oe.key==="Right"&&(ee=this._findNearestPartTowards(0)),ee!==null&&(Oe.shift?ee.isSelected=!0:Oe.control||Oe.meta?ee.isSelected=!ee.isSelected:Ce.select(ee))},Ae.prototype._findNearestPartTowards=function(Ce){var Oe=this.diagram.selection.first();if(Oe===null)return null;for(var ee=Oe.actualBounds.center,Ie=this._getAllParts(),Tn=1/0,Hn=Oe,Bn=0;Bn<Ie.length;Bn++){var me=Ie[Bn];if(me!==Oe&&me.canSelect()){var Ze=me.actualBounds.center,Xn=ee.directionPoint(Ze),Ni=this._angleCloseness(Xn,Ce);if(Ni<=45){var sn=ee.distanceSquaredPoint(Ze);sn*=1+Math.sin(Ni*Math.PI/180),sn<Tn&&(Tn=sn,Hn=me)}}}return Hn},Ae.prototype._angleCloseness=function(Ce,Oe){return Math.min(Math.abs(Oe-Ce),Math.min(Math.abs(Oe+360-Ce),Math.abs(Oe-360-Ce)))},Ae.prototype._arrowKeyTree=function(){var Ce=this.diagram,Oe=Ce.selection.first();if(Oe instanceof go.Node){var ee=Ce.lastInput;if(ee.key==="Right"){if(!Oe.isTreeLeaf)if(!Oe.isTreeExpanded)Ce.commandHandler.canExpandTree(Oe)&&Ce.commandHandler.expandTree(Oe);else{var Ie=this._sortTreeChildrenByY(Oe).first();Ie!==null&&Ce.select(Ie)}}else if(ee.key==="Left")if(!Oe.isTreeLeaf&&Oe.isTreeExpanded)Ce.commandHandler.canCollapseTree(Oe)&&Ce.commandHandler.collapseTree(Oe);else{var Tn=Oe.findTreeParentNode();Tn!==null&&Ce.select(Tn)}else if(ee.key==="Up"){var Tn=Oe.findTreeParentNode();if(Tn!==null){var Hn=this._sortTreeChildrenByY(Tn),Bn=Hn.indexOf(Oe);if(Bn>0){for(var me=Hn.elt(Bn-1);me!==null&&me.isTreeExpanded&&!me.isTreeLeaf;){var Ze=this._sortTreeChildrenByY(me);me=Ze.last()}me!==null&&Ce.select(me)}else Ce.select(Tn)}}else if(ee.key==="Down")if(Oe.isTreeExpanded&&!Oe.isTreeLeaf){var Ie=this._sortTreeChildrenByY(Oe).first();Ie!==null&&Ce.select(Ie)}else for(;Oe!==null;){var Tn=Oe.findTreeParentNode();if(Tn===null)break;var Hn=this._sortTreeChildrenByY(Tn),Bn=Hn.indexOf(Oe);if(Bn<Hn.length-1){Ce.select(Hn.elt(Bn+1));break}else Oe=Tn}var Xn=Ce.selection.first();Xn!==null&&Ce.scrollToRect(Xn.actualBounds)}},Ae.prototype._sortTreeChildrenByY=function(Ce){var Oe=new go.List().addAll(Ce.findTreeChildrenNodes());return Oe.sort(function(ee,Ie){var Tn=ee.location,Hn=Ie.location;return Tn.y<Hn.y?-1:Tn.y>Hn.y?1:Tn.x<Hn.x?-1:Tn.x>Hn.x?1:0}),Oe},Ae.prototype.copyToClipboard=function(Ce){go.CommandHandler.prototype.copyToClipboard.call(this,Ce),this._lastPasteOffset.set(this.pasteOffset)},Ae.prototype.pasteFromClipboard=function(){var Ce=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(Ce,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),Ce},Object.defineProperty(Ae.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(Ce){if(Ce!=="move"&&Ce!=="select"&&Ce!=="scroll"&&Ce!=="tree"&&Ce!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+Ce);this._arrowKeyBehavior=Ce}}),Object.defineProperty(Ae.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(Ce){if(!(Ce instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+Ce);this._pasteOffset.set(Ce)}});var hn=Ae,De=Vt(18023),Rt=Vt(15746),Lt=Vt(33170),Ct={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},Bt=Vt(52262),_t=Vt(67294),Nt=(Ce,Oe,ee)=>new Promise((Ie,Tn)=>{var Hn=Ze=>{try{me(ee.next(Ze))}catch(Xn){Tn(Xn)}},Bn=Ze=>{try{me(ee.throw(Ze))}catch(Xn){Tn(Xn)}},me=Ze=>Ze.done?Ie(Ze.value):Promise.resolve(Ze.value).then(Hn,Bn);me((ee=ee.apply(Ce,Oe)).next())});function Me({onCancel:Ce,callback:Oe}){let ee=(0,wt.useRef)(),Ie=(0,wt.useRef)(),Tn=(0,wt.useRef)(),Hn=(0,wt.useRef)(!1);const Bn=(0,wt.useRef)(!1),[me,Ze]=(0,wt.useState)(0);function Xn(){const sn=he.bx.make,de={red:"#ff3333",blue:"#3358ff",green:"#25ad23",magenta:"#d533ff",purple:"#7d33ff",orange:"#ff6233",brown:"#8e571e",white:"#ffffff",black:"#000000",beige:"#fffcd5",extralightblue:"#d5ebff",extralightred:"#f2dfe0",lightblue:"#a5d2fa",lightgray:"#cccccc",lightgreen:"#b3e6b3",lightred:"#fcbbbd"};ee.current=new he.S0(Ie.current,{padding:20,grid:sn(he.s_,"Grid",sn(he.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),sn(he.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:ae=>{var Mn=ae.diagram.commandHandler.addTopLevelParts(ae.diagram.selection,!0);Mn||ae.diagram.currentTool.doCancel()},commandHandler:sn(hn),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:ae=>{var Mn=ae.subject;Mn.location=Mn.location.copy().snapToGridPoint(ae.diagram.grid.gridOrigin,ae.diagram.grid.gridCellSize),setTimeout(()=>{ae.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:ae=>{var Mn=ae.subject;setTimeout(()=>{ae.diagram.commandHandler.editTextBlock()})},LinkRelinked:ae=>{var Mn=ae.parameter.part;Mn.invalidateConnectedLinks();var cn=ae.subject;ae.diagram.toolManager.linkingTool.isForwards?cn.toNode.invalidateConnectedLinks():cn.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),ee.current.nodeTemplate=sn(he.NB,"Auto",{locationSpot:he.z6.Center,locationObjectName:"SHAPE",desiredSize:new he.$u(120,60),minSize:new he.$u(40,40),resizable:!0,resizeCellSize:new he.$u(10,10),rotatable:!0},new he.KX("location","loc",he.E9.parse).makeTwoWay(he.E9.stringify),new he.KX("desiredSize","size",he.$u.parse).makeTwoWay(he.$u.stringify),sn(he.bn,{name:"SHAPE",fill:de.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:he.z6.AllSides,toSpot:he.z6.AllSides},new he.KX("figure"),new he.KX("fill"),new he.KX("stroke","borderColor"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),sn(he.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),sn(he.al,{margin:1,textAlign:"center",overflow:he.al.OverflowEllipsis,editable:!0},new he.KX("text").makeTwoWay(),new he.KX("stroke","color"))),ee.current.nodeTemplate.toolTip=sn("ToolTip",sn(he.s_,"Vertical",{maxSize:new he.$u(200,NaN)},sn(he.al,{font:"bold 10pt sans-serif",textAlign:"center"},new he.KX("text")),sn(he.al,{font:"10pt sans-serif",textAlign:"center"},new he.KX("text","details"))));function bn(ae,Mn){var cn=(Se,$n)=>{Se.handled=!0,Se.diagram.model.commit(Vn=>{var ui=$n.part.adornedPart,di=new he.E9().setRectSpot(ui.actualBounds,ae);di.subtract(ui.location),di.scale(2,2),di.x+=Math.sign(di.x)*130,di.y+=Math.sign(di.y)*130,di.add(ui.location),di.snapToGridPoint(Se.diagram.grid.gridOrigin,Se.diagram.grid.gridCellSize);var fi=Vn.copyNodeData(ui.data);Vn.setGroupKeyForNodeData(fi,Vn.getGroupKeyForNodeData(ui.data)),Vn.addNodeData(fi);var In={from:ui.key,to:Vn.getKeyForNodeData(fi)};Vn.addLinkData(In);var be=Se.diagram.findNodeForData(fi);be.location=di,Se.diagram.select(be),setTimeout(()=>{Se.diagram.commandHandler.editTextBlock()},20)})};return sn(he.bn,{figure:Mn,alignment:ae,alignmentFocus:ae.opposite(),width:ae.equals(he.z6.Top)||ae.equals(he.z6.Bottom)?25:18,height:ae.equals(he.z6.Top)||ae.equals(he.z6.Bottom)?18:25,fill:"orange",stroke:de.white,strokeWidth:4,mouseEnter:(Se,$n)=>$n.fill="dodgerblue",mouseLeave:(Se,$n)=>$n.fill="orange",isActionable:!0,click:cn,contextClick:cn})}function qn(ae){return sn(he.bn,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:(Mn,cn)=>cn.fill="dodgerblue",mouseLeave:(Mn,cn)=>cn.fill="orange",click:(Mn,cn)=>{Mn.diagram.commandHandler.showContextMenu(cn.part.adornedPart)}},ae||{})}ee.current.nodeTemplate.selectionAdornmentTemplate=sn(he.uz,"Spot",sn(he.Vm,{padding:10}),bn(he.z6.Top,"TriangleUp"),bn(he.z6.Left,"TriangleLeft"),bn(he.z6.Right,"TriangleRight"),bn(he.z6.Bottom,"TriangleDown"),qn({alignment:new he.z6(.75,0)}));function Di(ae,Mn){return(cn,Se)=>{cn.handled=!0,cn.diagram.model.commit($n=>{$n.set(Se.part.adornedPart.data,ae,Mn)})}}function Ve(ae,Mn){return Mn||(Mn="color"),sn(he.bn,{width:16,height:16,stroke:"lightgray",fill:ae,margin:1,background:"transparent",mouseEnter:(cn,Se)=>Se.stroke="dodgerblue",mouseLeave:(cn,Se)=>Se.stroke="lightgray",click:Di(Mn,ae),contextClick:Di(Mn,ae)})}function jn(){return[sn("ContextMenuButton",sn(he.s_,"Horizontal",Ve(de.white,"fill"),Ve(de.beige,"fill"),Ve(de.extralightblue,"fill"),Ve(de.extralightred,"fill"))),sn("ContextMenuButton",sn(he.s_,"Horizontal",Ve(de.lightgray,"fill"),Ve(de.lightgreen,"fill"),Ve(de.lightblue,"fill"),Ve(de.lightred,"fill")))]}function wo(){return[sn("ContextMenuButton",sn(he.s_,"Horizontal",Ve(de.black),Ve(de.green),Ve(de.blue),Ve(de.red))),sn("ContextMenuButton",sn(he.s_,"Horizontal",Ve(de.white),Ve(de.magenta),Ve(de.purple),Ve(de.orange)))]}function Ho(ae,Mn){return Mn||(Mn="thickness"),sn(he.bn,"LineH",{width:16,height:16,strokeWidth:ae,margin:1,background:"transparent",mouseEnter:(cn,Se)=>Se.background="dodgerblue",mouseLeave:(cn,Se)=>Se.background="transparent",click:Di(Mn,ae),contextClick:Di(Mn,ae)})}function fo(ae,Mn){return Mn||(Mn="dash"),sn(he.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:ae,margin:1,background:"transparent",mouseEnter:(cn,Se)=>Se.background="dodgerblue",mouseLeave:(cn,Se)=>Se.background="transparent",click:Di(Mn,ae),contextClick:Di(Mn,ae)})}function Un(){return[sn("ContextMenuButton",sn(he.s_,"Horizontal",Ho(1),Ho(2),Ho(3),Ho(4))),sn("ContextMenuButton",sn(he.s_,"Horizontal",fo(null),fo([2,4]),fo([4,4])))]}function _n(ae,Mn){return Mn||(Mn="figure"),sn(he.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:ae,margin:1,background:"transparent",mouseEnter:(cn,Se)=>Se.fill="dodgerblue",mouseLeave:(cn,Se)=>Se.fill="lightgray",click:Di(Mn,ae),contextClick:Di(Mn,ae)})}ee.current.nodeTemplate.contextMenu=sn("ContextMenu",sn("ContextMenuButton",sn(he.s_,"Horizontal",_n("Rectangle"),_n("RoundedRectangle"),_n("Ellipse"),_n("Diamond"))),sn("ContextMenuButton",sn(he.s_,"Horizontal",_n("Parallelogram2"),_n("ManualOperation"),_n("Procedure"),_n("Cylinder1"))),sn("ContextMenuButton",sn(he.s_,"Horizontal",_n("Terminator"),_n("CreateRequest"),_n("Document"),_n("TriangleDown"))),jn(),wo(),Un()),ee.current.groupTemplate=sn(he.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:he.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(ae,Mn)=>{var cn=Mn.addMembers(Mn.diagram.selection,!0);cn||Mn.diagram.currentTool.doCancel()},avoidable:!1},new he.KX("location","loc",he.E9.parse).makeTwoWay(he.E9.stringify),sn(he.s_,"Auto",{name:"BODY"},sn(he.bn,{parameter1:10,fill:de.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:he.z6.AllSides,toSpot:he.z6.AllSides},new he.KX("fill"),new he.KX("stroke","color"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),sn(he.Vm,{background:"transparent",margin:20})),sn(he.al,{alignment:he.z6.Top,alignmentFocus:he.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new he.KX("text"),new he.KX("stroke","color"))),ee.current.groupTemplate.selectionAdornmentTemplate=sn(he.uz,"Spot",sn(he.s_,"Auto",sn(he.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),sn(he.Vm,{margin:1.5})),qn({alignment:he.z6.TopRight,alignmentFocus:he.z6.BottomRight})),ee.current.groupTemplate.contextMenu=sn("ContextMenu",jn(),wo(),Un()),ee.current.linkTemplate=sn(he.rU,{layerName:"Foreground",routing:he.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new he.KX("fromSpot","fromSpot",he.z6.parse),new he.KX("toSpot","toSpot",he.z6.parse),new he.KX("fromShortLength","dir",ae=>ae>=1?10:0),new he.KX("toShortLength","dir",ae=>ae>=1?10:0),new he.KX("points").makeTwoWay(),sn(he.bn,{strokeWidth:2},new he.KX("stroke","color"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),sn(he.bn,{segmentIndex:0,segmentOffset:new he.E9(15,0),segmentOrientation:he.rU.OrientAlong,alignmentFocus:he.z6.Right,figure:"circle",width:10,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",ae=>ae===1)),sn(he.bn,{segmentIndex:-1,segmentOffset:new he.E9(-10,6),segmentOrientation:he.rU.OrientPlus90,alignmentFocus:he.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",ae=>ae>=1),new he.KX("width","thickness",ae=>7+3*ae),new he.KX("height","thickness",ae=>7+3*ae),new he.KX("segmentOffset","thickness",ae=>new he.E9(-15,4+1.5*ae))),sn(he.bn,{segmentIndex:0,segmentOffset:new he.E9(15,-6),segmentOrientation:he.rU.OrientMinus90,alignmentFocus:he.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",ae=>ae===2),new he.KX("width","thickness",ae=>7+3*ae),new he.KX("height","thickness",ae=>7+3*ae),new he.KX("segmentOffset","thickness",ae=>new he.E9(-15,4+1.5*ae))),sn(he.al,{alignmentFocus:new he.z6(0,1,-4,0),editable:!0},new he.KX("text").makeTwoWay(),new he.KX("stroke","color"))),ee.current.linkTemplate.selectionAdornmentTemplate=sn(he.uz,sn(he.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:ti(2)},new he.KX("pathPattern","thickness",ti)),qn({alignmentFocus:new he.z6(0,0,-6,-4)}));function ti(ae){return sn(he.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(ae+4).toString()+" H3"})}function Yi(ae){var Mn="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return ae===0?Mn="M0 0 M16 16 M0 8 L16 8":ae===2&&(Mn="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),sn(he.bn,{geometryString:Mn,margin:2,background:"transparent",mouseEnter:(cn,Se)=>Se.background="dodgerblue",mouseLeave:(cn,Se)=>Se.background="transparent",click:Di("dir",ae),contextClick:Di("dir",ae)})}function Co(ae){var Mn=(cn,Se)=>{cn.handled=!0,cn.diagram.model.commit($n=>{var Vn=Se.part.adornedPart;$n.set(Vn.data,ae?"toSpot":"fromSpot",he.z6.stringify(he.z6.AllSides)),(ae?Vn.toNode:Vn.fromNode).invalidateConnectedLinks()})};return sn(he.bn,{width:12,height:12,fill:"transparent",mouseEnter:(cn,Se)=>Se.background="dodgerblue",mouseLeave:(cn,Se)=>Se.background="transparent",click:Mn,contextClick:Mn})}function ne(ae,Mn){var cn=0,Se=he.z6.RightSide;ae.equals(he.z6.Top)?(cn=270,Se=he.z6.TopSide):ae.equals(he.z6.Left)?(cn=180,Se=he.z6.LeftSide):ae.equals(he.z6.Bottom)&&(cn=90,Se=he.z6.BottomSide),Mn||(cn-=180);var $n=(Vn,ui)=>{Vn.handled=!0,Vn.diagram.model.commit(di=>{var fi=ui.part.adornedPart;di.set(fi.data,Mn?"toSpot":"fromSpot",he.z6.stringify(Se)),(Mn?fi.toNode:fi.fromNode).invalidateConnectedLinks()})};return sn(he.bn,{alignment:ae,alignmentFocus:ae.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:cn,background:"transparent",mouseEnter:(Vn,ui)=>ui.background="dodgerblue",mouseLeave:(Vn,ui)=>ui.background="transparent",click:$n,contextClick:$n})}ee.current.linkTemplate.contextMenu=sn("ContextMenu",wo(),Un(),sn("ContextMenuButton",sn(he.s_,"Horizontal",Yi(0),Yi(1),Yi(2))),sn("ContextMenuButton",sn(he.s_,"Horizontal",sn(he.s_,"Spot",Co(!1),ne(he.z6.Top,!1),ne(he.z6.Left,!1),ne(he.z6.Right,!1),ne(he.z6.Bottom,!1)),sn(he.s_,"Spot",{margin:new he.Zt(0,0,0,2)},Co(!0),ne(he.z6.Top,!0),ne(he.z6.Left,!0),ne(he.z6.Right,!0),ne(he.z6.Bottom,!0)))));const xe=`{ "class": "GraphLinksModel",
"nodeDataArray": [
{"text":"Find Problem","key":-9,"loc":"-20 -140","color":"#3358ff","fill":"white","figure":"Procedure","thickness":3},
{"text":"What do we want?","key":-10,"loc":"-65 -324.305","group":-16,"figure":"Ellipse","fill":"white"},
{"text":"What do our users want?","key":-11,"loc":"105 -334.305","group":-20,"figure":"Ellipse","fill":"#ffffff","color":"black"},
{"text":"Meetings","key":-12,"loc":"-65 -444.305","group":-16,"figure":"TriangleDown","fill":"#ffffff"},
{"text":"Reviews","key":-13,"loc":"105 -454.305","group":-20,"figure":"TriangleDown","fill":"#ffffff","color":"black"},
{"text":"Can we solve it?","key":-14,"loc":"190 -140","color":"#7d33ff","fill":"#ffffff","figure":"Diamond","size":"140 80","thickness":3},
{"isGroup":true,"text":"Internal","key":-16,"loc":"-65 -384.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
{"isGroup":true,"text":"External","key":-20,"loc":"105 -394.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
{"isGroup":true,"text":"Sources","key":-22,"loc":"20 -400","fill":"#a5d2fa","dash":[4,4],"color":"#3358ff"}
],
"linkDataArray": [
{"from":-12,"to":-10,"points":[-65,-414.305,-65,-404.305,-65,-384.305,-65,-384.305,-65,-364.305,-65,-354.305],"dash":null,"dir":1},
{"from":-13,"to":-11,"points":[105,-424.305,105,-414.305,105,-394.305,105,-394.305,105,-374.305,105,-364.305],"dash":null,"color":"#000000","dir":1},
{"from":-10,"to":-9,"points":[-65,-294.305,-65,-284.305,-65,-232.1525,-40,-232.1525,-40,-180,-40,-170],"dir":2,"dash":[4,4]},
{"from":-11,"to":-9,"points":[105,-304.305,105,-294.305,105,-237.1525,0,-237.1525,0,-180,0,-170],"dash":[4,4],"dir":2},
{"from":-9,"to":-14,"points":[40,-150,58,-150,80,-150,80,-153.33333333333331,102,-153.33333333333331,120,-153.33333333333331],"dir":1,"color":"#3358ff"},
{"from":-14,"to":-9,"points":[190,-100,190,-90,-20,-90,-20,-95,-20,-100,-20,-110],"fromSpot":"BottomSide","toSpot":"BottomSide","text":"No","color":"#ff3333","thickness":2,"dir":1},
{"from":-9,"to":-14,"points":[40,-130,58,-130,80,-130,80,-126.66666666666666,102,-126.66666666666666,120,-126.66666666666666]}
]}`;var Pe=["Rectangle","Square","RoundedRectangle","Border","Ellipse","Circle","TriangleRight","TriangleDown","TriangleLeft","TriangleUp","Triangle","Diamond","LineH","LineV","None","BarH","BarV","MinusLine","PlusLine","XLine","LineRight","LineDown","LineLeft","LineUp"];function kn(ae){return console.log("shapeName:",ae),Pe.indexOf(ae)>=0}var zi=new he.YI(Tn.current,{maxSelectionCount:1,linkTemplate:sn(he.rU,{locationSpot:he.z6.Center,selectionAdornmentTemplate:sn(he.uz,"Link",{locationSpot:he.z6.Center},sn(he.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),sn(he.bn,{toArrow:"Standard",stroke:null}))},{routing:he.rU.AvoidsNodes,curve:he.rU.JumpOver,corner:5,toShortLength:4},new he.KX("points"),sn(he.bn,{isPanelMain:!0,strokeWidth:2}),sn(he.bn,{toArrow:"Standard",stroke:null})),model:new he.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...he.bn.getFigureGenerators().toArray().map(ae=>({text:"\u672A\u547D\u540D",size:"100 100",figure:ae.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return ee.current.addDiagramListener("TextEdited",function(ae){var Mn;const cn=ae.subject.part;var Se=(Mn=document.activeElement)==null?void 0:Mn.value;typeof Se=="string"&&Se.trim()===""&&ee.current.model.commit(function($n){$n.set(cn.data,"text","\u672A\u547D\u540D"),ee.current.commandHandler.stopCommand()},"increment")}),zi.nodeTemplate=sn(he.NB,"Auto",{locationSpot:he.z6.Center},new he.KX("location","location",he.E9.parse).makeTwoWay(he.E9.stringify),sn(he.bn,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new he.KX("stroke").makeTwoWay(),new he.KX("fill").makeTwoWay(),new he.KX("figure")),sn(he.al,{margin:new he.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new he.$u(16,16),maxSize:new he.$u(10,NaN),textAlign:"center",editable:!0},new he.KX("key").makeTwoWay())),setTimeout(()=>{ee.current.grid=sn(he.s_,"Grid",sn(he.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),sn(he.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),ee.current.grid.visible=!0,ee.current.grid.gridCellStroke="darkgray",ee.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=ee.current,ee.current}const Ni=()=>Nt(this,null,function*(){var sn,de=ee.current.makeImage();const bn=yield(0,Lt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:de.src,file_data:JSON.stringify({login:(sn=(0,Bt.eY)())==null?void 0:sn.login,data:JSON.parse(ee.current.model.toJson())})}});Oe({src:bn.url})});return(0,wt.useEffect)(()=>(setTimeout(()=>{Xn()},500),Ze(me+1),()=>{ee.current=null}),[]),_t.createElement("div",{ref:Bn,className:"body-overflow-initial"},_t.createElement(Te.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!me,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:_t.createElement(ln.Z,null,_t.createElement(Rt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),_t.createElement(Rt.Z,{onClick:()=>{var sn,de,bn=ee.current.selection.first();if(Hn.current=!Hn.current,document.activeElement&&bn){let qn=(de=(sn=document.activeElement)==null?void 0:sn.value)==null?void 0:de.trim();typeof qn=="string"&&ee.current.model.commit(function(Di){Di.set(bn.data,"text",qn||"\u672A\u547D\u540D"),ee.current.commandHandler.stopCommand()},"increment")}Ze(me+1)}},_t.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:Ce},_t.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Hn.current?"none":"block"},className:Ct.flowChartWrp},_t.createElement("div",{style:{display:"flex",height:"100%"}},_t.createElement("div",{style:{width:"300px",height:"100%"}},_t.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),_t.createElement("div",{style:{height:"calc(100% - 50px)"},className:Ct.myPaletteDiv,ref:Tn})),_t.createElement("div",{style:{flex:1,position:"relative"}},_t.createElement("div",{ref:Ie,style:{height:"80vh"}}))),_t.createElement("div",{className:"tr"},_t.createElement(Ge.ZP,{size:"large",onClick:Ni,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var wn=Me,pi=Vt(98813),Gn=Vt(37720);const Yn=pi.ZP.Group,Ci={margin:"0 8px"};var Pn=({callback:Ce,onCancel:Oe})=>{function ee(Ie){Ce(Ie)}return wt.createElement(le.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ee},wt.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},wt.createElement("span",{style:Ci},"\u5355\u5143\u683C\u6570\uFF1A"),wt.createElement("span",{style:Ci},"\u884C\u6570"),wt.createElement(le.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},wt.createElement(Gn.Z,null)),wt.createElement("span",{style:Ci},"\u5217\u6570"),wt.createElement(le.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},wt.createElement(Gn.Z,null))),wt.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},wt.createElement("span",{style:Ci},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),wt.createElement(le.default.Item,{name:"align"},wt.createElement(Yn,null,wt.createElement(pi.ZP,{value:"default"},wt.createElement("i",{className:"fa fa-align-justify"})),wt.createElement(pi.ZP,{value:"left"},wt.createElement("i",{className:"fa fa-align-left"})),wt.createElement(pi.ZP,{value:"center"},wt.createElement("i",{className:"fa fa-align-center"})),wt.createElement(pi.ZP,{value:"right"},wt.createElement("i",{className:"fa fa-align-right"}))))),wt.createElement("div",{className:"flex-container flex-end"},wt.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),wt.createElement(Ge.ZP,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},ki=Vt(59637),ai=Vt(61016),eo=Vt.n(ai),Yo=(0,wt.forwardRef)(({use3d:Ce,width:Oe,height:ee,callback:Ie,showSaveButton:Tn},Hn)=>{const Bn=(0,wt.useRef)(),me=(0,wt.useRef)(),[Ze,Xn]=(0,wt.useState)(!1),Ni=(0,wt.useRef)({id:Bn,appName:"graphing",width:Oe||1e3,height:ee||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,wt.useEffect)(()=>{me.current=new(eo())(Ni.current,!0),window.onload=function(){me.current.inject("applet_container")}},[]);const sn=()=>{var de=window.ggbApplet.getPNGBase64(1,!0,72);return Ie&&Ie(de),de};return(0,wt.useEffect)(()=>{Ni.current.appName=Ze?"3D":"graphing",me.current.inject("applet_container")},[Ze]),(0,wt.useEffect)(()=>{Xn(Ce)},[Ce]),(0,wt.useImperativeHandle)(Hn,()=>({getImgData:sn})),wt.createElement(wt.Fragment,null,wt.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Bn}),wt.createElement(ln.Z,{align:"middle"},wt.createElement(Rt.Z,{flex:1},wt.createElement(ki.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Ze,onChange:de=>Xn(de)})),wt.createElement(Rt.Z,null,wt.createElement(Ge.ZP,{size:"large",onClick:sn,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Ro=Vt(36527),mo=Vt(2453);const Ji="link",Cr="upload-image",Po="add-flowchart",dr="draw-image",rr="add-flowchart",fr="code-block",Ti="add-table",jo="------------",As={default:jo,left:`:${jo}`,center:`:${jo}:`,right:`${jo}:`};var ws=Vt(99914);function Ws(){}let Wr=0;const os=1e4,Or="\u2581",sr="@\u2581\u2581@",Je="@\u2581@",xt=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,en=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function vn(Ce){return/^\d+$/.test(Ce)?`${Ce}px`:Ce}const li=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",hi={[li+"-B"]:"bold",[li+"-I"]:"italic"},Fi={[Ji]:"\u6DFB\u52A0\u94FE\u63A5",[fr]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Cr]:"\u6DFB\u52A0\u56FE\u7247",[dr]:"\u6DFB\u52A0\u753B\u56FE",[Po]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Ti]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var to=({defaultValue:Ce="",onChange:Oe,width:ee="100%",height:Ie=400,miniToolbar:Tn=!1,isFocus:Hn=!1,watch:Bn,insertTemp:me,mode:Ze="markdown",id:Xn="markdown-editor-id",showResizeBar:Ni=!1,noStorage:sn=!1,showNullButton:de=!1,showNullProgramButton:bn=!1,hidetoolBar:qn=!1,fullScreen:Di=!1,onBlur:Ve,onCMBeforeChange:jn,onFullScreen:wo,className:Ho="",disablePaste:fo=!1,disabled:Un=!1,disabledFill:_n=!1,placeholder:ti="",values:Yi="",extraUse:Co})=>{const[ne,xe]=(0,wt.useState)(null),[Pe,kn]=(0,wt.useState)(Ce),[zi,ae]=(0,wt.useState)(Bn),[Mn,cn]=(0,wt.useState)(Di),[Se,$n]=(0,wt.useState)(""),[Vn,ui]=(0,wt.useState)(0),[di,fi]=(0,wt.useState)(Ie),[In,be]=(0,wt.useState)(!1),[Gi,ke]=(0,wt.useState)(0),[vi,co]=(0,wt.useState)(0),qt=(0,wt.useRef)(),se=(0,wt.useRef)(),ve=(0,wt.useRef)(),je=(0,wt.useRef)();(0,wt.useEffect)(()=>{const Wn=window.scrollY||window.pageYOffset;kn(Yi),ne==null||ne.setValue(Yi),window.scrollTo(0,Wn)},[Yi]),(0,wt.useEffect)(()=>{wo==null||wo(Mn)},[Mn]),(0,wt.useEffect)(()=>{if(qt.current){let Wn=function(xi,Le){var gi;if(fo){Le.preventDefault();return}const ji=Le.clipboardData;if(ji){const Lo=ji.types.toString(),vo=ji.items;if(Lo==="Files"||ji.types.indexOf("Files")>-1){if(Le.preventDefault(),Ze=="stex")return;try{let Oo=vo[1];((gi=vo[0])==null?void 0:gi.kind)==="file"&&(Oo=vo[0]);const Wo=Oo.getAsFile(),Ar=Wo.name.split(".").pop();(0,Fn.I)(Wo,cr=>{var Bs,Us,pe;cr.id?((Bs=Wo==null?void 0:Wo.type)==null?void 0:Bs.indexOf("image"))>-1?Dn.replaceSelection(`<img width="100%" src="/api/attachments/${cr.id}?type=${cr.content_type})" alt="" />`):((Us=Wo==null?void 0:Wo.type)==null?void 0:Us.indexOf("video"))>-1?Dn.replaceSelection(`<video width="100%" controls src="/api/attachments/${cr.id}"></video>`):((pe=Wo==null?void 0:Wo.type)==null?void 0:pe.indexOf("pdf"))>-1?Dn.replaceSelection(`<a href="/api/attachments/${cr.id}?type=${Wo.type}&disposition=inline" target="_blank">${Wo.name}</a>`):en.includes(Ar)?Dn.replaceSelection(`<a href="/api/attachments/${cr.id}?type=office&disposition=inline" target="_blank">${Wo.name}</a>`):Dn.replaceSelection(`[${Wo.name}](/api/attachments/${cr.id}?type=${cr.content_type})`):(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})}catch(Oo){mo.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Dn=_e().fromTextArea(qt.current,{mode:Ze,lineNumbers:!Tn,lineWrapping:!0,value:Ce,autoCloseTags:!0,autoCloseBrackets:!0});return Dn.on("keyup",function(xi,Le){Le.keyCode===8&&(xi.getValue()==""?Dn.setOption("placeholder",ti):Dn.setOption("placeholder",null))}),Dn.on("keydown",function(xi,Le){if(Le.keyCode===8){var gi=Kn(xi);gi&&Le.preventDefault()}}),Hn&&Dn.focus(),Dn.on("paste",Wn),Un&&Dn.on("beforeChange",function(xi,Le){(Le.origin==="paste"||Le.origin==="+input")&&Le.cancel()}),xe(Dn),()=>{Dn.off("paste",Wn)}}},[]);const fn=(0,wt.useCallback)(()=>{if(se.current)try{}catch(Wn){console.log(Wn,"---- to set md editor body height")}},[di,se,Mn]);(0,wt.useEffect)(()=>{function Wn(){let Dn=new $e.Z(xi=>{for(let Le of xi)(Le.target.offsetHeight>0||Le.target.offsetWidth>0)&&(fn(),ne.setSize("100%","100%"),ne.refresh())});return Dn.observe(qt.current.parentElement),Dn}if(ne){const Dn=Wn();return()=>{var xi,Le;(xi=qt.current)!=null&&xi.parentElement&&Dn.unobserve((Le=qt.current)==null?void 0:Le.parentElement)}}},[ne,fn]),(0,wt.useEffect)(()=>{if(ne){let Wn=[];for(const[Dn,xi]of Object.entries(hi)){let Le={[Dn]:()=>{yn(xi)}};Wn.push(Le),ne.addKeyMap(Le)}return()=>{for(let Dn of Wn)ne.removeKeyMap(Dn)}}},[ne]),(0,wt.useEffect)(()=>{Di!==Mn&&cn(Di)},[Di]),(0,ws.Z)(()=>{if(!sn&&Vn>0){let Wn=new Date().getTime(),Dn=window.sessionStorage.getItem(Xn);Wn>=Vn+os&&(!Dn||Dn!==Pe)&&(window.sessionStorage.setItem(Xn,Pe),be(!0))}},os),(0,wt.useEffect)(()=>{ae(Bn)},[ne,Bn]),(0,wt.useEffect)(()=>{ne&&Hn&&ne.focus()},[ne,Hn]),(0,wt.useEffect)(()=>{if(zi&&ne){let Wn=function(xi){let Le=xi.target;if(je.current){let gi=Le.scrollTop/Le.scrollHeight;je.current.scrollTop=je.current.scrollHeight*gi}};const Dn=ne.getScrollerElement();return Dn.addEventListener("scroll",Wn),()=>{Dn.removeEventListener("scroll",Wn)}}},[ne,zi]),(0,wt.useEffect)(()=>{if(ne&&jn){let Wn=function(Dn,xi){jn(Dn,xi)};return ne.on("beforeChange",Wn),()=>{ne.off("beforeChange",Wn)}}},[ne,jn]),(0,wt.useEffect)(()=>{if(ne&&Ve){let Wn=function(){Ve(ne.getValue())};return ne.on("blur",Wn),()=>{ne.off("blur",Wn)}}},[ne,Ve]);function Kn(Wn,Dn){var xi=Wn.getDoc(),Le=xi.getCursor(),gi=xi.getLine(Le.line),ji=gi.charAt(Le.ch-1),Lo=gi.lastIndexOf("@\u2581@",Le.ch),vo=gi.lastIndexOf("@\u2581\u2581@",Le.ch),Oo=Lo>vo?Lo:vo,Wo=Lo>vo?3:4;if(sr.indexOf(ji)===-1)return null;if(console.log("change1:",Dn,Wn,gi,Le,Oo,Lo,vo,ji),Oo>=0&&Le.ch-Oo<5){var Ar=Oo+Wo;return xi.replaceRange("",{line:Le.line,ch:Oo},{line:Le.line,ch:Ar}),{line:Le.line,ch:Ar}}return null}(0,wt.useEffect)(()=>{if(ne){let Wn=function(Dn,xi){const Le=Dn.getValue();kn(Le),ui(new Date().getTime()),Dn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Oe&&(bn?Oe(Le,Qi(Le)):Oe(Le))};return ne.on("change",Wn),()=>{ne.off("change",Wn)}}},[ne,Oe]),(0,wt.useEffect)(()=>{if(ne)if(Ce==null)ne.setValue(""),kn("");else{const Wn=window.scrollY||window.pageYOffset;Ce!==ne.getValue()&&(ne.setValue(Ce),kn(Ce),ne.setCursor(Un?1:ne.lineCount(),0),window.scrollTo(0,Wn))}},[ne,Ce]);const yn=(0,wt.useCallback)(Wn=>{const Dn=ne.getCursor(),xi=ne.getSelection();let Le=xi.split(`
`);switch(Wn){case"bold":return ne.replaceSelection("**"+xi+"**"),xi===""&&ne.setCursor(Dn.line,Dn.ch+2),ne.focus();case"italic":return ne.replaceSelection("*"+xi+"*"),xi===""&&ne.setCursor(Dn.line,Dn.ch+1),ne.focus();case"code":return ne.replaceSelection("`"+xi+"`"),xi===""&&ne.setCursor(Dn.line,Dn.ch+1),ne.focus();case"inline-latex":return $n("inline-latex"),ne.focus();case"latex":return ne.replaceSelection("```latex\n"+xi+"\n```"),ne.setCursor(Dn.line+1,xi.length+1),ne.focus();case"line-break":return ne.replaceSelection(`<br/>
`),ne.focus();case"list-ul":return xi===""?ne.replaceSelection("- "+xi):ne.replaceSelection(Le.map(gi=>gi===""?"":`- ${gi}`).join(`
`)),ne.focus();case"list-ol":return xi===""?ne.replaceSelection("1. "+xi):ne.replaceSelection(Le.map((gi,ji)=>gi===""?"":`${ji+1}. ${gi}`).join(`
`)),ne.focus();case"add-null-ch":return xi===""&&ne.setCursor(Dn.line,Dn.ch),ne.replaceSelection(Or),ne.focus();case"add-signal":return xi===""&&ne.setCursor(Dn.line,Dn.ch),ne.replaceSelection(Je),ne.focus();case"add-multiple":return xi===""&&ne.setCursor(Dn.line,Dn.ch),ne.replaceSelection(sr),ne.focus();case"inster-template-1":return xi===""&&ne.setCursor(Dn.line,Dn.ch),ne.replaceSelection(xt),ne.focus();case"eraser":return ne.setValue(""),ne.focus();case"trigger-watch":return ae(!zi),ne.focus();case"trigger-full-screen":return cn(!Mn),ne.focus();case Ji:$n(Ji);return;case fr:$n(fr);return;case Cr:$n(Cr);return;case dr:$n(dr);return;case"maths-latex":$n("maths-latex");return;case Po:$n(Po);return;case Ti:$n(Ti);return;default:throw new Error}},[ne,zi,Mn]),qe=(0,wt.useCallback)((Wn,Dn)=>{var xi,Le,gi,ji,Lo,vo;switch($n(""),Se){case Ji:const{title:Bs,link:Us}=Wn;return ne.replaceSelection(`[${Bs}](${Us})`),ne.focus();case fr:const{language:pe,content:Br}=Wn;return ne.replaceSelection(["```"+pe,Br,"```"].join(`
`)),ne.focus();case"maths-latex":for(var Oo=atob(Wn),Wo=new Uint8Array(Oo.length),Ar=0;Ar<Oo.length;Ar++)Wo[Ar]=Oo.charCodeAt(Ar);var cr=new Blob([Wo],{type:"image/png"});(0,Fn.I)(cr,Hi=>{Hi.id?ne.replaceSelection(`![,](/api/attachments/${Hi.id}?type=${Hi.content_type})`):(Hi==null?void 0:Hi.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":ne.replaceSelection("`$$"+Wn+"$$`");break;case Cr:case dr:case rr:const{src:Cs,alt:ma}=Wn,po=Dn,Ds=(gi=(Le=(xi=po==null?void 0:po.name)==null?void 0:xi.split("."))==null?void 0:Le.pop)==null?void 0:gi.call(Le);return((ji=po==null?void 0:po.type)==null?void 0:ji.indexOf("image"))>-1||!(po!=null&&po.type)?po!=null&&po.align||po!=null&&po.width?ne.replaceSelection(`<p style="text-align:${po.align||"initial"}"><img width="${po.width?po.width+"%":"initial"}" src="${Cs}" alt="${ma||""}" /></p>`):ne.replaceSelection(`<img width="100%" src="${Cs}" alt="${ma||""}" />`):((Lo=po==null?void 0:po.type)==null?void 0:Lo.indexOf("video"))>-1?ne.replaceSelection(`<video width="100%" controls src="${Cs}"></video>`):((vo=po==null?void 0:po.type)==null?void 0:vo.indexOf("pdf"))>-1?ne.replaceSelection(`<a href="${Cs}?type=${po.type}&disposition=inline" target="_blank">${po.name}</a>`):en.includes(Ds)?ne.replaceSelection(`<a href="${Cs}?type=office&disposition=inline" target="_blank">${po.name}</a>`):ne.replaceSelection(`[${po.name}](${Cs})`),ne.focus();case Ti:const{row:Os,col:Vs,align:yo}=Wn;let $o=`
`;for(let Hi=0;Hi<Os;Hi++){let Vi=[],Mo=[];for(let Bo=0;Bo<Vs;Bo++)Hi===1&&Mo.push(As[yo]),Vi.push(" ");Hi===1&&($o+=`| ${Mo.join(" | ")} |
`),$o+=`| ${Vi.join(Vs===1?"":" | ")} |
`}return ne.replaceSelection($o+`
`),ne.focus();default:throw new Error}},[ne,Se]),At=(0,wt.useMemo)(()=>{switch(Se){case Ji:return wt.createElement(He,{callback:qe,onCancel:An});case fr:return wt.createElement(En.Z,{callback:qe,onCancel:An});case Cr:return wt.createElement(Fn.Z,{callback:qe,onCancel:An});case Po:return wt.createElement(wn,{callback:qe,onCancel:An});case Ti:return wt.createElement(Pn,{callback:qe,onCancel:An});case"maths-latex":return wt.createElement(Yo,{showSaveButton:!0,callback:qe});case"inline-latex":return wt.createElement(Ro.Z,{showSaveButton:!0,callback:qe});default:return null}},[Se]);function An(){$n("")}(0,wt.useEffect)(()=>{if(ve.current){let Wn=function(Lo){gi=!0,ji=Lo.pageY},Dn=function(){gi=!1},xi=function(Lo){if(gi){let vo=Lo.pageY-ji;vo<0&&(vo=0),vo>300&&(vo=300);let Oo=Ie+vo+"px";fi(Oo)}},Le=ve.current,gi=!1,ji=0;return Le.addEventListener("mousedown",Wn),document.addEventListener("mousemove",xi),document.addEventListener("mouseup",Dn),()=>{Le.removeEventListener("mousedown",Wn),document.removeEventListener("mousemove",xi),document.removeEventListener("mouseup",Dn)}}},[ne,ve]),(0,wt.useEffect)(()=>{fi(Ie)},[Ie]);const _i=vn(ee),Wi=vn(di),To={width:_i,height:Wi},lo=(0,wt.useMemo)(()=>{if(Vn){let Wn=new Date(Vn),Dn=Wn.getHours(),xi=Wn.getMinutes(),Le=Wn.getSeconds();return Dn=Dn<10?"0"+Dn:Dn,xi=xi<10?"0"+xi:xi,Le=Le<10?"0"+Le:Le,`${Dn}:${xi}:${Le}`}return 0},[Vn]),Qi=Wn=>{const Dn=[];if(bn){let xi=-1;Wn=Wn.replace(/(@▁▁@|@▁@)/g,function(Le,gi,ji){Dn.push({multiLine:Le!==Je})})}return Dn};function Do(){window.sessionStorage.removeItem(Xn),be(!1),ui(0)}function Ii(){be(!1),ui(0),ne.setValue(window.sessionStorage.getItem(Xn))}(0,wt.useEffect)(()=>{Fi[Se]&&Se!==dr&&Se!==Po&&setTimeout(()=>{const Wn=document.getElementsByClassName("markdown-popup-form")[0],Dn=window.innerWidth/2-Wn.offsetWidth/2,xi=window.innerHeight/2-Wn.offsetHeight/2;ke(Dn),co(xi)},0)},[Se]);const Pi=Wn=>{Wn.preventDefault();const Dn=Wn.clientX-Gi,xi=Wn.clientY-vi;document.body.onmousemove=Le=>{let gi=Le.clientX-Dn,ji=Le.clientY-xi;const Lo=document.getElementsByClassName("markdown-popup-form")[0],vo=window.innerWidth-Lo.offsetWidth,Oo=window.innerHeight-Lo.offsetHeight;gi=Math.max(0,Math.min(gi,vo)),ji=Math.max(0,Math.min(ji,Oo)),Ui(Le.clientX,Le.clientY,Dn,xi)&&(ke(gi),co(ji))},document.body.onmouseup=function(){document.body.onmousemove=null}},Ui=(Wn,Dn,xi,Le)=>{const gi=document.body.clientHeight,ji=document.body.clientWidth;return Wn<20&&xi>Wn||Wn>ji-20&&xi<Wn||Dn<20&&Le>Dn||Dn>gi-20&&Le<Dn?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return wt.createElement(wt.Fragment,null,wt.createElement("div",{className:"markdown-editor-wrapper",ref:se},wt.createElement("div",{className:`markdown-editor-container ${Ho} ${zi?"on-preview":""} ${Tn?"mini":""} ${Mn?"full-screen":""}`,style:To},wt.createElement(Zt,{insertTemp:me,watch:zi,fullScreen:Mn,showNullButton:de,showNullProgramButton:bn,onActionCallback:yn,hidetoolBar:qn,extraUse:Co}),wt.createElement("div",{className:"markdown-editor-body"},wt.createElement("div",{className:"codemirror-container"},wt.createElement("textarea",{ref:qt,placeholder:ti})),zi?wt.createElement("div",{ref:je,className:"preview-container"},Ze==="stex"&&wt.createElement(Be,{value:Pe}),Ze!=="stex"&&wt.createElement(Ye.Z,{disabledFill:_n,showProgramFill:bn,value:Pe})):null))),Ni?wt.createElement("a",{ref:ve,className:"editor-resize"}):null,Se===dr&&wt.createElement(Cn,{callback:qe,onCancel:An}),Se===Po&&wt.createElement(wn,{callback:qe,onCancel:An}),wt.createElement(ie.Z,null,Fi[Se]&&Se!==dr&&Se!==Po?wt.createElement(Te.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Gi,top:vi},title:wt.createElement("div",{style:{cursor:"move"},onMouseDown:Pi},Fi[Se]),open:!0,onCancel:An,footer:null,destroyOnClose:!0,width:Se===Po?"1200px":null,height:Se===Po?"80vh":null,className:"markdown-popup-form"},At):null))}},70859:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return Ht},I:function(){return ie}});var wt=Vt(91773),ue=Vt(2453),_e=Vt(28802),$e=Vt(78957),ye=Vt(37720),oe=Vt(98813),Yt=Vt(85804),Ne=Vt(15476),ge=Vt(67294),we=Vt(67294),Ye=Object.defineProperty,Be=Object.defineProperties,on=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ht=(le,re,Ge)=>re in le?Ye(le,re,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):le[re]=Ge,lt=(le,re)=>{for(var Ge in re||(re={}))et.call(re,Ge)&&ht(le,Ge,re[Ge]);if(Ft)for(var Ge of Ft(re))nt.call(re,Ge)&&ht(le,Ge,re[Ge]);return le},pt=(le,re)=>Be(le,on(re));const{useForm:vt}=wt.default,kt={width:280,marginRight:10},Et={labelCol:{span:5},wrapperCol:{span:19}};var Ht=({callback:le,onCancel:re})=>{const[Ge]=vt();let fe=(0,ge.useRef)();function Ke(Si){fe.current.width=Ge.getFieldValue("width"),fe.current.align=Ge.getFieldValue("align"),le(Si,fe.current)}function an(Si,oi){if(Si.status===-1){ue.ZP.error(Si.message);return}Ge.setFieldsValue({src:`/api/attachments/${Si.id}`,type:oi.type})}function nn(Si){let oi=Si.target.files[0];fe.current=oi,ie(oi,an)}return we.createElement(wt.default,pt(lt({form:Ge},Et),{className:"upload-image-panel",onFinish:Ke,style:{width:470,overflow:"hidden"}}),we.createElement(wt.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},we.createElement("div",{className:"flex-container"},we.createElement(wt.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},we.createElement(_e.default,{style:kt})),we.createElement(Zt,{onFileChange:nn}))),we.createElement(wt.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},we.createElement(_e.default,{style:{width:264}})),we.createElement(wt.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},we.createElement($e.Z,null,we.createElement(wt.default.Item,{name:"width",style:{margin:0}},we.createElement(ye.Z,{style:{width:264}})),we.createElement("span",{className:"ml8"},"%"))),we.createElement(wt.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},we.createElement(oe.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),we.createElement("aside",null,we.createElement(wt.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},we.createElement(Yt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),we.createElement(Yt.ZP,{type:"default",onClick:re},"\u53D6\u6D88"))))};function Zt({onFileChange:le}){return we.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",we.createElement("input",{type:"file",onChange:le}))}function ie(le,re){if(!le)throw new String("\u6CA1\u6709\u6587\u4EF6");let Ge=new FormData;Ge.append("editormd-image-file",le),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var fe=new window.XMLHttpRequest;fe.withCredentials=!0,fe.addEventListener("load",function(Ke){re(JSON.parse(Ke.target.responseText),le)},!1),fe.addEventListener("error",function(Ke){console.error(Ke)},!1),fe.open("POST",`${Ne.KI}/api/attachments.json`),fe.send(Ge)}},76621:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return _e}});var wt=Vt(67294),ue=Vt(73935);class _e extends wt.Component{constructor(ye){super(ye);const oe=window.document;this.node=oe.createElement("div"),oe.body.appendChild(this.node)}render(){const{children:ye}=this.props;return(0,ue.createPortal)(ye,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},36295:function(un,Rn,Vt){"use strict";Vt.d(Rn,{SV:function(){return he},ZP:function(){return Cn}});var wt=Vt(67294),ue=Vt(91033);const _e={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},$e={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},ye={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},oe={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},Yt={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var Ne=Vt(84204),ge=Vt.n(Ne),we=(Ae,hn,De)=>new Promise((Rt,Lt)=>{var Ct=Nt=>{try{_t(De.next(Nt))}catch(Me){Lt(Me)}},Bt=Nt=>{try{_t(De.throw(Nt))}catch(Me){Lt(Me)}},_t=Nt=>Nt.done?Rt(Nt.value):Promise.resolve(Nt.value).then(Ct,Bt);_t((De=De.apply(Ae,hn)).next())});const Ye={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},Be=(Ae,hn,De,Rt)=>{const Lt=hn.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:De.lineNumber,endColumn:De.column});return Array.from(new Set(Lt.match(/\b\w{2,}\b/g)||[])).map(Bt=>({label:Bt,kind:Ae.languages.CompletionItemKind.Text,insertText:Bt,range:Rt}))},on=(Ae,hn,De,Rt)=>{Ae.languages.registerCompletionItemProvider(hn,{provideCompletionItems(Lt,Ct){const Bt=Lt.getWordUntilPosition(Ct),_t={startLineNumber:Ct.lineNumber,endLineNumber:Ct.lineNumber,startColumn:Bt.startColumn,endColumn:Bt.endColumn},Nt=Lt.getLineContent(Ct.lineNumber).substring(Bt.startColumn-2,Bt.endColumn);return{suggestions:[...Be(Ae,Lt,Ct,_t),...De.map(wn=>({label:wn,kind:Ae.languages.CompletionItemKind.Keyword,documentation:wn,insertText:wn,insertTextRules:Ae.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_t})),...Rt.map(wn=>({label:wn.label,kind:Ae.languages.CompletionItemKind.Snippet,documentation:wn.content,insertText:Nt.startsWith("#")?wn.content.replace(/#/,""):wn.content,insertTextRules:Ae.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_t}))]}}})};var Ft=Ae=>{Ye.languages.forEach(hn=>{Ae.languages.registerDocumentFormattingEditProvider(hn,{provideDocumentFormattingEdits(De){return we(this,null,function*(){const Rt=ge()(De.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:De.getFullModelRange(),text:Rt}]})}})}),on(Ae,"java",$e.keywords,$e.quickKey),on(Ae,"cpp",ye.keywords,ye.quickKey),on(Ae,"c",_e.keywords,[]),on(Ae,"python",oe.keywords,oe.quickKey),on(Ae,"scala",Yt.keywords,Yt.quickKey)};const et="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var nt=Object.defineProperty,ht=(Ae,hn,De)=>hn in Ae?nt(Ae,hn,{enumerable:!0,configurable:!0,writable:!0,value:De}):Ae[hn]=De,lt=(Ae,hn,De)=>ht(Ae,typeof hn!="symbol"?hn+"":hn,De);const pt=class px{constructor(hn,De,Rt){this.placeholder=hn,this.editor=De,this.monaco=Rt,De.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return px.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};lt(pt,"ID","editor.widget.placeholderHint");var kt=pt,Et=Vt(84144),Ht=Vt(2453),Zt=Vt(83062),ie=Vt(96486),le=Vt(33054),re=Vt(74855),Ge=Object.defineProperty,fe=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertySymbols,nn=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable,oi=(Ae,hn,De)=>hn in Ae?Ge(Ae,hn,{enumerable:!0,configurable:!0,writable:!0,value:De}):Ae[hn]=De,Bi=(Ae,hn)=>{for(var De in hn||(hn={}))nn.call(hn,De)&&oi(Ae,De,hn[De]);if(an)for(var De of an(hn))Si.call(hn,De)&&oi(Ae,De,hn[De]);return Ae},so=(Ae,hn)=>fe(Ae,Ke(hn)),Qt=(Ae,hn)=>{var De={};for(var Rt in Ae)nn.call(Ae,Rt)&&hn.indexOf(Rt)<0&&(De[Rt]=Ae[Rt]);if(Ae!=null&&an)for(var Rt of an(Ae))hn.indexOf(Rt)<0&&Si.call(Ae,Rt)&&(De[Rt]=Ae[Rt]);return De},zt=(Ae,hn,De)=>new Promise((Rt,Lt)=>{var Ct=Nt=>{try{_t(De.next(Nt))}catch(Me){Lt(Me)}},Bt=Nt=>{try{_t(De.throw(Nt))}catch(Me){Lt(Me)}},_t=Nt=>Nt.done?Rt(Nt.value):Promise.resolve(Nt.value).then(Ct,Bt);_t((De=De.apply(Ae,hn)).next())});function He(Ae){return/^\d+$/.test(Ae)?`${Ae}px`:Ae}function En(){}let Fn=!1;const Te={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function ln(Ae=[]){let hn=Ae;if(Array.isArray(Ae)){for(let De=0;De<Ae.length;De++){let Rt=Te[Ae[De]];if(Rt)return Rt}return hn[0]}return Te[hn]||hn}let pn=null;const ni=()=>zt(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Ae){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Ae)}});var Cn=Ae=>{var hn=Ae,{width:De="100%",height:Rt="100%",value:Lt,language:Ct="javascript",style:Bt={},options:_t={},overrideServices:Nt={},theme:Me="vs-dark",onEditBlur:wn,isCopy:pi=!1,onSave:Gn,autoHeight:Yn=!1,forbidCopy:Ci=!1,onChange:Pn=En,editorDidMount:ki=En,onFocus:ai=En,onBreakPoint:eo=En,breakPointValue:ri=[],filename:Yo="educoder.txt",errorLine:Ro,errorContent:mo="",highlightLine:Ji,openBreakPoint:Cr=!1,placeholder:Po="",showMiniMap:dr=!0}=hn,rr=Qt(hn,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const fr=(0,wt.useRef)(),Ti=(0,wt.useRef)({}),jo=(0,wt.useRef)(),As=(0,wt.useRef)(),ws=(0,wt.useRef)([]),Ws=(0,wt.useRef)(!1),Wr=(0,wt.useRef)(),os=(0,wt.useRef)(),Or=(0,wt.useRef)(!1),[sr,Je]=(0,wt.useState)(!1);function xt(){let me;return fr.current&&(me=new ue.Z(Ze=>{for(let Xn of Ze)(Xn.target.offsetHeight>0||Xn.target.offsetWidth>0)&&Ti.current.instance.layout()}),me.observe(fr.current)),me}function en(){Ht.ZP.warning({content:decodeURIComponent(et),key:"monaco-editor-tip"})}const vn=()=>{let me=Ti.current.instance;if(Lt!=null&&me&&sr){const Ze=me.getModel();Ze&&Lt!==Ze.getValue()&&(Fn=!0,Ze.setValue(Lt),me.layout(),Fn=!1)}};(0,wt.useEffect)(()=>{const me=le.Z.subscribe("formatDocument",Ze=>{var Xn;let Ni=Ti.current.instance;(Xn=Ni==null?void 0:Ni.getAction)==null||Xn.call(Ni,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ze=>{Pn(Ze)},me},[]),(0,wt.useEffect)(()=>{var me;let Ze=Ti.current.instance;As.current&&clearTimeout(As.current),As.current=setTimeout(()=>{vn()},500),Lt&&(Lt!=null&&Lt.length)&&((me=Ze==null?void 0:Ze.updateOptions)==null||me.call(Ze,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Lt.split(/\r\n|\r|\n/g).length))+3,5)}))},[Lt,sr,Ti.current]),(0,wt.useEffect)(()=>{if(Ro&&Ti.current&&Ti.current.instance){let Ze=Ti.current.instance;Ze.changeViewZones(function(Xn){var Ni=document.createElement("div");Ni.style.padding="10px 20px",Ni.style.width="calc(100% - 20px)",Ni.className="my-error-line-wrp",Ni.innerHTML=mo,Xn.addZone({afterLineNumber:Ro||11,heightInLines:3,domNode:Ni})});var me={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ze.addOverlayWidget(me),Ze.revealPositionInCenter({lineNumber:20,column:1})}},[Ro,Ti.current,sr]);const mi=(me="",Ze)=>{if(!me||me.trim()==="")return!0;const Ni=Ti.current.instance.getModel().getLineTokens(Ze);let sn=!1;for(let de=0;de<2;de++)Ni.getStandardTokenType(de)===1&&(sn=!0);return sn};(0,wt.useEffect)(()=>{var me;const Ze=(me=Ti.current)==null?void 0:me.instance;if(Ze&&sr&&Ci){const Xn=Ze.onDidBlurEditorWidget(()=>{Or.current=!1}),Ni=Ze.onDidFocusEditorText(()=>{Or.current=!0});return()=>{Xn.dispose(),Ni.dispose()}}},[Ti.current,sr,Ci]),(0,wt.useEffect)(()=>{var me;if((me=Ti.current)!=null&&me.instance&&sr&&Cr){let Ze=Ti.current.instance,Xn=Ze.getModel();if(!Xn)return;(()=>{var Un;let _n=[],ti=[];const Yi=Xn.getAllDecorations();for(let ne of Yi)ne.options.className==="highlighted-line"&&(_n.push((Un=ne==null?void 0:ne.range)==null?void 0:Un.startLineNumber),ti.push(ne==null?void 0:ne.id));if(Ji===_n[0])return;Xn.deltaDecorations(ti,[]);const Co=Xn.getLineCount();Ji&&Ji<=Co&&(Ze.deltaDecorations([],[{range:new pn.Range(Ji,1,Ji,Xn.getLineMaxColumn(Ji)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ze.revealLineInCenter(Ji))})();const sn=(Un=!1)=>{var _n;let ti=[],Yi=[];const Co=Xn.getAllDecorations();for(let ne of Co)ne.options.linesDecorationsClassName==="breakpoints-select"&&(ti.push((_n=ne==null?void 0:ne.range)==null?void 0:_n.startLineNumber),Yi.push(ne==null?void 0:ne.id));if(Un)return{lines:ti,ids:Yi};eo(ti)},de=Un=>zt(void 0,null,function*(){let _n={range:new pn.Range(Un,1,Un,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Xn.deltaDecorations([],[_n]),sn()}),bn=Un=>zt(void 0,null,function*(){let _n=[];const ti=Ze.getLineDecorations(Un);for(let Yi of ti)Yi.options.linesDecorationsClassName==="breakpoints-select"&&_n.push(Yi.id);yield Xn.deltaDecorations(_n,[]),sn()}),qn=Un=>{let _n=Ze.getLineDecorations(Un);for(let ti of _n)if(ti.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,ie.isEqual)(ri,sn(!0).lines)){Xn.deltaDecorations(sn(!0).ids,[]);const Un=ri.map(_n=>({range:new pn.Range(_n,1,_n,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Xn.deltaDecorations([],Un)}const Di=Ze.onDidChangeModelContent(Un=>{let _n=Ze.getPosition();if(_n){let ti=_n.lineNumber;clearTimeout(os.current),os.current=setTimeout(()=>{mi(Xn.getLineContent(ti),ti)?bn(ti):qn(ti)?(bn(ti),de(ti)):sn()},100)}}),Ve=Ze.onMouseDown(Un=>{var _n,ti,Yi;if(Un.target.detail&&((Yi=(ti=(_n=Un.target)==null?void 0:_n.element)==null?void 0:ti.className)!=null&&Yi.includes("line-numbers"))){let Co=Un.target.position.lineNumber;if(mi(Xn.getLineContent(Co),Co))return;qn(Co)?bn(Co):de(Co)}}),jn=Un=>{let _n={range:new pn.Range(Un,1,Un,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};ws.current=Ze.deltaDecorations(ws.current,[_n])},wo=()=>{ws.current=Ze.deltaDecorations(ws.current,[])},Ho=Ze.onMouseMove(Un=>{var _n,ti,Yi;if(wo(),Un.target.detail&&((Yi=(ti=(_n=Un.target)==null?void 0:_n.element)==null?void 0:ti.className)!=null&&Yi.includes("line-numbers"))){let Co=Un.target.position.lineNumber;if(mi(Xn.getLineContent(Co),Co))return;jn(Co)}}),fo=Ze.onMouseLeave(()=>{wo()});return()=>{Di.dispose(),Ve.dispose(),Ho.dispose(),fo.dispose()}}},[Ti.current,sr,ri,Ji,Cr,Ct]),(0,wt.useEffect)(()=>{var me;(me=Ti.current)!=null&&me.instance&&Cr&&Ti.current.instance.setPosition({lineNumber:0,column:0})},[Ji]);function li(){let me=Ti.current.instance;if(me){const Ze=me.getSelection(),Xn=Ti.current.pastePos||{},Ni=new pn.Range(Xn.startLineNumber||Ze.endLineNumber,Xn.startColumn||Ze.endColumn,Xn.endLineNumber||Ze.endLineNumber,Xn.endColumn||Ze.endColumn);setTimeout(()=>{me.executeEdits("",[{range:Ni,text:""}])},300)}}function hi(me){(window.navigator.platform.match("Mac")?me.metaKey:me.ctrlKey)&&me.keyCode==83&&(me.preventDefault(),Gn())}const Fi=()=>{if(Yn&&Ti.current.instance){const me=Ti.current.instance.getContentHeight();Hn(me<Rt?Rt:me)}else Hn(Rt)};function to(me){var Ze=document.createEvent("MouseEvents");Ze.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),me.dispatchEvent(Ze)}const Ce=me=>{if(!Or.current)return;const{keyCode:Ze,ctrlKey:Xn,metaKey:Ni,target:sn,type:de}=me;return(de==="paste"||(Ze===67||Ze===86)&&(Ni||Xn))&&sn.nodeName==="TEXTAREA"&&(en(),me.preventDefault()),!1};function Oe(me,Ze){var Xn=window.URL||window.webkitURL||window,Ni=new Blob([Ze]),sn=document.createElementNS("http://www.w3.org/1999/xhtml","a");sn.href=Xn.createObjectURL(Ni),sn.download=me,to(sn)}(0,wt.useEffect)(()=>{Fi()},[Fi]),(0,wt.useEffect)(()=>{fr.current&&!sr&&Promise.all([Vt.e(5552),Vt.e(9651)]).then(Vt.bind(Vt,55826)).then(me=>{try{pn=me,Ti.current.instance=pn.editor.create(fr.current,{value:Lt,language:ln(Ct),theme:Me,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:dr||!1}},Nt);const Ze=Ti.current.instance;let sn=[...Et.BH._menuItems].find(Di=>Di[0]._debugName=="EditorContext")[1],de=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],bn=(Di,Ve)=>{var jn,wo;let Ho=Di._first;do Ve.includes((wo=(jn=Ho.element)==null?void 0:jn.command)==null?void 0:wo.id)&&Di._remove(Ho);while(Ho=Ho.next)};if(ki(Ze,pn),setTimeout(()=>{Fi(),Ti.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Oe(Yo||"educoder.txt",Ze.getValue())}})},500),Ti.current.subscription=Ze.onDidChangeModelContent(Di=>{Ws.current?clearTimeout(Wr.current):(Fi(),Pn(Ze.getValue(),Di)),Wr.current=setTimeout(()=>{Ws.current=!1},500)}),window.Monaco||Ft(pn,ln(Ct)),Ci&&(bn(sn,de),fr.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Ce),window.removeEventListener("paste",Ce),window.addEventListener("keydown",Ce),window.addEventListener("paste",Ce)),window.Monaco=pn,wn&&Ze.onDidBlurEditorWidget(()=>{wn(Ze.getValue())}),ai&&Ze.onDidFocusEditorText(()=>{Ci&&ni(),ai(Ze.getValue())}),Ci){ni();try{Ze.onDidPaste(Di=>{const Ve=Ze.getSelection(),jn=Ti.current.pastePos||{},wo=new pn.Range(jn.startLineNumber||Ve.endLineNumber,jn.startColumn||Ve.endColumn,jn.endLineNumber||Ve.endLineNumber,jn.endColumn||Ve.endColumn);Ze.executeEdits("",[{range:Di.range,text:""}])})}catch(Di){}}let qn=xt();return Po&&typeof Po=="string"&&new kt(Po,Ze,pn),Je(!0),()=>{const Di=Ti.current.instance;Di.dispose();const Ve=Di.getModel();Ve&&Ve.dispose(),Ti.current.subscription&&Ti.current.subscription.dispose(),qn.unobserve(fr.current)}}catch(Ze){}})},[]),(0,wt.useEffect)(()=>{if(Ti.current.instance&&sr)return document.addEventListener("keydown",hi,!1),()=>{document.removeEventListener("keydown",hi)}},[Gn,sr]),(0,wt.useEffect)(()=>{let me=Ti.current.instance;if(me&&sr){let Ze=ln(Ct);pn.editor.setModelLanguage(me.getModel(),Ze)}},[Ct,sr]),(0,wt.useEffect)(()=>{Ti.current.instance&&sr&&pn.editor.setTheme(Me)},[Me,sr]),(0,wt.useEffect)(()=>{let me=Ti.current.instance;jo.current=_t,me&&sr&&(me.updateOptions(Bi({},_t)),setTimeout(()=>{me.getModel().updateOptions(Bi({},_t))},200))},[JSON.stringify(_t),sr]),(0,wt.useEffect)(()=>{let me=Ti.current.instance;me&&sr&&me.layout()},[De,Rt,sr]);const[ee,Ie]=(0,wt.useState)(He(De)),[Tn,Hn]=(0,wt.useState)(He(Rt)),Bn=so(Bi({},Bt),{width:ee,height:Tn,position:"relative"});return wt.createElement("div",{className:"my-monaco-editor",ref:fr,style:Bn},pi&&wt.createElement(re.CopyToClipboard,{text:Lt,onCopy:()=>Ht.ZP.success("\u590D\u5236\u6210\u529F")},wt.createElement(Zt.Z,{title:"\u590D\u5236\u4EE3\u7801"},wt.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},wt.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function he({width:Ae="100%",height:hn="100%",original:De,modified:Rt,language:Lt,options:Ct={}}){const Bt=(0,wt.useRef)(),[_t,Nt]=(0,wt.useState)(null);function Me(Yn){let Ci;return Bt.current&&(Ci=new ue.Z(Pn=>{for(let ki of Pn)(ki.target.offsetHeight>0||ki.target.offsetWidth>0)&&Yn.layout()}),Ci.observe(Bt.current)),Ci}(0,wt.useEffect)(()=>(Bt.current&&Promise.all([Vt.e(5552),Vt.e(9404)]).then(Vt.bind(Vt,50048)).then(Yn=>{pn=Yn;const Ci=pn.editor.createDiffEditor(Bt.current,so(Bi({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ct),{wordWrap:!0}));Nt(Ci);let Pn=Me(Ci);return()=>{Ci.dispose();const ki=Ci.getModel();ki&&ki.dispose(),Pn.unobserve(Bt.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,wt.useEffect)(()=>{_t&&_t.setModel({original:pn.editor.createModel(De,Lt),modified:pn.editor.createModel(Rt,Lt)})},[De,Rt,Lt,_t]);const wn=He(Ae),pi=He(hn),Gn={width:wn,height:pi};return wt.createElement("div",{className:"my-diff-editor",ref:Bt,style:Gn})}},99914:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return ue}});var wt=Vt(67294);function ue(_e,$e){const ye=(0,wt.useRef)();(0,wt.useEffect)(()=>{ye.current=_e}),(0,wt.useEffect)(()=>{function oe(){ye.current()}if($e!==null){let Yt=setInterval(oe,$e);return()=>clearInterval(Yt)}},[$e])}},79061:function(un,Rn,Vt){"use strict";Vt.r(Rn),Vt.d(Rn,{default:function(){return Co}});var wt=Vt(67294),ue=Vt(35973),_e=Vt(50136),$e=Vt(26058),ye=Vt(91773),oe=Vt(2453),Yt=Vt(96074),Ne=Vt(85673),ge=Vt(71230),we=Vt(15746),Ye=Vt(83062),Be=Vt(28802),on=Vt(85804),Ft=Vt(40043),et=Vt(32027),nt=Vt(62844),ht=Vt(84567),lt=Vt(37720),pt=Vt(15835),vt=Vt(35567),kt=Vt(65226),Et={flex_box_center:"flex_box_center___T9vjl",flex_space_between:"flex_space_between___zZP1J",flex_box_vertical_center:"flex_box_vertical_center___vbIhw",flex_box_center_end:"flex_box_center_end___SjRau",flex_box_column:"flex_box_column___Ic_zi",wrap:"wrap___GtXAk",modal:"modal___mDuC3",titleWrap:"titleWrap___EzCZh",required:"required___KgfdI",title:"title___TMgfc",colorGray:"colorGray___xNVTs",choiceWrap:"choiceWrap___Rv9ug",answer:"answer___hVpls",activeAnswer:"activeAnswer___oJoq9",deleteIcon:"deleteIcon___bkn4b",addIcon:"addIcon___S2pDY",editorWrap:"editorWrap___BOx_r",htmlWrap:"htmlWrap___ERVlQ",radio:"radio___lrt5b",color333:"color333___pz3OT",color999:"color999___jtQ7e",questionType:"questionType___qUnUb",questionChoices:"questionChoices___n36qp"},Ht=Object.defineProperty,Zt=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable,re=(ne,xe,Pe)=>xe in ne?Ht(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,Ge=(ne,xe)=>{for(var Pe in xe||(xe={}))ie.call(xe,Pe)&&re(ne,Pe,xe[Pe]);if(Zt)for(var Pe of Zt(xe))le.call(xe,Pe)&&re(ne,Pe,xe[Pe]);return ne},fe=(ne,xe)=>{var Pe={};for(var kn in ne)ie.call(ne,kn)&&xe.indexOf(kn)<0&&(Pe[kn]=ne[kn]);if(ne!=null&&Zt)for(var kn of Zt(ne))xe.indexOf(kn)<0&&le.call(ne,kn)&&(Pe[kn]=ne[kn]);return Pe},Ke=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const an=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],nn=(ne,xe)=>{var Pe=ne,{problemset:kn,globalSetting:zi,loading:ae,dispatch:Mn,onRef:cn=()=>{},editData:Se}=Pe,$n=fe(Pe,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,ui]=(0,wt.useState)([]),[di,fi]=(0,wt.useState)(),[In,be]=(0,wt.useState)([]),[Gi,ke]=(0,wt.useState)(""),[vi,co]=(0,wt.useState)(5),[qt,se]=(0,wt.useState)(!1),ve=(0,ue.useParams)();(0,wt.useEffect)(()=>{ui(["","","",""])},[]),(0,wt.useEffect)(()=>{if(!(Se!=null&&Se.question_choices)){se(!0);return}ke(Se==null?void 0:Se.question_title),co(parseInt(Se==null?void 0:Se.question_score)),ui(Se==null?void 0:Se.question_choices.map(An=>An.choice_text));const At=[];Se==null||Se.standard_answer.map((An,_i)=>{At.push(An-1)}),be(At)},[Se]),(0,wt.useImperativeHandle)(xe,()=>({onSave:je,isEdit:qt}));const je=()=>Ke(void 0,null,function*(){if(!Gi)return oe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const At=Vn.findIndex(Wi=>!Wi);if(At>-1)return oe.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${an[At]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!In.length)return oe.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(In.length<1)return oe.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const An=Vn.map((Wi,To)=>({choice_text:Wi,is_answer:In.includes(To)?To+1:0}));let _i;Se.question_id?_i=yield Mn({type:"exercise/editExerciseQuestion",payload:{id:Se.question_id,question_title:Gi,question_type:1,question_score:"5.0",question_choices:An.map(Wi=>Wi.choice_text),standard_answers:An.filter(Wi=>Wi.is_answer).map(Wi=>Wi.is_answer)}}):_i=yield Mn({type:"exercise/addExerciseQuestion",payload:{categoryId:ve.categoryId,question_title:Gi,question_type:1,question_score:"5.0",question_choices:An.map(Wi=>Wi.choice_text),standard_answers:An.filter(Wi=>Wi.is_answer).map(Wi=>Wi.is_answer)}}),_i.status===0&&(oe.ZP.success("\u4FDD\u5B58\u6210\u529F"),se(!1),Mn({type:"exercise/editExercise",payload:Ge({},ve)}))}),fn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Kn=At=>Ke(void 0,null,function*(){switch(At.id){case"del":let An;nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Ke(this,null,function*(){yield(0,pt.Fl)({id:Se.question_id}),Mn({type:"exercise/editExercise",payload:Ge({},ve)})})}});break;case"up":case"down":yield Mn({type:"exercise/exeriseMoveUpDown",payload:{id:Se.question_id,opr:At.id}}),Mn({type:"exercise/editExercise",payload:Ge({},ve)});break;case"edit":se(!0);break}}),yn=()=>{var At;return wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},Se.key,"\u3001\u591A\u9009\u9898"),"\uFF08",Se.question_score,"\u5206\uFF09"),!Se.hideAction&&fn.map(function(An,_i){return An.id==="up"&&Se.key===1||An.id==="down"&&Se.key===Se.len?null:wt.createElement(Ye.Z,{key:_i,placement:"bottom",title:An.name},wt.createElement("span",{onClick:()=>Kn(An),className:An.icon}))})),wt.createElement("div",{className:"mt5"},wt.createElement(kt.Z,{value:Se.question_title})),wt.createElement("div",{className:Et.questionChoices},(At=Se==null?void 0:Se.question_choices)==null?void 0:At.map(function(An,_i){return wt.createElement(ge.Z,null,wt.createElement(we.Z,null,wt.createElement(ht.default,{key:_i,checked:Se.standard_answer.includes(_i+1),disabled:!0},an[_i],".")),wt.createElement(we.Z,{flex:"1"},wt.createElement("span",{className:"c-black font14"},wt.createElement(kt.Z,{value:An.choice_text}))))})))},qe=()=>wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),wt.createElement("p",{className:Et.titleWrap},wt.createElement("span",{className:Et.required},"*"),wt.createElement("span",{className:Et.title},"\u9898\u5E72\uFF1A")),wt.createElement(vt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Gi,onChange:At=>ke(At)}),Vn.map((At,An)=>wt.createElement("div",{className:Et.choiceWrap,key:An},wt.createElement(Ye.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},wt.createElement("div",{className:`${Et.answer} ${In.includes(An)?Et.activeAnswer:""}`,onClick:()=>{In.includes(An)?be(In.filter(_i=>_i!==An)):be([...In,An])}},an[An])),wt.createElement("div",{className:Et.editorWrap},di===An?wt.createElement(vt.Z,{id:`single-question-option-${An}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:At,onChange:_i=>{Vn[An]=_i,ui(Vn)}}):wt.createElement("div",{className:Et.htmlWrap,onClick:()=>fi(An)},wt.createElement(kt.Z,{value:At}))),An>1&&wt.createElement(Ye.Z,{title:"\u5220\u9664"},wt.createElement("i",{className:`${Et.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>ui(Vn.filter((_i,Wi)=>Wi!==An))})),An<7&&An===Vn.length-1&&wt.createElement(Ye.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},wt.createElement("i",{className:`${Et.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>ui([...Vn,""])})))),wt.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),wt.createElement("p",{className:""},"\u5206\u503C\uFF1A",wt.createElement(lt.Z,{value:vi,max:1e4,min:-1,onChange:At=>{co(At)}})," \u5206"),wt.createElement("aside",{className:"tr"},Se.question_id&&wt.createElement(on.ZP,{type:"default",onClick:()=>se(!1)},"\u53D6\u6D88"),wt.createElement(on.ZP,{className:"ml20",type:"primary",onClick:()=>je()},"\u4FDD\u5B58")));return wt.createElement("section",{className:Et.wrap},!qt&&yn(),qt&&qe())};var Si=(0,ue.connect)(({problemset:ne,loading:xe,globalSetting:Pe})=>({problemset:ne,globalSetting:Pe,loading:xe.effects}),null,null,{forwardRef:!0})((0,wt.forwardRef)(nn)),oi=Vt(98813),Bi=Object.defineProperty,so=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,He=(ne,xe,Pe)=>xe in ne?Bi(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,En=(ne,xe)=>{for(var Pe in xe||(xe={}))Qt.call(xe,Pe)&&He(ne,Pe,xe[Pe]);if(so)for(var Pe of so(xe))zt.call(xe,Pe)&&He(ne,Pe,xe[Pe]);return ne},Fn=(ne,xe)=>{var Pe={};for(var kn in ne)Qt.call(ne,kn)&&xe.indexOf(kn)<0&&(Pe[kn]=ne[kn]);if(ne!=null&&so)for(var kn of so(ne))xe.indexOf(kn)<0&&zt.call(ne,kn)&&(Pe[kn]=ne[kn]);return Pe},Te=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const ln=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pn=(ne,xe)=>{var Pe=ne,{problemset:kn,globalSetting:zi,loading:ae,dispatch:Mn,onRef:cn=()=>{},editData:Se}=Pe,$n=Fn(Pe,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,ui]=(0,wt.useState)([]),[di,fi]=(0,wt.useState)(),[In,be]=(0,wt.useState)([]),[Gi,ke]=(0,wt.useState)(""),[vi,co]=(0,wt.useState)(0),[qt,se]=(0,wt.useState)(!1),ve=(0,ue.useParams)();(0,wt.useEffect)(()=>{ui(["","","",""])},[]),(0,wt.useEffect)(()=>{if(!(Se!=null&&Se.question_choices)){se(!0);return}ke(Se==null?void 0:Se.question_title),co(parseInt(Se==null?void 0:Se.question_score)),ui(Se==null?void 0:Se.question_choices.map(An=>An.choice_text));const At=[];Se==null||Se.standard_answer.map((An,_i)=>{At.push(An-1)}),be(At)},[Se]),(0,wt.useImperativeHandle)(xe,()=>({onSave:je,isEdit:qt}));const je=()=>Te(void 0,null,function*(){if(!Gi)return oe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const At=Vn.findIndex(Wi=>!Wi);if(At>-1)return oe.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${ln[At]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!In.length)return oe.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(In.length<1)return oe.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const An=Vn.map((Wi,To)=>({choice_text:Wi,is_answer:In.includes(To)?To+1:0}));let _i;Se.question_id?_i=yield(0,et.Kc)({id:Se.question_id,question_title:Gi,question_type:1,question_score:vi,question_choices:An.map(Wi=>Wi.choice_text),standard_answers:An.filter(Wi=>Wi.is_answer).map(Wi=>Wi.is_answer)}):_i=yield(0,et.iV)({exercise_bank_id:ve.topicId,question_title:Gi,question_type:1,question_score:"5.0",question_choices:An.map(Wi=>Wi.choice_text),standard_answers:An.filter(Wi=>Wi.is_answer).map(Wi=>Wi.is_answer)}),_i.status===0&&(oe.ZP.success("\u4FDD\u5B58\u6210\u529F"),se(!1)),yield Mn({type:"polls/getExerciseBanks",payload:En({},ve)})}),fn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Kn=At=>Te(void 0,null,function*(){switch(At.id){case"del":let An;nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Te(this,null,function*(){yield(0,et.x$)({pollsId:Se.question_id}),Mn({type:"polls/getExerciseBanks",payload:En({},ve)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:Se==null?void 0:Se.question_id,opr:At.id}),Mn({type:"polls/getExerciseBanks",payload:En({},ve)});break;case"edit":se(!0);break}}),yn=()=>{var At;return wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},Se.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Se.question_score,"\u5206\uFF09"),!Se.hideAction&&fn.map(function(An,_i){return An.id==="up"&&Se.key===1||An.id==="down"&&Se.key===Se.len?null:wt.createElement(Ye.Z,{key:_i,placement:"bottom",title:An.name},wt.createElement("span",{onClick:()=>Kn(An),className:An.icon}))})),wt.createElement("div",{className:"mt5"},wt.createElement(kt.Z,{value:Se.question_title})),wt.createElement("div",{className:Et.questionChoices},(At=Se==null?void 0:Se.question_choices)==null?void 0:At.map(function(An,_i){return wt.createElement(ge.Z,null,wt.createElement(we.Z,null,wt.createElement(oi.ZP,{key:_i,checked:Se.standard_answer.includes(_i+1),disabled:!0},ln[_i],".")),wt.createElement(we.Z,{flex:"1"},wt.createElement("span",{className:"c-black font14"},wt.createElement(kt.Z,{value:An.choice_text}))))})))},qe=()=>wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),wt.createElement("p",{className:Et.titleWrap},wt.createElement("span",{className:Et.required},"*"),wt.createElement("span",{className:Et.title},"\u9898\u5E72\uFF1A")),wt.createElement(vt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Gi,onChange:At=>ke(At)}),Vn.map((At,An)=>wt.createElement("div",{className:Et.choiceWrap,key:An},wt.createElement(Ye.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},wt.createElement("div",{className:`${Et.answer} ${In.includes(An)?Et.activeAnswer:""}`,onClick:()=>{In.includes(An)?be(In.filter(_i=>_i!==An)):be([...In,An])}},ln[An])),wt.createElement("div",{className:Et.editorWrap},di===An?wt.createElement(vt.Z,{id:`single-question-option-${An}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:At,onChange:_i=>{Vn[An]=_i,ui(Vn)}}):wt.createElement("div",{className:Et.htmlWrap,onClick:()=>fi(An)},wt.createElement(kt.Z,{value:At}))),An>1&&wt.createElement(Ye.Z,{title:"\u5220\u9664"},wt.createElement("i",{className:`${Et.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>ui(Vn.filter((_i,Wi)=>Wi!==An))})),An<7&&An===Vn.length-1&&wt.createElement(Ye.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},wt.createElement("i",{className:`${Et.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>ui([...Vn,""])})))),wt.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),wt.createElement("p",{className:""},"\u5206\u503C\uFF1A",wt.createElement(lt.Z,{value:vi,max:1e4,min:-1,onChange:At=>{co(At)}})," \u5206"),wt.createElement("aside",{className:"tr"},Se.question_id&&wt.createElement(on.ZP,{type:"default",onClick:()=>se(!1)},"\u53D6\u6D88"),wt.createElement(on.ZP,{className:"ml20",type:"primary",onClick:()=>je()},"\u4FDD\u5B58")));return wt.createElement("section",{className:Et.wrap},!qt&&yn(),qt&&qe())};var ni=(0,ue.connect)(({problemset:ne,loading:xe,globalSetting:Pe})=>({problemset:ne,globalSetting:Pe,loading:xe.effects}),null,null,{forwardRef:!0})((0,wt.forwardRef)(pn)),Cn=Object.defineProperty,he=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,De=(ne,xe,Pe)=>xe in ne?Cn(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,Rt=(ne,xe)=>{for(var Pe in xe||(xe={}))Ae.call(xe,Pe)&&De(ne,Pe,xe[Pe]);if(he)for(var Pe of he(xe))hn.call(xe,Pe)&&De(ne,Pe,xe[Pe]);return ne},Lt=(ne,xe)=>{var Pe={};for(var kn in ne)Ae.call(ne,kn)&&xe.indexOf(kn)<0&&(Pe[kn]=ne[kn]);if(ne!=null&&he)for(var kn of he(ne))xe.indexOf(kn)<0&&hn.call(ne,kn)&&(Pe[kn]=ne[kn]);return Pe},Ct=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const Bt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_t=(ne,xe)=>{var Pe=ne,{problemset:kn,globalSetting:zi,loading:ae,dispatch:Mn,onRef:cn=()=>{},editData:Se}=Pe,$n=Lt(Pe,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,ui]=(0,wt.useState)(),[di,fi]=(0,wt.useState)(""),[In,be]=(0,wt.useState)(!1),[Gi,ke]=(0,wt.useState)(5),vi=(0,ue.useParams)();(0,wt.useEffect)(()=>{if(!(Se!=null&&Se.question_choices)){be(!0);return}fi(Se==null?void 0:Se.question_title),ke(Se==null?void 0:Se.question_score),ui(Se.standard_answer[0]+"")},[Se]),(0,wt.useImperativeHandle)(xe,()=>({onSave:co,isEdit:In}));const co=()=>Ct(void 0,null,function*(){if(!di)return oe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!Vn)return oe.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;const fn=[{choice_text:"\u6B63\u786E",is_answer:Vn==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Vn==="2"?2:0}];let Kn;return Se.question_id?Kn=yield(0,et.Kc)({id:Se.question_id,question_title:di,question_type:2,question_score:Gi,question_choices:fn.map(yn=>yn.choice_text),standard_answers:fn.filter(yn=>yn.is_answer).map(yn=>yn.is_answer)}):Kn=yield(0,et.iV)({exercise_bank_id:vi.topicId,question_title:di,question_type:2,question_score:Gi,question_choices:fn.map(yn=>yn.choice_text),standard_answers:fn.filter(yn=>yn.is_answer).map(yn=>yn.is_answer)}),Kn.status===0&&(oe.ZP.success("\u4FDD\u5B58\u6210\u529F"),be(!1)),Mn({type:"polls/getExerciseBanks",payload:Rt({},vi)}),{name:di,choices:fn}}),qt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],se=fn=>Ct(void 0,null,function*(){switch(fn.id){case"del":let Kn;nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Ct(this,null,function*(){yield(0,et.x$)({pollsId:Se.question_id}),Mn({type:"polls/getExerciseBanks",payload:Rt({},vi)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:Se==null?void 0:Se.question_id,opr:fn.id}),Mn({type:"polls/getExerciseBanks",payload:Rt({},vi)});break;case"edit":be(!0);break}}),ve=()=>{var fn;return wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},Se.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Se.question_score,"\u5206\uFF09"),!Se.hideAction&&qt.map(function(Kn,yn){return Kn.id==="up"&&Se.key===1||Kn.id==="down"&&Se.key===Se.len?null:wt.createElement(Ye.Z,{key:yn,placement:"bottom",title:Kn.name},wt.createElement("span",{onClick:()=>se(Kn),className:Kn.icon}))})),wt.createElement("div",{className:"mt5"},Se.question_title),wt.createElement("div",{className:Et.questionChoices},(fn=Se==null?void 0:Se.question_choices)==null?void 0:fn.map(function(Kn,yn){return wt.createElement(oi.ZP,{key:yn,checked:Se.standard_answer.includes(yn+1),disabled:!0},Bt[yn],". ",wt.createElement("span",{className:"c-black font14"},Kn.choice_text))})))},je=()=>wt.createElement("aside",null,wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),wt.createElement("p",{className:Et.titleWrap},wt.createElement("span",{className:Et.required},"*"),wt.createElement("span",{className:Et.title},"\u9898\u5E72\uFF1A")),wt.createElement(vt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:di,onChange:fn=>fi(fn)}),wt.createElement("p",{className:Et.titleWrap},wt.createElement("span",{className:Et.required},"*"),wt.createElement("span",{className:Et.title},"\u7B54\u6848\u9009\u9879\uFF1A",wt.createElement("span",{className:Et.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),wt.createElement(oi.ZP.Group,{buttonStyle:"solid",value:Vn,onChange:fn=>ui(fn.target.value)},wt.createElement(oi.ZP.Button,{value:"1",className:`${Et.radio} mr40`},"\u6B63\u786E"),wt.createElement(oi.ZP.Button,{value:"2",className:Et.radio},"\u9519\u8BEF")),wt.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),wt.createElement("p",{className:""},"\u5206\u503C\uFF1A",wt.createElement(lt.Z,{value:Gi,max:1e4,min:-1,onChange:fn=>{ke(fn)}})," \u5206"),wt.createElement("aside",{className:"tr"},Se.question_id&&wt.createElement(on.ZP,{type:"default",onClick:()=>be(!1)},"\u53D6\u6D88"),wt.createElement(on.ZP,{className:"ml20",type:"primary",onClick:()=>co()},"\u4FDD\u5B58")));return wt.createElement("section",{className:Et.wrap},!In&&ve(),In&&je())};var Nt=(0,ue.connect)(({problemset:ne,loading:xe,globalSetting:Pe})=>({problemset:ne,globalSetting:Pe,loading:xe.effects}),null,null,{forwardRef:!0})((0,wt.forwardRef)(_t)),Me=Vt(35566),wn=Vt(73646),pi=Vt(28706),Gn=Object.defineProperty,Yn=Object.getOwnPropertySymbols,Ci=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,ki=(ne,xe,Pe)=>xe in ne?Gn(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,ai=(ne,xe)=>{for(var Pe in xe||(xe={}))Ci.call(xe,Pe)&&ki(ne,Pe,xe[Pe]);if(Yn)for(var Pe of Yn(xe))Pn.call(xe,Pe)&&ki(ne,Pe,xe[Pe]);return ne},eo=(ne,xe)=>{var Pe={};for(var kn in ne)Ci.call(ne,kn)&&xe.indexOf(kn)<0&&(Pe[kn]=ne[kn]);if(ne!=null&&Yn)for(var kn of Yn(ne))xe.indexOf(kn)<0&&Pn.call(ne,kn)&&(Pe[kn]=ne[kn]);return Pe},ri=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const Yo=null,Ro=(ne,xe)=>{var Pe=ne,{problemset:kn,globalSetting:zi,loading:ae,dispatch:Mn,editData:cn}=Pe,Se=eo(Pe,["problemset","globalSetting","loading","dispatch","editData"]);const[$n,Vn]=(0,wt.useState)(""),[ui,di]=(0,wt.useState)(""),[fi,In]=(0,wt.useState)([]),[be,Gi]=(0,wt.useState)(""),[ke,vi]=(0,wt.useState)(),[co,qt]=(0,wt.useState)(!1),[se,ve]=(0,wt.useState)(5),[je,fn]=(0,wt.useState)(!1),Kn=(0,ue.useParams)();(0,wt.useEffect)(()=>{if(!(cn!=null&&cn.question_title)){fn(!0);return}Vn(cn==null?void 0:cn.question_title),vi(cn==null?void 0:cn.is_ordered),ve(cn==null?void 0:cn.question_score);const Ii=cn==null?void 0:cn.standard_answer.map(Pi=>Pi.answer_text);In(Ii)},[kn.editData]),(0,wt.useEffect)(()=>{qt(!1)},[je]),(0,wt.useImperativeHandle)(xe,()=>({onSave:yn,isEdit:je}));const yn=()=>ri(void 0,null,function*(){let Ii=[],Pi=!1;if(fi.forEach((Wn,Dn)=>{Ii.push({choice_id:Dn+1,answer_text:[]}),Wn.forEach((xi,Le)=>{Ii[Dn].answer_text.push(xi),(!xi||!(0,pi.eR)(xi,1e4))&&(Gi(`${Dn}-${Le}`),oe.ZP.info(xi?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Pi=!0)})}),Pi)return!1;let Ui;return cn.question_id?Ui=yield(0,et.Kc)({id:cn.question_id,question_title:$n,question_type:3,question_score:se,is_ordered:ke,standard_answers:Ii}):Ui=yield(0,et.iV)({exercise_bank_id:Kn.topicId,question_title:$n,question_type:3,question_score:se,is_ordered:ke,standard_answers:Ii}),Ui.status===0&&(oe.ZP.success("\u4FDD\u5B58\u6210\u529F"),fn(!1)),Mn({type:"polls/getExerciseBanks",payload:ai({},Kn)}),{name:$n,analysis:ui,standard_answers:Ii,is_ordered:ke}}),qe=(Ii,Pi,Ui)=>{const Wn=fi.slice();if(Pi&&Wn.splice(Ii,Pi),Ui&&co)for(let Dn=0;Dn<Ui;Dn++)Wn.splice(Ii+Dn,0,[""]);qt(!0),In(Wn)},At=(Ii,Pi,Ui)=>{Gi("");let Wn=fi.slice();Wn[Ii][Pi]=Ui,In(Wn)},An=Ii=>{let Pi=fi.slice();Pi[Ii]=[...Pi[Ii],""],In(Pi)},_i=(Ii,Pi)=>{let Ui=fi.slice();if(!Ui[Ii][Pi]){Ui[Ii]=Ui[Ii].filter((Wn,Dn)=>Dn!==Pi),In(Ui);return}nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Et.modal,onOk:()=>{Ui[Ii]=Ui[Ii].filter((Wn,Dn)=>Dn!==Pi),In(Ui)}})},Wi=Ii=>{nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Et.modal,onOk:()=>{let Pi=fi.slice();Pi=fi.filter((Ui,Wn)=>Ii!==Wn),In(Pi)}})},To=()=>wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),wt.createElement("div",null,wt.createElement(Me.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:$n,onChange:Ii=>Vn(Ii),showNullButton:!0,onPlaceholderChange:qe})),wt.createElement("div",{className:"mt20"},fi.map((Ii,Pi)=>wt.createElement(wn.Z,{key:Pi,answers:Ii,index:Pi,is_md:!0,activeOptionErrorIndex:be,onAnswerChange:At,addChildAnswer:An,deleteChildAnswer:_i,deleteChildAnswermain:Wi}))),wt.createElement("div",{className:"mt20"},fi.length>1&&wt.createElement("span",null,wt.createElement(ht.default,{checked:ke,onChange:Ii=>vi(Ii.target.checked),className:`${Et.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),wt.createElement("span",{className:`${Et.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),wt.createElement("p",{className:""},"\u5206\u503C\uFF1A",wt.createElement(lt.Z,{value:se,max:1e4,min:-1,onChange:Ii=>{ve(Ii)}})," \u5206"),wt.createElement("aside",{className:"tr"},cn.question_id&&wt.createElement(on.ZP,{type:"default",onClick:()=>fn(!1)},"\u53D6\u6D88"),wt.createElement(on.ZP,{className:"ml20",type:"primary",onClick:()=>yn()},"\u4FDD\u5B58"))),lo=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Qi=Ii=>ri(void 0,null,function*(){switch(Ii.id){case"del":let Pi;nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return ri(this,null,function*(){yield(0,et.x$)({pollsId:cn.question_id}),Mn({type:"polls/getExerciseBanks",payload:ai({},Kn)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:cn==null?void 0:cn.question_id,opr:Ii.id}),Mn({type:"polls/getExerciseBanks",payload:ai({},Kn)});break;case"edit":fn(!0);break}}),Do=()=>{var Ii;return wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},cn.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",cn.question_score,"\u5206\uFF09"),!cn.hideAction&&lo.map(function(Pi,Ui){return Pi.id==="up"&&cn.key===1||Pi.id==="down"&&cn.key===cn.len?null:wt.createElement(Ye.Z,{key:Ui,placement:"bottom",title:Pi.name},wt.createElement("span",{onClick:()=>Qi(Pi),className:Pi.icon}))})),wt.createElement("div",{className:"mt5"},cn.question_title),wt.createElement("div",{className:Et.questionChoices},(Ii=cn==null?void 0:cn.standard_answer)==null?void 0:Ii.map(function(Pi,Ui){return wt.createElement(ge.Z,null,wt.createElement(we.Z,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Pi.choice_id,"\uFF09\uFF1A"),wt.createElement(we.Z,{flex:"1"},wt.createElement(Be.default,{key:Ui,checked:cn.standard_answer.includes(Ui),disabled:!0,value:Pi.answer_text})))})))};return wt.createElement("section",{className:Et.wrap},!je&&Do(),je&&To())};var mo=(0,ue.connect)(({problemset:ne,loading:xe,globalSetting:Pe})=>({problemset:ne,globalSetting:Pe,loading:xe.effects}),null,null,{forwardRef:!0})((0,wt.forwardRef)(Ro)),Ji=Object.defineProperty,Cr=Object.getOwnPropertySymbols,Po=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,rr=(ne,xe,Pe)=>xe in ne?Ji(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,fr=(ne,xe)=>{for(var Pe in xe||(xe={}))Po.call(xe,Pe)&&rr(ne,Pe,xe[Pe]);if(Cr)for(var Pe of Cr(xe))dr.call(xe,Pe)&&rr(ne,Pe,xe[Pe]);return ne},Ti=(ne,xe)=>{var Pe={};for(var kn in ne)Po.call(ne,kn)&&xe.indexOf(kn)<0&&(Pe[kn]=ne[kn]);if(ne!=null&&Cr)for(var kn of Cr(ne))xe.indexOf(kn)<0&&dr.call(ne,kn)&&(Pe[kn]=ne[kn]);return Pe},jo=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const As=null,ws=(ne,xe)=>{var Pe=ne,{problemset:kn,globalSetting:zi,loading:ae,dispatch:Mn,onRef:cn=()=>{},editData:Se}=Pe,$n=Ti(Pe,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,ui]=(0,wt.useState)(""),[di,fi]=(0,wt.useState)(""),[In,be]=(0,wt.useState)(""),[Gi,ke]=(0,wt.useState)(5),[vi,co]=(0,wt.useState)(!1),qt=(0,ue.useParams)();(0,wt.useEffect)(()=>{var yn;if(!(Se!=null&&Se.question_title)){co(!0);return}ui(Se==null?void 0:Se.question_title),be((yn=Se==null?void 0:Se.standard_answer)==null?void 0:yn[0]),ke(Se==null?void 0:Se.question_score)},[kn.editData]),(0,wt.useImperativeHandle)(xe,()=>({onSave:se,isEdit:vi}));const se=()=>jo(void 0,null,function*(){if(!Vn)return oe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;let yn;return Se.question_id?yn=yield(0,et.Kc)({id:Se.question_id,question_title:Vn,question_type:4,question_score:Gi,standard_answers:[In]}):yn=yield(0,et.iV)({exercise_bank_id:qt.topicId,question_title:Vn,question_type:4,question_score:Gi,standard_answers:[In]}),yn.status===0&&(oe.ZP.success("\u4FDD\u5B58\u6210\u529F"),co(!1),Mn({type:"polls/getExerciseBanks",payload:fr({},qt)})),{name:Vn,answer_texts:[In],analysis:di}}),ve=()=>wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},"\u7B80\u7B54\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),wt.createElement(vt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vn,onChange:yn=>ui(yn)}),wt.createElement("p",{className:Et.titleWrap},wt.createElement("span",{className:Et.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),wt.createElement(vt.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:In,onChange:yn=>be(yn)}),wt.createElement("p",{className:""},"\u5206\u503C\uFF1A",wt.createElement(lt.Z,{value:Gi,max:1e4,min:-1,onChange:yn=>{ke(yn)}})," \u5206"),wt.createElement("aside",{className:"tr"},Se.question_id&&wt.createElement(on.ZP,{type:"default",onClick:()=>co(!1)},"\u53D6\u6D88"),wt.createElement(on.ZP,{className:"ml20",type:"primary",onClick:()=>se()},"\u4FDD\u5B58"))),je=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],fn=yn=>jo(void 0,null,function*(){switch(yn.id){case"del":let qe;nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return jo(this,null,function*(){yield(0,et.x$)({pollsId:Se.question_id}),Mn({type:"polls/getExerciseBanks",payload:fr({},qt)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:Se==null?void 0:Se.question_id,opr:yn.id}),Mn({type:"polls/getExerciseBanks",payload:fr({},qt)});break;case"edit":co(!0);break}}),Kn=()=>wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},Se.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Se.question_score,"\u5206\uFF09"),!Se.hideAction&&je.map(function(yn,qe){return yn.id==="up"&&Se.key===1||yn.id==="down"&&Se.key===Se.len?null:wt.createElement(Ye.Z,{key:qe,placement:"bottom",title:yn.name},wt.createElement("span",{onClick:()=>fn(yn),className:yn.icon}))})),wt.createElement("div",{className:"mt5"},Se.question_title),wt.createElement("div",{className:Et.questionChoices},wt.createElement("p",null,wt.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),wt.createElement(kt.Z,{value:In})));return wt.createElement("section",{className:Et.wrap},!vi&&Kn(),vi&&ve())};var Ws=(0,ue.connect)(({problemset:ne,loading:xe,globalSetting:Pe})=>({problemset:ne,globalSetting:Pe,loading:xe.effects}),null,null,{forwardRef:!0})((0,wt.forwardRef)(ws)),Wr=Object.defineProperty,os=Object.getOwnPropertySymbols,Or=Object.prototype.hasOwnProperty,sr=Object.prototype.propertyIsEnumerable,Je=(ne,xe,Pe)=>xe in ne?Wr(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,xt=(ne,xe)=>{for(var Pe in xe||(xe={}))Or.call(xe,Pe)&&Je(ne,Pe,xe[Pe]);if(os)for(var Pe of os(xe))sr.call(xe,Pe)&&Je(ne,Pe,xe[Pe]);return ne},en=(ne,xe)=>{var Pe={};for(var kn in ne)Or.call(ne,kn)&&xe.indexOf(kn)<0&&(Pe[kn]=ne[kn]);if(ne!=null&&os)for(var kn of os(ne))xe.indexOf(kn)<0&&sr.call(ne,kn)&&(Pe[kn]=ne[kn]);return Pe},vn=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const mi=null,li=(ne,xe)=>{var Pe=ne,{problemset:kn,globalSetting:zi,loading:ae,dispatch:Mn,editData:cn}=Pe,Se=en(Pe,["problemset","globalSetting","loading","dispatch","editData"]);const[$n,Vn]=(0,wt.useState)(""),[ui,di]=(0,wt.useState)(""),[fi,In]=(0,wt.useState)(""),[be,Gi]=(0,wt.useState)([]),[ke,vi]=(0,wt.useState)(""),[co,qt]=(0,wt.useState)(),[se,ve]=(0,wt.useState)(!1),[je,fn]=(0,wt.useState)([]),[Kn,yn]=(0,wt.useState)(!1),qe=(0,ue.useParams)();(0,wt.useEffect)(()=>{var lo;cn.edit&&yn(!0),Vn(cn.shixun_name),di(cn.question_title);const Qi=[];(lo=cn.shixun)==null||lo.map(Do=>{Qi.push(Do.challenge_score)}),fn(Qi)},[cn]),(0,wt.useEffect)(()=>{ve(!1)},[Kn]),(0,wt.useImperativeHandle)(xe,()=>({onSave:At,isEdit:Kn}));const At=()=>vn(void 0,null,function*(){let lo=[];if(!1)return!1;let Do;return cn.question_id?Do=yield(0,et.Kc)({id:cn.question_id,question_title:ui,shixun_name:$n,shixun_id:cn.shixun_id,question_type:5,question_scores:je}):Do=yield(0,et.iV)({exercise_bank_id:qe.topicId,question_title:ui,shixun_name:$n,shixun_id:cn.shixun_id,question_type:5,question_scores:je}),Do.status===0&&(oe.ZP.success("\u4FDD\u5B58\u6210\u529F"),yn(!1)),yield Mn({type:"polls/getExerciseBanks",payload:xt({},qe)}),{name:ui,analysis:fi,standard_answers:lo,is_ordered:co}}),An=()=>{var lo;return wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),wt.createElement("div",{className:"mt10"},wt.createElement(Be.default,{defaultValue:$n,onChange:Qi=>{Vn(Qi.target.value)}})),wt.createElement("div",{className:"mt10"},wt.createElement(vt.Z,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:ui,onChange:Qi=>{di(Qi)}})),wt.createElement("div",{className:"mt20"},(lo=cn.shixun)==null?void 0:lo.map((Qi,Do)=>wt.createElement(ge.Z,{gutter:[20,20]},wt.createElement(we.Z,{flex:"1"},Do+1,".",Qi.challenge_name),wt.createElement(we.Z,null,wt.createElement(lt.Z,{defaultValue:je[Do],onChange:Ii=>{je[Do]=Ii,fn(je),console.log("srore:L",je[Do])}}))))),wt.createElement("div",{className:"mt20"},be.length>1&&wt.createElement("span",null,wt.createElement(ht.default,{checked:co,onChange:Qi=>qt(Qi.target.checked),className:`${Et.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),wt.createElement("span",{className:`${Et.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),wt.createElement("aside",{className:"tr"},!(cn!=null&&cn.edit)&&wt.createElement(on.ZP,{type:"default",onClick:()=>yn(!1)},"\u53D6\u6D88"),wt.createElement(on.ZP,{className:"ml20",type:"primary",onClick:()=>At()},"\u4FDD\u5B58")))},_i=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Wi=lo=>vn(void 0,null,function*(){switch(lo.id){case"del":let Qi;nt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return vn(this,null,function*(){yield(0,et.x$)({pollsId:cn.question_id}),Mn({type:"polls/getExerciseBanks",payload:xt({},qe)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:cn==null?void 0:cn.question_id,opr:lo.id}),Mn({type:"polls/getExerciseBanks",payload:xt({},qe)});break;case"edit":yn(!0);break}}),To=()=>{var lo;return wt.createElement("aside",null,wt.createElement("div",{className:Et.questionType},wt.createElement("div",null,wt.createElement("span",{className:"font16 c-blue"},cn.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",cn.question_score,"\u5206\uFF09"),wt.createElement("div",{className:"tr"},wt.createElement(ue.Link,{target:"_blank",to:`/shixuns/${cn.shixun_identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),!cn.hideAction&&_i.map(function(Qi,Do){return Qi.id==="up"&&cn.key===1||Qi.id==="down"&&cn.key===cn.len?null:wt.createElement(Ye.Z,{key:Do,placement:"bottom",title:Qi.name},wt.createElement("span",{onClick:()=>Wi(Qi),className:Qi.icon}))}))),wt.createElement("div",{className:"font16"},cn.shixun_name),wt.createElement("div",{className:"mt30"}),(lo=cn.shixun)==null?void 0:lo.map(function(Qi,Do){return wt.createElement("div",{key:Do},"\u7B2C",Do+1,"\u5173 ",wt.createElement("span",{className:"ml10"},Qi.challenge_name)," ",wt.createElement("span",{className:"ml10"},Qi.challenge_score))}))};return wt.createElement("section",{className:Et.wrap},!Kn&&To(),Kn&&An())};var hi=(0,ue.connect)(({problemset:ne,loading:xe,globalSetting:Pe})=>({problemset:ne,globalSetting:Pe,loading:xe.effects}),null,null,{forwardRef:!0})((0,wt.forwardRef)(li)),Fi=Vt(95012),to=Vt(14845),Ce={flex_box_center:"flex_box_center___hUmFx",flex_space_between:"flex_space_between___ZQWRF",flex_box_vertical_center:"flex_box_vertical_center___NvFWH",flex_box_center_end:"flex_box_center_end___VzfH9",flex_box_column:"flex_box_column___jzLHY",wrp:"wrp___tA5YW",drawer:"drawer___aMsAr",menu:"menu___EdF6h",actived:"actived___rUgO6",actived2:"actived2___ENpPA",listItem:"listItem___Ixzli",info:"info___KHkuz",title:"title___pDJPn",titleLeft:"titleLeft___UBBKz",titleRight:"titleRight___WrCz9",search:"search___AEwRm",description:"description___CYPQc",menuCourse:"menuCourse___gwZ0E"},Oe=Object.defineProperty,ee=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Tn=Object.prototype.propertyIsEnumerable,Hn=(ne,xe,Pe)=>xe in ne?Oe(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,Bn=(ne,xe)=>{for(var Pe in xe||(xe={}))Ie.call(xe,Pe)&&Hn(ne,Pe,xe[Pe]);if(ee)for(var Pe of ee(xe))Tn.call(xe,Pe)&&Hn(ne,Pe,xe[Pe]);return ne},me=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const{Search:Ze}=Be.default,Xn=[{id:"type",name:"\u7B5B\u9009",children:[{name:"\u5168\u90E8\u5B9E\u8BAD",id:"all",type:"type"},{name:"\u6211\u7684\u5B9E\u8BAD",id:"mine",type:"type"}]},{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],Ni=({classroomList:ne,loading:xe,dispatch:Pe,callback:kn})=>{var zi;const ae=(0,ue.useParams)(),Mn=(0,ue.useLocation)(),{actionTabs:cn}=ne,[Se]=ye.default.useForm(),{shixunLists:$n}=ne,[Vn,ui]=(0,wt.useState)([]),[di,fi]=(0,wt.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1});return(0,wt.useEffect)(()=>{Pe({type:"classroomList/getShixunLists",payload:Bn({},di)})},[ae.categoryId]),(0,wt.useEffect)(()=>{ui([])},[ne.actionTabs.key]),ne.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:wt.createElement(Fi.Z,{title:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",placement:"bottom",height:"100%",closable:!1,open:ne.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",rootClassName:Ce.drawer,footer:wt.createElement("div",{className:"tc"},wt.createElement(on.ZP,{size:"middle",onClick:()=>{Pe({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),wt.createElement(on.ZP,{size:"middle",onClick:()=>me(void 0,null,function*(){var In;Vn.length>1?oe.ZP.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"):Vn.length===0?oe.ZP.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"):(kn&&kn((In=$n==null?void 0:$n.shixun_list)==null?void 0:In.filter(be=>be.id===Vn[0])[0]),Pe({type:"classroomList/setActionTabs",payload:{key:""}}))}),type:"primary"},"\u786E\u5B9A"))},wt.createElement("section",{className:"tc"},wt.createElement(Ze,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"middle",className:Ce.search,onSearch:In=>{di.keyword=In,Pe({type:"classroomList/getShixunLists",payload:Bn({},di)})}})),wt.createElement("section",{className:"edu-container"},Xn.map(function(In,be){var Gi;return wt.createElement("ul",{className:Ce.menu,key:be},wt.createElement("li",null,In.name),(Gi=In==null?void 0:In.children)==null?void 0:Gi.map(function(ke,vi){return wt.createElement("li",{key:vi,className:di[In.id]==ke.id?Ce.actived:"",onClick:()=>{di[In.id]=ke.id,fi(Bn({},di)),Pe({type:"classroomList/getShixunLists",payload:Bn({},di)})}},wt.createElement("strong",null,ke.name))}))}),(zi=$n==null?void 0:$n.shixun_list)==null?void 0:zi.map(function(In,be){return wt.createElement("div",{className:Ce.listItem,key:be},wt.createElement(ht.default,{checked:Vn.includes(In.id),value:In.id,onChange:Gi=>{let ke=Vn.indexOf(In.id);Vn.indexOf(In.id)>-1?ui(Vn.filter(vi=>vi!==In.id)):ui(Vn.concat(In.id))}}),wt.createElement("div",{className:Ce.info},wt.createElement("div",{className:Ce.title},wt.createElement("div",{className:Ce.titleLeft},wt.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:In.title}}))),wt.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},wt.createElement("span",{className:Ce.description,dangerouslySetInnerHTML:{__html:In.description}})),wt.createElement("div",{className:" mt15"},In.challenge_names.map(function(Gi,ke){return wt.createElement("span",{key:ke,className:"mr30"},"\u7B2C",ke+1,"\u5173 ",Gi," ")})),wt.createElement(Yt.Z,{dashed:!0}),wt.createElement("div",{className:"c-light-black mt20"},wt.createElement("span",null,In.author_name),wt.createElement("span",{className:"ml15 mr15"},"|"),wt.createElement("span",null,In.author_school_name),wt.createElement("span",{className:"ml15 mr15"},"|"),wt.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570:",In.level),wt.createElement("span",{className:"ml15 mr15"},"|"),wt.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570:"),wt.createElement("span",null,In.study_count))))}),wt.createElement("p",null)),wt.createElement("div",{className:"tc"},wt.createElement(to.Z,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,total:$n==null?void 0:$n.shixuns_count,onChange:In=>{di.page=In,ui([]),Pe({type:"classroomList/getShixunLists",payload:Bn({},di)})}})))};var sn=(0,ue.connect)(({classroomList:ne,loading:xe})=>({classroomList:ne,loading:xe}))(Ni),de={flex_box_center:"flex_box_center___SQWFF",flex_space_between:"flex_space_between___CnFKV",flex_box_vertical_center:"flex_box_vertical_center___pIPP9",flex_box_center_end:"flex_box_center_end___wiYA8",flex_box_column:"flex_box_column___elCPc",bg:"bg___EaPuT",containerTitle:"containerTitle___ixpkx",containerDesc:"containerDesc___r2R0u",listItem:"listItem___jvD98",info:"info___dCwGz",title:"title___UW6TT",titleLeft:"titleLeft___MquHc",titleRight:"titleRight___aWhE3",acitons:"acitons___yle7y"},bn=Object.defineProperty,qn=Object.getOwnPropertySymbols,Di=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,jn=(ne,xe,Pe)=>xe in ne?bn(ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):ne[xe]=Pe,wo=(ne,xe)=>{for(var Pe in xe||(xe={}))Di.call(xe,Pe)&&jn(ne,Pe,xe[Pe]);if(qn)for(var Pe of qn(xe))Ve.call(xe,Pe)&&jn(ne,Pe,xe[Pe]);return ne},Ho=(ne,xe)=>{var Pe={};for(var kn in ne)Di.call(ne,kn)&&xe.indexOf(kn)<0&&(Pe[kn]=ne[kn]);if(ne!=null&&qn)for(var kn of qn(ne))xe.indexOf(kn)<0&&Ve.call(ne,kn)&&(Pe[kn]=ne[kn]);return Pe},fo=(ne,xe,Pe)=>new Promise((kn,zi)=>{var ae=Se=>{try{cn(Pe.next(Se))}catch($n){zi($n)}},Mn=Se=>{try{cn(Pe.throw(Se))}catch($n){zi($n)}},cn=Se=>Se.done?kn(Se.value):Promise.resolve(Se.value).then(ae,Mn);cn((Pe=Pe.apply(ne,xe)).next())});const{SubMenu:Un}=_e.default,{Content:_n,Sider:ti}=$e.default,Yi=ne=>{var xe=ne,{polls:Pe,globalSetting:kn,loading:zi,user:ae,dispatch:Mn}=xe,cn=Ho(xe,["polls","globalSetting","loading","user","dispatch"]),Se,$n,Vn,ui,di,fi,In,be,Gi,ke,vi,co,qt,se,ve,je,fn,Kn,yn,qe,At,An,_i,Wi,To,lo,Qi,Do,Ii,Pi,Ui,Wn,Dn,xi,Le,gi,ji,Lo,vo,Oo,Wo,Ar,cr,Bs,Us,pe,Br,Cs,ma,po,Ds,Os,Vs,yo,$o,Hi;const Vi=(0,ue.useParams)(),Mo=(0,ue.useLocation)(),{userInfo:Bo}=ae,[On]=ye.default.useForm(),[ra,Zr]=(0,wt.useState)([]),[Ys,Tl]=(0,wt.useState)(!1),Fl=[{name:"\u9009\u62E9\u9898",id:0},{name:"\u5224\u65AD\u9898",id:2},{name:"\u586B\u7A7A\u9898",id:3},{name:"\u7B80\u7B54\u9898",id:4},{name:"\u5B9E\u8BAD\u9898",id:5}],Sn=(0,wt.useRef)();(0,wt.useEffect)(()=>{var qi,Uo,Mi,va,rs,Ur;(qi=Pe.exerciseBanks)!=null&&qi.exercise_questions&&(Zr([...(Uo=Pe.exerciseBanks)==null?void 0:Uo.exercise_questions]),On.setFieldsValue({exercise_name:(va=(Mi=Pe.exerciseBanks)==null?void 0:Mi.exercise)==null?void 0:va.exercise_name,exercise_description:(Ur=(rs=Pe.exerciseBanks)==null?void 0:rs.exercise)==null?void 0:Ur.exercise_description}))},[Pe.exerciseBanks]),(0,wt.useEffect)(()=>{Mn({type:"polls/getExerciseBanks",payload:wo({},Vi)})},[Vi.categoryId]);const hr=()=>fo(void 0,null,function*(){var qi,Uo;yield On.validateFields();const Mi=On.getFieldValue();Mi.is_md=!0,Mi.topicId=(Uo=(qi=Pe.exerciseBanks)==null?void 0:qi.exercise)==null?void 0:Uo.id,Tl(!1),yield(0,et.hO)(wo({},Mi)),Mn({type:"polls/getExerciseBanks",payload:wo({},Vi)})}),Sr=qi=>fo(void 0,null,function*(){const Uo=yield Sn==null?void 0:Sn.current;if(Uo!=null&&Uo.isEdit){oe.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}qi===5?Mn({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):Zr([...ra,{question_type:qi}])}),sa=function(){return ra==null?void 0:ra.map(function(qi,Uo){if(qi.key=Uo+1,qi.len=ra.length,qi.question_type===0)return wt.createElement("aside",null,wt.createElement(ni,{ref:Sn,editData:qi}),wt.createElement(Yt.Z,null));if(qi.question_type===1)return wt.createElement("aside",null,wt.createElement(Si,{ref:Sn,editData:qi}),wt.createElement(Yt.Z,null));if(qi.question_type===2)return wt.createElement("aside",null,wt.createElement(Nt,{ref:Sn,editData:qi}),wt.createElement(Yt.Z,null));if(qi.question_type===3)return wt.createElement("aside",null,wt.createElement(mo,{editData:qi}),wt.createElement(Yt.Z,null));if(qi.question_type===4)return wt.createElement("aside",null,wt.createElement(Ws,{editData:qi}),wt.createElement(Yt.Z,null));if(qi.question_type===5)return wt.createElement("aside",null,wt.createElement(hi,{editData:qi}),wt.createElement(Yt.Z,null))})};return wt.createElement("section",{className:"edu-container"},wt.createElement("section",{className:"animated fadeIn"},wt.createElement("aside",{className:"mt10"},Bo&&wt.createElement(Ne.Z,{separator:">"},wt.createElement(Ne.Z.Item,null,wt.createElement(ue.Link,{to:`/users/${Bo.login}/topics/personal`},"\u6211\u7684\u9898\u5E93")),wt.createElement(Ne.Z.Item,null,wt.createElement(ue.Link,{to:`/users/${Bo==null?void 0:Bo.login}/topics/${Vi.topicId}/${Vi.topictype}/exercise/detail`},"\u8BE6\u60C5")),wt.createElement(Ne.Z.Item,null,"\u7F16\u8F91"))),wt.createElement("aside",{className:[de.title,"mt20"].join(" ")},wt.createElement(ge.Z,{style:{width:"100%"},align:"middle"},wt.createElement(we.Z,{flex:"1"},wt.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377"),wt.createElement(pi.VV,{status:[($n=(Se=Pe.exerciseBanks)==null?void 0:Se.exercise)!=null&&$n.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),wt.createElement(we.Z,null,wt.createElement(ue.Link,{className:"font16 c-light-black",to:`/users/${Bo.login}/topics/personal`},"\u8FD4\u56DE"))))),wt.createElement("section",{className:[de.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},!Ys&&wt.createElement("aside",null,wt.createElement("div",{className:de.containerDesc},wt.createElement("div",null,(ui=(Vn=Pe.exerciseBanks)==null?void 0:Vn.exercise)==null?void 0:ui.exercise_name),wt.createElement("div",null,wt.createElement(Ye.Z,{title:"\u7F16\u8F91"},wt.createElement("span",{onClick:()=>Tl(!0),className:"iconfont c-green ml30 icon-bianjishijuan3x"})))),wt.createElement("div",{className:"c-light-black"},(fi=(di=Pe.exerciseBanks)==null?void 0:di.exercise)==null?void 0:fi.exercise_description)),Ys&&wt.createElement(ye.default,{layout:"vertical",form:On},wt.createElement(ye.default.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},wt.createElement(Be.default,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),wt.createElement(ye.default.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},wt.createElement(Be.default.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),wt.createElement(ye.default.Item,{className:"tr"},wt.createElement(on.ZP,{type:"primary",onClick:()=>{hr()}},"\u4FDD\u5B58")))),wt.createElement("p",{className:"mt10",style:{display:"flex"}},wt.createElement("span",{className:"fl",style:{flex:"1"}},!!((be=(In=Pe.exerciseBanks)==null?void 0:In.exercise_types)!=null&&be.q_singles)&&wt.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(ke=(Gi=Pe.exerciseBanks)==null?void 0:Gi.exercise_types)==null?void 0:ke.q_singles,"\u9898\uFF0C\u5171",(co=(vi=Pe.exerciseBanks)==null?void 0:vi.exercise_types)==null?void 0:co.q_singles_scores,"\u5206"),!!((se=(qt=Pe.exerciseBanks)==null?void 0:qt.exercise_types)!=null&&se.q_doubles)&&wt.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(je=(ve=Pe.exerciseBanks)==null?void 0:ve.exercise_types)==null?void 0:je.q_doubles,"\u9898\uFF0C\u5171",(Kn=(fn=Pe.exerciseBanks)==null?void 0:fn.exercise_types)==null?void 0:Kn.q_doubles_scores,"\u5206"),!!((qe=(yn=Pe.exerciseBanks)==null?void 0:yn.exercise_types)!=null&&qe.q_judges)&&wt.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",(An=(At=Pe.exerciseBanks)==null?void 0:At.exercise_types)==null?void 0:An.q_judges,"\u9898\uFF0C\u5171",(Wi=(_i=Pe.exerciseBanks)==null?void 0:_i.exercise_types)==null?void 0:Wi.q_judges_scores,"\u5206"),!!((lo=(To=Pe.exerciseBanks)==null?void 0:To.exercise_types)!=null&&lo.q_nulls)&&wt.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(Do=(Qi=Pe.exerciseBanks)==null?void 0:Qi.exercise_types)==null?void 0:Do.q_nulls,"\u9898\uFF0C\u5171",(Pi=(Ii=Pe.exerciseBanks)==null?void 0:Ii.exercise_types)==null?void 0:Pi.q_nulls_scores,"\u5206"),!!((Wn=(Ui=Pe.exerciseBanks)==null?void 0:Ui.exercise_types)!=null&&Wn.q_mains)&&wt.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(xi=(Dn=Pe.exerciseBanks)==null?void 0:Dn.exercise_types)==null?void 0:xi.q_mains,"\u9898\uFF0C\u5171",(gi=(Le=Pe.exerciseBanks)==null?void 0:Le.exercise_types)==null?void 0:gi.q_mains_scores,"\u5206"),!!((Lo=(ji=Pe.exerciseBanks)==null?void 0:ji.exercise_types)!=null&&Lo.q_shixuns)&&wt.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(Oo=(vo=Pe.exerciseBanks)==null?void 0:vo.exercise_types)==null?void 0:Oo.q_shixuns,"\u9898\uFF0C\u5171",(Ar=(Wo=Pe.exerciseBanks)==null?void 0:Wo.exercise_types)==null?void 0:Ar.q_shixuns_scores,"\u5206"),!!((Bs=(cr=Pe.exerciseBanks)==null?void 0:cr.exercise_types)!=null&&Bs.q_pros)&&wt.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(pe=(Us=Pe.exerciseBanks)==null?void 0:Us.exercise_types)==null?void 0:pe.q_pros,"\u9898\uFF0C\u5171",(Cs=(Br=Pe.exerciseBanks)==null?void 0:Br.exercise_types)==null?void 0:Cs.q_pros_scores,"\u5206")),wt.createElement("span",{className:"fr"},!!((po=(ma=Pe.exerciseBanks)==null?void 0:ma.exercise_types)!=null&&po.q_counts)&&wt.createElement("span",null,"\u5408\u8BA1 ",wt.createElement("span",{className:"color-blue"},(Os=(Ds=Pe.exerciseBanks)==null?void 0:Ds.exercise_types)==null?void 0:Os.q_counts)," \u9898\uFF0C \u5171 ",wt.createElement("span",{className:`${((yo=(Vs=Pe.exerciseBanks)==null?void 0:Vs.exercise_types)==null?void 0:yo.q_scores)>100?"color-red font-bd":"color-orange"}`},(Hi=($o=Pe.exerciseBanks)==null?void 0:$o.exercise_types)==null?void 0:Hi.q_scores)," \u5206"))),ra!=""&&wt.createElement("section",{className:[de.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},sa()),wt.createElement("section",{style:{display:"flex"},className:[de.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},wt.createElement("div",{style:{flex:"1"}},Fl.map(function(qi,Uo){return wt.createElement(on.ZP,{className:"mr20",type:"primary",onClick:()=>Sr(qi.id)},wt.createElement(Ft.Z,{className:"mr5"}),qi.name)}))),wt.createElement(sn,{callback:qi=>{ra.push({shixun:qi.challenge_names.map(Uo=>({challenge_name:Uo,challenge_score:5})),shixun_name:qi.title,shixun_id:qi.id,question_type:5,edit:!0}),Zr([...ra])}}))};var Co=(0,ue.connect)(({polls:ne,loading:xe,user:Pe,globalSetting:kn})=>({polls:ne,globalSetting:kn,user:Pe,loading:xe.effects}))(Yi)},51161:function(un,Rn,Vt){"use strict";Vt.d(Rn,{AL:function(){return kt},Iy:function(){return Ye},Qv:function(){return Ft},ez:function(){return vt},jb:function(){return Be}});var wt=Vt(47084),ue=Vt.n(wt),_e=Vt(90621),$e=Vt.n(_e);let ye=1;function oe(le,re){const Ge=le.match(/^(\s+)(?:```)/);if(Ge===null)return re;const fe=Ge[1];return re.split(`
`).map(Ke=>{const an=Ke.match(/^\s+/);if(an===null)return Ke;const[nn]=an;return nn.length>=fe.length?Ke.slice(fe.length):Ke}).join(`
`)}let Yt=[],Ne=["<ul>"];const ge=new(ue()).Renderer,we=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ye(){Yt.length=0,Ne=["<ul>"]}const Be={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function on(le,re,Ge,fe){if(re>=le.length||le[re].level<=Ge)return re;var Ke=le[re];fe.push("<li><a href='#"+ye+Ke.anchor+"'>"+Ke.text+"</a>"),re++;var an=[];return re=on(le,re,Ke.level,an),an.length>0&&(fe.push("<ul>"),an.forEach(function(nn){fe.push(nn)}),fe.push("</ul>")),fe.push("</li>"),re=on(le,re,Ge,fe),re}function Ft(){return on(Yt,0,0,Ne),Ne.push("</ul>"),Ne.join("")}const et={heading(le){const re=we.exec(le);if(ye+=1,re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fences(le){const re=this.rules.block.fences.exec(le);if(re){const Ge=re[0];let fe=oe(Ge,re[3]||"");const Ke=re[2]?re[2].trim():re[2];if(["latex","katex","math"].indexOf(Ke)>=0){const an=lt(),nn=fe;fe=an,pt[an]={type:"block",expression:nn}}return{type:"code",raw:Ge,lang:Ke,text:fe}}}},nt=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ht=0;const lt=()=>`__special_katext_id_${ht++}__`;let pt={};function vt(){return pt}function kt(){ht=0,pt={}}function Et(le){return le=le.replace(nt,(re,Ge)=>{const fe=lt();return pt[fe]={type:"inline",expression:Ge},fe}),le}const Ht=ge.listitem;ge.listitem=function(le){return Ht(Et(le))};const Zt=ge.paragraph;ge.paragraph=function(le){return Zt(Et(le))};const ie=ge.tablecell;ge.tablecell=function(le,re){return ie(Et(le),re)},ge.code=function(le,re,Ge){const fe=(re||"").match(/\S*/)[0];return fe?["latex","katex","math"].indexOf(fe)>=0?`<p class='editormd-tex'>${le}</p>`:`<pre class="prettyprint linenums"><code class="language-${re}">${Ge?le:(0,_e.escape)(le,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(Ge?le:(0,_e.escape)(le,!0))+"</code></pre>"},ge.heading=function(le,re,Ge){let fe=this.options.headerPrefix+Ge.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Yt.push({anchor:fe,level:re,text:le}),"<h"+re+' id="'+ye+fe+'">'+le+"</h"+re+">"},ue().setOptions({silent:!0,gfm:!0,pedantic:!1}),ue().use({tokenizer:et,renderer:ge}),Rn.ZP=ue()},88386:function(un,Rn,Vt){(function(wt){wt(Vt(4631))})(function(wt){wt.defineOption("placeholder","",function(Ne,ge,we){var Ye=we&&we!=wt.Init;if(ge&&!Ye)Ne.on("blur",ye),Ne.on("change",oe),Ne.on("swapDoc",oe),wt.on(Ne.getInputField(),"compositionupdate",Ne.state.placeholderCompose=function(){$e(Ne)}),oe(Ne);else if(!ge&&Ye){Ne.off("blur",ye),Ne.off("change",oe),Ne.off("swapDoc",oe),wt.off(Ne.getInputField(),"compositionupdate",Ne.state.placeholderCompose),ue(Ne);var Be=Ne.getWrapperElement();Be.className=Be.className.replace(" CodeMirror-empty","")}ge&&!Ne.hasFocus()&&ye(Ne)});function ue(Ne){Ne.state.placeholder&&(Ne.state.placeholder.parentNode.removeChild(Ne.state.placeholder),Ne.state.placeholder=null)}function _e(Ne){ue(Ne);var ge=Ne.state.placeholder=document.createElement("pre");ge.style.cssText="height: 0; overflow: visible",ge.style.direction=Ne.getOption("direction"),ge.className="CodeMirror-placeholder CodeMirror-line-like";var we=Ne.getOption("placeholder");typeof we=="string"&&(we=document.createTextNode(we)),ge.appendChild(we),Ne.display.lineSpace.insertBefore(ge,Ne.display.lineSpace.firstChild)}function $e(Ne){setTimeout(function(){var ge=!1,we=Ne.getInputField();we.nodeName=="TEXTAREA"?ge=!we.value:Ne.lineCount()==1&&(ge=!/[^\u200b]/.test(we.querySelector(".CodeMirror-line").textContent)),ge?_e(Ne):ue(Ne)},20)}function ye(Ne){Yt(Ne)&&_e(Ne)}function oe(Ne){var ge=Ne.getWrapperElement(),we=Yt(Ne);ge.className=ge.className.replace(" CodeMirror-empty","")+(we?" CodeMirror-empty":""),we?_e(Ne):ue(Ne)}function Yt(Ne){return Ne.lineCount()===1&&Ne.getLine(0)===""}})},82801:function(un,Rn,Vt){(function(wt){wt(Vt(4631))})(function(wt){var ue={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},_e=wt.Pos;wt.defineOption("autoCloseBrackets",!1,function(et,nt,ht){ht&&ht!=wt.Init&&(et.removeKeyMap(ye),et.state.closeBrackets=null),nt&&(oe($e(nt,"pairs")),et.state.closeBrackets=nt,et.addKeyMap(ye))});function $e(et,nt){return nt=="pairs"&&typeof et=="string"?et:typeof et=="object"&&et[nt]!=null?et[nt]:ue[nt]}var ye={Backspace:ge,Enter:we};function oe(et){for(var nt=0;nt<et.length;nt++){var ht=et.charAt(nt),lt="'"+ht+"'";ye[lt]||(ye[lt]=Yt(ht))}}oe(ue.pairs+"`");function Yt(et){return function(nt){return Be(nt,et)}}function Ne(et){var nt=et.state.closeBrackets;if(!nt||nt.override)return nt;var ht=et.getModeAt(et.getCursor());return ht.closeBrackets||nt}function ge(et){var nt=Ne(et);if(!nt||et.getOption("disableInput"))return wt.Pass;for(var ht=$e(nt,"pairs"),lt=et.listSelections(),pt=0;pt<lt.length;pt++){if(!lt[pt].empty())return wt.Pass;var vt=on(et,lt[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return wt.Pass}for(var pt=lt.length-1;pt>=0;pt--){var kt=lt[pt].head;et.replaceRange("",_e(kt.line,kt.ch-1),_e(kt.line,kt.ch+1),"+delete")}}function we(et){var nt=Ne(et),ht=nt&&$e(nt,"explode");if(!ht||et.getOption("disableInput"))return wt.Pass;for(var lt=et.listSelections(),pt=0;pt<lt.length;pt++){if(!lt[pt].empty())return wt.Pass;var vt=on(et,lt[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return wt.Pass}et.operation(function(){var kt=et.lineSeparator()||`
`;et.replaceSelection(kt+kt,null),et.execCommand("goCharLeft"),lt=et.listSelections();for(var Et=0;Et<lt.length;Et++){var Ht=lt[Et].head.line;et.indentLine(Ht,null,!0),et.indentLine(Ht+1,null,!0)}})}function Ye(et){var nt=wt.cmpPos(et.anchor,et.head)>0;return{anchor:new _e(et.anchor.line,et.anchor.ch+(nt?-1:1)),head:new _e(et.head.line,et.head.ch+(nt?1:-1))}}function Be(et,nt){var ht=Ne(et);if(!ht||et.getOption("disableInput"))return wt.Pass;var lt=$e(ht,"pairs"),pt=lt.indexOf(nt);if(pt==-1)return wt.Pass;for(var vt=$e(ht,"closeBefore"),kt=$e(ht,"triples"),Et=lt.charAt(pt+1)==nt,Ht=et.listSelections(),Zt=pt%2==0,ie,le=0;le<Ht.length;le++){var re=Ht[le],Ge=re.head,fe,Ke=et.getRange(Ge,_e(Ge.line,Ge.ch+1));if(Zt&&!re.empty())fe="surround";else if((Et||!Zt)&&Ke==nt)Et&&Ft(et,Ge)?fe="both":kt.indexOf(nt)>=0&&et.getRange(Ge,_e(Ge.line,Ge.ch+3))==nt+nt+nt?fe="skipThree":fe="skip";else if(Et&&Ge.ch>1&&kt.indexOf(nt)>=0&&et.getRange(_e(Ge.line,Ge.ch-2),Ge)==nt+nt){if(Ge.ch>2&&/\bstring/.test(et.getTokenTypeAt(_e(Ge.line,Ge.ch-2))))return wt.Pass;fe="addFour"}else if(Et){var an=Ge.ch==0?" ":et.getRange(_e(Ge.line,Ge.ch-1),Ge);if(!wt.isWordChar(Ke)&&an!=nt&&!wt.isWordChar(an))fe="both";else return wt.Pass}else if(Zt&&(Ke.length===0||/\s/.test(Ke)||vt.indexOf(Ke)>-1))fe="both";else return wt.Pass;if(!ie)ie=fe;else if(ie!=fe)return wt.Pass}var nn=pt%2?lt.charAt(pt-1):nt,Si=pt%2?nt:lt.charAt(pt+1);et.operation(function(){if(ie=="skip")et.execCommand("goCharRight");else if(ie=="skipThree")for(var oi=0;oi<3;oi++)et.execCommand("goCharRight");else if(ie=="surround"){for(var Bi=et.getSelections(),oi=0;oi<Bi.length;oi++)Bi[oi]=nn+Bi[oi]+Si;et.replaceSelections(Bi,"around"),Bi=et.listSelections().slice();for(var oi=0;oi<Bi.length;oi++)Bi[oi]=Ye(Bi[oi]);et.setSelections(Bi)}else ie=="both"?(et.replaceSelection(nn+Si,null),et.triggerElectric(nn+Si),et.execCommand("goCharLeft")):ie=="addFour"&&(et.replaceSelection(nn+nn+nn+nn,"before"),et.execCommand("goCharRight"))})}function on(et,nt){var ht=et.getRange(_e(nt.line,nt.ch-1),_e(nt.line,nt.ch+1));return ht.length==2?ht:null}function Ft(et,nt){var ht=et.getTokenAt(_e(nt.line,nt.ch+1));return/\bstring/.test(ht.type)&&ht.start==nt.ch&&(nt.ch==0||!/\bstring/.test(et.getTokenTypeAt(nt)))}})},57341:function(un,Rn,Vt){(function(wt){wt(Vt(4631),Vt(4786))})(function(wt){wt.defineOption("autoCloseTags",!1,function(ge,we,Ye){if(Ye!=wt.Init&&Ye&&ge.removeKeyMap("autoCloseTags"),!!we){var Be={name:"autoCloseTags"};(typeof we!="object"||we.whenClosing!==!1)&&(Be["'/'"]=function(on){return oe(on)}),(typeof we!="object"||we.whenOpening!==!1)&&(Be["'>'"]=function(on){return $e(on)}),ge.addKeyMap(Be)}});var ue=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],_e=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function $e(ge){if(ge.getOption("disableInput"))return wt.Pass;for(var we=ge.listSelections(),Ye=[],Be=ge.getOption("autoCloseTags"),on=0;on<we.length;on++){if(!we[on].empty())return wt.Pass;var Ft=we[on].head,et=ge.getTokenAt(Ft),nt=wt.innerMode(ge.getMode(),et.state),ht=nt.state,lt=nt.mode.xmlCurrentTag&&nt.mode.xmlCurrentTag(ht),pt=lt&&lt.name;if(!pt)return wt.Pass;var vt=nt.mode.configuration=="html",kt=typeof Be=="object"&&Be.dontCloseTags||vt&&ue,Et=typeof Be=="object"&&Be.indentTags||vt&&_e;et.end>Ft.ch&&(pt=pt.slice(0,pt.length-et.end+Ft.ch));var Ht=pt.toLowerCase();if(!pt||et.type=="string"&&(et.end!=Ft.ch||!/[\"\']/.test(et.string.charAt(et.string.length-1))||et.string.length==1)||et.type=="tag"&&lt.close||et.string.indexOf("/")==Ft.ch-et.start-1||kt&&Yt(kt,Ht)>-1||Ne(ge,nt.mode.xmlCurrentContext&&nt.mode.xmlCurrentContext(ht)||[],pt,Ft,!0))return wt.Pass;var Zt=typeof Be=="object"&&Be.emptyTags;if(Zt&&Yt(Zt,pt)>-1){Ye[on]={text:"/>",newPos:wt.Pos(Ft.line,Ft.ch+2)};continue}var ie=Et&&Yt(Et,Ht)>-1;Ye[on]={indent:ie,text:">"+(ie?`
`:"")+"</"+pt+">",newPos:ie?wt.Pos(Ft.line+1,0):wt.Pos(Ft.line,Ft.ch+1)}}for(var le=typeof Be=="object"&&Be.dontIndentOnAutoClose,on=we.length-1;on>=0;on--){var re=Ye[on];ge.replaceRange(re.text,we[on].head,we[on].anchor,"+insert");var Ge=ge.listSelections().slice(0);Ge[on]={head:re.newPos,anchor:re.newPos},ge.setSelections(Ge),!le&&re.indent&&(ge.indentLine(re.newPos.line,null,!0),ge.indentLine(re.newPos.line+1,null,!0))}}function ye(ge,we){for(var Ye=ge.listSelections(),Be=[],on=we?"/":"</",Ft=ge.getOption("autoCloseTags"),et=typeof Ft=="object"&&Ft.dontIndentOnSlash,nt=0;nt<Ye.length;nt++){if(!Ye[nt].empty())return wt.Pass;var ht=Ye[nt].head,lt=ge.getTokenAt(ht),pt=wt.innerMode(ge.getMode(),lt.state),vt=pt.state;if(we&&(lt.type=="string"||lt.string.charAt(0)!="<"||lt.start!=ht.ch-1))return wt.Pass;var kt,Et=pt.mode.name!="xml"&&ge.getMode().name=="htmlmixed";if(Et&&pt.mode.name=="javascript")kt=on+"script";else if(Et&&pt.mode.name=="css")kt=on+"style";else{var Ht=pt.mode.xmlCurrentContext&&pt.mode.xmlCurrentContext(vt);if(!Ht||Ht.length&&Ne(ge,Ht,Ht[Ht.length-1],ht))return wt.Pass;kt=on+Ht[Ht.length-1]}ge.getLine(ht.line).charAt(lt.end)!=">"&&(kt+=">"),Be[nt]=kt}if(ge.replaceSelections(Be),Ye=ge.listSelections(),!et)for(var nt=0;nt<Ye.length;nt++)(nt==Ye.length-1||Ye[nt].head.line<Ye[nt+1].head.line)&&ge.indentLine(Ye[nt].head.line)}function oe(ge){return ge.getOption("disableInput")?wt.Pass:ye(ge,!0)}wt.commands.closeTag=function(ge){return ye(ge)};function Yt(ge,we){if(ge.indexOf)return ge.indexOf(we);for(var Ye=0,Be=ge.length;Ye<Be;++Ye)if(ge[Ye]==we)return Ye;return-1}function Ne(ge,we,Ye,Be,on){if(!wt.scanForClosingTag)return!1;var Ft=Math.min(ge.lastLine()+1,Be.line+500),et=wt.scanForClosingTag(ge,Be,null,Ft);if(!et||et.tag!=Ye)return!1;for(var nt=on?1:0,ht=we.length-1;ht>=0&&we[ht]==Ye;ht--)++nt;Be=et.to;for(var ht=1;ht<nt;ht++){var lt=wt.scanForClosingTag(ge,Be,null,Ft);if(!lt||lt.tag!=Ye)return!1;Be=lt.to}return!0}})},4786:function(un,Rn,Vt){(function(wt){wt(Vt(4631))})(function(wt){"use strict";var ue=wt.Pos;function _e(ht,lt){return ht.line-lt.line||ht.ch-lt.ch}var $e="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ye=$e+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",oe=new RegExp("<(/?)(["+$e+"]["+ye+"]*)","g");function Yt(ht,lt,pt,vt){this.line=lt,this.ch=pt,this.cm=ht,this.text=ht.getLine(lt),this.min=vt?Math.max(vt.from,ht.firstLine()):ht.firstLine(),this.max=vt?Math.min(vt.to-1,ht.lastLine()):ht.lastLine()}function Ne(ht,lt){var pt=ht.cm.getTokenTypeAt(ue(ht.line,lt));return pt&&/\btag\b/.test(pt)}function ge(ht){if(!(ht.line>=ht.max))return ht.ch=0,ht.text=ht.cm.getLine(++ht.line),!0}function we(ht){if(!(ht.line<=ht.min))return ht.text=ht.cm.getLine(--ht.line),ht.ch=ht.text.length,!0}function Ye(ht){for(;;){var lt=ht.text.indexOf(">",ht.ch);if(lt==-1){if(ge(ht))continue;return}if(!Ne(ht,lt+1)){ht.ch=lt+1;continue}var pt=ht.text.lastIndexOf("/",lt),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,lt));return ht.ch=lt+1,vt?"selfClose":"regular"}}function Be(ht){for(;;){var lt=ht.ch?ht.text.lastIndexOf("<",ht.ch-1):-1;if(lt==-1){if(we(ht))continue;return}if(!Ne(ht,lt+1)){ht.ch=lt;continue}oe.lastIndex=lt,ht.ch=lt;var pt=oe.exec(ht.text);if(pt&&pt.index==lt)return pt}}function on(ht){for(;;){oe.lastIndex=ht.ch;var lt=oe.exec(ht.text);if(!lt){if(ge(ht))continue;return}if(!Ne(ht,lt.index+1)){ht.ch=lt.index+1;continue}return ht.ch=lt.index+lt[0].length,lt}}function Ft(ht){for(;;){var lt=ht.ch?ht.text.lastIndexOf(">",ht.ch-1):-1;if(lt==-1){if(we(ht))continue;return}if(!Ne(ht,lt+1)){ht.ch=lt;continue}var pt=ht.text.lastIndexOf("/",lt),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,lt));return ht.ch=lt+1,vt?"selfClose":"regular"}}function et(ht,lt){for(var pt=[];;){var vt=on(ht),kt,Et=ht.line,Ht=ht.ch-(vt?vt[0].length:0);if(!vt||!(kt=Ye(ht)))return;if(kt!="selfClose")if(vt[1]){for(var Zt=pt.length-1;Zt>=0;--Zt)if(pt[Zt]==vt[2]){pt.length=Zt;break}if(Zt<0&&(!lt||lt==vt[2]))return{tag:vt[2],from:ue(Et,Ht),to:ue(ht.line,ht.ch)}}else pt.push(vt[2])}}function nt(ht,lt){for(var pt=[];;){var vt=Ft(ht);if(!vt)return;if(vt=="selfClose"){Be(ht);continue}var kt=ht.line,Et=ht.ch,Ht=Be(ht);if(!Ht)return;if(Ht[1])pt.push(Ht[2]);else{for(var Zt=pt.length-1;Zt>=0;--Zt)if(pt[Zt]==Ht[2]){pt.length=Zt;break}if(Zt<0&&(!lt||lt==Ht[2]))return{tag:Ht[2],from:ue(ht.line,ht.ch),to:ue(kt,Et)}}}}wt.registerHelper("fold","xml",function(ht,lt){for(var pt=new Yt(ht,lt.line,0);;){var vt=on(pt);if(!vt||pt.line!=lt.line)return;var kt=Ye(pt);if(!kt)return;if(!vt[1]&&kt!="selfClose"){var Et=ue(pt.line,pt.ch),Ht=et(pt,vt[2]);return Ht&&_e(Ht.from,Et)>0?{from:Et,to:Ht.from}:null}}}),wt.findMatchingTag=function(ht,lt,pt){var vt=new Yt(ht,lt.line,lt.ch,pt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var kt=Ye(vt),Et=kt&&ue(vt.line,vt.ch),Ht=kt&&Be(vt);if(!(!kt||!Ht||_e(vt,lt)>0)){var Zt={from:ue(vt.line,vt.ch),to:Et,tag:Ht[2]};return kt=="selfClose"?{open:Zt,close:null,at:"open"}:Ht[1]?{open:nt(vt,Ht[2]),close:Zt,at:"close"}:(vt=new Yt(ht,Et.line,Et.ch,pt),{open:Zt,close:et(vt,Ht[2]),at:"open"})}}},wt.findEnclosingTag=function(ht,lt,pt,vt){for(var kt=new Yt(ht,lt.line,lt.ch,pt);;){var Et=nt(kt,vt);if(!Et)break;var Ht=new Yt(ht,lt.line,lt.ch,pt),Zt=et(Ht,Et.tag);if(Zt)return{open:Et,close:Zt}}},wt.scanForClosingTag=function(ht,lt,pt,vt){var kt=new Yt(ht,lt.line,lt.ch,vt?{from:0,to:vt}:null);return et(kt,pt)}})},4631:function(un){(function(Rn,Vt){un.exports=Vt()})(this,function(){"use strict";var Rn=navigator.userAgent,Vt=navigator.platform,wt=/gecko\/\d/i.test(Rn),ue=/MSIE \d/.test(Rn),_e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rn),$e=/Edge\/(\d+)/.exec(Rn),ye=ue||_e||$e,oe=ye&&(ue?document.documentMode||6:+($e||_e)[1]),Yt=!$e&&/WebKit\//.test(Rn),Ne=Yt&&/Qt\/\d+\.\d+/.test(Rn),ge=!$e&&/Chrome\//.test(Rn),we=/Opera\//.test(Rn),Ye=/Apple Computer/.test(navigator.vendor),Be=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Rn),on=/PhantomJS/.test(Rn),Ft=!$e&&/AppleWebKit/.test(Rn)&&/Mobile\/\w+/.test(Rn),et=/Android/.test(Rn),nt=Ft||et||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Rn),ht=Ft||/Mac/.test(Vt),lt=/\bCrOS\b/.test(Rn),pt=/win/i.test(Vt),vt=we&&Rn.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&(we=!1,Yt=!0);var kt=ht&&(Ne||we&&(vt==null||vt<12.11)),Et=wt||ye&&oe>=9;function Ht(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var Zt=function(it,st){var ft=it.className,dt=Ht(st).exec(ft);if(dt){var gt=ft.slice(dt.index+dt[0].length);it.className=ft.slice(0,dt.index)+(gt?dt[1]+gt:"")}};function ie(it){for(var st=it.childNodes.length;st>0;--st)it.removeChild(it.firstChild);return it}function le(it,st){return ie(it).appendChild(st)}function re(it,st,ft,dt){var gt=document.createElement(it);if(ft&&(gt.className=ft),dt&&(gt.style.cssText=dt),typeof st=="string")gt.appendChild(document.createTextNode(st));else if(st)for(var Pt=0;Pt<st.length;++Pt)gt.appendChild(st[Pt]);return gt}function Ge(it,st,ft,dt){var gt=re(it,st,ft,dt);return gt.setAttribute("role","presentation"),gt}var fe;document.createRange?fe=function(it,st,ft,dt){var gt=document.createRange();return gt.setEnd(dt||it,ft),gt.setStart(it,st),gt}:fe=function(it,st,ft){var dt=document.body.createTextRange();try{dt.moveToElementText(it.parentNode)}catch(gt){return dt}return dt.collapse(!0),dt.moveEnd("character",ft),dt.moveStart("character",st),dt};function Ke(it,st){if(st.nodeType==3&&(st=st.parentNode),it.contains)return it.contains(st);do if(st.nodeType==11&&(st=st.host),st==it)return!0;while(st=st.parentNode)}function an(){var it;try{it=document.activeElement}catch(st){it=document.body||null}for(;it&&it.shadowRoot&&it.shadowRoot.activeElement;)it=it.shadowRoot.activeElement;return it}function nn(it,st){var ft=it.className;Ht(st).test(ft)||(it.className+=(ft?" ":"")+st)}function Si(it,st){for(var ft=it.split(" "),dt=0;dt<ft.length;dt++)ft[dt]&&!Ht(ft[dt]).test(st)&&(st+=" "+ft[dt]);return st}var oi=function(it){it.select()};Ft?oi=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:ye&&(oi=function(it){try{it.select()}catch(st){}});function Bi(it){var st=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,st)}}function so(it,st,ft){st||(st={});for(var dt in it)it.hasOwnProperty(dt)&&(ft!==!1||!st.hasOwnProperty(dt))&&(st[dt]=it[dt]);return st}function Qt(it,st,ft,dt,gt){st==null&&(st=it.search(/[^\s\u00a0]/),st==-1&&(st=it.length));for(var Pt=dt||0,Tt=gt||0;;){var It=it.indexOf(" ",Pt);if(It<0||It>=st)return Tt+(st-Pt);Tt+=It-Pt,Tt+=ft-Tt%ft,Pt=It+1}}var zt=function(){this.id=null,this.f=null,this.time=0,this.handler=Bi(this.onTimeout,this)};zt.prototype.onTimeout=function(it){it.id=0,it.time<=+new Date?it.f():setTimeout(it.handler,it.time-+new Date)},zt.prototype.set=function(it,st){this.f=st;var ft=+new Date+it;(!this.id||ft<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,it),this.time=ft)};function He(it,st){for(var ft=0;ft<it.length;++ft)if(it[ft]==st)return ft;return-1}var En=50,Fn={toString:function(){return"CodeMirror.Pass"}},Te={scroll:!1},ln={origin:"*mouse"},pn={origin:"+move"};function ni(it,st,ft){for(var dt=0,gt=0;;){var Pt=it.indexOf(" ",dt);Pt==-1&&(Pt=it.length);var Tt=Pt-dt;if(Pt==it.length||gt+Tt>=st)return dt+Math.min(Tt,st-gt);if(gt+=Pt-dt,gt+=ft-gt%ft,dt=Pt+1,gt>=st)return dt}}var Cn=[""];function he(it){for(;Cn.length<=it;)Cn.push(Ae(Cn)+" ");return Cn[it]}function Ae(it){return it[it.length-1]}function hn(it,st){for(var ft=[],dt=0;dt<it.length;dt++)ft[dt]=st(it[dt],dt);return ft}function De(it,st,ft){for(var dt=0,gt=ft(st);dt<it.length&&ft(it[dt])<=gt;)dt++;it.splice(dt,0,st)}function Rt(){}function Lt(it,st){var ft;return Object.create?ft=Object.create(it):(Rt.prototype=it,ft=new Rt),st&&so(st,ft),ft}var Ct=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Bt(it){return/\w/.test(it)||it>"\x80"&&(it.toUpperCase()!=it.toLowerCase()||Ct.test(it))}function _t(it,st){return st?st.source.indexOf("\\w")>-1&&Bt(it)?!0:st.test(it):Bt(it)}function Nt(it){for(var st in it)if(it.hasOwnProperty(st)&&it[st])return!1;return!0}var Me=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function wn(it){return it.charCodeAt(0)>=768&&Me.test(it)}function pi(it,st,ft){for(;(ft<0?st>0:st<it.length)&&wn(it.charAt(st));)st+=ft;return st}function Gn(it,st,ft){for(var dt=st>ft?-1:1;;){if(st==ft)return st;var gt=(st+ft)/2,Pt=dt<0?Math.ceil(gt):Math.floor(gt);if(Pt==st)return it(Pt)?st:ft;it(Pt)?ft=Pt:st=Pt+dt}}function Yn(it,st,ft,dt){if(!it)return dt(st,ft,"ltr",0);for(var gt=!1,Pt=0;Pt<it.length;++Pt){var Tt=it[Pt];(Tt.from<ft&&Tt.to>st||st==ft&&Tt.to==st)&&(dt(Math.max(Tt.from,st),Math.min(Tt.to,ft),Tt.level==1?"rtl":"ltr",Pt),gt=!0)}gt||dt(st,ft,"ltr")}var Ci=null;function Pn(it,st,ft){var dt;Ci=null;for(var gt=0;gt<it.length;++gt){var Pt=it[gt];if(Pt.from<st&&Pt.to>st)return gt;Pt.to==st&&(Pt.from!=Pt.to&&ft=="before"?dt=gt:Ci=gt),Pt.from==st&&(Pt.from!=Pt.to&&ft!="before"?dt=gt:Ci=gt)}return dt!=null?dt:Ci}var ki=function(){var it="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",st="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ft(Ut){return Ut<=247?it.charAt(Ut):1424<=Ut&&Ut<=1524?"R":1536<=Ut&&Ut<=1785?st.charAt(Ut-1536):1774<=Ut&&Ut<=2220?"r":8192<=Ut&&Ut<=8203?"w":Ut==8204?"b":"L"}var dt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,gt=/[stwN]/,Pt=/[LRr]/,Tt=/[Lb1n]/,It=/[1n]/;function Dt(Ut,ce,Xt){this.level=Ut,this.from=ce,this.to=Xt}return function(Ut,ce){var Xt=ce=="ltr"?"L":"R";if(Ut.length==0||ce=="ltr"&&!dt.test(Ut))return!1;for(var Re=Ut.length,Fe=[],gn=0;gn<Re;++gn)Fe.push(ft(Ut.charCodeAt(gn)));for(var xn=0,Nn=Xt;xn<Re;++xn){var Qn=Fe[xn];Qn=="m"?Fe[xn]=Nn:Nn=Qn}for(var wi=0,si=Xt;wi<Re;++wi){var Ei=Fe[wi];Ei=="1"&&si=="r"?Fe[wi]="n":Pt.test(Ei)&&(si=Ei,Ei=="r"&&(Fe[wi]="R"))}for(var $i=1,ii=Fe[0];$i<Re-1;++$i){var ho=Fe[$i];ho=="+"&&ii=="1"&&Fe[$i+1]=="1"?Fe[$i]="1":ho==","&&ii==Fe[$i+1]&&(ii=="1"||ii=="n")&&(Fe[$i]=ii),ii=ho}for(var mr=0;mr<Re;++mr){var ts=Fe[mr];if(ts==",")Fe[mr]="N";else if(ts=="%"){var Mr=void 0;for(Mr=mr+1;Mr<Re&&Fe[Mr]=="%";++Mr);for(var ha=mr&&Fe[mr-1]=="!"||Mr<Re&&Fe[Mr]=="1"?"1":"N",Rs=mr;Rs<Mr;++Rs)Fe[Rs]=ha;mr=Mr-1}}for(var Yr=0,La=Xt;Yr<Re;++Yr){var Ms=Fe[Yr];La=="L"&&Ms=="1"?Fe[Yr]="L":Pt.test(Ms)&&(La=Ms)}for(var Kr=0;Kr<Re;++Kr)if(gt.test(Fe[Kr])){var zo=void 0;for(zo=Kr+1;zo<Re&&gt.test(Fe[zo]);++zo);for(var Tr=(Kr?Fe[Kr-1]:Xt)=="L",ds=(zo<Re?Fe[zo]:Xt)=="L",Es=Tr==ds?Tr?"L":"R":Xt,al=Kr;al<zo;++al)Fe[al]=Es;Kr=zo-1}for(var Er=[],Za,Dr=0;Dr<Re;)if(Tt.test(Fe[Dr])){var nf=Dr;for(++Dr;Dr<Re&&Tt.test(Fe[Dr]);++Dr);Er.push(new Dt(0,nf,Dr))}else{var Ra=Dr,ka=Er.length,da=ce=="rtl"?1:0;for(++Dr;Dr<Re&&Fe[Dr]!="L";++Dr);for(var nr=Ra;nr<Dr;)if(It.test(Fe[nr])){Ra<nr&&(Er.splice(ka,0,new Dt(1,Ra,nr)),ka+=da);var fs=nr;for(++nr;nr<Dr&&It.test(Fe[nr]);++nr);Er.splice(ka,0,new Dt(2,fs,nr)),ka+=da,Ra=nr}else++nr;Ra<Dr&&Er.splice(ka,0,new Dt(1,Ra,Dr))}return ce=="ltr"&&(Er[0].level==1&&(Za=Ut.match(/^\s+/))&&(Er[0].from=Za[0].length,Er.unshift(new Dt(0,0,Za[0].length))),Ae(Er).level==1&&(Za=Ut.match(/\s+$/))&&(Ae(Er).to-=Za[0].length,Er.push(new Dt(0,Re-Za[0].length,Re)))),ce=="rtl"?Er.reverse():Er}}();function ai(it,st){var ft=it.order;return ft==null&&(ft=it.order=ki(it.text,st)),ft}var eo=[],ri=function(it,st,ft){if(it.addEventListener)it.addEventListener(st,ft,!1);else if(it.attachEvent)it.attachEvent("on"+st,ft);else{var dt=it._handlers||(it._handlers={});dt[st]=(dt[st]||eo).concat(ft)}};function Yo(it,st){return it._handlers&&it._handlers[st]||eo}function Ro(it,st,ft){if(it.removeEventListener)it.removeEventListener(st,ft,!1);else if(it.detachEvent)it.detachEvent("on"+st,ft);else{var dt=it._handlers,gt=dt&&dt[st];if(gt){var Pt=He(gt,ft);Pt>-1&&(dt[st]=gt.slice(0,Pt).concat(gt.slice(Pt+1)))}}}function mo(it,st){var ft=Yo(it,st);if(ft.length)for(var dt=Array.prototype.slice.call(arguments,2),gt=0;gt<ft.length;++gt)ft[gt].apply(null,dt)}function Ji(it,st,ft){return typeof st=="string"&&(st={type:st,preventDefault:function(){this.defaultPrevented=!0}}),mo(it,ft||st.type,it,st),Ti(st)||st.codemirrorIgnore}function Cr(it){var st=it._handlers&&it._handlers.cursorActivity;if(st)for(var ft=it.curOp.cursorActivityHandlers||(it.curOp.cursorActivityHandlers=[]),dt=0;dt<st.length;++dt)He(ft,st[dt])==-1&&ft.push(st[dt])}function Po(it,st){return Yo(it,st).length>0}function dr(it){it.prototype.on=function(st,ft){ri(this,st,ft)},it.prototype.off=function(st,ft){Ro(this,st,ft)}}function rr(it){it.preventDefault?it.preventDefault():it.returnValue=!1}function fr(it){it.stopPropagation?it.stopPropagation():it.cancelBubble=!0}function Ti(it){return it.defaultPrevented!=null?it.defaultPrevented:it.returnValue==!1}function jo(it){rr(it),fr(it)}function As(it){return it.target||it.srcElement}function ws(it){var st=it.which;return st==null&&(it.button&1?st=1:it.button&2?st=3:it.button&4&&(st=2)),ht&&it.ctrlKey&&st==1&&(st=3),st}var Ws=function(){if(ye&&oe<9)return!1;var it=re("div");return"draggable"in it||"dragDrop"in it}(),Wr;function os(it){if(Wr==null){var st=re("span","\u200B");le(it,re("span",[st,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Wr=st.offsetWidth<=1&&st.offsetHeight>2&&!(ye&&oe<8))}var ft=Wr?re("span","\u200B"):re("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ft.setAttribute("cm-text",""),ft}var Or;function sr(it){if(Or!=null)return Or;var st=le(it,document.createTextNode("A\u062EA")),ft=fe(st,0,1).getBoundingClientRect(),dt=fe(st,1,2).getBoundingClientRect();return ie(it),!ft||ft.left==ft.right?!1:Or=dt.right-ft.right<3}var Je=`
b`.split(/\n/).length!=3?function(it){for(var st=0,ft=[],dt=it.length;st<=dt;){var gt=it.indexOf(`
`,st);gt==-1&&(gt=it.length);var Pt=it.slice(st,it.charAt(gt-1)=="\r"?gt-1:gt),Tt=Pt.indexOf("\r");Tt!=-1?(ft.push(Pt.slice(0,Tt)),st+=Tt+1):(ft.push(Pt),st=gt+1)}return ft}:function(it){return it.split(/\r\n?|\n/)},xt=window.getSelection?function(it){try{return it.selectionStart!=it.selectionEnd}catch(st){return!1}}:function(it){var st;try{st=it.ownerDocument.selection.createRange()}catch(ft){}return!st||st.parentElement()!=it?!1:st.compareEndPoints("StartToEnd",st)!=0},en=function(){var it=re("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),vn=null;function mi(it){if(vn!=null)return vn;var st=le(it,re("span","x")),ft=st.getBoundingClientRect(),dt=fe(st,0,1).getBoundingClientRect();return vn=Math.abs(ft.left-dt.left)>1}var li={},hi={};function Fi(it,st){arguments.length>2&&(st.dependencies=Array.prototype.slice.call(arguments,2)),li[it]=st}function to(it,st){hi[it]=st}function Ce(it){if(typeof it=="string"&&hi.hasOwnProperty(it))it=hi[it];else if(it&&typeof it.name=="string"&&hi.hasOwnProperty(it.name)){var st=hi[it.name];typeof st=="string"&&(st={name:st}),it=Lt(st,it),it.name=st.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return Ce("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return Ce("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function Oe(it,st){st=Ce(st);var ft=li[st.name];if(!ft)return Oe(it,"text/plain");var dt=ft(it,st);if(ee.hasOwnProperty(st.name)){var gt=ee[st.name];for(var Pt in gt)gt.hasOwnProperty(Pt)&&(dt.hasOwnProperty(Pt)&&(dt["_"+Pt]=dt[Pt]),dt[Pt]=gt[Pt])}if(dt.name=st.name,st.helperType&&(dt.helperType=st.helperType),st.modeProps)for(var Tt in st.modeProps)dt[Tt]=st.modeProps[Tt];return dt}var ee={};function Ie(it,st){var ft=ee.hasOwnProperty(it)?ee[it]:ee[it]={};so(st,ft)}function Tn(it,st){if(st===!0)return st;if(it.copyState)return it.copyState(st);var ft={};for(var dt in st){var gt=st[dt];gt instanceof Array&&(gt=gt.concat([])),ft[dt]=gt}return ft}function Hn(it,st){for(var ft;it.innerMode&&(ft=it.innerMode(st),!(!ft||ft.mode==it));)st=ft.state,it=ft.mode;return ft||{mode:it,state:st}}function Bn(it,st,ft){return it.startState?it.startState(st,ft):!0}var me=function(it,st,ft){this.pos=this.start=0,this.string=it,this.tabSize=st||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ft};me.prototype.eol=function(){return this.pos>=this.string.length},me.prototype.sol=function(){return this.pos==this.lineStart},me.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},me.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},me.prototype.eat=function(it){var st=this.string.charAt(this.pos),ft;if(typeof it=="string"?ft=st==it:ft=st&&(it.test?it.test(st):it(st)),ft)return++this.pos,st},me.prototype.eatWhile=function(it){for(var st=this.pos;this.eat(it););return this.pos>st},me.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},me.prototype.skipToEnd=function(){this.pos=this.string.length},me.prototype.skipTo=function(it){var st=this.string.indexOf(it,this.pos);if(st>-1)return this.pos=st,!0},me.prototype.backUp=function(it){this.pos-=it},me.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Qt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Qt(this.string,this.lineStart,this.tabSize):0)},me.prototype.indentation=function(){return Qt(this.string,null,this.tabSize)-(this.lineStart?Qt(this.string,this.lineStart,this.tabSize):0)},me.prototype.match=function(it,st,ft){if(typeof it=="string"){var dt=function(Tt){return ft?Tt.toLowerCase():Tt},gt=this.string.substr(this.pos,it.length);if(dt(gt)==dt(it))return st!==!1&&(this.pos+=it.length),!0}else{var Pt=this.string.slice(this.pos).match(it);return Pt&&Pt.index>0?null:(Pt&&st!==!1&&(this.pos+=Pt[0].length),Pt)}},me.prototype.current=function(){return this.string.slice(this.start,this.pos)},me.prototype.hideFirstChars=function(it,st){this.lineStart+=it;try{return st()}finally{this.lineStart-=it}},me.prototype.lookAhead=function(it){var st=this.lineOracle;return st&&st.lookAhead(it)},me.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function Ze(it,st){if(st-=it.first,st<0||st>=it.size)throw new Error("There is no line "+(st+it.first)+" in the document.");for(var ft=it;!ft.lines;)for(var dt=0;;++dt){var gt=ft.children[dt],Pt=gt.chunkSize();if(st<Pt){ft=gt;break}st-=Pt}return ft.lines[st]}function Xn(it,st,ft){var dt=[],gt=st.line;return it.iter(st.line,ft.line+1,function(Pt){var Tt=Pt.text;gt==ft.line&&(Tt=Tt.slice(0,ft.ch)),gt==st.line&&(Tt=Tt.slice(st.ch)),dt.push(Tt),++gt}),dt}function Ni(it,st,ft){var dt=[];return it.iter(st,ft,function(gt){dt.push(gt.text)}),dt}function sn(it,st){var ft=st-it.height;if(ft)for(var dt=it;dt;dt=dt.parent)dt.height+=ft}function de(it){if(it.parent==null)return null;for(var st=it.parent,ft=He(st.lines,it),dt=st.parent;dt;st=dt,dt=dt.parent)for(var gt=0;dt.children[gt]!=st;++gt)ft+=dt.children[gt].chunkSize();return ft+st.first}function bn(it,st){var ft=it.first;t:do{for(var dt=0;dt<it.children.length;++dt){var gt=it.children[dt],Pt=gt.height;if(st<Pt){it=gt;continue t}st-=Pt,ft+=gt.chunkSize()}return ft}while(!it.lines);for(var Tt=0;Tt<it.lines.length;++Tt){var It=it.lines[Tt],Dt=It.height;if(st<Dt)break;st-=Dt}return ft+Tt}function qn(it,st){return st>=it.first&&st<it.first+it.size}function Di(it,st){return String(it.lineNumberFormatter(st+it.firstLineNumber))}function Ve(it,st,ft){if(ft===void 0&&(ft=null),!(this instanceof Ve))return new Ve(it,st,ft);this.line=it,this.ch=st,this.sticky=ft}function jn(it,st){return it.line-st.line||it.ch-st.ch}function wo(it,st){return it.sticky==st.sticky&&jn(it,st)==0}function Ho(it){return Ve(it.line,it.ch)}function fo(it,st){return jn(it,st)<0?st:it}function Un(it,st){return jn(it,st)<0?it:st}function _n(it,st){return Math.max(it.first,Math.min(st,it.first+it.size-1))}function ti(it,st){if(st.line<it.first)return Ve(it.first,0);var ft=it.first+it.size-1;return st.line>ft?Ve(ft,Ze(it,ft).text.length):Yi(st,Ze(it,st.line).text.length)}function Yi(it,st){var ft=it.ch;return ft==null||ft>st?Ve(it.line,st):ft<0?Ve(it.line,0):it}function Co(it,st){for(var ft=[],dt=0;dt<st.length;dt++)ft[dt]=ti(it,st[dt]);return ft}var ne=function(it,st){this.state=it,this.lookAhead=st},xe=function(it,st,ft,dt){this.state=st,this.doc=it,this.line=ft,this.maxLookAhead=dt||0,this.baseTokens=null,this.baseTokenPos=1};xe.prototype.lookAhead=function(it){var st=this.doc.getLine(this.line+it);return st!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),st},xe.prototype.baseToken=function(it){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=it;)this.baseTokenPos+=2;var st=this.baseTokens[this.baseTokenPos+1];return{type:st&&st.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-it}},xe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},xe.fromSaved=function(it,st,ft){return st instanceof ne?new xe(it,Tn(it.mode,st.state),ft,st.lookAhead):new xe(it,Tn(it.mode,st),ft)},xe.prototype.save=function(it){var st=it!==!1?Tn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ne(st,this.maxLookAhead):st};function Pe(it,st,ft,dt){var gt=[it.state.modeGen],Pt={};ui(it,st.text,it.doc.mode,ft,function(Ut,ce){return gt.push(Ut,ce)},Pt,dt);for(var Tt=ft.state,It=function(Ut){ft.baseTokens=gt;var ce=it.state.overlays[Ut],Xt=1,Re=0;ft.state=!0,ui(it,st.text,ce.mode,ft,function(Fe,gn){for(var xn=Xt;Re<Fe;){var Nn=gt[Xt];Nn>Fe&&gt.splice(Xt,1,Fe,gt[Xt+1],Nn),Xt+=2,Re=Math.min(Fe,Nn)}if(gn)if(ce.opaque)gt.splice(xn,Xt-xn,Fe,"overlay "+gn),Xt=xn+2;else for(;xn<Xt;xn+=2){var Qn=gt[xn+1];gt[xn+1]=(Qn?Qn+" ":"")+"overlay "+gn}},Pt),ft.state=Tt,ft.baseTokens=null,ft.baseTokenPos=1},Dt=0;Dt<it.state.overlays.length;++Dt)It(Dt);return{styles:gt,classes:Pt.bgClass||Pt.textClass?Pt:null}}function kn(it,st,ft){if(!st.styles||st.styles[0]!=it.state.modeGen){var dt=zi(it,de(st)),gt=st.text.length>it.options.maxHighlightLength&&Tn(it.doc.mode,dt.state),Pt=Pe(it,st,dt);gt&&(dt.state=gt),st.stateAfter=dt.save(!gt),st.styles=Pt.styles,Pt.classes?st.styleClasses=Pt.classes:st.styleClasses&&(st.styleClasses=null),ft===it.doc.highlightFrontier&&(it.doc.modeFrontier=Math.max(it.doc.modeFrontier,++it.doc.highlightFrontier))}return st.styles}function zi(it,st,ft){var dt=it.doc,gt=it.display;if(!dt.mode.startState)return new xe(dt,!0,st);var Pt=di(it,st,ft),Tt=Pt>dt.first&&Ze(dt,Pt-1).stateAfter,It=Tt?xe.fromSaved(dt,Tt,Pt):new xe(dt,Bn(dt.mode),Pt);return dt.iter(Pt,st,function(Dt){ae(it,Dt.text,It);var Ut=It.line;Dt.stateAfter=Ut==st-1||Ut%5==0||Ut>=gt.viewFrom&&Ut<gt.viewTo?It.save():null,It.nextLine()}),ft&&(dt.modeFrontier=It.line),It}function ae(it,st,ft,dt){var gt=it.doc.mode,Pt=new me(st,it.options.tabSize,ft);for(Pt.start=Pt.pos=dt||0,st==""&&Mn(gt,ft.state);!Pt.eol();)cn(gt,Pt,ft.state),Pt.start=Pt.pos}function Mn(it,st){if(it.blankLine)return it.blankLine(st);if(it.innerMode){var ft=Hn(it,st);if(ft.mode.blankLine)return ft.mode.blankLine(ft.state)}}function cn(it,st,ft,dt){for(var gt=0;gt<10;gt++){dt&&(dt[0]=Hn(it,ft).mode);var Pt=it.token(st,ft);if(st.pos>st.start)return Pt}throw new Error("Mode "+it.name+" failed to advance stream.")}var Se=function(it,st,ft){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=st||null,this.state=ft};function $n(it,st,ft,dt){var gt=it.doc,Pt=gt.mode,Tt;st=ti(gt,st);var It=Ze(gt,st.line),Dt=zi(it,st.line,ft),Ut=new me(It.text,it.options.tabSize,Dt),ce;for(dt&&(ce=[]);(dt||Ut.pos<st.ch)&&!Ut.eol();)Ut.start=Ut.pos,Tt=cn(Pt,Ut,Dt.state),dt&&ce.push(new Se(Ut,Tt,Tn(gt.mode,Dt.state)));return dt?ce:new Se(Ut,Tt,Dt.state)}function Vn(it,st){if(it)for(;;){var ft=it.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ft)break;it=it.slice(0,ft.index)+it.slice(ft.index+ft[0].length);var dt=ft[1]?"bgClass":"textClass";st[dt]==null?st[dt]=ft[2]:new RegExp("(?:^|\\s)"+ft[2]+"(?:$|\\s)").test(st[dt])||(st[dt]+=" "+ft[2])}return it}function ui(it,st,ft,dt,gt,Pt,Tt){var It=ft.flattenSpans;It==null&&(It=it.options.flattenSpans);var Dt=0,Ut=null,ce=new me(st,it.options.tabSize,dt),Xt,Re=it.options.addModeClass&&[null];for(st==""&&Vn(Mn(ft,dt.state),Pt);!ce.eol();){if(ce.pos>it.options.maxHighlightLength?(It=!1,Tt&&ae(it,st,dt,ce.pos),ce.pos=st.length,Xt=null):Xt=Vn(cn(ft,ce,dt.state,Re),Pt),Re){var Fe=Re[0].name;Fe&&(Xt="m-"+(Xt?Fe+" "+Xt:Fe))}if(!It||Ut!=Xt){for(;Dt<ce.start;)Dt=Math.min(ce.start,Dt+5e3),gt(Dt,Ut);Ut=Xt}ce.start=ce.pos}for(;Dt<ce.pos;){var gn=Math.min(ce.pos,Dt+5e3);gt(gn,Ut),Dt=gn}}function di(it,st,ft){for(var dt,gt,Pt=it.doc,Tt=ft?-1:st-(it.doc.mode.innerMode?1e3:100),It=st;It>Tt;--It){if(It<=Pt.first)return Pt.first;var Dt=Ze(Pt,It-1),Ut=Dt.stateAfter;if(Ut&&(!ft||It+(Ut instanceof ne?Ut.lookAhead:0)<=Pt.modeFrontier))return It;var ce=Qt(Dt.text,null,it.options.tabSize);(gt==null||dt>ce)&&(gt=It-1,dt=ce)}return gt}function fi(it,st){if(it.modeFrontier=Math.min(it.modeFrontier,st),!(it.highlightFrontier<st-10)){for(var ft=it.first,dt=st-1;dt>ft;dt--){var gt=Ze(it,dt).stateAfter;if(gt&&(!(gt instanceof ne)||dt+gt.lookAhead<st)){ft=dt+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,ft)}}var In=!1,be=!1;function Gi(){In=!0}function ke(){be=!0}function vi(it,st,ft){this.marker=it,this.from=st,this.to=ft}function co(it,st){if(it)for(var ft=0;ft<it.length;++ft){var dt=it[ft];if(dt.marker==st)return dt}}function qt(it,st){for(var ft,dt=0;dt<it.length;++dt)it[dt]!=st&&(ft||(ft=[])).push(it[dt]);return ft}function se(it,st){it.markedSpans=it.markedSpans?it.markedSpans.concat([st]):[st],st.marker.attachLine(it)}function ve(it,st,ft){var dt;if(it)for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Tt=Pt.marker,It=Pt.from==null||(Tt.inclusiveLeft?Pt.from<=st:Pt.from<st);if(It||Pt.from==st&&Tt.type=="bookmark"&&(!ft||!Pt.marker.insertLeft)){var Dt=Pt.to==null||(Tt.inclusiveRight?Pt.to>=st:Pt.to>st);(dt||(dt=[])).push(new vi(Tt,Pt.from,Dt?null:Pt.to))}}return dt}function je(it,st,ft){var dt;if(it)for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Tt=Pt.marker,It=Pt.to==null||(Tt.inclusiveRight?Pt.to>=st:Pt.to>st);if(It||Pt.from==st&&Tt.type=="bookmark"&&(!ft||Pt.marker.insertLeft)){var Dt=Pt.from==null||(Tt.inclusiveLeft?Pt.from<=st:Pt.from<st);(dt||(dt=[])).push(new vi(Tt,Dt?null:Pt.from-st,Pt.to==null?null:Pt.to-st))}}return dt}function fn(it,st){if(st.full)return null;var ft=qn(it,st.from.line)&&Ze(it,st.from.line).markedSpans,dt=qn(it,st.to.line)&&Ze(it,st.to.line).markedSpans;if(!ft&&!dt)return null;var gt=st.from.ch,Pt=st.to.ch,Tt=jn(st.from,st.to)==0,It=ve(ft,gt,Tt),Dt=je(dt,Pt,Tt),Ut=st.text.length==1,ce=Ae(st.text).length+(Ut?gt:0);if(It)for(var Xt=0;Xt<It.length;++Xt){var Re=It[Xt];if(Re.to==null){var Fe=co(Dt,Re.marker);Fe?Ut&&(Re.to=Fe.to==null?null:Fe.to+ce):Re.to=gt}}if(Dt)for(var gn=0;gn<Dt.length;++gn){var xn=Dt[gn];if(xn.to!=null&&(xn.to+=ce),xn.from==null){var Nn=co(It,xn.marker);Nn||(xn.from=ce,Ut&&(It||(It=[])).push(xn))}else xn.from+=ce,Ut&&(It||(It=[])).push(xn)}It&&(It=Kn(It)),Dt&&Dt!=It&&(Dt=Kn(Dt));var Qn=[It];if(!Ut){var wi=st.text.length-2,si;if(wi>0&&It)for(var Ei=0;Ei<It.length;++Ei)It[Ei].to==null&&(si||(si=[])).push(new vi(It[Ei].marker,null,null));for(var $i=0;$i<wi;++$i)Qn.push(si);Qn.push(Dt)}return Qn}function Kn(it){for(var st=0;st<it.length;++st){var ft=it[st];ft.from!=null&&ft.from==ft.to&&ft.marker.clearWhenEmpty!==!1&&it.splice(st--,1)}return it.length?it:null}function yn(it,st,ft){var dt=null;if(it.iter(st.line,ft.line+1,function(Fe){if(Fe.markedSpans)for(var gn=0;gn<Fe.markedSpans.length;++gn){var xn=Fe.markedSpans[gn].marker;xn.readOnly&&(!dt||He(dt,xn)==-1)&&(dt||(dt=[])).push(xn)}}),!dt)return null;for(var gt=[{from:st,to:ft}],Pt=0;Pt<dt.length;++Pt)for(var Tt=dt[Pt],It=Tt.find(0),Dt=0;Dt<gt.length;++Dt){var Ut=gt[Dt];if(!(jn(Ut.to,It.from)<0||jn(Ut.from,It.to)>0)){var ce=[Dt,1],Xt=jn(Ut.from,It.from),Re=jn(Ut.to,It.to);(Xt<0||!Tt.inclusiveLeft&&!Xt)&&ce.push({from:Ut.from,to:It.from}),(Re>0||!Tt.inclusiveRight&&!Re)&&ce.push({from:It.to,to:Ut.to}),gt.splice.apply(gt,ce),Dt+=ce.length-3}}return gt}function qe(it){var st=it.markedSpans;if(st){for(var ft=0;ft<st.length;++ft)st[ft].marker.detachLine(it);it.markedSpans=null}}function At(it,st){if(st){for(var ft=0;ft<st.length;++ft)st[ft].marker.attachLine(it);it.markedSpans=st}}function An(it){return it.inclusiveLeft?-1:0}function _i(it){return it.inclusiveRight?1:0}function Wi(it,st){var ft=it.lines.length-st.lines.length;if(ft!=0)return ft;var dt=it.find(),gt=st.find(),Pt=jn(dt.from,gt.from)||An(it)-An(st);if(Pt)return-Pt;var Tt=jn(dt.to,gt.to)||_i(it)-_i(st);return Tt||st.id-it.id}function To(it,st){var ft=be&&it.markedSpans,dt;if(ft)for(var gt=void 0,Pt=0;Pt<ft.length;++Pt)gt=ft[Pt],gt.marker.collapsed&&(st?gt.from:gt.to)==null&&(!dt||Wi(dt,gt.marker)<0)&&(dt=gt.marker);return dt}function lo(it){return To(it,!0)}function Qi(it){return To(it,!1)}function Do(it,st){var ft=be&&it.markedSpans,dt;if(ft)for(var gt=0;gt<ft.length;++gt){var Pt=ft[gt];Pt.marker.collapsed&&(Pt.from==null||Pt.from<st)&&(Pt.to==null||Pt.to>st)&&(!dt||Wi(dt,Pt.marker)<0)&&(dt=Pt.marker)}return dt}function Ii(it,st,ft,dt,gt){var Pt=Ze(it,st),Tt=be&&Pt.markedSpans;if(Tt)for(var It=0;It<Tt.length;++It){var Dt=Tt[It];if(Dt.marker.collapsed){var Ut=Dt.marker.find(0),ce=jn(Ut.from,ft)||An(Dt.marker)-An(gt),Xt=jn(Ut.to,dt)||_i(Dt.marker)-_i(gt);if(!(ce>=0&&Xt<=0||ce<=0&&Xt>=0)&&(ce<=0&&(Dt.marker.inclusiveRight&&gt.inclusiveLeft?jn(Ut.to,ft)>=0:jn(Ut.to,ft)>0)||ce>=0&&(Dt.marker.inclusiveRight&&gt.inclusiveLeft?jn(Ut.from,dt)<=0:jn(Ut.from,dt)<0)))return!0}}}function Pi(it){for(var st;st=lo(it);)it=st.find(-1,!0).line;return it}function Ui(it){for(var st;st=Qi(it);)it=st.find(1,!0).line;return it}function Wn(it){for(var st,ft;st=Qi(it);)it=st.find(1,!0).line,(ft||(ft=[])).push(it);return ft}function Dn(it,st){var ft=Ze(it,st),dt=Pi(ft);return ft==dt?st:de(dt)}function xi(it,st){if(st>it.lastLine())return st;var ft=Ze(it,st),dt;if(!Le(it,ft))return st;for(;dt=Qi(ft);)ft=dt.find(1,!0).line;return de(ft)+1}function Le(it,st){var ft=be&&st.markedSpans;if(ft){for(var dt=void 0,gt=0;gt<ft.length;++gt)if(dt=ft[gt],!!dt.marker.collapsed){if(dt.from==null)return!0;if(!dt.marker.widgetNode&&dt.from==0&&dt.marker.inclusiveLeft&&gi(it,st,dt))return!0}}}function gi(it,st,ft){if(ft.to==null){var dt=ft.marker.find(1,!0);return gi(it,dt.line,co(dt.line.markedSpans,ft.marker))}if(ft.marker.inclusiveRight&&ft.to==st.text.length)return!0;for(var gt=void 0,Pt=0;Pt<st.markedSpans.length;++Pt)if(gt=st.markedSpans[Pt],gt.marker.collapsed&&!gt.marker.widgetNode&&gt.from==ft.to&&(gt.to==null||gt.to!=ft.from)&&(gt.marker.inclusiveLeft||ft.marker.inclusiveRight)&&gi(it,st,gt))return!0}function ji(it){it=Pi(it);for(var st=0,ft=it.parent,dt=0;dt<ft.lines.length;++dt){var gt=ft.lines[dt];if(gt==it)break;st+=gt.height}for(var Pt=ft.parent;Pt;ft=Pt,Pt=ft.parent)for(var Tt=0;Tt<Pt.children.length;++Tt){var It=Pt.children[Tt];if(It==ft)break;st+=It.height}return st}function Lo(it){if(it.height==0)return 0;for(var st=it.text.length,ft,dt=it;ft=lo(dt);){var gt=ft.find(0,!0);dt=gt.from.line,st+=gt.from.ch-gt.to.ch}for(dt=it;ft=Qi(dt);){var Pt=ft.find(0,!0);st-=dt.text.length-Pt.from.ch,dt=Pt.to.line,st+=dt.text.length-Pt.to.ch}return st}function vo(it){var st=it.display,ft=it.doc;st.maxLine=Ze(ft,ft.first),st.maxLineLength=Lo(st.maxLine),st.maxLineChanged=!0,ft.iter(function(dt){var gt=Lo(dt);gt>st.maxLineLength&&(st.maxLineLength=gt,st.maxLine=dt)})}var Oo=function(it,st,ft){this.text=it,At(this,st),this.height=ft?ft(this):1};Oo.prototype.lineNo=function(){return de(this)},dr(Oo);function Wo(it,st,ft,dt){it.text=st,it.stateAfter&&(it.stateAfter=null),it.styles&&(it.styles=null),it.order!=null&&(it.order=null),qe(it),At(it,ft);var gt=dt?dt(it):1;gt!=it.height&&sn(it,gt)}function Ar(it){it.parent=null,qe(it)}var cr={},Bs={};function Us(it,st){if(!it||/^\s*$/.test(it))return null;var ft=st.addModeClass?Bs:cr;return ft[it]||(ft[it]=it.replace(/\S+/g,"cm-$&"))}function pe(it,st){var ft=Ge("span",null,null,Yt?"padding-right: .1px":null),dt={pre:Ge("pre",[ft],"CodeMirror-line"),content:ft,col:0,pos:0,cm:it,trailingSpace:!1,splitSpaces:it.getOption("lineWrapping")};st.measure={};for(var gt=0;gt<=(st.rest?st.rest.length:0);gt++){var Pt=gt?st.rest[gt-1]:st.line,Tt=void 0;dt.pos=0,dt.addToken=Cs,sr(it.display.measure)&&(Tt=ai(Pt,it.doc.direction))&&(dt.addToken=po(dt.addToken,Tt)),dt.map=[];var It=st!=it.display.externalMeasured&&de(Pt);Os(Pt,dt,kn(it,Pt,It)),Pt.styleClasses&&(Pt.styleClasses.bgClass&&(dt.bgClass=Si(Pt.styleClasses.bgClass,dt.bgClass||"")),Pt.styleClasses.textClass&&(dt.textClass=Si(Pt.styleClasses.textClass,dt.textClass||""))),dt.map.length==0&&dt.map.push(0,0,dt.content.appendChild(os(it.display.measure))),gt==0?(st.measure.map=dt.map,st.measure.cache={}):((st.measure.maps||(st.measure.maps=[])).push(dt.map),(st.measure.caches||(st.measure.caches=[])).push({}))}if(Yt){var Dt=dt.content.lastChild;(/\bcm-tab\b/.test(Dt.className)||Dt.querySelector&&Dt.querySelector(".cm-tab"))&&(dt.content.className="cm-tab-wrap-hack")}return mo(it,"renderLine",it,st.line,dt.pre),dt.pre.className&&(dt.textClass=Si(dt.pre.className,dt.textClass||"")),dt}function Br(it){var st=re("span","\u2022","cm-invalidchar");return st.title="\\u"+it.charCodeAt(0).toString(16),st.setAttribute("aria-label",st.title),st}function Cs(it,st,ft,dt,gt,Pt,Tt){if(st){var It=it.splitSpaces?ma(st,it.trailingSpace):st,Dt=it.cm.state.specialChars,Ut=!1,ce;if(!Dt.test(st))it.col+=st.length,ce=document.createTextNode(It),it.map.push(it.pos,it.pos+st.length,ce),ye&&oe<9&&(Ut=!0),it.pos+=st.length;else{ce=document.createDocumentFragment();for(var Xt=0;;){Dt.lastIndex=Xt;var Re=Dt.exec(st),Fe=Re?Re.index-Xt:st.length-Xt;if(Fe){var gn=document.createTextNode(It.slice(Xt,Xt+Fe));ye&&oe<9?ce.appendChild(re("span",[gn])):ce.appendChild(gn),it.map.push(it.pos,it.pos+Fe,gn),it.col+=Fe,it.pos+=Fe}if(!Re)break;Xt+=Fe+1;var xn=void 0;if(Re[0]==" "){var Nn=it.cm.options.tabSize,Qn=Nn-it.col%Nn;xn=ce.appendChild(re("span",he(Qn),"cm-tab")),xn.setAttribute("role","presentation"),xn.setAttribute("cm-text"," "),it.col+=Qn}else Re[0]=="\r"||Re[0]==`
`?(xn=ce.appendChild(re("span",Re[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),xn.setAttribute("cm-text",Re[0]),it.col+=1):(xn=it.cm.options.specialCharPlaceholder(Re[0]),xn.setAttribute("cm-text",Re[0]),ye&&oe<9?ce.appendChild(re("span",[xn])):ce.appendChild(xn),it.col+=1);it.map.push(it.pos,it.pos+1,xn),it.pos++}}if(it.trailingSpace=It.charCodeAt(st.length-1)==32,ft||dt||gt||Ut||Pt||Tt){var wi=ft||"";dt&&(wi+=dt),gt&&(wi+=gt);var si=re("span",[ce],wi,Pt);if(Tt)for(var Ei in Tt)Tt.hasOwnProperty(Ei)&&Ei!="style"&&Ei!="class"&&si.setAttribute(Ei,Tt[Ei]);return it.content.appendChild(si)}it.content.appendChild(ce)}}function ma(it,st){if(it.length>1&&!/ /.test(it))return it;for(var ft=st,dt="",gt=0;gt<it.length;gt++){var Pt=it.charAt(gt);Pt==" "&&ft&&(gt==it.length-1||it.charCodeAt(gt+1)==32)&&(Pt="\xA0"),dt+=Pt,ft=Pt==" "}return dt}function po(it,st){return function(ft,dt,gt,Pt,Tt,It,Dt){gt=gt?gt+" cm-force-border":"cm-force-border";for(var Ut=ft.pos,ce=Ut+dt.length;;){for(var Xt=void 0,Re=0;Re<st.length&&(Xt=st[Re],!(Xt.to>Ut&&Xt.from<=Ut));Re++);if(Xt.to>=ce)return it(ft,dt,gt,Pt,Tt,It,Dt);it(ft,dt.slice(0,Xt.to-Ut),gt,Pt,null,It,Dt),Pt=null,dt=dt.slice(Xt.to-Ut),Ut=Xt.to}}}function Ds(it,st,ft,dt){var gt=!dt&&ft.widgetNode;gt&&it.map.push(it.pos,it.pos+st,gt),!dt&&it.cm.display.input.needsContentAttribute&&(gt||(gt=it.content.appendChild(document.createElement("span"))),gt.setAttribute("cm-marker",ft.id)),gt&&(it.cm.display.input.setUneditable(gt),it.content.appendChild(gt)),it.pos+=st,it.trailingSpace=!1}function Os(it,st,ft){var dt=it.markedSpans,gt=it.text,Pt=0;if(!dt){for(var Tt=1;Tt<ft.length;Tt+=2)st.addToken(st,gt.slice(Pt,Pt=ft[Tt]),Us(ft[Tt+1],st.cm.options));return}for(var It=gt.length,Dt=0,Ut=1,ce="",Xt,Re,Fe=0,gn,xn,Nn,Qn,wi;;){if(Fe==Dt){gn=xn=Nn=Re="",wi=null,Qn=null,Fe=1/0;for(var si=[],Ei=void 0,$i=0;$i<dt.length;++$i){var ii=dt[$i],ho=ii.marker;if(ho.type=="bookmark"&&ii.from==Dt&&ho.widgetNode)si.push(ho);else if(ii.from<=Dt&&(ii.to==null||ii.to>Dt||ho.collapsed&&ii.to==Dt&&ii.from==Dt)){if(ii.to!=null&&ii.to!=Dt&&Fe>ii.to&&(Fe=ii.to,xn=""),ho.className&&(gn+=" "+ho.className),ho.css&&(Re=(Re?Re+";":"")+ho.css),ho.startStyle&&ii.from==Dt&&(Nn+=" "+ho.startStyle),ho.endStyle&&ii.to==Fe&&(Ei||(Ei=[])).push(ho.endStyle,ii.to),ho.title&&((wi||(wi={})).title=ho.title),ho.attributes)for(var mr in ho.attributes)(wi||(wi={}))[mr]=ho.attributes[mr];ho.collapsed&&(!Qn||Wi(Qn.marker,ho)<0)&&(Qn=ii)}else ii.from>Dt&&Fe>ii.from&&(Fe=ii.from)}if(Ei)for(var ts=0;ts<Ei.length;ts+=2)Ei[ts+1]==Fe&&(xn+=" "+Ei[ts]);if(!Qn||Qn.from==Dt)for(var Mr=0;Mr<si.length;++Mr)Ds(st,0,si[Mr]);if(Qn&&(Qn.from||0)==Dt){if(Ds(st,(Qn.to==null?It+1:Qn.to)-Dt,Qn.marker,Qn.from==null),Qn.to==null)return;Qn.to==Dt&&(Qn=!1)}}if(Dt>=It)break;for(var ha=Math.min(It,Fe);;){if(ce){var Rs=Dt+ce.length;if(!Qn){var Yr=Rs>ha?ce.slice(0,ha-Dt):ce;st.addToken(st,Yr,Xt?Xt+gn:gn,Nn,Dt+Yr.length==Fe?xn:"",Re,wi)}if(Rs>=ha){ce=ce.slice(ha-Dt),Dt=ha;break}Dt=Rs,Nn=""}ce=gt.slice(Pt,Pt=ft[Ut++]),Xt=Us(ft[Ut++],st.cm.options)}}}function Vs(it,st,ft){this.line=st,this.rest=Wn(st),this.size=this.rest?de(Ae(this.rest))-ft+1:1,this.node=this.text=null,this.hidden=Le(it,st)}function yo(it,st,ft){for(var dt=[],gt,Pt=st;Pt<ft;Pt=gt){var Tt=new Vs(it.doc,Ze(it.doc,Pt),Pt);gt=Pt+Tt.size,dt.push(Tt)}return dt}var $o=null;function Hi(it){$o?$o.ops.push(it):it.ownsGroup=$o={ops:[it],delayedCallbacks:[]}}function Vi(it){var st=it.delayedCallbacks,ft=0;do{for(;ft<st.length;ft++)st[ft].call(null);for(var dt=0;dt<it.ops.length;dt++){var gt=it.ops[dt];if(gt.cursorActivityHandlers)for(;gt.cursorActivityCalled<gt.cursorActivityHandlers.length;)gt.cursorActivityHandlers[gt.cursorActivityCalled++].call(null,gt.cm)}}while(ft<st.length)}function Mo(it,st){var ft=it.ownsGroup;if(ft)try{Vi(ft)}finally{$o=null,st(ft)}}var Bo=null;function On(it,st){var ft=Yo(it,st);if(ft.length){var dt=Array.prototype.slice.call(arguments,2),gt;$o?gt=$o.delayedCallbacks:Bo?gt=Bo:(gt=Bo=[],setTimeout(ra,0));for(var Pt=function(It){gt.push(function(){return ft[It].apply(null,dt)})},Tt=0;Tt<ft.length;++Tt)Pt(Tt)}}function ra(){var it=Bo;Bo=null;for(var st=0;st<it.length;++st)it[st]()}function Zr(it,st,ft,dt){for(var gt=0;gt<st.changes.length;gt++){var Pt=st.changes[gt];Pt=="text"?Sn(it,st):Pt=="gutter"?Sr(it,st,ft,dt):Pt=="class"?hr(it,st):Pt=="widget"&&sa(it,st,dt)}st.changes=null}function Ys(it){return it.node==it.text&&(it.node=re("div",null,null,"position: relative"),it.text.parentNode&&it.text.parentNode.replaceChild(it.node,it.text),it.node.appendChild(it.text),ye&&oe<8&&(it.node.style.zIndex=2)),it.node}function Tl(it,st){var ft=st.bgClass?st.bgClass+" "+(st.line.bgClass||""):st.line.bgClass;if(ft&&(ft+=" CodeMirror-linebackground"),st.background)ft?st.background.className=ft:(st.background.parentNode.removeChild(st.background),st.background=null);else if(ft){var dt=Ys(st);st.background=dt.insertBefore(re("div",null,ft),dt.firstChild),it.display.input.setUneditable(st.background)}}function Fl(it,st){var ft=it.display.externalMeasured;return ft&&ft.line==st.line?(it.display.externalMeasured=null,st.measure=ft.measure,ft.built):pe(it,st)}function Sn(it,st){var ft=st.text.className,dt=Fl(it,st);st.text==st.node&&(st.node=dt.pre),st.text.parentNode.replaceChild(dt.pre,st.text),st.text=dt.pre,dt.bgClass!=st.bgClass||dt.textClass!=st.textClass?(st.bgClass=dt.bgClass,st.textClass=dt.textClass,hr(it,st)):ft&&(st.text.className=ft)}function hr(it,st){Tl(it,st),st.line.wrapClass?Ys(st).className=st.line.wrapClass:st.node!=st.text&&(st.node.className="");var ft=st.textClass?st.textClass+" "+(st.line.textClass||""):st.line.textClass;st.text.className=ft||""}function Sr(it,st,ft,dt){if(st.gutter&&(st.node.removeChild(st.gutter),st.gutter=null),st.gutterBackground&&(st.node.removeChild(st.gutterBackground),st.gutterBackground=null),st.line.gutterClass){var gt=Ys(st);st.gutterBackground=re("div",null,"CodeMirror-gutter-background "+st.line.gutterClass,"left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px; width: "+dt.gutterTotalWidth+"px"),it.display.input.setUneditable(st.gutterBackground),gt.insertBefore(st.gutterBackground,st.text)}var Pt=st.line.gutterMarkers;if(it.options.lineNumbers||Pt){var Tt=Ys(st),It=st.gutter=re("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px");if(it.display.input.setUneditable(It),Tt.insertBefore(It,st.text),st.line.gutterClass&&(It.className+=" "+st.line.gutterClass),it.options.lineNumbers&&(!Pt||!Pt["CodeMirror-linenumbers"])&&(st.lineNumber=It.appendChild(re("div",Di(it.options,ft),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dt.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),Pt)for(var Dt=0;Dt<it.display.gutterSpecs.length;++Dt){var Ut=it.display.gutterSpecs[Dt].className,ce=Pt.hasOwnProperty(Ut)&&Pt[Ut];ce&&It.appendChild(re("div",[ce],"CodeMirror-gutter-elt","left: "+dt.gutterLeft[Ut]+"px; width: "+dt.gutterWidth[Ut]+"px"))}}}function sa(it,st,ft){st.alignable&&(st.alignable=null);for(var dt=Ht("CodeMirror-linewidget"),gt=st.node.firstChild,Pt=void 0;gt;gt=Pt)Pt=gt.nextSibling,dt.test(gt.className)&&st.node.removeChild(gt);Uo(it,st,ft)}function qi(it,st,ft,dt){var gt=Fl(it,st);return st.text=st.node=gt.pre,gt.bgClass&&(st.bgClass=gt.bgClass),gt.textClass&&(st.textClass=gt.textClass),hr(it,st),Sr(it,st,ft,dt),Uo(it,st,dt),st.node}function Uo(it,st,ft){if(Mi(it,st.line,st,ft,!0),st.rest)for(var dt=0;dt<st.rest.length;dt++)Mi(it,st.rest[dt],st,ft,!1)}function Mi(it,st,ft,dt,gt){if(st.widgets)for(var Pt=Ys(ft),Tt=0,It=st.widgets;Tt<It.length;++Tt){var Dt=It[Tt],Ut=re("div",[Dt.node],"CodeMirror-linewidget"+(Dt.className?" "+Dt.className:""));Dt.handleMouseEvents||Ut.setAttribute("cm-ignore-events","true"),va(Dt,Ut,ft,dt),it.display.input.setUneditable(Ut),gt&&Dt.above?Pt.insertBefore(Ut,ft.gutter||ft.text):Pt.appendChild(Ut),On(Dt,"redraw")}}function va(it,st,ft,dt){if(it.noHScroll){(ft.alignable||(ft.alignable=[])).push(st);var gt=dt.wrapperWidth;st.style.left=dt.fixedPos+"px",it.coverGutter||(gt-=dt.gutterTotalWidth,st.style.paddingLeft=dt.gutterTotalWidth+"px"),st.style.width=gt+"px"}it.coverGutter&&(st.style.zIndex=5,st.style.position="relative",it.noHScroll||(st.style.marginLeft=-dt.gutterTotalWidth+"px"))}function rs(it){if(it.height!=null)return it.height;var st=it.doc.cm;if(!st)return 0;if(!Ke(document.body,it.node)){var ft="position: relative;";it.coverGutter&&(ft+="margin-left: -"+st.display.gutters.offsetWidth+"px;"),it.noHScroll&&(ft+="width: "+st.display.wrapper.clientWidth+"px;"),le(st.display.measure,re("div",[it.node],null,ft))}return it.height=it.node.parentNode.offsetHeight}function Ur(it,st){for(var ft=As(st);ft!=it.wrapper;ft=ft.parentNode)if(!ft||ft.nodeType==1&&ft.getAttribute("cm-ignore-events")=="true"||ft.parentNode==it.sizer&&ft!=it.mover)return!0}function ya(it){return it.lineSpace.offsetTop}function vu(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function oh(it){if(it.cachedPaddingH)return it.cachedPaddingH;var st=le(it.measure,re("pre","x","CodeMirror-line-like")),ft=window.getComputedStyle?window.getComputedStyle(st):st.currentStyle,dt={left:parseInt(ft.paddingLeft),right:parseInt(ft.paddingRight)};return!isNaN(dt.left)&&!isNaN(dt.right)&&(it.cachedPaddingH=dt),dt}function Sa(it){return En-it.display.nativeBarWidth}function ol(it){return it.display.scroller.clientWidth-Sa(it)-it.display.barWidth}function Td(it){return it.display.scroller.clientHeight-Sa(it)-it.display.barHeight}function Yc(it,st,ft){var dt=it.options.lineWrapping,gt=dt&&ol(it);if(!st.measure.heights||dt&&st.measure.width!=gt){var Pt=st.measure.heights=[];if(dt){st.measure.width=gt;for(var Tt=st.text.firstChild.getClientRects(),It=0;It<Tt.length-1;It++){var Dt=Tt[It],Ut=Tt[It+1];Math.abs(Dt.bottom-Ut.bottom)>2&&Pt.push((Dt.bottom+Ut.top)/2-ft.top)}}Pt.push(ft.bottom-ft.top)}}function Mf(it,st,ft){if(it.line==st)return{map:it.measure.map,cache:it.measure.cache};for(var dt=0;dt<it.rest.length;dt++)if(it.rest[dt]==st)return{map:it.measure.maps[dt],cache:it.measure.caches[dt]};for(var gt=0;gt<it.rest.length;gt++)if(de(it.rest[gt])>ft)return{map:it.measure.maps[gt],cache:it.measure.caches[gt],before:!0}}function Kc(it,st){st=Pi(st);var ft=de(st),dt=it.display.externalMeasured=new Vs(it.doc,st,ft);dt.lineN=ft;var gt=dt.built=pe(it,dt);return dt.text=gt.pre,le(it.display.lineMeasure,gt.pre),dt}function Ef(it,st,ft,dt){return rl(it,yu(it,st),ft,dt)}function Fd(it,st){if(st>=it.display.viewFrom&&st<it.display.viewTo)return it.display.view[Ba(it,st)];var ft=it.display.externalMeasured;if(ft&&st>=ft.lineN&&st<ft.lineN+ft.size)return ft}function yu(it,st){var ft=de(st),dt=Fd(it,ft);dt&&!dt.text?dt=null:dt&&dt.changes&&(Zr(it,dt,ft,Df(it)),it.curOp.forceUpdate=!0),dt||(dt=Kc(it,st));var gt=Mf(dt,st,ft);return{line:st,view:dt,rect:null,map:gt.map,cache:gt.cache,before:gt.before,hasHeights:!1}}function rl(it,st,ft,dt,gt){st.before&&(ft=-1);var Pt=ft+(dt||""),Tt;return st.cache.hasOwnProperty(Pt)?Tt=st.cache[Pt]:(st.rect||(st.rect=st.view.text.getBoundingClientRect()),st.hasHeights||(Yc(it,st.view,st.rect),st.hasHeights=!0),Tt=Ir(it,st,ft,dt),Tt.bogus||(st.cache[Pt]=Tt)),{left:Tt.left,right:Tt.right,top:gt?Tt.rtop:Tt.top,bottom:gt?Tt.rbottom:Tt.bottom}}var Nf={left:0,right:0,top:0,bottom:0};function Tf(it,st,ft){for(var dt,gt,Pt,Tt,It,Dt,Ut=0;Ut<it.length;Ut+=3)if(It=it[Ut],Dt=it[Ut+1],st<It?(gt=0,Pt=1,Tt="left"):st<Dt?(gt=st-It,Pt=gt+1):(Ut==it.length-3||st==Dt&&it[Ut+3]>st)&&(Pt=Dt-It,gt=Pt-1,st>=Dt&&(Tt="right")),gt!=null){if(dt=it[Ut+2],It==Dt&&ft==(dt.insertLeft?"left":"right")&&(Tt=ft),ft=="left"&&gt==0)for(;Ut&&it[Ut-2]==it[Ut-3]&&it[Ut-1].insertLeft;)dt=it[(Ut-=3)+2],Tt="left";if(ft=="right"&&gt==Dt-It)for(;Ut<it.length-3&&it[Ut+3]==it[Ut+4]&&!it[Ut+5].insertLeft;)dt=it[(Ut+=3)+2],Tt="right";break}return{node:dt,start:gt,end:Pt,collapse:Tt,coverStart:It,coverEnd:Dt}}function Xc(it,st){var ft=Nf;if(st=="left")for(var dt=0;dt<it.length&&(ft=it[dt]).left==ft.right;dt++);else for(var gt=it.length-1;gt>=0&&(ft=it[gt]).left==ft.right;gt--);return ft}function Ir(it,st,ft,dt){var gt=Tf(st.map,ft,dt),Pt=gt.node,Tt=gt.start,It=gt.end,Dt=gt.collapse,Ut;if(Pt.nodeType==3){for(var ce=0;ce<4;ce++){for(;Tt&&wn(st.line.text.charAt(gt.coverStart+Tt));)--Tt;for(;gt.coverStart+It<gt.coverEnd&&wn(st.line.text.charAt(gt.coverStart+It));)++It;if(ye&&oe<9&&Tt==0&&It==gt.coverEnd-gt.coverStart?Ut=Pt.parentNode.getBoundingClientRect():Ut=Xc(fe(Pt,Tt,It).getClientRects(),dt),Ut.left||Ut.right||Tt==0)break;It=Tt,Tt=Tt-1,Dt="right"}ye&&oe<11&&(Ut=bp(it.display.measure,Ut))}else{Tt>0&&(Dt=dt="right");var Xt;it.options.lineWrapping&&(Xt=Pt.getClientRects()).length>1?Ut=Xt[dt=="right"?Xt.length-1:0]:Ut=Pt.getBoundingClientRect()}if(ye&&oe<9&&!Tt&&(!Ut||!Ut.left&&!Ut.right)){var Re=Pt.parentNode.getClientRects()[0];Re?Ut={left:Re.left,right:Re.left+rh(it.display),top:Re.top,bottom:Re.bottom}:Ut=Nf}for(var Fe=Ut.top-st.rect.top,gn=Ut.bottom-st.rect.top,xn=(Fe+gn)/2,Nn=st.view.measure.heights,Qn=0;Qn<Nn.length-1&&!(xn<Nn[Qn]);Qn++);var wi=Qn?Nn[Qn-1]:0,si=Nn[Qn],Ei={left:(Dt=="right"?Ut.right:Ut.left)-st.rect.left,right:(Dt=="left"?Ut.left:Ut.right)-st.rect.left,top:wi,bottom:si};return!Ut.left&&!Ut.right&&(Ei.bogus=!0),it.options.singleCursorHeightPerLine||(Ei.rtop=Fe,Ei.rbottom=gn),Ei}function bp(it,st){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!mi(it))return st;var ft=screen.logicalXDPI/screen.deviceXDPI,dt=screen.logicalYDPI/screen.deviceYDPI;return{left:st.left*ft,right:st.right*ft,top:st.top*dt,bottom:st.bottom*dt}}function Zc(it){if(it.measure&&(it.measure.cache={},it.measure.heights=null,it.rest))for(var st=0;st<it.rest.length;st++)it.measure.caches[st]={}}function bd(it){it.display.externalMeasure=null,ie(it.display.lineMeasure);for(var st=0;st<it.display.view.length;st++)Zc(it.display.view[st])}function Yh(it){bd(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function Ks(){return ge&&et?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Xs(){return ge&&et?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Jr(it){var st=0;if(it.widgets)for(var ft=0;ft<it.widgets.length;++ft)it.widgets[ft].above&&(st+=rs(it.widgets[ft]));return st}function Ls(it,st,ft,dt,gt){if(!gt){var Pt=Jr(st);ft.top+=Pt,ft.bottom+=Pt}if(dt=="line")return ft;dt||(dt="local");var Tt=ji(st);if(dt=="local"?Tt+=ya(it.display):Tt-=it.display.viewOffset,dt=="page"||dt=="window"){var It=it.display.lineSpace.getBoundingClientRect();Tt+=It.top+(dt=="window"?0:Xs());var Dt=It.left+(dt=="window"?0:Ks());ft.left+=Dt,ft.right+=Dt}return ft.top+=Tt,ft.bottom+=Tt,ft}function Ff(it,st,ft){if(ft=="div")return st;var dt=st.left,gt=st.top;if(ft=="page")dt-=Ks(),gt-=Xs();else if(ft=="local"||!ft){var Pt=it.display.sizer.getBoundingClientRect();dt+=Pt.left,gt+=Pt.top}var Tt=it.display.lineSpace.getBoundingClientRect();return{left:dt-Tt.left,top:gt-Tt.top}}function Ad(it,st,ft,dt,gt){return dt||(dt=Ze(it.doc,st.line)),Ls(it,dt,Ef(it,dt,st.ch,gt),ft)}function Lr(it,st,ft,dt,gt,Pt){dt=dt||Ze(it.doc,st.line),gt||(gt=yu(it,dt));function Tt(gn,xn){var Nn=rl(it,gt,gn,xn?"right":"left",Pt);return xn?Nn.left=Nn.right:Nn.right=Nn.left,Ls(it,dt,Nn,ft)}var It=ai(dt,it.doc.direction),Dt=st.ch,Ut=st.sticky;if(Dt>=dt.text.length?(Dt=dt.text.length,Ut="before"):Dt<=0&&(Dt=0,Ut="after"),!It)return Tt(Ut=="before"?Dt-1:Dt,Ut=="before");function ce(gn,xn,Nn){var Qn=It[xn],wi=Qn.level==1;return Tt(Nn?gn-1:gn,wi!=Nn)}var Xt=Pn(It,Dt,Ut),Re=Ci,Fe=ce(Dt,Xt,Ut=="before");return Re!=null&&(Fe.other=ce(Dt,Re,Ut!="before")),Fe}function bf(it,st){var ft=0;st=ti(it.doc,st),it.options.lineWrapping||(ft=rh(it.display)*st.ch);var dt=Ze(it.doc,st.line),gt=ji(dt)+ya(it.display);return{left:ft,right:ft,top:gt,bottom:gt+dt.height}}function Af(it,st,ft,dt,gt){var Pt=Ve(it,st,ft);return Pt.xRel=gt,dt&&(Pt.outside=dt),Pt}function Bf(it,st,ft){var dt=it.doc;if(ft+=it.display.viewOffset,ft<0)return Af(dt.first,0,null,-1,-1);var gt=bn(dt,ft),Pt=dt.first+dt.size-1;if(gt>Pt)return Af(dt.first+dt.size-1,Ze(dt,Pt).text.length,null,1,1);st<0&&(st=0);for(var Tt=Ze(dt,gt);;){var It=Xe(it,Tt,gt,st,ft),Dt=Do(Tt,It.ch+(It.xRel>0||It.outside>0?1:0));if(!Dt)return It;var Ut=Dt.find(1);if(Ut.line==gt)return Ut;Tt=Ze(dt,gt=Ut.line)}}function ci(it,st,ft,dt){dt-=Jr(st);var gt=st.text.length,Pt=Gn(function(Tt){return rl(it,ft,Tt-1).bottom<=dt},gt,0);return gt=Gn(function(Tt){return rl(it,ft,Tt).top>dt},Pt,gt),{begin:Pt,end:gt}}function Jc(it,st,ft,dt){ft||(ft=yu(it,st));var gt=Ls(it,st,rl(it,ft,dt),"line").top;return ci(it,st,ft,gt)}function Jt(it,st,ft,dt){return it.bottom<=ft?!1:it.top>ft?!0:(dt?it.left:it.right)>st}function Xe(it,st,ft,dt,gt){gt-=ji(st);var Pt=yu(it,st),Tt=Jr(st),It=0,Dt=st.text.length,Ut=!0,ce=ai(st,it.doc.direction);if(ce){var Xt=(it.options.lineWrapping?Bp:Ap)(it,st,ft,Pt,ce,dt,gt);Ut=Xt.level!=1,It=Ut?Xt.from:Xt.to-1,Dt=Ut?Xt.to:Xt.from-1}var Re=null,Fe=null,gn=Gn(function($i){var ii=rl(it,Pt,$i);return ii.top+=Tt,ii.bottom+=Tt,Jt(ii,dt,gt,!1)?(ii.top<=gt&&ii.left<=dt&&(Re=$i,Fe=ii),!0):!1},It,Dt),xn,Nn,Qn=!1;if(Fe){var wi=dt-Fe.left<Fe.right-dt,si=wi==Ut;gn=Re+(si?0:1),Nn=si?"after":"before",xn=wi?Fe.left:Fe.right}else{!Ut&&(gn==Dt||gn==It)&&gn++,Nn=gn==0?"after":gn==st.text.length?"before":rl(it,Pt,gn-(Ut?1:0)).bottom+Tt<=gt==Ut?"after":"before";var Ei=Lr(it,Ve(ft,gn,Nn),"line",st,Pt);xn=Ei.left,Qn=gt<Ei.top?-1:gt>=Ei.bottom?1:0}return gn=pi(st.text,gn,1),Af(ft,gn,Nn,Qn,dt-xn)}function Ap(it,st,ft,dt,gt,Pt,Tt){var It=Gn(function(Xt){var Re=gt[Xt],Fe=Re.level!=1;return Jt(Lr(it,Ve(ft,Fe?Re.to:Re.from,Fe?"before":"after"),"line",st,dt),Pt,Tt,!0)},0,gt.length-1),Dt=gt[It];if(It>0){var Ut=Dt.level!=1,ce=Lr(it,Ve(ft,Ut?Dt.from:Dt.to,Ut?"after":"before"),"line",st,dt);Jt(ce,Pt,Tt,!0)&&ce.top>Tt&&(Dt=gt[It-1])}return Dt}function Bp(it,st,ft,dt,gt,Pt,Tt){var It=ci(it,st,dt,Tt),Dt=It.begin,Ut=It.end;/\s/.test(st.text.charAt(Ut-1))&&Ut--;for(var ce=null,Xt=null,Re=0;Re<gt.length;Re++){var Fe=gt[Re];if(!(Fe.from>=Ut||Fe.to<=Dt)){var gn=Fe.level!=1,xn=rl(it,dt,gn?Math.min(Ut,Fe.to)-1:Math.max(Dt,Fe.from)).right,Nn=xn<Pt?Pt-xn+1e9:xn-Pt;(!ce||Xt>Nn)&&(ce=Fe,Xt=Nn)}}return ce||(ce=gt[gt.length-1]),ce.from<Dt&&(ce={from:Dt,to:ce.to,level:ce.level}),ce.to>Ut&&(ce={from:ce.from,to:Ut,level:ce.level}),ce}var Jl;function Ql(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(Jl==null){Jl=re("pre",null,"CodeMirror-line-like");for(var st=0;st<49;++st)Jl.appendChild(document.createTextNode("x")),Jl.appendChild(re("br"));Jl.appendChild(document.createTextNode("x"))}le(it.measure,Jl);var ft=Jl.offsetHeight/50;return ft>3&&(it.cachedTextHeight=ft),ie(it.measure),ft||1}function rh(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var st=re("span","xxxxxxxxxx"),ft=re("pre",[st],"CodeMirror-line-like");le(it.measure,ft);var dt=st.getBoundingClientRect(),gt=(dt.right-dt.left)/10;return gt>2&&(it.cachedCharWidth=gt),gt||10}function Df(it){for(var st=it.display,ft={},dt={},gt=st.gutters.clientLeft,Pt=st.gutters.firstChild,Tt=0;Pt;Pt=Pt.nextSibling,++Tt){var It=it.display.gutterSpecs[Tt].className;ft[It]=Pt.offsetLeft+Pt.clientLeft+gt,dt[It]=Pt.clientWidth}return{fixedPos:Bd(st),gutterTotalWidth:st.gutters.offsetWidth,gutterLeft:ft,gutterWidth:dt,wrapperWidth:st.wrapper.clientWidth}}function Bd(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function gr(it){var st=Ql(it.display),ft=it.options.lineWrapping,dt=ft&&Math.max(5,it.display.scroller.clientWidth/rh(it.display)-3);return function(gt){if(Le(it.doc,gt))return 0;var Pt=0;if(gt.widgets)for(var Tt=0;Tt<gt.widgets.length;Tt++)gt.widgets[Tt].height&&(Pt+=gt.widgets[Tt].height);return ft?Pt+(Math.ceil(gt.text.length/dt)||1)*st:Pt+st}}function Oi(it){var st=it.doc,ft=gr(it);st.iter(function(dt){var gt=ft(dt);gt!=dt.height&&sn(dt,gt)})}function Zs(it,st,ft,dt){var gt=it.display;if(!ft&&As(st).getAttribute("cm-not-content")=="true")return null;var Pt,Tt,It=gt.lineSpace.getBoundingClientRect();try{Pt=st.clientX-It.left,Tt=st.clientY-It.top}catch(Xt){return null}var Dt=Bf(it,Pt,Tt),Ut;if(dt&&Dt.xRel>0&&(Ut=Ze(it.doc,Dt.line).text).length==Dt.ch){var ce=Qt(Ut,Ut.length,it.options.tabSize)-Ut.length;Dt=Ve(Dt.line,Math.max(0,Math.round((Pt-oh(it.display).left)/rh(it.display))-ce))}return Dt}function Ba(it,st){if(st>=it.display.viewTo||(st-=it.display.viewFrom,st<0))return null;for(var ft=it.display.view,dt=0;dt<ft.length;dt++)if(st-=ft[dt].size,st<0)return dt}function pr(it,st,ft,dt){st==null&&(st=it.doc.first),ft==null&&(ft=it.doc.first+it.doc.size),dt||(dt=0);var gt=it.display;if(dt&&ft<gt.viewTo&&(gt.updateLineNumbers==null||gt.updateLineNumbers>st)&&(gt.updateLineNumbers=st),it.curOp.viewChanged=!0,st>=gt.viewTo)be&&Dn(it.doc,st)<gt.viewTo&&Rr(it);else if(ft<=gt.viewFrom)be&&xi(it.doc,ft+dt)>gt.viewFrom?Rr(it):(gt.viewFrom+=dt,gt.viewTo+=dt);else if(st<=gt.viewFrom&&ft>=gt.viewTo)Rr(it);else if(st<=gt.viewFrom){var Pt=aa(it,ft,ft+dt,1);Pt?(gt.view=gt.view.slice(Pt.index),gt.viewFrom=Pt.lineN,gt.viewTo+=dt):Rr(it)}else if(ft>=gt.viewTo){var Tt=aa(it,st,st,-1);Tt?(gt.view=gt.view.slice(0,Tt.index),gt.viewTo=Tt.lineN):Rr(it)}else{var It=aa(it,st,st,-1),Dt=aa(it,ft,ft+dt,1);It&&Dt?(gt.view=gt.view.slice(0,It.index).concat(yo(it,It.lineN,Dt.lineN)).concat(gt.view.slice(Dt.index)),gt.viewTo+=dt):Rr(it)}var Ut=gt.externalMeasured;Ut&&(ft<Ut.lineN?Ut.lineN+=dt:st<Ut.lineN+Ut.size&&(gt.externalMeasured=null))}function ao(it,st,ft){it.curOp.viewChanged=!0;var dt=it.display,gt=it.display.externalMeasured;if(gt&&st>=gt.lineN&&st<gt.lineN+gt.size&&(dt.externalMeasured=null),!(st<dt.viewFrom||st>=dt.viewTo)){var Pt=dt.view[Ba(it,st)];if(Pt.node!=null){var Tt=Pt.changes||(Pt.changes=[]);He(Tt,ft)==-1&&Tt.push(ft)}}}function Rr(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function aa(it,st,ft,dt){var gt=Ba(it,st),Pt,Tt=it.display.view;if(!be||ft==it.doc.first+it.doc.size)return{index:gt,lineN:ft};for(var It=it.display.viewFrom,Dt=0;Dt<gt;Dt++)It+=Tt[Dt].size;if(It!=st){if(dt>0){if(gt==Tt.length-1)return null;Pt=It+Tt[gt].size-st,gt++}else Pt=It-st;st+=Pt,ft+=Pt}for(;Dn(it.doc,ft)!=ft;){if(gt==(dt<0?0:Tt.length-1))return null;ft+=dt*Tt[gt-(dt<0?1:0)].size,gt+=dt}return{index:gt,lineN:ft}}function tr(it,st,ft){var dt=it.display,gt=dt.view;gt.length==0||st>=dt.viewTo||ft<=dt.viewFrom?(dt.view=yo(it,st,ft),dt.viewFrom=st):(dt.viewFrom>st?dt.view=yo(it,st,dt.viewFrom).concat(dt.view):dt.viewFrom<st&&(dt.view=dt.view.slice(Ba(it,st))),dt.viewFrom=st,dt.viewTo<ft?dt.view=dt.view.concat(yo(it,dt.viewTo,ft)):dt.viewTo>ft&&(dt.view=dt.view.slice(0,Ba(it,ft)))),dt.viewTo=ft}function xa(it){for(var st=it.display.view,ft=0,dt=0;dt<st.length;dt++){var gt=st[dt];!gt.hidden&&(!gt.node||gt.changes)&&++ft}return ft}function Qr(it){it.display.input.showSelection(it.display.input.prepareSelection())}function Su(it,st){st===void 0&&(st=!0);for(var ft=it.doc,dt={},gt=dt.cursors=document.createDocumentFragment(),Pt=dt.selection=document.createDocumentFragment(),Tt=0;Tt<ft.sel.ranges.length;Tt++)if(!(!st&&Tt==ft.sel.primIndex)){var It=ft.sel.ranges[Tt];if(!(It.from().line>=it.display.viewTo||It.to().line<it.display.viewFrom)){var Dt=It.empty();(Dt||it.options.showCursorWhenSelecting)&&No(it,It.head,gt),Dt||Eo(it,It,Pt)}}return dt}function No(it,st,ft){var dt=Lr(it,st,"div",null,null,!it.options.singleCursorHeightPerLine),gt=ft.appendChild(re("div","\xA0","CodeMirror-cursor"));if(gt.style.left=dt.left+"px",gt.style.top=dt.top+"px",gt.style.height=Math.max(0,dt.bottom-dt.top)*it.options.cursorHeight+"px",dt.other){var Pt=ft.appendChild(re("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Pt.style.display="",Pt.style.left=dt.other.left+"px",Pt.style.top=dt.other.top+"px",Pt.style.height=(dt.other.bottom-dt.other.top)*.85+"px"}}function Js(it,st){return it.top-st.top||it.left-st.left}function Eo(it,st,ft){var dt=it.display,gt=it.doc,Pt=document.createDocumentFragment(),Tt=oh(it.display),It=Tt.left,Dt=Math.max(dt.sizerWidth,ol(it)-dt.sizer.offsetLeft)-Tt.right,Ut=gt.direction=="ltr";function ce(si,Ei,$i,ii){Ei<0&&(Ei=0),Ei=Math.round(Ei),ii=Math.round(ii),Pt.appendChild(re("div",null,"CodeMirror-selected","position: absolute; left: "+si+`px;
top: `+Ei+"px; width: "+($i==null?Dt-si:$i)+`px;
height: `+(ii-Ei)+"px"))}function Xt(si,Ei,$i){var ii=Ze(gt,si),ho=ii.text.length,mr,ts;function Mr(Yr,La){return Ad(it,Ve(si,Yr),"div",ii,La)}function ha(Yr,La,Ms){var Kr=Jc(it,ii,null,Yr),zo=La=="ltr"==(Ms=="after")?"left":"right",Tr=Ms=="after"?Kr.begin:Kr.end-(/\s/.test(ii.text.charAt(Kr.end-1))?2:1);return Mr(Tr,zo)[zo]}var Rs=ai(ii,gt.direction);return Yn(Rs,Ei||0,$i==null?ho:$i,function(Yr,La,Ms,Kr){var zo=Ms=="ltr",Tr=Mr(Yr,zo?"left":"right"),ds=Mr(La-1,zo?"right":"left"),Es=Ei==null&&Yr==0,al=$i==null&&La==ho,Er=Kr==0,Za=!Rs||Kr==Rs.length-1;if(ds.top-Tr.top<=3){var Dr=(Ut?Es:al)&&Er,nf=(Ut?al:Es)&&Za,Ra=Dr?It:(zo?Tr:ds).left,ka=nf?Dt:(zo?ds:Tr).right;ce(Ra,Tr.top,ka-Ra,Tr.bottom)}else{var da,nr,fs,Il;zo?(da=Ut&&Es&&Er?It:Tr.left,nr=Ut?Dt:ha(Yr,Ms,"before"),fs=Ut?It:ha(La,Ms,"after"),Il=Ut&&al&&Za?Dt:ds.right):(da=Ut?ha(Yr,Ms,"before"):It,nr=!Ut&&Es&&Er?Dt:Tr.right,fs=!Ut&&al&&Za?It:ds.left,Il=Ut?ha(La,Ms,"after"):Dt),ce(da,Tr.top,nr-da,Tr.bottom),Tr.bottom<ds.top&&ce(It,Tr.bottom,null,ds.top),ce(fs,ds.top,Il-fs,ds.bottom)}(!mr||Js(Tr,mr)<0)&&(mr=Tr),Js(ds,mr)<0&&(mr=ds),(!ts||Js(Tr,ts)<0)&&(ts=Tr),Js(ds,ts)<0&&(ts=ds)}),{start:mr,end:ts}}var Re=st.from(),Fe=st.to();if(Re.line==Fe.line)Xt(Re.line,Re.ch,Fe.ch);else{var gn=Ze(gt,Re.line),xn=Ze(gt,Fe.line),Nn=Pi(gn)==Pi(xn),Qn=Xt(Re.line,Re.ch,Nn?gn.text.length+1:null).end,wi=Xt(Fe.line,Nn?0:null,Fe.ch).start;Nn&&(Qn.top<wi.top-2?(ce(Qn.right,Qn.top,null,Qn.bottom),ce(It,wi.top,wi.left,wi.bottom)):ce(Qn.right,Qn.top,wi.left-Qn.right,Qn.bottom)),Qn.bottom<wi.top&&ce(It,Qn.bottom,null,wi.top)}ft.appendChild(Pt)}function Ko(it){if(it.state.focused){var st=it.display;clearInterval(st.blinker);var ft=!0;st.cursorDiv.style.visibility="",it.options.cursorBlinkRate>0?st.blinker=setInterval(function(){it.hasFocus()||sh(it),st.cursorDiv.style.visibility=(ft=!ft)?"":"hidden"},it.options.cursorBlinkRate):it.options.cursorBlinkRate<0&&(st.cursorDiv.style.visibility="hidden")}}function ar(it){it.state.focused||(it.display.input.focus(),Fo(it))}function xr(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,sh(it))},100)}function Fo(it,st){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(mo(it,"focus",it,st),it.state.focused=!0,nn(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),Yt&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),Ko(it))}function sh(it,st){it.state.delayingBlurEvent||(it.state.focused&&(mo(it,"blur",it,st),it.state.focused=!1,Zt(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function bi(it){for(var st=it.display,ft=st.lineDiv.offsetTop,dt=0;dt<st.view.length;dt++){var gt=st.view[dt],Pt=it.options.lineWrapping,Tt=void 0,It=0;if(!gt.hidden){if(ye&&oe<8){var Dt=gt.node.offsetTop+gt.node.offsetHeight;Tt=Dt-ft,ft=Dt}else{var Ut=gt.node.getBoundingClientRect();Tt=Ut.bottom-Ut.top,!Pt&&gt.text.firstChild&&(It=gt.text.firstChild.getBoundingClientRect().right-Ut.left-1)}var ce=gt.line.height-Tt;if((ce>.005||ce<-.005)&&(sn(gt.line,Tt),Dp(gt.line),gt.rest))for(var Xt=0;Xt<gt.rest.length;Xt++)Dp(gt.rest[Xt]);if(It>it.display.sizerWidth){var Re=Math.ceil(It/rh(it.display));Re>it.display.maxLineLength&&(it.display.maxLineLength=Re,it.display.maxLine=gt.line,it.display.maxLineChanged=!0)}}}}function Dp(it){if(it.widgets)for(var st=0;st<it.widgets.length;++st){var ft=it.widgets[st],dt=ft.node.parentNode;dt&&(ft.height=dt.offsetHeight)}}function ko(it,st,ft){var dt=ft&&ft.top!=null?Math.max(0,ft.top):it.scroller.scrollTop;dt=Math.floor(dt-ya(it));var gt=ft&&ft.bottom!=null?ft.bottom:dt+it.wrapper.clientHeight,Pt=bn(st,dt),Tt=bn(st,gt);if(ft&&ft.ensure){var It=ft.ensure.from.line,Dt=ft.ensure.to.line;It<Pt?(Pt=It,Tt=bn(st,ji(Ze(st,It))+it.wrapper.clientHeight)):Math.min(Dt,st.lastLine())>=Tt&&(Pt=bn(st,ji(Ze(st,Dt))-it.wrapper.clientHeight),Tt=Dt)}return{from:Pt,to:Math.max(Tt,Pt+1)}}function Op(it,st){if(!Ji(it,"scrollCursorIntoView")){var ft=it.display,dt=ft.sizer.getBoundingClientRect(),gt=null;if(st.top+dt.top<0?gt=!0:st.bottom+dt.top>(window.innerHeight||document.documentElement.clientHeight)&&(gt=!1),gt!=null&&!on){var Pt=re("div","\u200B",null,`position: absolute;
top: `+(st.top-ft.viewOffset-ya(it.display))+`px;
height: `+(st.bottom-st.top+Sa(it)+ft.barHeight)+`px;
left: `+st.left+"px; width: "+Math.max(2,st.right-st.left)+"px;");it.display.lineSpace.appendChild(Pt),Pt.scrollIntoView(gt),it.display.lineSpace.removeChild(Pt)}}}function Kh(it,st,ft,dt){dt==null&&(dt=0);var gt;!it.options.lineWrapping&&st==ft&&(st=st.ch?Ve(st.line,st.sticky=="before"?st.ch-1:st.ch,"after"):st,ft=st.sticky=="before"?Ve(st.line,st.ch+1,"before"):st);for(var Pt=0;Pt<5;Pt++){var Tt=!1,It=Lr(it,st),Dt=!ft||ft==st?It:Lr(it,ft);gt={left:Math.min(It.left,Dt.left),top:Math.min(It.top,Dt.top)-dt,right:Math.max(It.left,Dt.left),bottom:Math.max(It.bottom,Dt.bottom)+dt};var Ut=Qc(it,gt),ce=it.doc.scrollTop,Xt=it.doc.scrollLeft;if(Ut.scrollTop!=null&&(lh(it,Ut.scrollTop),Math.abs(it.doc.scrollTop-ce)>1&&(Tt=!0)),Ut.scrollLeft!=null&&($l(it,Ut.scrollLeft),Math.abs(it.doc.scrollLeft-Xt)>1&&(Tt=!0)),!Tt)break}return gt}function Dd(it,st){var ft=Qc(it,st);ft.scrollTop!=null&&lh(it,ft.scrollTop),ft.scrollLeft!=null&&$l(it,ft.scrollLeft)}function Qc(it,st){var ft=it.display,dt=Ql(it.display);st.top<0&&(st.top=0);var gt=it.curOp&&it.curOp.scrollTop!=null?it.curOp.scrollTop:ft.scroller.scrollTop,Pt=Td(it),Tt={};st.bottom-st.top>Pt&&(st.bottom=st.top+Pt);var It=it.doc.height+vu(ft),Dt=st.top<dt,Ut=st.bottom>It-dt;if(st.top<gt)Tt.scrollTop=Dt?0:st.top;else if(st.bottom>gt+Pt){var ce=Math.min(st.top,(Ut?It:st.bottom)-Pt);ce!=gt&&(Tt.scrollTop=ce)}var Xt=it.options.fixedGutter?0:ft.gutters.offsetWidth,Re=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:ft.scroller.scrollLeft-Xt,Fe=ol(it)-ft.gutters.offsetWidth,gn=st.right-st.left>Fe;return gn&&(st.right=st.left+Fe),st.left<10?Tt.scrollLeft=0:st.left<Re?Tt.scrollLeft=Math.max(0,st.left+Xt-(gn?0:10)):st.right>Fe+Re-3&&(Tt.scrollLeft=st.right+(gn?0:10)-Fe),Tt}function Of(it,st){st!=null&&(bl(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+st)}function ql(it){bl(it);var st=it.getCursor();it.curOp.scrollToPos={from:st,to:st,margin:it.options.cursorScrollMargin}}function ah(it,st,ft){(st!=null||ft!=null)&&bl(it),st!=null&&(it.curOp.scrollLeft=st),ft!=null&&(it.curOp.scrollTop=ft)}function bo(it,st){bl(it),it.curOp.scrollToPos=st}function bl(it){var st=it.curOp.scrollToPos;if(st){it.curOp.scrollToPos=null;var ft=bf(it,st.from),dt=bf(it,st.to);If(it,ft,dt,st.margin)}}function If(it,st,ft,dt){var gt=Qc(it,{left:Math.min(st.left,ft.left),top:Math.min(st.top,ft.top)-dt,right:Math.max(st.right,ft.right),bottom:Math.max(st.bottom,ft.bottom)+dt});ah(it,gt.scrollLeft,gt.scrollTop)}function lh(it,st){Math.abs(it.doc.scrollTop-st)<2||(wt||ku(it,{top:st}),qc(it,st,!0),wt&&ku(it),Xh(it,100))}function qc(it,st,ft){st=Math.max(0,Math.min(it.display.scroller.scrollHeight-it.display.scroller.clientHeight,st)),!(it.display.scroller.scrollTop==st&&!ft)&&(it.doc.scrollTop=st,it.display.scrollbars.setScrollTop(st),it.display.scroller.scrollTop!=st&&(it.display.scroller.scrollTop=st))}function $l(it,st,ft,dt){st=Math.max(0,Math.min(st,it.display.scroller.scrollWidth-it.display.scroller.clientWidth)),!((ft?st==it.doc.scrollLeft:Math.abs(it.doc.scrollLeft-st)<2)&&!dt)&&(it.doc.scrollLeft=st,zf(it),it.display.scroller.scrollLeft!=st&&(it.display.scroller.scrollLeft=st),it.display.scrollbars.setScrollLeft(st))}function Va(it){var st=it.display,ft=st.gutters.offsetWidth,dt=Math.round(it.doc.height+vu(it.display));return{clientHeight:st.scroller.clientHeight,viewHeight:st.wrapper.clientHeight,scrollWidth:st.scroller.scrollWidth,clientWidth:st.scroller.clientWidth,viewWidth:st.wrapper.clientWidth,barLeft:it.options.fixedGutter?ft:0,docHeight:dt,scrollHeight:dt+Sa(it)+st.barHeight,nativeBarWidth:st.nativeBarWidth,gutterWidth:ft}}var xu=function(it,st,ft){this.cm=ft;var dt=this.vert=re("div",[re("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),gt=this.horiz=re("div",[re("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");dt.tabIndex=gt.tabIndex=-1,it(dt),it(gt),ri(dt,"scroll",function(){dt.clientHeight&&st(dt.scrollTop,"vertical")}),ri(gt,"scroll",function(){gt.clientWidth&&st(gt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ye&&oe<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xu.prototype.update=function(it){var st=it.scrollWidth>it.clientWidth+1,ft=it.scrollHeight>it.clientHeight+1,dt=it.nativeBarWidth;if(ft){this.vert.style.display="block",this.vert.style.bottom=st?dt+"px":"0";var gt=it.viewHeight-(st?dt:0);this.vert.firstChild.style.height=Math.max(0,it.scrollHeight-it.clientHeight+gt)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(st){this.horiz.style.display="block",this.horiz.style.right=ft?dt+"px":"0",this.horiz.style.left=it.barLeft+"px";var Pt=it.viewWidth-it.barLeft-(ft?dt:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+Pt)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&it.clientHeight>0&&(dt==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:ft?dt:0,bottom:st?dt:0}},xu.prototype.setScrollLeft=function(it){this.horiz.scrollLeft!=it&&(this.horiz.scrollLeft=it),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xu.prototype.setScrollTop=function(it){this.vert.scrollTop!=it&&(this.vert.scrollTop=it),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xu.prototype.zeroWidthHack=function(){var it=ht&&!Be?"12px":"18px";this.horiz.style.height=this.vert.style.width=it,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new zt,this.disableVert=new zt},xu.prototype.enableZeroWidthBar=function(it,st,ft){it.style.pointerEvents="auto";function dt(){var gt=it.getBoundingClientRect(),Pt=ft=="vert"?document.elementFromPoint(gt.right-1,(gt.top+gt.bottom)/2):document.elementFromPoint((gt.right+gt.left)/2,gt.bottom-1);Pt!=it?it.style.pointerEvents="none":st.set(1e3,dt)}st.set(1e3,dt)},xu.prototype.clear=function(){var it=this.horiz.parentNode;it.removeChild(this.horiz),it.removeChild(this.vert)};var vl=function(){};vl.prototype.update=function(){return{bottom:0,right:0}},vl.prototype.setScrollLeft=function(){},vl.prototype.setScrollTop=function(){},vl.prototype.clear=function(){};function Pu(it,st){st||(st=Va(it));var ft=it.display.barWidth,dt=it.display.barHeight;Rf(it,st);for(var gt=0;gt<4&&ft!=it.display.barWidth||dt!=it.display.barHeight;gt++)ft!=it.display.barWidth&&it.options.lineWrapping&&bi(it),Rf(it,Va(it)),ft=it.display.barWidth,dt=it.display.barHeight}function Rf(it,st){var ft=it.display,dt=ft.scrollbars.update(st);ft.sizer.style.paddingRight=(ft.barWidth=dt.right)+"px",ft.sizer.style.paddingBottom=(ft.barHeight=dt.bottom)+"px",ft.heightForcer.style.borderBottom=dt.bottom+"px solid transparent",dt.right&&dt.bottom?(ft.scrollbarFiller.style.display="block",ft.scrollbarFiller.style.height=dt.bottom+"px",ft.scrollbarFiller.style.width=dt.right+"px"):ft.scrollbarFiller.style.display="",dt.bottom&&it.options.coverGutterNextToScrollbar&&it.options.fixedGutter?(ft.gutterFiller.style.display="block",ft.gutterFiller.style.height=dt.bottom+"px",ft.gutterFiller.style.width=st.gutterWidth+"px"):ft.gutterFiller.style.display=""}var $c={native:xu,null:vl};function tg(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&Zt(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new $c[it.options.scrollbarStyle](function(st){it.display.wrapper.insertBefore(st,it.display.scrollbarFiller),ri(st,"mousedown",function(){it.state.focused&&setTimeout(function(){return it.display.input.focus()},0)}),st.setAttribute("cm-not-content","true")},function(st,ft){ft=="horizontal"?$l(it,st):lh(it,st)},it),it.display.scrollbars.addClass&&nn(it.display.wrapper,it.display.scrollbars.addClass)}var Ip=0;function wu(it){it.curOp={cm:it,viewChanged:!1,startHeight:it.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ip},Hi(it.curOp)}function Cu(it){var st=it.curOp;st&&Mo(st,function(ft){for(var dt=0;dt<ft.ops.length;dt++)ft.ops[dt].cm.curOp=null;J0(ft)})}function J0(it){for(var st=it.ops,ft=0;ft<st.length;ft++)Q0(st[ft]);for(var dt=0;dt<st.length;dt++)q0(st[dt]);for(var gt=0;gt<st.length;gt++)Rp(st[gt]);for(var Pt=0;Pt<st.length;Pt++)Nr(st[Pt]);for(var Tt=0;Tt<st.length;Tt++)Lu(st[Tt])}function Q0(it){var st=it.cm,ft=st.display;jp(st),it.updateMaxLine&&vo(st),it.mustUpdate=it.viewChanged||it.forceUpdate||it.scrollTop!=null||it.scrollToPos&&(it.scrollToPos.from.line<ft.viewFrom||it.scrollToPos.to.line>=ft.viewTo)||ft.maxLineChanged&&st.options.lineWrapping,it.update=it.mustUpdate&&new uh(st,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function q0(it){it.updatedDisplay=it.mustUpdate&&jf(it.cm,it.update)}function Rp(it){var st=it.cm,ft=st.display;it.updatedDisplay&&bi(st),it.barMeasure=Va(st),ft.maxLineChanged&&!st.options.lineWrapping&&(it.adjustWidthTo=Ef(st,ft.maxLine,ft.maxLine.text.length).left+3,st.display.sizerWidth=it.adjustWidthTo,it.barMeasure.scrollWidth=Math.max(ft.scroller.clientWidth,ft.sizer.offsetLeft+it.adjustWidthTo+Sa(st)+st.display.barWidth),it.maxScrollLeft=Math.max(0,ft.sizer.offsetLeft+it.adjustWidthTo-ol(st))),(it.updatedDisplay||it.selectionChanged)&&(it.preparedSelection=ft.input.prepareSelection())}function Nr(it){var st=it.cm;it.adjustWidthTo!=null&&(st.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<st.doc.scrollLeft&&$l(st,Math.min(st.display.scroller.scrollLeft,it.maxScrollLeft),!0),st.display.maxLineChanged=!1);var ft=it.focus&&it.focus==an();it.preparedSelection&&st.display.input.showSelection(it.preparedSelection,ft),(it.updatedDisplay||it.startHeight!=st.doc.height)&&Pu(st,it.barMeasure),it.updatedDisplay&&Eu(st,it.barMeasure),it.selectionChanged&&Ko(st),st.state.focused&&it.updateInput&&st.display.input.reset(it.typing),ft&&ar(it.cm)}function Lu(it){var st=it.cm,ft=st.display,dt=st.doc;if(it.updatedDisplay&&Xo(st,it.update),ft.wheelStartX!=null&&(it.scrollTop!=null||it.scrollLeft!=null||it.scrollToPos)&&(ft.wheelStartX=ft.wheelStartY=null),it.scrollTop!=null&&qc(st,it.scrollTop,it.forceScroll),it.scrollLeft!=null&&$l(st,it.scrollLeft,!0,!0),it.scrollToPos){var gt=Kh(st,ti(dt,it.scrollToPos.from),ti(dt,it.scrollToPos.to),it.scrollToPos.margin);Op(st,gt)}var Pt=it.maybeHiddenMarkers,Tt=it.maybeUnhiddenMarkers;if(Pt)for(var It=0;It<Pt.length;++It)Pt[It].lines.length||mo(Pt[It],"hide");if(Tt)for(var Dt=0;Dt<Tt.length;++Dt)Tt[Dt].lines.length&&mo(Tt[Dt],"unhide");ft.wrapper.offsetHeight&&(dt.scrollTop=st.display.scroller.scrollTop),it.changeObjs&&mo(st,"changes",st,it.changeObjs),it.update&&it.update.finish()}function _o(it,st){if(it.curOp)return st();wu(it);try{return st()}finally{Cu(it)}}function qr(it,st){return function(){if(it.curOp)return st.apply(it,arguments);wu(it);try{return st.apply(it,arguments)}finally{Cu(it)}}}function ss(it){return function(){if(this.curOp)return it.apply(this,arguments);wu(this);try{return it.apply(this,arguments)}finally{Cu(this)}}}function as(it){return function(){var st=this.cm;if(!st||st.curOp)return it.apply(this,arguments);wu(st);try{return it.apply(this,arguments)}finally{Cu(st)}}}function Xh(it,st){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(st,Bi(ls,it))}function ls(it){var st=it.doc;if(!(st.highlightFrontier>=it.display.viewTo)){var ft=+new Date+it.options.workTime,dt=zi(it,st.highlightFrontier),gt=[];st.iter(dt.line,Math.min(st.first+st.size,it.display.viewTo+500),function(Pt){if(dt.line>=it.display.viewFrom){var Tt=Pt.styles,It=Pt.text.length>it.options.maxHighlightLength?Tn(st.mode,dt.state):null,Dt=Pe(it,Pt,dt,!0);It&&(dt.state=It),Pt.styles=Dt.styles;var Ut=Pt.styleClasses,ce=Dt.classes;ce?Pt.styleClasses=ce:Ut&&(Pt.styleClasses=null);for(var Xt=!Tt||Tt.length!=Pt.styles.length||Ut!=ce&&(!Ut||!ce||Ut.bgClass!=ce.bgClass||Ut.textClass!=ce.textClass),Re=0;!Xt&&Re<Tt.length;++Re)Xt=Tt[Re]!=Pt.styles[Re];Xt&&gt.push(dt.line),Pt.stateAfter=dt.save(),dt.nextLine()}else Pt.text.length<=it.options.maxHighlightLength&&ae(it,Pt.text,dt),Pt.stateAfter=dt.line%5==0?dt.save():null,dt.nextLine();if(+new Date>ft)return Xh(it,it.options.workDelay),!0}),st.highlightFrontier=dt.line,st.modeFrontier=Math.max(st.modeFrontier,dt.line),gt.length&&_o(it,function(){for(var Pt=0;Pt<gt.length;Pt++)ao(it,gt[Pt],"text")})}}var uh=function(it,st,ft){var dt=it.display;this.viewport=st,this.visible=ko(dt,it.doc,st),this.editorIsHidden=!dt.wrapper.offsetWidth,this.wrapperHeight=dt.wrapper.clientHeight,this.wrapperWidth=dt.wrapper.clientWidth,this.oldDisplayWidth=ol(it),this.force=ft,this.dims=Df(it),this.events=[]};uh.prototype.signal=function(it,st){Po(it,st)&&this.events.push(arguments)},uh.prototype.finish=function(){for(var it=0;it<this.events.length;it++)mo.apply(null,this.events[it])};function jp(it){var st=it.display;!st.scrollbarsClipped&&st.scroller.offsetWidth&&(st.nativeBarWidth=st.scroller.offsetWidth-st.scroller.clientWidth,st.heightForcer.style.height=Sa(it)+"px",st.sizer.style.marginBottom=-st.nativeBarWidth+"px",st.sizer.style.borderRightWidth=Sa(it)+"px",st.scrollbarsClipped=!0)}function zp(it){if(it.hasFocus())return null;var st=an();if(!st||!Ke(it.display.lineDiv,st))return null;var ft={activeElt:st};if(window.getSelection){var dt=window.getSelection();dt.anchorNode&&dt.extend&&Ke(it.display.lineDiv,dt.anchorNode)&&(ft.anchorNode=dt.anchorNode,ft.anchorOffset=dt.anchorOffset,ft.focusNode=dt.focusNode,ft.focusOffset=dt.focusOffset)}return ft}function la(it){if(!(!it||!it.activeElt||it.activeElt==an())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&Ke(document.body,it.anchorNode)&&Ke(document.body,it.focusNode))){var st=window.getSelection(),ft=document.createRange();ft.setEnd(it.anchorNode,it.anchorOffset),ft.collapse(!1),st.removeAllRanges(),st.addRange(ft),st.extend(it.focusNode,it.focusOffset)}}function jf(it,st){var ft=it.display,dt=it.doc;if(st.editorIsHidden)return Rr(it),!1;if(!st.force&&st.visible.from>=ft.viewFrom&&st.visible.to<=ft.viewTo&&(ft.updateLineNumbers==null||ft.updateLineNumbers>=ft.viewTo)&&ft.renderedView==ft.view&&xa(it)==0)return!1;Hr(it)&&(Rr(it),st.dims=Df(it));var gt=dt.first+dt.size,Pt=Math.max(st.visible.from-it.options.viewportMargin,dt.first),Tt=Math.min(gt,st.visible.to+it.options.viewportMargin);ft.viewFrom<Pt&&Pt-ft.viewFrom<20&&(Pt=Math.max(dt.first,ft.viewFrom)),ft.viewTo>Tt&&ft.viewTo-Tt<20&&(Tt=Math.min(gt,ft.viewTo)),be&&(Pt=Dn(it.doc,Pt),Tt=xi(it.doc,Tt));var It=Pt!=ft.viewFrom||Tt!=ft.viewTo||ft.lastWrapHeight!=st.wrapperHeight||ft.lastWrapWidth!=st.wrapperWidth;tr(it,Pt,Tt),ft.viewOffset=ji(Ze(it.doc,ft.viewFrom)),it.display.mover.style.top=ft.viewOffset+"px";var Dt=xa(it);if(!It&&Dt==0&&!st.force&&ft.renderedView==ft.view&&(ft.updateLineNumbers==null||ft.updateLineNumbers>=ft.viewTo))return!1;var Ut=zp(it);return Dt>4&&(ft.lineDiv.style.display="none"),eg(it,ft.updateLineNumbers,st.dims),Dt>4&&(ft.lineDiv.style.display=""),ft.renderedView=ft.view,la(Ut),ie(ft.cursorDiv),ie(ft.selectionDiv),ft.gutters.style.height=ft.sizer.style.minHeight=0,It&&(ft.lastWrapHeight=st.wrapperHeight,ft.lastWrapWidth=st.wrapperWidth,Xh(it,400)),ft.updateLineNumbers=null,!0}function Xo(it,st){for(var ft=st.viewport,dt=!0;;dt=!1){if(!dt||!it.options.lineWrapping||st.oldDisplayWidth==ol(it)){if(ft&&ft.top!=null&&(ft={top:Math.min(it.doc.height+vu(it.display)-Td(it),ft.top)}),st.visible=ko(it.display,it.doc,ft),st.visible.from>=it.display.viewFrom&&st.visible.to<=it.display.viewTo)break}else dt&&(st.visible=ko(it.display,it.doc,ft));if(!jf(it,st))break;bi(it);var gt=Va(it);Qr(it),Pu(it,gt),Eu(it,gt),st.force=!1}st.signal(it,"update",it),(it.display.viewFrom!=it.display.reportedViewFrom||it.display.viewTo!=it.display.reportedViewTo)&&(st.signal(it,"viewportChange",it,it.display.viewFrom,it.display.viewTo),it.display.reportedViewFrom=it.display.viewFrom,it.display.reportedViewTo=it.display.viewTo)}function ku(it,st){var ft=new uh(it,st);if(jf(it,ft)){bi(it),Xo(it,ft);var dt=Va(it);Qr(it),Pu(it,dt),Eu(it,dt),ft.finish()}}function eg(it,st,ft){var dt=it.display,gt=it.options.lineNumbers,Pt=dt.lineDiv,Tt=Pt.firstChild;function It(gn){var xn=gn.nextSibling;return Yt&&ht&&it.display.currentWheelTarget==gn?gn.style.display="none":gn.parentNode.removeChild(gn),xn}for(var Dt=dt.view,Ut=dt.viewFrom,ce=0;ce<Dt.length;ce++){var Xt=Dt[ce];if(!Xt.hidden)if(!Xt.node||Xt.node.parentNode!=Pt){var Re=qi(it,Xt,Ut,ft);Pt.insertBefore(Re,Tt)}else{for(;Tt!=Xt.node;)Tt=It(Tt);var Fe=gt&&st!=null&&st<=Ut&&Xt.lineNumber;Xt.changes&&(He(Xt.changes,"gutter")>-1&&(Fe=!1),Zr(it,Xt,Ut,ft)),Fe&&(ie(Xt.lineNumber),Xt.lineNumber.appendChild(document.createTextNode(Di(it.options,Ut)))),Tt=Xt.node.nextSibling}Ut+=Xt.size}for(;Tt;)Tt=It(Tt)}function Mu(it){var st=it.gutters.offsetWidth;it.sizer.style.marginLeft=st+"px"}function Eu(it,st){it.display.sizer.style.minHeight=st.docHeight+"px",it.display.heightForcer.style.top=st.docHeight+"px",it.display.gutters.style.height=st.docHeight+it.display.barHeight+Sa(it)+"px"}function zf(it){var st=it.display,ft=st.view;if(!(!st.alignWidgets&&(!st.gutters.firstChild||!it.options.fixedGutter))){for(var dt=Bd(st)-st.scroller.scrollLeft+it.doc.scrollLeft,gt=st.gutters.offsetWidth,Pt=dt+"px",Tt=0;Tt<ft.length;Tt++)if(!ft[Tt].hidden){it.options.fixedGutter&&(ft[Tt].gutter&&(ft[Tt].gutter.style.left=Pt),ft[Tt].gutterBackground&&(ft[Tt].gutterBackground.style.left=Pt));var It=ft[Tt].alignable;if(It)for(var Dt=0;Dt<It.length;Dt++)It[Dt].style.left=Pt}it.options.fixedGutter&&(st.gutters.style.left=dt+gt+"px")}}function Hr(it){if(!it.options.lineNumbers)return!1;var st=it.doc,ft=Di(it.options,st.first+st.size-1),dt=it.display;if(ft.length!=dt.lineNumChars){var gt=dt.measure.appendChild(re("div",[re("div",ft)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Pt=gt.firstChild.offsetWidth,Tt=gt.offsetWidth-Pt;return dt.lineGutter.style.width="",dt.lineNumInnerWidth=Math.max(Pt,dt.lineGutter.offsetWidth-Tt)+1,dt.lineNumWidth=dt.lineNumInnerWidth+Tt,dt.lineNumChars=dt.lineNumInnerWidth?ft.length:-1,dt.lineGutter.style.width=dt.lineNumWidth+"px",Mu(it.display),!0}return!1}function us(it,st){for(var ft=[],dt=!1,gt=0;gt<it.length;gt++){var Pt=it[gt],Tt=null;if(typeof Pt!="string"&&(Tt=Pt.style,Pt=Pt.className),Pt=="CodeMirror-linenumbers")if(st)dt=!0;else continue;ft.push({className:Pt,style:Tt})}return st&&!dt&&ft.push({className:"CodeMirror-linenumbers",style:null}),ft}function hh(it){var st=it.gutters,ft=it.gutterSpecs;ie(st),it.lineGutter=null;for(var dt=0;dt<ft.length;++dt){var gt=ft[dt],Pt=gt.className,Tt=gt.style,It=st.appendChild(re("div",null,"CodeMirror-gutter "+Pt));Tt&&(It.style.cssText=Tt),Pt=="CodeMirror-linenumbers"&&(it.lineGutter=It,It.style.width=(it.lineNumWidth||1)+"px")}st.style.display=ft.length?"":"none",Mu(it)}function Da(it){hh(it.display),pr(it),zf(it)}function Nu(it,st,ft,dt){var gt=this;this.input=ft,gt.scrollbarFiller=re("div",null,"CodeMirror-scrollbar-filler"),gt.scrollbarFiller.setAttribute("cm-not-content","true"),gt.gutterFiller=re("div",null,"CodeMirror-gutter-filler"),gt.gutterFiller.setAttribute("cm-not-content","true"),gt.lineDiv=Ge("div",null,"CodeMirror-code"),gt.selectionDiv=re("div",null,null,"position: relative; z-index: 1"),gt.cursorDiv=re("div",null,"CodeMirror-cursors"),gt.measure=re("div",null,"CodeMirror-measure"),gt.lineMeasure=re("div",null,"CodeMirror-measure"),gt.lineSpace=Ge("div",[gt.measure,gt.lineMeasure,gt.selectionDiv,gt.cursorDiv,gt.lineDiv],null,"position: relative; outline: none");var Pt=Ge("div",[gt.lineSpace],"CodeMirror-lines");gt.mover=re("div",[Pt],null,"position: relative"),gt.sizer=re("div",[gt.mover],"CodeMirror-sizer"),gt.sizerWidth=null,gt.heightForcer=re("div",null,null,"position: absolute; height: "+En+"px; width: 1px;"),gt.gutters=re("div",null,"CodeMirror-gutters"),gt.lineGutter=null,gt.scroller=re("div",[gt.sizer,gt.heightForcer,gt.gutters],"CodeMirror-scroll"),gt.scroller.setAttribute("tabIndex","-1"),gt.wrapper=re("div",[gt.scrollbarFiller,gt.gutterFiller,gt.scroller],"CodeMirror"),ye&&oe<8&&(gt.gutters.style.zIndex=-1,gt.scroller.style.paddingRight=0),!Yt&&!(wt&&nt)&&(gt.scroller.draggable=!0),it&&(it.appendChild?it.appendChild(gt.wrapper):it(gt.wrapper)),gt.viewFrom=gt.viewTo=st.first,gt.reportedViewFrom=gt.reportedViewTo=st.first,gt.view=[],gt.renderedView=null,gt.externalMeasured=null,gt.viewOffset=0,gt.lastWrapHeight=gt.lastWrapWidth=0,gt.updateLineNumbers=null,gt.nativeBarWidth=gt.barHeight=gt.barWidth=0,gt.scrollbarsClipped=!1,gt.lineNumWidth=gt.lineNumInnerWidth=gt.lineNumChars=null,gt.alignWidgets=!1,gt.cachedCharWidth=gt.cachedTextHeight=gt.cachedPaddingH=null,gt.maxLine=null,gt.maxLineLength=0,gt.maxLineChanged=!1,gt.wheelDX=gt.wheelDY=gt.wheelStartX=gt.wheelStartY=null,gt.shift=!1,gt.selForContextMenu=null,gt.activeTouch=null,gt.gutterSpecs=us(dt.gutters,dt.lineNumbers),hh(gt),ft.init(gt)}var Pa=0,jr=null;ye?jr=-.53:wt?jr=15:ge?jr=-.7:Ye&&(jr=-1/3);function yl(it){var st=it.wheelDeltaX,ft=it.wheelDeltaY;return st==null&&it.detail&&it.axis==it.HORIZONTAL_AXIS&&(st=it.detail),ft==null&&it.detail&&it.axis==it.VERTICAL_AXIS?ft=it.detail:ft==null&&(ft=it.wheelDelta),{x:st,y:ft}}function Oa(it){var st=yl(it);return st.x*=jr,st.y*=jr,st}function hs(it,st){var ft=yl(st),dt=ft.x,gt=ft.y,Pt=it.display,Tt=Pt.scroller,It=Tt.scrollWidth>Tt.clientWidth,Dt=Tt.scrollHeight>Tt.clientHeight;if(dt&&It||gt&&Dt){if(gt&&ht&&Yt){t:for(var Ut=st.target,ce=Pt.view;Ut!=Tt;Ut=Ut.parentNode)for(var Xt=0;Xt<ce.length;Xt++)if(ce[Xt].node==Ut){it.display.currentWheelTarget=Ut;break t}}if(dt&&!wt&&!we&&jr!=null){gt&&Dt&&lh(it,Math.max(0,Tt.scrollTop+gt*jr)),$l(it,Math.max(0,Tt.scrollLeft+dt*jr)),(!gt||gt&&Dt)&&rr(st),Pt.wheelStartX=null;return}if(gt&&jr!=null){var Re=gt*jr,Fe=it.doc.scrollTop,gn=Fe+Pt.wrapper.clientHeight;Re<0?Fe=Math.max(0,Fe+Re-50):gn=Math.min(it.doc.height,gn+Re+50),ku(it,{top:Fe,bottom:gn})}Pa<20&&(Pt.wheelStartX==null?(Pt.wheelStartX=Tt.scrollLeft,Pt.wheelStartY=Tt.scrollTop,Pt.wheelDX=dt,Pt.wheelDY=gt,setTimeout(function(){if(Pt.wheelStartX!=null){var xn=Tt.scrollLeft-Pt.wheelStartX,Nn=Tt.scrollTop-Pt.wheelStartY,Qn=Nn&&Pt.wheelDY&&Nn/Pt.wheelDY||xn&&Pt.wheelDX&&xn/Pt.wheelDX;Pt.wheelStartX=Pt.wheelStartY=null,Qn&&(jr=(jr*Pa+Qn)/(Pa+1),++Pa)}},200)):(Pt.wheelDX+=dt,Pt.wheelDY+=gt))}}var Ya=function(it,st){this.ranges=it,this.primIndex=st};Ya.prototype.primary=function(){return this.ranges[this.primIndex]},Ya.prototype.equals=function(it){if(it==this)return!0;if(it.primIndex!=this.primIndex||it.ranges.length!=this.ranges.length)return!1;for(var st=0;st<this.ranges.length;st++){var ft=this.ranges[st],dt=it.ranges[st];if(!wo(ft.anchor,dt.anchor)||!wo(ft.head,dt.head))return!1}return!0},Ya.prototype.deepCopy=function(){for(var it=[],st=0;st<this.ranges.length;st++)it[st]=new Zo(Ho(this.ranges[st].anchor),Ho(this.ranges[st].head));return new Ya(it,this.primIndex)},Ya.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},Ya.prototype.contains=function(it,st){st||(st=it);for(var ft=0;ft<this.ranges.length;ft++){var dt=this.ranges[ft];if(jn(st,dt.from())>=0&&jn(it,dt.to())<=0)return ft}return-1};var Zo=function(it,st){this.anchor=it,this.head=st};Zo.prototype.from=function(){return Un(this.anchor,this.head)},Zo.prototype.to=function(){return fo(this.anchor,this.head)},Zo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function sl(it,st,ft){var dt=it&&it.options.selectionsMayTouch,gt=st[ft];st.sort(function(Re,Fe){return jn(Re.from(),Fe.from())}),ft=He(st,gt);for(var Pt=1;Pt<st.length;Pt++){var Tt=st[Pt],It=st[Pt-1],Dt=jn(It.to(),Tt.from());if(dt&&!Tt.empty()?Dt>0:Dt>=0){var Ut=Un(It.from(),Tt.from()),ce=fo(It.to(),Tt.to()),Xt=It.empty()?Tt.from()==Tt.head:It.from()==It.head;Pt<=ft&&--ft,st.splice(--Pt,2,new Zo(Xt?ce:Ut,Xt?Ut:ce))}}return new Ya(st,ft)}function tu(it,st){return new Ya([new Zo(it,st||it)],0)}function Tu(it){return it.text?Ve(it.from.line+it.text.length-1,Ae(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function dh(it,st){if(jn(it,st.from)<0)return it;if(jn(it,st.to)<=0)return Tu(st);var ft=it.line+st.text.length-(st.to.line-st.from.line)-1,dt=it.ch;return it.line==st.to.line&&(dt+=Tu(st).ch-st.to.ch),Ve(ft,dt)}function Od(it,st){for(var ft=[],dt=0;dt<it.sel.ranges.length;dt++){var gt=it.sel.ranges[dt];ft.push(new Zo(dh(gt.anchor,st),dh(gt.head,st)))}return sl(it.cm,ft,it.sel.primIndex)}function Zh(it,st,ft){return it.line==st.line?Ve(ft.line,it.ch-st.ch+ft.ch):Ve(ft.line+(it.line-st.line),it.ch)}function Id(it,st,ft){for(var dt=[],gt=Ve(it.first,0),Pt=gt,Tt=0;Tt<st.length;Tt++){var It=st[Tt],Dt=Zh(It.from,gt,Pt),Ut=Zh(Tu(It),gt,Pt);if(gt=It.to,Pt=Ut,ft=="around"){var ce=it.sel.ranges[Tt],Xt=jn(ce.head,ce.anchor)<0;dt[Tt]=new Zo(Xt?Ut:Dt,Xt?Dt:Ut)}else dt[Tt]=new Zo(Dt,Dt)}return new Ya(dt,it.sel.primIndex)}function uo(it){it.doc.mode=Oe(it.options,it.doc.modeOption),Rd(it)}function Rd(it){it.doc.iter(function(st){st.stateAfter&&(st.stateAfter=null),st.styles&&(st.styles=null)}),it.doc.modeFrontier=it.doc.highlightFrontier=it.doc.first,Xh(it,100),it.state.modeGen++,it.curOp&&pr(it)}function ng(it,st){return st.from.ch==0&&st.to.ch==0&&Ae(st.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function _f(it,st,ft,dt){function gt(wi){return ft?ft[wi]:null}function Pt(wi,si,Ei){Wo(wi,si,Ei,dt),On(wi,"change",wi,st)}function Tt(wi,si){for(var Ei=[],$i=wi;$i<si;++$i)Ei.push(new Oo(Ut[$i],gt($i),dt));return Ei}var It=st.from,Dt=st.to,Ut=st.text,ce=Ze(it,It.line),Xt=Ze(it,Dt.line),Re=Ae(Ut),Fe=gt(Ut.length-1),gn=Dt.line-It.line;if(st.full)it.insert(0,Tt(0,Ut.length)),it.remove(Ut.length,it.size-Ut.length);else if(ng(it,st)){var xn=Tt(0,Ut.length-1);Pt(Xt,Xt.text,Fe),gn&&it.remove(It.line,gn),xn.length&&it.insert(It.line,xn)}else if(ce==Xt)if(Ut.length==1)Pt(ce,ce.text.slice(0,It.ch)+Re+ce.text.slice(Dt.ch),Fe);else{var Nn=Tt(1,Ut.length-1);Nn.push(new Oo(Re+ce.text.slice(Dt.ch),Fe,dt)),Pt(ce,ce.text.slice(0,It.ch)+Ut[0],gt(0)),it.insert(It.line+1,Nn)}else if(Ut.length==1)Pt(ce,ce.text.slice(0,It.ch)+Ut[0]+Xt.text.slice(Dt.ch),gt(0)),it.remove(It.line+1,gn);else{Pt(ce,ce.text.slice(0,It.ch)+Ut[0],gt(0)),Pt(Xt,Re+Xt.text.slice(Dt.ch),Fe);var Qn=Tt(1,Ut.length-1);gn>1&&it.remove(It.line+1,gn-1),it.insert(It.line+1,Qn)}On(it,"change",it,st)}function Sl(it,st,ft){function dt(gt,Pt,Tt){if(gt.linked)for(var It=0;It<gt.linked.length;++It){var Dt=gt.linked[It];if(Dt.doc!=Pt){var Ut=Tt&&Dt.sharedHist;ft&&!Ut||(st(Dt.doc,Ut),dt(Dt.doc,gt,Ut))}}}dt(it,null,!0)}function Gf(it,st){if(st.cm)throw new Error("This document is already in use.");it.doc=st,st.cm=it,Oi(it),uo(it),jd(it),it.options.lineWrapping||vo(it),it.options.mode=st.modeOption,pr(it)}function jd(it){(it.doc.direction=="rtl"?nn:Zt)(it.display.lineDiv,"CodeMirror-rtl")}function $0(it){_o(it,function(){jd(it),pr(it)})}function Jh(it){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=it||1}function Hf(it,st){var ft={from:Ho(st.from),to:Tu(st),text:Xn(it,st.from,st.to)};return Fu(it,ft,st.from.line,st.to.line+1),Sl(it,function(dt){return Fu(dt,ft,st.from.line,st.to.line+1)},!0),ft}function Qh(it){for(;it.length;){var st=Ae(it);if(st.ranges)it.pop();else break}}function zd(it,st){if(st)return Qh(it.done),Ae(it.done);if(it.done.length&&!Ae(it.done).ranges)return Ae(it.done);if(it.done.length>1&&!it.done[it.done.length-2].ranges)return it.done.pop(),Ae(it.done)}function _d(it,st,ft,dt){var gt=it.history;gt.undone.length=0;var Pt=+new Date,Tt,It;if((gt.lastOp==dt||gt.lastOrigin==st.origin&&st.origin&&(st.origin.charAt(0)=="+"&&gt.lastModTime>Pt-(it.cm?it.cm.options.historyEventDelay:500)||st.origin.charAt(0)=="*"))&&(Tt=zd(gt,gt.lastOp==dt)))It=Ae(Tt.changes),jn(st.from,st.to)==0&&jn(st.from,It.to)==0?It.to=Tu(st):Tt.changes.push(Hf(it,st));else{var Dt=Ae(gt.done);for((!Dt||!Dt.ranges)&&qh(it.sel,gt.done),Tt={changes:[Hf(it,st)],generation:gt.generation},gt.done.push(Tt);gt.done.length>gt.undoDepth;)gt.done.shift(),gt.done[0].ranges||gt.done.shift()}gt.done.push(ft),gt.generation=++gt.maxGeneration,gt.lastModTime=gt.lastSelTime=Pt,gt.lastOp=gt.lastSelOp=dt,gt.lastOrigin=gt.lastSelOrigin=st.origin,It||mo(it,"historyAdded")}function ig(it,st,ft,dt){var gt=st.charAt(0);return gt=="*"||gt=="+"&&ft.ranges.length==dt.ranges.length&&ft.somethingSelected()==dt.somethingSelected()&&new Date-it.history.lastSelTime<=(it.cm?it.cm.options.historyEventDelay:500)}function Gd(it,st,ft,dt){var gt=it.history,Pt=dt&&dt.origin;ft==gt.lastSelOp||Pt&&gt.lastSelOrigin==Pt&&(gt.lastModTime==gt.lastSelTime&&gt.lastOrigin==Pt||ig(it,Pt,Ae(gt.done),st))?gt.done[gt.done.length-1]=st:qh(st,gt.done),gt.lastSelTime=+new Date,gt.lastSelOrigin=Pt,gt.lastSelOp=ft,dt&&dt.clearRedo!==!1&&Qh(gt.undone)}function qh(it,st){var ft=Ae(st);ft&&ft.ranges&&ft.equals(it)||st.push(it)}function Fu(it,st,ft,dt){var gt=st["spans_"+it.id],Pt=0;it.iter(Math.max(it.first,ft),Math.min(it.first+it.size,dt),function(Tt){Tt.markedSpans&&((gt||(gt=st["spans_"+it.id]={}))[Pt]=Tt.markedSpans),++Pt})}function Qs(it){if(!it)return null;for(var st,ft=0;ft<it.length;++ft)it[ft].marker.explicitlyCleared?st||(st=it.slice(0,ft)):st&&st.push(it[ft]);return st?st.length?st:null:it}function Al(it,st){var ft=st["spans_"+it.id];if(!ft)return null;for(var dt=[],gt=0;gt<st.text.length;++gt)dt.push(Qs(ft[gt]));return dt}function Wf(it,st){var ft=Al(it,st),dt=fn(it,st);if(!ft)return dt;if(!dt)return ft;for(var gt=0;gt<ft.length;++gt){var Pt=ft[gt],Tt=dt[gt];if(Pt&&Tt)t:for(var It=0;It<Tt.length;++It){for(var Dt=Tt[It],Ut=0;Ut<Pt.length;++Ut)if(Pt[Ut].marker==Dt.marker)continue t;Pt.push(Dt)}else Tt&&(ft[gt]=Tt)}return ft}function eu(it,st,ft){for(var dt=[],gt=0;gt<it.length;++gt){var Pt=it[gt];if(Pt.ranges){dt.push(ft?Ya.prototype.deepCopy.call(Pt):Pt);continue}var Tt=Pt.changes,It=[];dt.push({changes:It});for(var Dt=0;Dt<Tt.length;++Dt){var Ut=Tt[Dt],ce=void 0;if(It.push({from:Ut.from,to:Ut.to,text:Ut.text}),st)for(var Xt in Ut)(ce=Xt.match(/^spans_(\d+)$/))&&He(st,Number(ce[1]))>-1&&(Ae(It)[Xt]=Ut[Xt],delete Ut[Xt])}}return dt}function Uf(it,st,ft,dt){if(dt){var gt=it.anchor;if(ft){var Pt=jn(st,gt)<0;Pt!=jn(ft,gt)<0?(gt=st,st=ft):Pt!=jn(st,ft)<0&&(st=ft)}return new Zo(gt,st)}else return new Zo(ft||st,st)}function Vf(it,st,ft,dt,gt){gt==null&&(gt=it.cm&&(it.cm.display.shift||it.extend)),Is(it,new Ya([Uf(it.sel.primary(),st,ft,gt)],0),dt)}function _p(it,st,ft){for(var dt=[],gt=it.cm&&(it.cm.display.shift||it.extend),Pt=0;Pt<it.sel.ranges.length;Pt++)dt[Pt]=Uf(it.sel.ranges[Pt],st[Pt],null,gt);var Tt=sl(it.cm,dt,it.sel.primIndex);Is(it,Tt,ft)}function bu(it,st,ft,dt){var gt=it.sel.ranges.slice(0);gt[st]=ft,Is(it,sl(it.cm,gt,it.sel.primIndex),dt)}function fh(it,st,ft,dt){Is(it,tu(st,ft),dt)}function Gp(it,st,ft){var dt={ranges:st.ranges,update:function(gt){this.ranges=[];for(var Pt=0;Pt<gt.length;Pt++)this.ranges[Pt]=new Zo(ti(it,gt[Pt].anchor),ti(it,gt[Pt].head))},origin:ft&&ft.origin};return mo(it,"beforeSelectionChange",it,dt),it.cm&&mo(it.cm,"beforeSelectionChange",it.cm,dt),dt.ranges!=st.ranges?sl(it.cm,dt.ranges,dt.ranges.length-1):st}function Yf(it,st,ft){var dt=it.history.done,gt=Ae(dt);gt&&gt.ranges?(dt[dt.length-1]=st,ch(it,st,ft)):Is(it,st,ft)}function Is(it,st,ft){ch(it,st,ft),Gd(it,it.sel,it.cm?it.cm.curOp.id:NaN,ft)}function ch(it,st,ft){(Po(it,"beforeSelectionChange")||it.cm&&Po(it.cm,"beforeSelectionChange"))&&(st=Gp(it,st,ft));var dt=ft&&ft.bias||(jn(st.primary().head,it.sel.primary().head)<0?-1:1);og(it,Wd(it,st,dt,!0)),!(ft&&ft.scroll===!1)&&it.cm&&ql(it.cm)}function og(it,st){st.equals(it.sel)||(it.sel=st,it.cm&&(it.cm.curOp.updateInput=1,it.cm.curOp.selectionChanged=!0,Cr(it.cm)),On(it,"cursorActivity",it))}function Hd(it){og(it,Wd(it,it.sel,null,!1))}function Wd(it,st,ft,dt){for(var gt,Pt=0;Pt<st.ranges.length;Pt++){var Tt=st.ranges[Pt],It=st.ranges.length==it.sel.ranges.length&&it.sel.ranges[Pt],Dt=Ud(it,Tt.anchor,It&&It.anchor,ft,dt),Ut=Ud(it,Tt.head,It&&It.head,ft,dt);(gt||Dt!=Tt.anchor||Ut!=Tt.head)&&(gt||(gt=st.ranges.slice(0,Pt)),gt[Pt]=new Zo(Dt,Ut))}return gt?sl(it.cm,gt,st.primIndex):st}function nu(it,st,ft,dt,gt){var Pt=Ze(it,st.line);if(Pt.markedSpans)for(var Tt=0;Tt<Pt.markedSpans.length;++Tt){var It=Pt.markedSpans[Tt],Dt=It.marker,Ut="selectLeft"in Dt?!Dt.selectLeft:Dt.inclusiveLeft,ce="selectRight"in Dt?!Dt.selectRight:Dt.inclusiveRight;if((It.from==null||(Ut?It.from<=st.ch:It.from<st.ch))&&(It.to==null||(ce?It.to>=st.ch:It.to>st.ch))){if(gt&&(mo(Dt,"beforeCursorEnter"),Dt.explicitlyCleared))if(Pt.markedSpans){--Tt;continue}else break;if(!Dt.atomic)continue;if(ft){var Xt=Dt.find(dt<0?1:-1),Re=void 0;if((dt<0?ce:Ut)&&(Xt=rg(it,Xt,-dt,Xt&&Xt.line==st.line?Pt:null)),Xt&&Xt.line==st.line&&(Re=jn(Xt,ft))&&(dt<0?Re<0:Re>0))return nu(it,Xt,st,dt,gt)}var Fe=Dt.find(dt<0?-1:1);return(dt<0?Ut:ce)&&(Fe=rg(it,Fe,dt,Fe.line==st.line?Pt:null)),Fe?nu(it,Fe,st,dt,gt):null}}return st}function Ud(it,st,ft,dt,gt){var Pt=dt||1,Tt=nu(it,st,ft,Pt,gt)||!gt&&nu(it,st,ft,Pt,!0)||nu(it,st,ft,-Pt,gt)||!gt&&nu(it,st,ft,-Pt,!0);return Tt||(it.cantEdit=!0,Ve(it.first,0))}function rg(it,st,ft,dt){return ft<0&&st.ch==0?st.line>it.first?ti(it,Ve(st.line-1)):null:ft>0&&st.ch==(dt||Ze(it,st.line)).text.length?st.line<it.first+it.size-1?Ve(st.line+1,0):null:new Ve(st.line,st.ch+ft)}function zr(it){it.setSelection(Ve(it.firstLine(),0),Ve(it.lastLine()),Te)}function Vd(it,st,ft){var dt={canceled:!1,from:st.from,to:st.to,text:st.text,origin:st.origin,cancel:function(){return dt.canceled=!0}};return ft&&(dt.update=function(gt,Pt,Tt,It){gt&&(dt.from=ti(it,gt)),Pt&&(dt.to=ti(it,Pt)),Tt&&(dt.text=Tt),It!==void 0&&(dt.origin=It)}),mo(it,"beforeChange",it,dt),it.cm&&mo(it.cm,"beforeChange",it.cm,dt),dt.canceled?(it.cm&&(it.cm.curOp.updateInput=2),null):{from:dt.from,to:dt.to,text:dt.text,origin:dt.origin}}function Au(it,st,ft){if(it.cm){if(!it.cm.curOp)return qr(it.cm,Au)(it,st,ft);if(it.cm.state.suppressEdits)return}if(!((Po(it,"beforeChange")||it.cm&&Po(it.cm,"beforeChange"))&&(st=Vd(it,st,!0),!st))){var dt=In&&!ft&&yn(it,st.from,st.to);if(dt)for(var gt=dt.length-1;gt>=0;--gt)gh(it,{from:dt[gt].from,to:dt[gt].to,text:gt?[""]:st.text,origin:st.origin});else gh(it,st)}}function gh(it,st){if(!(st.text.length==1&&st.text[0]==""&&jn(st.from,st.to)==0)){var ft=Od(it,st);_d(it,st,ft,it.cm?it.cm.curOp.id:NaN),$h(it,st,ft,fn(it,st));var dt=[];Sl(it,function(gt,Pt){!Pt&&He(dt,gt.history)==-1&&(ag(gt.history,st),dt.push(gt.history)),$h(gt,st,null,fn(gt,st))})}}function Yd(it,st,ft){var dt=it.cm&&it.cm.state.suppressEdits;if(!(dt&&!ft)){for(var gt=it.history,Pt,Tt=it.sel,It=st=="undo"?gt.done:gt.undone,Dt=st=="undo"?gt.undone:gt.done,Ut=0;Ut<It.length&&(Pt=It[Ut],!(ft?Pt.ranges&&!Pt.equals(it.sel):!Pt.ranges));Ut++);if(Ut!=It.length){for(gt.lastOrigin=gt.lastSelOrigin=null;;)if(Pt=It.pop(),Pt.ranges){if(qh(Pt,Dt),ft&&!Pt.equals(it.sel)){Is(it,Pt,{clearRedo:!1});return}Tt=Pt}else if(dt){It.push(Pt);return}else break;var ce=[];qh(Tt,Dt),Dt.push({changes:ce,generation:gt.generation}),gt.generation=Pt.generation||++gt.maxGeneration;for(var Xt=Po(it,"beforeChange")||it.cm&&Po(it.cm,"beforeChange"),Re=function(xn){var Nn=Pt.changes[xn];if(Nn.origin=st,Xt&&!Vd(it,Nn,!1))return It.length=0,{};ce.push(Hf(it,Nn));var Qn=xn?Od(it,Nn):Ae(It);$h(it,Nn,Qn,Wf(it,Nn)),!xn&&it.cm&&it.cm.scrollIntoView({from:Nn.from,to:Tu(Nn)});var wi=[];Sl(it,function(si,Ei){!Ei&&He(wi,si.history)==-1&&(ag(si.history,Nn),wi.push(si.history)),$h(si,Nn,null,Wf(si,Nn))})},Fe=Pt.changes.length-1;Fe>=0;--Fe){var gn=Re(Fe);if(gn)return gn.v}}}}function sg(it,st){if(st!=0&&(it.first+=st,it.sel=new Ya(hn(it.sel.ranges,function(gt){return new Zo(Ve(gt.anchor.line+st,gt.anchor.ch),Ve(gt.head.line+st,gt.head.ch))}),it.sel.primIndex),it.cm)){pr(it.cm,it.first,it.first-st,st);for(var ft=it.cm.display,dt=ft.viewFrom;dt<ft.viewTo;dt++)ao(it.cm,dt,"gutter")}}function $h(it,st,ft,dt){if(it.cm&&!it.cm.curOp)return qr(it.cm,$h)(it,st,ft,dt);if(st.to.line<it.first){sg(it,st.text.length-1-(st.to.line-st.from.line));return}if(!(st.from.line>it.lastLine())){if(st.from.line<it.first){var gt=st.text.length-1-(it.first-st.from.line);sg(it,gt),st={from:Ve(it.first,0),to:Ve(st.to.line+gt,st.to.ch),text:[Ae(st.text)],origin:st.origin}}var Pt=it.lastLine();st.to.line>Pt&&(st={from:st.from,to:Ve(Pt,Ze(it,Pt).text.length),text:[st.text[0]],origin:st.origin}),st.removed=Xn(it,st.from,st.to),ft||(ft=Od(it,st)),it.cm?Hp(it.cm,st,dt):_f(it,st,dt),ch(it,ft,Te),it.cantEdit&&Ud(it,Ve(it.firstLine(),0))&&(it.cantEdit=!1)}}function Hp(it,st,ft){var dt=it.doc,gt=it.display,Pt=st.from,Tt=st.to,It=!1,Dt=Pt.line;it.options.lineWrapping||(Dt=de(Pi(Ze(dt,Pt.line))),dt.iter(Dt,Tt.line+1,function(Fe){if(Fe==gt.maxLine)return It=!0,!0})),dt.sel.contains(st.from,st.to)>-1&&Cr(it),_f(dt,st,ft,gr(it)),it.options.lineWrapping||(dt.iter(Dt,Pt.line+st.text.length,function(Fe){var gn=Lo(Fe);gn>gt.maxLineLength&&(gt.maxLine=Fe,gt.maxLineLength=gn,gt.maxLineChanged=!0,It=!1)}),It&&(it.curOp.updateMaxLine=!0)),fi(dt,Pt.line),Xh(it,400);var Ut=st.text.length-(Tt.line-Pt.line)-1;st.full?pr(it):Pt.line==Tt.line&&st.text.length==1&&!ng(it.doc,st)?ao(it,Pt.line,"text"):pr(it,Pt.line,Tt.line+1,Ut);var ce=Po(it,"changes"),Xt=Po(it,"change");if(Xt||ce){var Re={from:Pt,to:Tt,text:st.text,removed:st.removed,origin:st.origin};Xt&&On(it,"change",it,Re),ce&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(Re)}it.display.selForContextMenu=null}function ph(it,st,ft,dt,gt){var Pt;dt||(dt=ft),jn(dt,ft)<0&&(Pt=[dt,ft],ft=Pt[0],dt=Pt[1]),typeof st=="string"&&(st=it.splitLines(st)),Au(it,{from:ft,to:dt,text:st,origin:gt})}function Ka(it,st,ft,dt){ft<it.line?it.line+=dt:st<it.line&&(it.line=st,it.ch=0)}function Wp(it,st,ft,dt){for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Tt=!0;if(Pt.ranges){Pt.copied||(Pt=it[gt]=Pt.deepCopy(),Pt.copied=!0);for(var It=0;It<Pt.ranges.length;It++)Ka(Pt.ranges[It].anchor,st,ft,dt),Ka(Pt.ranges[It].head,st,ft,dt);continue}for(var Dt=0;Dt<Pt.changes.length;++Dt){var Ut=Pt.changes[Dt];if(ft<Ut.from.line)Ut.from=Ve(Ut.from.line+dt,Ut.from.ch),Ut.to=Ve(Ut.to.line+dt,Ut.to.ch);else if(st<=Ut.to.line){Tt=!1;break}}Tt||(it.splice(0,gt+1),gt=0)}}function ag(it,st){var ft=st.from.line,dt=st.to.line,gt=st.text.length-(dt-ft)-1;Wp(it.done,ft,dt,gt),Wp(it.undone,ft,dt,gt)}function mh(it,st,ft,dt){var gt=st,Pt=st;return typeof st=="number"?Pt=Ze(it,_n(it,st)):gt=de(st),gt==null?null:(dt(Pt,gt)&&it.cm&&ao(it.cm,gt,ft),Pt)}function td(it){this.lines=it,this.parent=null;for(var st=0,ft=0;ft<it.length;++ft)it[ft].parent=this,st+=it[ft].height;this.height=st}td.prototype={chunkSize:function(){return this.lines.length},removeInner:function(it,st){for(var ft=it,dt=it+st;ft<dt;++ft){var gt=this.lines[ft];this.height-=gt.height,Ar(gt),On(gt,"delete")}this.lines.splice(it,st)},collapse:function(it){it.push.apply(it,this.lines)},insertInner:function(it,st,ft){this.height+=ft,this.lines=this.lines.slice(0,it).concat(st).concat(this.lines.slice(it));for(var dt=0;dt<st.length;++dt)st[dt].parent=this},iterN:function(it,st,ft){for(var dt=it+st;it<dt;++it)if(ft(this.lines[it]))return!0}};function kr(it){this.children=it;for(var st=0,ft=0,dt=0;dt<it.length;++dt){var gt=it[dt];st+=gt.chunkSize(),ft+=gt.height,gt.parent=this}this.size=st,this.height=ft,this.parent=null}kr.prototype={chunkSize:function(){return this.size},removeInner:function(it,st){this.size-=st;for(var ft=0;ft<this.children.length;++ft){var dt=this.children[ft],gt=dt.chunkSize();if(it<gt){var Pt=Math.min(st,gt-it),Tt=dt.height;if(dt.removeInner(it,Pt),this.height-=Tt-dt.height,gt==Pt&&(this.children.splice(ft--,1),dt.parent=null),(st-=Pt)==0)break;it=0}else it-=gt}if(this.size-st<25&&(this.children.length>1||!(this.children[0]instanceof td))){var It=[];this.collapse(It),this.children=[new td(It)],this.children[0].parent=this}},collapse:function(it){for(var st=0;st<this.children.length;++st)this.children[st].collapse(it)},insertInner:function(it,st,ft){this.size+=st.length,this.height+=ft;for(var dt=0;dt<this.children.length;++dt){var gt=this.children[dt],Pt=gt.chunkSize();if(it<=Pt){if(gt.insertInner(it,st,ft),gt.lines&&gt.lines.length>50){for(var Tt=gt.lines.length%25+25,It=Tt;It<gt.lines.length;){var Dt=new td(gt.lines.slice(It,It+=25));gt.height-=Dt.height,this.children.splice(++dt,0,Dt),Dt.parent=this}gt.lines=gt.lines.slice(0,Tt),this.maybeSpill()}break}it-=Pt}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var st=it.children.splice(it.children.length-5,5),ft=new kr(st);if(it.parent){it.size-=ft.size,it.height-=ft.height;var gt=He(it.parent.children,it);it.parent.children.splice(gt+1,0,ft)}else{var dt=new kr(it.children);dt.parent=it,it.children=[dt,ft],it=dt}ft.parent=it.parent}while(it.children.length>10);it.parent.maybeSpill()}},iterN:function(it,st,ft){for(var dt=0;dt<this.children.length;++dt){var gt=this.children[dt],Pt=gt.chunkSize();if(it<Pt){var Tt=Math.min(st,Pt-it);if(gt.iterN(it,Tt,ft))return!0;if((st-=Tt)==0)break;it=0}else it-=Pt}}};var iu=function(it,st,ft){if(ft)for(var dt in ft)ft.hasOwnProperty(dt)&&(this[dt]=ft[dt]);this.doc=it,this.node=st};iu.prototype.clear=function(){var it=this.doc.cm,st=this.line.widgets,ft=this.line,dt=de(ft);if(!(dt==null||!st)){for(var gt=0;gt<st.length;++gt)st[gt]==this&&st.splice(gt--,1);st.length||(ft.widgets=null);var Pt=rs(this);sn(ft,Math.max(0,ft.height-Pt)),it&&(_o(it,function(){Up(it,ft,-Pt),ao(it,dt,"widget")}),On(it,"lineWidgetCleared",it,this,dt))}},iu.prototype.changed=function(){var it=this,st=this.height,ft=this.doc.cm,dt=this.line;this.height=null;var gt=rs(this)-st;gt&&(Le(this.doc,dt)||sn(dt,dt.height+gt),ft&&_o(ft,function(){ft.curOp.forceUpdate=!0,Up(ft,dt,gt),On(ft,"lineWidgetChanged",ft,it,de(dt))}))},dr(iu);function Up(it,st,ft){ji(st)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&Of(it,ft)}function Kf(it,st,ft,dt){var gt=new iu(it,ft,dt),Pt=it.cm;return Pt&&gt.noHScroll&&(Pt.display.alignWidgets=!0),mh(it,st,"widget",function(Tt){var It=Tt.widgets||(Tt.widgets=[]);if(gt.insertAt==null?It.push(gt):It.splice(Math.min(It.length-1,Math.max(0,gt.insertAt)),0,gt),gt.line=Tt,Pt&&!Le(it,Tt)){var Dt=ji(Tt)<it.scrollTop;sn(Tt,Tt.height+rs(gt)),Dt&&Of(Pt,gt.height),Pt.curOp.forceUpdate=!0}return!0}),Pt&&On(Pt,"lineWidgetAdded",Pt,gt,typeof st=="number"?st:de(st)),gt}var Vp=0,te=function(it,st){this.lines=[],this.type=st,this.doc=it,this.id=++Vp};te.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,st=it&&!it.curOp;if(st&&wu(it),Po(this,"clear")){var ft=this.find();ft&&On(this,"clear",ft.from,ft.to)}for(var dt=null,gt=null,Pt=0;Pt<this.lines.length;++Pt){var Tt=this.lines[Pt],It=co(Tt.markedSpans,this);it&&!this.collapsed?ao(it,de(Tt),"text"):it&&(It.to!=null&&(gt=de(Tt)),It.from!=null&&(dt=de(Tt))),Tt.markedSpans=qt(Tt.markedSpans,It),It.from==null&&this.collapsed&&!Le(this.doc,Tt)&&it&&sn(Tt,Ql(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Dt=0;Dt<this.lines.length;++Dt){var Ut=Pi(this.lines[Dt]),ce=Lo(Ut);ce>it.display.maxLineLength&&(it.display.maxLine=Ut,it.display.maxLineLength=ce,it.display.maxLineChanged=!0)}dt!=null&&it&&this.collapsed&&pr(it,dt,gt+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,it&&Hd(it.doc)),it&&On(it,"markerCleared",it,this,dt,gt),st&&Cu(it),this.parent&&this.parent.clear()}},te.prototype.find=function(it,st){it==null&&this.type=="bookmark"&&(it=1);for(var ft,dt,gt=0;gt<this.lines.length;++gt){var Pt=this.lines[gt],Tt=co(Pt.markedSpans,this);if(Tt.from!=null&&(ft=Ve(st?Pt:de(Pt),Tt.from),it==-1))return ft;if(Tt.to!=null&&(dt=Ve(st?Pt:de(Pt),Tt.to),it==1))return dt}return ft&&{from:ft,to:dt}},te.prototype.changed=function(){var it=this,st=this.find(-1,!0),ft=this,dt=this.doc.cm;!st||!dt||_o(dt,function(){var gt=st.line,Pt=de(st.line),Tt=Fd(dt,Pt);if(Tt&&(Zc(Tt),dt.curOp.selectionChanged=dt.curOp.forceUpdate=!0),dt.curOp.updateMaxLine=!0,!Le(ft.doc,gt)&&ft.height!=null){var It=ft.height;ft.height=null;var Dt=rs(ft)-It;Dt&&sn(gt,gt.height+Dt)}On(dt,"markerChanged",dt,it)})},te.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(!st.maybeHiddenMarkers||He(st.maybeHiddenMarkers,this)==-1)&&(st.maybeUnhiddenMarkers||(st.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},te.prototype.detachLine=function(it){if(this.lines.splice(He(this.lines,it),1),!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(st.maybeHiddenMarkers||(st.maybeHiddenMarkers=[])).push(this)}},dr(te);function vh(it,st,ft,dt,gt){if(dt&&dt.shared)return Yp(it,st,ft,dt,gt);if(it.cm&&!it.cm.curOp)return qr(it.cm,vh)(it,st,ft,dt,gt);var Pt=new te(it,gt),Tt=jn(st,ft);if(dt&&so(dt,Pt,!1),Tt>0||Tt==0&&Pt.clearWhenEmpty!==!1)return Pt;if(Pt.replacedWith&&(Pt.collapsed=!0,Pt.widgetNode=Ge("span",[Pt.replacedWith],"CodeMirror-widget"),dt.handleMouseEvents||Pt.widgetNode.setAttribute("cm-ignore-events","true"),dt.insertLeft&&(Pt.widgetNode.insertLeft=!0)),Pt.collapsed){if(Ii(it,st.line,st,ft,Pt)||st.line!=ft.line&&Ii(it,ft.line,st,ft,Pt))throw new Error("Inserting collapsed marker partially overlapping an existing one");ke()}Pt.addToHistory&&_d(it,{from:st,to:ft,origin:"markText"},it.sel,NaN);var It=st.line,Dt=it.cm,Ut;if(it.iter(It,ft.line+1,function(Xt){Dt&&Pt.collapsed&&!Dt.options.lineWrapping&&Pi(Xt)==Dt.display.maxLine&&(Ut=!0),Pt.collapsed&&It!=st.line&&sn(Xt,0),se(Xt,new vi(Pt,It==st.line?st.ch:null,It==ft.line?ft.ch:null)),++It}),Pt.collapsed&&it.iter(st.line,ft.line+1,function(Xt){Le(it,Xt)&&sn(Xt,0)}),Pt.clearOnEnter&&ri(Pt,"beforeCursorEnter",function(){return Pt.clear()}),Pt.readOnly&&(Gi(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),Pt.collapsed&&(Pt.id=++Vp,Pt.atomic=!0),Dt){if(Ut&&(Dt.curOp.updateMaxLine=!0),Pt.collapsed)pr(Dt,st.line,ft.line+1);else if(Pt.className||Pt.startStyle||Pt.endStyle||Pt.css||Pt.attributes||Pt.title)for(var ce=st.line;ce<=ft.line;ce++)ao(Dt,ce,"text");Pt.atomic&&Hd(Dt.doc),On(Dt,"markerAdded",Dt,Pt)}return Pt}var Bl=function(it,st){this.markers=it,this.primary=st;for(var ft=0;ft<it.length;++ft)it[ft].parent=this};Bl.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var it=0;it<this.markers.length;++it)this.markers[it].clear();On(this,"clear")}},Bl.prototype.find=function(it,st){return this.primary.find(it,st)},dr(Bl);function Yp(it,st,ft,dt,gt){dt=so(dt),dt.shared=!1;var Pt=[vh(it,st,ft,dt,gt)],Tt=Pt[0],It=dt.widgetNode;return Sl(it,function(Dt){It&&(dt.widgetNode=It.cloneNode(!0)),Pt.push(vh(Dt,ti(Dt,st),ti(Dt,ft),dt,gt));for(var Ut=0;Ut<Dt.linked.length;++Ut)if(Dt.linked[Ut].isParent)return;Tt=Ae(Pt)}),new Bl(Pt,Tt)}function lg(it){return it.findMarks(Ve(it.first,0),it.clipPos(Ve(it.lastLine())),function(st){return st.parent})}function Kp(it,st){for(var ft=0;ft<st.length;ft++){var dt=st[ft],gt=dt.find(),Pt=it.clipPos(gt.from),Tt=it.clipPos(gt.to);if(jn(Pt,Tt)){var It=vh(it,Pt,Tt,dt.primary,dt.primary.type);dt.markers.push(It),It.parent=dt}}}function ug(it){for(var st=function(dt){var gt=it[dt],Pt=[gt.primary.doc];Sl(gt.primary.doc,function(Dt){return Pt.push(Dt)});for(var Tt=0;Tt<gt.markers.length;Tt++){var It=gt.markers[Tt];He(Pt,It.doc)==-1&&(It.parent=null,gt.markers.splice(Tt--,1))}},ft=0;ft<it.length;ft++)st(ft)}var tv=0,ks=function(it,st,ft,dt,gt){if(!(this instanceof ks))return new ks(it,st,ft,dt,gt);ft==null&&(ft=0),kr.call(this,[new td([new Oo("",null)])]),this.first=ft,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ft;var Pt=Ve(ft,0);this.sel=tu(Pt),this.history=new Jh(null),this.id=++tv,this.modeOption=st,this.lineSep=dt,this.direction=gt=="rtl"?"rtl":"ltr",this.extend=!1,typeof it=="string"&&(it=this.splitLines(it)),_f(this,{from:Pt,to:Pt,text:it}),Is(this,tu(Pt),Te)};ks.prototype=Lt(kr.prototype,{constructor:ks,iter:function(it,st,ft){ft?this.iterN(it-this.first,st-it,ft):this.iterN(this.first,this.first+this.size,it)},insert:function(it,st){for(var ft=0,dt=0;dt<st.length;++dt)ft+=st[dt].height;this.insertInner(it-this.first,st,ft)},remove:function(it,st){this.removeInner(it-this.first,st)},getValue:function(it){var st=Ni(this,this.first,this.first+this.size);return it===!1?st:st.join(it||this.lineSeparator())},setValue:as(function(it){var st=Ve(this.first,0),ft=this.first+this.size-1;Au(this,{from:st,to:Ve(ft,Ze(this,ft).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&ah(this.cm,0,0),Is(this,tu(st),Te)}),replaceRange:function(it,st,ft,dt){st=ti(this,st),ft=ft?ti(this,ft):st,ph(this,it,st,ft,dt)},getRange:function(it,st,ft){var dt=Xn(this,ti(this,it),ti(this,st));return ft===!1?dt:dt.join(ft||this.lineSeparator())},getLine:function(it){var st=this.getLineHandle(it);return st&&st.text},getLineHandle:function(it){if(qn(this,it))return Ze(this,it)},getLineNumber:function(it){return de(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=Ze(this,it)),Pi(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return ti(this,it)},getCursor:function(it){var st=this.sel.primary(),ft;return it==null||it=="head"?ft=st.head:it=="anchor"?ft=st.anchor:it=="end"||it=="to"||it===!1?ft=st.to():ft=st.from(),ft},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:as(function(it,st,ft){fh(this,ti(this,typeof it=="number"?Ve(it,st||0):it),null,ft)}),setSelection:as(function(it,st,ft){fh(this,ti(this,it),ti(this,st||it),ft)}),extendSelection:as(function(it,st,ft){Vf(this,ti(this,it),st&&ti(this,st),ft)}),extendSelections:as(function(it,st){_p(this,Co(this,it),st)}),extendSelectionsBy:as(function(it,st){var ft=hn(this.sel.ranges,it);_p(this,Co(this,ft),st)}),setSelections:as(function(it,st,ft){if(it.length){for(var dt=[],gt=0;gt<it.length;gt++)dt[gt]=new Zo(ti(this,it[gt].anchor),ti(this,it[gt].head));st==null&&(st=Math.min(it.length-1,this.sel.primIndex)),Is(this,sl(this.cm,dt,st),ft)}}),addSelection:as(function(it,st,ft){var dt=this.sel.ranges.slice(0);dt.push(new Zo(ti(this,it),ti(this,st||it))),Is(this,sl(this.cm,dt,dt.length-1),ft)}),getSelection:function(it){for(var st=this.sel.ranges,ft,dt=0;dt<st.length;dt++){var gt=Xn(this,st[dt].from(),st[dt].to());ft=ft?ft.concat(gt):gt}return it===!1?ft:ft.join(it||this.lineSeparator())},getSelections:function(it){for(var st=[],ft=this.sel.ranges,dt=0;dt<ft.length;dt++){var gt=Xn(this,ft[dt].from(),ft[dt].to());it!==!1&&(gt=gt.join(it||this.lineSeparator())),st[dt]=gt}return st},replaceSelection:function(it,st,ft){for(var dt=[],gt=0;gt<this.sel.ranges.length;gt++)dt[gt]=it;this.replaceSelections(dt,st,ft||"+input")},replaceSelections:as(function(it,st,ft){for(var dt=[],gt=this.sel,Pt=0;Pt<gt.ranges.length;Pt++){var Tt=gt.ranges[Pt];dt[Pt]={from:Tt.from(),to:Tt.to(),text:this.splitLines(it[Pt]),origin:ft}}for(var It=st&&st!="end"&&Id(this,dt,st),Dt=dt.length-1;Dt>=0;Dt--)Au(this,dt[Dt]);It?Yf(this,It):this.cm&&ql(this.cm)}),undo:as(function(){Yd(this,"undo")}),redo:as(function(){Yd(this,"redo")}),undoSelection:as(function(){Yd(this,"undo",!0)}),redoSelection:as(function(){Yd(this,"redo",!0)}),setExtending:function(it){this.extend=it},getExtending:function(){return this.extend},historySize:function(){for(var it=this.history,st=0,ft=0,dt=0;dt<it.done.length;dt++)it.done[dt].ranges||++st;for(var gt=0;gt<it.undone.length;gt++)it.undone[gt].ranges||++ft;return{undo:st,redo:ft}},clearHistory:function(){var it=this;this.history=new Jh(this.history.maxGeneration),Sl(this,function(st){return st.history=it.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(it){return it&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(it){return this.history.generation==(it||this.cleanGeneration)},getHistory:function(){return{done:eu(this.history.done),undone:eu(this.history.undone)}},setHistory:function(it){var st=this.history=new Jh(this.history.maxGeneration);st.done=eu(it.done.slice(0),null,!0),st.undone=eu(it.undone.slice(0),null,!0)},setGutterMarker:as(function(it,st,ft){return mh(this,it,"gutter",function(dt){var gt=dt.gutterMarkers||(dt.gutterMarkers={});return gt[st]=ft,!ft&&Nt(gt)&&(dt.gutterMarkers=null),!0})}),clearGutter:as(function(it){var st=this;this.iter(function(ft){ft.gutterMarkers&&ft.gutterMarkers[it]&&mh(st,ft,"gutter",function(){return ft.gutterMarkers[it]=null,Nt(ft.gutterMarkers)&&(ft.gutterMarkers=null),!0})})}),lineInfo:function(it){var st;if(typeof it=="number"){if(!qn(this,it)||(st=it,it=Ze(this,it),!it))return null}else if(st=de(it),st==null)return null;return{line:st,handle:it,text:it.text,gutterMarkers:it.gutterMarkers,textClass:it.textClass,bgClass:it.bgClass,wrapClass:it.wrapClass,widgets:it.widgets}},addLineClass:as(function(it,st,ft){return mh(this,it,st=="gutter"?"gutter":"class",function(dt){var gt=st=="text"?"textClass":st=="background"?"bgClass":st=="gutter"?"gutterClass":"wrapClass";if(!dt[gt])dt[gt]=ft;else{if(Ht(ft).test(dt[gt]))return!1;dt[gt]+=" "+ft}return!0})}),removeLineClass:as(function(it,st,ft){return mh(this,it,st=="gutter"?"gutter":"class",function(dt){var gt=st=="text"?"textClass":st=="background"?"bgClass":st=="gutter"?"gutterClass":"wrapClass",Pt=dt[gt];if(Pt)if(ft==null)dt[gt]=null;else{var Tt=Pt.match(Ht(ft));if(!Tt)return!1;var It=Tt.index+Tt[0].length;dt[gt]=Pt.slice(0,Tt.index)+(!Tt.index||It==Pt.length?"":" ")+Pt.slice(It)||null}else return!1;return!0})}),addLineWidget:as(function(it,st,ft){return Kf(this,it,st,ft)}),removeLineWidget:function(it){it.clear()},markText:function(it,st,ft){return vh(this,ti(this,it),ti(this,st),ft,ft&&ft.type||"range")},setBookmark:function(it,st){var ft={replacedWith:st&&(st.nodeType==null?st.widget:st),insertLeft:st&&st.insertLeft,clearWhenEmpty:!1,shared:st&&st.shared,handleMouseEvents:st&&st.handleMouseEvents};return it=ti(this,it),vh(this,it,it,ft,"bookmark")},findMarksAt:function(it){it=ti(this,it);var st=[],ft=Ze(this,it.line).markedSpans;if(ft)for(var dt=0;dt<ft.length;++dt){var gt=ft[dt];(gt.from==null||gt.from<=it.ch)&&(gt.to==null||gt.to>=it.ch)&&st.push(gt.marker.parent||gt.marker)}return st},findMarks:function(it,st,ft){it=ti(this,it),st=ti(this,st);var dt=[],gt=it.line;return this.iter(it.line,st.line+1,function(Pt){var Tt=Pt.markedSpans;if(Tt)for(var It=0;It<Tt.length;It++){var Dt=Tt[It];!(Dt.to!=null&&gt==it.line&&it.ch>=Dt.to||Dt.from==null&&gt!=it.line||Dt.from!=null&&gt==st.line&&Dt.from>=st.ch)&&(!ft||ft(Dt.marker))&&dt.push(Dt.marker.parent||Dt.marker)}++gt}),dt},getAllMarks:function(){var it=[];return this.iter(function(st){var ft=st.markedSpans;if(ft)for(var dt=0;dt<ft.length;++dt)ft[dt].from!=null&&it.push(ft[dt].marker)}),it},posFromIndex:function(it){var st,ft=this.first,dt=this.lineSeparator().length;return this.iter(function(gt){var Pt=gt.text.length+dt;if(Pt>it)return st=it,!0;it-=Pt,++ft}),ti(this,Ve(ft,st))},indexFromPos:function(it){it=ti(this,it);var st=it.ch;if(it.line<this.first||it.ch<0)return 0;var ft=this.lineSeparator().length;return this.iter(this.first,it.line,function(dt){st+=dt.text.length+ft}),st},copy:function(it){var st=new ks(Ni(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return st.scrollTop=this.scrollTop,st.scrollLeft=this.scrollLeft,st.sel=this.sel,st.extend=!1,it&&(st.history.undoDepth=this.history.undoDepth,st.setHistory(this.getHistory())),st},linkedDoc:function(it){it||(it={});var st=this.first,ft=this.first+this.size;it.from!=null&&it.from>st&&(st=it.from),it.to!=null&&it.to<ft&&(ft=it.to);var dt=new ks(Ni(this,st,ft),it.mode||this.modeOption,st,this.lineSep,this.direction);return it.sharedHist&&(dt.history=this.history),(this.linked||(this.linked=[])).push({doc:dt,sharedHist:it.sharedHist}),dt.linked=[{doc:this,isParent:!0,sharedHist:it.sharedHist}],Kp(dt,lg(this)),dt},unlinkDoc:function(it){if(it instanceof Io&&(it=it.doc),this.linked)for(var st=0;st<this.linked.length;++st){var ft=this.linked[st];if(ft.doc==it){this.linked.splice(st,1),it.unlinkDoc(this),ug(lg(this));break}}if(it.history==this.history){var dt=[it.id];Sl(it,function(gt){return dt.push(gt.id)},!0),it.history=new Jh(null),it.history.done=eu(this.history.done,dt),it.history.undone=eu(this.history.undone,dt)}},iterLinkedDocs:function(it){Sl(this,it)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(it){return this.lineSep?it.split(this.lineSep):Je(it)},lineSeparator:function(){return this.lineSep||`
`},setDirection:as(function(it){it!="rtl"&&(it="ltr"),it!=this.direction&&(this.direction=it,this.iter(function(st){return st.order=null}),this.cm&&$0(this.cm))})}),ks.prototype.eachLine=ks.prototype.iter;var Kd=0;function hg(it){var st=this;if(Jp(st),!(Ji(st,it)||Ur(st.display,it))){rr(it),ye&&(Kd=+new Date);var ft=Zs(st,it,!0),dt=it.dataTransfer.files;if(!(!ft||st.isReadOnly()))if(dt&&dt.length&&window.FileReader&&window.File)for(var gt=dt.length,Pt=Array(gt),Tt=0,It=function(){++Tt==gt&&qr(st,function(){ft=ti(st.doc,ft);var Fe={from:ft,to:ft,text:st.doc.splitLines(Pt.filter(function(gn){return gn!=null}).join(st.doc.lineSeparator())),origin:"paste"};Au(st.doc,Fe),Yf(st.doc,tu(ti(st.doc,ft),ti(st.doc,Tu(Fe))))})()},Dt=function(Fe,gn){if(st.options.allowDropFileTypes&&He(st.options.allowDropFileTypes,Fe.type)==-1){It();return}var xn=new FileReader;xn.onerror=function(){return It()},xn.onload=function(){var Nn=xn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Nn)){It();return}Pt[gn]=Nn,It()},xn.readAsText(Fe)},Ut=0;Ut<dt.length;Ut++)Dt(dt[Ut],Ut);else{if(st.state.draggingText&&st.doc.sel.contains(ft)>-1){st.state.draggingText(it),setTimeout(function(){return st.display.input.focus()},20);return}try{var ce=it.dataTransfer.getData("Text");if(ce){var Xt;if(st.state.draggingText&&!st.state.draggingText.copy&&(Xt=st.listSelections()),ch(st.doc,tu(ft,ft)),Xt)for(var Re=0;Re<Xt.length;++Re)ph(st.doc,"",Xt[Re].anchor,Xt[Re].head,"drag");st.replaceSelection(ce,"around","paste"),st.display.input.focus()}}catch(Fe){}}}}function Xp(it,st){if(ye&&(!it.state.draggingText||+new Date-Kd<100)){jo(st);return}if(!(Ji(it,st)||Ur(it.display,st))&&(st.dataTransfer.setData("Text",it.getSelection()),st.dataTransfer.effectAllowed="copyMove",st.dataTransfer.setDragImage&&!Ye)){var ft=re("img",null,null,"position: fixed; left: 0; top: 0;");ft.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",we&&(ft.width=ft.height=1,it.display.wrapper.appendChild(ft),ft._top=ft.offsetTop),st.dataTransfer.setDragImage(ft,0,0),we&&ft.parentNode.removeChild(ft)}}function Zp(it,st){var ft=Zs(it,st);if(ft){var dt=document.createDocumentFragment();No(it,ft,dt),it.display.dragCursor||(it.display.dragCursor=re("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),it.display.lineSpace.insertBefore(it.display.dragCursor,it.display.cursorDiv)),le(it.display.dragCursor,dt)}}function Jp(it){it.display.dragCursor&&(it.display.lineSpace.removeChild(it.display.dragCursor),it.display.dragCursor=null)}function Qp(it){if(document.getElementsByClassName){for(var st=document.getElementsByClassName("CodeMirror"),ft=[],dt=0;dt<st.length;dt++){var gt=st[dt].CodeMirror;gt&&ft.push(gt)}ft.length&&ft[0].operation(function(){for(var Pt=0;Pt<ft.length;Pt++)it(ft[Pt])})}}var dg=!1;function Ia(){dg||(ed(),dg=!0)}function ed(){var it;ri(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,Qp(fg)},100))}),ri(window,"blur",function(){return Qp(sh)})}function fg(it){var st=it.display;st.cachedCharWidth=st.cachedTextHeight=st.cachedPaddingH=null,st.scrollbarsClipped=!1,it.setSize()}for(var Dl={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Xd=0;Xd<10;Xd++)Dl[Xd+48]=Dl[Xd+96]=String(Xd);for(var Xf=65;Xf<=90;Xf++)Dl[Xf]=String.fromCharCode(Xf);for(var Zd=1;Zd<=12;Zd++)Dl[Zd+111]=Dl[Zd+63235]="F"+Zd;var wa={};wa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},wa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},wa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},wa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},wa.default=ht?wa.macDefault:wa.pcDefault;function cg(it){var st=it.split(/-(?!$)/);it=st[st.length-1];for(var ft,dt,gt,Pt,Tt=0;Tt<st.length-1;Tt++){var It=st[Tt];if(/^(cmd|meta|m)$/i.test(It))Pt=!0;else if(/^a(lt)?$/i.test(It))ft=!0;else if(/^(c|ctrl|control)$/i.test(It))dt=!0;else if(/^s(hift)?$/i.test(It))gt=!0;else throw new Error("Unrecognized modifier name: "+It)}return ft&&(it="Alt-"+it),dt&&(it="Ctrl-"+it),Pt&&(it="Cmd-"+it),gt&&(it="Shift-"+it),it}function gg(it){var st={};for(var ft in it)if(it.hasOwnProperty(ft)){var dt=it[ft];if(/^(name|fallthrough|(de|at)tach)$/.test(ft))continue;if(dt=="..."){delete it[ft];continue}for(var gt=hn(ft.split(" "),cg),Pt=0;Pt<gt.length;Pt++){var Tt=void 0,It=void 0;Pt==gt.length-1?(It=gt.join(" "),Tt=dt):(It=gt.slice(0,Pt+1).join(" "),Tt="...");var Dt=st[It];if(!Dt)st[It]=Tt;else if(Dt!=Tt)throw new Error("Inconsistent bindings for "+It)}delete it[ft]}for(var Ut in st)it[Ut]=st[Ut];return it}function Xa(it,st,ft,dt){st=yh(st);var gt=st.call?st.call(it,dt):st[it];if(gt===!1)return"nothing";if(gt==="...")return"multi";if(gt!=null&&ft(gt))return"handled";if(st.fallthrough){if(Object.prototype.toString.call(st.fallthrough)!="[object Array]")return Xa(it,st.fallthrough,ft,dt);for(var Pt=0;Pt<st.fallthrough.length;Pt++){var Tt=Xa(it,st.fallthrough[Pt],ft,dt);if(Tt)return Tt}}}function nd(it){var st=typeof it=="string"?it:Dl[it.keyCode];return st=="Ctrl"||st=="Alt"||st=="Shift"||st=="Mod"}function pg(it,st,ft){var dt=it;return st.altKey&&dt!="Alt"&&(it="Alt-"+it),(kt?st.metaKey:st.ctrlKey)&&dt!="Ctrl"&&(it="Ctrl-"+it),(kt?st.ctrlKey:st.metaKey)&&dt!="Mod"&&(it="Cmd-"+it),!ft&&st.shiftKey&&dt!="Shift"&&(it="Shift-"+it),it}function qp(it,st){if(we&&it.keyCode==34&&it.char)return!1;var ft=Dl[it.keyCode];return ft==null||it.altGraphKey?!1:(it.keyCode==3&&it.code&&(ft=it.code),pg(ft,it,st))}function yh(it){return typeof it=="string"?wa[it]:it}function Ca(it,st){for(var ft=it.doc.sel.ranges,dt=[],gt=0;gt<ft.length;gt++){for(var Pt=st(ft[gt]);dt.length&&jn(Pt.from,Ae(dt).to)<=0;){var Tt=dt.pop();if(jn(Tt.from,Pt.from)<0){Pt.from=Tt.from;break}}dt.push(Pt)}_o(it,function(){for(var It=dt.length-1;It>=0;It--)ph(it.doc,"",dt[It].from,dt[It].to,"+delete");ql(it)})}function mg(it,st,ft){var dt=pi(it.text,st+ft,ft);return dt<0||dt>it.text.length?null:dt}function _r(it,st,ft){var dt=mg(it,st.ch,ft);return dt==null?null:new Ve(st.line,dt,ft<0?"after":"before")}function Jd(it,st,ft,dt,gt){if(it){st.doc.direction=="rtl"&&(gt=-gt);var Pt=ai(ft,st.doc.direction);if(Pt){var Tt=gt<0?Ae(Pt):Pt[0],It=gt<0==(Tt.level==1),Dt=It?"after":"before",Ut;if(Tt.level>0||st.doc.direction=="rtl"){var ce=yu(st,ft);Ut=gt<0?ft.text.length-1:0;var Xt=rl(st,ce,Ut).top;Ut=Gn(function(Re){return rl(st,ce,Re).top==Xt},gt<0==(Tt.level==1)?Tt.from:Tt.to-1,Ut),Dt=="before"&&(Ut=mg(ft,Ut,1))}else Ut=gt<0?Tt.to:Tt.from;return new Ve(dt,Ut,Dt)}}return new Ve(dt,gt<0?ft.text.length:0,gt<0?"before":"after")}function Zf(it,st,ft,dt){var gt=ai(st,it.doc.direction);if(!gt)return _r(st,ft,dt);ft.ch>=st.text.length?(ft.ch=st.text.length,ft.sticky="before"):ft.ch<=0&&(ft.ch=0,ft.sticky="after");var Pt=Pn(gt,ft.ch,ft.sticky),Tt=gt[Pt];if(it.doc.direction=="ltr"&&Tt.level%2==0&&(dt>0?Tt.to>ft.ch:Tt.from<ft.ch))return _r(st,ft,dt);var It=function(Qn,wi){return mg(st,Qn instanceof Ve?Qn.ch:Qn,wi)},Dt,Ut=function(Qn){return it.options.lineWrapping?(Dt=Dt||yu(it,st),Jc(it,st,Dt,Qn)):{begin:0,end:st.text.length}},ce=Ut(ft.sticky=="before"?It(ft,-1):ft.ch);if(it.doc.direction=="rtl"||Tt.level==1){var Xt=Tt.level==1==dt<0,Re=It(ft,Xt?1:-1);if(Re!=null&&(Xt?Re<=Tt.to&&Re<=ce.end:Re>=Tt.from&&Re>=ce.begin)){var Fe=Xt?"before":"after";return new Ve(ft.line,Re,Fe)}}var gn=function(Qn,wi,si){for(var Ei=function(mr,ts){return ts?new Ve(ft.line,It(mr,1),"before"):new Ve(ft.line,mr,"after")};Qn>=0&&Qn<gt.length;Qn+=wi){var $i=gt[Qn],ii=wi>0==($i.level!=1),ho=ii?si.begin:It(si.end,-1);if($i.from<=ho&&ho<$i.to||(ho=ii?$i.from:It($i.to,-1),si.begin<=ho&&ho<si.end))return Ei(ho,ii)}},xn=gn(Pt+dt,dt,ce);if(xn)return xn;var Nn=dt>0?ce.end:It(ce.begin,-1);return Nn!=null&&!(dt>0&&Nn==st.text.length)&&(xn=gn(dt>0?0:gt.length-1,dt,Ut(Nn)),xn)?xn:null}var Bu={selectAll:zr,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),Te)},killLine:function(it){return Ca(it,function(st){if(st.empty()){var ft=Ze(it.doc,st.head.line).text.length;return st.head.ch==ft&&st.head.line<it.lastLine()?{from:st.head,to:Ve(st.head.line+1,0)}:{from:st.head,to:Ve(st.head.line,ft)}}else return{from:st.from(),to:st.to()}})},deleteLine:function(it){return Ca(it,function(st){return{from:Ve(st.from().line,0),to:ti(it.doc,Ve(st.to().line+1,0))}})},delLineLeft:function(it){return Ca(it,function(st){return{from:Ve(st.from().line,0),to:st.from()}})},delWrappedLineLeft:function(it){return Ca(it,function(st){var ft=it.charCoords(st.head,"div").top+5,dt=it.coordsChar({left:0,top:ft},"div");return{from:dt,to:st.from()}})},delWrappedLineRight:function(it){return Ca(it,function(st){var ft=it.charCoords(st.head,"div").top+5,dt=it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ft},"div");return{from:st.from(),to:dt}})},undo:function(it){return it.undo()},redo:function(it){return it.redo()},undoSelection:function(it){return it.undoSelection()},redoSelection:function(it){return it.redoSelection()},goDocStart:function(it){return it.extendSelection(Ve(it.firstLine(),0))},goDocEnd:function(it){return it.extendSelection(Ve(it.lastLine()))},goLineStart:function(it){return it.extendSelectionsBy(function(st){return id(it,st.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(it){return it.extendSelectionsBy(function(st){return vg(it,st.head)},{origin:"+move",bias:1})},goLineEnd:function(it){return it.extendSelectionsBy(function(st){return od(it,st.head.line)},{origin:"+move",bias:-1})},goLineRight:function(it){return it.extendSelectionsBy(function(st){var ft=it.cursorCoords(st.head,"div").top+5;return it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ft},"div")},pn)},goLineLeft:function(it){return it.extendSelectionsBy(function(st){var ft=it.cursorCoords(st.head,"div").top+5;return it.coordsChar({left:0,top:ft},"div")},pn)},goLineLeftSmart:function(it){return it.extendSelectionsBy(function(st){var ft=it.cursorCoords(st.head,"div").top+5,dt=it.coordsChar({left:0,top:ft},"div");return dt.ch<it.getLine(dt.line).search(/\S/)?vg(it,st.head):dt},pn)},goLineUp:function(it){return it.moveV(-1,"line")},goLineDown:function(it){return it.moveV(1,"line")},goPageUp:function(it){return it.moveV(-1,"page")},goPageDown:function(it){return it.moveV(1,"page")},goCharLeft:function(it){return it.moveH(-1,"char")},goCharRight:function(it){return it.moveH(1,"char")},goColumnLeft:function(it){return it.moveH(-1,"column")},goColumnRight:function(it){return it.moveH(1,"column")},goWordLeft:function(it){return it.moveH(-1,"word")},goGroupRight:function(it){return it.moveH(1,"group")},goGroupLeft:function(it){return it.moveH(-1,"group")},goWordRight:function(it){return it.moveH(1,"word")},delCharBefore:function(it){return it.deleteH(-1,"codepoint")},delCharAfter:function(it){return it.deleteH(1,"char")},delWordBefore:function(it){return it.deleteH(-1,"word")},delWordAfter:function(it){return it.deleteH(1,"word")},delGroupBefore:function(it){return it.deleteH(-1,"group")},delGroupAfter:function(it){return it.deleteH(1,"group")},indentAuto:function(it){return it.indentSelection("smart")},indentMore:function(it){return it.indentSelection("add")},indentLess:function(it){return it.indentSelection("subtract")},insertTab:function(it){return it.replaceSelection(" ")},insertSoftTab:function(it){for(var st=[],ft=it.listSelections(),dt=it.options.tabSize,gt=0;gt<ft.length;gt++){var Pt=ft[gt].from(),Tt=Qt(it.getLine(Pt.line),Pt.ch,dt);st.push(he(dt-Tt%dt))}it.replaceSelections(st)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return _o(it,function(){for(var st=it.listSelections(),ft=[],dt=0;dt<st.length;dt++)if(st[dt].empty()){var gt=st[dt].head,Pt=Ze(it.doc,gt.line).text;if(Pt){if(gt.ch==Pt.length&&(gt=new Ve(gt.line,gt.ch-1)),gt.ch>0)gt=new Ve(gt.line,gt.ch+1),it.replaceRange(Pt.charAt(gt.ch-1)+Pt.charAt(gt.ch-2),Ve(gt.line,gt.ch-2),gt,"+transpose");else if(gt.line>it.doc.first){var Tt=Ze(it.doc,gt.line-1).text;Tt&&(gt=new Ve(gt.line,1),it.replaceRange(Pt.charAt(0)+it.doc.lineSeparator()+Tt.charAt(Tt.length-1),Ve(gt.line-1,Tt.length-1),gt,"+transpose"))}}ft.push(new Zo(gt,gt))}it.setSelections(ft)})},newlineAndIndent:function(it){return _o(it,function(){for(var st=it.listSelections(),ft=st.length-1;ft>=0;ft--)it.replaceRange(it.doc.lineSeparator(),st[ft].anchor,st[ft].head,"+input");st=it.listSelections();for(var dt=0;dt<st.length;dt++)it.indentLine(st[dt].from().line,null,!0);ql(it)})},openLine:function(it){return it.replaceSelection(`
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function id(it,st){var ft=Ze(it.doc,st),dt=Pi(ft);return dt!=ft&&(st=de(dt)),Jd(!0,it,dt,st,1)}function od(it,st){var ft=Ze(it.doc,st),dt=Ui(ft);return dt!=ft&&(st=de(dt)),Jd(!0,it,ft,st,-1)}function vg(it,st){var ft=id(it,st.line),dt=Ze(it.doc,ft.line),gt=ai(dt,it.doc.direction);if(!gt||gt[0].level==0){var Pt=Math.max(ft.ch,dt.text.search(/\S/)),Tt=st.line==ft.line&&st.ch<=Pt&&st.ch;return Ve(ft.line,Tt?0:Pt,ft.sticky)}return ft}function rd(it,st,ft){if(typeof st=="string"&&(st=Bu[st],!st))return!1;it.display.input.ensurePolled();var dt=it.display.shift,gt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),ft&&(it.display.shift=!1),gt=st(it)!=Fn}finally{it.display.shift=dt,it.state.suppressEdits=!1}return gt}function yg(it,st,ft){for(var dt=0;dt<it.state.keyMaps.length;dt++){var gt=Xa(st,it.state.keyMaps[dt],ft,it);if(gt)return gt}return it.options.extraKeys&&Xa(st,it.options.extraKeys,ft,it)||Xa(st,it.options.keyMap,ft,it)}var Ol=new zt;function Sh(it,st,ft,dt){var gt=it.state.keySeq;if(gt){if(nd(st))return"handled";if(/\'$/.test(st)?it.state.keySeq=null:Ol.set(50,function(){it.state.keySeq==gt&&(it.state.keySeq=null,it.display.input.reset())}),Jf(it,gt+" "+st,ft,dt))return!0}return Jf(it,st,ft,dt)}function Jf(it,st,ft,dt){var gt=yg(it,st,dt);return gt=="multi"&&(it.state.keySeq=st),gt=="handled"&&On(it,"keyHandled",it,st,ft),(gt=="handled"||gt=="multi")&&(rr(ft),Ko(it)),!!gt}function Qf(it,st){var ft=qp(st,!0);return ft?st.shiftKey&&!it.state.keySeq?Sh(it,"Shift-"+ft,st,function(dt){return rd(it,dt,!0)})||Sh(it,ft,st,function(dt){if(typeof dt=="string"?/^go[A-Z]/.test(dt):dt.motion)return rd(it,dt)}):Sh(it,ft,st,function(dt){return rd(it,dt)}):!1}function qf(it,st,ft){return Sh(it,"'"+ft+"'",st,function(dt){return rd(it,dt,!0)})}var xh=null;function Sg(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&(st.curOp.focus=an(),!Ji(st,it))){ye&&oe<11&&it.keyCode==27&&(it.returnValue=!1);var ft=it.keyCode;st.display.shift=ft==16||it.shiftKey;var dt=Qf(st,it);we&&(xh=dt?ft:null,!dt&&ft==88&&!en&&(ht?it.metaKey:it.ctrlKey)&&st.replaceSelection("",null,"cut")),wt&&!ht&&!dt&&ft==46&&it.shiftKey&&!it.ctrlKey&&document.execCommand&&document.execCommand("cut"),ft==18&&!/\bCodeMirror-crosshair\b/.test(st.display.lineDiv.className)&&xg(st)}}function xg(it){var st=it.display.lineDiv;nn(st,"CodeMirror-crosshair");function ft(dt){(dt.keyCode==18||!dt.altKey)&&(Zt(st,"CodeMirror-crosshair"),Ro(document,"keyup",ft),Ro(document,"mouseover",ft))}ri(document,"keyup",ft),ri(document,"mouseover",ft)}function Pg(it){it.keyCode==16&&(this.doc.sel.shift=!1),Ji(this,it)}function xl(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&!(Ur(st.display,it)||Ji(st,it)||it.ctrlKey&&!it.altKey||ht&&it.metaKey)){var ft=it.keyCode,dt=it.charCode;if(we&&ft==xh){xh=null,rr(it);return}if(!(we&&(!it.which||it.which<10)&&Qf(st,it))){var gt=String.fromCharCode(dt==null?ft:dt);gt!="\b"&&(qf(st,it,gt)||st.display.input.onKeyPress(it))}}}var $p=400,wg=function(it,st,ft){this.time=it,this.pos=st,this.button=ft};wg.prototype.compare=function(it,st,ft){return this.time+$p>it&&jn(st,this.pos)==0&&ft==this.button};var sd,Ph;function Cg(it,st){var ft=+new Date;return Ph&&Ph.compare(ft,it,st)?(sd=Ph=null,"triple"):sd&&sd.compare(ft,it,st)?(Ph=new wg(ft,it,st),sd=null,"double"):(sd=new wg(ft,it,st),Ph=null,"single")}function Pl(it){var st=this,ft=st.display;if(!(Ji(st,it)||ft.activeTouch&&ft.input.supportsTouch())){if(ft.input.ensurePolled(),ft.shift=it.shiftKey,Ur(ft,it)){Yt||(ft.scroller.draggable=!1,setTimeout(function(){return ft.scroller.draggable=!0},100));return}if(!ec(st,it)){var dt=Zs(st,it),gt=ws(it),Pt=dt?Cg(dt,gt):"single";window.focus(),gt==1&&st.state.selectingText&&st.state.selectingText(it),!(dt&&Lg(st,gt,dt,Pt,it))&&(gt==1?dt?tm(st,dt,Pt,it):As(it)==ft.scroller&&rr(it):gt==2?(dt&&Vf(st.doc,dt),setTimeout(function(){return ft.input.focus()},20)):gt==3&&(Et?st.display.input.onContextMenu(it):xr(st)))}}}function Lg(it,st,ft,dt,gt){var Pt="Click";return dt=="double"?Pt="Double"+Pt:dt=="triple"&&(Pt="Triple"+Pt),Pt=(st==1?"Left":st==2?"Middle":"Right")+Pt,Sh(it,pg(Pt,gt),gt,function(Tt){if(typeof Tt=="string"&&(Tt=Bu[Tt]),!Tt)return!1;var It=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),It=Tt(it,ft)!=Fn}finally{it.state.suppressEdits=!1}return It})}function $f(it,st,ft){var dt=it.getOption("configureMouse"),gt=dt?dt(it,st,ft):{};if(gt.unit==null){var Pt=lt?ft.shiftKey&&ft.metaKey:ft.altKey;gt.unit=Pt?"rectangle":st=="single"?"char":st=="double"?"word":"line"}return(gt.extend==null||it.doc.extend)&&(gt.extend=it.doc.extend||ft.shiftKey),gt.addNew==null&&(gt.addNew=ht?ft.metaKey:ft.ctrlKey),gt.moveOnDrag==null&&(gt.moveOnDrag=!(ht?ft.altKey:ft.ctrlKey)),gt}function tm(it,st,ft,dt){ye?setTimeout(Bi(ar,it),0):it.curOp.focus=an();var gt=$f(it,ft,dt),Pt=it.doc.sel,Tt;it.options.dragDrop&&Ws&&!it.isReadOnly()&&ft=="single"&&(Tt=Pt.contains(st))>-1&&(jn((Tt=Pt.ranges[Tt]).from(),st)<0||st.xRel>0)&&(jn(Tt.to(),st)>0||st.xRel<0)?kg(it,dt,st,gt):ev(it,dt,st,gt)}function kg(it,st,ft,dt){var gt=it.display,Pt=!1,Tt=qr(it,function(Ut){Yt&&(gt.scroller.draggable=!1),it.state.draggingText=!1,Ro(gt.wrapper.ownerDocument,"mouseup",Tt),Ro(gt.wrapper.ownerDocument,"mousemove",It),Ro(gt.scroller,"dragstart",Dt),Ro(gt.scroller,"drop",Tt),Pt||(rr(Ut),dt.addNew||Vf(it.doc,ft,null,null,dt.extend),Yt&&!Ye||ye&&oe==9?setTimeout(function(){gt.wrapper.ownerDocument.body.focus({preventScroll:!0}),gt.input.focus()},20):gt.input.focus())}),It=function(Ut){Pt=Pt||Math.abs(st.clientX-Ut.clientX)+Math.abs(st.clientY-Ut.clientY)>=10},Dt=function(){return Pt=!0};Yt&&(gt.scroller.draggable=!0),it.state.draggingText=Tt,Tt.copy=!dt.moveOnDrag,gt.scroller.dragDrop&&gt.scroller.dragDrop(),ri(gt.wrapper.ownerDocument,"mouseup",Tt),ri(gt.wrapper.ownerDocument,"mousemove",It),ri(gt.scroller,"dragstart",Dt),ri(gt.scroller,"drop",Tt),xr(it),setTimeout(function(){return gt.input.focus()},20)}function Mg(it,st,ft){if(ft=="char")return new Zo(st,st);if(ft=="word")return it.findWordAt(st);if(ft=="line")return new Zo(Ve(st.line,0),ti(it.doc,Ve(st.line+1,0)));var dt=ft(it,st);return new Zo(dt.from,dt.to)}function ev(it,st,ft,dt){var gt=it.display,Pt=it.doc;rr(st);var Tt,It,Dt=Pt.sel,Ut=Dt.ranges;if(dt.addNew&&!dt.extend?(It=Pt.sel.contains(ft),It>-1?Tt=Ut[It]:Tt=new Zo(ft,ft)):(Tt=Pt.sel.primary(),It=Pt.sel.primIndex),dt.unit=="rectangle")dt.addNew||(Tt=new Zo(ft,ft)),ft=Zs(it,st,!0,!0),It=-1;else{var ce=Mg(it,ft,dt.unit);dt.extend?Tt=Uf(Tt,ce.anchor,ce.head,dt.extend):Tt=ce}dt.addNew?It==-1?(It=Ut.length,Is(Pt,sl(it,Ut.concat([Tt]),It),{scroll:!1,origin:"*mouse"})):Ut.length>1&&Ut[It].empty()&&dt.unit=="char"&&!dt.extend?(Is(Pt,sl(it,Ut.slice(0,It).concat(Ut.slice(It+1)),0),{scroll:!1,origin:"*mouse"}),Dt=Pt.sel):bu(Pt,It,Tt,ln):(It=0,Is(Pt,new Ya([Tt],0),ln),Dt=Pt.sel);var Xt=ft;function Re(si){if(jn(Xt,si)!=0)if(Xt=si,dt.unit=="rectangle"){for(var Ei=[],$i=it.options.tabSize,ii=Qt(Ze(Pt,ft.line).text,ft.ch,$i),ho=Qt(Ze(Pt,si.line).text,si.ch,$i),mr=Math.min(ii,ho),ts=Math.max(ii,ho),Mr=Math.min(ft.line,si.line),ha=Math.min(it.lastLine(),Math.max(ft.line,si.line));Mr<=ha;Mr++){var Rs=Ze(Pt,Mr).text,Yr=ni(Rs,mr,$i);mr==ts?Ei.push(new Zo(Ve(Mr,Yr),Ve(Mr,Yr))):Rs.length>Yr&&Ei.push(new Zo(Ve(Mr,Yr),Ve(Mr,ni(Rs,ts,$i))))}Ei.length||Ei.push(new Zo(ft,ft)),Is(Pt,sl(it,Dt.ranges.slice(0,It).concat(Ei),It),{origin:"*mouse",scroll:!1}),it.scrollIntoView(si)}else{var La=Tt,Ms=Mg(it,si,dt.unit),Kr=La.anchor,zo;jn(Ms.anchor,Kr)>0?(zo=Ms.head,Kr=Un(La.from(),Ms.anchor)):(zo=Ms.anchor,Kr=fo(La.to(),Ms.head));var Tr=Dt.ranges.slice(0);Tr[It]=em(it,new Zo(ti(Pt,Kr),zo)),Is(Pt,sl(it,Tr,It),ln)}}var Fe=gt.wrapper.getBoundingClientRect(),gn=0;function xn(si){var Ei=++gn,$i=Zs(it,si,!0,dt.unit=="rectangle");if($i)if(jn($i,Xt)!=0){it.curOp.focus=an(),Re($i);var ii=ko(gt,Pt);($i.line>=ii.to||$i.line<ii.from)&&setTimeout(qr(it,function(){gn==Ei&&xn(si)}),150)}else{var ho=si.clientY<Fe.top?-20:si.clientY>Fe.bottom?20:0;ho&&setTimeout(qr(it,function(){gn==Ei&&(gt.scroller.scrollTop+=ho,xn(si))}),50)}}function Nn(si){it.state.selectingText=!1,gn=1/0,si&&(rr(si),gt.input.focus()),Ro(gt.wrapper.ownerDocument,"mousemove",Qn),Ro(gt.wrapper.ownerDocument,"mouseup",wi),Pt.history.lastSelOrigin=null}var Qn=qr(it,function(si){si.buttons===0||!ws(si)?Nn(si):xn(si)}),wi=qr(it,Nn);it.state.selectingText=wi,ri(gt.wrapper.ownerDocument,"mousemove",Qn),ri(gt.wrapper.ownerDocument,"mouseup",wi)}function em(it,st){var ft=st.anchor,dt=st.head,gt=Ze(it.doc,ft.line);if(jn(ft,dt)==0&&ft.sticky==dt.sticky)return st;var Pt=ai(gt);if(!Pt)return st;var Tt=Pn(Pt,ft.ch,ft.sticky),It=Pt[Tt];if(It.from!=ft.ch&&It.to!=ft.ch)return st;var Dt=Tt+(It.from==ft.ch==(It.level!=1)?0:1);if(Dt==0||Dt==Pt.length)return st;var Ut;if(dt.line!=ft.line)Ut=(dt.line-ft.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var ce=Pn(Pt,dt.ch,dt.sticky),Xt=ce-Tt||(dt.ch-ft.ch)*(It.level==1?-1:1);ce==Dt-1||ce==Dt?Ut=Xt<0:Ut=Xt>0}var Re=Pt[Dt+(Ut?-1:0)],Fe=Ut==(Re.level==1),gn=Fe?Re.from:Re.to,xn=Fe?"after":"before";return ft.ch==gn&&ft.sticky==xn?st:new Zo(new Ve(ft.line,gn,xn),dt)}function tc(it,st,ft,dt){var gt,Pt;if(st.touches)gt=st.touches[0].clientX,Pt=st.touches[0].clientY;else try{gt=st.clientX,Pt=st.clientY}catch(Re){return!1}if(gt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;dt&&rr(st);var Tt=it.display,It=Tt.lineDiv.getBoundingClientRect();if(Pt>It.bottom||!Po(it,ft))return Ti(st);Pt-=It.top-Tt.viewOffset;for(var Dt=0;Dt<it.display.gutterSpecs.length;++Dt){var Ut=Tt.gutters.childNodes[Dt];if(Ut&&Ut.getBoundingClientRect().right>=gt){var ce=bn(it.doc,Pt),Xt=it.display.gutterSpecs[Dt];return mo(it,ft,it,ce,Xt.className,st),Ti(st)}}}function ec(it,st){return tc(it,st,"gutterClick",!0)}function nc(it,st){Ur(it.display,st)||nm(it,st)||Ji(it,st,"contextmenu")||Et||it.display.input.onContextMenu(st)}function nm(it,st){return Po(it,"gutterContextMenu")?tc(it,st,"gutterContextMenu",!1):!1}function ic(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Yh(it)}var Du={toString:function(){return"CodeMirror.Init"}},Eg={},Qd={};function im(it){var st=it.optionHandlers;function ft(dt,gt,Pt,Tt){it.defaults[dt]=gt,Pt&&(st[dt]=Tt?function(It,Dt,Ut){Ut!=Du&&Pt(It,Dt,Ut)}:Pt)}it.defineOption=ft,it.Init=Du,ft("value","",function(dt,gt){return dt.setValue(gt)},!0),ft("mode",null,function(dt,gt){dt.doc.modeOption=gt,uo(dt)},!0),ft("indentUnit",2,uo,!0),ft("indentWithTabs",!1),ft("smartIndent",!0),ft("tabSize",4,function(dt){Rd(dt),Yh(dt),pr(dt)},!0),ft("lineSeparator",null,function(dt,gt){if(dt.doc.lineSep=gt,!!gt){var Pt=[],Tt=dt.doc.first;dt.doc.iter(function(Dt){for(var Ut=0;;){var ce=Dt.text.indexOf(gt,Ut);if(ce==-1)break;Ut=ce+gt.length,Pt.push(Ve(Tt,ce))}Tt++});for(var It=Pt.length-1;It>=0;It--)ph(dt.doc,gt,Pt[It],Ve(Pt[It].line,Pt[It].ch+gt.length))}}),ft("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(dt,gt,Pt){dt.state.specialChars=new RegExp(gt.source+(gt.test(" ")?"":"| "),"g"),Pt!=Du&&dt.refresh()}),ft("specialCharPlaceholder",Br,function(dt){return dt.refresh()},!0),ft("electricChars",!0),ft("inputStyle",nt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ft("spellcheck",!1,function(dt,gt){return dt.getInputField().spellcheck=gt},!0),ft("autocorrect",!1,function(dt,gt){return dt.getInputField().autocorrect=gt},!0),ft("autocapitalize",!1,function(dt,gt){return dt.getInputField().autocapitalize=gt},!0),ft("rtlMoveVisually",!pt),ft("wholeLineUpdateBefore",!0),ft("theme","default",function(dt){ic(dt),Da(dt)},!0),ft("keyMap","default",function(dt,gt,Pt){var Tt=yh(gt),It=Pt!=Du&&yh(Pt);It&&It.detach&&It.detach(dt,Tt),Tt.attach&&Tt.attach(dt,It||null)}),ft("extraKeys",null),ft("configureMouse",null),ft("lineWrapping",!1,om,!0),ft("gutters",[],function(dt,gt){dt.display.gutterSpecs=us(gt,dt.options.lineNumbers),Da(dt)},!0),ft("fixedGutter",!0,function(dt,gt){dt.display.gutters.style.left=gt?Bd(dt.display)+"px":"0",dt.refresh()},!0),ft("coverGutterNextToScrollbar",!1,function(dt){return Pu(dt)},!0),ft("scrollbarStyle","native",function(dt){tg(dt),Pu(dt),dt.display.scrollbars.setScrollTop(dt.doc.scrollTop),dt.display.scrollbars.setScrollLeft(dt.doc.scrollLeft)},!0),ft("lineNumbers",!1,function(dt,gt){dt.display.gutterSpecs=us(dt.options.gutters,gt),Da(dt)},!0),ft("firstLineNumber",1,Da,!0),ft("lineNumberFormatter",function(dt){return dt},Da,!0),ft("showCursorWhenSelecting",!1,Qr,!0),ft("resetSelectionOnContextMenu",!0),ft("lineWiseCopyCut",!0),ft("pasteLinesPerSelection",!0),ft("selectionsMayTouch",!1),ft("readOnly",!1,function(dt,gt){gt=="nocursor"&&(sh(dt),dt.display.input.blur()),dt.display.input.readOnlyChanged(gt)}),ft("screenReaderLabel",null,function(dt,gt){gt=gt===""?null:gt,dt.display.input.screenReaderLabelChanged(gt)}),ft("disableInput",!1,function(dt,gt){gt||dt.display.input.reset()},!0),ft("dragDrop",!0,oc),ft("allowDropFileTypes",null),ft("cursorBlinkRate",530),ft("cursorScrollMargin",0),ft("cursorHeight",1,Qr,!0),ft("singleCursorHeightPerLine",!0,Qr,!0),ft("workTime",100),ft("workDelay",100),ft("flattenSpans",!0,Rd,!0),ft("addModeClass",!1,Rd,!0),ft("pollInterval",100),ft("undoDepth",200,function(dt,gt){return dt.doc.history.undoDepth=gt}),ft("historyEventDelay",1250),ft("viewportMargin",10,function(dt){return dt.refresh()},!0),ft("maxHighlightLength",1e4,Rd,!0),ft("moveInputWithCursor",!0,function(dt,gt){gt||dt.display.input.resetPosition()}),ft("tabindex",null,function(dt,gt){return dt.display.input.getField().tabIndex=gt||""}),ft("autofocus",null),ft("direction","ltr",function(dt,gt){return dt.doc.setDirection(gt)},!0),ft("phrases",null)}function oc(it,st,ft){var dt=ft&&ft!=Du;if(!st!=!dt){var gt=it.display.dragFunctions,Pt=st?ri:Ro;Pt(it.display.scroller,"dragstart",gt.start),Pt(it.display.scroller,"dragenter",gt.enter),Pt(it.display.scroller,"dragover",gt.over),Pt(it.display.scroller,"dragleave",gt.leave),Pt(it.display.scroller,"drop",gt.drop)}}function om(it){it.options.lineWrapping?(nn(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(Zt(it.display.wrapper,"CodeMirror-wrap"),vo(it)),Oi(it),pr(it),Yh(it),setTimeout(function(){return Pu(it)},100)}function Io(it,st){var ft=this;if(!(this instanceof Io))return new Io(it,st);this.options=st=st?so(st):{},so(Eg,st,!1);var dt=st.value;typeof dt=="string"?dt=new ks(dt,st.mode,null,st.lineSeparator,st.direction):st.mode&&(dt.modeOption=st.mode),this.doc=dt;var gt=new Io.inputStyles[st.inputStyle](this),Pt=this.display=new Nu(it,dt,gt,st);Pt.wrapper.CodeMirror=this,ic(this),st.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),tg(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new zt,keySeq:null,specialChars:null},st.autofocus&&!nt&&Pt.input.focus(),ye&&oe<11&&setTimeout(function(){return ft.display.input.reset(!0)},20),ad(this),Ia(),wu(this),this.curOp.forceUpdate=!0,Gf(this,dt),st.autofocus&&!nt||this.hasFocus()?setTimeout(function(){ft.hasFocus()&&!ft.state.focused&&Fo(ft)},20):sh(this);for(var Tt in Qd)Qd.hasOwnProperty(Tt)&&Qd[Tt](this,st[Tt],Du);Hr(this),st.finishInit&&st.finishInit(this);for(var It=0;It<wh.length;++It)wh[It](this);Cu(this),Yt&&st.lineWrapping&&getComputedStyle(Pt.lineDiv).textRendering=="optimizelegibility"&&(Pt.lineDiv.style.textRendering="auto")}Io.defaults=Eg,Io.optionHandlers=Qd;function ad(it){var st=it.display;ri(st.scroller,"mousedown",qr(it,Pl)),ye&&oe<11?ri(st.scroller,"dblclick",qr(it,function(Dt){if(!Ji(it,Dt)){var Ut=Zs(it,Dt);if(!(!Ut||ec(it,Dt)||Ur(it.display,Dt))){rr(Dt);var ce=it.findWordAt(Ut);Vf(it.doc,ce.anchor,ce.head)}}})):ri(st.scroller,"dblclick",function(Dt){return Ji(it,Dt)||rr(Dt)}),ri(st.scroller,"contextmenu",function(Dt){return nc(it,Dt)}),ri(st.input.getField(),"contextmenu",function(Dt){st.scroller.contains(Dt.target)||nc(it,Dt)});var ft,dt={end:0};function gt(){st.activeTouch&&(ft=setTimeout(function(){return st.activeTouch=null},1e3),dt=st.activeTouch,dt.end=+new Date)}function Pt(Dt){if(Dt.touches.length!=1)return!1;var Ut=Dt.touches[0];return Ut.radiusX<=1&&Ut.radiusY<=1}function Tt(Dt,Ut){if(Ut.left==null)return!0;var ce=Ut.left-Dt.left,Xt=Ut.top-Dt.top;return ce*ce+Xt*Xt>20*20}ri(st.scroller,"touchstart",function(Dt){if(!Ji(it,Dt)&&!Pt(Dt)&&!ec(it,Dt)){st.input.ensurePolled(),clearTimeout(ft);var Ut=+new Date;st.activeTouch={start:Ut,moved:!1,prev:Ut-dt.end<=300?dt:null},Dt.touches.length==1&&(st.activeTouch.left=Dt.touches[0].pageX,st.activeTouch.top=Dt.touches[0].pageY)}}),ri(st.scroller,"touchmove",function(){st.activeTouch&&(st.activeTouch.moved=!0)}),ri(st.scroller,"touchend",function(Dt){var Ut=st.activeTouch;if(Ut&&!Ur(st,Dt)&&Ut.left!=null&&!Ut.moved&&new Date-Ut.start<300){var ce=it.coordsChar(st.activeTouch,"page"),Xt;!Ut.prev||Tt(Ut,Ut.prev)?Xt=new Zo(ce,ce):!Ut.prev.prev||Tt(Ut,Ut.prev.prev)?Xt=it.findWordAt(ce):Xt=new Zo(Ve(ce.line,0),ti(it.doc,Ve(ce.line+1,0))),it.setSelection(Xt.anchor,Xt.head),it.focus(),rr(Dt)}gt()}),ri(st.scroller,"touchcancel",gt),ri(st.scroller,"scroll",function(){st.scroller.clientHeight&&(lh(it,st.scroller.scrollTop),$l(it,st.scroller.scrollLeft,!0),mo(it,"scroll",it))}),ri(st.scroller,"mousewheel",function(Dt){return hs(it,Dt)}),ri(st.scroller,"DOMMouseScroll",function(Dt){return hs(it,Dt)}),ri(st.wrapper,"scroll",function(){return st.wrapper.scrollTop=st.wrapper.scrollLeft=0}),st.dragFunctions={enter:function(Dt){Ji(it,Dt)||jo(Dt)},over:function(Dt){Ji(it,Dt)||(Zp(it,Dt),jo(Dt))},start:function(Dt){return Xp(it,Dt)},drop:qr(it,hg),leave:function(Dt){Ji(it,Dt)||Jp(it)}};var It=st.input.getField();ri(It,"keyup",function(Dt){return Pg.call(it,Dt)}),ri(It,"keydown",qr(it,Sg)),ri(It,"keypress",qr(it,xl)),ri(It,"focus",function(Dt){return Fo(it,Dt)}),ri(It,"blur",function(Dt){return sh(it,Dt)})}var wh=[];Io.defineInitHook=function(it){return wh.push(it)};function $r(it,st,ft,dt){var gt=it.doc,Pt;ft==null&&(ft="add"),ft=="smart"&&(gt.mode.indent?Pt=zi(it,st).state:ft="prev");var Tt=it.options.tabSize,It=Ze(gt,st),Dt=Qt(It.text,null,Tt);It.stateAfter&&(It.stateAfter=null);var Ut=It.text.match(/^\s*/)[0],ce;if(!dt&&!/\S/.test(It.text))ce=0,ft="not";else if(ft=="smart"&&(ce=gt.mode.indent(Pt,It.text.slice(Ut.length),It.text),ce==Fn||ce>150)){if(!dt)return;ft="prev"}ft=="prev"?st>gt.first?ce=Qt(Ze(gt,st-1).text,null,Tt):ce=0:ft=="add"?ce=Dt+it.options.indentUnit:ft=="subtract"?ce=Dt-it.options.indentUnit:typeof ft=="number"&&(ce=Dt+ft),ce=Math.max(0,ce);var Xt="",Re=0;if(it.options.indentWithTabs)for(var Fe=Math.floor(ce/Tt);Fe;--Fe)Re+=Tt,Xt+=" ";if(Re<ce&&(Xt+=he(ce-Re)),Xt!=Ut)return ph(gt,Xt,Ve(st,0),Ve(st,Ut.length),"+input"),It.stateAfter=null,!0;for(var gn=0;gn<gt.sel.ranges.length;gn++){var xn=gt.sel.ranges[gn];if(xn.head.line==st&&xn.head.ch<Ut.length){var Nn=Ve(st,Ut.length);bu(gt,gn,new Zo(Nn,Nn));break}}}var ua=null;function Ch(it){ua=it}function qd(it,st,ft,dt,gt){var Pt=it.doc;it.display.shift=!1,dt||(dt=Pt.sel);var Tt=+new Date-200,It=gt=="paste"||it.state.pasteIncoming>Tt,Dt=Je(st),Ut=null;if(It&&dt.ranges.length>1)if(ua&&ua.text.join(`
`)==st){if(dt.ranges.length%ua.text.length==0){Ut=[];for(var ce=0;ce<ua.text.length;ce++)Ut.push(Pt.splitLines(ua.text[ce]))}}else Dt.length==dt.ranges.length&&it.options.pasteLinesPerSelection&&(Ut=hn(Dt,function(Qn){return[Qn]}));for(var Xt=it.curOp.updateInput,Re=dt.ranges.length-1;Re>=0;Re--){var Fe=dt.ranges[Re],gn=Fe.from(),xn=Fe.to();Fe.empty()&&(ft&&ft>0?gn=Ve(gn.line,gn.ch-ft):it.state.overwrite&&!It?xn=Ve(xn.line,Math.min(Ze(Pt,xn.line).text.length,xn.ch+Ae(Dt).length)):It&&ua&&ua.lineWise&&ua.text.join(`
`)==Dt.join(`
`)&&(gn=xn=Ve(gn.line,0)));var Nn={from:gn,to:xn,text:Ut?Ut[Re%Ut.length]:Dt,origin:gt||(It?"paste":it.state.cutIncoming>Tt?"cut":"+input")};Au(it.doc,Nn),On(it,"inputRead",it,Nn)}st&&!It&&Tg(it,st),ql(it),it.curOp.updateInput<2&&(it.curOp.updateInput=Xt),it.curOp.typing=!0,it.state.pasteIncoming=it.state.cutIncoming=-1}function Ng(it,st){var ft=it.clipboardData&&it.clipboardData.getData("Text");if(ft)return it.preventDefault(),!st.isReadOnly()&&!st.options.disableInput&&_o(st,function(){return qd(st,ft,0,null,"paste")}),!0}function Tg(it,st){if(!(!it.options.electricChars||!it.options.smartIndent))for(var ft=it.doc.sel,dt=ft.ranges.length-1;dt>=0;dt--){var gt=ft.ranges[dt];if(!(gt.head.ch>100||dt&&ft.ranges[dt-1].head.line==gt.head.line)){var Pt=it.getModeAt(gt.head),Tt=!1;if(Pt.electricChars){for(var It=0;It<Pt.electricChars.length;It++)if(st.indexOf(Pt.electricChars.charAt(It))>-1){Tt=$r(it,gt.head.line,"smart");break}}else Pt.electricInput&&Pt.electricInput.test(Ze(it.doc,gt.head.line).text.slice(0,gt.head.ch))&&(Tt=$r(it,gt.head.line,"smart"));Tt&&On(it,"electricInput",it,gt.head.line)}}}function Fg(it){for(var st=[],ft=[],dt=0;dt<it.doc.sel.ranges.length;dt++){var gt=it.doc.sel.ranges[dt].head.line,Pt={anchor:Ve(gt,0),head:Ve(gt+1,0)};ft.push(Pt),st.push(it.getRange(Pt.anchor,Pt.head))}return{text:st,ranges:ft}}function bg(it,st,ft,dt){it.setAttribute("autocorrect",ft?"":"off"),it.setAttribute("autocapitalize",dt?"":"off"),it.setAttribute("spellcheck",!!st)}function Ag(){var it=re("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),st=re("div",[it],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Yt?it.style.width="1000px":it.setAttribute("wrap","off"),Ft&&(it.style.border="1px solid black"),bg(it),st}function Ou(it){var st=it.optionHandlers,ft=it.helpers={};it.prototype={constructor:it,focus:function(){window.focus(),this.display.input.focus()},setOption:function(dt,gt){var Pt=this.options,Tt=Pt[dt];Pt[dt]==gt&&dt!="mode"||(Pt[dt]=gt,st.hasOwnProperty(dt)&&qr(this,st[dt])(this,gt,Tt),mo(this,"optionChange",this,dt))},getOption:function(dt){return this.options[dt]},getDoc:function(){return this.doc},addKeyMap:function(dt,gt){this.state.keyMaps[gt?"push":"unshift"](yh(dt))},removeKeyMap:function(dt){for(var gt=this.state.keyMaps,Pt=0;Pt<gt.length;++Pt)if(gt[Pt]==dt||gt[Pt].name==dt)return gt.splice(Pt,1),!0},addOverlay:ss(function(dt,gt){var Pt=dt.token?dt:it.getMode(this.options,dt);if(Pt.startState)throw new Error("Overlays may not be stateful.");De(this.state.overlays,{mode:Pt,modeSpec:dt,opaque:gt&&gt.opaque,priority:gt&&gt.priority||0},function(Tt){return Tt.priority}),this.state.modeGen++,pr(this)}),removeOverlay:ss(function(dt){for(var gt=this.state.overlays,Pt=0;Pt<gt.length;++Pt){var Tt=gt[Pt].modeSpec;if(Tt==dt||typeof dt=="string"&&Tt.name==dt){gt.splice(Pt,1),this.state.modeGen++,pr(this);return}}}),indentLine:ss(function(dt,gt,Pt){typeof gt!="string"&&typeof gt!="number"&&(gt==null?gt=this.options.smartIndent?"smart":"prev":gt=gt?"add":"subtract"),qn(this.doc,dt)&&$r(this,dt,gt,Pt)}),indentSelection:ss(function(dt){for(var gt=this.doc.sel.ranges,Pt=-1,Tt=0;Tt<gt.length;Tt++){var It=gt[Tt];if(It.empty())It.head.line>Pt&&($r(this,It.head.line,dt,!0),Pt=It.head.line,Tt==this.doc.sel.primIndex&&ql(this));else{var Dt=It.from(),Ut=It.to(),ce=Math.max(Pt,Dt.line);Pt=Math.min(this.lastLine(),Ut.line-(Ut.ch?0:1))+1;for(var Xt=ce;Xt<Pt;++Xt)$r(this,Xt,dt);var Re=this.doc.sel.ranges;Dt.ch==0&&gt.length==Re.length&&Re[Tt].from().ch>0&&bu(this.doc,Tt,new Zo(Dt,Re[Tt].to()),Te)}}}),getTokenAt:function(dt,gt){return $n(this,dt,gt)},getLineTokens:function(dt,gt){return $n(this,Ve(dt),gt,!0)},getTokenTypeAt:function(dt){dt=ti(this.doc,dt);var gt=kn(this,Ze(this.doc,dt.line)),Pt=0,Tt=(gt.length-1)/2,It=dt.ch,Dt;if(It==0)Dt=gt[2];else for(;;){var Ut=Pt+Tt>>1;if((Ut?gt[Ut*2-1]:0)>=It)Tt=Ut;else if(gt[Ut*2+1]<It)Pt=Ut+1;else{Dt=gt[Ut*2+2];break}}var ce=Dt?Dt.indexOf("overlay "):-1;return ce<0?Dt:ce==0?null:Dt.slice(0,ce-1)},getModeAt:function(dt){var gt=this.doc.mode;return gt.innerMode?it.innerMode(gt,this.getTokenAt(dt).state).mode:gt},getHelper:function(dt,gt){return this.getHelpers(dt,gt)[0]},getHelpers:function(dt,gt){var Pt=[];if(!ft.hasOwnProperty(gt))return Pt;var Tt=ft[gt],It=this.getModeAt(dt);if(typeof It[gt]=="string")Tt[It[gt]]&&Pt.push(Tt[It[gt]]);else if(It[gt])for(var Dt=0;Dt<It[gt].length;Dt++){var Ut=Tt[It[gt][Dt]];Ut&&Pt.push(Ut)}else It.helperType&&Tt[It.helperType]?Pt.push(Tt[It.helperType]):Tt[It.name]&&Pt.push(Tt[It.name]);for(var ce=0;ce<Tt._global.length;ce++){var Xt=Tt._global[ce];Xt.pred(It,this)&&He(Pt,Xt.val)==-1&&Pt.push(Xt.val)}return Pt},getStateAfter:function(dt,gt){var Pt=this.doc;return dt=_n(Pt,dt==null?Pt.first+Pt.size-1:dt),zi(this,dt+1,gt).state},cursorCoords:function(dt,gt){var Pt,Tt=this.doc.sel.primary();return dt==null?Pt=Tt.head:typeof dt=="object"?Pt=ti(this.doc,dt):Pt=dt?Tt.from():Tt.to(),Lr(this,Pt,gt||"page")},charCoords:function(dt,gt){return Ad(this,ti(this.doc,dt),gt||"page")},coordsChar:function(dt,gt){return dt=Ff(this,dt,gt||"page"),Bf(this,dt.left,dt.top)},lineAtHeight:function(dt,gt){return dt=Ff(this,{top:dt,left:0},gt||"page").top,bn(this.doc,dt+this.display.viewOffset)},heightAtLine:function(dt,gt,Pt){var Tt=!1,It;if(typeof dt=="number"){var Dt=this.doc.first+this.doc.size-1;dt<this.doc.first?dt=this.doc.first:dt>Dt&&(dt=Dt,Tt=!0),It=Ze(this.doc,dt)}else It=dt;return Ls(this,It,{top:0,left:0},gt||"page",Pt||Tt).top+(Tt?this.doc.height-ji(It):0)},defaultTextHeight:function(){return Ql(this.display)},defaultCharWidth:function(){return rh(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(dt,gt,Pt,Tt,It){var Dt=this.display;dt=Lr(this,ti(this.doc,dt));var Ut=dt.bottom,ce=dt.left;if(gt.style.position="absolute",gt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(gt),Dt.sizer.appendChild(gt),Tt=="over")Ut=dt.top;else if(Tt=="above"||Tt=="near"){var Xt=Math.max(Dt.wrapper.clientHeight,this.doc.height),Re=Math.max(Dt.sizer.clientWidth,Dt.lineSpace.clientWidth);(Tt=="above"||dt.bottom+gt.offsetHeight>Xt)&&dt.top>gt.offsetHeight?Ut=dt.top-gt.offsetHeight:dt.bottom+gt.offsetHeight<=Xt&&(Ut=dt.bottom),ce+gt.offsetWidth>Re&&(ce=Re-gt.offsetWidth)}gt.style.top=Ut+"px",gt.style.left=gt.style.right="",It=="right"?(ce=Dt.sizer.clientWidth-gt.offsetWidth,gt.style.right="0px"):(It=="left"?ce=0:It=="middle"&&(ce=(Dt.sizer.clientWidth-gt.offsetWidth)/2),gt.style.left=ce+"px"),Pt&&Dd(this,{left:ce,top:Ut,right:ce+gt.offsetWidth,bottom:Ut+gt.offsetHeight})},triggerOnKeyDown:ss(Sg),triggerOnKeyPress:ss(xl),triggerOnKeyUp:Pg,triggerOnMouseDown:ss(Pl),execCommand:function(dt){if(Bu.hasOwnProperty(dt))return Bu[dt].call(null,this)},triggerElectric:ss(function(dt){Tg(this,dt)}),findPosH:function(dt,gt,Pt,Tt){var It=1;gt<0&&(It=-1,gt=-gt);for(var Dt=ti(this.doc,dt),Ut=0;Ut<gt&&(Dt=$d(this.doc,Dt,It,Pt,Tt),!Dt.hitSide);++Ut);return Dt},moveH:ss(function(dt,gt){var Pt=this;this.extendSelectionsBy(function(Tt){return Pt.display.shift||Pt.doc.extend||Tt.empty()?$d(Pt.doc,Tt.head,dt,gt,Pt.options.rtlMoveVisually):dt<0?Tt.from():Tt.to()},pn)}),deleteH:ss(function(dt,gt){var Pt=this.doc.sel,Tt=this.doc;Pt.somethingSelected()?Tt.replaceSelection("",null,"+delete"):Ca(this,function(It){var Dt=$d(Tt,It.head,dt,gt,!1);return dt<0?{from:Dt,to:It.head}:{from:It.head,to:Dt}})}),findPosV:function(dt,gt,Pt,Tt){var It=1,Dt=Tt;gt<0&&(It=-1,gt=-gt);for(var Ut=ti(this.doc,dt),ce=0;ce<gt;++ce){var Xt=Lr(this,Ut,"div");if(Dt==null?Dt=Xt.left:Xt.left=Dt,Ut=Iu(this,Xt,It,Pt),Ut.hitSide)break}return Ut},moveV:ss(function(dt,gt){var Pt=this,Tt=this.doc,It=[],Dt=!this.display.shift&&!Tt.extend&&Tt.sel.somethingSelected();if(Tt.extendSelectionsBy(function(ce){if(Dt)return dt<0?ce.from():ce.to();var Xt=Lr(Pt,ce.head,"div");ce.goalColumn!=null&&(Xt.left=ce.goalColumn),It.push(Xt.left);var Re=Iu(Pt,Xt,dt,gt);return gt=="page"&&ce==Tt.sel.primary()&&Of(Pt,Ad(Pt,Re,"div").top-Xt.top),Re},pn),It.length)for(var Ut=0;Ut<Tt.sel.ranges.length;Ut++)Tt.sel.ranges[Ut].goalColumn=It[Ut]}),findWordAt:function(dt){var gt=this.doc,Pt=Ze(gt,dt.line).text,Tt=dt.ch,It=dt.ch;if(Pt){var Dt=this.getHelper(dt,"wordChars");(dt.sticky=="before"||It==Pt.length)&&Tt?--Tt:++It;for(var Ut=Pt.charAt(Tt),ce=_t(Ut,Dt)?function(Xt){return _t(Xt,Dt)}:/\s/.test(Ut)?function(Xt){return/\s/.test(Xt)}:function(Xt){return!/\s/.test(Xt)&&!_t(Xt)};Tt>0&&ce(Pt.charAt(Tt-1));)--Tt;for(;It<Pt.length&&ce(Pt.charAt(It));)++It}return new Zo(Ve(dt.line,Tt),Ve(dt.line,It))},toggleOverwrite:function(dt){dt!=null&&dt==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?nn(this.display.cursorDiv,"CodeMirror-overwrite"):Zt(this.display.cursorDiv,"CodeMirror-overwrite"),mo(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==an()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ss(function(dt,gt){ah(this,dt,gt)}),getScrollInfo:function(){var dt=this.display.scroller;return{left:dt.scrollLeft,top:dt.scrollTop,height:dt.scrollHeight-Sa(this)-this.display.barHeight,width:dt.scrollWidth-Sa(this)-this.display.barWidth,clientHeight:Td(this),clientWidth:ol(this)}},scrollIntoView:ss(function(dt,gt){dt==null?(dt={from:this.doc.sel.primary().head,to:null},gt==null&&(gt=this.options.cursorScrollMargin)):typeof dt=="number"?dt={from:Ve(dt,0),to:null}:dt.from==null&&(dt={from:dt,to:null}),dt.to||(dt.to=dt.from),dt.margin=gt||0,dt.from.line!=null?bo(this,dt):If(this,dt.from,dt.to,dt.margin)}),setSize:ss(function(dt,gt){var Pt=this,Tt=function(Dt){return typeof Dt=="number"||/^\d+$/.test(String(Dt))?Dt+"px":Dt};dt!=null&&(this.display.wrapper.style.width=Tt(dt)),gt!=null&&(this.display.wrapper.style.height=Tt(gt)),this.options.lineWrapping&&bd(this);var It=this.display.viewFrom;this.doc.iter(It,this.display.viewTo,function(Dt){if(Dt.widgets){for(var Ut=0;Ut<Dt.widgets.length;Ut++)if(Dt.widgets[Ut].noHScroll){ao(Pt,It,"widget");break}}++It}),this.curOp.forceUpdate=!0,mo(this,"refresh",this)}),operation:function(dt){return _o(this,dt)},startOperation:function(){return wu(this)},endOperation:function(){return Cu(this)},refresh:ss(function(){var dt=this.display.cachedTextHeight;pr(this),this.curOp.forceUpdate=!0,Yh(this),ah(this,this.doc.scrollLeft,this.doc.scrollTop),Mu(this.display),(dt==null||Math.abs(dt-Ql(this.display))>.5||this.options.lineWrapping)&&Oi(this),mo(this,"refresh",this)}),swapDoc:ss(function(dt){var gt=this.doc;return gt.cm=null,this.state.selectingText&&this.state.selectingText(),Gf(this,dt),Yh(this),this.display.input.reset(),ah(this,dt.scrollLeft,dt.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,gt),gt}),phrase:function(dt){var gt=this.options.phrases;return gt&&Object.prototype.hasOwnProperty.call(gt,dt)?gt[dt]:dt},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},dr(it),it.registerHelper=function(dt,gt,Pt){ft.hasOwnProperty(dt)||(ft[dt]=it[dt]={_global:[]}),ft[dt][gt]=Pt},it.registerGlobalHelper=function(dt,gt,Pt,Tt){it.registerHelper(dt,gt,Tt),ft[dt]._global.push({pred:Pt,val:Tt})}}function $d(it,st,ft,dt,gt){var Pt=st,Tt=ft,It=Ze(it,st.line),Dt=gt&&it.direction=="rtl"?-ft:ft;function Ut(){var wi=st.line+Dt;return wi<it.first||wi>=it.first+it.size?!1:(st=new Ve(wi,st.ch,st.sticky),It=Ze(it,wi))}function ce(wi){var si;if(dt=="codepoint"){var Ei=It.text.charCodeAt(st.ch+(dt>0?0:-1));isNaN(Ei)?si=null:si=new Ve(st.line,Math.max(0,Math.min(It.text.length,st.ch+ft*(Ei>=55296&&Ei<56320?2:1))),-ft)}else gt?si=Zf(it.cm,It,st,ft):si=_r(It,st,ft);if(si==null)if(!wi&&Ut())st=Jd(gt,it.cm,It,st.line,Dt);else return!1;else st=si;return!0}if(dt=="char"||dt=="codepoint")ce();else if(dt=="column")ce(!0);else if(dt=="word"||dt=="group")for(var Xt=null,Re=dt=="group",Fe=it.cm&&it.cm.getHelper(st,"wordChars"),gn=!0;!(ft<0&&!ce(!gn));gn=!1){var xn=It.text.charAt(st.ch)||`
`,Nn=_t(xn,Fe)?"w":Re&&xn==`
`?"n":!Re||/\s/.test(xn)?null:"p";if(Re&&!gn&&!Nn&&(Nn="s"),Xt&&Xt!=Nn){ft<0&&(ft=1,ce(),st.sticky="after");break}if(Nn&&(Xt=Nn),ft>0&&!ce(!gn))break}var Qn=Ud(it,st,Pt,Tt,!0);return wo(Pt,Qn)&&(Qn.hitSide=!0),Qn}function Iu(it,st,ft,dt){var gt=it.doc,Pt=st.left,Tt;if(dt=="page"){var It=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Dt=Math.max(It-.5*Ql(it.display),3);Tt=(ft>0?st.bottom:st.top)+ft*Dt}else dt=="line"&&(Tt=ft>0?st.bottom+3:st.top-3);for(var Ut;Ut=Bf(it,Pt,Tt),!!Ut.outside;){if(ft<0?Tt<=0:Tt>=gt.height){Ut.hitSide=!0;break}Tt+=ft*5}return Ut}var er=function(it){this.cm=it,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new zt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};er.prototype.init=function(it){var st=this,ft=this,dt=ft.cm,gt=ft.div=it.lineDiv;bg(gt,dt.options.spellcheck,dt.options.autocorrect,dt.options.autocapitalize);function Pt(It){for(var Dt=It.target;Dt;Dt=Dt.parentNode){if(Dt==gt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Dt.className))break}return!1}ri(gt,"paste",function(It){!Pt(It)||Ji(dt,It)||Ng(It,dt)||oe<=11&&setTimeout(qr(dt,function(){return st.updateFromDOM()}),20)}),ri(gt,"compositionstart",function(It){st.composing={data:It.data,done:!1}}),ri(gt,"compositionupdate",function(It){st.composing||(st.composing={data:It.data,done:!1})}),ri(gt,"compositionend",function(It){st.composing&&(It.data!=st.composing.data&&st.readFromDOMSoon(),st.composing.done=!0)}),ri(gt,"touchstart",function(){return ft.forceCompositionEnd()}),ri(gt,"input",function(){st.composing||st.readFromDOMSoon()});function Tt(It){if(!(!Pt(It)||Ji(dt,It))){if(dt.somethingSelected())Ch({lineWise:!1,text:dt.getSelections()}),It.type=="cut"&&dt.replaceSelection("",null,"cut");else if(dt.options.lineWiseCopyCut){var Dt=Fg(dt);Ch({lineWise:!0,text:Dt.text}),It.type=="cut"&&dt.operation(function(){dt.setSelections(Dt.ranges,0,Te),dt.replaceSelection("",null,"cut")})}else return;if(It.clipboardData){It.clipboardData.clearData();var Ut=ua.text.join(`
`);if(It.clipboardData.setData("Text",Ut),It.clipboardData.getData("Text")==Ut){It.preventDefault();return}}var ce=Ag(),Xt=ce.firstChild;dt.display.lineSpace.insertBefore(ce,dt.display.lineSpace.firstChild),Xt.value=ua.text.join(`
`);var Re=document.activeElement;oi(Xt),setTimeout(function(){dt.display.lineSpace.removeChild(ce),Re.focus(),Re==gt&&ft.showPrimarySelection()},50)}}ri(gt,"copy",Tt),ri(gt,"cut",Tt)},er.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},er.prototype.prepareSelection=function(){var it=Su(this.cm,!1);return it.focus=document.activeElement==this.div,it},er.prototype.showSelection=function(it,st){!it||!this.cm.display.view.length||((it.focus||st)&&this.showPrimarySelection(),this.showMultipleSelections(it))},er.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},er.prototype.showPrimarySelection=function(){var it=this.getSelection(),st=this.cm,ft=st.doc.sel.primary(),dt=ft.from(),gt=ft.to();if(st.display.viewTo==st.display.viewFrom||dt.line>=st.display.viewTo||gt.line<st.display.viewFrom){it.removeAllRanges();return}var Pt=tf(st,it.anchorNode,it.anchorOffset),Tt=tf(st,it.focusNode,it.focusOffset);if(!(Pt&&!Pt.bad&&Tt&&!Tt.bad&&jn(Un(Pt,Tt),dt)==0&&jn(fo(Pt,Tt),gt)==0)){var It=st.display.view,Dt=dt.line>=st.display.viewFrom&&rc(st,dt)||{node:It[0].measure.map[2],offset:0},Ut=gt.line<st.display.viewTo&&rc(st,gt);if(!Ut){var ce=It[It.length-1].measure,Xt=ce.maps?ce.maps[ce.maps.length-1]:ce.map;Ut={node:Xt[Xt.length-1],offset:Xt[Xt.length-2]-Xt[Xt.length-3]}}if(!Dt||!Ut){it.removeAllRanges();return}var Re=it.rangeCount&&it.getRangeAt(0),Fe;try{Fe=fe(Dt.node,Dt.offset,Ut.offset,Ut.node)}catch(gn){}Fe&&(!wt&&st.state.focused?(it.collapse(Dt.node,Dt.offset),Fe.collapsed||(it.removeAllRanges(),it.addRange(Fe))):(it.removeAllRanges(),it.addRange(Fe)),Re&&it.anchorNode==null?it.addRange(Re):wt&&this.startGracePeriod()),this.rememberSelection()}},er.prototype.startGracePeriod=function(){var it=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){it.gracePeriod=!1,it.selectionChanged()&&it.cm.operation(function(){return it.cm.curOp.selectionChanged=!0})},20)},er.prototype.showMultipleSelections=function(it){le(this.cm.display.cursorDiv,it.cursors),le(this.cm.display.selectionDiv,it.selection)},er.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},er.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var st=it.getRangeAt(0).commonAncestorContainer;return Ke(this.div,st)},er.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},er.prototype.blur=function(){this.div.blur()},er.prototype.getField=function(){return this.div},er.prototype.supportsTouch=function(){return!0},er.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():_o(this.cm,function(){return it.cm.curOp.selectionChanged=!0});function st(){it.cm.state.focused&&(it.pollSelection(),it.polling.set(it.cm.options.pollInterval,st))}this.polling.set(this.cm.options.pollInterval,st)},er.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},er.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),st=this.cm;if(et&&ge&&this.cm.display.gutterSpecs.length&&Bg(it.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ft=tf(st,it.anchorNode,it.anchorOffset),dt=tf(st,it.focusNode,it.focusOffset);ft&&dt&&_o(st,function(){Is(st.doc,tu(ft,dt),Te),(ft.bad||dt.bad)&&(st.curOp.selectionChanged=!0)})}}},er.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var it=this.cm,st=it.display,ft=it.doc.sel.primary(),dt=ft.from(),gt=ft.to();if(dt.ch==0&&dt.line>it.firstLine()&&(dt=Ve(dt.line-1,Ze(it.doc,dt.line-1).length)),gt.ch==Ze(it.doc,gt.line).text.length&&gt.line<it.lastLine()&&(gt=Ve(gt.line+1,0)),dt.line<st.viewFrom||gt.line>st.viewTo-1)return!1;var Pt,Tt,It;dt.line==st.viewFrom||(Pt=Ba(it,dt.line))==0?(Tt=de(st.view[0].line),It=st.view[0].node):(Tt=de(st.view[Pt].line),It=st.view[Pt-1].node.nextSibling);var Dt=Ba(it,gt.line),Ut,ce;if(Dt==st.view.length-1?(Ut=st.viewTo-1,ce=st.lineDiv.lastChild):(Ut=de(st.view[Dt+1].line)-1,ce=st.view[Dt+1].node.previousSibling),!It)return!1;for(var Xt=it.doc.splitLines(ud(it,It,ce,Tt,Ut)),Re=Xn(it.doc,Ve(Tt,0),Ve(Ut,Ze(it.doc,Ut).text.length));Xt.length>1&&Re.length>1;)if(Ae(Xt)==Ae(Re))Xt.pop(),Re.pop(),Ut--;else if(Xt[0]==Re[0])Xt.shift(),Re.shift(),Tt++;else break;for(var Fe=0,gn=0,xn=Xt[0],Nn=Re[0],Qn=Math.min(xn.length,Nn.length);Fe<Qn&&xn.charCodeAt(Fe)==Nn.charCodeAt(Fe);)++Fe;for(var wi=Ae(Xt),si=Ae(Re),Ei=Math.min(wi.length-(Xt.length==1?Fe:0),si.length-(Re.length==1?Fe:0));gn<Ei&&wi.charCodeAt(wi.length-gn-1)==si.charCodeAt(si.length-gn-1);)++gn;if(Xt.length==1&&Re.length==1&&Tt==dt.line)for(;Fe&&Fe>dt.ch&&wi.charCodeAt(wi.length-gn-1)==si.charCodeAt(si.length-gn-1);)Fe--,gn++;Xt[Xt.length-1]=wi.slice(0,wi.length-gn).replace(/^\u200b+/,""),Xt[0]=Xt[0].slice(Fe).replace(/\u200b+$/,"");var $i=Ve(Tt,Fe),ii=Ve(Ut,Re.length?Ae(Re).length-gn:0);if(Xt.length>1||Xt[0]||jn($i,ii))return ph(it.doc,Xt,$i,ii,"+input"),!0},er.prototype.ensurePolled=function(){this.forceCompositionEnd()},er.prototype.reset=function(){this.forceCompositionEnd()},er.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},er.prototype.readFromDOMSoon=function(){var it=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(it.readDOMTimeout=null,it.composing)if(it.composing.done)it.composing=null;else return;it.updateFromDOM()},80))},er.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&_o(this.cm,function(){return pr(it.cm)})},er.prototype.setUneditable=function(it){it.contentEditable="false"},er.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||qr(this.cm,qd)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},er.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},er.prototype.onContextMenu=function(){},er.prototype.resetPosition=function(){},er.prototype.needsContentAttribute=!0;function rc(it,st){var ft=Fd(it,st.line);if(!ft||ft.hidden)return null;var dt=Ze(it.doc,st.line),gt=Mf(ft,dt,st.line),Pt=ai(dt,it.doc.direction),Tt="left";if(Pt){var It=Pn(Pt,st.ch);Tt=It%2?"right":"left"}var Dt=Tf(gt.map,st.ch,Tt);return Dt.offset=Dt.collapse=="right"?Dt.end:Dt.start,Dt}function Bg(it){for(var st=it;st;st=st.parentNode)if(/CodeMirror-gutter-wrapper/.test(st.className))return!0;return!1}function ld(it,st){return st&&(it.bad=!0),it}function ud(it,st,ft,dt,gt){var Pt="",Tt=!1,It=it.doc.lineSeparator(),Dt=!1;function Ut(Fe){return function(gn){return gn.id==Fe}}function ce(){Tt&&(Pt+=It,Dt&&(Pt+=It),Tt=Dt=!1)}function Xt(Fe){Fe&&(ce(),Pt+=Fe)}function Re(Fe){if(Fe.nodeType==1){var gn=Fe.getAttribute("cm-text");if(gn){Xt(gn);return}var xn=Fe.getAttribute("cm-marker"),Nn;if(xn){var Qn=it.findMarks(Ve(dt,0),Ve(gt+1,0),Ut(+xn));Qn.length&&(Nn=Qn[0].find(0))&&Xt(Xn(it.doc,Nn.from,Nn.to).join(It));return}if(Fe.getAttribute("contenteditable")=="false")return;var wi=/^(pre|div|p|li|table|br)$/i.test(Fe.nodeName);if(!/^br$/i.test(Fe.nodeName)&&Fe.textContent.length==0)return;wi&&ce();for(var si=0;si<Fe.childNodes.length;si++)Re(Fe.childNodes[si]);/^(pre|p)$/i.test(Fe.nodeName)&&(Dt=!0),wi&&(Tt=!0)}else Fe.nodeType==3&&Xt(Fe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Re(st),st!=ft;)st=st.nextSibling,Dt=!1;return Pt}function tf(it,st,ft){var dt;if(st==it.display.lineDiv){if(dt=it.display.lineDiv.childNodes[ft],!dt)return ld(it.clipPos(Ve(it.display.viewTo-1)),!0);st=null,ft=0}else for(dt=st;;dt=dt.parentNode){if(!dt||dt==it.display.lineDiv)return null;if(dt.parentNode&&dt.parentNode==it.display.lineDiv)break}for(var gt=0;gt<it.display.view.length;gt++){var Pt=it.display.view[gt];if(Pt.node==dt)return rm(Pt,st,ft)}}function rm(it,st,ft){var dt=it.text.firstChild,gt=!1;if(!st||!Ke(dt,st))return ld(Ve(de(it.line),0),!0);if(st==dt&&(gt=!0,st=dt.childNodes[ft],ft=0,!st)){var Pt=it.rest?Ae(it.rest):it.line;return ld(Ve(de(Pt),Pt.text.length),gt)}var Tt=st.nodeType==3?st:null,It=st;for(!Tt&&st.childNodes.length==1&&st.firstChild.nodeType==3&&(Tt=st.firstChild,ft&&(ft=Tt.nodeValue.length));It.parentNode!=dt;)It=It.parentNode;var Dt=it.measure,Ut=Dt.maps;function ce(Nn,Qn,wi){for(var si=-1;si<(Ut?Ut.length:0);si++)for(var Ei=si<0?Dt.map:Ut[si],$i=0;$i<Ei.length;$i+=3){var ii=Ei[$i+2];if(ii==Nn||ii==Qn){var ho=de(si<0?it.line:it.rest[si]),mr=Ei[$i]+wi;return(wi<0||ii!=Nn)&&(mr=Ei[$i+(wi?1:0)]),Ve(ho,mr)}}}var Xt=ce(Tt,It,ft);if(Xt)return ld(Xt,gt);for(var Re=It.nextSibling,Fe=Tt?Tt.nodeValue.length-ft:0;Re;Re=Re.nextSibling){if(Xt=ce(Re,Re.firstChild,0),Xt)return ld(Ve(Xt.line,Xt.ch-Fe),gt);Fe+=Re.textContent.length}for(var gn=It.previousSibling,xn=ft;gn;gn=gn.previousSibling){if(Xt=ce(gn,gn.firstChild,-1),Xt)return ld(Ve(Xt.line,Xt.ch+xn),gt);xn+=gn.textContent.length}}var Vr=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new zt,this.hasSelection=!1,this.composing=null};Vr.prototype.init=function(it){var st=this,ft=this,dt=this.cm;this.createField(it);var gt=this.textarea;it.wrapper.insertBefore(this.wrapper,it.wrapper.firstChild),Ft&&(gt.style.width="0px"),ri(gt,"input",function(){ye&&oe>=9&&st.hasSelection&&(st.hasSelection=null),ft.poll()}),ri(gt,"paste",function(Tt){Ji(dt,Tt)||Ng(Tt,dt)||(dt.state.pasteIncoming=+new Date,ft.fastPoll())});function Pt(Tt){if(!Ji(dt,Tt)){if(dt.somethingSelected())Ch({lineWise:!1,text:dt.getSelections()});else if(dt.options.lineWiseCopyCut){var It=Fg(dt);Ch({lineWise:!0,text:It.text}),Tt.type=="cut"?dt.setSelections(It.ranges,null,Te):(ft.prevInput="",gt.value=It.text.join(`
`),oi(gt))}else return;Tt.type=="cut"&&(dt.state.cutIncoming=+new Date)}}ri(gt,"cut",Pt),ri(gt,"copy",Pt),ri(it.scroller,"paste",function(Tt){if(!(Ur(it,Tt)||Ji(dt,Tt))){if(!gt.dispatchEvent){dt.state.pasteIncoming=+new Date,ft.focus();return}var It=new Event("paste");It.clipboardData=Tt.clipboardData,gt.dispatchEvent(It)}}),ri(it.lineSpace,"selectstart",function(Tt){Ur(it,Tt)||rr(Tt)}),ri(gt,"compositionstart",function(){var Tt=dt.getCursor("from");ft.composing&&ft.composing.range.clear(),ft.composing={start:Tt,range:dt.markText(Tt,dt.getCursor("to"),{className:"CodeMirror-composing"})}}),ri(gt,"compositionend",function(){ft.composing&&(ft.poll(),ft.composing.range.clear(),ft.composing=null)})},Vr.prototype.createField=function(it){this.wrapper=Ag(),this.textarea=this.wrapper.firstChild},Vr.prototype.screenReaderLabelChanged=function(it){it?this.textarea.setAttribute("aria-label",it):this.textarea.removeAttribute("aria-label")},Vr.prototype.prepareSelection=function(){var it=this.cm,st=it.display,ft=it.doc,dt=Su(it);if(it.options.moveInputWithCursor){var gt=Lr(it,ft.sel.primary().head,"div"),Pt=st.wrapper.getBoundingClientRect(),Tt=st.lineDiv.getBoundingClientRect();dt.teTop=Math.max(0,Math.min(st.wrapper.clientHeight-10,gt.top+Tt.top-Pt.top)),dt.teLeft=Math.max(0,Math.min(st.wrapper.clientWidth-10,gt.left+Tt.left-Pt.left))}return dt},Vr.prototype.showSelection=function(it){var st=this.cm,ft=st.display;le(ft.cursorDiv,it.cursors),le(ft.selectionDiv,it.selection),it.teTop!=null&&(this.wrapper.style.top=it.teTop+"px",this.wrapper.style.left=it.teLeft+"px")},Vr.prototype.reset=function(it){if(!(this.contextMenuPending||this.composing)){var st=this.cm;if(st.somethingSelected()){this.prevInput="";var ft=st.getSelection();this.textarea.value=ft,st.state.focused&&oi(this.textarea),ye&&oe>=9&&(this.hasSelection=ft)}else it||(this.prevInput=this.textarea.value="",ye&&oe>=9&&(this.hasSelection=null))}},Vr.prototype.getField=function(){return this.textarea},Vr.prototype.supportsTouch=function(){return!1},Vr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!nt||an()!=this.textarea))try{this.textarea.focus()}catch(it){}},Vr.prototype.blur=function(){this.textarea.blur()},Vr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vr.prototype.receivedFocus=function(){this.slowPoll()},Vr.prototype.slowPoll=function(){var it=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){it.poll(),it.cm.state.focused&&it.slowPoll()})},Vr.prototype.fastPoll=function(){var it=!1,st=this;st.pollingFast=!0;function ft(){var dt=st.poll();!dt&&!it?(it=!0,st.polling.set(60,ft)):(st.pollingFast=!1,st.slowPoll())}st.polling.set(20,ft)},Vr.prototype.poll=function(){var it=this,st=this.cm,ft=this.textarea,dt=this.prevInput;if(this.contextMenuPending||!st.state.focused||xt(ft)&&!dt&&!this.composing||st.isReadOnly()||st.options.disableInput||st.state.keySeq)return!1;var gt=ft.value;if(gt==dt&&!st.somethingSelected())return!1;if(ye&&oe>=9&&this.hasSelection===gt||ht&&/[\uf700-\uf7ff]/.test(gt))return st.display.input.reset(),!1;if(st.doc.sel==st.display.selForContextMenu){var Pt=gt.charCodeAt(0);if(Pt==8203&&!dt&&(dt="\u200B"),Pt==8666)return this.reset(),this.cm.execCommand("undo")}for(var Tt=0,It=Math.min(dt.length,gt.length);Tt<It&&dt.charCodeAt(Tt)==gt.charCodeAt(Tt);)++Tt;return _o(st,function(){qd(st,gt.slice(Tt),dt.length-Tt,null,it.composing?"*compose":null),gt.length>1e3||gt.indexOf(`
`)>-1?ft.value=it.prevInput="":it.prevInput=gt,it.composing&&(it.composing.range.clear(),it.composing.range=st.markText(it.composing.start,st.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Vr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vr.prototype.onKeyPress=function(){ye&&oe>=9&&(this.hasSelection=null),this.fastPoll()},Vr.prototype.onContextMenu=function(it){var st=this,ft=st.cm,dt=ft.display,gt=st.textarea;st.contextMenuPending&&st.contextMenuPending();var Pt=Zs(ft,it),Tt=dt.scroller.scrollTop;if(!Pt||we)return;var It=ft.options.resetSelectionOnContextMenu;It&&ft.doc.sel.contains(Pt)==-1&&qr(ft,Is)(ft.doc,tu(Pt),Te);var Dt=gt.style.cssText,Ut=st.wrapper.style.cssText,ce=st.wrapper.offsetParent.getBoundingClientRect();st.wrapper.style.cssText="position: static",gt.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(it.clientY-ce.top-5)+"px; left: "+(it.clientX-ce.left-5)+`px;
z-index: 1000; background: `+(ye?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Xt;Yt&&(Xt=window.scrollY),dt.input.focus(),Yt&&window.scrollTo(null,Xt),dt.input.reset(),ft.somethingSelected()||(gt.value=st.prevInput=" "),st.contextMenuPending=Fe,dt.selForContextMenu=ft.doc.sel,clearTimeout(dt.detectingSelectAll);function Re(){if(gt.selectionStart!=null){var xn=ft.somethingSelected(),Nn="\u200B"+(xn?gt.value:"");gt.value="\u21DA",gt.value=Nn,st.prevInput=xn?"":"\u200B",gt.selectionStart=1,gt.selectionEnd=Nn.length,dt.selForContextMenu=ft.doc.sel}}function Fe(){if(st.contextMenuPending==Fe&&(st.contextMenuPending=!1,st.wrapper.style.cssText=Ut,gt.style.cssText=Dt,ye&&oe<9&&dt.scrollbars.setScrollTop(dt.scroller.scrollTop=Tt),gt.selectionStart!=null)){(!ye||ye&&oe<9)&&Re();var xn=0,Nn=function(){dt.selForContextMenu==ft.doc.sel&&gt.selectionStart==0&&gt.selectionEnd>0&&st.prevInput=="\u200B"?qr(ft,zr)(ft):xn++<10?dt.detectingSelectAll=setTimeout(Nn,500):(dt.selForContextMenu=null,dt.input.reset())};dt.detectingSelectAll=setTimeout(Nn,200)}}if(ye&&oe>=9&&Re(),Et){jo(it);var gn=function(){Ro(window,"mouseup",gn),setTimeout(Fe,20)};ri(window,"mouseup",gn)}else setTimeout(Fe,50)},Vr.prototype.readOnlyChanged=function(it){it||this.reset(),this.textarea.disabled=it=="nocursor",this.textarea.readOnly=!!it},Vr.prototype.setUneditable=function(){},Vr.prototype.needsContentAttribute=!1;function sm(it,st){if(st=st?so(st):{},st.value=it.value,!st.tabindex&&it.tabIndex&&(st.tabindex=it.tabIndex),!st.placeholder&&it.placeholder&&(st.placeholder=it.placeholder),st.autofocus==null){var ft=an();st.autofocus=ft==it||it.getAttribute("autofocus")!=null&&ft==document.body}function dt(){it.value=It.getValue()}var gt;if(it.form&&(ri(it.form,"submit",dt),!st.leaveSubmitMethodAlone)){var Pt=it.form;gt=Pt.submit;try{var Tt=Pt.submit=function(){dt(),Pt.submit=gt,Pt.submit(),Pt.submit=Tt}}catch(Dt){}}st.finishInit=function(Dt){Dt.save=dt,Dt.getTextArea=function(){return it},Dt.toTextArea=function(){Dt.toTextArea=isNaN,dt(),it.parentNode.removeChild(Dt.getWrapperElement()),it.style.display="",it.form&&(Ro(it.form,"submit",dt),!st.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=gt))}},it.style.display="none";var It=Io(function(Dt){return it.parentNode.insertBefore(Dt,it.nextSibling)},st);return It}function hd(it){it.off=Ro,it.on=ri,it.wheelEventPixels=Oa,it.Doc=ks,it.splitLines=Je,it.countColumn=Qt,it.findColumn=ni,it.isWordChar=Bt,it.Pass=Fn,it.signal=mo,it.Line=Oo,it.changeEnd=Tu,it.scrollbarModel=$c,it.Pos=Ve,it.cmpPos=jn,it.modes=li,it.mimeModes=hi,it.resolveMode=Ce,it.getMode=Oe,it.modeExtensions=ee,it.extendMode=Ie,it.copyState=Tn,it.startState=Bn,it.innerMode=Hn,it.commands=Bu,it.keyMap=wa,it.keyName=qp,it.isModifierKey=nd,it.lookupKey=Xa,it.normalizeKeyMap=gg,it.StringStream=me,it.SharedTextMarker=Bl,it.TextMarker=te,it.LineWidget=iu,it.e_preventDefault=rr,it.e_stopPropagation=fr,it.e_stop=jo,it.addClass=nn,it.contains=Ke,it.rmClass=Zt,it.keyNames=Dl}im(Io),Ou(Io);var ou="iter insert remove copy getEditor constructor".split(" ");for(var ef in ks.prototype)ks.prototype.hasOwnProperty(ef)&&He(ou,ef)<0&&(Io.prototype[ef]=function(it){return function(){return it.apply(this.doc,arguments)}}(ks.prototype[ef]));return dr(ks),Io.inputStyles={textarea:Vr,contenteditable:er},Io.defineMode=function(it){!Io.defaults.mode&&it!="null"&&(Io.defaults.mode=it),Fi.apply(this,arguments)},Io.defineMIME=to,Io.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),Io.defineMIME("text/plain","null"),Io.defineExtension=function(it,st){Io.prototype[it]=st},Io.defineDocExtension=function(it,st){ks.prototype[it]=st},Io.fromTextArea=sm,hd(Io),Io.version="5.58.2",Io})},49047:function(un,Rn,Vt){(function(wt){wt(Vt(4631),Vt(29589),Vt(52539))})(function(wt){"use strict";wt.defineMode("markdown",function(ue,_e){var $e=wt.getMode(ue,"text/html"),ye=$e.name=="null";function oe(Qt){if(wt.findModeByName){var zt=wt.findModeByName(Qt);zt&&(Qt=zt.mime||zt.mimes[0])}var He=wt.getMode(ue,Qt);return He.name=="null"?null:He}_e.highlightFormatting===void 0&&(_e.highlightFormatting=!1),_e.maxBlockquoteDepth===void 0&&(_e.maxBlockquoteDepth=0),_e.taskLists===void 0&&(_e.taskLists=!1),_e.strikethrough===void 0&&(_e.strikethrough=!1),_e.emoji===void 0&&(_e.emoji=!1),_e.fencedCodeBlockHighlighting===void 0&&(_e.fencedCodeBlockHighlighting=!0),_e.fencedCodeBlockDefaultMode===void 0&&(_e.fencedCodeBlockDefaultMode="text/plain"),_e.xml===void 0&&(_e.xml=!0),_e.tokenTypeOverrides===void 0&&(_e.tokenTypeOverrides={});var Yt={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var Ne in Yt)Yt.hasOwnProperty(Ne)&&_e.tokenTypeOverrides[Ne]&&(Yt[Ne]=_e.tokenTypeOverrides[Ne]);var ge=/^([*\-_])(?:\s*\1){2,}\s*$/,we=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Ye=/^\[(x| )\](?=\s)/i,Be=_e.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,on=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Ft=/^[^#!\[\]*_\\<>` "'(~:]+/,et=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,nt=/^\s*\[[^\]]+?\]:.*$/,ht=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,lt=" ";function pt(Qt,zt,He){return zt.f=zt.inline=He,He(Qt,zt)}function vt(Qt,zt,He){return zt.f=zt.block=He,He(Qt,zt)}function kt(Qt){return!Qt||!/\S/.test(Qt.string)}function Et(Qt){if(Qt.linkTitle=!1,Qt.linkHref=!1,Qt.linkText=!1,Qt.em=!1,Qt.strong=!1,Qt.strikethrough=!1,Qt.quote=0,Qt.indentedCode=!1,Qt.f==Zt){var zt=ye;if(!zt){var He=wt.innerMode($e,Qt.htmlState);zt=He.mode.name=="xml"&&He.state.tagStart===null&&!He.state.context&&He.state.tokenize.isInText}zt&&(Qt.f=Ge,Qt.block=Ht,Qt.htmlState=null)}return Qt.trailingSpace=0,Qt.trailingSpaceNewLine=!1,Qt.prevLine=Qt.thisLine,Qt.thisLine={stream:null},null}function Ht(Qt,zt){var He=Qt.column()===zt.indentation,En=kt(zt.prevLine.stream),Fn=zt.indentedCode,Te=zt.prevLine.hr,ln=zt.list!==!1,pn=(zt.listStack[zt.listStack.length-1]||0)+3;zt.indentedCode=!1;var ni=zt.indentation;if(zt.indentationDiff===null&&(zt.indentationDiff=zt.indentation,ln)){for(zt.list=null;ni<zt.listStack[zt.listStack.length-1];)zt.listStack.pop(),zt.listStack.length?zt.indentation=zt.listStack[zt.listStack.length-1]:zt.list=!1;zt.list!==!1&&(zt.indentationDiff=ni-zt.listStack[zt.listStack.length-1])}var Cn=!En&&!Te&&!zt.prevLine.header&&(!ln||!Fn)&&!zt.prevLine.fencedCodeEnd,he=(zt.list===!1||Te||En)&&zt.indentation<=pn&&Qt.match(ge),Ae=null;if(zt.indentationDiff>=4&&(Fn||zt.prevLine.fencedCodeEnd||zt.prevLine.header||En))return Qt.skipToEnd(),zt.indentedCode=!0,Yt.code;if(Qt.eatSpace())return null;if(He&&zt.indentation<=pn&&(Ae=Qt.match(Be))&&Ae[1].length<=6)return zt.quote=0,zt.header=Ae[1].length,zt.thisLine.header=!0,_e.highlightFormatting&&(zt.formatting="header"),zt.f=zt.inline,le(zt);if(zt.indentation<=pn&&Qt.eat(">"))return zt.quote=He?1:zt.quote+1,_e.highlightFormatting&&(zt.formatting="quote"),Qt.eatSpace(),le(zt);if(!he&&!zt.setext&&He&&zt.indentation<=pn&&(Ae=Qt.match(we))){var hn=Ae[1]?"ol":"ul";return zt.indentation=ni+Qt.current().length,zt.list=!0,zt.quote=0,zt.listStack.push(zt.indentation),zt.em=!1,zt.strong=!1,zt.code=!1,zt.strikethrough=!1,_e.taskLists&&Qt.match(Ye,!1)&&(zt.taskList=!0),zt.f=zt.inline,_e.highlightFormatting&&(zt.formatting=["list","list-"+hn]),le(zt)}else{if(He&&zt.indentation<=pn&&(Ae=Qt.match(et,!0)))return zt.quote=0,zt.fencedEndRE=new RegExp(Ae[1]+"+ *$"),zt.localMode=_e.fencedCodeBlockHighlighting&&oe(Ae[2]||_e.fencedCodeBlockDefaultMode),zt.localMode&&(zt.localState=wt.startState(zt.localMode)),zt.f=zt.block=ie,_e.highlightFormatting&&(zt.formatting="code-block"),zt.code=-1,le(zt);if(zt.setext||(!Cn||!ln)&&!zt.quote&&zt.list===!1&&!zt.code&&!he&&!nt.test(Qt.string)&&(Ae=Qt.lookAhead(1))&&(Ae=Ae.match(on)))return zt.setext?(zt.header=zt.setext,zt.setext=0,Qt.skipToEnd(),_e.highlightFormatting&&(zt.formatting="header")):(zt.header=Ae[0].charAt(0)=="="?1:2,zt.setext=zt.header),zt.thisLine.header=!0,zt.f=zt.inline,le(zt);if(he)return Qt.skipToEnd(),zt.hr=!0,zt.thisLine.hr=!0,Yt.hr;if(Qt.peek()==="[")return pt(Qt,zt,Si)}return pt(Qt,zt,zt.inline)}function Zt(Qt,zt){var He=$e.token(Qt,zt.htmlState);if(!ye){var En=wt.innerMode($e,zt.htmlState);(En.mode.name=="xml"&&En.state.tagStart===null&&!En.state.context&&En.state.tokenize.isInText||zt.md_inside&&Qt.current().indexOf(">")>-1)&&(zt.f=Ge,zt.block=Ht,zt.htmlState=null)}return He}function ie(Qt,zt){var He=zt.listStack[zt.listStack.length-1]||0,En=zt.indentation<He,Fn=He+3;if(zt.fencedEndRE&&zt.indentation<=Fn&&(En||Qt.match(zt.fencedEndRE))){_e.highlightFormatting&&(zt.formatting="code-block");var Te;return En||(Te=le(zt)),zt.localMode=zt.localState=null,zt.block=Ht,zt.f=Ge,zt.fencedEndRE=null,zt.code=0,zt.thisLine.fencedCodeEnd=!0,En?vt(Qt,zt,zt.block):Te}else return zt.localMode?zt.localMode.token(Qt,zt.localState):(Qt.skipToEnd(),Yt.code)}function le(Qt){var zt=[];if(Qt.formatting){zt.push(Yt.formatting),typeof Qt.formatting=="string"&&(Qt.formatting=[Qt.formatting]);for(var He=0;He<Qt.formatting.length;He++)zt.push(Yt.formatting+"-"+Qt.formatting[He]),Qt.formatting[He]==="header"&&zt.push(Yt.formatting+"-"+Qt.formatting[He]+"-"+Qt.header),Qt.formatting[He]==="quote"&&(!_e.maxBlockquoteDepth||_e.maxBlockquoteDepth>=Qt.quote?zt.push(Yt.formatting+"-"+Qt.formatting[He]+"-"+Qt.quote):zt.push("error"))}if(Qt.taskOpen)return zt.push("meta"),zt.length?zt.join(" "):null;if(Qt.taskClosed)return zt.push("property"),zt.length?zt.join(" "):null;if(Qt.linkHref?zt.push(Yt.linkHref,"url"):(Qt.strong&&zt.push(Yt.strong),Qt.em&&zt.push(Yt.em),Qt.strikethrough&&zt.push(Yt.strikethrough),Qt.emoji&&zt.push(Yt.emoji),Qt.linkText&&zt.push(Yt.linkText),Qt.code&&zt.push(Yt.code),Qt.image&&zt.push(Yt.image),Qt.imageAltText&&zt.push(Yt.imageAltText,"link"),Qt.imageMarker&&zt.push(Yt.imageMarker)),Qt.header&&zt.push(Yt.header,Yt.header+"-"+Qt.header),Qt.quote&&(zt.push(Yt.quote),!_e.maxBlockquoteDepth||_e.maxBlockquoteDepth>=Qt.quote?zt.push(Yt.quote+"-"+Qt.quote):zt.push(Yt.quote+"-"+_e.maxBlockquoteDepth)),Qt.list!==!1){var En=(Qt.listStack.length-1)%3;En?En===1?zt.push(Yt.list2):zt.push(Yt.list3):zt.push(Yt.list1)}return Qt.trailingSpaceNewLine?zt.push("trailing-space-new-line"):Qt.trailingSpace&&zt.push("trailing-space-"+(Qt.trailingSpace%2?"a":"b")),zt.length?zt.join(" "):null}function re(Qt,zt){if(Qt.match(Ft,!0))return le(zt)}function Ge(Qt,zt){var He=zt.text(Qt,zt);if(typeof He!="undefined")return He;if(zt.list)return zt.list=null,le(zt);if(zt.taskList){var En=Qt.match(Ye,!0)[1]===" ";return En?zt.taskOpen=!0:zt.taskClosed=!0,_e.highlightFormatting&&(zt.formatting="task"),zt.taskList=!1,le(zt)}if(zt.taskOpen=!1,zt.taskClosed=!1,zt.header&&Qt.match(/^#+$/,!0))return _e.highlightFormatting&&(zt.formatting="header"),le(zt);var Fn=Qt.next();if(zt.linkTitle){zt.linkTitle=!1;var Te=Fn;Fn==="("&&(Te=")"),Te=(Te+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ln="^\\s*(?:[^"+Te+"\\\\]+|\\\\\\\\|\\\\.)"+Te;if(Qt.match(new RegExp(ln),!0))return Yt.linkHref}if(Fn==="`"){var pn=zt.formatting;_e.highlightFormatting&&(zt.formatting="code"),Qt.eatWhile("`");var ni=Qt.current().length;if(zt.code==0&&(!zt.quote||ni==1))return zt.code=ni,le(zt);if(ni==zt.code){var Cn=le(zt);return zt.code=0,Cn}else return zt.formatting=pn,le(zt)}else if(zt.code)return le(zt);if(Fn==="\\"&&(Qt.next(),_e.highlightFormatting)){var he=le(zt),Ae=Yt.formatting+"-escape";return he?he+" "+Ae:Ae}if(Fn==="!"&&Qt.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return zt.imageMarker=!0,zt.image=!0,_e.highlightFormatting&&(zt.formatting="image"),le(zt);if(Fn==="["&&zt.imageMarker&&Qt.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return zt.imageMarker=!1,zt.imageAltText=!0,_e.highlightFormatting&&(zt.formatting="image"),le(zt);if(Fn==="]"&&zt.imageAltText){_e.highlightFormatting&&(zt.formatting="image");var he=le(zt);return zt.imageAltText=!1,zt.image=!1,zt.inline=zt.f=Ke,he}if(Fn==="["&&!zt.image)return zt.linkText&&Qt.match(/^.*?\]/)||(zt.linkText=!0,_e.highlightFormatting&&(zt.formatting="link")),le(zt);if(Fn==="]"&&zt.linkText){_e.highlightFormatting&&(zt.formatting="link");var he=le(zt);return zt.linkText=!1,zt.inline=zt.f=Qt.match(/\(.*?\)| ?\[.*?\]/,!1)?Ke:Ge,he}if(Fn==="<"&&Qt.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){zt.f=zt.inline=fe,_e.highlightFormatting&&(zt.formatting="link");var he=le(zt);return he?he+=" ":he="",he+Yt.linkInline}if(Fn==="<"&&Qt.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){zt.f=zt.inline=fe,_e.highlightFormatting&&(zt.formatting="link");var he=le(zt);return he?he+=" ":he="",he+Yt.linkEmail}if(_e.xml&&Fn==="<"&&Qt.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var hn=Qt.string.indexOf(">",Qt.pos);if(hn!=-1){var De=Qt.string.substring(Qt.start,hn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(De)&&(zt.md_inside=!0)}return Qt.backUp(1),zt.htmlState=wt.startState($e),vt(Qt,zt,Zt)}if(_e.xml&&Fn==="<"&&Qt.match(/^\/\w*?>/))return zt.md_inside=!1,"tag";if(Fn==="*"||Fn==="_"){for(var Rt=1,Lt=Qt.pos==1?" ":Qt.string.charAt(Qt.pos-2);Rt<3&&Qt.eat(Fn);)Rt++;var Ct=Qt.peek()||" ",Bt=!/\s/.test(Ct)&&(!ht.test(Ct)||/\s/.test(Lt)||ht.test(Lt)),_t=!/\s/.test(Lt)&&(!ht.test(Lt)||/\s/.test(Ct)||ht.test(Ct)),Nt=null,Me=null;if(Rt%2&&(!zt.em&&Bt&&(Fn==="*"||!_t||ht.test(Lt))?Nt=!0:zt.em==Fn&&_t&&(Fn==="*"||!Bt||ht.test(Ct))&&(Nt=!1)),Rt>1&&(!zt.strong&&Bt&&(Fn==="*"||!_t||ht.test(Lt))?Me=!0:zt.strong==Fn&&_t&&(Fn==="*"||!Bt||ht.test(Ct))&&(Me=!1)),Me!=null||Nt!=null){_e.highlightFormatting&&(zt.formatting=Nt==null?"strong":Me==null?"em":"strong em"),Nt===!0&&(zt.em=Fn),Me===!0&&(zt.strong=Fn);var Cn=le(zt);return Nt===!1&&(zt.em=!1),Me===!1&&(zt.strong=!1),Cn}}else if(Fn===" "&&(Qt.eat("*")||Qt.eat("_"))){if(Qt.peek()===" ")return le(zt);Qt.backUp(1)}if(_e.strikethrough){if(Fn==="~"&&Qt.eatWhile(Fn)){if(zt.strikethrough){_e.highlightFormatting&&(zt.formatting="strikethrough");var Cn=le(zt);return zt.strikethrough=!1,Cn}else if(Qt.match(/^[^\s]/,!1))return zt.strikethrough=!0,_e.highlightFormatting&&(zt.formatting="strikethrough"),le(zt)}else if(Fn===" "&&Qt.match(/^~~/,!0)){if(Qt.peek()===" ")return le(zt);Qt.backUp(2)}}if(_e.emoji&&Fn===":"&&Qt.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){zt.emoji=!0,_e.highlightFormatting&&(zt.formatting="emoji");var wn=le(zt);return zt.emoji=!1,wn}return Fn===" "&&(Qt.match(/^ +$/,!1)?zt.trailingSpace++:zt.trailingSpace&&(zt.trailingSpaceNewLine=!0)),le(zt)}function fe(Qt,zt){var He=Qt.next();if(He===">"){zt.f=zt.inline=Ge,_e.highlightFormatting&&(zt.formatting="link");var En=le(zt);return En?En+=" ":En="",En+Yt.linkInline}return Qt.match(/^[^>]+/,!0),Yt.linkInline}function Ke(Qt,zt){if(Qt.eatSpace())return null;var He=Qt.next();return He==="("||He==="["?(zt.f=zt.inline=nn(He==="("?")":"]"),_e.highlightFormatting&&(zt.formatting="link-string"),zt.linkHref=!0,le(zt)):"error"}var an={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function nn(Qt){return function(zt,He){var En=zt.next();if(En===Qt){He.f=He.inline=Ge,_e.highlightFormatting&&(He.formatting="link-string");var Fn=le(He);return He.linkHref=!1,Fn}return zt.match(an[Qt]),He.linkHref=!0,le(He)}}function Si(Qt,zt){return Qt.match(/^([^\]\\]|\\.)*\]:/,!1)?(zt.f=oi,Qt.next(),_e.highlightFormatting&&(zt.formatting="link"),zt.linkText=!0,le(zt)):pt(Qt,zt,Ge)}function oi(Qt,zt){if(Qt.match(/^\]:/,!0)){zt.f=zt.inline=Bi,_e.highlightFormatting&&(zt.formatting="link");var He=le(zt);return zt.linkText=!1,He}return Qt.match(/^([^\]\\]|\\.)+/,!0),Yt.linkText}function Bi(Qt,zt){return Qt.eatSpace()?null:(Qt.match(/^[^\s]+/,!0),Qt.peek()===void 0?zt.linkTitle=!0:Qt.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),zt.f=zt.inline=Ge,Yt.linkHref+" url")}var so={startState:function(){return{f:Ht,prevLine:{stream:null},thisLine:{stream:null},block:Ht,htmlState:null,indentation:0,inline:Ge,text:re,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(Qt){return{f:Qt.f,prevLine:Qt.prevLine,thisLine:Qt.thisLine,block:Qt.block,htmlState:Qt.htmlState&&wt.copyState($e,Qt.htmlState),indentation:Qt.indentation,localMode:Qt.localMode,localState:Qt.localMode?wt.copyState(Qt.localMode,Qt.localState):null,inline:Qt.inline,text:Qt.text,formatting:!1,linkText:Qt.linkText,linkTitle:Qt.linkTitle,linkHref:Qt.linkHref,code:Qt.code,em:Qt.em,strong:Qt.strong,strikethrough:Qt.strikethrough,emoji:Qt.emoji,header:Qt.header,setext:Qt.setext,hr:Qt.hr,taskList:Qt.taskList,list:Qt.list,listStack:Qt.listStack.slice(0),quote:Qt.quote,indentedCode:Qt.indentedCode,trailingSpace:Qt.trailingSpace,trailingSpaceNewLine:Qt.trailingSpaceNewLine,md_inside:Qt.md_inside,fencedEndRE:Qt.fencedEndRE}},token:function(Qt,zt){if(zt.formatting=!1,Qt!=zt.thisLine.stream){if(zt.header=0,zt.hr=!1,Qt.match(/^\s*$/,!0))return Et(zt),null;if(zt.prevLine=zt.thisLine,zt.thisLine={stream:Qt},zt.taskList=!1,zt.trailingSpace=0,zt.trailingSpaceNewLine=!1,!zt.localState&&(zt.f=zt.block,zt.f!=Zt)){var He=Qt.match(/^\s*/,!0)[0].replace(/\t/g,lt).length;if(zt.indentation=He,zt.indentationDiff=null,He>0)return null}}return zt.f(Qt,zt)},innerMode:function(Qt){return Qt.block==Zt?{state:Qt.htmlState,mode:$e}:Qt.localState?{state:Qt.localState,mode:Qt.localMode}:{state:Qt,mode:so}},indent:function(Qt,zt,He){return Qt.block==Zt&&$e.indent?$e.indent(Qt.htmlState,zt,He):Qt.localState&&Qt.localMode.indent?Qt.localMode.indent(Qt.localState,zt,He):wt.Pass},blankLine:Et,getType:le,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return so},"xml"),wt.defineMIME("text/markdown","markdown"),wt.defineMIME("text/x-markdown","markdown")})},52539:function(un,Rn,Vt){(function(wt){wt(Vt(4631))})(function(wt){"use strict";wt.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var ue=0;ue<wt.modeInfo.length;ue++){var _e=wt.modeInfo[ue];_e.mimes&&(_e.mime=_e.mimes[0])}wt.findModeByMIME=function($e){$e=$e.toLowerCase();for(var ye=0;ye<wt.modeInfo.length;ye++){var oe=wt.modeInfo[ye];if(oe.mime==$e)return oe;if(oe.mimes){for(var Yt=0;Yt<oe.mimes.length;Yt++)if(oe.mimes[Yt]==$e)return oe}}if(/\+xml$/.test($e))return wt.findModeByMIME("application/xml");if(/\+json$/.test($e))return wt.findModeByMIME("application/json")},wt.findModeByExtension=function($e){$e=$e.toLowerCase();for(var ye=0;ye<wt.modeInfo.length;ye++){var oe=wt.modeInfo[ye];if(oe.ext){for(var Yt=0;Yt<oe.ext.length;Yt++)if(oe.ext[Yt]==$e)return oe}}},wt.findModeByFileName=function($e){for(var ye=0;ye<wt.modeInfo.length;ye++){var oe=wt.modeInfo[ye];if(oe.file&&oe.file.test($e))return oe}var Yt=$e.lastIndexOf("."),Ne=Yt>-1&&$e.substring(Yt+1,$e.length);if(Ne)return wt.findModeByExtension(Ne)},wt.findModeByName=function($e){$e=$e.toLowerCase();for(var ye=0;ye<wt.modeInfo.length;ye++){var oe=wt.modeInfo[ye];if(oe.name.toLowerCase()==$e)return oe;if(oe.alias){for(var Yt=0;Yt<oe.alias.length;Yt++)if(oe.alias[Yt].toLowerCase()==$e)return oe}}}})},80785:function(un,Rn,Vt){(function(wt){wt(Vt(4631))})(function(wt){"use strict";wt.defineMode("stex",function(ue,_e){"use strict";function $e(Ft,et){Ft.cmdState.push(et)}function ye(Ft){return Ft.cmdState.length>0?Ft.cmdState[Ft.cmdState.length-1]:null}function oe(Ft){var et=Ft.cmdState.pop();et&&et.closeBracket()}function Yt(Ft){for(var et=Ft.cmdState,nt=et.length-1;nt>=0;nt--){var ht=et[nt];if(ht.name!="DEFAULT")return ht}return{styleIdentifier:function(){return null}}}function Ne(Ft,et,nt){return function(){this.name=Ft,this.bracketNo=0,this.style=et,this.styles=nt,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var ge={};ge.importmodule=Ne("importmodule","tag",["string","builtin"]),ge.documentclass=Ne("documentclass","tag",["","atom"]),ge.usepackage=Ne("usepackage","tag",["atom"]),ge.begin=Ne("begin","tag",["atom"]),ge.end=Ne("end","tag",["atom"]),ge.label=Ne("label","tag",["atom"]),ge.ref=Ne("ref","tag",["atom"]),ge.eqref=Ne("eqref","tag",["atom"]),ge.cite=Ne("cite","tag",["atom"]),ge.bibitem=Ne("bibitem","tag",["atom"]),ge.Bibitem=Ne("Bibitem","tag",["atom"]),ge.RBibitem=Ne("RBibitem","tag",["atom"]),ge.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function we(Ft,et){Ft.f=et}function Ye(Ft,et){var nt;if(Ft.match(/^\\[a-zA-Z@]+/)){var ht=Ft.current().slice(1);return nt=ge.hasOwnProperty(ht)?ge[ht]:ge.DEFAULT,nt=new nt,$e(et,nt),we(et,on),nt.style}if(Ft.match(/^\\[$&%#{}_]/)||Ft.match(/^\\[,;!\/\\]/))return"tag";if(Ft.match("\\["))return we(et,function(pt,vt){return Be(pt,vt,"\\]")}),"keyword";if(Ft.match("\\("))return we(et,function(pt,vt){return Be(pt,vt,"\\)")}),"keyword";if(Ft.match("$$"))return we(et,function(pt,vt){return Be(pt,vt,"$$")}),"keyword";if(Ft.match("$"))return we(et,function(pt,vt){return Be(pt,vt,"$")}),"keyword";var lt=Ft.next();if(lt=="%")return Ft.skipToEnd(),"comment";if(lt=="}"||lt=="]"){if(nt=ye(et),nt)nt.closeBracket(lt),we(et,on);else return"error";return"bracket"}else return lt=="{"||lt=="["?(nt=ge.DEFAULT,nt=new nt,$e(et,nt),"bracket"):/\d/.test(lt)?(Ft.eatWhile(/[\w.%]/),"atom"):(Ft.eatWhile(/[\w\-_]/),nt=Yt(et),nt.name=="begin"&&(nt.argument=Ft.current()),nt.styleIdentifier())}function Be(Ft,et,nt){if(Ft.eatSpace())return null;if(nt&&Ft.match(nt))return we(et,Ye),"keyword";if(Ft.match(/^\\[a-zA-Z@]+/))return"tag";if(Ft.match(/^[a-zA-Z]+/))return"variable-2";if(Ft.match(/^\\[$&%#{}_]/)||Ft.match(/^\\[,;!\/]/)||Ft.match(/^[\^_&]/))return"tag";if(Ft.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Ft.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var ht=Ft.next();return ht=="{"||ht=="}"||ht=="["||ht=="]"||ht=="("||ht==")"?"bracket":ht=="%"?(Ft.skipToEnd(),"comment"):"error"}function on(Ft,et){var nt=Ft.peek(),ht;return nt=="{"||nt=="["?(ht=ye(et),ht.openBracket(nt),Ft.eat(nt),we(et,Ye),"bracket"):/[ \t\r]/.test(nt)?(Ft.eat(nt),null):(we(et,Ye),oe(et),Ye(Ft,et))}return{startState:function(){var Ft=_e.inMathMode?function(et,nt){return Be(et,nt)}:Ye;return{cmdState:[],f:Ft}},copyState:function(Ft){return{cmdState:Ft.cmdState.slice(),f:Ft.f}},token:function(Ft,et){return et.f(Ft,et)},blankLine:function(Ft){Ft.f=Ye,Ft.cmdState.length=0},lineComment:"%"}}),wt.defineMIME("text/x-stex","stex"),wt.defineMIME("text/x-latex","stex")})},29589:function(un,Rn,Vt){(function(wt){wt(Vt(4631))})(function(wt){"use strict";var ue={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},_e={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};wt.defineMode("xml",function($e,ye){var oe=$e.indentUnit,Yt={},Ne=ye.htmlMode?ue:_e;for(var ge in Ne)Yt[ge]=Ne[ge];for(var ge in ye)Yt[ge]=ye[ge];var we,Ye;function Be(fe,Ke){function an(oi){return Ke.tokenize=oi,oi(fe,Ke)}var nn=fe.next();if(nn=="<")return fe.eat("!")?fe.eat("[")?fe.match("CDATA[")?an(et("atom","]]>")):null:fe.match("--")?an(et("comment","-->")):fe.match("DOCTYPE",!0,!0)?(fe.eatWhile(/[\w\._\-]/),an(nt(1))):null:fe.eat("?")?(fe.eatWhile(/[\w\._\-]/),Ke.tokenize=et("meta","?>"),"meta"):(we=fe.eat("/")?"closeTag":"openTag",Ke.tokenize=on,"tag bracket");if(nn=="&"){var Si;return fe.eat("#")?fe.eat("x")?Si=fe.eatWhile(/[a-fA-F\d]/)&&fe.eat(";"):Si=fe.eatWhile(/[\d]/)&&fe.eat(";"):Si=fe.eatWhile(/[\w\.\-:]/)&&fe.eat(";"),Si?"atom":"error"}else return fe.eatWhile(/[^&<]/),null}Be.isInText=!0;function on(fe,Ke){var an=fe.next();if(an==">"||an=="/"&&fe.eat(">"))return Ke.tokenize=Be,we=an==">"?"endTag":"selfcloseTag","tag bracket";if(an=="=")return we="equals",null;if(an=="<"){Ke.tokenize=Be,Ke.state=vt,Ke.tagName=Ke.tagStart=null;var nn=Ke.tokenize(fe,Ke);return nn?nn+" tag error":"tag error"}else return/[\'\"]/.test(an)?(Ke.tokenize=Ft(an),Ke.stringStartCol=fe.column(),Ke.tokenize(fe,Ke)):(fe.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Ft(fe){var Ke=function(an,nn){for(;!an.eol();)if(an.next()==fe){nn.tokenize=on;break}return"string"};return Ke.isInAttribute=!0,Ke}function et(fe,Ke){return function(an,nn){for(;!an.eol();){if(an.match(Ke)){nn.tokenize=Be;break}an.next()}return fe}}function nt(fe){return function(Ke,an){for(var nn;(nn=Ke.next())!=null;){if(nn=="<")return an.tokenize=nt(fe+1),an.tokenize(Ke,an);if(nn==">")if(fe==1){an.tokenize=Be;break}else return an.tokenize=nt(fe-1),an.tokenize(Ke,an)}return"meta"}}function ht(fe,Ke,an){this.prev=fe.context,this.tagName=Ke,this.indent=fe.indented,this.startOfLine=an,(Yt.doNotIndent.hasOwnProperty(Ke)||fe.context&&fe.context.noIndent)&&(this.noIndent=!0)}function lt(fe){fe.context&&(fe.context=fe.context.prev)}function pt(fe,Ke){for(var an;;){if(!fe.context||(an=fe.context.tagName,!Yt.contextGrabbers.hasOwnProperty(an)||!Yt.contextGrabbers[an].hasOwnProperty(Ke)))return;lt(fe)}}function vt(fe,Ke,an){return fe=="openTag"?(an.tagStart=Ke.column(),kt):fe=="closeTag"?Et:vt}function kt(fe,Ke,an){return fe=="word"?(an.tagName=Ke.current(),Ye="tag",ie):Yt.allowMissingTagName&&fe=="endTag"?(Ye="tag bracket",ie(fe,Ke,an)):(Ye="error",kt)}function Et(fe,Ke,an){if(fe=="word"){var nn=Ke.current();return an.context&&an.context.tagName!=nn&&Yt.implicitlyClosed.hasOwnProperty(an.context.tagName)&&lt(an),an.context&&an.context.tagName==nn||Yt.matchClosing===!1?(Ye="tag",Ht):(Ye="tag error",Zt)}else return Yt.allowMissingTagName&&fe=="endTag"?(Ye="tag bracket",Ht(fe,Ke,an)):(Ye="error",Zt)}function Ht(fe,Ke,an){return fe!="endTag"?(Ye="error",Ht):(lt(an),vt)}function Zt(fe,Ke,an){return Ye="error",Ht(fe,Ke,an)}function ie(fe,Ke,an){if(fe=="word")return Ye="attribute",le;if(fe=="endTag"||fe=="selfcloseTag"){var nn=an.tagName,Si=an.tagStart;return an.tagName=an.tagStart=null,fe=="selfcloseTag"||Yt.autoSelfClosers.hasOwnProperty(nn)?pt(an,nn):(pt(an,nn),an.context=new ht(an,nn,Si==an.indented)),vt}return Ye="error",ie}function le(fe,Ke,an){return fe=="equals"?re:(Yt.allowMissing||(Ye="error"),ie(fe,Ke,an))}function re(fe,Ke,an){return fe=="string"?Ge:fe=="word"&&Yt.allowUnquoted?(Ye="string",ie):(Ye="error",ie(fe,Ke,an))}function Ge(fe,Ke,an){return fe=="string"?Ge:ie(fe,Ke,an)}return{startState:function(fe){var Ke={tokenize:Be,state:vt,indented:fe||0,tagName:null,tagStart:null,context:null};return fe!=null&&(Ke.baseIndent=fe),Ke},token:function(fe,Ke){if(!Ke.tagName&&fe.sol()&&(Ke.indented=fe.indentation()),fe.eatSpace())return null;we=null;var an=Ke.tokenize(fe,Ke);return(an||we)&&an!="comment"&&(Ye=null,Ke.state=Ke.state(we||an,fe,Ke),Ye&&(an=Ye=="error"?an+" error":Ye)),an},indent:function(fe,Ke,an){var nn=fe.context;if(fe.tokenize.isInAttribute)return fe.tagStart==fe.indented?fe.stringStartCol+1:fe.indented+oe;if(nn&&nn.noIndent)return wt.Pass;if(fe.tokenize!=on&&fe.tokenize!=Be)return an?an.match(/^(\s*)/)[0].length:0;if(fe.tagName)return Yt.multilineTagIndentPastTag!==!1?fe.tagStart+fe.tagName.length+2:fe.tagStart+oe*(Yt.multilineTagIndentFactor||1);if(Yt.alignCDATA&&/<!\[CDATA\[/.test(Ke))return 0;var Si=Ke&&/^<(\/)?([\w_:\.-]*)/.exec(Ke);if(Si&&Si[1])for(;nn;)if(nn.tagName==Si[2]){nn=nn.prev;break}else if(Yt.implicitlyClosed.hasOwnProperty(nn.tagName))nn=nn.prev;else break;else if(Si)for(;nn;){var oi=Yt.contextGrabbers[nn.tagName];if(oi&&oi.hasOwnProperty(Si[2]))nn=nn.prev;else break}for(;nn&&nn.prev&&!nn.startOfLine;)nn=nn.prev;return nn?nn.indent+oe:fe.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Yt.htmlMode?"html":"xml",helperType:Yt.htmlMode?"html":"xml",skipAttribute:function(fe){fe.state==re&&(fe.state=ie)},xmlCurrentTag:function(fe){return fe.tagName?{name:fe.tagName,close:fe.type=="closeTag"}:null},xmlCurrentContext:function(fe){for(var Ke=[],an=fe.context;an;an=an.prev)an.tagName&&Ke.push(an.tagName);return Ke.reverse()}}}),wt.defineMIME("text/xml","xml"),wt.defineMIME("application/xml","xml"),wt.mimeModes.hasOwnProperty("text/html")||wt.defineMIME("text/html",{name:"xml",htmlMode:!0})})},23495:function(un,Rn,Vt){"use strict";Vt.d(Rn,{$u:function(){return ge},BD:function(){return Rt},E9:function(){return Ne},FF:function(){return Wr},FJ:function(){return vt},Hn:function(){return pt},KX:function(){return Et},NB:function(){return Yn},S0:function(){return Ae},UL:function(){return we},Vk:function(){return lt},Vm:function(){return Pn},YI:function(){return hn},ZA:function(){return _e},Zt:function(){return Ye},al:function(){return Nt},bn:function(){return _t},bx:function(){return Lt},g2:function(){return De},h1:function(){return re},hD:function(){return dr},l4:function(){return oe},rU:function(){return Ci},s_:function(){return Ct},uz:function(){return Gn},z6:function(){return Be}}),un=Vt.hmd(un),function(){var xt;function en(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function vn(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:en(a)}}function mi(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var li=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},hi;if(typeof Object.setPrototypeOf=="function")hi=Object.setPrototypeOf;else{var Fi;t:{var to={a:!0},Ce={};try{Ce.__proto__=to,Fi=Ce.a;break t}catch(a){}Fi=!1}hi=Fi?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var Oe=hi;function ee(a,y){if(a.prototype=li(y.prototype),a.prototype.constructor=a,Oe)Oe(a,y);else for(var x in y)if(x!="prototype")if(Object.defineProperties){var E=Object.getOwnPropertyDescriptor(y,x);E&&Object.defineProperty(a,x,E)}else a[x]=y[x];a.QA=y.prototype}var Ie=typeof Vt.g!="undefined"&&Vt.g!=null?Vt.g:self,Tn=typeof Object.assign=="function"?Object.assign:function(a,y){for(var x=1;x<arguments.length;x++){var E=arguments[x];if(E)for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(a[b]=E[b])}return a},Hn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function Bn(a,y){if(y){var x=Ie;a=a.split(".");for(var E=0;E<a.length-1;E++){var b=a[E];b in x||(x[b]={}),x=x[b]}a=a[a.length-1],E=x[a],y=y(E),y!=E&&y!=null&&Hn(x,a,{writable:!0,value:y})}}Bn("Object.assign",function(a){return a||Tn}),Bn("Array.prototype.fill",function(a){return a||function(y,x,E){var b=this.length||0;for(0>x&&(x=Math.max(0,b+x)),(E==null||E>b)&&(E=b),E=Number(E),0>E&&(E=Math.max(0,b+E)),x=Number(x||0);x<E;x++)this[x]=y;return this}});var me=typeof globalThis=="object"&&globalThis||typeof Vt.g=="object"&&Vt.g.global===Vt.g&&Vt.g||typeof self=="object"&&self.self===self&&self||{};me.requestAnimationFrame===void 0&&(me.setImmediate===void 0?me.requestAnimationFrame=function(a){me.setTimeout(a,0)}:me.requestAnimationFrame=me.setImmediate);function Ze(){}function Xn(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&me.clearTimeout(x),x=Ni(function(){x=-1,a.apply(E,b)},y)}}function Ni(a,y){return me.setTimeout(a,y)}function sn(a){return me.document.createElement(a)}function de(a){throw Error(a)}function bn(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),de(a)}function qn(a,y,x,E){x=x===null?"*":typeof x=="string"?x:typeof x=="function"&&typeof x.className=="string"?x.className:"",E!==void 0&&(x+="."+E),de(x+" is not in the range "+y+": "+a)}function Di(a){me.console&&me.console.log(a)}function Ve(a){return typeof a=="object"&&a!==null}function jn(a){return Array.isArray(a)||me.NodeList&&a instanceof me.NodeList||me.HTMLCollection&&a instanceof me.HTMLCollection}function wo(a){return Array.prototype.slice.call(a)}function Ho(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):de("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function fo(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):de("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function Un(){var a=zi.pop();return a===void 0?[]:a}function _n(a){a.length=0,zi.push(a)}function ti(a){if(typeof a=="function"){if(a.className)return a.className;if(a.name)return a.name;var y=a.toString();if(y=y.substring(9,y.indexOf("(")).trim(),y!=="")return a._className=y}else if(Ve(a)&&a.constructor)return ti(a.constructor);return typeof a}function Yi(a){var y=a;return Ve(a)&&(a.text?y=a.text:a.name?y=a.name:a.key!==void 0?y=a.key:a.id!==void 0?y=a.id:a.constructor===Object&&(a.Text?y=a.Text:a.Name?y=a.Name:a.Key!==void 0?y=a.Key:a.Id!==void 0?y=a.Id:a.ID!==void 0&&(y=a.ID))),y===void 0?"undefined":y===null?"null":y.toString()}function Co(a,y){if(a.hasOwnProperty(y))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(y))return!0;var x=a.CA;if(x&&x[y])return!0;a=Object.getPrototypeOf(a)}return!1}function ne(a,y,x){Object.defineProperty(ko.prototype,a,{get:y,set:x})}function xe(a){for(var y=[],x=0;256>x;x++)y["0123456789abcdef".charAt(x>>4)+"0123456789abcdef".charAt(x&15)]=String.fromCharCode(x);a.length%2&&(a="0"+a),x=[];for(var E=0,b=0;b<a.length;b+=2)x[E++]=y[a.substr(b,2)];for(a=x.join(""),a=a===""?"0":a,y=[],x=0;256>x;x++)y[x]=x;for(x=E=0;256>x;x++)E=(E+y[x]+119)%256,b=y[x],y[x]=y[E],y[E]=b;E=x=0;for(var z="",tt=0;tt<a.length;tt++)x=(x+1)%256,E=(E+y[x])%256,b=y[x],y[x]=y[E],y[E]=b,z+=String.fromCharCode(a.charCodeAt(tt)^y[(y[x]+y[E])%256]);return z.indexOf("GoJS 2.1 evaluation")>-1||z.indexOf("\xA9 1998-2021 Northwoods Software")>-1||z.indexOf("Not for distribution or production use")>-1||z.indexOf("gojs.net")>-1?"":z}var Pe=me.navigator!==void 0&&0<me.navigator.userAgent.indexOf("Trident/7"),kn=me.navigator!==void 0&&me.navigator.platform!==void 0&&me.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,zi=[];Object.freeze([]),Ze.className="Util",Ze.Dx="32ab5ff3b26f42dc0ed90f21472913b5",Ze.adym="gojs.net",Ze.vfo="28e645fdb266",Ze.className="Util";function ae(a,y,x){vi(this),this.j=a,this.xa=y,this.o=x}ae.prototype.toString=function(){return"EnumValue."+this.xa};function Mn(a,y){return y==null||y===""?null:a[y]}Ie.Object.defineProperties(ae.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),ae.className="EnumValue";function cn(){this.ew=[]}cn.prototype.toString=function(){return this.ew.join("")},cn.prototype.add=function(a){a!==""&&this.ew.push(a)},cn.className="StringBuilder";function Se(){}Se.className="PropertyCollection";var $n={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){me.console&&me.console.log(a)},HA:function(a,y,x,E){a.strokeStyle="red",a.fillStyle="red",a.font="8px sans-serif",a.beginPath(),a.moveTo(-10,0),a.lineTo(10,0),a.moveTo(0,-10),a.lineTo(0,10),a.stroke(),a.setTransform(1,0,0,1,0,0),a.scale(x,x),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.lineWidth=2,a.beginPath(),a.moveTo(E.left,E.top+20),a.lineTo(E.left,E.top),a.lineTo(E.left+20,E.top),a.moveTo(E.right,E.bottom-20),a.lineTo(E.right,E.bottom),a.lineTo(E.right-20,E.bottom),a.stroke(),a.fillText("DB: "+Math.round(E.x)+", "+Math.round(E.y)+", "+Math.round(E.width)+", "+Math.round(E.height),E.left,E.top-5)},DA:function(a){var y={},x;for(x in a){if(y.x=x,y.x!=="licenseKey"){var E=a[y.x];if(E.prototype!==void 0){y.Zl=Object.getOwnPropertyNames(E.prototype);for(var b={Tj:0};b.Tj<y.Zl.length;b={Tj:b.Tj},b.Tj++){var z=Object.getOwnPropertyDescriptor(E.prototype,y.Zl[b.Tj]);z.get!==void 0&&z.set===void 0&&Object.defineProperty(E.prototype,y.Zl[b.Tj],{set:function(tt,ot){return function(){throw Error("Property "+tt.Zl[ot.Tj]+" of "+tt.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function Vn(){}Vn.prototype.reset=function(){},Vn.prototype.next=function(){return!1},Vn.prototype.Ad=function(){return!1},Vn.prototype.first=function(){return null},Vn.prototype.any=function(){return!1},Vn.prototype.all=function(){return!0},Vn.prototype.each=function(){return this},Vn.prototype.map=function(){return this},Vn.prototype.filter=function(){return this},Vn.prototype.de=function(){},Vn.prototype.toString=function(){return"EmptyIterator"},Ie.Object.defineProperties(Vn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Vn.prototype.first=Vn.prototype.first,Vn.prototype.hasNext=Vn.prototype.Ad,Vn.prototype.next=Vn.prototype.next,Vn.prototype.reset=Vn.prototype.reset;var ui=null;Vn.className="EmptyIterator",ui=new Vn;function di(a){this.key=-1,this.value=a}di.prototype.reset=function(){this.key=-1},di.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},di.prototype.Ad=function(){return this.next()},di.prototype.first=function(){return this.key=0,this.value},di.prototype.any=function(a){return this.key=-1,a(this.value)},di.prototype.all=function(a){return this.key=-1,a(this.value)},di.prototype.each=function(a){return this.key=-1,a(this.value),this},di.prototype.map=function(a){return new di(a(this.value))},di.prototype.filter=function(a){return a(this.value)?new di(this.value):ui},di.prototype.de=function(){this.value=null},di.prototype.toString=function(){return"SingletonIterator("+this.value+")"},Ie.Object.defineProperties(di.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),di.prototype.first=di.prototype.first,di.prototype.hasNext=di.prototype.Ad,di.prototype.next=di.prototype.next,di.prototype.reset=di.prototype.reset,di.className="SingletonIterator";function fi(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}fi.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},fi.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;a=a.s;var y=a.length,x=++this.Za,E=this.qf;if(E!==null)for(;x<y;){var b=a[x];if(E(b))return this.key=this.Za=x,this.value=b,!0;x++}else{if(x<y)return this.key=x,this.value=a[x],!0;this.de()}return!1},fi.prototype.Ad=function(){return this.next()},fi.prototype.first=function(){var a=this.Bb;this.qa=a.Ja,this.Za=0,a=a.s;var y=a.length,x=this.qf;if(x!==null){for(var E=0;E<y;){var b=a[E];if(x(b))return this.key=this.Za=E,this.value=b;E++}return null}return 0<y?(a=a[0],this.key=0,this.value=a):null},fi.prototype.any=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&a(z))return!0}return!1},fi.prototype.all=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&!a(z))return!1}return!0},fi.prototype.each=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];(E===null||E(z))&&a(z)}return this},fi.prototype.map=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&x.push(a(tt))}return a=new be,a.s=x,a.xb(),a.iterator},fi.prototype.filter=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&a(tt)&&x.push(tt)}return a=new be,a.s=x,a.xb(),a.iterator},fi.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},fi.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},Ie.Object.defineProperties(fi.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.qf},set:function(a){this.qf=a}},count:{get:function(){var a=this.qf;if(a!==null){for(var y=0,x=this.Bb.s,E=x.length,b=0;b<E;b++)a(x[b])&&y++;return y}return this.Bb.s.length}}}),fi.prototype.first=fi.prototype.first,fi.prototype.hasNext=fi.prototype.Ad,fi.prototype.next=fi.prototype.next,fi.prototype.reset=fi.prototype.reset,fi.className="ListIterator";function In(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}In.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},In.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;var y=--this.Za;return 0<=y?(this.key=y,this.value=a.s[y],!0):(this.de(),!1)},In.prototype.Ad=function(){return this.next()},In.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;var y=a.s;return this.Za=a=y.length-1,0<=a?(y=y[a],this.key=a,this.value=y):null},In.prototype.any=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(a(y[x]))return!0;return!1},In.prototype.all=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(!a(y[x]))return!1;return!0},In.prototype.each=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)a(y[x]);return this},In.prototype.map=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--)x.push(a(y[E]));return a=new be,a.s=x,a.xb(),a.iterator},In.prototype.filter=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--){var b=y[E];a(b)&&x.push(b)}return a=new be,a.s=x,a.xb(),a.iterator},In.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},In.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},Ie.Object.defineProperties(In.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),In.prototype.first=In.prototype.first,In.prototype.hasNext=In.prototype.Ad,In.prototype.next=In.prototype.next,In.prototype.reset=In.prototype.reset,In.className="ListIteratorBackwards";function be(a){vi(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&de("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=be.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"List()#"+qt(this)},xt.add=function(a){return a===null?this:(this._isFrozen&&bn(this,a),this.s.push(a),this.xb(),this)},xt.push=function(a){this.add(a)},xt.addAll=function(a){if(a===null)return this;this._isFrozen&&bn(this);var y=this.s;if(jn(a))for(var x=a.length,E=0;E<x;E++)y.push(a[E]);else for(a=a.iterator;a.next();)y.push(a.value);return this.xb(),this},xt.clear=function(){this._isFrozen&&bn(this),this.s.length=0,this.xb()},xt.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},xt.has=function(a){return this.contains(a)},xt.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},xt.M=function(a){var y=this.s;return(0>a||a>=y.length)&&qn(a,"0 <= i < length",be,"elt:i"),y[a]},xt.get=function(a){return this.M(a)},xt.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&qn(a,"0 <= i < length",be,"setElt:i"),this._isFrozen&&bn(this,a),x[a]=y},xt.set=function(a,y){this.cd(a,y)},xt.first=function(){var a=this.s;return a.length===0?null:a[0]},xt.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},xt.pop=function(){this._isFrozen&&bn(this);var a=this.s;return 0<a.length?a.pop():null},be.prototype.any=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(a(y[E]))return!0;return!1},be.prototype.all=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(!a(y[E]))return!1;return!0},be.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},be.prototype.map=function(a){for(var y=new be,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},be.prototype.filter=function(a){for(var y=new be,x=[],E=this.s,b=E.length,z=0;z<b;z++){var tt=E[z];a(tt)&&x.push(tt)}return y.s=x,y.xb(),y},xt=be.prototype,xt.Gb=function(a,y){0>a&&qn(a,">= 0",be,"insertAt:i"),this._isFrozen&&bn(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},xt.remove=function(a){if(a===null)return!1;this._isFrozen&&bn(this,a);var y=this.s;return a=y.indexOf(a),a===-1?!1:(a===y.length-1?y.pop():y.splice(a,1),this.xb(),!0)},xt.delete=function(a){return this.remove(a)},xt.mb=function(a){var y=this.s;(0>a||a>=y.length)&&qn(a,"0 <= i < length",be,"removeAt:i"),this._isFrozen&&bn(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},xt.removeRange=function(a,y){var x=this.s,E=x.length;if(0>a)a=0;else if(a>=E)return this;if(0>y)return this;if(y>=E&&(y=E-1),a>y)return this;this._isFrozen&&bn(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},be.prototype.copy=function(){var a=new be,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},xt=be.prototype,xt.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},xt.Iv=function(){for(var a=new ke,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},xt.sort=function(a){return this._isFrozen&&bn(this),this.s.sort(a),this.xb(),this},xt.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&bn(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&qn(y,"0 <= from < length",be,"sortRange:from"),z===2)return x=E[y],b=E[y+1],0<a(x,b)&&(E[y]=b,E[y+1]=x,this.xb()),this;if(y===0)if(x>=b)E.sort(a);else for(y=E.slice(0,x),y.sort(a),a=0;a<x;a++)E[a]=y[a];else if(x>=b)for(x=E.slice(y),x.sort(a),a=y;a<b;a++)E[a]=x[a-y];else for(b=E.slice(y,x),b.sort(a),a=y;a<x;a++)E[a]=b[a-y];return this.xb(),this},xt.reverse=function(){return this._isFrozen&&bn(this),this.s.reverse(),this.xb(),this},Ie.Object.defineProperties(be.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return ui;var a=this.Sa;return a!==null?(a.reset(),a):new fi(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return ui;var a=this.Hg;return a!==null?(a.reset(),a):new In(this)}}}),be.prototype.reverse=be.prototype.reverse,be.prototype.sortRange=be.prototype.zi,be.prototype.sort=be.prototype.sort,be.prototype.toSet=be.prototype.Iv,be.prototype.toArray=be.prototype.Fa,be.prototype.removeRange=be.prototype.removeRange,be.prototype.removeAt=be.prototype.mb,be.prototype.delete=be.prototype.delete,be.prototype.remove=be.prototype.remove,be.prototype.insertAt=be.prototype.Gb,be.prototype.pop=be.prototype.pop,be.prototype.last=be.prototype.jc,be.prototype.first=be.prototype.first,be.prototype.set=be.prototype.set,be.prototype.setElt=be.prototype.cd,be.prototype.get=be.prototype.get,be.prototype.elt=be.prototype.M,be.prototype.indexOf=be.prototype.indexOf,be.prototype.has=be.prototype.has,be.prototype.contains=be.prototype.contains,be.prototype.clear=be.prototype.clear,be.prototype.addAll=be.prototype.addAll,be.prototype.push=be.prototype.push,be.prototype.add=be.prototype.add,be.prototype.thaw=be.prototype.ka,be.prototype.freeze=be.prototype.freeze,be.className="List";function Gi(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}Gi.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},Gi.prototype.next=function(){var a=this.eg;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},Gi.prototype.Ad=function(){return this.next()},Gi.prototype.first=function(){var a=this.eg;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},Gi.prototype.any=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Gi.prototype.all=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Gi.prototype.each=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},Gi.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new be;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Gi.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new be;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},Gi.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},Gi.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},Ie.Object.defineProperties(Gi.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),Gi.prototype.first=Gi.prototype.first,Gi.prototype.hasNext=Gi.prototype.Ad,Gi.prototype.next=Gi.prototype.next,Gi.prototype.reset=Gi.prototype.reset,Gi.className="SetIterator";function ke(a){vi(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&de("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=ke.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"Set()#"+qt(this)},xt.add=function(a){if(a===null)return this;this._isFrozen&&bn(this,a);var y=a;return Ve(a)&&(y=co(a)),this.Tb[y]===void 0&&(this.Sb++,a=new Kn(a,a),this.Tb[y]=a,y=this.kf,y===null?this.ea=a:(a.ll=y,y.va=a),this.kf=a,this.xb()),this},xt.addAll=function(a){if(a===null)return this;if(this._isFrozen&&bn(this),jn(a))for(var y=a.length,x=0;x<y;x++)this.add(a[x]);else for(a=a.iterator;a.next();)this.add(a.value);return this},xt.contains=function(a){if(a===null)return!1;var y=a;return Ve(a)&&(y=qt(a),y===void 0)?!1:this.Tb[y]!==void 0},xt.has=function(a){return this.contains(a)},xt.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},xt.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},xt.first=function(){var a=this.ea;return a===null?null:a.value},ke.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},ke.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},ke.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},ke.prototype.map=function(a){for(var y=new ke,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},ke.prototype.filter=function(a){for(var y=new ke,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},xt=ke.prototype,xt.remove=function(a){if(a===null)return!1;this._isFrozen&&bn(this,a);var y=a;if(Ve(a)&&(y=qt(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},xt.delete=function(a){return this.remove(a)},xt.hp=function(a){if(a===null)return this;if(this._isFrozen&&bn(this),jn(a))for(var y=a.length,x=0;x<y;x++)this.remove(a[x]);else for(a=a.iterator;a.next();)this.remove(a.value);return this},xt.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&bn(this);var y=new ke;y.addAll(a),a=[];for(var x=this.iterator;x.next();){var E=x.value;y.contains(E)||a.push(E)}return this.hp(a),this},xt.clear=function(){this._isFrozen&&bn(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},ke.prototype.copy=function(){var a=new ke,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},ke.prototype.Fa=function(){var a=Array(this.Sb),y=this.Tb,x=0,E;for(E in y)a[x]=y[E].value,x++;return a},ke.prototype.Hv=function(){var a=new be,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function vi(a){a.__gohashid=se++}function co(a){var y=a.__gohashid;return y===void 0&&(y=se++,a.__gohashid=y),y}function qt(a){return a.__gohashid}Ie.Object.defineProperties(ke.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return ui;var a=this.Sa;return a!==null?(a.reset(),a):new Gi(this)}}}),ke.prototype.toList=ke.prototype.Hv,ke.prototype.toArray=ke.prototype.Fa,ke.prototype.clear=ke.prototype.clear,ke.prototype.retainAll=ke.prototype.pA,ke.prototype.removeAll=ke.prototype.hp,ke.prototype.delete=ke.prototype.delete,ke.prototype.remove=ke.prototype.remove,ke.prototype.first=ke.prototype.first,ke.prototype.containsAny=ke.prototype.Ty,ke.prototype.containsAll=ke.prototype.Sy,ke.prototype.has=ke.prototype.has,ke.prototype.contains=ke.prototype.contains,ke.prototype.addAll=ke.prototype.addAll,ke.prototype.add=ke.prototype.add,ke.prototype.thaw=ke.prototype.ka,ke.prototype.freeze=ke.prototype.freeze;var se=1;ke.className="Set",ke.uniqueHash=vi,ke.hashIdUnique=co,ke.hashId=qt;function ve(a){this.ma=a,this.qa=a.Ja,this.sa=null}ve.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},ve.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=this.key=a=y.key,!0):(this.de(),!1)},ve.prototype.Ad=function(){return this.next()},ve.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.value=this.key=a=a.key):null},ve.prototype.any=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},ve.prototype.all=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},ve.prototype.each=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;)a(y.key),y=y.va;return this},ve.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new be;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},ve.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new be;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},ve.prototype.de=function(){this.value=this.key=null,this.qa=-1},ve.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},Ie.Object.defineProperties(ve.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ve.prototype.first=ve.prototype.first,ve.prototype.hasNext=ve.prototype.Ad,ve.prototype.next=ve.prototype.next,ve.prototype.reset=ve.prototype.reset,ve.className="MapKeySetIterator";function je(a){ke.call(this),vi(this),this._isFrozen=!0,this.ma=a}ee(je,ke),xt=je.prototype,xt.freeze=function(){return this},xt.ka=function(){return this},xt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},xt.add=function(){de("This Set is read-only: "+this.toString())},xt.contains=function(a){return this.ma.contains(a)},xt.has=function(a){return this.contains(a)},xt.remove=function(){de("This Set is read-only: "+this.toString())},xt.delete=function(a){return this.remove(a)},xt.clear=function(){de("This Set is read-only: "+this.toString())},xt.first=function(){var a=this.ma.ea;return a!==null?a.key:null},je.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},je.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},je.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},je.prototype.map=function(a){for(var y=new ke,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},je.prototype.filter=function(a){for(var y=new ke,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},je.prototype.copy=function(){return new je(this.ma)},je.prototype.Iv=function(){var a=new ke,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},je.prototype.Fa=function(){var a=this.ma.Tb,y=Array(this.ma.Sb),x=0,E;for(E in a)y[x]=a[E].key,x++;return y},je.prototype.Hv=function(){var a=new be,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Ie.Object.defineProperties(je.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?ui:new ve(this.ma)}}}),je.prototype.toList=je.prototype.Hv,je.prototype.toArray=je.prototype.Fa,je.prototype.toSet=je.prototype.Iv,je.prototype.first=je.prototype.first,je.prototype.clear=je.prototype.clear,je.prototype.delete=je.prototype.delete,je.prototype.remove=je.prototype.remove,je.prototype.has=je.prototype.has,je.prototype.contains=je.prototype.contains,je.prototype.add=je.prototype.add,je.prototype.thaw=je.prototype.ka,je.prototype.freeze=je.prototype.freeze,je.className="MapKeySet";function fn(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}fn.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},fn.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},fn.prototype.Ad=function(){return this.next()},fn.prototype.first=function(){var a=this.ma;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},fn.prototype.any=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},fn.prototype.all=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},fn.prototype.each=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},fn.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new be;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},fn.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new be;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},fn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},fn.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},Ie.Object.defineProperties(fn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),fn.prototype.first=fn.prototype.first,fn.prototype.hasNext=fn.prototype.Ad,fn.prototype.next=fn.prototype.next,fn.prototype.reset=fn.prototype.reset,fn.className="MapValueSetIterator";function Kn(a,y){this.key=a,this.value=y,this.ll=this.va=null}Kn.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Kn.className="KeyValuePair";function yn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}yn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},yn.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.key=y.key,this.value=y.value,!0):(this.de(),!1)},yn.prototype.Ad=function(){return this.next()},yn.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.key=a.key,this.value=a.value,a):null},yn.prototype.any=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},yn.prototype.all=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},yn.prototype.each=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y),y=y.va;return this},yn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new be;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},yn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new be;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},yn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},yn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},Ie.Object.defineProperties(yn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),yn.prototype.first=yn.prototype.first,yn.prototype.hasNext=yn.prototype.Ad,yn.prototype.next=yn.prototype.next,yn.prototype.reset=yn.prototype.reset,yn.className="MapIterator";function qe(a){vi(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&de("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=qe.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"Map()#"+qt(this)},xt.add=function(a,y){this._isFrozen&&bn(this,a);var x=a;Ve(a)&&(x=co(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new Kn(a,y),this.Tb[x]=a,x=this.kf,x===null?this.ea=a:(a.ll=x,x.va=a),this.kf=a,this.xb()):E.value=y,this},xt.set=function(a,y){return this.add(a,y)},xt.addAll=function(a){if(a===null)return this;if(jn(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];this.add(E.key,E.value)}else if(a instanceof qe)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)y=a.value,this.add(y.key,y.value);return this},xt.first=function(){return this.ea},qe.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},qe.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},qe.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},qe.prototype.map=function(a){for(var y=new qe,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},qe.prototype.filter=function(a){for(var y=new qe,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},xt=qe.prototype,xt.contains=function(a){var y=a;return Ve(a)&&(y=qt(a),y===void 0)?!1:this.Tb[y]!==void 0},xt.has=function(a){return this.contains(a)},xt.I=function(a){var y=a;return Ve(a)&&(y=qt(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},xt.get=function(a){return this.I(a)},xt.remove=function(a){if(a===null)return!1;this._isFrozen&&bn(this,a);var y=a;if(Ve(a)&&(y=qt(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},xt.delete=function(a){return this.remove(a)},xt.clear=function(){this._isFrozen&&bn(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.jf!==null&&this.jf.reset(),this.kf=this.ea=null,this.xb()},qe.prototype.copy=function(){var a=new qe,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},qe.prototype.Fa=function(){var a=this.Tb,y=Array(this.Sb),x=0,E;for(E in a){var b=a[E];y[x]=new Kn(b.key,b.value),x++}return y},qe.prototype.Lf=function(){return new je(this)},Ie.Object.defineProperties(qe.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return ui;var a=this.Sa;return a!==null?(a.reset(),a):new yn(this)}},iteratorKeys:{get:function(){return 0>=this.count?ui:new ve(this)}},iteratorValues:{get:function(){if(0>=this.count)return ui;var a=this.jf;return a!==null?(a.reset(),a):new fn(this)}}}),qe.prototype.toKeySet=qe.prototype.Lf,qe.prototype.toArray=qe.prototype.Fa,qe.prototype.clear=qe.prototype.clear,qe.prototype.delete=qe.prototype.delete,qe.prototype.remove=qe.prototype.remove,qe.prototype.get=qe.prototype.get,qe.prototype.getValue=qe.prototype.I,qe.prototype.has=qe.prototype.has,qe.prototype.contains=qe.prototype.contains,qe.prototype.first=qe.prototype.first,qe.prototype.addAll=qe.prototype.addAll,qe.prototype.set=qe.prototype.set,qe.prototype.add=qe.prototype.add,qe.prototype.thaw=qe.prototype.ka,qe.prototype.freeze=qe.prototype.freeze,qe.className="Map";function At(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):de("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var An,_i,Wi,To,lo;At.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.h=function(a,y){return this.x=a,this.y=y,this},At.prototype.sg=function(a,y){return this.x=a,this.y=y,this},At.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.copy=function(){var a=new At;return a.x=this.x,a.y=this.y,a},xt=At.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&de("cannot thaw constant: "+this),this._isFrozen=!1,this};function Qi(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new At(x,b)}return new At}function Do(a){return a.x.toString()+" "+a.y.toString()}xt.toString=function(){return"Point("+this.x+","+this.y+")"},xt.D=function(a){return a instanceof At?this.x===a.x&&this.y===a.y:!1},xt.hi=function(a,y){return this.x===a&&this.y===y},xt.Xa=function(a){return Jt.B(this.x,a.x)&&Jt.B(this.y,a.y)},xt.add=function(a){return this.x+=a.x,this.y+=a.y,this},xt.re=function(a){return this.x-=a.x,this.y-=a.y,this},xt.offset=function(a,y){return this.x+=a,this.y+=y,this},At.prototype.rotate=function(a){if(a===0)return this;var y=this.x,x=this.y;if(y===0&&x===0)return this;if(360<=a?a-=360:0>a&&(a+=360),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));return this.x=a*y-E*x,this.y=E*y+a*x,this},xt=At.prototype,xt.scale=function(a,y){return this.x*=a,this.y*=y,this},xt.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},xt.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},xt.normalize=function(){var a=this.x,y=this.y,x=Math.sqrt(a*a+y*y);return 0<x&&(this.x=a/x,this.y=y/x),this},xt.ab=function(a){return Ii(a.x-this.x,a.y-this.y)},xt.direction=function(a,y){return Ii(a-this.x,y-this.y)};function Ii(a,y){if(a===0)return 0<y?90:0>y?270:0;if(y===0)return 0<a?0:180;if(isNaN(a)||isNaN(y))return 0;var x=180*Math.atan(Math.abs(y/a))/Math.PI;return 0>a?x=0>y?x+180:180-x:0>y&&(x=360-x),x}xt.Ry=function(a,y){return Jt.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},xt.fA=function(a,y,x,E){return Jt.qh(a,y,x,E,this.x,this.y,this),this},xt.gA=function(a,y){return Jt.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},xt.uA=function(a,y,x,E){return Jt.No(this.x,this.y,a,y,x,E,this),this},xt.vA=function(a,y){return Jt.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},xt.xi=function(a,y){return this.x=a.x+y.x*a.width+y.offsetX,this.y=a.y+y.y*a.height+y.offsetY,this},xt.yi=function(a,y,x,E,b){return this.x=a+b.x*x+b.offsetX,this.y=y+b.y*E+b.offsetY,this},xt.transform=function(a){return a.Ga(this),this};function Pi(a,y){return y.Cd(a),a}function Ui(a,y,x,E,b,z){var tt=b-x,ot=z-E,rt=tt*tt+ot*ot;x-=a,E-=y;var at=-x*tt-E*ot;return 0>=at||at>=rt?(tt=b-a,ot=z-y,Math.min(x*x+E*E,tt*tt+ot*ot)):(a=tt*E-ot*x,a*a/rt)}function Wn(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function Dn(a,y,x,E){return a=x-a,y=E-y,a===0?0<y?90:0>y?270:0:y===0?0<a?0:180:isNaN(a)||isNaN(y)?0:(E=180*Math.atan(Math.abs(y/a))/Math.PI,0>a?E=0>y?E+180:180-E:0>y&&(E=360-E),E)}xt.w=function(){return isFinite(this.x)&&isFinite(this.y)},At.alloc=function(){var a=xi.pop();return a===void 0?new At:a},At.allocAt=function(a,y){var x=xi.pop();return x===void 0?new At(a,y):(x.x=a,x.y=y,x)},At.free=function(a){xi.push(a)},At.prototype.isReal=At.prototype.w,At.prototype.setSpot=At.prototype.yi,At.prototype.setRectSpot=At.prototype.xi,At.prototype.snapToGridPoint=At.prototype.vA,At.prototype.snapToGrid=At.prototype.uA,At.prototype.projectOntoLineSegmentPoint=At.prototype.gA,At.prototype.projectOntoLineSegment=At.prototype.fA,At.intersectingLineSegments=function(a,y,x,E,b,z,tt,ot){return Jt.Rl(a,y,x,E,b,z,tt,ot)},At.prototype.compareWithLineSegmentPoint=At.prototype.Ry,At.compareWithLineSegment=function(a,y,x,E,b,z){return Jt.Fl(a,y,x,E,b,z)},At.prototype.direction=At.prototype.direction,At.prototype.directionPoint=At.prototype.ab,At.prototype.normalize=At.prototype.normalize,At.prototype.distanceSquared=At.prototype.zd,At.prototype.distanceSquaredPoint=At.prototype.Bf,At.prototype.scale=At.prototype.scale,At.prototype.rotate=At.prototype.rotate,At.prototype.offset=At.prototype.offset,At.prototype.subtract=At.prototype.re,At.prototype.add=At.prototype.add,At.prototype.equalsApprox=At.prototype.Xa,At.prototype.equalTo=At.prototype.hi,At.prototype.equals=At.prototype.D,At.prototype.set=At.prototype.set,At.prototype.setTo=At.prototype.sg;var xi=[];At.className="Point",At.parse=Qi,At.stringify=Do,At.distanceLineSegmentSquared=Ui,At.distanceSquared=Wn,At.direction=Dn,At.Origin=An=new At(0,0).ja(),At.InfiniteTopLeft=_i=new At(-1/0,-1/0).ja(),At.InfiniteBottomRight=Wi=new At(1/0,1/0).ja(),At.SixPoint=To=new At(6,6).ja(),At.NoPoint=lo=new At(NaN,NaN).ja(),At.parse=Qi,At.stringify=Do,At.distanceLineSegmentSquared=Ui,At.distanceSquared=Wn,At.direction=Dn;function Le(a,y){a===void 0?this.height=this.width=0:typeof a=="number"&&(0<=a||isNaN(a))&&typeof y=="number"&&(0<=y||isNaN(y))?(this.width=a,this.height=y):de("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var gi,ji,Lo,vo,Oo,Wo,Ar;Le.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},Le.prototype.h=function(a,y){return this.width=a,this.height=y,this},Le.prototype.sg=function(a,y){return this.width=a,this.height=y,this},Le.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},Le.prototype.copy=function(){var a=new Le;return a.width=this.width,a.height=this.height,a},xt=Le.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&de("cannot thaw constant: "+this),this._isFrozen=!1,this};function cr(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new Le(x,b)}return new Le}function Bs(a){return a.width.toString()+" "+a.height.toString()}xt.toString=function(){return"Size("+this.width+","+this.height+")"},xt.D=function(a){return a instanceof Le?this.width===a.width&&this.height===a.height:!1},xt.hi=function(a,y){return this.width===a&&this.height===y},xt.Xa=function(a){return Jt.B(this.width,a.width)&&Jt.B(this.height,a.height)},xt.Bc=function(a,y){return a=this.width+a,this.width=0<=a?a:0,y=this.height+y,this.height=0<=y?y:0,this},xt.w=function(){return isFinite(this.width)&&isFinite(this.height)},Le.alloc=function(){var a=Us.pop();return a===void 0?new Le:a},Le.free=function(a){Us.push(a)},Le.prototype.isReal=Le.prototype.w,Le.prototype.inflate=Le.prototype.Bc,Le.prototype.equalsApprox=Le.prototype.Xa,Le.prototype.equalTo=Le.prototype.hi,Le.prototype.equals=Le.prototype.D,Le.prototype.set=Le.prototype.set,Le.prototype.setTo=Le.prototype.sg;var Us=[];Le.className="Size",Le.parse=cr,Le.stringify=Bs,Le.ZeroSize=gi=new Le(0,0).ja(),Le.OneSize=ji=new Le(1,1).ja(),Le.SixSize=Lo=new Le(6,6).ja(),Le.EightSize=vo=new Le(8,8).ja(),Le.TenSize=Oo=new Le(10,10).ja(),Le.InfiniteSize=Wo=new Le(1/0,1/0).ja(),Le.NoSize=Ar=new Le(NaN,NaN).ja(),Le.parse=cr,Le.stringify=Bs;function pe(a,y,x,E){a===void 0?this.height=this.width=this.y=this.x=0:typeof a=="number"&&typeof y=="number"&&typeof x=="number"&&(0<=x||isNaN(x))&&typeof E=="number"&&(0<=E||isNaN(E))?(this.x=a,this.y=y,this.width=x,this.height=E):a instanceof At?(x=a.x,a=a.y,y instanceof At?(E=y.x,y=y.y,this.x=Math.min(x,E),this.y=Math.min(a,y),this.width=Math.abs(x-E),this.height=Math.abs(a-y)):y instanceof Le?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):de("Incorrect second argument supplied to Rect constructor "+y)):de("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}xt=pe.prototype,xt.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},xt.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function Br(a,y,x){a.width=y,a.height=x}xt.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},xt.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},xt.dd=function(a){return this.x=a.x,this.y=a.y,this},xt.tA=function(a){return this.width=a.width,this.height=a.height,this},pe.prototype.copy=function(){var a=new pe;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},xt=pe.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&de("cannot thaw constant: "+this),this._isFrozen=!1,this};function Cs(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;(E=a[y++])&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;(E=a[y++])&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),new pe(x,b,z,tt)}return new pe}function ma(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}xt.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},xt.D=function(a){return a instanceof pe?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},xt.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},xt.Xa=function(a){return Jt.B(this.x,a.x)&&Jt.B(this.y,a.y)&&Jt.B(this.width,a.width)&&Jt.B(this.height,a.height)};function po(a,y){return Jt.$(a.x,y.x)&&Jt.$(a.y,y.y)&&Jt.$(a.width,y.width)&&Jt.$(a.height,y.height)}xt.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},xt.Re=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},xt.contains=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),this.x<=a&&a+x<=this.x+this.width&&this.y<=y&&y+E<=this.y+this.height},xt.offset=function(a,y){return this.x+=a,this.y+=y,this},xt.Bc=function(a,y){return Ds(this,y,a,y,a)},xt.Co=function(a){return Ds(this,a.top,a.right,a.bottom,a.left)},xt.Fv=function(a){return Ds(this,-a.top,-a.right,-a.bottom,-a.left)},xt.Hz=function(a,y,x,E){return Ds(this,a,y,x,E)};function Ds(a,y,x,E,b){var z=a.width;return x+b<=-z?(a.x+=z/2,a.width=0):(a.x-=b,a.width+=x+b),x=a.height,y+E<=-x?(a.y+=x/2,a.height=0):(a.y-=y,a.height+=y+E),a}xt.Ex=function(a){return Os(this,a.x,a.y,a.width,a.height)},xt.Uu=function(a,y,x,E){return Os(this,a,y,x,E)};function Os(a,y,x,E,b){var z=Math.max(a.x,y),tt=Math.max(a.y,x);return y=Math.min(a.x+a.width,y+E),x=Math.min(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=Math.max(0,y-z),a.height=Math.max(0,x-tt),a}xt.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},xt.Vu=function(a,y,x,E){var b=this.width,z=this.x;return b!==1/0&&x!==1/0&&(b+=z,x+=a,isNaN(x)||isNaN(b)||z>x||a>b)?!1:(a=this.height,x=this.y,!(a!==1/0&&E!==1/0&&(a+=x,E+=y,isNaN(E)||isNaN(a)||x>E||y>a)))};function Vs(a,y){var x=a.width,E=a.x,b=y.x-10;return E>y.width+10+10+b||b>x+E?!1:(x=a.height,a=a.y,E=y.y-10,!(a>y.height+10+10+E||E>x+a))}xt.Ye=function(a){return yo(this,a.x,a.y,0,0)},xt.ed=function(a){return yo(this,a.x,a.y,a.width,a.height)},xt.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),yo(this,a,y,x,E)};function yo(a,y,x,E,b){var z=Math.min(a.x,y),tt=Math.min(a.y,x);return y=Math.max(a.x+a.width,y+E),x=Math.max(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=y-z,a.height=x-tt,a}xt.yi=function(a,y,x){return this.x=a-x.offsetX-x.x*this.width,this.y=y-x.offsetY-x.y*this.height,this};function $o(a,y,x,E,b,z,tt,ot){return tt===void 0&&(tt=0),ot===void 0&&(ot=0),a<=b&&b+tt<=a+x&&y<=z&&z+ot<=y+E}function Hi(a,y,x,E,b,z,tt,ot){return a>tt+b||b>x+a?!1:!(y>ot+z||z>E+y)}xt.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},xt.Mz=function(){return this.width===0&&this.height===0},pe.alloc=function(){var a=Bo.pop();return a===void 0?new pe:a},pe.allocAt=function(a,y,x,E){var b=Bo.pop();return b===void 0?new pe(a,y,x,E):b.h(a,y,x,E)},pe.free=function(a){Bo.push(a)},Ie.Object.defineProperties(pe.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{get:function(){return new At(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new Le(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new At(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2,this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}}),pe.prototype.isEmpty=pe.prototype.Mz,pe.prototype.isReal=pe.prototype.w,pe.intersectsLineSegment=function(a,y,x,E,b,z,tt,ot){return Jt.Fx(a,y,x,E,b,z,tt,ot)},pe.prototype.setSpot=pe.prototype.yi,pe.prototype.union=pe.prototype.Kv,pe.prototype.unionRect=pe.prototype.ed,pe.prototype.unionPoint=pe.prototype.Ye,pe.prototype.intersects=pe.prototype.Vu,pe.prototype.intersectsRect=pe.prototype.Yc,pe.prototype.intersect=pe.prototype.Uu,pe.prototype.intersectRect=pe.prototype.Ex,pe.prototype.grow=pe.prototype.Hz,pe.prototype.subtractMargin=pe.prototype.Fv,pe.prototype.addMargin=pe.prototype.Co,pe.prototype.inflate=pe.prototype.Bc,pe.prototype.offset=pe.prototype.offset,pe.prototype.contains=pe.prototype.contains,pe.prototype.containsRect=pe.prototype.Re,pe.prototype.containsPoint=pe.prototype.ca,pe.prototype.equalsApprox=pe.prototype.Xa,pe.prototype.equalTo=pe.prototype.hi,pe.prototype.equals=pe.prototype.D,pe.prototype.setSize=pe.prototype.tA,pe.prototype.setPoint=pe.prototype.dd,pe.prototype.set=pe.prototype.set,pe.prototype.setTo=pe.prototype.sg;var Vi=null,Mo=null,Bo=[];pe.className="Rect",pe.parse=Cs,pe.stringify=ma,pe.contains=$o,pe.intersects=Hi,pe.ZeroRect=Vi=new pe(0,0,0,0).ja(),pe.NoRect=Mo=new pe(NaN,NaN,NaN,NaN).ja(),pe.parse=Cs,pe.stringify=ma,pe.contains=$o,pe.intersects=Hi;function On(a,y,x,E){a===void 0?this.left=this.bottom=this.right=this.top=0:y===void 0?this.left=this.bottom=this.right=this.top=a:x===void 0?(this.top=a,this.right=y,this.bottom=a,this.left=y):E!==void 0?(this.top=a,this.right=y,this.bottom=x,this.left=E):de("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}On.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},On.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},On.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},On.prototype.copy=function(){var a=new On;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},xt=On.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&de("cannot thaw constant: "+this),this._isFrozen=!1,this};function ra(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=NaN;a[y]==="";)y++;var E=a[y++];if(E&&(x=parseFloat(E)),isNaN(x))return new On;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new On(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new On(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new On(x,b):new On(x,b,z,tt)}return new On}function Zr(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}xt.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},xt.D=function(a){return a instanceof On?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},xt.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},xt.Xa=function(a){return Jt.B(this.top,a.top)&&Jt.B(this.right,a.right)&&Jt.B(this.bottom,a.bottom)&&Jt.B(this.left,a.left)},xt.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},On.alloc=function(){var a=Fl.pop();return a===void 0?new On:a},On.free=function(a){Fl.push(a)},On.prototype.isReal=On.prototype.w,On.prototype.equalsApprox=On.prototype.Xa,On.prototype.equalTo=On.prototype.hi,On.prototype.equals=On.prototype.D,On.prototype.set=On.prototype.set,On.prototype.setTo=On.prototype.sg;var Ys=null,Tl=null,Fl=[];On.className="Margin",On.parse=ra,On.stringify=Zr,On.ZeroMargin=Ys=new On(0,0,0,0).ja(),On.TwoMargin=Tl=new On(2,2,2,2).ja(),On.parse=ra,On.stringify=Zr;function Sn(a,y,x,E){a===void 0?this.offsetY=this.offsetX=this.y=this.x=0:(y===void 0&&(y=0),x===void 0&&(x=0),E===void 0&&(E=0),this.x=a,this.y=y,this.offsetX=x,this.offsetY=E),this._isFrozen=!1}var hr,Sr,sa,qi,Uo,Mi,va,rs,Ur,ya,vu,oh,Sa,ol,Td,Yc,Mf,Kc,Ef,Fd,yu,rl,Nf,Tf,Xc,Ir,bp,Zc,bd,Yh,Ks,Xs,Jr,Ls,Ff,Ad;Sn.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},Sn.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},Sn.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},Sn.prototype.copy=function(){var a=new Sn;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},xt=Sn.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&de("cannot thaw constant: "+this),this._isFrozen=!1,this};function Lr(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function bf(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return hr;if(a==="TopLeft")return Sr;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return sa;if(a==="TopRight")return qi;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return Uo;if(a==="Center")return Mi;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return va;if(a==="BottomLeft")return rs;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Ur;if(a==="BottomRight")return ya;if(a==="TopSide")return vu;if(a==="LeftSide")return oh;if(a==="RightSide")return Sa;if(a==="BottomSide")return ol;if(a==="TopBottomSides")return Td;if(a==="LeftRightSides")return Yc;if(a==="TopLeftSides")return Mf;if(a==="TopRightSides")return Kc;if(a==="BottomLeftSides")return Ef;if(a==="BottomRightSides")return Fd;if(a==="NotTopSide")return yu;if(a==="NotLeftSide")return rl;if(a==="NotRightSide")return Nf;if(a==="NotBottomSide")return Tf;if(a==="AllSides")return Xc;if(a==="Default")return Ir;a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E!==void 0&&0<E.length&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return E=a[y++],E!==void 0&&0<E.length&&(tt=parseFloat(E)),new Sn(x,b,z,tt)}return new Sn}function Af(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}xt.toString=function(){return this.sb()?this.offsetX===0&&this.offsetY===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(hr)?"None":this.D(Sr)?"TopLeft":this.D(sa)?"Top":this.D(qi)?"TopRight":this.D(Uo)?"Left":this.D(Mi)?"Center":this.D(va)?"Right":this.D(rs)?"BottomLeft":this.D(Ur)?"Bottom":this.D(ya)?"BottomRight":this.D(vu)?"TopSide":this.D(oh)?"LeftSide":this.D(Sa)?"RightSide":this.D(ol)?"BottomSide":this.D(Td)?"TopBottomSides":this.D(Yc)?"LeftRightSides":this.D(Mf)?"TopLeftSides":this.D(Kc)?"TopRightSides":this.D(Ef)?"BottomLeftSides":this.D(Fd)?"BottomRightSides":this.D(yu)?"NotTopSide":this.D(rl)?"NotLeftSide":this.D(Nf)?"NotRightSide":this.D(Tf)?"NotBottomSide":this.D(Xc)?"AllSides":this.D(Ir)?"Default":"None"},xt.D=function(a){return a instanceof Sn?(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},xt.gv=function(){return new Sn(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},xt.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(bp))a=oh;else if(a.D(Zc))a=Sa;else if(a.D(bd))a=vu;else if(a.D(Yh))a=ol;else return!1;return a=a.offsetY,(this.offsetY&a)===a},xt.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},xt.Mc=function(){return isNaN(this.x)||isNaN(this.y)},xt.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},xt.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},xt.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},Sn.alloc=function(){var a=Bf.pop();return a===void 0?new Sn:a},Sn.free=function(a){Bf.push(a)},Sn.prototype.isDefault=Sn.prototype.Xb,Sn.prototype.isNone=Sn.prototype.ys,Sn.prototype.isSide=Sn.prototype.$c,Sn.prototype.isNoSpot=Sn.prototype.Mc,Sn.prototype.isSpot=Sn.prototype.sb,Sn.prototype.includesSide=Sn.prototype.Hf,Sn.prototype.opposite=Sn.prototype.gv,Sn.prototype.equals=Sn.prototype.D,Sn.prototype.set=Sn.prototype.set,Sn.prototype.setTo=Sn.prototype.sg;var Bf=[];Sn.className="Spot",Sn.parse=bf,Sn.stringify=Af,Sn.None=hr=Lr(new Sn(0,0,0,0),0).ja(),Sn.Default=Ir=Lr(new Sn(0,0,-1,0),-1).ja(),Sn.TopLeft=Sr=new Sn(0,0,0,0).ja(),Sn.TopCenter=sa=new Sn(.5,0,0,0).ja(),Sn.TopRight=qi=new Sn(1,0,0,0).ja(),Sn.LeftCenter=Uo=new Sn(0,.5,0,0).ja(),Sn.Center=Mi=new Sn(.5,.5,0,0).ja(),Sn.RightCenter=va=new Sn(1,.5,0,0).ja(),Sn.BottomLeft=rs=new Sn(0,1,0,0).ja(),Sn.BottomCenter=Ur=new Sn(.5,1,0,0).ja(),Sn.BottomRight=ya=new Sn(1,1,0,0).ja(),Sn.MiddleTop=Ks=sa,Sn.MiddleLeft=Xs=Uo,Sn.MiddleRight=Jr=va,Sn.MiddleBottom=Ls=Ur,Sn.Top=bd=sa,Sn.Left=bp=Uo,Sn.Right=Zc=va,Sn.Bottom=Yh=Ur,Sn.TopSide=vu=Lr(new Sn(0,0,1,1),1).ja(),Sn.LeftSide=oh=Lr(new Sn(0,0,1,2),1).ja(),Sn.RightSide=Sa=Lr(new Sn(0,0,1,4),1).ja(),Sn.BottomSide=ol=Lr(new Sn(0,0,1,8),1).ja(),Sn.TopBottomSides=Td=Lr(new Sn(0,0,1,9),1).ja(),Sn.LeftRightSides=Yc=Lr(new Sn(0,0,1,6),1).ja(),Sn.TopLeftSides=Mf=Lr(new Sn(0,0,1,3),1).ja(),Sn.TopRightSides=Kc=Lr(new Sn(0,0,1,5),1).ja(),Sn.BottomLeftSides=Ef=Lr(new Sn(0,0,1,10),1).ja(),Sn.BottomRightSides=Fd=Lr(new Sn(0,0,1,12),1).ja(),Sn.NotTopSide=yu=Lr(new Sn(0,0,1,14),1).ja(),Sn.NotLeftSide=rl=Lr(new Sn(0,0,1,13),1).ja(),Sn.NotRightSide=Nf=Lr(new Sn(0,0,1,11),1).ja(),Sn.NotBottomSide=Tf=Lr(new Sn(0,0,1,7),1).ja(),Sn.AllSides=Xc=Lr(new Sn(0,0,1,15),1).ja(),Ff=new Sn(.156,.156).ja(),Ad=new Sn(.844,.844).ja(),Sn.parse=bf,Sn.stringify=Af;function ci(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}ci.prototype.set=function(a){return this.m11=a.m11,this.m12=a.m12,this.m21=a.m21,this.m22=a.m22,this.dx=a.dx,this.dy=a.dy,this},ci.prototype.setTransform=function(a,y,x,E,b,z){return this.m11=a,this.m12=y,this.m21=x,this.m22=E,this.dx=b,this.dy=z,this},ci.prototype.copy=function(){var a=new ci;return a.m11=this.m11,a.m12=this.m12,a.m21=this.m21,a.m22=this.m22,a.dx=this.dx,a.dy=this.dy,a},ci.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},ci.prototype.D=function(a){return this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy},ci.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},ci.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},ci.prototype.multiply=function(a){var y=this.m11*a.m11+this.m21*a.m12,x=this.m12*a.m11+this.m22*a.m12,E=this.m11*a.m21+this.m21*a.m22,b=this.m12*a.m21+this.m22*a.m22;return this.dx=this.m11*a.dx+this.m21*a.dy+this.dx,this.dy=this.m12*a.dx+this.m22*a.dy+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},ci.prototype.bv=function(a){var y=1/(a.m11*a.m22-a.m12*a.m21),x=a.m22*y,E=-a.m12*y,b=-a.m21*y,z=a.m11*y,tt=y*(a.m21*a.dy-a.m22*a.dx);return a=y*(a.m12*a.dx-a.m11*a.dy),y=this.m11*x+this.m21*E,x=this.m12*x+this.m22*E,E=this.m11*b+this.m21*z,b=this.m12*b+this.m22*z,this.dx=this.m11*tt+this.m21*a+this.dx,this.dy=this.m12*tt+this.m22*a+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},ci.prototype.Vj=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),y=-this.m12*a,x=-this.m21*a,E=this.m11*a,b=a*(this.m21*this.dy-this.m22*this.dx),z=a*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*a,this.m12=y,this.m21=x,this.m22=E,this.dx=b,this.dy=z,this},ci.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a===0)return this;if(this.translate(y,x),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.m12*a+this.m22*E,z=this.m11*-E+this.m21*a,tt=this.m12*-E+this.m22*a;return this.m11=this.m11*a+this.m21*E,this.m12=b,this.m21=z,this.m22=tt,this.translate(-y,-x),this},xt=ci.prototype,xt.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},xt.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},xt.Ga=function(a){var y=a.x,x=a.y;return a.h(y*this.m11+x*this.m21+this.dx,y*this.m12+x*this.m22+this.dy)},xt.Cd=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=a.x,E=a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},xt.Eu=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=1.25*a.x,E=1.2*a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},xt.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,tt=this.m12,ot=this.m21,rt=this.m22,at=this.dx,ut=this.dy,ct=y*z+x*ot+at,mt=y*tt+x*rt+ut,yt=E*z+x*ot+at,St=E*tt+x*rt+ut;return x=y*z+b*ot+at,y=y*tt+b*rt+ut,z=E*z+b*ot+at,E=E*tt+b*rt+ut,b=Math.min(ct,yt),ct=Math.max(ct,yt),yt=Math.min(mt,St),mt=Math.max(mt,St),b=Math.min(b,x),ct=Math.max(ct,x),yt=Math.min(yt,y),mt=Math.max(mt,y),b=Math.min(b,z),ct=Math.max(ct,z),yt=Math.min(yt,E),mt=Math.max(mt,E),a.h(b,yt,ct-b,mt-yt),a},ci.alloc=function(){var a=Jc.pop();return a===void 0?new ci:a},ci.free=function(a){Jc.push(a)},ci.prototype.transformRect=ci.prototype.pp,ci.prototype.transformPoint=ci.prototype.Ga,ci.prototype.scale=ci.prototype.scale,ci.prototype.translate=ci.prototype.translate,ci.prototype.rotate=ci.prototype.rotate,ci.prototype.invert=ci.prototype.Vj,ci.prototype.multiplyInverted=ci.prototype.bv,ci.prototype.multiply=ci.prototype.multiply,ci.prototype.reset=ci.prototype.reset,ci.prototype.isIdentity=ci.prototype.ws,ci.prototype.equals=ci.prototype.D,ci.prototype.setTransform=ci.prototype.setTransform,ci.prototype.set=ci.prototype.set;var Jc=[];ci.className="Transform",ci.xF="54a702f3e53909c447824c6706603faf4c";var Jt={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=Jt.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);Jt.Uv=y}return 1>a?(x=1/a,2e3>=x?1/y[x|0]:Math.sqrt(a)):2e3>=a?y[a|0]:Math.sqrt(a)},B:function(a,y){return a-=y,.5>a&&-.5<a},$:function(a,y){return a-=y,5e-8>a&&-5e-8<a},Yb:function(a,y,x,E,b,z,tt){if(0>=b&&(b=1e-6),a<x)var ot=a,rt=x;else ot=x,rt=a;if(y<E)var at=y,ut=E;else at=E,ut=y;if(a===x)return at<=tt&&tt<=ut&&a-b<=z&&z<=a+b;if(y===E)return ot<=z&&z<=rt&&y-b<=tt&&tt<=y+b;if(rt+=b,ot-=b,ot<=z&&z<=rt&&(ut+=b,at-=b,at<=tt&&tt<=ut))if(rt-ot>ut-at)if(a-x>b||x-a>b){if(z=(E-y)/(x-a)*(z-a)+y,z-b<=tt&&tt<=z+b)return!0}else return!0;else if(y-E>b||E-y>b){if(tt=(x-a)/(E-y)*(tt-y)+a,tt-b<=z&&z<=tt+b)return!0}else return!0;return!1},cs:function(a,y,x,E,b,z,tt,ot,rt,at,ut,ct){if(Jt.Yb(a,y,tt,ot,ct,x,E)&&Jt.Yb(a,y,tt,ot,ct,b,z))return Jt.Yb(a,y,tt,ot,ct,at,ut);var mt=(a+x)/2,yt=(y+E)/2,St=(x+b)/2,Mt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(mt+St)/2,x=(yt+Mt)/2,St=(St+b)/2,Mt=(Mt+z)/2;var Ot=(E+St)/2,bt=(x+Mt)/2;return Jt.cs(a,y,mt,yt,E,x,Ot,bt,rt,at,ut,ct)||Jt.cs(Ot,bt,St,Mt,b,z,tt,ot,rt,at,ut,ct)},ax:function(a,y,x,E,b,z,tt,ot,rt){var at=(x+b)/2,ut=(E+z)/2;return rt.h((((a+x)/2+at)/2+(at+(b+tt)/2)/2)/2,(((y+E)/2+ut)/2+(ut+(z+ot)/2)/2)/2),rt},My:function(a,y,x,E,b,z,tt,ot){var rt=(x+b)/2,at=(E+z)/2;return Dn(((a+x)/2+rt)/2,((y+E)/2+at)/2,(rt+(b+tt)/2)/2,(at+(z+ot)/2)/2)},Dl:function(a,y,x,E,b,z,tt,ot,rt,at){if(Jt.Yb(a,y,tt,ot,rt,x,E)&&Jt.Yb(a,y,tt,ot,rt,b,z))yo(at,a,y,0,0),yo(at,tt,ot,0,0);else{var ut=(a+x)/2,ct=(y+E)/2,mt=(x+b)/2,yt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(ut+mt)/2,x=(ct+yt)/2,mt=(mt+b)/2,yt=(yt+z)/2;var St=(E+mt)/2,Mt=(x+yt)/2;Jt.Dl(a,y,ut,ct,E,x,St,Mt,rt,at),Jt.Dl(St,Mt,mt,yt,b,z,tt,ot,rt,at)}return at},Qe:function(a,y,x,E,b,z,tt,ot,rt,at){if(Jt.Yb(a,y,tt,ot,rt,x,E)&&Jt.Yb(a,y,tt,ot,rt,b,z))at.length===0&&(at.push(a),at.push(y)),at.push(tt),at.push(ot);else{var ut=(a+x)/2,ct=(y+E)/2,mt=(x+b)/2,yt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(ut+mt)/2,x=(ct+yt)/2,mt=(mt+b)/2,yt=(yt+z)/2;var St=(E+mt)/2,Mt=(x+yt)/2;Jt.Qe(a,y,ut,ct,E,x,St,Mt,rt,at),Jt.Qe(St,Mt,mt,yt,b,z,tt,ot,rt,at)}return at},jv:function(a,y,x,E,b,z,tt,ot,rt,at){if(Jt.Yb(a,y,b,z,at,x,E))return Jt.Yb(a,y,b,z,at,ot,rt);var ut=(a+x)/2,ct=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var mt=(ut+x)/2,yt=(ct+E)/2;return Jt.jv(a,y,ut,ct,mt,yt,tt,ot,rt,at)||Jt.jv(mt,yt,x,E,b,z,tt,ot,rt,at)},OA:function(a,y,x,E,b,z,tt){return tt.h(((a+x)/2+(x+b)/2)/2,((y+E)/2+(E+z)/2)/2),tt},iv:function(a,y,x,E,b,z,tt,ot){if(Jt.Yb(a,y,b,z,tt,x,E))yo(ot,a,y,0,0),yo(ot,b,z,0,0);else{var rt=(a+x)/2,at=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(rt+x)/2,ct=(at+E)/2;Jt.iv(a,y,rt,at,ut,ct,tt,ot),Jt.iv(ut,ct,x,E,b,z,tt,ot)}return ot},ep:function(a,y,x,E,b,z,tt,ot){if(Jt.Yb(a,y,b,z,tt,x,E))ot.length===0&&(ot.push(a),ot.push(y)),ot.push(b),ot.push(z);else{var rt=(a+x)/2,at=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(rt+x)/2,ct=(at+E)/2;Jt.ep(a,y,rt,at,ut,ct,tt,ot),Jt.ep(ut,ct,x,E,b,z,tt,ot)}return ot},Eo:function(a,y,x,E,b,z,tt,ot,rt,at,ut,ct,mt,yt){if(Jt.Yb(a,y,tt,ot,mt,x,E)&&Jt.Yb(a,y,tt,ot,mt,b,z))return!Jt.Rl(a,y,tt,ot,rt,at,ut,ct)||(mt=(a-tt)*(at-ct)-(y-ot)*(rt-ut),mt===0)?!1:(yt.h(((a*ot-y*tt)*(rt-ut)-(a-tt)*(rt*ct-at*ut))/mt,((a*ot-y*tt)*(at-ct)-(y-ot)*(rt*ct-at*ut))/mt),!0);var St=(a+x)/2,Mt=(y+E)/2,Ot=(x+b)/2,bt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(St+Ot)/2,x=(Mt+bt)/2,Ot=(Ot+b)/2,bt=(bt+z)/2;var jt=(E+Ot)/2,Gt=(x+bt)/2,Wt=1/0,Kt=!1,$t=0,Qe=0;return Jt.Eo(a,y,St,Mt,E,x,jt,Gt,rt,at,ut,ct,mt,yt)&&(a=(yt.x-rt)*(yt.x-rt)+(yt.y-at)*(yt.y-at),a<Wt&&(Wt=a,Kt=!0,$t=yt.x,Qe=yt.y)),Jt.Eo(jt,Gt,Ot,bt,b,z,tt,ot,rt,at,ut,ct,mt,yt)&&(yt.x-rt)*(yt.x-rt)+(yt.y-at)*(yt.y-at)<Wt&&(Kt=!0,$t=yt.x,Qe=yt.y),Kt&&(yt.x=$t,yt.y=Qe),Kt},Fo:function(a,y,x,E,b,z,tt,ot,rt,at,ut,ct,mt){var yt=0;if(Jt.Yb(a,y,tt,ot,mt,x,E)&&Jt.Yb(a,y,tt,ot,mt,b,z)){if(mt=(a-tt)*(at-ct)-(y-ot)*(rt-ut),mt===0)return yt;var St=((a*ot-y*tt)*(rt-ut)-(a-tt)*(rt*ct-at*ut))/mt,Mt=((a*ot-y*tt)*(at-ct)-(y-ot)*(rt*ct-at*ut))/mt;if(St>=ut)return yt;if((rt>ut?rt-ut:ut-rt)<(at>ct?at-ct:ct-at)){if(y<ot?(rt=y,a=ot):(rt=ot,a=y),Mt<rt||Mt>a)return yt}else if(a<tt?(rt=a,a=tt):rt=tt,St<rt||St>a)return yt;0<mt?yt++:0>mt&&yt--}else{St=(a+x)/2,Mt=(y+E)/2;var Ot=(x+b)/2,bt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(St+Ot)/2,x=(Mt+bt)/2,Ot=(Ot+b)/2,bt=(bt+z)/2;var jt=(E+Ot)/2,Gt=(x+bt)/2;yt+=Jt.Fo(a,y,St,Mt,E,x,jt,Gt,rt,at,ut,ct,mt),yt+=Jt.Fo(jt,Gt,Ot,bt,b,z,tt,ot,rt,at,ut,ct,mt)}return yt},qh:function(a,y,x,E,b,z,tt){return Jt.$(a,x)?(y<E?(x=y,y=E):x=E,z<x?(tt.h(a,x),!1):z>y?(tt.h(a,y),!1):(tt.h(a,z),!0)):Jt.$(y,E)?(a<x?(E=a,a=x):E=x,b<E?(tt.h(E,y),!1):b>a?(tt.h(a,y),!1):(tt.h(b,y),!0)):(b=((a-b)*(a-x)+(y-z)*(y-E))/((x-a)*(x-a)+(E-y)*(E-y)),-5e-6>b?(tt.h(a,y),!1):1.000005<b?(tt.h(x,E),!1):(tt.h(a+b*(x-a),y+b*(E-y)),!0))},Ve:function(a,y,x,E,b,z,tt,ot,rt){return Jt.B(a,x)&&Jt.B(y,E)?(rt.h(a,y),!1):Jt.$(b,tt)?Jt.$(a,x)?(Jt.qh(a,y,x,E,b,z,rt),!1):Jt.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,rt):(ot=(ot-z)/(tt-b),Jt.$(a,x)?(x=ot*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(rt.h(a,b),!1):x>y?(rt.h(a,y),!1):(rt.h(a,x),!0)):(tt=(E-y)/(x-a),Jt.$(ot,tt)?(Jt.qh(a,y,x,E,b,z,rt),!1):(b=(tt*a-ot*b+z-y)/(tt-ot),Jt.$(tt,0)?(a<x?(E=a,a=x):E=x,b<E?(rt.h(E,y),!1):b>a?(rt.h(a,y),!1):(rt.h(b,y),!0)):Jt.qh(a,y,x,E,b,tt*(b-a)+y,rt))))},MA:function(a,y,x,E,b){return Jt.Ve(x.x,x.y,E.x,E.y,a.x,a.y,y.x,y.y,b)},KA:function(a,y,x,E,b,z,tt,ot,rt,at){function ut(Ot,bt){var jt=(Ot-a)*(Ot-a)+(bt-y)*(bt-y);jt<ct&&(ct=jt,rt.h(Ot,bt))}var ct=1/0;ut(rt.x,rt.y);var mt=0,yt=0,St=0,Mt=0;if(b<tt?(mt=b,yt=tt):(mt=tt,yt=b),z<ot?(St=b,Mt=tt):(St=tt,Mt=b),mt=(yt-mt)/2+at,at=(Mt-St)/2+at,b=(b+tt)/2,z=(z+ot)/2,mt===0||at===0)return rt;if(.5>(x>a?x-a:a-x)){if(mt=1-(x-b)*(x-b)/(mt*mt),0>mt)return rt;mt=Math.sqrt(mt),E=-at*mt+z,ut(x,at*mt+z),ut(x,E)}else{if(x=(E-y)/(x-a),E=1/(mt*mt)+x*x/(at*at),ot=2*x*(y-x*a)/(at*at)-2*x*z/(at*at)-2*b/(mt*mt),mt=ot*ot-4*E*(2*x*a*z/(at*at)-2*y*z/(at*at)+z*z/(at*at)+b*b/(mt*mt)-1+(y-x*a)*(y-x*a)/(at*at)),0>mt)return rt;mt=Math.sqrt(mt),at=(-ot+mt)/(2*E),ut(at,x*at-x*a+y),mt=(-ot-mt)/(2*E),ut(mt,x*mt-x*a+y)}return rt},Ff:function(a,y,x,E,b,z,tt,ot,rt){var at=1e21,ut=a,ct=y;if(Jt.Ve(a,y,a,E,b,z,tt,ot,rt)){var mt=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z);mt<at&&(at=mt,ut=rt.x,ct=rt.y)}return Jt.Ve(x,y,x,E,b,z,tt,ot,rt)&&(mt=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z),mt<at&&(at=mt,ut=rt.x,ct=rt.y)),Jt.Ve(a,y,x,y,b,z,tt,ot,rt)&&(y=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z),y<at&&(at=y,ut=rt.x,ct=rt.y)),Jt.Ve(a,E,x,E,b,z,tt,ot,rt)&&(a=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z),a<at&&(at=a,ut=rt.x,ct=rt.y)),rt.h(ut,ct),1e21>at},us:function(a,y,x){return Jt.Fx(a.x,a.y,a.width,a.height,y.x,y.y,x.x,x.y)},Fx:function(a,y,x,E,b,z,tt,ot){var rt=a+x,at=y+E;return b===tt?(z<ot?(tt=z,z=ot):tt=ot,a<=b&&b<=rt&&tt<=at&&z>=y):z===ot?(b<tt?(ot=b,b=tt):ot=tt,y<=z&&z<=at&&ot<=rt&&b>=a):!!($o(a,y,x,E,b,z)||$o(a,y,x,E,tt,ot)||Jt.Rl(a,y,rt,y,b,z,tt,ot)||Jt.Rl(rt,y,rt,at,b,z,tt,ot)||Jt.Rl(rt,at,a,at,b,z,tt,ot)||Jt.Rl(a,at,a,y,b,z,tt,ot))},Rl:function(a,y,x,E,b,z,tt,ot){return a===x&&y===E&&b===tt&&z===ot?a===b&&y===z:0>=Jt.Fl(a,y,x,E,b,z)*Jt.Fl(a,y,x,E,tt,ot)&&0>=Jt.Fl(b,z,tt,ot,a,y)*Jt.Fl(b,z,tt,ot,x,E)},Fl:function(a,y,x,E,b,z){return x-=a,E-=y,a=b-a,y=z-y,z=a*E-y*x,z===0&&(z=a*x+y*E,0<z&&(z=(a-x)*x+(y-E)*E,0>z&&(z=0))),z},bp:function(a){return 0>a&&(a+=360),360<=a&&(a-=360),a},jx:function(a,y,x,E,b,z){var tt=Math.PI;z||(E*=tt/180,b*=tt/180);var ot=E>b?-1:1;z=[];var rt=tt/2,at=E;if(E=Math.min(2*tt,Math.abs(b-E)),1e-5>E)return rt=at+ot*Math.min(E,rt),ot=a+x*Math.cos(at),at=y+x*Math.sin(at),a+=x*Math.cos(rt),y+=x*Math.sin(rt),x=(ot+a)/2,rt=(at+y)/2,z.push([ot,at,x,rt,x,rt,a,y]),z;for(;1e-5<E;)b=at+ot*Math.min(E,rt),z.push(Jt.Vy(x,at,b,a,y)),E-=Math.abs(b-at),at=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,tt=a*Math.cos(z),ot=a*Math.sin(z),rt=-ot,at=tt*tt+rt*rt,ut=at+tt*tt+rt*ot;return at=4/3*(Math.sqrt(2*at*ut)-ut)/(tt*ot-rt*tt),ot=tt-at*rt,tt=rt+at*tt,rt=-tt,at=z+y,z=Math.cos(at),at=Math.sin(at),[E+a*Math.cos(y),b+a*Math.sin(y),E+ot*z-tt*at,b+ot*at+tt*z,E+ot*z-rt*at,b+ot*at+rt*z,E+a*Math.cos(x),b+a*Math.sin(x)]},No:function(a,y,x,E,b,z,tt){x=Math.floor((a-x)/b)*b+x,E=Math.floor((y-E)/z)*z+E;var ot=x;return x+b-a<b/2&&(ot=x+b),a=E,E+z-y<z/2&&(a=E+z),tt.h(ot,a),tt},vx:function(a,y){var x=Math.max(a,y);a=Math.min(a,y);var E;do y=x%a,x=E=a,a=y;while(0<y);return E},$y:function(a,y,x,E){var b=0>x,z=0>E;if(a<y)var tt=1,ot=0;else tt=0,ot=1;var rt=tt===0?a:y,at=tt===0?x:E;return(tt===0?b:z)&&(at=-at),tt=ot,x=tt===0?x:E,(tt===0?b:z)&&(x=-x),Jt.az(rt,tt===0?a:y,at,x,0,0)},az:function(a,y,x,E,b,z){if(0<E)if(0<x){b=a*a,z=y*y,a*=x;var tt=y*E,ot=-z+tt,rt=-z+Math.sqrt(a*a+tt*tt);y=ot;for(var at=0;9999999999>at&&(y=.5*(ot+rt),!(y===ot||y===rt));++at){var ut=a/(y+b),ct=tt/(y+z);if(ut=ut*ut+ct*ct-1,0<ut)ot=y;else if(0>ut)rt=y;else break}x=b*x/(y+b)-x,E=z*E/(y+z)-E,x=Math.sqrt(x*x+E*E)}else x=Math.abs(E-y);else E=a*a-y*y,z=a*x,z<E?(E=z/E,z=y*Math.sqrt(Math.abs(1-E*E)),x=a*E-x,x=Math.sqrt(x*x+z*z)):x=Math.abs(x-a);return x},Ze:new Se,um:new Se,Mf:new Se,Nf:0,vm:100};Jt.za=Jt.AA;function Xe(a){vi(this),this.l=2,a===void 0&&(a=Xe.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===Xe.o?this.ee=new be:(Xe.V===null&&(Xe.V=new be().freeze()),this.ee=Xe.V),this.aq=this.ee.Ja,this.Ip=new pe().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=Sr,this.gg=ya,this.Rk=this.Sk=NaN,this.Uf=Re}Xe.prototype.copy=function(){var a=new Xe;if(a.l=this.l&-2,a.na=this.na,a.od=this.od,a.pd=this.pd,a.Dc=this.Dc,a.Ec=this.Ec,this.na===Xe.o){for(var y=this.ee.s,x=a.ee,E=0;E<y.length;E++)x.add(y[E].copy());a.ee=x}else a.ee=this.ee;return a.aq=this.aq,a.Ip.assign(this.Ip),a.tk=this.tk,a.ym=this.ym,a.zm=this.zm,a.fg=this.fg.J(),a.gg=this.gg.J(),a.Sk=this.Sk,a.Rk=this.Rk,a.Uf=this.Uf,a},Xe.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},Xe.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==Xe.o)return this;var a=this.figures;a.freeze(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].freeze();return this},Xe.prototype.ka=function(){if(Object.isFrozen(this)&&de("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==Xe.o)return this;var a=this.figures;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},Xe.prototype.Xa=function(a){if(!(a instanceof Xe))return!1;if(this.type!==a.type)return this.type===Xe.j&&a.type===Xe.o?Ap(this,a):a.type===Xe.j&&this.type===Xe.o?Ap(a,this):!1;if(this.type===Xe.o){var y=this.figures.s;a=a.figures.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0}return Jt.B(this.startX,a.startX)&&Jt.B(this.startY,a.startY)&&Jt.B(this.endX,a.endX)&&Jt.B(this.endY,a.endY)};function Ap(a,y){return a.type!==Xe.j||y.type!==Xe.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&Jt.B(a.startX,y.startX)&&Jt.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===ao&&Jt.B(a.endX,y.endX)&&Jt.B(a.endY,y.endY))))}Xe.ia=function(a){return a.toString()},Xe.prototype.qb=function(a){a.classType===Xe&&(this.type=a)},Xe.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case Xe.j:return 0>a?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case Xe.u:var y=new pe(this.startX,this.startY,0,0);return y.Kv(this.endX,this.endY,0,0),0>a?"M"+y.x.toString()+" "+y.y.toString()+"H"+y.right.toString()+"V"+y.bottom.toString()+"H"+y.left.toString()+"z":"M"+y.x.toFixed(a)+" "+y.y.toFixed(a)+"H"+y.right.toFixed(a)+"V"+y.bottom.toFixed(a)+"H"+y.left.toFixed(a)+"z";case Xe.F:if(y=new pe(this.startX,this.startY,0,0),y.Kv(this.endX,this.endY,0,0),0>a)return a=y.left.toString()+" "+(y.y+y.height/2).toString(),"M"+a+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+(y.right.toString()+" "+(y.y+y.height/2).toString())+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+a;var x=y.left.toFixed(a)+" "+(y.y+y.height/2).toFixed(a);return"M"+x+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+(y.right.toFixed(a)+" "+(y.y+y.height/2).toFixed(a))+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+x;case Xe.o:y="",x=this.figures.s;for(var E=x.length,b=0;b<E;b++){var z=x[b];0<b&&(y+=" x "),z.isFilled&&(y+="F "),y+=z.toString(a)}return y;default:return this.type.toString()}},Xe.nb=function(a){a=a.split(/[Xx]/);for(var y=a.length,x="",E=0;E<y;E++){var b=a[E];x=b.match(/[Ff]/)!==null?E===0?x+b:x+("X"+(b[0]===" "?"":" ")+b):x+((E===0?"":"X ")+"F"+(b[0]===" "?"":" ")+b)}return x},Xe.parse=function(a,y){function x(){return Mt>=Wt-1?!0:at[Mt+1].match(Kt)!==null}function E(){return Mt++,at[Mt]}function b(Zn){var zn=parseFloat(E()),Ri=parseFloat(E());Ot===Ot.toLowerCase()&&(zn=Gt.x+zn,Ri=Gt.y+Ri),Zn.h(zn,Ri)}function z(){return b(Gt),Gt}function tt(){return b(jt),jt}function ot(){var Zn=bt.toLowerCase();return Zn!=="c"&&Zn!=="s"&&Zn!=="q"&&Zn!=="t"?Gt:new At(2*Gt.x-jt.x,2*Gt.y-jt.y)}y===void 0&&(y=!1);var rt=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(rt,"$1 $2"),a=a.replace(rt,"$1 $2"),a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2"),a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2"),a=a.replace(/([0-9])([+\-])/gm,"$1 $2"),a=a.replace(/[\s\r\t\n]+/gm," "),a=a.replace(/^\s+|\s+$/g,"");var at=a.split(" ");for(a=0;a<at.length;a++){var ut=at[a];if(ut.match(/(\.[0-9]*)(\.)/gm)!==null){rt=Un();for(var ct="",mt=!1,yt=0;yt<ut.length;yt++){var St=ut[yt];St!=="."||mt?St==="."?(rt.push(ct),ct="."):ct+=St:(mt=!0,ct+=St)}for(rt.push(ct),at.splice(a,1),ut=0;ut<rt.length;ut++)at.splice(a+ut,0,rt[ut]);a+=rt.length-1,_n(rt)}}var Mt=-1,Ot="",bt="";rt=new At(0,0);var jt=new At(0,0),Gt=new At(0,0),Wt=at.length;a=F1(null),mt=ct=ut=!1,yt=!0,St=null;for(var Kt=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(Mt>=Wt-1);)if(bt=Ot,Ot=E(),Ot!=="")switch(Ot.toUpperCase()){case"X":yt=!0,ct=ut=!1;break;case"M":for(St=z(),a.mc===null||yt===!0?(Sc(a,St.x,St.y,ut,!ct,mt),yt=!1):a.moveTo(St.x,St.y),rt.assign(Gt);!x();)St=z(),a.lineTo(St.x,St.y);break;case"L":for(;!x();)St=z(),a.lineTo(St.x,St.y);break;case"H":for(;!x();)Gt=new At((Ot===Ot.toLowerCase()?Gt.x:0)+parseFloat(E()),Gt.y),a.lineTo(Gt.x,Gt.y);break;case"V":for(;!x();)Gt=new At(Gt.x,(Ot===Ot.toLowerCase()?Gt.y:0)+parseFloat(E())),a.lineTo(Gt.x,Gt.y);break;case"C":for(;!x();){St=new At,b(St);var $t=tt(),Qe=z();_u(a,St.x,St.y,$t.x,$t.y,Qe.x,Qe.y)}break;case"S":for(;!x();)St=ot(),$t=tt(),Qe=z(),_u(a,St.x,St.y,$t.x,$t.y,Qe.x,Qe.y);break;case"Q":for(;!x();)St=tt(),$t=z(),Im(a,St.x,St.y,$t.x,$t.y);break;case"T":for(;!x();)jt=St=ot(),$t=z(),Im(a,St.x,St.y,$t.x,$t.y);break;case"B":for(;!x();){St=parseFloat(E()),$t=parseFloat(E()),Qe=parseFloat(E());var dn=parseFloat(E()),rn=parseFloat(E()),We=rn,Ee=!1;x()||(We=parseFloat(E()),x()||(Ee=parseFloat(E())!==0)),Ot===Ot.toLowerCase()&&(Qe+=Gt.x,dn+=Gt.y),a.arcTo(St,$t,Qe,dn,rn,We,Ee)}break;case"A":for(;!x();)St=Math.abs(parseFloat(E())),$t=Math.abs(parseFloat(E())),Qe=parseFloat(E()),rn=dn=!1,Ee=We=0,We=E(),We.length===1?(dn=!!parseFloat(We),rn=!!parseFloat(E()),We=parseFloat(E())):We.length===2?(dn=!!parseFloat(We[0]),rn=!!parseFloat(We[1]),We=parseFloat(E())):(dn=!!parseFloat(We[0]),rn=!!parseFloat(We[1]),We=parseFloat(We.slice(2))),Ee=parseFloat(E()),Ot===Ot.toLowerCase()&&(We=Gt.x+We,Ee=Gt.y+Ee),Gt.h(We,Ee),wx(a,St,$t,Qe,dn,rn,We,Ee);break;case"Z":Px(a),Gt.assign(rt);break;case"F":for(St="",$t=1;at[Mt+$t];)if(at[Mt+$t]==="0")mt=!0,$t++;else if(at[Mt+$t].match(/[Uu]/)!==null)$t++;else if(at[Mt+$t].match(Kt)===null)$t++;else{St=at[Mt+$t];break}St.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(St="",$t=1;at[Mt+$t];)if(at[Mt+$t].match(/[Ff]/)!==null)$t++;else if(at[Mt+$t].match(Kt)===null)$t++;else{St=at[Mt+$t];break}St.match(/[Mm]/)?ct=!0:a.mc.isShadowed=!1}if(rt=a.os,Rm=a,y)for(y=rt.figures.iterator;y.next();)y.value.isFilled=!0;return rt},Xe.Ha=function(a,y){for(var x=a.length,E=At.alloc(),b=0;b<x;b++){var z=a[b];E.x=z[0],E.y=z[1],y.Ga(E),z[0]=E.x,z[1]=E.y,E.x=z[2],E.y=z[3],y.Ga(E),z[2]=E.x,z[3]=E.y,E.x=z[4],E.y=z[5],y.Ga(E),z[4]=E.x,z[5]=E.y,E.x=z[6],E.y=z[7],y.Ga(E),z[6]=E.x,z[7]=E.y}At.free(E)},Xe.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===Xe.o){if(this.aq!==this.figures.Ja)return!0;for(var a=this.figures.s,y=a.length,x=0;x<y;x++)if(a[x].Zu())return!0}return!1},Xe.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===Xe.o){this.aq=this.figures.Ja;for(var a=this.figures.s,y=a.length,x=0;x<y;x++){var E=a[x];E._isInvalidBounds=!1;var b=E.segments;E.sr=b.Ja,E=b.s,b=E.length;for(var z=0;z<b;z++){var tt=E[z];tt._isInvalidBounds=!1,tt.ae=null}}}a=this.Ip,a.ka(),isNaN(this.Sk)||isNaN(this.Rk)?a.h(0,0,0,0):a.h(0,0,this.Sk,this.Rk),Bp(this,a,!1),yo(a,0,0,0,0),a.freeze()},Xe.prototype.ix=function(){var a=new pe;return Bp(this,a,!0),a};function Bp(a,y,x){switch(a.type){case Xe.j:case Xe.u:case Xe.F:x?y.h(a.od,a.pd,0,0):yo(y,a.od,a.pd,0,0),yo(y,a.Dc,a.Ec,0,0);break;case Xe.o:var E=a.figures;a=E.s,E=E.length;for(var b=0;b<E;b++){var z=a[b];x&&b===0?y.h(z.startX,z.startY,0,0):yo(y,z.startX,z.startY,0,0);for(var tt=z.segments.s,ot=tt.length,rt=z.startX,at=z.startY,ut=0;ut<ot;ut++){var ct=tt[ut];switch(ct.type){case ao:case pr:rt=ct.endX,at=ct.endY,yo(y,rt,at,0,0);break;case Rr:Jt.Dl(rt,at,ct.point1X,ct.point1Y,ct.point2X,ct.point2Y,ct.endX,ct.endY,.5,y),rt=ct.endX,at=ct.endY;break;case aa:Jt.iv(rt,at,ct.point1X,ct.point1Y,ct.endX,ct.endY,.5,y),rt=ct.endX,at=ct.endY;break;case tr:case xa:var mt=ct.type===tr?Zs(ct,z):Ba(ct,z,rt,at),yt=mt.length;if(yt===0){rt=ct.type===tr?ct.centerX:ct.endX,at=ct.type===tr?ct.centerY:ct.endY,yo(y,rt,at,0,0);break}ct=null;for(var St=0;St<yt;St++)ct=mt[St],Jt.Dl(ct[0],ct[1],ct[2],ct[3],ct[4],ct[5],ct[6],ct[7],.5,y);ct!==null&&(rt=ct[6],at=ct[7]);break;default:de("Unknown Segment type: "+ct.type)}}}break;default:de("Unknown Geometry type: "+a.type)}}Xe.prototype.normalize=function(){this._isFrozen&&bn(this);var a=this.ix();return this.offset(-a.x,-a.y),new At(-a.x,-a.y)},Xe.prototype.offset=function(a,y){return this._isFrozen&&bn(this),this.transform(1,0,0,1,a,y),this},Xe.prototype.scale=function(a,y){return this._isFrozen&&bn(this),this.transform(a,0,0,y,0,0),this},Xe.prototype.rotate=function(a,y,x){this._isFrozen&&bn(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=ci.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),ci.free(E),this},xt=Xe.prototype,xt.transform=function(a,y,x,E,b,z){switch(this.type){case Xe.j:case Xe.u:case Xe.F:var tt=this.od,ot=this.pd;this.od=tt*a+ot*x+b,this.pd=tt*y+ot*E+z,tt=this.Dc,ot=this.Ec,this.Dc=tt*a+ot*x+b,this.Ec=tt*y+ot*E+z;break;case Xe.o:for(var rt=this.figures.s,at=rt.length,ut=0;ut<at;ut++){var ct=rt[ut];tt=ct.startX,ot=ct.startY,ct.startX=tt*a+ot*x+b,ct.startY=tt*y+ot*E+z,ct=ct.segments.s;for(var mt=ct.length,yt=0;yt<mt;yt++){var St=ct[yt];switch(St.type){case ao:case pr:tt=St.endX,ot=St.endY,St.endX=tt*a+ot*x+b,St.endY=tt*y+ot*E+z;break;case Rr:tt=St.point1X,ot=St.point1Y,St.point1X=tt*a+ot*x+b,St.point1Y=tt*y+ot*E+z,tt=St.point2X,ot=St.point2Y,St.point2X=tt*a+ot*x+b,St.point2Y=tt*y+ot*E+z,tt=St.endX,ot=St.endY,St.endX=tt*a+ot*x+b,St.endY=tt*y+ot*E+z;break;case aa:tt=St.point1X,ot=St.point1Y,St.point1X=tt*a+ot*x+b,St.point1Y=tt*y+ot*E+z,tt=St.endX,ot=St.endY,St.endX=tt*a+ot*x+b,St.endY=tt*y+ot*E+z;break;case tr:tt=St.centerX,ot=St.centerY,St.centerX=tt*a+ot*x+b,St.centerY=tt*y+ot*E+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),St.startAngle+=tt),0>a&&(St.startAngle=180-St.startAngle,St.sweepAngle=-St.sweepAngle),0>E&&(St.startAngle=-St.startAngle,St.sweepAngle=-St.sweepAngle),St.radiusX*=Math.sqrt(a*a+x*x),St.radiusY!==void 0&&(St.radiusY*=Math.sqrt(y*y+E*E));break;case xa:if(tt=St.endX,ot=St.endY,St.endX=tt*a+ot*x+b,St.endY=tt*y+ot*E+z,St.radiusX===0||St.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),St.xAxisRotation+=tt),0>a&&(St.xAxisRotation=180-St.xAxisRotation,St.isClockwiseArc=!St.isClockwiseArc),0>E&&(St.xAxisRotation=-St.xAxisRotation,St.isClockwiseArc=!St.isClockwiseArc),St.radiusX*=Math.sqrt(a*a+x*x),St.radiusY*=Math.sqrt(y*y+E*E);break;default:de("Unknown Segment type: "+St.type)}}}}return this._isInvalidBounds=!0,this},xt.ca=function(a,y){y===void 0&&(y=0);var x=this.od,E=this.pd,b=this.Dc,z=this.Ec;switch(this.type){case Xe.j:return Jt.Yb(x,E,b,z,y,a.x,a.y);case Xe.u:var tt=pe.allocAt(Math.min(x,b)-y,Math.min(E,z)-y,Math.abs(b-x)+2*y,Math.abs(z-E)+2*y);return a=tt.ca(a),pe.free(tt),a;case Xe.F:tt=Math.min(x,b)-y;var ot=Math.min(E,z)-y;return x=(Math.abs(b-x)+2*y)/2,y=(Math.abs(z-E)+2*y)/2,0>=x||0>=y?!1:(tt=a.x-(tt+x),ot=a.y-(ot+y),1>=tt*tt/(x*x)+ot*ot/(y*y));case Xe.o:return Jl(this,a,y,!0,!1);default:return!1}};function Jl(a,y,x,E,b){var z=y.x;y=y.y;for(var tt=a.bounds.x-20,ot=0,rt,at,ut,ct,mt=a.figures.s,yt=mt.length,St=0;St<yt;St++){var Mt=mt[St],Ot=!Mt.isEvenOdd;if(Mt.isFilled){if(E&&Mt.ca(z,y,x))return!0;var bt=Mt.segments;rt=Mt.startX,at=Mt.startY;for(var jt=rt,Gt=at,Wt=bt.s,Kt=0;Kt<=bt.length;Kt++){var $t=void 0;if(Kt!==bt.length){$t=Wt[Kt];var Qe=$t.type;a=$t.endX,ct=$t.endY}else Qe=ao,a=jt,ct=Gt;switch(Qe){case pr:if(jt=Ql(z,y,tt,y,rt,at,jt,Gt),isNaN(jt))return!0;ot+=jt,jt=a,Gt=ct;break;case ao:if(rt=Ql(z,y,tt,y,rt,at,a,ct),isNaN(rt))return!0;ot+=rt;break;case Rr:ut=Jt.Fo(rt,at,$t.point1X,$t.point1Y,$t.point2X,$t.point2Y,a,ct,tt,y,z,y,.5),ot+=ut;break;case aa:ut=Jt.Fo(rt,at,(rt+2*$t.point1X)/3,(at+2*$t.point1Y)/3,(2*$t.point1X+a)/3,(2*$t.point1Y+ct)/3,a,ct,tt,y,z,y,.5),ot+=ut;break;case tr:case xa:Qe=$t.type===tr?Zs($t,Mt):Ba($t,Mt,rt,at);var dn=Qe.length;if(dn===0){if(rt=Ql(z,y,tt,y,rt,at,$t.type===tr?$t.centerX:$t.endX,$t.type===tr?$t.centerY:$t.endY),isNaN(rt))return!0;ot+=rt;break}$t=null;for(var rn=0;rn<dn;rn++){if($t=Qe[rn],rn===0){if(ut=Ql(z,y,tt,y,rt,at,$t[0],$t[1]),isNaN(ut))return!0;ot+=ut}ut=Jt.Fo($t[0],$t[1],$t[2],$t[3],$t[4],$t[5],$t[6],$t[7],tt,y,z,y,.5),ot+=ut}$t!==null&&(a=$t[6],ct=$t[7]);break;default:de("Unknown Segment type: "+$t.type)}rt=a,at=ct}if(Ot){if(ot!==0)return!0}else if(ot%2!==0)return!0;ot=0}else if(Mt.ca(z,y,b?x:x+2))return!0}return!1}function Ql(a,y,x,E,b,z,tt,ot){if(Jt.Yb(b,z,tt,ot,.05,a,y))return NaN;var rt=(a-x)*(z-ot);if(rt===0)return 0;var at=((a*E-y*x)*(b-tt)-(a-x)*(b*ot-z*tt))/rt;if(y=(a*E-y*x)*(z-ot)/rt,at>=a)return 0;if((b>tt?b-tt:tt-b)<(z>ot?z-ot:ot-z)){if(z<ot){if(y<z||y>ot)return 0}else if(y<ot||y>z)return 0}else if(b<tt){if(at<b||at>tt)return 0}else if(at<tt||at>b)return 0;return 0<rt?1:-1}function rh(a,y,x,E){a=a.figures.s;for(var b=a.length,z=0;z<b;z++)if(a[z].ca(y,x,E))return!0;return!1}xt.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new At),this.type===Xe.j)return y.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,ot=0;ot<b;ot++){var rt=E[ot],at=rt.length;for(a=0;a<at;a++){var ut=rt[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,x=x[ot],ot=x[2*a],b=x[2*a+1],y.h(ot+(x[2*a+2]-ot)*E,b+(x[2*a+3]-b)*E),y;tt+=ut}}return y},xt.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===Xe.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var y=this.flattenedSegments,x=this.flattenedLengths,E=y.length,b=this.flattenedTotalLength*a,z=0,tt=0;tt<E;tt++){var ot=x[tt],rt=ot.length;for(a=0;a<rt;a++){var at=ot[a];if(z+at>=b)return b=y[tt],y=b[2*a],x=b[2*a+1],E=b[2*a+2],a=b[2*a+3],1>Math.abs(E-y)&&1>Math.abs(a-x)?0:1>Math.abs(E-y)?0<=a-x?90:270:1>Math.abs(a-x)?0<=E-y?0:180:180*Math.atan2(a-x,E-y)/Math.PI;z+=at}}return NaN},xt.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===Xe.j)return y[0]=this.startX+a*(this.endX-this.startX),y[1]=this.startY+a*(this.endY-this.startY),y[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,ot=0;ot<b;ot++){var rt=E[ot],at=rt.length;for(a=0;a<at;a++){var ut=rt[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,ut=x[ot],x=ut[2*a],ot=ut[2*a+1],b=ut[2*a+2],a=ut[2*a+3],y[0]=x+(b-x)*E,y[1]=ot+(a-ot)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-ot)?0:1>Math.abs(b-x)?0<=a-ot?90:270:1>Math.abs(a-ot)?0<=b-x?0:180:180*Math.atan2(a-ot,b-x)/Math.PI,y;tt+=ut}}return y},xt.xx=function(a){if(this.type===Xe.j){var y=this.startX,x=this.startY,E=this.endX,b=this.endY;if(y!==E||x!==b){var z=a.x;if(a=a.y,y===E){if(x<b){var tt=x;E=b}else tt=b,E=x;return a<=tt?tt===x?0:1:a>=E?E===x?0:1:Math.abs(a-x)/(E-tt)}if(x===b)return y<E?tt=y:(tt=E,E=y),z<=tt?tt===y?0:1:z>=E?E===y?0:1:Math.abs(z-y)/(E-tt);tt=(E-y)*(E-y)+(b-x)*(b-x);var ot=At.alloc();return Jt.qh(y,x,E,b,z,a,ot),a=ot.x,z=ot.y,At.free(ot),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===Xe.u){tt=this.startX,ot=this.startY;var rt=this.endX;if(b=this.endY,tt!==rt||ot!==b){y=rt-tt,x=b-ot,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,tt),rt),a=Math.min(Math.max(a,ot),b),tt=Math.abs(E-tt),rt=Math.abs(E-rt),ot=Math.abs(a-ot),b=Math.abs(a-b);var at=Math.min(tt,rt,ot,b);if(at===ot)return E/z;if(at===rt)return(y+a)/z;if(at===b)return(2*y+x-E)/z;if(at===tt)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=At.alloc(),b=1/0,ot=tt=0,rt=y.length;for(var ut=at=0,ct=0;ct<rt;ct++)for(var mt=y[ct],yt=x[ct],St=mt.length,Mt=0;Mt<St;Mt+=2){var Ot=mt[Mt],bt=mt[Mt+1];if(Mt!==0){Jt.qh(at,ut,Ot,bt,a.x,a.y,E);var jt=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);jt<b&&(b=jt,tt=ot,tt+=Math.sqrt((E.x-at)*(E.x-at)+(E.y-ut)*(E.y-ut))),ot+=yt[(Mt-2)/2]}at=Ot,ut=bt}return At.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function Df(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===Xe.j)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.endY),y.push(E),b.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),x.push(b);else if(a.type===Xe.u)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.startY),E.push(a.endX),E.push(a.endY),E.push(a.startX),E.push(a.endY),E.push(a.startX),E.push(a.startY),y.push(E),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),x.push(b);else if(a.type===Xe.F){var z=new gr;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new Oi(tr);if(tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(a.startX+a.endX)/2,tt.centerY=(a.startY+a.endY)/2,tt.radiusX=Math.abs(a.startX-a.endX)/2,tt.radiusY=Math.abs(a.startY-a.endY)/2,z.add(tt),a=Zs(tt,z),b=a.length,b===0)E.push(tt.centerX),E.push(tt.centerY);else{tt=z.startX,z=z.startY;for(var ot=0;ot<b;ot++){var rt=a[ot];Jt.Qe(tt,z,rt[2],rt[3],rt[4],rt[5],rt[6],rt[7],.5,E),tt=rt[6],z=rt[7]}}y.push(E),x.push(Bd(E))}else for(a=a.figures.iterator;a.next();){b=a.value,E=[],E.push(b.startX),E.push(b.startY),tt=b.startX,z=b.startY,ot=tt,rt=z;for(var at=b.segments.s,ut=at.length,ct=0;ct<ut;ct++){var mt=at[ct];switch(mt.type){case pr:4<=E.length&&(y.push(E),x.push(Bd(E))),E=[],E.push(mt.endX),E.push(mt.endY),tt=mt.endX,z=mt.endY,ot=tt,rt=z;break;case ao:E.push(mt.endX),E.push(mt.endY),tt=mt.endX,z=mt.endY;break;case Rr:Jt.Qe(tt,z,mt.point1X,mt.point1Y,mt.point2X,mt.point2Y,mt.endX,mt.endY,.5,E),tt=mt.endX,z=mt.endY;break;case aa:Jt.ep(tt,z,mt.point1X,mt.point1Y,mt.endX,mt.endY,.5,E),tt=mt.endX,z=mt.endY;break;case tr:var yt=Zs(mt,b),St=yt.length;if(St===0){E.push(mt.centerX),E.push(mt.centerY),tt=mt.centerX,z=mt.centerY;break}for(var Mt=0;Mt<St;Mt++){var Ot=yt[Mt];Jt.Qe(tt,z,Ot[2],Ot[3],Ot[4],Ot[5],Ot[6],Ot[7],.5,E),tt=Ot[6],z=Ot[7]}break;case xa:if(yt=Ba(mt,b,tt,z),St=yt.length,Mt=mt.endX,Ot=mt.endY,St===0){E.push(Mt),E.push(Ot),tt=Mt,z=Ot;break}for(Mt=0;Mt<St;Mt++)Ot=yt[Mt],Jt.Qe(tt,z,Ot[2],Ot[3],Ot[4],Ot[5],Ot[6],Ot[7],.5,E),tt=Ot[6],z=Ot[7];break;default:de("Segment not of valid type: "+mt.type)}mt.isClosed&&(E.push(ot),E.push(rt))}4<=E.length&&(y.push(E),x.push(Bd(E)))}}}function Bd(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var tt=a[z],ot=a[z+1];z!==0&&y.push(Math.sqrt(Wn(x,E,tt,ot))),x=tt,E=ot}return y}xt.add=function(a){return this.ee.add(a),this},xt.pm=function(a,y,x,E,b,z,tt,ot){return this._isFrozen&&bn(this),this.fg=new Sn(a,y,b,z).freeze(),this.gg=new Sn(x,E,tt,ot).freeze(),this},Ie.Object.defineProperties(Xe.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},flattenedSegments:{get:function(){return Df(this),this.tk}},flattenedLengths:{get:function(){return Df(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===Xe.j){a=Math.abs(this.endX-this.startX);var y=Math.abs(this.endY-this.startY);a=Math.sqrt(a*a+y*y)}else if(this.type===Xe.u)a=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{y=this.flattenedLengths;for(var x=y.length,E=a=0;E<x;E++)for(var b=y[E],z=b.length,tt=0;tt<z;tt++)a+=b[tt]}this.zm=a}return a}},type:{get:function(){return this.na},set:function(a){this.na!==a&&(this._isFrozen&&bn(this,a),this.na=a,a===Xe.o?this.ee=new be:(Xe.V===null&&(Xe.V=new be().freeze()),this.ee=Xe.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&bn(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&bn(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&bn(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&bn(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&bn(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&bn(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&bn(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&bn(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),Xe.prototype.setSpots=Xe.prototype.pm,Xe.prototype.add=Xe.prototype.add,Xe.prototype.getFractionForPoint=Xe.prototype.xx,Xe.prototype.getPointAndAngleAlongPath=Xe.prototype.Qu,Xe.prototype.getAngleAlongPath=Xe.prototype.wx,Xe.prototype.getPointAlongPath=Xe.prototype.Pu,Xe.prototype.containsPoint=Xe.prototype.ca,Xe.prototype.transform=Xe.prototype.transform,Xe.prototype.rotate=Xe.prototype.rotate,Xe.prototype.scale=Xe.prototype.scale,Xe.prototype.offset=Xe.prototype.offset,Xe.prototype.normalize=Xe.prototype.normalize,Xe.prototype.computeBoundsWithoutOrigin=Xe.prototype.ix,Xe.prototype.equalsApprox=Xe.prototype.Xa,Xe.className="Geometry",Xe.j=new ae(Xe,"Line",0),Xe.u=new ae(Xe,"Rectangle",1),Xe.F=new ae(Xe,"Ellipse",2),Xe.o=new ae(Xe,"Path",3),Xe.V=null,Xe.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",Xe.className="Geometry",Xe.stringify=Xe.ia,Xe.fillPath=Xe.nb,Xe.parse=Xe.parse,Xe.Line=Xe.j,Xe.Rectangle=Xe.u,Xe.Ellipse=Xe.F,Xe.Path=Xe.o;function gr(a,y,x,E,b){vi(this),x===void 0&&(x=!0),E===void 0&&(E=!0),b===void 0&&(b=!1),this.l=2|(x?4:0)|(E?8:0)|(b?16:0),a!==void 0?this.od=a:this.od=0,y!==void 0?this.pd=y:this.pd=0,this.pl=new be,this.sr=this.pl.Ja,this.fw=null}gr.prototype.copy=function(){var a=new gr;a.l=this.l&-2,a.od=this.od,a.pd=this.pd;for(var y=this.pl.s,x=y.length,E=a.pl,b=0;b<x;b++){var z=y[b].copy();E.add(z)}return a.sr=this.sr,a.fw=this.fw,a},xt=gr.prototype,xt.Xa=function(a){if(!(a instanceof gr&&Jt.B(this.startX,a.startX)&&Jt.B(this.startY,a.startY)))return!1;var y=this.segments.s;a=a.segments.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0},xt.toString=function(a){a===void 0&&(a=-1);for(var y=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a),x=this.segments.s,E=x.length,b=0;b<E;b++)y+=" "+x[b].toString(a);return y},xt.freeze=function(){this._isFrozen=!0;var a=this.segments;a.freeze();var y=a.s;a=a.length;for(var x=0;x<a;x++)y[x].freeze();return this},xt.ka=function(){this._isFrozen=!1;var a=this.segments;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},xt.Zu=function(){if(this._isInvalidBounds)return!0;var a=this.segments;if(this.sr!==a.Ja)return!0;a=a.s;for(var y=a.length,x=0;x<y;x++)if(a[x]._isInvalidBounds)return!0;return!1},xt.add=function(a){return this.pl.add(a),this},xt.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,tt=b,ot=this.segments.s,rt=ot.length,at=0;at<rt;at++){var ut=ot[at];switch(ut.type){case pr:z=ut.endX,tt=ut.endY,E=ut.endX,b=ut.endY;break;case ao:if(Jt.Yb(E,b,ut.endX,ut.endY,x,a,y))return!0;E=ut.endX,b=ut.endY;break;case Rr:if(Jt.cs(E,b,ut.point1X,ut.point1Y,ut.point2X,ut.point2Y,ut.endX,ut.endY,.5,a,y,x))return!0;E=ut.endX,b=ut.endY;break;case aa:if(Jt.jv(E,b,ut.point1X,ut.point1Y,ut.endX,ut.endY,.5,a,y,x))return!0;E=ut.endX,b=ut.endY;break;case tr:case xa:var ct=ut.type===tr?Zs(ut,this):Ba(ut,this,E,b),mt=ct.length,yt=ut.type===tr?ut.centerX:ut.endX,St=ut.type===tr?ut.centerY:ut.endY;if(mt===0){if(Jt.Yb(E,b,yt,St,x,a,y))return!0;E=yt,b=St;break}for(yt=null,St=0;St<mt;St++)if(yt=ct[St],St===0&&Jt.Yb(E,b,yt[0],yt[1],x,a,y)||Jt.cs(yt[0],yt[1],yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],.5,a,y,x))return!0;yt!==null&&(E=yt[6],b=yt[7]);break;default:de("Unknown Segment type: "+ut.type)}if(ut.isClosed&&(E!==z||b!==tt)&&Jt.Yb(E,b,z,tt,x,a,y))return!0}return!1},Ie.Object.defineProperties(gr.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isFilled:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&bn(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&bn(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&bn(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&bn(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&bn(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&bn(this,a),this.pl=a,this._isInvalidBounds=!0}}}),gr.prototype.add=gr.prototype.add,gr.prototype.equalsApprox=gr.prototype.Xa,gr.className="PathFigure";function Oi(a,y,x,E,b,z,tt,ot){vi(this),a===void 0&&(a=ao),this.na=a,this.l=2,y!==void 0?this.Dc=y:this.Dc=0,x!==void 0?this.Ec=x:this.Ec=0,E===void 0&&(E=0),b===void 0&&(b=0),z===void 0&&(z=0),tt===void 0&&(tt=0),a===xa?(a=z%360,0>a&&(a+=360),this.Ne=a,this.Vh=0,this.Wh=Math.max(E,0),this.Pg=Math.max(b,0),typeof tt=="boolean"?tt&&(this.isLargeArc=!0):typeof tt=="number"&&tt&&(this.isLargeArc=!0),ot&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===tr&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===tr&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}Oi.prototype.copy=function(){var a=new Oi;return a.na=this.na,a.l=this.l&-2,a.Dc=this.Dc,a.Ec=this.Ec,a.Ne=this.Ne,a.Vh=this.Vh,a.Wh=this.Wh,a.Pg=this.Pg,a},xt=Oi.prototype,xt.Xa=function(a){if(!(a instanceof Oi)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case pr:case ao:return Jt.B(this.endX,a.endX)&&Jt.B(this.endY,a.endY);case Rr:return Jt.B(this.endX,a.endX)&&Jt.B(this.endY,a.endY)&&Jt.B(this.point1X,a.point1X)&&Jt.B(this.point1Y,a.point1Y)&&Jt.B(this.point2X,a.point2X)&&Jt.B(this.point2Y,a.point2Y);case aa:return Jt.B(this.endX,a.endX)&&Jt.B(this.endY,a.endY)&&Jt.B(this.point1X,a.point1X)&&Jt.B(this.point1Y,a.point1Y);case tr:return Jt.B(this.startAngle,a.startAngle)&&Jt.B(this.sweepAngle,a.sweepAngle)&&Jt.B(this.centerX,a.centerX)&&Jt.B(this.centerY,a.centerY)&&Jt.B(this.radiusX,a.radiusX)&&Jt.B(this.radiusY,a.radiusY);case xa:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&Jt.B(this.xAxisRotation,a.xAxisRotation)&&Jt.B(this.endX,a.endX)&&Jt.B(this.endY,a.endY)&&Jt.B(this.radiusX,a.radiusX)&&Jt.B(this.radiusY,a.radiusY);default:return!1}},xt.qb=function(a){a.classType===Oi&&(this.type=a)},xt.toString=function(a){switch(a===void 0&&(a=-1),this.type){case pr:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case ao:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Rr:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case aa:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case tr:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case xa:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.close=function(){return this.isClosed=!0,this};function Zs(a,y){if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;var x=a.radiusX,E=a.radiusY;if(E===void 0&&(E=x),x===0||E===0)return a.ae=[],a.ae;y=a.Ne;var b=a.Vh,z=Jt.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var tt=ci.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),Xe.Ha(z,tt),ci.free(tt)}for(x=z.length,E=0;E<x;E++)tt=z[E],tt[0]+=y,tt[1]+=b,tt[2]+=y,tt[3]+=b,tt[4]+=y,tt[5]+=b,tt[6]+=y,tt[7]+=b;return a.ae=z,a.ae}function Ba(a,y,x,E){function b(Mt,Ot,bt,jt){return(Mt*jt<Ot*bt?-1:1)*Math.acos((Mt*bt+Ot*jt)/(Math.sqrt(Mt*Mt+Ot*Ot)*Math.sqrt(bt*bt+jt*jt)))}if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;if(a.radiusX===0||a.radiusY===0)return a.ae=[],a.ae;y=a.Wh;var z=a.Pg;y===0&&(y=1e-4),z===0&&(z=1e-4);var tt=Math.PI/180*a.Ne,ot=a.isLargeArc,rt=a.isClockwiseArc,at=a.Dc,ut=a.Ec,ct=Math.cos(tt),mt=Math.sin(tt),yt=ct*(x-at)/2+mt*(E-ut)/2;tt=-mt*(x-at)/2+ct*(E-ut)/2;var St=yt*yt/(y*y)+tt*tt/(z*z);return 1<St&&(y*=Math.sqrt(St),z*=Math.sqrt(St)),St=(ot===rt?-1:1)*Math.sqrt((y*y*z*z-y*y*tt*tt-z*z*yt*yt)/(y*y*tt*tt+z*z*yt*yt)),isNaN(St)&&(St=0),ot=St*y*tt/z,St=St*-z*yt/y,isNaN(ot)&&(ot=0),isNaN(St)&&(St=0),x=(x+at)/2+ct*ot-mt*St,E=(E+ut)/2+mt*ot+ct*St,ut=b(1,0,(yt-ot)/y,(tt-St)/z),ct=(yt-ot)/y,at=(tt-St)/z,yt=(-yt-ot)/y,ot=(-tt-St)/z,tt=b(ct,at,yt,ot),yt=(ct*yt+at*ot)/(Math.sqrt(ct*ct+at*at)*Math.sqrt(yt*yt+ot*ot)),-1>=yt?tt=Math.PI:1<=yt&&(tt=0),!rt&&0<tt&&(tt-=2*Math.PI),rt&&0>tt&&(tt+=2*Math.PI),rt=y>z?1:y/z,yt=y>z?z/y:1,y=Jt.jx(0,0,y>z?y:z,ut,ut+tt,!0),z=ci.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(rt,yt),Xe.Ha(y,z),ci.free(z),a.ae=y,a.ae}Ie.Object.defineProperties(Oi.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isClosed:{get:function(){return(this.l&8)!==0},set:function(a){this.isClosed!==a&&(this.l=a?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(a){this._isFrozen&&bn(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&bn(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&bn(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&bn(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&bn(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&bn(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&bn(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&bn(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&bn(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&qn(a,">= zero",Oi,"radiusX"),this._isFrozen&&bn(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&qn(a,">= zero",Oi,"radiusY"),this._isFrozen&&bn(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&bn(this,a),a%=360,0>a&&(a+=360),this.Dc=a,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(a){this._isFrozen&&bn(this,a),360<a&&(a=360),-360>a&&(a=-360),this.Ec=a,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&bn(this,a),this.l=a?this.l|4:this.l&-5,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&bn(this,a),this.l=a?this.l|16:this.l&-17,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(a){this._isFrozen&&bn(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Oi.prototype.equalsApprox=Oi.prototype.Xa;var pr=new ae(Oi,"Move",0),ao=new ae(Oi,"Line",1),Rr=new ae(Oi,"Bezier",2),aa=new ae(Oi,"QuadraticBezier",3),tr=new ae(Oi,"Arc",4),xa=new ae(Oi,"SvgArc",4);Oi.className="PathSegment",Oi.Move=pr,Oi.Line=ao,Oi.Bezier=Rr,Oi.QuadraticBezier=aa,Oi.Arc=tr,Oi.SvgArc=xa;function Qr(){this.H=null,this.xu=new At(0,0).freeze(),this.mt=new At(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}Qr.prototype.copy=function(){var a=new Qr;return this.clone(a)},Qr.prototype.clone=function(a){return a.H=this.H,a.xu.assign(this.viewPoint),a.mt.assign(this.documentPoint),a.Rq=this.Rq,a.Bp=this.Bp,a.Cp=this.Cp,a.xq=this.xq,a.Tp=this.Tp,a.Wr=this.Wr,a.Ep=this.Ep,a.Rp=this.Rp,a.tq=this.tq,a.nq=this.nq,a.xg=this.xg,a.Zp=this.Zp,a.Rr=this.Rr,a.Nr=this.Nr,a.xd=this.xd,a},Qr.prototype.toString=function(){var a="^";return this.modifiers!==0&&(a+="M:"+this.modifiers),this.button!==0&&(a+="B:"+this.button),this.key!==""&&(a+="K:"+this.key),this.clickCount!==0&&(a+="C:"+this.clickCount),this.delta!==0&&(a+="D:"+this.delta),this.handled&&(a+="h"),this.bubbles&&(a+="b"),this.documentPoint!==null&&(a+="@"+this.documentPoint.toString()),a},Qr.prototype.So=function(a,y){var x=this.diagram;return x===null||pg(x,a,y),y},Qr.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(pg(x,a,y),y.assign(x.Ps(y))),y},Ie.Object.defineProperties(Qr.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{get:function(){return this.xu},set:function(a){this.xu.assign(a)}},documentPoint:{get:function(){return this.mt},set:function(a){this.mt.assign(a)}},modifiers:{get:function(){return this.Rq},set:function(a){this.Rq=a}},button:{get:function(){return this.Bp},set:function(a){if(this.Bp=a,this.event===null)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(a){this.Cp=a}},key:{get:function(){return this.xq},set:function(a){this.xq=a}},down:{get:function(){return this.Tp},set:function(a){this.Tp=a}},up:{get:function(){return this.Wr},set:function(a){this.Wr=a}},clickCount:{get:function(){return this.Ep},set:function(a){this.Ep=a}},delta:{get:function(){return this.Rp},set:function(a){this.Rp=a}},isMultiTouch:{get:function(){return this.tq},set:function(a){this.tq=a}},handled:{get:function(){return this.nq},set:function(a){this.nq=a}},bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},event:{get:function(){return this.Zp},set:function(a){this.Zp=a}},isTouchEvent:{get:function(){var a=this.event;return a===null?!1:a.pointerType==="touch"||a.pointerType==="pen"}},timestamp:{get:function(){return this.Rr},set:function(a){this.Rr=a}},targetDiagram:{get:function(){return this.Nr},set:function(a){this.Nr=a}},targetObject:{get:function(){return this.xd},set:function(a){this.xd=a}},control:{get:function(){return(this.modifiers&1)!==0},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return(this.modifiers&4)!==0},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return(this.modifiers&2)!==0},set:function(a){this.modifiers=a?this.modifiers|2:this.modifiers&-3}},meta:{get:function(){return(this.modifiers&8)!==0},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&1)!==0:this.button===0},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&2)!==0:this.button===2},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&4)!==0:this.button===1},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}),Qr.prototype.getMultiTouchDocumentPoint=Qr.prototype.Bz,Qr.prototype.getMultiTouchViewPoint=Qr.prototype.So,Qr.className="InputEvent";function Su(){this.H=null,this.xa="",this.ar=this.Lr=null}Su.prototype.copy=function(){var a=new Su;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Su.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},Ie.Object.defineProperties(Su.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},subject:{get:function(){return this.Lr},set:function(a){this.Lr=a}},parameter:{get:function(){return this.ar},set:function(a){this.ar=a}}}),Su.className="DiagramEvent";function No(){this.Fm=Eo,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}No.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},No.prototype.copy=function(){var a=new No;a.Fm=this.Fm,a.Qq=this.Qq,a.rf=this.rf,a.cc=this.cc,a.H=this.H,a.Qn=this.Qn;var y=this.Sn;return a.Sn=Ve(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=Ve(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=Ve(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=Ve(y)&&typeof y.J=="function"?y.J():y,a},No.prototype.qb=function(a){a.classType===No&&(this.change=a)},No.prototype.toString=function(){var a="";return a=this.change===Js?a+"* ":this.change===Eo?a+(this.model!==null?"!m":"!d"):a+((this.model!==null?"!m":"!d")+this.change),this.propertyName&&typeof this.propertyName=="string"&&(a+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange),a+=": ",this.change===Js?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=Yi(this.object)),this.oldValue!==null&&(a+=" old: "+Yi(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+Yi(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},No.prototype.I=function(a){return a?this.oldValue:this.newValue},No.prototype.Dz=function(a){return a?this.oldParam:this.newParam},No.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},No.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},No.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},No.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},Ie.Object.defineProperties(No.prototype,{model:{get:function(){return this.cc},set:function(a){this.cc=a}},diagram:{get:function(){return this.H},set:function(a){this.H=a}},change:{get:function(){return this.Fm},set:function(a){this.Fm=a}},modelChange:{get:function(){return this.Qq},set:function(a){this.Qq=a}},propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},isTransactionFinished:{get:function(){return this.Fm===Js&&(this.rf==="CommittedTransaction"||this.rf==="FinishedUndo"||this.rf==="FinishedRedo")}},object:{get:function(){return this.Qn},set:function(a){this.Qn=a}},oldValue:{get:function(){return this.Sn},set:function(a){this.Sn=a}},oldParam:{get:function(){return this.Rn},set:function(a){this.Rn=a}},newValue:{get:function(){return this.Mn},set:function(a){this.Mn=a}},newParam:{get:function(){return this.Ln},set:function(a){this.Ln=a}}}),No.prototype.redo=No.prototype.redo,No.prototype.canRedo=No.prototype.canRedo,No.prototype.undo=No.prototype.undo,No.prototype.canUndo=No.prototype.canUndo,No.prototype.getParam=No.prototype.Dz,No.prototype.getValue=No.prototype.I,No.prototype.clear=No.prototype.clear;var Js=new ae(No,"Transaction",-1),Eo=new ae(No,"Property",0),Ko=new ae(No,"Insert",1),ar=new ae(No,"Remove",2);No.className="ChangedEvent",No.Transaction=Js,No.Property=Eo,No.Insert=Ko,No.Remove=ar;function xr(){this.o=new be().freeze(),this.xa="",this.j=!1}xr.prototype.toString=function(a){var y="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(a!==void 0&&0<a){a=this.changes.count;for(var x=0;x<a;x++){var E=this.changes.M(x);E!==null&&(y+=`
`+E.toString())}}return y},xr.prototype.clear=function(){var a=this.changes;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),a.freeze()},xr.prototype.canUndo=function(){return this.isComplete},xr.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--){var y=this.changes.M(a);y!==null&&y.undo()}},xr.prototype.canRedo=function(){return this.isComplete},xr.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,y=0;y<a;y++){var x=this.changes.M(y);x!==null&&x.redo()}},xr.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new qe,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===Eo&&E.object){var b=y.get(E.object);b||(b=new qe,y.set(E.object,b));var z=b.get(E.propertyName);z===null?b.set(E.propertyName,-1):(0<z&&a.cd(z,null),b.set(E.propertyName,x))}}for(x=y=0;x<a.count;x++)E=a.M(x),E!==null&&(x>y&&a.cd(y,E),y++);for(;a.length>y;)a.pop();a.freeze()}},Ie.Object.defineProperties(xr.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isComplete:{get:function(){return this.j},set:function(a){this.j=a}}}),xr.prototype.optimize=xr.prototype.ak,xr.prototype.redo=xr.prototype.redo,xr.prototype.canRedo=xr.prototype.canRedo,xr.prototype.undo=xr.prototype.undo,xr.prototype.canUndo=xr.prototype.canUndo,xr.prototype.clear=xr.prototype.clear,xr.className="Transaction";function Fo(){this.Pt=new ke,this.Jd=!1,this.u=new be().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new be().freeze(),this.hl=new be,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}Fo.prototype.toString=function(a){var y="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;y+="[";for(var x=this.nestedTransactionNames.count,E=0;E<x;E++)0<E&&(y+=" "),y+=this.nestedTransactionNames.M(E);if(y+="]",a!==void 0&&0<a)for(x=this.history.count,E=0;E<x;E++)y+=`
`+this.history.M(E).toString(a-1);return y},Fo.prototype.clear=function(){var a=this.history;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),this.Ce=-1,a.freeze(),this.Fe=!1,this.Np=null,this.bi=0,this.Ie.ka(),this.Ie.clear(),this.Ie.freeze(),this.hl.clear(),this.Dt=this.rq=this.Gt=this.Ft=!1},Fo.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},xt=Fo.prototype,xt.Xw=function(a){this.Pt.add(a)},xt.Rx=function(a){this.Pt.remove(a)},xt.Ea=function(a){if(a===void 0&&(a=""),a===null&&(a=""),this.isUndoingRedoing)return!1;this.tt===!0&&(this.tt=!1,this.bi++,this.isInternalTransaction||this.Ob("StartingFirstTransaction",a,this.currentTransaction),0<this.bi&&this.bi--),this.isEnabled&&(this.Ie.ka(),this.Ie.add(a),this.Ie.freeze(),this.currentTransaction===null?this.hl.add(0):this.hl.add(this.currentTransaction.changes.count)),this.bi++;var y=this.transactionLevel===1;return y&&(this.isInternalTransaction||this.Ob("StartedTransaction",a,this.currentTransaction)),y},xt.eb=function(a){return a===void 0&&(a=""),sh(this,!0,a)},xt.Kf=function(){return sh(this,!1,"")};function sh(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Di("Ending transaction without having started a transaction: "+x);var E=a.transactionLevel===1,b=a.currentTransaction;E&&y&&(a.isInternalTransaction||a.Ob("CommittingTransaction",x,b));var z=0;if(0<a.transactionLevel&&(a.bi--,a.isEnabled)){var tt=a.Ie.count;0<tt&&(x===""&&(x=a.Ie.M(0)),a.Ie.ka(),a.Ie.mb(tt-1),a.Ie.freeze()),tt=a.hl.count,0<tt&&(z=a.hl.M(tt-1),a.hl.mb(tt-1))}if(E){if(y)a.rq=!1,b===null&&x!==""&&(b=a.currentTransaction),a.isEnabled&&b!==null&&(b.isComplete||(b.isComplete=!0,b.name=x),a.lx(),y=a.history,y.ka(),E=a.maxHistoryLength,0<=E&&(E===0?y.clear():y.count>=E&&(z=y.M(0),z!==null&&z.clear(),y.mb(0),a.Ce--)),E===0||y.count!==0&&y.get(y.count-1)===b||(y.add(b),a.Ce++),y.freeze()),a.isInternalTransaction||a.Ob("CommittedTransaction",x,b);else{a.Fe=!0;try{a.isEnabled&&b!==null&&(b.isComplete=!0,b.undo())}finally{a.isInternalTransaction||a.Ob("RolledBackTransaction",x,b),a.Fe=!1}b!==null&&b.clear()}return a.Np=null,a.isPendingClear&&a.clear(),a.isPendingClear=!1,a.isPendingUnmodified=!1,!0}if(a.isEnabled&&!y&&b!==null){for(a=z,x=b.changes,b=x.count-1;b>=a;b--)y=x.M(b),y!==null&&y.undo(),x.ka(),x.mb(b);x.freeze()}return!1}xt.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var a=this.history;a.ka();for(var y=a.count-1;y>this.historyIndex;y--){var x=a.M(y);x!==null&&x.clear(),a.mb(y),this.rq=!0}a.freeze()}},Fo.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},Fo.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.Fe=!0,this.Ob("StartingUndo","Undo",a),this.Ce--,a.undo()}catch(y){Di("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},Fo.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},Fo.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.Fe=!0,this.Ob("StartingRedo","Redo",a),this.Ce++,a.redo()}catch(y){Di("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},Fo.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new No;for(E.change=Js,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},Fo.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new xr);var x=a.copy();y=y.changes,y.ka(),y.add(x),y.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.tt&&(a=a.diagram,a!==null&&a.pi===!1||Di("Change not within a transaction: "+x.toString()))}},Fo.prototype.skipsEvent=function(a){if(a===null||0>a.change.value)return!0;if(a=a.object,a===null)return!1;if(a.layer!==void 0){if(a=a.layer,a!==null&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1},Ie.Object.defineProperties(Fo.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count-1?this.history.M(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.Fe}},history:{get:function(){return this.u}},maxHistoryLength:{get:function(){return this.o},set:function(a){this.o=a}},historyIndex:{get:function(){return this.Ce}},currentTransaction:{get:function(){return this.Np}},transactionLevel:{get:function(){return this.bi}},isInTransaction:{get:function(){return 0<this.bi}},checksTransactionLevel:{get:function(){return this.j},set:function(a){this.j=a}},nestedTransactionNames:{get:function(){return this.Ie}},isPendingClear:{get:function(){return this.Ft},set:function(a){this.Ft=a}},isPendingUnmodified:{get:function(){return this.Gt},set:function(a){this.Gt=a}},isInternalTransaction:{get:function(){return this.Dt},set:function(a){this.Dt=a}},isJustDiscarded:{get:function(){return this.rq}}}),Fo.prototype.handleChanged=Fo.prototype.Tu,Fo.prototype.redo=Fo.prototype.redo,Fo.prototype.undo=Fo.prototype.undo,Fo.prototype.canUndo=Fo.prototype.canUndo,Fo.prototype.discardHistoryAfterIndex=Fo.prototype.lx,Fo.prototype.rollbackTransaction=Fo.prototype.Kf,Fo.prototype.commitTransaction=Fo.prototype.eb,Fo.prototype.startTransaction=Fo.prototype.Ea,Fo.prototype.removeModel=Fo.prototype.Rx,Fo.prototype.addModel=Fo.prototype.Xw,Fo.prototype.clear=Fo.prototype.clear,Fo.className="UndoManager";function bi(){vi(this),this.H=Bl,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new Qr,this.Zr=-1}bi.prototype.toString=function(){return this.name!==""?this.name+" Tool":ti(this.constructor)},bi.prototype.updateAdornments=function(){},bi.prototype.canStart=function(){return this.isEnabled},bi.prototype.doStart=function(){},bi.prototype.doActivate=function(){this.isActive=!0},bi.prototype.doDeactivate=function(){this.isActive=!1},bi.prototype.doStop=function(){},bi.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},bi.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},bi.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},bi.prototype.doMouseMove=function(){},bi.prototype.doMouseUp=function(){this.stopTool()},bi.prototype.doMouseWheel=function(){},bi.prototype.canStartMultiTouch=function(){return!0},bi.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){a.Bw=a.scale;var b=E.x-x.x,z=E.y-x.y;a.Jw=Math.sqrt(b*b+z*z),y.bubbles=!1}At.free(x),At.free(E)},bi.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){var b=E.x-x.x,z=E.y-x.y;z=Math.sqrt(b*b+z*z)/a.Jw,b=new At((Math.min(E.x,x.x)+Math.max(E.x,x.x))/2,(Math.min(E.y,x.y)+Math.max(E.y,x.y))/2),z*=a.Bw;var tt=a.commandHandler;if(z!==a.scale&&tt.canResetZoom(z)){var ot=a.zoomPoint;a.zoomPoint=b,tt.resetZoom(z),a.zoomPoint=ot}y.bubbles=!1}At.free(x),At.free(E)},bi.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},bi.prototype.doKeyUp=function(){},bi.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},bi.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},bi.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(kn?y.meta:y.control){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!y.isSelected),a.R("ChangedSelection",a.selection)}else if(y.shift){if(!x.isSelected){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!0),a.R("ChangedSelection",a.selection)}}else if(!x.isSelected){for(y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&a.select(y)}}else!y.left||(kn?y.meta:y.control)||y.shift||a.clearSelection()}},bi.prototype.standardMouseClick=function(a,y){a===void 0&&(a=null),y===void 0&&(y=function(b){return!b.layer.isTemporary});var x=this.diagram,E=x.lastInput;return a=x.ic(E.documentPoint,a,y),E.targetObject=a,Dp(a,E,x),E.handled};function Dp(a,y,x){if(y.handled=!1,a===null||a.If()){var E=0;y.left?E=y.clickCount===1?1:y.clickCount===2?2:1:y.right&&y.clickCount===1&&(E=3);var b="ObjectSingleClicked";if(a!==null){switch(E){case 1:b="ObjectSingleClicked";break;case 2:b="ObjectDoubleClicked";break;case 3:b="ObjectContextClicked"}E!==0&&x.R(b,a)}else{switch(E){case 1:b="BackgroundSingleClicked";break;case 2:b="BackgroundDoubleClicked";break;case 3:b="BackgroundContextClicked"}E!==0&&x.R(b)}if(a!==null)for(;a!==null;){switch(x=null,E){case 1:x=a.click;break;case 2:x=a.doubleClick?a.doubleClick:a.click;break;case 3:x=a.contextClick}if(x!==null&&(x(y,a),y.handled))break;a=a.panel}else{switch(a=null,E){case 1:a=x.click;break;case 2:a=x.doubleClick?x.doubleClick:x.click;break;case 3:a=x.contextClick}a!==null&&a(y)}}}bi.prototype.standardMouseOver=function(){var a=this.diagram,y=a.lastInput;if(a.animationManager.zb!==!0){var x=a.skipsUndoManager;a.skipsUndoManager=!0;var E=a.viewportBounds.ca(y.documentPoint)?a.ic(y.documentPoint,null,null):null;!y.event||y.event.type!=="pointercancel"&&y.event.type!=="pointerout"||(E=null),y.targetObject=E;var b=!1;if(E!==a.Ck){var z=a.Ck,tt=z;for(a.Ck=E,this.doCurrentObjectChanged(z,E),y.handled=!1;z!==null;){var ot=z.mouseLeave;if(ot!==null&&(E===z||E!==null&&E.rg(z)||(ot(y,z,E),b=!0,y.handled)))break;z=z.panel}for(z=tt,y.handled=!1;E!==null&&(tt=E.mouseEnter,!(tt!==null&&(z===E||z!==null&&z.rg(E)||(tt(y,E,z),b=!0,y.handled))));)E=E.panel;E=a.Ck}if(E!==null){for(z=E,tt="";z!==null&&(tt=z.cursor,tt==="");)z=z.panel;for(a.currentCursor=tt,y.handled=!1,z=E;z!==null&&(E=z.mouseOver,!(E!==null&&(E(y,z),b=!0,y.handled)));)z=z.panel}else this.doUpdateCursor(null),E=a.mouseOver,E!==null&&(E(y),b=!0);b&&a.$b(),a.skipsUndoManager=x}},bi.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},bi.prototype.doCurrentObjectChanged=function(){},bi.prototype.standardMouseWheel=function(){var a=this.diagram,y=a.lastInput,x=y.delta;if(x!==0&&a.documentBounds.w()){var E=a.commandHandler,b=a.toolManager.mouseWheelBehavior;if(E!==null&&(b===Dd&&!y.shift||b===Kh&&y.control))(0<x?E.canIncreaseZoom():E.canDecreaseZoom())&&(b=a.zoomPoint,a.zoomPoint=y.viewPoint,0<x?E.increaseZoom():E.decreaseZoom(),a.zoomPoint=b),y.bubbles=!1;else if(b===Dd&&y.shift||b===Kh&&!y.control){E=a.position.copy();var z=y.event;b=z.deltaMode;var tt=z.deltaX;z=z.deltaY;var ot="pixel";if(tt===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(ot,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(ot,0<x?"left":"right",Math.abs(x)));else{switch(b){case 0:ot="pixel";break;case 1:ot="line";break;case 2:ot="page"}tt!==0&&a.allowHorizontalScroll&&(tt*=a.scrollHorizontalLineChange/16,a.scroll(ot,0<tt?"right":"left",Math.abs(tt))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(ot,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,E,y)}}},bi.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},bi.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=Ni(function(){x.doWaitAfter(E)},a)},bi.prototype.cancelWaitAfter=function(){this.Zr!==-1&&me.clearTimeout(this.Zr),this.Zr=-1},bi.prototype.doWaitAfter=function(){},bi.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof Ai);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},bi.prototype.isBeyondDragSize=function(a,y){var x=this.diagram;a===void 0&&(a=x.firstInput.viewPoint),y===void 0&&(y=x.lastInput.viewPoint);var E=x.toolManager.dragSize,b=E.width;return E=E.height,x.firstInput.isTouchEvent&&(b+=6,E+=6),Math.abs(y.x-a.x)>b||Math.abs(y.y-a.y)>E},Ie.Object.defineProperties(bi.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof te&&(this.H=a)}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},isActive:{get:function(){return this.nb},set:function(a){this.nb=a}},transactionResult:{get:function(){return this.wm},set:function(a){this.wm=a}}}),bi.prototype.startTransaction=bi.prototype.Ea,bi.className="Tool";function ko(){bi.call(this),this.name="ToolManager",this.hb=new be,this.ob=new be,this.Hb=new be,this.F=this.V=850,this.o=new Le(2,2).ja(),this.Ha=5e3,this.ia=Kh,this.u=Of,this.Mp=this.j=null,this.zj=-1}ee(ko,bi),ko.prototype.initializeStandardTools=function(){},ko.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof Ai&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},ko.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===ql&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===ah){y.bubbles=!0;return}if(this.gestureBehavior===ql)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseDown());return}}a.lastInput.button===1&&(this.mouseWheelBehavior===Kh?this.mouseWheelBehavior=Dd:this.mouseWheelBehavior===Dd&&(this.mouseWheelBehavior=Kh)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},ko.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===ah){y.bubbles=!0;return}if(this.gestureBehavior===ql)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var x=this.mouseMoveTools.length,E=0;E<x;E++){var b=this.mouseMoveTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseMove());return}}Op(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function Op(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}ko.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Ai&&(y===a||y.rg(a))||this.hideToolTip()},ko.prototype.doWaitAfter=function(a){var y=this.diagram;y.ta!==null&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!y.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,y.lastInput=a,y.qu=!0,y.doMouseUp()))},ko.prototype.doMouseHover=function(){var a=this.diagram,y=a.lastInput;y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null));var x=y.targetObject;if(x!==null)for(y.handled=!1;x!==null&&(a=this.isActive?x.mouseHold:x.mouseHover,!(a!==null&&(a(y,x),y.handled)));)x=x.panel;else x=this.isActive?a.mouseHold:a.mouseHover,x!==null&&x(y)},ko.prototype.doToolTip=function(){var a=this.diagram,y=a.lastInput;if(y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null)),y=y.targetObject,y!==null){if(a=this.currentToolTip,!(a instanceof Ai)||y!==a&&!y.rg(a)){for(;y!==null;){if(a=y.toolTip,a!==null){this.showToolTip(a,y);return}y=y.panel}this.hideToolTip()}}else y=a.toolTip,y!==null?this.showToolTip(y,null):this.hideToolTip()},ko.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof Ai){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category="ToolTip",a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionToolTip(a,y)}else a instanceof yl&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(me.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=Ni(function(){b.hideToolTip()},a)}},ko.prototype.positionToolTip=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y=x.y+20/y.scale+E.height>b.bottom?x.y-(E.height+5/y.scale):x.y+20/y.scale,x.y<b.y&&(x.y=b.y),a.position=x}},ko.prototype.hideToolTip=function(){this.zj!==-1&&(me.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof Ai?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof yl&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},ko.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var y=this.mouseUpTools.length,x=0;x<y;x++){var E=this.mouseUpTools.M(x);if(E.diagram=this.diagram,E.canStart()){a.doFocus(),a.currentTool=E,a.currentTool===E&&(E.isActive||E.doActivate(),E.doMouseUp());return}}a.doFocus(),this.doDeactivate()},ko.prototype.doMouseWheel=function(){this.standardMouseWheel()},ko.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},ko.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},ko.prototype.findTool=function(a){for(var y=this.mouseDownTools.length,x=0;x<y;x++){var E=this.mouseDownTools.M(x);if(E.name===a)return E}for(y=this.mouseMoveTools.length,x=0;x<y;x++)if(E=this.mouseMoveTools.M(x),E.name===a)return E;for(y=this.mouseUpTools.length,x=0;x<y;x++)if(E=this.mouseUpTools.M(x),E.name===a)return E;return null},ko.prototype.replaceTool=function(a,y){y!==null&&(y.diagram=this.diagram);for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.name===a)return y!==null?this.mouseDownTools.cd(E,y):this.mouseDownTools.mb(E),b}for(x=this.mouseMoveTools.length,E=0;E<x;E++)if(b=this.mouseMoveTools.M(E),b.name===a)return y!==null?this.mouseMoveTools.cd(E,y):this.mouseMoveTools.mb(E),b;for(x=this.mouseUpTools.length,E=0;E<x;E++)if(b=this.mouseUpTools.M(E),b.name===a)return y!==null?this.mouseUpTools.cd(E,y):this.mouseUpTools.mb(E),b;return null},ko.prototype.gb=function(a,y,x){y!==null&&(y.name=a,y.diagram=this.diagram),this.findTool(a)?this.replaceTool(a,y):y!==null&&x.add(y)},Ie.Object.defineProperties(ko.prototype,{mouseWheelBehavior:{get:function(){return this.ia},set:function(a){this.ia=a}},gestureBehavior:{get:function(){return this.u},set:function(a){this.u=a}},currentToolTip:{get:function(){return this.j},set:function(a){this.j=a,this.Mp=a!==null&&a instanceof Ai?a.adornedPart:null}},mouseDownTools:{get:function(){return this.hb}},mouseMoveTools:{get:function(){return this.ob}},mouseUpTools:{get:function(){return this.Hb}},hoverDelay:{get:function(){return this.V},set:function(a){this.V=a}},holdDelay:{get:function(){return this.F},set:function(a){this.F=a}},dragSize:{get:function(){return this.o},set:function(a){this.o=a.J()}},toolTipDuration:{get:function(){return this.Ha},set:function(a){this.Ha=a}}}),ko.prototype.replaceStandardTool=ko.prototype.gb;var Kh=new ae(ko,"WheelScroll",0),Dd=new ae(ko,"WheelZoom",1),Qc=new ae(ko,"WheelNone",2),Of=new ae(ko,"GestureZoom",3),ql=new ae(ko,"GestureCancel",4),ah=new ae(ko,"GestureNone",5);ko.className="ToolManager",ko.WheelScroll=Kh,ko.WheelZoom=Dd,ko.WheelNone=Qc,ko.GestureZoom=Of,ko.GestureCancel=ql,ko.GestureNone=ah;function bo(){bi.call(this),this.name="Dragging",this.u=this.Sw=this.ob=!0,this.o=this.Ha=this.V=this.Oe=null,this.Ym=this.Hb=!1,this.tl=new At(NaN,NaN),this.Fr=new At,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new ke().freeze(),this.ia=new st,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var bl;ee(bo,bi),bo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var y=a.lastInput;return!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.isTouchEvent&&y.timestamp-a.firstInput.timestamp<this.Ik)?!1:this.findDraggablePart()!==null},bo.prototype.findDraggablePart=function(){var a=this.diagram;if(a=a.Ol(a.firstInput.documentPoint,!1),a===null)return null;for(;a!==null&&!a.canSelect();)a=a.containingGroup;return a!==null&&(a.canMove()||a.canCopy())?a:null},bo.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.Ol(a.firstInput.documentPoint,!1);if(y!==null){for(;y!==null&&!y.canSelect();)y=y.containingGroup;this.currentPart=y,this.currentPart===null||this.currentPart.isSelected||(a.R("ChangingSelection",a.selection),y=a.lastInput,(kn?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},bo.prototype.doActivate=function(){var a=this.diagram;this.Bn=null,this.currentPart===null&&this.standardMouseSelect();var y=this.currentPart;y!==null&&(y.canMove()||y.canCopy())&&(a.Fu(!0),Nr=null,this.isActive=!0,this.tl.set(a.position),If(this,a.selection),this.Cg.length=0,a.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),this.Sw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,a.Ns=!0,a.Gf("temporaryPixelRatio")===!0&&30<a.$w&&ks(a),qf(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,Nr=this,Lu=this.diagram,this.doSimulatedDragOut()))};function If(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof Ue?(a.draggedLink=y.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.Ej(),a.Oe=x.toolManager.findTool("Relinking"),a.Oe===null&&(a.Oe=new la,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}bo.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},bo.prototype.Pd=function(a){return a===void 0?new ou(An):this.isGridSnapEnabled?new ou(new At(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new ou(a.copy())},bo.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),lh(this),xh(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<bl.count){for(var y=bl,x=y.length,E=0;E<x;E++){var b=y.M(E);xu(b),Va(b),lh(b),b.diagram.ug()}y.clear()}xu(this),this.tl.h(NaN,NaN),Lu!==null&&(Lu.currentCursor=""),Nr=Lu=null,Va(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),Kd(a,!0)},bo.prototype.stopTransaction=function(){var a=this.diagram,y=bi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function lh(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,$c(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function qc(){var a=Nr;Va(a),Pu(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}bo.prototype.doCancel=function(){Va(this),Pu(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},bo.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},bo.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function $l(a,y){if(a.copiedParts===null){var x=a.diagram;if((!y||!x.isReadOnly&&!x.isModelReadOnly)&&a.draggedParts!==null){var E=x.undoManager;for(E.isEnabled&&E.isInTransaction?E.currentTransaction!==null&&0<E.currentTransaction.changes.count&&(x.undoManager.Kf(),x.Ea("Drag")):Pu(a),x.skipsUndoManager=!y,x.partManager.addsToTemporaryLayer=!y,a.startPoint=x.firstInput.documentPoint,y=a.copiesEffectiveCollection?a.draggedParts.Lf():x.selection,y=x.Kj(y,x,!0),x=new qe,E=a.draggedParts.iterator;E.next();){var b=E.key;if(b.Zc()&&b.canCopy()){var z=y.I(b);z!==null&&(z.location=b.location,z.Va(),x.add(z,a.Pd(z.location)))}}for(y=y.iterator;y.next();)E=y.value,E instanceof Ue&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,If(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,Wu(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function Va(a){var y=a.diagram;if(a.copiedParts!==null){if(y.Is(a.copiedParts.Lf(),!1),a.copiedParts=null,a.draggedParts!==null)for(var x=a.draggedParts.iterator;x.next();)x.key instanceof Ue&&(x.value.point=new At(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function xu(a){if(a.draggedLink!==null){if(a.dragsLink&&a.Oe!==null){var y=a.Oe;y.diagram.remove(y.temporaryFromNode),y.diagram.remove(y.temporaryToNode),a.Oe.originalLink=null}a.draggedLink=null,a.Oe=null}}function vl(a,y,x){var E=a.diagram,b=a.startPoint,z=At.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),At.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(ks(E),E.hk())}bo.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&Sh(E,a,y,this.dragOptions,x)};function Pu(a){if(a.draggedParts!==null){for(var y=a.diagram,x=a.draggedParts.iterator;x.next();){var E=x.key;E.Zc()&&(E.location=x.value.point)}for(x=a.draggedParts.iterator;x.next();)if(E=x.key,E instanceof Ue&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),Wu(E,-b.x,-b.y)}y.bd()}}function Rf(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),wu(a,!1));var E=a.findDragOverObject(y),b=x.lastInput;b.targetObject=E,a.doUpdateCursor(E);var z=x.skipsUndoManager,tt=!1;try{if(x.skipsUndoManager=!0,tt=$c(a,b,E),!a.isActive&&Nr===null)return;var ot=E!==null?E.part:null;if(ot===null||x.handlesDragDropForTopLevelParts&&ot.isTopLevel&&!(ot instanceof Jn)){var rt=x.mouseDragOver;rt!==null&&(rt(b),tt=!0)}if(!a.isActive&&Nr===null||(a.doDragOver(y,E),!a.isActive&&Nr===null))return}finally{x.skipsUndoManager=z,tt&&x.bd()}a.Bn=E,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(b.viewPoint)}bo.prototype.findDragOverObject=function(a){var y=this;return Dl(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof Ai||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},bo.prototype.doUpdateCursor=function(a){var y=this.diagram;(a===null||this.Bn!==a)&&(!this.diagram.currentTool.isActive||this.mayCopy()?y.currentCursor=this.copyCursor:this.mayMove()?y.currentCursor=this.moveCursor:this.mayDragOut()&&(y.currentCursor=this.nodropCursor))};function $c(a,y,x){var E=!1,b=a.Cg.length,z=0<b?a.Cg[0]:null;if(x===z)return!1;y.handled=!1;for(var tt=0;tt<b;tt++){var ot=a.Cg[tt],rt=ot.mouseDragLeave;if(rt!==null&&(rt(y,ot,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&Nr===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=tg(b);for(b=a.Cg.length,x=0;x<b&&(tt=a.Cg[x],ot=tt.mouseDragEnter,ot===null||(ot(y,tt,z),E=!0,!y.handled));x++);return E}function tg(a){var y=a.panel;return y!==null?y:a instanceof Ln&&!(a instanceof Jn)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function Ip(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(at){return E.findValidLinkablePort(at,x)});a=At.alloc();var z=1/0,tt=null;for(b=b.iterator;b.next();){var ot=b.value;if(ot.part!==null){var rt=ot.ga(Mi,a);rt=y.Bf(rt),rt<z&&(tt=ot,z=rt)}}return At.free(a),tt}function wu(a,y){var x=a.draggedLink;if(x!==null&&!(2>x.pointsCount)){var E=a.diagram;if(!E.isReadOnly){var b=a.Oe;if(b!==null){var z=null,tt=null;x.fromNode===null&&(z=Ip(a,x.i(0),!1),z!==null&&(tt=z.part));var ot=null,rt=null;x.toNode===null&&(ot=Ip(a,x.i(x.pointsCount-1),!0),ot!==null&&(rt=ot.part)),b.isValidLink(tt,z,rt,ot)?y?(x.defaultFromPoint=x.i(0),x.defaultToPoint=x.i(x.pointsCount-1),x.suspendsRouting=!1,x.fromNode=tt,z!==null&&(x.fromPortId=z.portId),x.toNode=rt,ot!==null&&(x.toPortId=ot.portId),x.fromPort!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):jf(b,tt,z,rt,ot):jf(b,null,null,null,null)}}}}bo.prototype.doDragOver=function(){};function Cu(a,y){var x=a.diagram;a.dragsLink&&wu(a,!0),lh(a);var E=a.findDragOverObject(y),b=x.lastInput;if(b.targetObject=E,E!==null){b.handled=!1;for(var z=E;z!==null;){var tt=z.mouseDrop;if(tt!==null&&(tt(b,z),b.handled))break;J0(a,b,z),z=tg(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||Nr!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof tn&&z.linksConnected.each(function(ot){ot.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||Nr!==null){for(a=pe.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof tn&&Q0(x,E,a);pe.free(a)}}}function J0(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof Jn||(x=a.mouseDrop,x!==null&&x(y))}function Q0(a,y,x){var E=!1;if(x=y.getAvoidableRect(x),a.viewportBounds.Re(x)&&(E=!0),a=a.Nu(x,function(b){return b.part},function(b){return b instanceof Ue},!0,function(b){return b instanceof Ue},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}bo.prototype.doDropOnto=function(){},bo.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;this.simulatedMouseMove(y.event,y.documentPoint,y.targetDiagram)||this.currentPart===null||this.draggedParts===null||(this.mayCopy()?($l(this,!1),qf(a,this.copiedParts),vl(this,this.copiedParts,!1),xh(a,this.copiedParts)):this.mayMove()?(Va(this),vl(this,this.draggedParts,!0)):this.mayDragOut()?($l(this,!1),vl(this,this.copiedParts,!1)):Va(this),Rf(this,a.lastInput.documentPoint))}},bo.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;if(!this.simulatedMouseUp(y.event,y.documentPoint,y.targetDiagram)){y=!1;var x=this.mayCopy();if(x&&this.copiedParts!==null?(Va(this),$l(this,!0),qf(a,this.copiedParts),vl(this,this.copiedParts,!1),xh(a,this.copiedParts),this.copiedParts!==null&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0}))):(y=!0,Va(this),this.mayMove()&&(vl(this,this.draggedParts,!0),Rf(this,a.lastInput.documentPoint))),this.Ym=!0,Cu(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&q0(this),a.Ya(),xh(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},bo.prototype.simulatedMouseMove=function(a,y,x){if(Nr===null)return!1;var E=Nr.diagram;x instanceof te||(x=null);var b=Lu;return x!==b&&(b!==null&&b!==E&&(b.ug(),Nr.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),Lu=x,x!==null&&x!==E&&(qc(),b=x.toolManager.findTool("Dragging"),b!==null&&(bl.contains(b)||bl.add(b),b.doSimulatedDragEnter())),this.doUpdateCursor(null)),x===null||x===E||!x.allowDrop||x.isReadOnly||!x.allowInsert?!1:(E=x.toolManager.findTool("Dragging"),E!==null&&(a!==null&&(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!1,E.doSimulatedDragOver()),!0)},bo.prototype.simulatedMouseUp=function(a,y,x){if(Nr===null)return!1;var E=Lu,b=Nr.diagram;if(x===null)return Nr.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),Nr.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;Lu=x,E=x.toolManager.findTool("Dragging"),E!==null&&(qc(),bl.contains(E)||bl.add(E),E.doSimulatedDragEnter())}return x!==this.diagram?(a!==null?(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)):y===null&&(y=new At),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!0,a=x.toolManager.findTool("Dragging"),a!==null&&a.doSimulatedDrop(),a=Nr,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function q0(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof tn&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}bo.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(kn?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},bo.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},bo.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())},bo.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},bo.prototype.Az=function(){return Nr},bo.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=Nr;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},bo.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),Ca(a),a.animationManager.Cc(),a=Nr,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},bo.prototype.doSimulatedDragLeave=function(){var a=Nr;a!==null&&a.doSimulatedDragOut(),this.doCancel()},bo.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=Nr;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;Rp(this,y.draggedParts.Lf(),!1,a.firstInput),vl(this,this.copiedParts,!1),Rf(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},bo.prototype.doSimulatedDrop=function(){var a=this.diagram,y=Nr;if(y!==null){var x=y.diagram;if(y.Ym=!0,Va(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),Rp(this,y.draggedParts.Lf(),!0,a.lastInput),vl(this,this.copiedParts,!1);var E=new ke;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),Cu(this,a.lastInput.documentPoint),a.Ya(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,a.doFocus(),a.R("ExternalObjectsDropped",E,x),this.stopTransaction(),a.R("ChangedSelection",a.selection)}a.animationManager.Dm=!1};function Rp(a,y,x,E){if(a.copiedParts===null){var b=a.diagram;if(!b.isReadOnly&&!b.isModelReadOnly){b.skipsUndoManager=!x,b.partManager.addsToTemporaryLayer=!x,a.startPoint=E.documentPoint,x=b.Kj(y,b,!0);var z=pe.alloc();b=E=1/0;for(var tt=-1/0,ot=-1/0,rt=y.iterator;rt.next();){var at=rt.value;if(at.isVisible()){var ut=at.location;at=ut.x,ut=ut.y,isNaN(at)||isNaN(ut)||(at<E&&(E=at),ut<b&&(b=ut),at>tt&&(tt=at),ut>ot&&(ot=ut))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,tt-E,ot-b),E=z.x+z.width/2,b=z.y+z.height/2,pe.free(z),z=a.Fr,tt=new qe,ot=At.alloc(),rt=y.iterator;rt.next();)at=rt.value,at instanceof Ue&&at.canCopy()&&(ut=x.I(at),ut!==null&&(ut.points=at.points,Wu(ut,z.x-E,z.y-b),ut.suspendsRouting=!0,tt.add(ut,a.Pd())));for(y=y.iterator;y.next();)at=y.value,at.Zc()&&at.canCopy()&&(rt=x.I(at),rt!==null&&(at=at.location,ot.h(z.x-(E-at.x),z.y-(b-at.y)),rt.location=ot,rt.Va(),tt.add(rt,a.Pd(ot))));At.free(ot),a.copiedParts=tt,If(a,tt.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,Wu(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}bo.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},bo.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new At},Ie.Object.defineProperties(bo.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(a){this.ob=a}},copiesEffectiveCollection:{get:function(){return this.u},set:function(a){this.u=a}},dragOptions:{get:function(){return this.ia},set:function(a){this.ia=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(a){this.hb=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.D(a)||(a=a.J(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink=a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.F},set:function(a){this.F=a}},moveCursor:{get:function(){return this.Oc},set:function(a){this.Oc=a}},nodropCursor:{get:function(){return this.Pc},set:function(a){this.Pc=a}},currentPart:{get:function(){return this.V},set:function(a){this.V=a}},copiedParts:{get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{get:function(){return this.Ha},set:function(a){this.Ha=a}},draggingParts:{get:function(){return this.copiedParts!==null?this.copiedParts.Lf():this.draggedParts!==null?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink=a}},isDragOutStarted:{get:function(){return this.Hb},set:function(a){this.Hb=a}},startPoint:{get:function(){return this.Fr},set:function(a){this.Fr.D(a)||this.Fr.assign(a)}},delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}}}),bo.prototype.getDraggingSource=bo.prototype.Az;var Nr=null,Lu=null;bo.className="DraggingTool",bl=new be,ne("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),ko.prototype.doCancel=function(){Nr!==null&&Nr.doCancel(),bi.prototype.doCancel.call(this)};function _o(){bi.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new Ue,y=new ei;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new ei,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new tn,y=new ei,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=ji,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new tn,y=new ei,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=ji,a.add(y),a.selectable=!1,a.layerName="Tool",this.Di=a,this.o=y,this.Pc=this.Oc=this.ob=this.hb=this.Hb=null,this.ia=!0,this.hy=new qe,this.Of=this.gj=this.Pf=null}ee(_o,bi),_o.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},_o.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=Le.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,Le.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=Mi,z=At.alloc(),x.location=y.ga(Mi,z),At.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},_o.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=ji,y.fromSpot=hr,y.toSpot=hr),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},_o.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},_o.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof tn){var y=this.targetPort.part;this.isForwards?this.copyPortProperties(y,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(y,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},_o.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof tn))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof tn)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},_o.prototype.findTargetPort=function(a){var y=this.diagram,x=y.lastInput.documentPoint,E=this.portGravity;0>=E&&(E=.1);var b=this,z=y.og(x,E,function(ct){return b.findValidLinkablePort(ct,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var tt=z.value,ot=tt.part;if(ot instanceof tn){var rt=tt.ga(Mi,At.alloc()),at=x.x-rt.x,ut=x.y-rt.y;At.free(rt),rt=at*at+ut*ut,rt<E&&(at=this.validPortsCache.I(tt),at!==null?at&&(y=tt,E=rt):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,ot,tt)||!a&&this.isValidLink(ot,tt,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(tt,!0),y=tt,E=rt):this.validPortsCache.add(tt,!1))}}return y!==null&&(x=y.part,x instanceof tn&&(x.layer===null||x.layer.allowLink))?y:null},_o.prototype.isValidFrom=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.fromLinkable!==!0))return!1;var x=y.fromMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalFromNode&&y===this.originalFromPort)return!0;if(y=y.portId,y===null&&(y=""),a.Mo(y).count>=x)return!1}return!0},_o.prototype.isValidTo=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.toLinkable!==!0))return!1;var x=y.toMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalToNode&&y===this.originalToPort)return!0;if(y=y.portId,y===null&&(y=""),a.Sd(y).count>=x)return!1}return!0},_o.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},_o.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof tn))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof tn))return!1;for(y=y.portId,y===null&&(y=""),y=E.Sd(y);y.next();)if(E=y.value,E.fromNode===x&&E.fromPortId===a)return!0;return!1},_o.prototype.isValidLink=function(a,y,x,E){if(!this.isValidFrom(a,y)||!this.isValidTo(x,E)||!(y===null||E===null||(y.fromLinkableSelfNode&&E.toLinkableSelfNode||!this.isInSameNode(y,E))&&(y.fromLinkableDuplicates&&E.toLinkableDuplicates||!this.isLinked(y,E)))||this.originalLink!==null&&(a!==null&&this.isLabelDependentOnLink(a,this.originalLink)||x!==null&&this.isLabelDependentOnLink(x,this.originalLink))||a!==null&&x!==null&&(a.data===null&&x.data!==null||a.data!==null&&x.data===null)||!this.isValidCycle(a,x,this.originalLink))return!1;if(a!==null){var b=a.linkValidation;if(b!==null&&!b(a,y,x,E,this.originalLink))return!1}return x!==null&&(b=x.linkValidation,b!==null&&!b(a,y,x,E,this.originalLink))?!1:(b=this.linkValidation,b!==null?b(a,y,x,E,this.originalLink):!0)},_o.prototype.isLabelDependentOnLink=function(a,y){if(a===null)return!1;var x=a.labeledLink;if(x===null)return!1;if(x===y)return!0;var E=new ke;return E.add(a),qr(this,x,y,E)};function qr(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),qr(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),qr(a,y.labeledLink,x,E))))}_o.prototype.isValidCycle=function(a,y,x){if(x===void 0&&(x=null),a===null||y===null)return this.isUnconnectedLinkValid;var E=this.diagram.validCycle;if(E!==qd){if(E===bg){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=y.linksConnected;E.next();){var b=E.value;if(b!==x&&b.isTreeLink&&b.toNode===y)return!1}return!ss(this,a,y,x,!0)}if(E===Ag){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=a.linksConnected;E.next();)if(b=E.value,b!==x&&b.isTreeLink&&b.fromNode===a)return!1;return!ss(this,a,y,x,!0)}if(E===Ng)return a===y?a=!0:(E=new ke,E.add(y),a=as(this,E,a,y,x)),!a;if(E===Tg)return!ss(this,a,y,x,!1);if(E===Fg)return a===y?a=!0:(E=new ke,E.add(y),a=Xh(this,E,a,y,x)),!a}return!0};function ss(a,y,x,E,b){if(y===x)return!0;if(y===null||x===null)return!1;for(var z=y.linksConnected;z.next();){var tt=z.value;if(tt!==E&&(!b||tt.isTreeLink)&&tt.toNode===y&&(tt=tt.fromNode,tt!==y&&ss(a,tt,x,E,b)))return!0}return!1}function as(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b&&tt.toNode===x&&(tt=tt.fromNode,tt!==x&&as(a,y,tt,E,b)))return!0}return!1}function Xh(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b){var ot=tt.fromNode;if(tt=tt.toNode,ot=ot===x?tt:ot,ot!==x&&Xh(a,y,ot,E,b))return!0}}return!1}Ie.Object.defineProperties(_o.prototype,{portGravity:{get:function(){return this.te},set:function(a){0<=a&&(this.te=a)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(a){this.Ha=a}},linkingCursor:{get:function(){return this.u},set:function(a){this.u=a}},temporaryLink:{get:function(){return this.Ci},set:function(a){this.Ci=a}},temporaryFromNode:{get:function(){return this.Bi},set:function(a){(this.Bi=a)&&(this.j=a.port)}},temporaryFromPort:{get:function(){return this.j},set:function(a){if(this.j!==null){var y=this.j.panel;if(y!==null){var x=y.O.indexOf(this.j);y.mb(x),y.Gb(x,a)}}this.j=a}},temporaryToNode:{get:function(){return this.Di},set:function(a){(this.Di=a)&&(this.o=a.port)}},temporaryToPort:{get:function(){return this.o},set:function(a){if(this.o!==null){var y=this.o.panel;if(y!==null){var x=y.O.indexOf(this.o);y.mb(x),y.Gb(x,a)}}this.o=a}},originalLink:{get:function(){return this.Hb},set:function(a){this.Hb=a}},originalFromNode:{get:function(){return this.hb},set:function(a){this.hb=a}},originalFromPort:{get:function(){return this.ob},set:function(a){this.ob=a}},originalToNode:{get:function(){return this.Oc},set:function(a){this.Oc=a}},originalToPort:{get:function(){return this.Pc},set:function(a){this.Pc=a}},isForwards:{get:function(){return this.ia},set:function(a){this.ia=a}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(a){this.Pf=a}},linkValidation:{get:function(){return this.gj},set:function(a){this.gj=a}},portTargeted:{get:function(){return this.Of},set:function(a){this.Of=a}}}),_o.className="LinkingBaseTool";function ls(){_o.call(this),this.name="Linking",this.V={},this.F=null,this.K=uh,this.Xd=null}ee(ls,_o),ls.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.xs()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:this.findLinkablePort()!==null},ls.prototype.findLinkablePort=function(){var a=this.diagram,y=this.startObject;if(y===null&&(y=a.ic(a.firstInput.documentPoint,null,null)),y===null||(a=y.part,!(a instanceof tn)))return null;var x=this.direction;if(x===uh||x===jp){var E=this.findValidLinkablePort(y,!1);if(E!==null||this.startObject===a&&(E=a.port,this.findValidLinkablePort(E,!1)))return this.isForwards=!0,E}return(x===uh||x===zp)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},ls.prototype.doActivate=function(){var a=this.diagram,y=this.findLinkablePort();y===null?this.stopTool():(this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(this.temporaryToNode!==null&&(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=y,y=this.originalFromPort.part,y instanceof tn&&(this.originalFromNode=y),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(this.temporaryFromNode!==null&&(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=y,y=this.originalToPort.part,y instanceof tn&&(this.originalToNode=y),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),a.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0)},ls.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},ls.prototype.doStop=function(){_o.prototype.doStop.call(this),this.startObject=null},ls.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,E=null,b=null,z=null;try{var tt=this.targetPort=this.findTargetPort(this.isForwards);if(tt!==null){var ot=tt.part;ot instanceof tn&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=ot,b=tt):(y=ot,x=tt,this.originalToNode!==null&&(E=this.originalToNode,b=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(y=this.originalFromNode,x=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(E=this.originalToNode,b=this.originalToPort);y!==null||E!==null?(z=this.insertLink(y,x,E,b),z!==null?(tt===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),z.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",z)):this.doNoLink(y,x,E,b)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),z&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}},ls.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof Ue)return a.isTreeLink;var y=this.diagram;return y===null?!0:(a=y.partManager.getLinkCategoryForData(a),y=y.partManager.findLinkTemplateForCategory(a),y!==null?y.isTreeLink:!0)},ls.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},ls.prototype.doNoLink=function(){},Ie.Object.defineProperties(ls.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(a){this.V=a}},archetypeLabelNodeData:{get:function(){return this.F},set:function(a){this.F=a}},direction:{get:function(){return this.K},set:function(a){this.K=a}},startObject:{get:function(){return this.Xd},set:function(a){this.Xd=a}}});var uh=new ae(ls,"Either",0),jp=new ae(ls,"ForwardsOnly",0),zp=new ae(ls,"BackwardsOnly",0);ls.className="LinkingTool",ls.Either=uh,ls.ForwardsOnly=jp,ls.BackwardsOnly=zp;function la(){_o.call(this),this.name="Relinking";var a=new ei;a.figure="Diamond",a.desiredSize=vo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new ei,a.figure="Diamond",a.desiredSize=vo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new pe}ee(la,_o),la.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Ue){var y="RelinkFrom",x=null;if(a.isSelected&&!this.diagram.isReadOnly){var E=a.selectionObject;E!==null&&a.canRelinkFrom()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null&&(x=this.makeAdornment(E,!1),a.bh(y,x)))}x===null&&a.Jf(y),y="RelinkTo",x=null,a.isSelected&&!this.diagram.isReadOnly&&(E=a.selectionObject,E!==null&&a.canRelinkTo()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null?(x=this.makeAdornment(E,!0),a.bh(y,x)):x.v())),x===null&&a.Jf(y)}},la.prototype.makeAdornment=function(a,y){var x=new Ai;return x.type=ze.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},la.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.xs()||!a.lastInput.left)return!1;var y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");return y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")),y!==null},la.prototype.doActivate=function(){var a=this.diagram;if(this.originalLink===null){var y=this.handle;if(y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"))),y===null)return;var x=y.part;if(!(x instanceof Ai&&x.adornedPart instanceof Ue))return;this.handle=y,this.isForwards=x===null||x.category==="RelinkTo",this.originalLink=x.adornedPart}this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Ew.set(this.originalLink.actualBounds),this.originalLink!==null&&0<this.originalLink.pointsCount&&(this.originalLink.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=gi),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=gi),this.temporaryToNode!==null&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0},la.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===wc||x===Uu)&&(x=ps),y.curve=x,y.curviness=a.curviness,y.isTreeLink=a.isTreeLink,y.points=a.points,y.routing=a.routing,y.smoothness=a.smoothness,y.fromSpot=a.fromSpot,y.fromEndSegmentLength=a.fromEndSegmentLength,y.fromShortLength=a.fromShortLength,y.toSpot=a.toSpot,y.toEndSegmentLength=a.toEndSegmentLength,y.toShortLength=a.toShortLength}},la.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},la.prototype.doStop=function(){_o.prototype.doStop.call(this),this.handle=null},la.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var y=this.originalFromNode,x=this.originalFromPort,E=this.originalToNode,b=this.originalToPort,z=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var tt=this.targetPort.part;tt instanceof tn&&(this.isForwards?(E=tt,b=this.targetPort):(y=tt,x=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?b=E=null:x=y=null:z=null;z!==null?(this.reconnectLink(z,this.isForwards?E:y,this.isForwards?b:x,this.isForwards),this.targetPort===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint,z.bb()),this.transactionResult=this.name,a.R("LinkRelinked",z,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Xo(this.Ew)}finally{this.stopTool()}}},la.prototype.reconnectLink=function(a,y,x,E){return x=x!==null&&x.portId!==null?x.portId:"",E?(a.toNode=y,a.toPortId=x):(a.fromNode=y,a.fromPortId=x),!0},la.prototype.doNoRelink=function(){};function jf(a,y,x,E,b){y!==null?(a.copyPortProperties(y,x,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode),E!==null?(a.copyPortProperties(E,b,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)}Ie.Object.defineProperties(la.prototype,{fromHandleArchetype:{get:function(){return this.V},set:function(a){this.V=a}},toHandleArchetype:{get:function(){return this.Xd},set:function(a){this.Xd=a}},handle:{get:function(){return this.F},set:function(a){if(a!==null&&!(a.part instanceof Ai))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),la.className="RelinkingTool",ne("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),ne("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function Xo(){bi.call(this),this.name="LinkReshaping";var a=new ei;a.figure="Rectangle",a.desiredSize=Lo,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new ei,a.figure="Diamond",a.desiredSize=vo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new At,this.Yq=new be}ee(Xo,bi),Xo.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:eg},Xo.prototype.om=function(a,y){a.reshapingBehavior=y},Xo.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Ue){var y=null;if(a.isSelected&&!this.diagram.isReadOnly){var x=a.path;x!==null&&a.canReshape()&&a.actualBounds.w()&&a.isVisible()&&x.actualBounds.w()&&x.Ed()&&(y=a.Pj(this.name),y===null||y.Aw!==a.pointsCount||y.Uw!==a.resegmentable)&&(y=this.makeAdornment(x),y!==null&&(y.Aw=a.pointsCount,y.Uw=a.resegmentable,a.bh(this.name,y)))}y===null&&a.Jf(this.name)}},Xo.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new Ai,b.type=ze.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=E?1:0;if(y.resegmentable&&y.computeCurve()!==ca)for(var ot=x+tt;ot<z-tt;ot++){var rt=this.makeResegmentHandle(a,ot);rt!==null&&(rt.segmentIndex=ot,rt.segmentFraction=.5,rt.fromMaxLinks=999,b.add(rt))}for(tt=x+1;tt<z;tt++)if(ot=this.makeHandle(a,tt),ot!==null){if(ot.segmentIndex=tt,tt!==x)if(tt===x+1&&E){rt=y.i(x);var at=y.i(x+1);Jt.B(rt.x,at.x)&&Jt.B(rt.y,at.y)&&(at=y.i(x-1)),Jt.B(rt.x,at.x)?(this.om(ot,Eu),ot.cursor="n-resize"):Jt.B(rt.y,at.y)&&(this.om(ot,Mu),ot.cursor="w-resize")}else tt===z-1&&E?(rt=y.i(z-1),at=y.i(z),Jt.B(rt.x,at.x)&&Jt.B(rt.y,at.y)&&(rt=y.i(z+1)),Jt.B(rt.x,at.x)?(this.om(ot,Eu),ot.cursor="n-resize"):Jt.B(rt.y,at.y)&&(this.om(ot,Mu),ot.cursor="w-resize")):tt!==z&&(this.om(ot,zf),ot.cursor="move");b.add(ot)}b.adornedObject=a}return b},Xo.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},Xo.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},Xo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},Xo.prototype.doActivate=function(){var a=this.diagram;if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null){var y=this.handle.part.adornedPart;if(y instanceof Ue){if(this.Ts=y,a.isMouseCaptured=!0,this.Ea(this.name),y.resegmentable&&this.handle.fromMaxLinks===999){var x=y.points.copy(),E=this.getResegmentingPoint();if(x.Gb(this.handle.segmentIndex+1,E),y.isOrthogonal&&x.Gb(this.handle.segmentIndex+1,E),y.points=x,y.Wb(),y.updateAdornments(),this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name),this.handle===null){this.doDeactivate();return}}this.Fw=y.i(this.handle.segmentIndex),this.Yq=y.points.copy(),this.isActive=!0}}},Xo.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},Xo.prototype.stopTransaction=function(){var a=this.diagram,y=bi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Xo.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},Xo.prototype.getResegmentingPoint=function(){return this.handle.ga(Mi)},Xo.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},Xo.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.computeReshape(a.lastInput.documentPoint);if(this.reshape(y),y=this.adornedLink,y!==null&&y.resegmentable){var x=this.handle.segmentIndex,E=y.i(x-1),b=y.i(x),z=y.i(x+1);if(y.isOrthogonal){if(x>y.firstPickIndex+1&&x<y.lastPickIndex-1){var tt=y.i(x-2);if(Math.abs(E.x-b.x)<this.resegmentingDistance&&Math.abs(E.y-b.y)<this.resegmentingDistance&&(ku(this,tt,E,b,z,!0)||ku(this,tt,E,b,z,!1))){var ot=y.points.copy();ku(this,tt,E,b,z,!0)?(ot.cd(x-2,new At(tt.x,(z.y+tt.y)/2)),ot.cd(x+1,new At(z.x,(z.y+tt.y)/2))):(ot.cd(x-2,new At((z.x+tt.x)/2,tt.y)),ot.cd(x+1,new At((z.x+tt.x)/2,z.y))),ot.mb(x),ot.mb(x-1),y.points=ot,y.Wb()}else tt=y.i(x+2),Math.abs(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(ku(this,E,b,z,tt,!0)||ku(this,E,b,z,tt,!1))&&(ot=y.points.copy(),ku(this,E,b,z,tt,!0)?(ot.cd(x-1,new At(E.x,(E.y+tt.y)/2)),ot.cd(x+2,new At(tt.x,(E.y+tt.y)/2))):(ot.cd(x-1,new At((E.x+tt.x)/2,E.y)),ot.cd(x+2,new At((E.x+tt.x)/2,tt.y))),ot.mb(x+1),ot.mb(x),y.points=ot,y.Wb())}}else tt=At.alloc(),Jt.qh(E.x,E.y,z.x,z.y,b.x,b.y,tt)&&tt.Bf(b)<this.resegmentingDistance*this.resegmentingDistance&&(E=y.points.copy(),E.mb(x),y.points=E,y.Wb()),At.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function ku(a,y,x,E,b,z){return z?Math.abs(y.y-x.y)<a.resegmentingDistance&&Math.abs(x.y-E.y)<a.resegmentingDistance&&Math.abs(E.y-b.y)<a.resegmentingDistance:Math.abs(y.x-x.x)<a.resegmentingDistance&&Math.abs(x.x-E.x)<a.resegmentingDistance&&Math.abs(E.x-b.x)<a.resegmentingDistance}Xo.prototype.reshape=function(a){var y=this.adornedLink;y.uh();var x=this.handle.segmentIndex,E=this.Ru(this.handle);if(y.isOrthogonal)if(x===y.firstPickIndex+1)x=y.firstPickIndex+1,E===Eu?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Mu&&(y.L(x,a.x,y.i(x-1).y),y.L(x+1,a.x,y.i(x+2).y));else if(x===y.lastPickIndex-1)x=y.lastPickIndex-1,E===Eu?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Mu&&(y.L(x-1,a.x,y.i(x-2).y),y.L(x,a.x,y.i(x+1).y));else{E=x;var b=y.i(E),z=y.i(E-1),tt=y.i(E+1);Jt.B(z.x,b.x)&&Jt.B(b.y,tt.y)?(Jt.B(z.x,y.i(E-2).x)&&!Jt.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),Jt.B(tt.y,y.i(E+2).y)&&!Jt.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)):Jt.B(z.y,b.y)&&Jt.B(b.x,tt.x)?(Jt.B(z.y,y.i(E-2).y)&&!Jt.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),Jt.B(tt.x,y.i(E+2).x)&&!Jt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):Jt.B(z.x,b.x)&&Jt.B(b.x,tt.x)?(Jt.B(z.x,y.i(E-2).x)&&!Jt.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),Jt.B(tt.x,y.i(E+2).x)&&!Jt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):Jt.B(z.y,b.y)&&Jt.B(b.y,tt.y)&&(Jt.B(z.y,y.i(E-2).y)&&!Jt.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),Jt.B(tt.y,y.i(E+2).y)&&!Jt.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)),y.L(x,a.x,a.y)}else y.L(x,a.x,a.y),E=y.fromNode,b=y.fromPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===1&&y.computeSpot(!0,b).Mc()&&(z=b.ga(Mi,At.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,At.alloc()),y.L(0,E.x,E.y),At.free(z),At.free(E)),E=y.toNode,b=y.toPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===y.pointsCount-2&&y.computeSpot(!1,b).Mc()&&(x=b.ga(Mi,At.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,At.alloc()),y.L(y.pointsCount-1,a.x,a.y),At.free(x),At.free(a));y.zf()},Xo.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case zf:return a;case Eu:return new At(y.i(x).x,a.y);case Mu:return new At(a.x,y.i(x).y);default:case eg:return y.i(x)}},Ie.Object.defineProperties(Xo.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},midHandleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof Ai))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedLink:{get:function(){return this.Ts}},resegmentingDistance:{get:function(){return this.F},set:function(a){this.F=a}},originalPoint:{get:function(){return this.Fw}},originalPoints:{get:function(){return this.Yq}}}),Xo.prototype.setReshapingBehavior=Xo.prototype.om,Xo.prototype.getReshapingBehavior=Xo.prototype.Ru;var eg=new ae(Xo,"None",0),Mu=new ae(Xo,"Horizontal",1),Eu=new ae(Xo,"Vertical",2),zf=new ae(Xo,"All",3);Xo.className="LinkReshapingTool",Xo.None=eg,Xo.Horizontal=Mu,Xo.Vertical=Eu,Xo.All=zf,ne("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Hr(){bi.call(this),this.name="Resizing",this.o=new Le(1,1).freeze(),this.j=new Le(9999,9999).freeze(),this.yg=new Le(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new ei;a.alignmentFocus=Mi,a.figure="Rectangle",a.desiredSize=Lo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new At,this.Dw=new Le,this.Tn=new At,this.rt=new Le(0,0),this.qt=new Le(1/0,1/0),this.pt=new Le(1,1)}ee(Hr,bi),Hr.prototype.updateAdornments=function(a){if(!(a===null||a instanceof Ue)){if(a.isSelected&&!this.diagram.isReadOnly){var y=a.resizeObject,x=a.Pj(this.name);if(y!==null&&a.canResize()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed()&&((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null)){y=y.li(),Mh(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},Hr.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Ai,y.type=ze.Spot,y.locationSpot=Mi;var x=new gs;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,Sr)),y.add(this.makeHandle(a,qi)),y.add(this.makeHandle(a,ya)),y.add(this.makeHandle(a,rs)),y.add(this.makeHandle(a,Ks)),y.add(this.makeHandle(a,Jr)),y.add(this.makeHandle(a,Ls)),y.add(this.makeHandle(a,Xs))}else if(za(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Hr.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Hr.prototype.updateResizeHandles=function(a,y){if(a!==null){if(!a.alignment.Xb()&&(a.cursor==="pointer"||0<a.cursor.indexOf("resize")))t:{var x=a.alignment;if(x.Mc()&&(x=Mi),0>=x.x)y=0>=x.y?y+225:1<=x.y?y+135:y+180;else if(1<=x.x)0>=x.y?y+=315:1<=x.y&&(y+=45);else if(0>=x.y)y+=270;else if(1<=x.y)y+=90;else break t;0>y?y+=360:360<=y&&(y-=360),a.cursor=22.5>y?"e-resize":67.5>y?"se-resize":112.5>y?"s-resize":157.5>y?"sw-resize":202.5>y?"w-resize":247.5>y?"nw-resize":292.5>y?"n-resize":337.5>y?"ne-resize":"e-resize"}else if(a instanceof ze)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},Hr.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},Hr.prototype.doActivate=function(){var a=this.diagram;this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null&&(this.adornedObject=this.handle.part.adornedObject,this.adornedObject!==null&&(a.isMouseCaptured=!0,a.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},Hr.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Hr.prototype.stopTransaction=function(){var a=this.diagram,y=bi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Hr.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Hr.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),At.free(b)}},Hr.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),At.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Hr.prototype.resize=function(a){var y=this.diagram,x=this.adornedObject;if(x!==null){if(x.desiredSize=a.size,a=x.part,a.Va(),x=x.ga(this.handle.alignment.gv()),a instanceof Jn){var E=new be;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new st;b.dragsMembers=!1}y.moveParts(E,this.oppositePoint.copy().re(x),!0,b)}else a.location=a.location.copy().re(x).add(this.oppositePoint);y.bd()}},Hr.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=Mi);var tt=this.adornedObject.naturalBounds,ot=tt.x,rt=tt.y,at=tt.x+tt.width,ut=tt.y+tt.height,ct=1;if(!z){ct=tt.width;var mt=tt.height;0>=ct&&(ct=1),0>=mt&&(mt=1),ct=mt/ct}return mt=At.alloc(),Jt.No(a.x,a.y,ot,rt,b.width,b.height,mt),a=tt.copy(),0>=y.x?0>=y.y?(a.x=Math.max(mt.x,at-E.width),a.x=Math.min(a.x,at-x.width),a.width=Math.max(at-a.x,x.width),a.y=Math.max(mt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,E.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,E.width),x.width),a.height=ct*a.width),a.x=at-a.width,a.y=ut-a.height)):1<=y.y?(a.x=Math.max(mt.x,at-E.width),a.x=Math.min(a.x,at-x.width),a.width=Math.max(at-a.x,x.width),a.height=Math.max(Math.min(mt.y-rt,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,E.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,E.width),x.width),a.height=ct*a.width),a.x=at-a.width)):(a.x=Math.max(mt.x,at-E.width),a.x=Math.min(a.x,at-x.width),a.width=at-a.x,z||(a.height=Math.max(Math.min(ct*a.width,E.height),x.height),a.width=a.height/ct,a.y=rt+.5*(ut-rt-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(mt.x-ot,E.width),x.width),a.y=Math.max(mt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,E.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,E.width),x.width),a.height=ct*a.width),a.y=ut-a.height)):1<=y.y?(a.width=Math.max(Math.min(mt.x-ot,E.width),x.width),a.height=Math.max(Math.min(mt.y-rt,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,E.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,E.width),x.width),a.height=ct*a.width))):(a.width=Math.max(Math.min(mt.x-ot,E.width),x.width),z||(a.height=Math.max(Math.min(ct*a.width,E.height),x.height),a.width=a.height/ct,a.y=rt+.5*(ut-rt-a.height))):0>=y.y?(a.y=Math.max(mt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=ut-a.y,z||(a.width=Math.max(Math.min(a.height/ct,E.width),x.width),a.height=ct*a.width,a.x=ot+.5*(at-ot-a.width))):1<=y.y&&(a.height=Math.max(Math.min(mt.y-rt,E.height),x.height),z||(a.width=Math.max(Math.min(a.height/ct,E.width),x.width),a.height=ct*a.width,a.x=ot+.5*(at-ot-a.width))),At.free(mt),a},Hr.prototype.computeReshape=function(){var a=Fe;return this.adornedObject instanceof ei&&(a=Lv(this.adornedObject)),!(a===gn||this.diagram.lastInput.shift)},Hr.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),y=this.minSize;return!isNaN(y.width)&&y.width>a.width&&(a.width=y.width),!isNaN(y.height)&&y.height>a.height&&(a.height=y.height),a},Hr.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),y=this.maxSize;return!isNaN(y.width)&&y.width<a.width&&(a.width=y.width),!isNaN(y.height)&&y.height<a.height&&(a.height=y.height),a},Hr.prototype.computeCellSize=function(){var a=new Le(NaN,NaN),y=this.adornedObject.part;return y!==null&&(y=y.resizeCellSize,!isNaN(y.width)&&0<y.width&&(a.width=y.width),!isNaN(y.height)&&0<y.height&&(a.height=y.height)),y=this.cellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height),y=this.diagram,(isNaN(a.width)||isNaN(a.height))&&y&&(y=y.grid,y!==null&&y.visible&&this.isGridSnapEnabled&&(y=y.gridCellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height))),(isNaN(a.width)||a.width===0||a.width===1/0)&&(a.width=1),(isNaN(a.height)||a.height===0||a.height===1/0)&&(a.height=1),a},Ie.Object.defineProperties(Hr.prototype,{handleArchetype:{get:function(){return this.F},set:function(a){this.F=a}},handle:{get:function(){return this.u},set:function(a){if(a!==null&&!(a.part instanceof Ai))throw Error("new handle is not in an Adornment: "+a);this.u=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof Ai)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},minSize:{get:function(){return this.o},set:function(a){if(!this.o.D(a)){var y=a.width;isNaN(y)&&(y=0),a=a.height,isNaN(a)&&(a=0),this.o.h(y,a)}}},maxSize:{get:function(){return this.j},set:function(a){if(!this.j.D(a)){var y=a.width;isNaN(y)&&(y=1/0),a=a.height,isNaN(a)&&(a=1/0),this.j.h(y,a)}}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||this.yg.assign(a)}},isGridSnapEnabled:{get:function(){return this.V},set:function(a){this.V=a}},dragsMembers:{get:function(){return this.ia},set:function(a){this.ia=a}},oppositePoint:{get:function(){return this.Xq},set:function(a){this.Xq.D(a)||this.Xq.assign(a)}},originalDesiredSize:{get:function(){return this.Dw}},originalLocation:{get:function(){return this.Tn}}}),Hr.className="ResizingTool",ne("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function us(){bi.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new At,this.ue=null;var a=new ei;a.figure="Ellipse",a.desiredSize=vo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new At(NaN,NaN),this.u=0,this.F=50}ee(us,bi),us.prototype.updateAdornments=function(a){if(a!==null){if(a.ph()){var y=a.rotateObject;if(y===a||y===a.path||y.isPanelMain)return}if(a.isSelected&&!this.diagram.isReadOnly&&(y=a.rotateObject,y!==null&&a.canRotate()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed())){var x=a.Pj(this.name);if((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null){x.angle=y.li(),x.placeholder===null&&(x.location=this.computeAdornmentLocation(y)),a.bh(this.name,x);return}}a.Jf(this.name)}},us.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Ai,y.type=ze.Position,y.locationSpot=Mi;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(za(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},us.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},us.prototype.doActivate=function(){var a=this.diagram;if(this.adornedObject===null){if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle===null)return;this.adornedObject=this.handle.part.adornedObject}this.adornedObject!==null&&(a.isMouseCaptured=!0,a.delaysLayout=!0,this.Ea(this.name),this.Cw=this.adornedObject.angle,this.kr=this.computeRotationPoint(this.adornedObject),this.Tn=this.adornedObject.part.location.copy(),this.isActive=!0)},us.prototype.computeRotationPoint=function(a){var y=a.part,x=y.locationObject;return y.rotationSpot.sb()?a.ga(y.rotationSpot):a===y||a===x?x.ga(y.locationSpot):a.ga(Mi)},us.prototype.computeAdornmentLocation=function(a){var y=this.rotationPoint;y.w()||(y=this.computeRotationPoint(a)),y=a.qs(y);var x=this.handleAngle;0>x?x+=360:360<=x&&(x-=360),x=Math.round(45*Math.round(x/45));var E=this.handleDistance;return x===0?y.x=a.naturalBounds.width+E:x===45?(y.x=a.naturalBounds.width+E,y.y=a.naturalBounds.height+E):x===90?y.y=a.naturalBounds.height+E:x===135?(y.x=-E,y.y=a.naturalBounds.height+E):x===180?y.x=-E:x===225?(y.x=-E,y.y=-E):x===270?y.y=-E:x===315&&(y.x=a.naturalBounds.width+E,y.y=-E),a.ga(y)},us.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new At(NaN,NaN),this.isActive=a.isMouseCaptured=!1},us.prototype.stopTransaction=function(){var a=this.diagram,y=bi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},us.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},us.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},us.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var y=this.computeRotate(a.lastInput.documentPoint);this.rotate(y),a.Ya(),this.transactionResult=this.name,a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},us.prototype.rotate=function(a){var y=this.adornedObject;if(y!==null){y.angle=a,y=y.part,y.Va();var x=y.locationObject,E=y.rotateObject;(x===E||x.rg(E))&&(x=this.Tn.copy(),y.location=x.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},us.prototype.computeRotate=function(a){a=this.rotationPoint.ab(a)-this.handleAngle;var y=this.adornedObject.panel;y!==null&&(a-=y.li()),360<=a?a-=360:0>a&&(a+=360),y=Math.min(Math.abs(this.snapAngleMultiple),180);var x=Math.min(Math.abs(this.snapAngleEpsilon),y/2);return!this.diagram.lastInput.shift&&0<y&&0<x&&(a%y<x?a=Math.floor(a/y)*y:a%y>y-x&&(a=(Math.floor(a/y)+1)*y)),360<=a?a-=360:0>a&&(a+=360),a},Ie.Object.defineProperties(us.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof Ai))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof Ai)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},snapAngleMultiple:{get:function(){return this.ia},set:function(a){this.ia=a}},snapAngleEpsilon:{get:function(){return this.V},set:function(a){this.V=a}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(a){this.kr=a.copy()}},handleAngle:{get:function(){return this.u},set:function(a){this.u=a}},handleDistance:{get:function(){return this.F},set:function(a){this.F=a}}}),us.className="RotatingTool",ne("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function hh(){bi.call(this),this.name="ClickSelecting"}ee(hh,bi),hh.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},hh.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},hh.className="ClickSelectingTool";function Da(){bi.call(this),this.name="Action",this.pk=null}ee(Da,bi),Da.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,y=a.lastInput,x=a.ic(y.documentPoint,function(E){for(;E.panel!==null&&!E.isActionable;)E=E.panel;return E});return x!==null&&x.isActionable?(this.pk=x,a.Ck=a.ic(y.documentPoint,null,null),!0):!1},Da.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionDown!==null&&y.actionDown(a,y))}else this.canStart()&&this.doActivate()},Da.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionMove!==null&&y.actionMove(a,y))}},Da.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;if(y===null)return;a.targetObject=y,y.actionUp!==null&&y.actionUp(a,y),this.standardMouseClick(function(x){for(;x.panel!==null&&(!x.isActionable||x!==y);)x=x.panel;return x},function(x){return x===y})}this.stopTool()},Da.prototype.doCancel=function(){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionCancel!==null&&y.actionCancel(a,y),this.stopTool())},Da.prototype.doStop=function(){this.pk=null},Da.className="ActionTool";function Nu(){bi.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new At(0,0)}ee(Nu,bi),Nu.prototype.canStart=function(){if(!this.isEnabled||this.archetypeNodeData===null)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(a.lastInput.clickCount===1&&(this.mw=a.lastInput.viewPoint.copy()),a.lastInput.clickCount!==2||this.isBeyondDragSize(this.mw))return!1}else if(a.lastInput.clickCount!==1)return!1;return!(a.currentTool!==this&&a.Ol(a.lastInput.documentPoint,!0)!==null)},Nu.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},Nu.prototype.insertPart=function(a){var y=this.diagram,x=this.archetypeNodeData;if(x===null)return null;var E=null;try{if(y.R("ChangingSelection",y.selection),this.Ea(this.name),x instanceof Ln)x.Zc()&&(za(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);Ve(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=At.allocAt(a.x,a.y);this.isGridSnapEnabled&&Qf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),At.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},Ie.Object.defineProperties(Nu.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){this.Ri=a}},isDoubleClick:{get:function(){return this.o},set:function(a){this.o=a}},isGridSnapEnabled:{get:function(){return this.j},set:function(a){this.j=a}}}),Nu.className="ClickCreatingTool";function Pa(){bi.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new Ln;a.layerName="Tool",a.selectable=!1;var y=new ei;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}ee(Pa,bi),Pa.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var y=a.lastInput;return!(!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.timestamp-a.firstInput.timestamp<this.delay||a.Ol(y.documentPoint,!0)!==null))},Pa.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},Pa.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},Pa.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive&&this.box!==null){var y=this.computeBoxBounds(),x=this.box.fb("SHAPE");x===null&&(x=this.box.Pb());var E=Le.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),Le.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},Pa.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;a.remove(this.box);try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),this.selectInRect(this.computeBoxBounds()),a.R("ChangedSelection",a.selection)}finally{a.currentCursor=""}}this.stopTool()},Pa.prototype.computeBoxBounds=function(){var a=this.diagram;return new pe(a.firstInput.documentPoint,a.lastInput.documentPoint)},Pa.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),kn?x.meta:x.control)if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected&&(y.isSelected=!1);else for(a=a.iterator;a.next();)y=a.value,y.isSelected=!y.isSelected;else if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0);else{for(x=new be,y=y.selection.iterator;y.next();){var E=y.value;a.contains(E)||x.add(E)}for(y=x.iterator;y.next();)y.value.isSelected=!1;for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0)}},Ie.Object.defineProperties(Pa.prototype,{delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}},isPartialInclusion:{get:function(){return this.o},set:function(a){this.o=a}},box:{get:function(){return this.j},set:function(a){this.j=a}}}),Pa.className="DragSelectingTool";function jr(){bi.call(this),this.name="Panning",this.Xt=new At,this.xy=new At,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(me.document,"scroll",a.Kw,!1),a.stopTool()}}ee(jr,bi),jr.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!(!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize())},jr.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(me.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},jr.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},jr.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},jr.prototype.doMouseMove=function(){this.move()},jr.prototype.doMouseUp=function(){this.move(),this.stopTool()},jr.prototype.move=function(){var a=this.diagram;if(this.isActive&&a)if(this.xg)a.lastInput.bubbles=!0;else{var y=a.position,x=a.firstInput.documentPoint,E=a.lastInput.documentPoint,b=y.x+x.x-E.x;x=y.y+x.y-E.y,a.allowHorizontalScroll||(b=y.x),a.allowVerticalScroll||(x=y.y),a.position=this.xy.h(b,x)}},Ie.Object.defineProperties(jr.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),jr.className="PanningTool",ne("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),ne("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),ne("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),ne("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),ne("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function yl(){this.F=this.u=this.j=this.o=null}Ie.Object.defineProperties(yl.prototype,{mainElement:{get:function(){return this.u},set:function(a){this.u=a}},show:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},hide:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},valueFunction:{get:function(){return this.F},set:function(a){this.F=a}}}),yl.className="HTMLInfo";function Oa(a,y,x){this.text=a,this.hx=y,this.visible=x}Oa.className="ContextMenuButtonInfo";function hs(){bi.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new At,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}ee(hs,bi);function Ya(a){var y=new yl;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},dh=y,a.tu=function(){a.stopTool()},y=sn("div");var x=sn("div");y.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",x.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";var E=sn("style");me.document.getElementsByTagName("head")[0].appendChild(E),E.sheet.insertRule(".goCXul { list-style: none; }",0),E.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),E.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),E=a.diagram,E!==null&&(E.addEventListener(y,"contextmenu",Zo,!1),E.addEventListener(y,"selectstart",Zo,!1),E.addEventListener(x,"contextmenu",Zo,!1)),y.className="goCXforeground",x.className="goCXbackground",me.document.body&&(me.document.body.appendChild(y),me.document.body.appendChild(x)),Id=y,Zh=x,Od=!0}function Zo(a){return a.preventDefault(),!1}hs.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right||1<a.lastInput.clickCount?!1:!!(a.lastInput.isTouchEvent&&this.defaultTouchContextMenu!==null||this.findObjectWithContextMenu()!==null)},hs.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},hs.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},hs.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof te||(a instanceof Xt?E=a:E=y.ic(x.documentPoint,null,function(b){return!b.layer.isTemporary})),E!==null){for(a=E;a!==null;){if(a.contextMenu!==null)return a;a=a.panel}if(y.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return E.part}else if(y.contextMenu!==null)return y;return null},hs.prototype.doActivate=function(){},hs.prototype.doMouseDown=function(){if(bi.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Ai){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&sl(this)},hs.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Ai){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}sl(this)};function sl(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof yl||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(tu(a,!0),a.isActive||a.stopTool())}hs.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function tu(a,y,x){if(x===void 0&&(x=null),!a.Et&&(a.Et=!0,y&&a.standardMouseSelect(),y=a.standardMouseClick(),a.Et=!1,!y)){if(a.isActive=!0,y=dh,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof Xt?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof Ai&&!a.currentContextMenu.visible&&a.stopTool()}}hs.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},hs.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof Ai){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category=this.name,a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionContextMenu(a,y)}else a instanceof yl&&a.show(y,x,this);this.currentContextMenu=a},hs.prototype.positionContextMenu=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y+E.height>b.bottom&&(x.y-=E.height+5/y.scale),x.y<b.y&&(x.y=b.y),a.position=x}},hs.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof Ai?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof yl&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Tu(a){var y=new be;return y.add(new Oa("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new Oa("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new Oa("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new Oa("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new Oa("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new Oa("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new Oa("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new Oa("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new Oa("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new Oa("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new Oa("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new Oa("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new Oa("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}hs.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Tu(this)),Id.innerHTML="",Zh.addEventListener("pointerdown",this.tu,!1);var y=this,x=sn("ul");x.className="goCXul",Id.appendChild(x),x.innerHTML="";for(var E=this.jt.iterator;E.next();){var b=E.value,z=b.visible;if(typeof b.hx=="function"&&(typeof z!="function"||z(a))){z=sn("li"),z.className="goCXli";var tt=sn("a");tt.className="goCXa",tt.href="#",tt.ky=b.hx,tt.addEventListener("pointerdown",function(ot){return this.ky(a),y.stopTool(),ot.preventDefault(),!1},!1),tt.textContent=b.text,z.appendChild(tt),x.appendChild(z)}}Id.style.display="block",Zh.style.display="block"},hs.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===dh){Id.style.display="none",Zh.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Zh,"pointerdown",this.tu,!1),this.currentContextMenu=null}},Ie.Object.defineProperties(hs.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof Ai?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return Od===!1&&dh===null&&Io&&Ya(this),dh},set:function(a){a===null&&(Od=!0),dh=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var dh=null,Od=!1,Zh=null,Id=null;hs.className="ContextMenuTool",ne("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function uo(){bi.call(this),this.name="TextEditing",this.Zh=new io,this.ia=null,this.V=Jh,this.vj=null,this.qa=Qh,this.u=1,this.F=!0,this.o=null,this.j=new yl,this.kt=null,Rd(this,this.j)}ee(uo,bi);function Rd(a,y){if(Io){var x=sn("textarea");a.kt=x,x.addEventListener("input",function(){if(a.textBlock!==null){var E=a.Lx(this.value);this.style.width=20+E.measuredBounds.width*this.wA+"px",this.rows=E.lineCount}},!1),x.addEventListener("keydown",function(E){if(!E.isComposing&&a.textBlock!==null){var b=E.key;b==="Enter"?(a.textBlock.isMultiline===!1&&E.preventDefault(),a.acceptText(jd)):b==="Tab"?(a.acceptText(Gf),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==Qh){var E=a.kt;a.qa===zd&&(a.qa=_d),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==Qh){var E=a.kt;typeof E.focus=="function"&&E.focus(),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),y.valueFunction=function(){return x.value},y.mainElement=x,y.show=function(E,b,z){if(E instanceof io&&z instanceof uo)if(z.state===Gd)x.style.border="3px solid red",x.focus();else{var tt=E.ga(Mi),ot=b.position,rt=b.scale,at=E.Df()*rt;at<z.minimumEditorScale&&(at=z.minimumEditorScale);var ut=E.naturalBounds.width*at+6,ct=E.naturalBounds.height*at+2,mt=(tt.x-ot.x)*rt;tt=(tt.y-ot.y)*rt,ot=E.verticalAlignment,rt=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*at,ct=ot.y*ct-ot.y*rt+ot.offsetY-(.5*ct-.5*rt)-rt/2,x.value=E.text,b.div.style.font=E.font,x.style.position="absolute",x.style.zIndex="100",x.style.font="inherit",x.style.fontSize=100*at+"%",x.style.lineHeight="normal",x.style.width=ut+"px",x.style.left=(mt-ut/2|0)-1+"px",x.style.top=(tt+ct|0)-1+"px",x.style.textAlign=E.textAlign,x.style.margin="0",x.style.padding="1px",x.style.border="0",x.style.outline="none",x.style.whiteSpace="pre-wrap",x.style.overflow="hidden",x.rows=E.lineCount,x.wA=at,x.className="goTXarea",b.div.appendChild(x),x.focus(),z.selectsTextOnActivate&&(x.select(),x.setSelectionRange(0,9999))}},y.hide=function(E){E.div.removeChild(x)}}}uo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||Fu&&Fu!==this&&(Fu.acceptText(Sl),Fu&&Fu!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof io&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===Jh&&!y.isSelected||this.starting===Hf&&2>a.lastInput.clickCount)):!1},uo.prototype.doStart=function(){Fu=this,this.textBlock!==null&&this.doActivate()},uo.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(a!==null){var y=this.textBlock;if(y===null&&(y=a.ic(a.lastInput.documentPoint)),y!==null&&y instanceof io&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=zd;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new pe(this.textBlock.ga(Sr),this.textBlock.ga(ya));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},uo.prototype.doCancel=function(){this.stopTool()},uo.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},uo.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Sl)},uo.prototype.acceptText=function(a){switch(a){case Sl:this.qa===qh?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===zd||this.qa===Gd||this.qa===_d)&&(this.qa=ig,ng(this));break;case _f:case jd:case Gf:(jd!==a||this.textBlock.isMultiline!==!0)&&(this.qa===zd||this.qa===Gd||this.qa===_d)&&(this.qa=ig,ng(this))}};function ng(a){var y=a.textBlock,x=a.diagram,E=a.currentTextEditor;if(y!==null&&E!==null){var b=y.text,z="";E.valueFunction!==null&&(z=E.valueFunction()),a.isValidText(y,b,z)?(a.Ea(a.name),a.qa=qh,a.transactionResult=a.name,y.text=z,a.doSuccess(b,z),x!==null&&x.R("TextEdited",y,b),a.stopTransaction(),a.stopTool(),x!==null&&x.doFocus()):(a.qa=Gd,a.doError(b,z))}}uo.prototype.doError=function(a,y){var x=this.textBlock;x.errorFunction!==null&&x.errorFunction(this,a,y),(a=this.currentTextEditor)&&a.show(x,this.diagram,this)},uo.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},uo.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=Qh,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},uo.prototype.doStop=function(){Fu=null},uo.prototype.isValidText=function(a,y,x){var E=this.textValidation;return E!==null&&!E(a,y,x)?!1:(E=a.textValidation,!!(E===null||E(a,y,x)))},uo.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},Ie.Object.defineProperties(uo.prototype,{textBlock:{get:function(){return this.ia},set:function(a){this.ia=a}},currentTextEditor:{get:function(){return this.o},set:function(a){this.o=a}},defaultTextEditor:{get:function(){return this.j},set:function(a){this.j=a}},starting:{get:function(){return this.V},set:function(a){this.V=a}},textValidation:{get:function(){return this.vj},set:function(a){this.vj=a}},minimumEditorScale:{get:function(){return this.u},set:function(a){this.u=a}},selectsTextOnActivate:{get:function(){return this.F},set:function(a){this.F=a}},state:{get:function(){return this.qa},set:function(a){this.qa!==a&&(this.qa=a)}}}),uo.prototype.measureTemporaryTextBlock=uo.prototype.Lx;var _f=new ae(uo,"LostFocus",0),Sl=new ae(uo,"MouseDown",1),Gf=new ae(uo,"Tab",2),jd=new ae(uo,"Enter",3),$0=new ae(uo,"SingleClick",0),Jh=new ae(uo,"SingleClickSelected",1),Hf=new ae(uo,"DoubleClick",2),Qh=new ae(uo,"StateNone",0),zd=new ae(uo,"StateActive",1),_d=new ae(uo,"StateEditing",2),ig=new ae(uo,"StateValidating",3),Gd=new ae(uo,"StateInvalid",4),qh=new ae(uo,"StateValidated",5),Fu=null;uo.className="TextEditingTool",uo.LostFocus=_f,uo.MouseDown=Sl,uo.Tab=Gf,uo.Enter=jd,uo.SingleClick=$0,uo.SingleClickSelected=Jh,uo.DoubleClick=Hf,uo.StateNone=Qh,uo.StateActive=zd,uo.StateEditing=_d,uo.StateValidating=ig,uo.StateInvalid=Gd,uo.StateValidated=qh,ne("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function Qs(a){Wd||(og(),Wd=!0),this.H=Bl,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=nu,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new ke,this.ce=new zr,this.ce.Yd=this,this.Ei=new ke,this.pu=new ke,this.Sr=new ke,this.pr=new ke,a&&Object.assign(this,a)}Qs.prototype.Xe=function(a){this.H=a},Qs.prototype.canStart=function(){return!0};function Al(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),_r(a.H),a.zb=!0)}function Wf(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===nu?(y.isViewportUnconstrained=!0,y.vc.clear(),y.add(x,"position",x.position.copy().offset(0,-200),x.position),y.add(x,"opacity",0,1)):a.Pk===rg&&y.vc.clear(),a.Qw=!!(a.Pk===Ud&&x.du.D(x.pa)),x.R("InitialAnimationStarting",a)),E&&!a.Gh||y.vc.count===0?(a.Zd.clear(),a.zb=!1,y.vc.clear(),Vd(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==$r&&E!==null&&(delete E.start.scale,delete E.end.scale),me.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&ks(x),hg(x),a.zb=!1,y.start(),y.bc&&(bu(a),x.Ya(),sg(y,0),Ca(x,!0),fh(a),x.R("AnimationStarting",a)))}))}}function eu(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function Uf(a,y,x,E){a.isTicking||eu(a)||y instanceof Ue&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}xt=Qs.prototype,xt.fv=function(a){return this.ce.fv(a)},xt.Xu=function(a){return this.ce.Xu(a)};function Vf(a,y){function x(){if(0<b.Sr.count&&(E.addAll(b.Sr),b.Sr.clear(),b.bc=!0),b.bc!==!1&&E.count!==0){b.pu.addAll(E);for(var z=b.pu.iterator;z.next();){var tt=z.value;if(tt.bc!==!1){t:if(0<tt.yl.count)var ot=!0;else{for(ot=tt.vc.iterator;ot.next();){var rt=ot.key;if(rt instanceof Xt&&rt.diagram!==null||rt instanceof te){ot=!0;break t}}ot=!1}ot?Yd(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(bu(b),Ca(b.H),fh(b)),me.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),me.requestAnimationFrame(function(){x()}))}function _p(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function bu(a){if(!a.vq){var y=a.H;a.Ow=y.skipsUndoManager,a.cw=y.skipsModelSourceBindings,y.skipsUndoManager=!0,y.skipsModelSourceBindings=!0,a.vq=!0}}function fh(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}xt.Cc=function(a){var y=this.ce;if(this.zb===!0&&(this.Ok=this.zb=!1,this.Zd.clear(),0<y.vc.count&&this.H.$b()),this.bc){if(y.Ml(!0),y.vc.clear(),Vd(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Vd(y,this.H)},xt.Ml=function(a){a===this.defaultAnimation&&this.defaultAnimation.vc.clear(),this.Ei.remove(a),this.Ei.count===0&&(this.bc=!1,this.H.$b()),a===this.defaultAnimation&&(this.defaultAnimation.vc.clear(),this.H.R("AnimationFinished",this))},xt.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),Is(this,a))},xt.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),Au(this.ce,y,"position",y.position,y.position),Is(this,a))};function Gp(a,y,x){!a.zb||y.D(x)||eu(a)||(a.H.pi||(y=x.copy()),Au(a.ce,a.H,"position",y,x))}function Yf(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function Is(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function ch(a,y,x,E,b){a===null&&(a=[0,0,0,0]),y===null&&(y=[0,0,0,0]);var z=a[0],tt=a[1],ot=a[2];a=a[3];var rt=y[0],at=y[1],ut=y[2];return y=y[3],ot===0||ot===100?(z=rt,tt=at):(ut===0||ut===100)&&(rt=z,at=tt),180<Math.abs(rt-z)&&(rt>z?z+=360:rt+=360),z=b(x,z,rt-z,E)%360,tt=b(x,tt,at-tt,E),ot=b(x,ot,ut-ot,E),x=b(x,a,y-a,E),"hsla("+z+", "+tt+"%, "+ot+"%, "+x+")"}function og(){function a(x,E,b,z,tt,ot){x.position=new At(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}var y=new qe;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,tt,ot){tt<ot?x.mm(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot),!1):x.position=new At(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}),y.add("location",function(x,E,b,z,tt,ot){tt<ot?x.mm(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot),!0):x.location=new At(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}),y.add("position:placeholder",function(x,E,b,z,tt,ot){tt<ot?x.mm(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot),!1):x.position=new At(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}),y.add("position:nodeCollapse",function(x,E,b,z,tt,ot){var rt=x.actualBounds,at=b.actualBounds;b=at.x+at.width/2-rt.width/2,rt=at.y+at.height/2-rt.height/2,tt<ot?x.mm(z(tt,E.x,b-E.x,ot),z(tt,E.y,rt-E.y,ot),!1):x.position=new At(z(tt,E.x,b-E.x,ot),z(tt,E.y,rt-E.y,ot))}),y.add("desiredSize",function(x,E,b,z,tt,ot){x.desiredSize=new pe(z(tt,E.width,b.width-E.width,ot),z(tt,E.height,b.height-E.height,ot))}),y.add("width",function(x,E,b,z,tt,ot){x.width=z(tt,E,b-E,ot)}),y.add("height",function(x,E,b,z,tt,ot){x.height=z(tt,E,b-E,ot)}),y.add("fill",function(x,E,b,z,tt,ot){x.fill=ch(E,b,tt,ot,z)}),y.add("stroke",function(x,E,b,z,tt,ot){x.stroke=ch(E,b,tt,ot,z)}),y.add("strokeWidth",function(x,E,b,z,tt,ot){x.strokeWidth=z(tt,E,b-E,ot)}),y.add("strokeDashOffset",function(x,E,b,z,tt,ot){x.strokeDashOffset=z(tt,E,b-E,ot)}),y.add("background",function(x,E,b,z,tt,ot){x.background=ch(E,b,tt,ot,z)}),y.add("areaBackground",function(x,E,b,z,tt,ot){x.areaBackground=ch(E,b,tt,ot,z)}),y.add("opacity",function(x,E,b,z,tt,ot){x.opacity=z(tt,E,b-E,ot)}),y.add("scale",function(x,E,b,z,tt,ot){x.scale=z(tt,E,b-E,ot)}),y.add("angle",function(x,E,b,z,tt,ot){x.angle=z(tt,E,b-E,ot)}),Hd=y}Ie.Object.defineProperties(Qs.prototype,{animationReasons:{get:function(){return this.Zd}},isEnabled:{get:function(){return this.Jd},set:function(a){(this.Jd=a)&&this.Ei.each(function(y){y.isAnimating||y.runCount!==1/0||y.start()})}},duration:{get:function(){return this.Dg},set:function(a){1>a&&qn(a,">= 1",Qs,"duration"),this.Dg=a}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(a){this.Pk=a}}}),Qs.prototype.stopAnimation=Qs.prototype.Cc;var Hd=null,Wd=!1,nu=new ae(Qs,"Default",1),Ud=new ae(Qs,"AnimateLocations",2),rg=new ae(Qs,"None",3);Qs.className="AnimationManager",Qs.defineAnimationEffect=function(a,y){Wd||(og(),Wd=!0),Hd.add(a,y)},Qs.Default=nu,Qs.AnimateLocations=Ud,Qs.None=rg;function zr(a){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=$h,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=An,this.vc=new qe,this.Tt=new qe,this.yl=new ke,this.Ut=new ke,this.dw=Ou,a&&Object.assign(this,a)}zr.prototype.suspend=function(){this.Xk=!0},zr.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Yd(this,!0),bu(this.Yd),Ca(this.H),fh(this.Yd),this.H.redraw()};function Vd(a,y){if(a.Tt.clear(),a.Wk=!1,a.au=0,a.Gd=NaN,0<a.yl.count&&a.yl.clear(),0<a.Ut.count&&a.Ut.clear(),y!==null)for(a=y.links;a.next();)a.value.Tg=null}xt=zr.prototype,xt.start=function(){if(this.vc.count===0||this.bc)return this;for(var a=this.H,y=this.vc.iterator;y.next();){var x=y.key;a===null&&(x instanceof te?a=x:x instanceof Xt&&(a=x.diagram))}if(a!==null)this.H=a,this.Yd=a.animationManager;else return this;return y=this.Yd,y.isEnabled===!1?this:(this.Gd=isNaN(this.Dg)?y.duration:this.Dg,this.Lp=this.ot,y.Ok&&y.Pk===nu&&this===y.defaultAnimation&&(this.Lp=Hp,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=$d),bu(y),this.yl.each(function(E){E.data=null,a.add(E)}),fh(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,Vf(y,this),this)},xt.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},xt.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof te?this.H=a:a instanceof Xt&&a.diagram!==null&&(this.H=a.diagram)),a instanceof Ln){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return Au(this,a,y,x,E,b),this};function Au(a,y,x,E,b,z){var tt=a.vc;if(y instanceof te&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(su(E),sv(),E=[fa.j,fa.u,fa.o,fa.F],su(b),sv(),b=[fa.j,fa.u,fa.o,fa.F]),tt.contains(y)){var ot=tt.I(y),rt=ot.start,at=ot.end;rt[x]===void 0&&(rt[x]=gh(E)),at[x]=gh(b)}else rt={},at={},rt[x]=gh(E),at[x]=gh(b),ot=rt.position,y instanceof Xt&&ot instanceof At&&!ot.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&ot.assign(at.position),ot=new ph(rt,at,z),tt.add(y,ot);tt=rt[x],tt instanceof At&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof Ln?ot.Ku.location=gh(y.location):z&&(ot.Ku[x]=gh(E))}function gh(a){return a instanceof At||a instanceof Le?a.copy():a}xt.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},xt.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Yd(a,y){if(!a.Xk||y){var x=a.Yd;if(a.bc!==!1){var E=+new Date,b=E>a.cn?a.Gd:E-a.Qd;y&&(b=a.gw,b<a.Gd?(a.Qd=+new Date-b,a.cn=a.Qd+a.Gd):b=a.Gd),bu(x),sg(a,b),Ca(a.H,!0),fh(x),E>a.cn&&(a.ho&&!a.Wk?(a.Qd=+new Date,a.cn=a.Qd+a.Gd,a.Wk=!0):a.Ml(!1))}}}function sg(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof Xt&&z.diagram===null)){var tt=E.value,ot=b?tt.end:tt.start;tt=b?tt.start:tt.end;var rt=Hd,at;for(at in tt)at==="position"&&(tt["position:placeholder"]||tt["position:nodeCollapse"])||rt.get(at)===null||rt.get(at)(z,ot[at],tt[at],a.Lp,y,x,a)}}}xt.stop=function(){return this.bc?(this.Ml(!0),this):this},xt.Ml=function(a){if(this.vu!==null&&this.vu.jo.remove(this.Nw),this.bc){var y=this.H,x=this.Yd;this.Xk=this.bc=x.Ok=!1,bu(x);for(var E=this.vc,b=this.yl.iterator;b.next();)y.remove(b.value);for(b=this.Ut.iterator;b.next();)b.value.v();b=this.ho,E=E.iterator;for(var z=Hd;E.next();){var tt=E.key,ot=E.value,rt=b?ot.end:ot.start,at=b?ot.start:ot.end,ut=ot.Ku,ct;for(ct in at)if(z.get(ct)!==null){var mt=ct;!ot.Hu||mt!=="position:nodeCollapse"&&mt!=="position:placeholder"||(mt="position"),z.get(mt)(tt,rt[ct],ut[ct]!==void 0?ut[ct]:ot.Hu?rt[ct]:at[ct],this.Lp,this.Gd,this.Gd,this)}ot.Hu&&ut.location!==void 0&&tt instanceof Ln&&(tt.location=ut.location),ot.nv&&tt instanceof Ln&&tt.Zb(!1)}if(y.As.clear(),Kd(y,!1),y.Ya(),y.N(),Ca(y,!0),x.defaultAnimation===this){for(ct=x.pr.iterator;ct.next();)b=ct.value,b.Tg!==null&&(b.points=b.Tg,b.Tg=null);x.pr.clear()}Ca(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),fh(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Vd(this,null),x.Ml(this),y.$b())}},xt.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof Jn&&(E=y.placeholder),E!==null?(x=E.ga(Sr),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new At(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof Jn)for(a=a.memberParts;a.next();)E=a.value,E instanceof tn&&this.Cj(E,y)},xt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof Jn&&(x=y.placeholder),x!==null){var E=x.ga(Sr);x=x.padding,E.x+=x.left,E.y+=x.top,this.add(a,"position:placeholder",a.position,E,!0)}else this.add(a,"position:nodeCollapse",a.position,y,!0);if(this.add(a,"scale",a.scale,.01,!0),E=this.vc,E.contains(a)&&(E.I(a).nv=!0),a instanceof Jn)for(a=a.memberParts;a.next();)E=a.value,E instanceof tn&&this.Aj(E,y)}},xt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},Ie.Object.defineProperties(zr.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&qn(a,">= 1",zr,"duration"),this.Dg=a}},reversible:{get:function(){return this.ho},set:function(a){this.ho=a}},runCount:{get:function(){return this.cu},set:function(a){0<a?this.cu=a:de("Animation.runCount value must be a positive integer.")}},finished:{get:function(){return this.dn},set:function(a){this.dn!==a&&(this.dn=a)}},easing:{get:function(){return this.ot},set:function(a){this.ot=a}},isViewportUnconstrained:{get:function(){return this.j},set:function(a){this.j=a}},isAnimating:{get:function(){return this.bc}}}),zr.prototype.getTemporaryState=zr.prototype.Ez,zr.prototype.stop=zr.prototype.stop,zr.prototype.add=zr.prototype.add,zr.prototype.addTemporaryPart=zr.prototype.Iy;function $h(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function Hp(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}zr.className="Animation",zr.EaseLinear=function(a,y,x,E){return x*a/E+y},zr.EaseInOutQuad=$h,zr.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},zr.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},zr.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},zr.EaseOutExpo=Hp;function ph(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}ph.className="AnimationState";function Ka(a,y,x){this.xd=null,this.rf=a,this.so=x||ag,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=mh))}Ka.prototype.copy=function(){var a=new Ka(this.rf);a.so=this.so;var y=this.uk;if(y!==null){var x={};y.duration!==void 0&&(x.duration=y.duration),y.finished!==void 0&&(x.finished=y.finished),y.easing!==void 0&&(x.easing=y.easing),a.uk=x}return a};function Wp(a,y){a=a.uk,a!==null&&(a.duration&&(y.duration=a.duration),a.finished&&(y.finished=a.finished),a.easing&&(y.easing=a.easing))}Ie.Object.defineProperties(Ka.prototype,{propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{get:function(){return this.uk},set:function(a){this.uk=a}},startCondition:{get:function(){return this.so},set:function(a){this.so=a}}});var ag=new ae(Ka,"Default",1),mh=new ae(Ka,"Immediate",2),td=new ae(Ka,"Bundled",3);Ka.className="AnimationTrigger",Ka.Default=ag,Ka.Immediate=mh,Ka.Bundled=td;function kr(a){vi(this),this.H=null,this.Pa=new be,this.xa="",this.pb=1,this.o=!1,this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0,this.Zq=[],a&&Object.assign(this,a)}xt=kr.prototype,xt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,Kr(x)}a.clear(),this.Zq.length=0},xt.Xe=function(a){this.H=a},xt.toString=function(a){a===void 0&&(a=0);var y='Layer "'+this.name+'"';if(0>=a)return y;for(var x=0,E=0,b=0,z=0,tt=0,ot=this.Pa.iterator;ot.next();){var rt=ot.value;rt instanceof Jn?b++:rt instanceof tn?E++:rt instanceof Ue?z++:rt instanceof Ai?tt++:x++}if(ot="",0<x&&(ot+=x+" Parts "),0<E&&(ot+=E+" Nodes "),0<b&&(ot+=b+" Groups "),0<z&&(ot+=z+" Links "),0<tt&&(ot+=tt+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,ot+=`
`+x.toString(),E=x.data,E!==null&&qt(E)&&(ot+=" #"+qt(E)),x instanceof tn?ot+=" "+Yi(E):x instanceof Ue&&(ot+=" "+Yi(x.fromNode)+" "+Yi(x.toNode));return y+" "+this.Pa.count+": "+ot},xt.ic=function(a,y,x){if(y===void 0&&(y=null),x===void 0&&(x=null),this.Uh===!1)return null;var E=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(E=!0);for(var b=At.alloc(),z=this.Pa.s,tt=z.length;tt--;){var ot=z[tt];if((E!==!0||Mh(ot)!==!1)&&ot.isVisible()&&(b.assign(a),Pi(b,ot.oe),ot=ot.ic(b,y,x),ot!==null&&(y!==null&&(ot=y(ot)),ot!==null&&(x===null||x(ot)))))return At.free(b),ot}return At.free(b),null},xt.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof be||E instanceof ke||(E=new ke),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=At.alloc(),tt=this.Pa.s,ot=tt.length;ot--;){var rt=tt[ot];if((b!==!0||Mh(rt)!==!1)&&rt.isVisible()){z.assign(a),Pi(z,rt.oe);var at=rt;rt.ji(z,y,x,E)&&(y!==null&&(at=y(at)),at===null||x!==null&&!x(at)||E.add(at))}}return At.free(z),E},xt.Cf=function(a,y,x,E,b){if(y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof be||b instanceof ke||(b=new ke),this.Uh===!1)return b;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var tt=this.Pa.s,ot=tt.length;ot--;){var rt=tt[ot];if((z!==!0||Mh(rt)!==!1)&&rt.isVisible()){var at=rt;rt.Cf(a,y,x,E,b)&&(y!==null&&(at=y(at)),at===null||x!==null&&!x(at)||b.add(at))}}return b},xt.Nu=function(a,y,x,E,b,z,tt){if(this.Uh===!1)return b;for(var ot=this.Pa.s,rt=ot.length;rt--;){var at=ot[rt];if((tt!==!0||Mh(at)!==!1)&&z(at)&&at.isVisible()){var ut=at;at.Cf(a,y,x,E,b)&&(y!==null&&(ut=y(ut)),ut===null||x!==null&&!x(ut)||b.add(ut))}}return b},xt.og=function(a,y,x,E,b,z){if(x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof be||b instanceof ke)&&(z=b),b=!0),z instanceof be||z instanceof ke||(z=new ke),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var ot=At.alloc(),rt=At.alloc(),at=this.Pa.s,ut=at.length;ut--;){var ct=at[ut];if((tt!==!0||Mh(ct)!==!1)&&ct.isVisible()){ot.assign(a),Pi(ot,ct.oe),rt.h(a.x+y,a.y),Pi(rt,ct.oe);var mt=ct;ct.og(ot,rt,x,E,b,z)&&(x!==null&&(mt=x(mt)),mt===null||E!==null&&!E(mt)||z.add(mt))}}return At.free(ot),At.free(rt),z},xt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=Un();for(var b=Un(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof Ue){if(tt.fd===!1)continue}else if(tt instanceof Ai&&tt.adornedPart!==null)continue;var ot=tt.actualBounds;tt.isVisible()&&Vs(ot,y)?(tt.Fd(!0),a.push(tt)):(tt.Fd(!1),tt.adornments!==null&&0<tt.adornments.count&&b.push(tt))}for(y=0;y<a.length;y++)for(x=a[y],Ov(x),x=x.adornments;x.next();)E=x.value,E.measure(1/0,1/0),E.arrange(),E.Fd(!0);for(y=0;y<b.length;y++)Ov(b[y]);_n(a),_n(b)}}};function iu(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}xt.gc=function(a,y,x){if(this.visible&&this.pb!==0&&(x===void 0&&(x=!0),x||!this.isTemporary)){x=this.Pa.s;var E=x.length;if(E!==0){if(a.isTemporary)for(var b=0;b<E;b++)x[b].Gj();b=iu(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,ot=pe.alloc(),rt=0;rt<E;rt++)this.Oj(a,x[rt],y,z,tt,ot,!0);if(pe.free(ot),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Up(a,y,x,E,b){if(a.visible&&a.pb!==0&&(b||!a.isTemporary)){b=a.Pa.s;var z=b.length;if(z!==0){var tt=iu(a,y),ot=a.Zq;ot.length=0;for(var rt=x.scale,at=pe.alloc(),ut=0;ut<z;ut++){var ct=b[ut];E.contains(ct)&&a.Oj(y,ct,x,ot,rt,at,!1)}pe.free(at),y.globalAlpha=tt}}}xt.Oj=function(a,y,x,E,b,z,tt){if(tt&&!Mh(y))a.Hs(y);else{if(E!==null&&y instanceof Ue&&(y.isOrthogonal&&E.push(y),y.fd===!1)){a.Hs(y);return}for(tt=!1,E=y.containingGroup;E!==null;)tt?E.tb!==null&&z.Ex(E.tb):E.tb!==null&&(tt=!0,z.assign(E.tb)),E=E.containingGroup;var ot=y.actualBounds;if(E=!1,tt&&y.isVisible()){if(!z.Yc(ot)){a.Hs(y);return}E=!z.Re(ot)}E&&(a.save(),a instanceof qs?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),ot.width*b>x.Oq||ot.height*b>x.Oq?y.gc(a,x):(b=y.actualBounds,z=y.naturalBounds,b.width===0||b.height===0||isNaN(b.x)||isNaN(b.y)||!y.isVisible()||(x=y.transform,y.areaBackground!==null&&(zo(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(zo(y,a,"rgba(0,0,0,0.3)",!0,!1,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.background!==null&&(a.transform(x.m11,x.m12,x.m21,x.m22,x.dx,x.dy),zo(y,a,y.background,!0,!1,z,b),a.fillRect(0,0,z.width/2,z.height/2),x.ws()||(y=1/(x.m11*x.m22-x.m12*x.m21),a.transform(x.m22*y,-x.m12*y,-x.m21*y,x.m11*y,y*(x.m21*x.dy-x.m22*x.dx),y*(x.m12*x.dx-x.m11*x.dy)))))),E&&(a.restore(),a.Vc(!0))}},xt.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(Eo,a,this,y,x,E,b)},xt.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&Kr(y),a>=E.count)a=E.count;else if(E.M(a)===y)return-1;return E.Gb(a,y),y.Vo(x),E=this.diagram,E!==null&&(x?E.N():E.oi(y)),Kf(this,a,y),a},xt.pc=function(a,y,x){if(!x&&y.layer!==this&&y.layer!==null)return y.layer.pc(a,y,x);var E=this.Pa;if(0>a||a>=E.length){if(a=E.indexOf(y),0>a)return-1}else if(E.M(a)!==y&&(a=E.indexOf(y),0>a))return-1;return y.Wo(x),E.mb(a),E=this.diagram,E!==null&&(x?E.N():E.pc(y)),y.Ig=null,Kr(y),a};function Kf(a,y,x){if(y=Vp(a,y,x),x instanceof Jn&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var E=-1,b=a.Pa.s,z=b.length,tt=0;tt<z;tt++){var ot=b[tt];if(ot===x&&(y=tt,0<=E)||0>E&&ot.containingGroup===x&&(E=tt,0<=y))break}!(0>E)&&E<y&&(b=a.Pa,b.mb(y),b.Gb(E,x))}y=x.containingGroup,y!==null&&Kf(a,-1,y)}x.svg!==null&&x.svg.remove()}function Vp(a,y,x){var E=x.zOrder;if(isNaN(E))return y;a=a.Pa;var b=a.count;if(1>=b)return y;if(0>y&&(y=a.indexOf(x)),0>y)return-1;for(var z=y-1,tt=NaN;0<=z&&(tt=a.M(z).zOrder,!!isNaN(tt));)z--;for(var ot=y+1,rt=NaN;ot<b&&(rt=a.M(ot).zOrder,!!isNaN(rt));)ot++;if(!isNaN(tt)&&tt>E)for(;;){if(z===-1||tt<=E){if(z++,z===y)break;return a.mb(y),a.Gb(z,x),z}for(tt=NaN;0<=--z&&(tt=a.M(z).zOrder,isNaN(tt)););}else if(!isNaN(rt)&&rt<E)for(;;){if(ot===b||rt>=E){if(ot--,ot===y)break;return a.mb(y),a.Gb(ot,x),ot}for(rt=NaN;++ot<b&&(rt=a.M(ot).zOrder,isNaN(rt)););}return y}Ie.Object.defineProperties(kr.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(a){var y=this.xa;if(y!==a){var x=this.diagram;if(x!==null)for(y===""&&de("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&de("Layer.name is already present in this diagram: "+a);for(this.xa=a,this.g("name",y,a),a=this.Pa.iterator;a.next();)a.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&qn(a,"0 <= value <= 1",kr,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,a!==null&&a.N())}},isTemporary:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&((this.o=a)&&(this.isInDocumentBounds=!1),this.g("isTemporary",y,a))}},visible:{get:function(){return this.u},set:function(a){var y=this.u;if(y!==a){for(this.u=a,this.g("visible",y,a),y=this.Pa.iterator;y.next();)y.value.Zb(a);a=this.diagram,a!==null&&a.N()}}},pickable:{get:function(){return this.Uh},set:function(a){var y=this.Uh;y!==a&&(this.Uh=a,this.g("pickable",y,a))}},isInDocumentBounds:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,this.diagram!==null&&this.diagram.Ya())}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}}}),kr.prototype.findObjectsNear=kr.prototype.og,kr.prototype.findObjectsIn=kr.prototype.Cf,kr.prototype.findObjectsAt=kr.prototype.ji,kr.prototype.findObjectAt=kr.prototype.ic,kr.className="Layer";function te(a,y){if(rm||(Vr(),rm=!0),vi(this),Bl=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Io){var x=this,E=function(){x.removeEventListener(me.document,"DOMContentLoaded",E,!1),x.setRTL()};me.document.body!==null?this.setRTL():x.addEventListener(me.document,"DOMContentLoaded",E,!1)}this.ol=null,oc.add("Model",Xi);var b=this;return this.Hb=function(z){var tt=b.partManager;if(z.model===tt.diagram.model&&tt.diagram.aa){tt.diagram.aa=!1;try{var ot=z.change;z.modelChange===""&&ot===Eo&&tt.updateDataBindings(z.object,z.propertyName)}finally{tt.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Yp(this),this.model=hy(),this.Wg=!0,Xp(this),this.layout=new xo,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new sm,a!==void 0&&(typeof a=="string"||me.Element&&a instanceof Element?ug(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var vh,Bl;function Yp(a){a.Yd=new Qs,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new be,a.pj=new qe,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new At(NaN,NaN).freeze(),a.du=new At(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new At(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new ci,a.zu=new At(NaN,NaN).freeze(),a.ut=new pe(NaN,NaN,NaN,NaN).freeze(),a.rj=new On(0,0,0,0).freeze(),a.sj=Ou,a.nu=!1,a.Zt=null,a.fu=null,a.yh=$r,a.zk=Ir,a.Fg=$r,a.pq=Ir,a.yt=Sr,a.Bt=Sr,a.Fc=!0,a.pn=!1,a.De=new ke,a.Eh=new qe,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new On(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new Qr,a.bq.diagram=a,a.Qg=new Qr,a.Qg.diagram=a,a.cj=new Qr,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,ev(a),a.ai=new ke,a.Ht=!0,a.uu=Iu,a.pw=!1,a.wu=qd,a.it="auto",a.Op="auto",a.zh=null,a.Fh=null,a.Bh=null,a.Qh=null,a.Oh=null,a.Nh=null,a.Qt=null,a.Lh=null,a.xt=!1,a.Mh=null,a.Ph=null,a.$h=null,a.Ch=null,a.Rt=!1,a.Yt={},a.oj=[null,null],a.Wg=!1,a.Iw=!1,a.ou=!1,a.lt=!1,a.rw=!0,a.ld=!1,a.$i=!1,a.Tw=!0,a.Ce=-2,a.Og=new qe,a.Xn=new be,a.Gg=!1,a.Jd=!0,a.Us=!0,a.Fi=!0,a.Gi=!0,a.Vs=!1,a.Ws=!0,a.Pi=!0,a.Hi=!0,a.Qi=!0,a.Ys=!0,a.Ii=!0,a.Ki=!0,a.Ji=!0,a.Li=!0,a.Mi=!0,a.Ni=!0,a.Oi=!0,a.Zs=!0,a.at=!0,a.qw=!1,a.Vk=!1,a.mn=!0,a.nn=!0,a.Xs=!0,a.$s=!0,a.iu=16,a.mu=16,a.qr=!1,a.gu=!1,a.lu=0,a.ju=0,a.yb=new On(5).freeze(),a.Hw=new ke().freeze(),a.Nt=999999999,a.nw=new ke().freeze(),a.Zi=!0,a.Ee=!0,a.vd=!0,a.Be=!1,a.gf=!1,a.xh=!0,a.hf=!1,a.sy=new ke,a.ow=new ke,a.Xh=null,a.aw=new Le(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new At,bounds:new pe,Py:new Le,bA:new Le,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new pe(NaN,NaN,NaN,NaN).freeze(),a.wo=new Le(NaN,NaN).freeze(),a.Sp=new pe(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new qe;var y=new tn,x=new io;x.bind(new Jo("text","",Yi)),y.add(x),a.ny=y,a.Lg.add("",y),y=new tn,x=new io,x.stroke="brown",x.bind(new Jo("text","",Yi)),y.add(x),a.Lg.add("Comment",y),y=new tn,y.selectable=!1,y.avoidable=!1,x=new ei,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new Le(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new qe,y=new Jn,y.selectionObjectName="GROUPPANEL",y.type=ze.Vertical,x=new io,x.font="bold 12pt sans-serif",x.bind(new Jo("text","",Yi)),y.add(x),x=new ze(ze.Auto),x.name="GROUPPANEL";var E=new ei;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new gs,E.padding=new On(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new qe,y=new Ue,x=new ei,x.isPanelMain=!0,y.add(x),x=new ei,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new Ue,x=new ei,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Ai,y.type=ze.Auto,x=new ei,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new gs,x.margin=new On(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new Ai,y.type=ze.Link,x=new ei,x.isPanelMain=!0,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),a.Kt=y,a.fe=null,a.mq=!1,a.Ck=null,a.partManager=new Xi,a.toolManager=new ko,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new st,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Kp(),a.eq=null,a.fq=lo,a.Pw=!1,a.Mb=1,a.Yh=null,a.Oq=1,a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0,a.yq=1,a.tw=0,a.uw=new At,a.zy=500,a.wp=new At,a.wq=!1}te.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),ad=null,wh="",lg(this,!1),this.Xn.clear(),vc(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function lg(a,y){a.animationManager.Cc(!0),a.Hw=new ke().freeze(),a.nw=new ke().freeze();var x=a.skipsUndoManager,E=a.cc!==null&&a.cc!==void 0;E&&(a.skipsUndoManager=!0);var b=null;a.fe!==null&&(b=a.fe.part,b!==null&&a.remove(b));var z=[],tt=a.Wa.length;if(y){for(y=0;y<tt;y++)for(var ot=a.Wa.s[y].parts;ot.next();){var rt=ot.value;rt!==b&&rt.data===null&&z.push(rt)}for(y=0;y<z.length;y++)a.remove(z[y])}for(y=0;y<tt;y++)a.Wa.s[y].clear();return a.partManager.clear(),a.De.clear(),a.Eh.clear(),a.ai.clear(),a.Ck=null,a.Xn.clear(),vc(),a.Og.clear(),zi=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Kp(){return null}te.prototype.reset=function(){this.clear(),this.vb=!0,Yp(this),Pl(this),this.Wg=!0,Xp(this),this.layout=new xo,this.Wg=!1,this.model=hy(),this.model.undoManager=new Fo,this.vb=this.rn=!1,this.N()},te.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=me.document.body);var y=sn("div");y.dir="rtl",y.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",y.textContent="A",a.appendChild(y);var x="reverse";0<y.scrollLeft?x="default":(y.scrollLeft=1,y.scrollLeft===0&&(x="negative")),a.removeChild(y),this.bu=x},te.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=me.document.body);var y=0;if(Io){var x=om;y=vh,x===null&&(x=om=sn("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=vh=sn("div"),y.style.position="absolute",y.style.visibility="hidden",y.style.width="200px",y.style.height="150px",y.style.boxSizing="content-box",y.appendChild(x)),y.style.overflow="hidden",a.appendChild(y);var E=x.offsetWidth;y.style.overflow="scroll",x=x.offsetWidth,E===x&&(x=y.clientWidth),a.removeChild(y),y=E-x,y!==0||kn||(y=11)}this.Db=y,this.Gw=!0},te.prototype.qb=function(a){a.classType===te&&(this.autoScale=a)},te.prototype.toString=function(a){a===void 0&&(a=0);var y="";if(this.div&&this.div.id&&(y=this.div.id),y='Diagram "'+y+'"',0>=a)return y;for(var x=this.Wa.iterator;x.next();)y+=`
`+x.value.toString(a-1);return y};function ug(a,y){if(Io){if(y!=null||de("Diagram setup requires an argument DIV."),a.Ka!==null&&de("Diagram has already completed setup."),typeof y=="string"?a.Ka=me.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:de("No DIV or DIV id supplied: "+y),a.Ka===null&&de("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&de("Invalid div id; div already has a Diagram associated with it."),!a.ol&&me.ResizeObserver){var x=Xn(function(){a.$b()},250);a.ol=new me.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}me.getComputedStyle(a.Ka,null).position==="static"&&(a.Ka.style.position="relative"),y=5;var E="rgba(2"+y+"5, 255, 255, 0)";y--,a.Ka.style["-webkit-tap-highlight-color"]=E,a.Ka.innerHTML="",a.Ka.H=a,a.Ka.goDiagram=a,a.Ka.go=me.go;var b=new ja(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",me.getComputedStyle(a.Ka,null).getPropertyValue("direction")==="rtl"&&(a.tn=!0),b.style.zIndex="2",b.style.userSelect="none",b.style.MozUserSelect="none",b.style.touchAction="none",b.style.letterSpacing="normal !important",b.style.wordSpacing="normal !important"),a.ta=b,a.ib=b.context,E=a.ib,a.Mb=a.computePixelRatio(),a.viewSize.w()||(a.Aa=a.Ka.clientWidth||1,a.ya=a.Ka.clientHeight||1),vg(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new ja(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,Io){b=sn("div");var z=sn("div");b.style.position="absolute",b.style.overflow="auto",b.style.width=a.Aa+"px",b.style.height=a.ya+"px",b.style.zIndex="1",z.style.position="absolute",z.style.width="1px",z.style.height="1px",a.Ka.appendChild(b),b.appendChild(z),b.onscroll=Jp,b.addEventListener("pointerdown",Qp),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=Xn(function(){a.Yh=null,a.N()},300),a.Ov=Xn(function(){hg(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var ot=wa(a,tt,!0);ot.bubbles=!0;var rt=0,at=0;ot.delta=0,tt.deltaX!==void 0?(tt.deltaX!==0&&(rt=0<tt.deltaX?1:-1),tt.deltaY!==0&&(at=0<tt.deltaY?1:-1),ot.delta=Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?-rt:-at):tt.wheelDeltaX!==void 0?(tt.wheelDeltaX!==0&&(rt=0<tt.wheelDeltaX?-1:1),tt.wheelDeltaY!==0&&(at=0<tt.wheelDeltaY?-1:1),ot.delta=Math.abs(tt.wheelDeltaX)>Math.abs(tt.wheelDeltaY)?-rt:-at):tt.wheelDelta!==void 0&&tt.wheelDelta!==0&&(ot.delta=0<tt.wheelDelta?1:-1),a.doMouseWheel(),Xa(ot,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,wa(a,tt,!0),tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())},a.ui=function(tt){if(a.isEnabled){a.Vk=!0;var ot=a.Yt;ot[tt.pointerId]===void 0&&(ot[tt.pointerId]=tt),ot=a.oj;var rt=!1;if(ot[0]===null||ot[0].pointerId!==tt.pointerId&&ot[0].pointerType===tt.pointerType)if(ot[1]!==null&&ot[1].pointerId===tt.pointerId)ot[1]=tt,rt=!0;else if(ot[0]===null)ot[0]=tt;else if(ot[1]===null)ot[1]=tt,rt=!0;else{tt.preventDefault();return}else ot[0]=tt;(ot=tt.pointerType==="touch"||tt.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var at=rt;rt=gg(a,tt,!0,!1,!0,at),nd(a,tt,rt),rt.targetDiagram=cg(tt,tt.target),rt.targetObject=null,at||rt.clone(a.bq),at=a.uw,ot=ot?25:10,tt.timeStamp-a.tw<a.zy&&!(Math.abs(at.x-tt.screenX)>ot||Math.abs(at.y-tt.screenY)>ot)?a.yq++:a.yq=1,rt.clickCount=a.yq,a.tw=tt.timeStamp,a.uw.sg(tt.screenX,tt.screenY),a.doMouseDown(),tt.button===1?tt.preventDefault():Xa(rt,tt)}},a.dk=function(tt){if(a.isEnabled){a.Vk=!0;var ot=a.oj;if(ot[0]===null||ot[0].pointerId!==tt.pointerId&&ot[0].pointerType===tt.pointerType){if(ot[1]!==null&&ot[1].pointerId===tt.pointerId){ot[1]=tt;return}if(ot[0]===null)ot[0]=tt;else return}else ot[0]=tt;if(ot[0].pointerId===tt.pointerId){ot=gg(a,tt,!1,!1,!1,ot[1]!==null);var rt=me.document.elementFromPoint(tt.clientX,tt.clientY)||null;rt!==null&&rt.shadowRoot!==void 0&&rt.shadowRoot!==null&&(rt=rt.shadowRoot.elementFromPoint(tt.clientX,tt.clientY));var at=a,ut=tt;rt&&rt.H&&(ut=tt,at=rt.H),ot.targetDiagram=at,nd(a,ut,ot),ot.targetObject=null,a.doMouseMove(),Xa(ot,tt)}}},a.fk=function(tt){if(a.isEnabled){a.Vk=!0;var ot=tt.pointerType==="touch"||tt.pointerType==="pen",rt=a.Yt;if(ot&&a.qu)delete rt[tt.pointerId],tt.preventDefault();else if(rt=a.oj,rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType)rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null);else{rt[0]=null,rt=gg(a,tt,!1,!0,!0,!1);var at=me.document.elementFromPoint(tt.clientX,tt.clientY)||null;at!==null&&at.shadowRoot!==void 0&&at.shadowRoot!==null&&(at=at.shadowRoot.elementFromPoint(tt.clientX,tt.clientY)),at!==null&&at.H instanceof te&&at.H!==a&&nd(at.H,tt,rt),at===null&&(at=tt.target),nd(a,tt,rt),rt.clickCount=a.yq,rt.targetDiagram=cg(tt,at),rt.targetObject=null,a.doMouseUp(),Xa(rt,tt),ot&&(a.wq=!1)}}},a.ek=function(tt){if(a.isEnabled){a.Vk=!1;var ot=a.Yt;ot[tt.pointerId]&&delete ot[tt.pointerId],ot=a.oj,ot[0]!==null&&ot[0].pointerId===tt.pointerId&&(ot[0]=null),ot[1]!==null&&ot[1].pointerId===tt.pointerId&&(ot[1]=null),tt.pointerType!=="touch"&&tt.pointerType!=="pen"&&(tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())}},a.ck=function(tt){var ot=a.oj;ot[0]!==null&&ot[0].pointerId===tt.pointerId?(ot[0]=null,a.wq=!1):ot[1]!==null&&ot[1].pointerId===tt.pointerId&&(ot[1]=null)},a.Vp=E.Z["d"+ef[1]+ef[2]+"wI"+ud.slice(1,5)]["b"+Ax.slice(1,y)](E.Z,tf,y,y),E.Vc(!0),tv(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}te.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},te.prototype.removeEventListener=function(a,y,x,E){a.removeEventListener(y,x,{capture:E})};function tv(a){var y=a.ta.Oa;y instanceof HTMLCanvasElement||(y=a.div),a.addEventListener(y,"pointerdown",a.ui,!1),a.addEventListener(y,"pointermove",a.dk,!1),a.addEventListener(y,"pointerup",a.fk,!1),a.addEventListener(y,"pointerout",a.ek,!1),a.addEventListener(y,"pointercancel",a.ck,!1),a.addEventListener(y,"pointerenter",a.bz,!1),a.addEventListener(y,"pointerleave",a.cz,!1),a.addEventListener(y,"wheel",a.$j,!1),a.addEventListener(y,"keydown",a.Qz,!1),a.addEventListener(y,"keyup",a.Rz,!1),a.addEventListener(y,"blur",a.Ny,!1),a.addEventListener(y,"focus",a.Oy,!1),a.addEventListener(y,"selectstart",function(x){return x.preventDefault(),!1},!1),a.addEventListener(y,"contextmenu",function(x){return x.preventDefault(),!1},!1),a.addEventListener(me,"resize",a.Ov,!1)}function ks(a){30<a.Sq&&(a.Yh=1)}function Kd(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),$n&&$n.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}te.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:me.devicePixelRatio||1},te.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},te.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},te.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},te.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},te.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},te.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},te.prototype.doFocus=function(){this.focus()},te.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=me.scrollX||me.pageXOffset,y=me.scrollY||me.pageYOffset;this.ta.focus(),me.scrollTo(a,y)}},te.prototype.Oy=function(){this.H.R("GainedFocus")},te.prototype.Ny=function(){this.H.R("LostFocus")};function hg(a){if(a.ta!==null){var y=a.Ka;if(y!==null&&y.clientWidth!==0&&y.clientHeight!==0){a.Gw||a.setScrollWidth();var x=a.gf?a.Db:0,E=a.Be?a.Db:0,b=a.Mb;a.Mb=a.computePixelRatio(),a.Mb!==b&&(a.pn=!0,a.$b()),(y.clientWidth!==a.Aa+x||y.clientHeight!==a.ya+E)&&(a.Ee=!0,a.Fc=!0,y=a.layout,y!==null&&y.isViewportSized&&a.autoScale===$r&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Xp(a){var y=new kr;y.name="Background",a.Al(y),y=new kr,y.name="",a.Al(y),y=new kr,y.name="Foreground",a.Al(y),y=new kr,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new kr,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new kr,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function Zp(a){var y=new ze(ze.Grid);y.name="GRID";var x=new ei;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new ei,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new ei,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new ei,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new ei,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new ei,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Ln,x.add(y),x.layerName="Grid",x.zOrder=0,x.isInDocumentBounds=!1,x.isAnimated=!1,x.pickable=!1,x.locationObjectName="GRID",a.add(x),a.partManager.parts.remove(x),y.visible=!1,y}function Jp(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):rd(this.H)}function Qp(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):rd(this.H)}te.prototype.kx=function(a){if(this.ta!==null){var y=this.ku,x=this.hu;this.qr=!0;var E=this.documentBounds,b=this.viewportBounds,z=this.rj,tt=E.x-z.left,ot=E.y-z.top,rt=E.width+z.left+z.right,at=E.height+z.top+z.bottom,ut=E.right+z.right;z=E.bottom+z.bottom;var ct=b.x;E=b.y;var mt=b.width,yt=b.height,St=b.right,Mt=b.bottom;b=this.scale;var Ot=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Ot=Ot+a.scrollWidth-a.clientWidth;break;case"reverse":Ot=a.scrollWidth-Ot-a.clientWidth}var bt=Ot;mt<rt||yt<at?(Ot=At.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==bt&&(Ot.x=bt/b+tt,this.ju=bt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Ot.y=a.scrollTop/b+ot,this.lu=a.scrollTop),this.position=Ot,At.free(Ot),this.Ee=this.qr=!1):(Ot=At.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ct&&(this.position=Ot.h(bt+tt,this.position.y)),ut>St&&(this.position=Ot.h(-(y.scrollWidth-this.Aa)+bt-this.Aa/b+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(ot<E&&(this.position=Ot.h(this.position.x,a.scrollTop+ot)),z>Mt&&(this.position=Ot.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),At.free(Ot),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,ut=E.right,St=b.right,z=E.bottom,Mt=b.bottom,tt=E.x,ct=b.x,ot=E.y,E=b.y,mt>=rt&&tt>=ct&&ut<=St&&(x.style.width="1px"),yt>=at&&ot>=E&&z<=Mt&&(x.style.height="1px"))}},te.prototype.computeBounds=function(a){return a===void 0&&(a=new pe),_r(this),dg(this,a)};function dg(a,y){if(a.fixedBounds.w())return y.assign(a.fixedBounds),y.Co(a.yb),y;for(var x=!0,E=a.Wa.s,b=E.length,z=0;z<b;z++){var tt=E[z];if(tt.visible&&tt.isInDocumentBounds){tt=tt.Pa.s;for(var ot=tt.length,rt=0;rt<ot;rt++){var at=tt[rt];at.isInDocumentBounds&&at.isVisible()&&(at=at.actualBounds,at.w()&&(x?(x=!1,y.assign(at)):y.ed(at)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}te.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(jn(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof Ue||(b.Va(),x===null?x=b.actualBounds.copy():x.ed(b.actualBounds))}else for(a=a.iterator;a.next();)E=a.value,!y&&E instanceof Ue||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new pe(NaN,NaN,0,0):x};function Ia(a,y){if((y||a.hf)&&!a.vb&&a.ta!==null&&a.documentBounds.w()){if(a.vb=!0,y){var x=a.initialPosition;if(x.w()){a.vb=!1,a.position=x;return}x=At.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=pe.allocAt(0,0,E.width,E.height);var b=At.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,pe.free(E),At.free(b),At.free(x)}x=a.yh,y&&a.Fg!==$r&&(x=a.Fg);var z=x!==$r?ed(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var tt=a.ya/z,ot=a.zk,rt=a.pq;y&&!ot.sb()&&(rt.sb()||rt.Xb())&&(ot=rt.Xb()?Mi:rt),fg(a,a.documentBounds,b,tt,ot,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,Jt.B(z.x,x)&&Jt.B(z.y,E)&&Jt.B(z.width,b)&&Jt.B(z.height,tt)||a.onViewportBoundsChanged(new pe(x,E,b,tt),z,y,!1)}}function ed(a,y){var x=a.Pp;if(a.ta===null)return x;a.Va();var E=a.documentBounds;if(!E.w())return x;var b=E.width;E=E.height;var z=a.Aa+(a.gf?a.Db:0),tt=a.ya+(a.Be?a.Db:0),ot=z/b,rt=tt/E;return y===ua?(y=Math.min(rt,ot),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===Ch?(y=rt>ot?(tt-a.Db)/E:(z-a.Db)/b,y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):a.scale}te.prototype.zoomToFit=function(){var a=this.sj;this.sj=Ou,this.scale=ed(this,ua),a!==Ou&&(Ia(this,!1),fg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},xt=te.prototype,xt.BA=function(a,y){y===void 0&&(y=ua);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===ua||y===Ch)if(isNaN(x))b=this.viewportBounds.height*this.scale/E;else if(isNaN(E))b=this.viewportBounds.width*this.scale/x;else{b=this.Aa;var z=this.ya;b=y===Ch?z/E>b/x?(z-(this.Be?this.Db:0))/E:(b-(this.gf?this.Db:0))/x:Math.min(z/E,b/x)}this.scale=b,this.position=new At(a.x,a.y)}},xt.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new At(x.x+(a.x*x.width+a.offsetX)-(y.x*E.width-y.offsetX),x.y+(a.y*x.height+a.offsetY)-(y.y*E.height-y.offsetY))},xt.zz=function(a){if(a instanceof Xt){this.eq=a;var y=At.alloc();this.fq=this.op(a.ga(Sr,y)),At.free(y)}else this.eq=null,this.fq=lo};function fg(a,y,x,E,b,z){var tt=At.allocAt(a.pa.x,a.pa.y),ot=tt.x,rt=tt.y;if(a.eq!==null){var at=At.alloc();at=a.eq.ga(Sr,at),ot=at.x-a.fq.x/a.scale,rt=at.y-a.fq.y/a.scale,b=hr,At.free(at)}(z||a.scrollMode===Ou)&&(b.sb()&&(x>y.width&&(ot=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(rt=y.y+(b.y*y.height+b.offsetY)-(b.y*E-b.offsetY))),b=a.rj,z=x-y.width,x<y.width+b.left+b.right?(ot=Math.min(ot+x/2,y.right+Math.max(z,b.right)-x/2),ot=Math.max(ot,y.left-Math.max(z,b.left)+x/2),ot-=x/2):ot>y.left?ot=y.left:ot<y.right-x&&(ot=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(rt=Math.min(rt+E/2,y.bottom+Math.max(x,b.bottom)-E/2),rt=Math.max(rt,y.top-Math.max(x,b.top)+E/2),rt-=E/2):rt>y.top?rt=y.top:rt<y.bottom-E&&(rt=y.bottom-E)),tt.x=isFinite(ot)?ot:-a.yb.left,tt.y=isFinite(rt)?rt:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,tt),tt.x=y.x,tt.y=y.y),Gp(a.Yd,a.pa,tt),a.pa.h(tt.x,tt.y),Pl(a),At.free(tt)}xt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=Dl(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof Ln)return a}else if(a=Dl(this,a,function(x){return x.part}),a instanceof Ln)return a;return null},xt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),_r(this);for(var E=this.Wa.iteratorBackwards;E.next();){var b=E.value;if(b.visible&&(b=b.ic(a,y,x),b!==null))return b}return null};function Dl(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),_r(a),a=a.Wa.iteratorBackwards;a.next();){var b=a.value;if(b.visible&&!b.isTemporary&&(b=b.ic(y,x,E),b!==null))return b}return null}xt.lz=function(a,y,x){return y===void 0&&(y=!0),Xd(this,a,function(E){return E.part},y?function(E){return E instanceof Ln&&E.canSelect()}:null,x)};function Xd(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof be||b instanceof ke||(b=new ke),_r(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}xt.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof be||E instanceof ke||(E=new ke),_r(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},xt.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),Xf(this,a,function(b){return b instanceof Ln&&(!x||b.canSelect())},y,E)},xt.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof be||b instanceof ke||(b=new ke),_r(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,E,b)}return b},xt.Nu=function(a,y,x,E,b,z){var tt=new ke;_r(this);for(var ot=this.Wa.iteratorBackwards;ot.next();){var rt=ot.value;rt.visible&&rt.Nu(a,y,x,E,tt,b,z)}return tt};function Xf(a,y,x,E,b){var z=null;for(z===void 0&&(z=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof be||b instanceof ke||(b=new ke),_r(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,E,b)}return b}xt.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),Zd(this,a,y,function(z){return z instanceof Ln&&(!E||z.canSelect())},x,b)},xt.og=function(a,y,x,E,b,z){x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof be||b instanceof ke)&&(z=b),b=!0),z instanceof be||z instanceof ke||(z=new ke),_r(this);for(var tt=this.Wa.iteratorBackwards;tt.next();){var ot=tt.value;ot.visible&&ot.og(a,y,x,E,b,z)}return z};function Zd(a,y,x,E,b,z){var tt=null;for(tt===void 0&&(tt=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof be||b instanceof ke)&&(z=b),b=!0),z instanceof be||z instanceof ke||(z=new ke),_r(a),a=a.Wa.iteratorBackwards;a.next();){var ot=a.value;ot.visible&&!ot.isTemporary&&ot.og(y,x,tt,E,b,z)}return z}te.prototype.acceptEvent=function(a){return wa(this,a,a instanceof MouseEvent)};function wa(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?nd(a,y,E):(E.viewPoint=a.Qg.viewPoint,E.documentPoint=a.Qg.documentPoint),a=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),E.modifiers=a,E.button=y.button,y.buttons!==void 0&&(E.buttons=y.buttons),kn&&y.button===0&&y.ctrlKey&&(E.button=2),E.down=!1,E.up=!1,E.clickCount=1,E.delta=0,E.handled=!1,E.bubbles=!1,E.timestamp=y.timeStamp,E.isMultiTouch=!1,E.targetDiagram=cg(y,y.target),E.targetObject=null,E}function cg(a,y){return y===null?null:(y=y.H)?y:((y=a.path)||typeof a.composedPath!="function"||(y=a.composedPath()),y&&y[0]&&y[0].H?y[0].H:null)}function gg(a,y,x,E,b,z){var tt=a.Qg;return a.Qg=a.cj,a.cj=tt,tt.diagram=a,tt.clickCount=1,a=tt.delta=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),tt.modifiers=a,tt.event=y,tt.timestamp=y.timeStamp,tt.button=y.button,tt.buttons=y.buttons,kn&&y.button===0&&y.ctrlKey&&(tt.button=2),tt.down=x,tt.up=E,tt.handled=!1,tt.bubbles=b,tt.isMultiTouch=z,tt}function Xa(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}te.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=wa(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.down=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del";break;case 48:x.key="0";break;case 187:case 61:case 107:x.key="Add";break;case 189:case 173:case 109:x.key="Subtract";break;case 27:x.key="Esc"}return y.doKeyDown(),Xa(x,a)},te.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=wa(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.up=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del"}return y.doKeyUp(),Xa(x,a)},te.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=wa(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),Xa(x,a)},te.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=wa(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),Xa(x,a)},te.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new At(0,0);var x=y.getBoundingClientRect();return y=a.clientX-this.Aa/x.width*x.left,a=a.clientY-this.ya/x.height*x.top,this.Ab!==null?Pi(new At(y,a),this.Ab):new At(y,a)};function nd(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,tt=0,ot=0;E!==null&&(E=E.getBoundingClientRect(),tt=y.clientX-b/E.width*E.left,ot=y.clientY-z/E.height*E.top),x.viewPoint.h(tt,ot),a.Ab!==null?(y=At.allocAt(tt,ot),a.Ab.Cd(y),x.documentPoint.assign(y),At.free(y)):x.documentPoint.h(tt,ot)}function pg(a,y,x){if(a.oj[0]!==null){y=a.oj[y];var E=a.ta;E!==null&&(E=E.getBoundingClientRect(),x.h(y.clientX-a.Aa/E.width*E.left,y.clientY-a.ya/E.height*E.top))}}te.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function qp(a){a.ld||_r(a),a.Va()}te.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},xt=te.prototype,xt.Pz=function(){return this.kg},xt.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,Ca(this),this.hf=!1,this.du=new At(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&Ni(function(){E.ld=!1,Al(y,"Model"),a(E)},1)},xt.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;me.requestAnimationFrame(function(){y.kg&&y.bd()})}},xt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),Ca(this))};function yh(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||rd(a)||(y&&_r(a),x&&Ia(a,!1))}function Ca(a,y){if(!a.ld&&(a.kg=!1,a.Ka!==null||a.wo.w())){a.ld=!0;var x=a.animationManager,E=a.Xn;if(!x.isAnimating&&E.length!==0){for(var b=E.s,z=b.length,tt=0;tt<z;tt++){var ot=b[tt];nr(ot,!1),ot.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(rt){rt.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||hg(a),yh(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(xl(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),_r(a),z=!1,(!a.hf||a.xh)&&(a.hf?kg(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),kg(a,!1)),z=!0),a.Jk=!1,_r(a),a.ou||qp(a),yh(a,!0,!1),tt=!1,z?(x=pe.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,mg(a)),a.R("LayoutCompleted"),yh(a,!0,!1),pe.free(x)):x.Ok&&x.Qw&&(a.Fg!==$r?a.scale=ed(a,a.Fg):a.yh!==$r?a.scale=ed(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),Ia(a,!0)),z&&tt&&a.eb("Initial Layout"),_r(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function mg(a){if(a.Fg!==$r)a.scale=ed(a,a.Fg);else if(a.yh!==$r)a.scale=ed(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}Ia(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),xl(a)}function _r(a){if(a.De.count!==0&&(a.ld||!a.animationManager.isTicking)){for(var y=0;23>y;y++){var x=a.De.iterator;if(x===null||a.De.count===0)break;a.De=new ke,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof Jn&&E.U&65536&&(E.U=E.U^65536)})}}xt.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof Jn||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof Jn&&x.isVisible()&&Jd(this,x);for(a.reset();a.next();)x=a.value,x instanceof Ue&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x));for(a.reset();a.next();)x=a.value,x instanceof Ai&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function Jd(a,y){for(var x=Un(),E=Un(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof Jn?(da(z)||fs(z)||kh(z))&&Jd(a,z):z instanceof Ue?z.fromNode===y||z.toNode===y?E.push(z):x.push(z):(z.measure(1/0,1/0),z.arrange()))}for(a=x.length,b=0;b<a;b++)z=x[b],z.measure(1/0,1/0),z.arrange();for(_n(x),y.measure(1/0,1/0),y.arrange(),a=E.length,y=0;y<a;y++)x=E[y],x.measure(1/0,1/0),x.arrange();_n(E)}xt.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},xt.gc=function(a){if(this.Ka!==null){if(this.ta===null&&de("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){od(this);var x=this.Aa,E=this.ya;if(a.Gv.resize(x,E,x,E),x=this.Wa.s,E=x.length,this.Fd(x,E,this,this.viewportBounds),this.Fc||y.isAnimating){y=this.pa;var b=this.Ca,z=Math.round(y.x*b)/b,tt=Math.round(y.y*b)/b,ot=this.Ab;for(ot.reset(),b!==1&&ot.scale(b),y.x===0&&y.y===0||ot.translate(-z,-tt),a.ti=null,Xy(a,ot.m11,ot.m12,ot.m21,ot.m22,ot.dx,ot.dy),this.pb!==1&&(a.globalAlpha=this.pb),Bu(this,a),y=this.Mb,this.ta.context.setTransform(y,0,0,y,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya),y=0;y<E;y++)x[y].gc(a,this);a=!1,this.Yf?hd(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(ci.prototype.Cd=ci.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,od(this),this.Ka.style.opacity!=="0")){if(E=a!==this.ib,y=this.Wa.s,b=y.length,this.Fd(y,b,this,this.viewportBounds),E)a.Vc(!0),this.vd=!0;else if(!this.Fc&&!z.isAnimating)break t;z=this.Ab,z.reset(),tt=this.Mb,ot=this.pa;var rt=this.Ca,at=Math.round(ot.x*rt)/rt,ut=Math.round(ot.y*rt)/rt;for(rt!==1&&z.scale(rt),ot.x===0&&ot.y===0||z.translate(-at,-ut),a.setTransform(tt,0,0,tt,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),Bu(this,a),ot=0;ot<b;ot++)a.setTransform(tt,0,0,tt,0,0),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),a.yc(),y[ot].gc(a,this);if(y=!1,this.Yf?hd(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(ci.prototype.Cd=ci.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=$n&&$n.nx,x=this.zw,E||this.Yh===null){for(x[this.Tq]=y,this.Tq=(this.Tq+1)%x.length,b=y=0;b<x.length;b++)y+=x[b];this.Sq=y/x.length}if(this.pb!==1&&(a.globalAlpha=1),E)for(a.setTransform(1,0,0,1,0,0),E=0;E<x.length;E++)a.fillText(x[E].toString(),20,150+ +(20*E))}}};function Zf(a,y,x,E,b,z,tt,ot,rt,at){if(a.Ka!==null){a.ta===null&&de("No canvas specified"),tt===void 0&&(tt=null),ot===void 0&&(ot=null),rt===void 0&&(rt=!1),at===void 0&&(at=!1),od(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var ut=a.Ca;a.Ca=b;var ct=a.Wa.s,mt=ct.length;try{var yt=new pe(z.x,z.y,E.width/b,E.height/b),St=yt.copy();St.Co(x),xl(a,St),_r(a),a.Fd(ct,mt,a,yt),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),ot!==null&&ot!==""&&(y.fillStyle=ot,y.ox(0,0,E.width,E.height));var Mt=a.Mb;y.scale(Mt,Mt);var Ot=ci.alloc();Ot.reset(),Ot.translate(x.left,x.top),Ot.scale(b),z.x===0&&z.y===0||Ot.translate(-z.x,-z.y),y.setTransform(Ot.m11,Ot.m12,Ot.m21,Ot.m22,Ot.dx,Ot.dy),y.yc(),y instanceof qs&&Xy(y,Ot.m11,Ot.m12,Ot.m21,Ot.m22,Ot.dx,Ot.dy),ci.free(Ot),Bu(a,y),y.globalAlpha=a.pb;var bt=a.Qj("Grid");if(tt){var jt=new ke,Gt=tt.iterator;for(Gt.reset();Gt.next();){var Wt=Gt.value;Wt instanceof Ln&&(at||Wt.layer!==bt)&&(Wt.Gj(),jt.add(Wt))}for(at=0;at<mt;at++)Up(ct[at],y,a,jt,rt);jt.each(function($t){return $t.Gj()})}else for(jt=0;jt<mt;jt++){var Kt=ct[jt];Kt===bt?at&&Kt.gc(y,a,!0):Kt.gc(y,a,rt)}a.$i=!1,a.Yf&&hd(a.Yf,a)&&a.Vp()}finally{a.Ca=ut,a.ib.Vc(!0),a.vd=!0,a.Fd(ct,mt,a,a.viewportBounds),xl(a),a.ib instanceof qs&&(a.ib.Nj.PA(),a.redraw())}}}xt.Gf=function(a){return this.Rg[a]},xt.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},xt.Tx=function(){this.Rg=new Se,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(kn||Pe),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function Bu(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}xt.Ql=function(a){return this.on[a]},xt.sA=function(a,y){this.on[a]=y},xt.Sx=function(){this.on=new Se,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},xt.set=function(a){return Object.assign(this,a),this},xt.Du=function(a){return this.nm(a)},xt.nm=function(a){return id(this,a),this};function id(a,y){var x=a instanceof ze,E=a instanceof te,b;for(b in y){b===""&&de("Setting properties requires non-empty property names");var z=a,tt=b;if(x||E){var ot=b.indexOf(".");if(0<ot){var rt=b.substring(0,ot);x?z=a.fb(rt):(z=a[rt],z==null&&(z=a.toolManager[rt])),Ve(z)?tt=b.substr(ot+1):de("Unable to find object named: "+rt+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!Co(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&Co(a.toolManager,tt))z=a.toolManager;else if(E&&em(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof mn&&tt==="Changed"){a.Pe(y[tt]);continue}else de('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof Xt&&z.Vw(tt)}}xt.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new qe,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},xt.N=function(a){if(a===void 0)this.Fc=!0,this.$b();else{var y=this.viewportBounds;a.w()&&y.Yc(a)&&(this.Fc=!0,this.$b())}this.R("InvalidateDraw")},te.prototype.invalidateViewport=function(a,y){if(this.Fc!==!0)if(this.Fc=!0,this.nl==="svg")this.bd();else{var x=this.Gf("temporaryPixelRatio")===!0;if(this.Gf("viewportOptimizations")===!0&&this.scrollMode!==$d&&this.rj.hi(0,0,0,0)&&y.width===a.width&&y.height===a.height){var E=this.scale,b=Math.max(a.y,y.y),z=Math.min(a.y+a.height,y.y+y.height);if(0<Math.max(0,Math.min(a.x+a.width,y.x+y.width)-Math.max(a.x,y.x))*E&&0<Math.max(0,z-b)*E){if(!(this.ld||(this.kg=!1,this.Ka===null||(this.ld=!0,this.documentBounds.w()||(E=pe.alloc(),Lg(this,this.computeBounds(E)),pe.free(E)),E=this.ta,E===null||E instanceof wl)))){var tt=this.Mb;b=this.Aa*tt;var ot=this.ya*tt,rt=this.scale*tt;z=Math.round(Math.round(y.x*rt)-Math.round(a.x*rt)),y=Math.round(Math.round(y.y*rt)-Math.round(a.y*rt)),rt=this.jw,a=this.oy,rt.width!==b&&(rt.width=b),rt.height!==ot&&(rt.height=ot),a.clearRect(0,0,b,ot),rt=190*tt;var at=70*tt,ut=Math.max(z,0),ct=Math.max(y,0),mt=Math.floor(b-ut),yt=Math.floor(ot-ct);a.drawImage(E.Oa,ut,ct,mt,yt,0,0,mt,yt),hd(this.Yf,this)&&a.clearRect(0,0,rt,at),E=Un(),a=Un(),yt=Math.abs(z),mt=Math.abs(y);var St=ut===0?0:b-yt;ut=At.allocAt(St,0),yt=At.allocAt(yt+St,ot),a.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y)));var Mt=this.Ab;if(Mt.reset(),Mt.scale(tt,tt),this.Ca!==1&&Mt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&Mt.translate(-tt.x,-tt.y),Pi(ut,Mt),Pi(yt,Mt),E.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),St=ct===0?0:ot-mt,ut.h(0,St),yt.h(b,mt+St),a.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Pi(ut,Mt),Pi(yt,Mt),E.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),hd(this.Yf,this)&&(b=0<z?0:-z,ot=0<y?0:-y,ut.h(b,ot),yt.h(rt+b,at+ot),a.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Pi(ut,Mt),Pi(yt,Mt),E.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y)))),At.free(ut),At.free(yt),yh(this,!1,!0),this.Ka===null&&de("No div specified"),this.ta===null&&de("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(od(this),ot=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*ot,this.ya*ot),b.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,tt=this.Ca,rt=Math.round(z.x*tt)/tt,at=Math.round(z.y*tt)/tt,y=this.Ab,y.reset(),tt!==1&&y.scale(tt),z.x===0&&z.y===0||y.translate(-rt,-at),b.save(),b.beginPath(),z=a.length,tt=0;tt<z;tt++)rt=a[tt],rt.width!==0&&rt.height!==0&&b.rect(Math.floor(rt.x),Math.floor(rt.y),Math.ceil(rt.width),Math.ceil(rt.height));for(b.clip(),b.setTransform(ot,0,0,ot,0,0),b.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),b.yc(),y=this.Wa.s,z=y.length,this.Fd(y,z,this,this.viewportBounds),Bu(this,b),b.globalAlpha=this.pb,ot=0;ot<z;ot++)if(tt=y[ot],rt=E,tt.visible&&tt.pb!==0){at=iu(tt,b),ct=tt.Zq,ct.length=0,ut=this.scale,mt=pe.alloc(),yt=tt.Pa.s,Mt=yt.length,St=rt.length;for(var Ot=0;Ot<Mt;Ot++){var bt=yt[Ot],jt=vd(bt,bt.actualBounds);t:{for(var Gt=2/ut,Wt=4/ut,Kt=0;Kt<St;Kt++){var $t=rt[Kt];if($t.width!==0&&$t.height!==0&&jt.Vu($t.x-Gt,$t.y-Gt,$t.width+Wt,$t.height+Wt)){jt=!0;break t}}jt=!1}jt&&tt.Oj(b,bt,this,ct,ut,mt,!0)}pe.free(mt),b.globalAlpha=at}b.restore(),b.Vc(!0),this.Yf&&hd(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}_n(E),_n(a),this.ld=!1}}else this.bd();x&&(ks(this),this.bd(),Kd(this,!0))}else x?(ks(this),this.bd(),Kd(this,!0)):this.bd()}};function od(a){a.pn!==!1&&(a.pn=!1,vg(a,a.Aa,a.ya))}function vg(a,y,x){Pl(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function rd(a){var y=a.ta;if(y===null||a.wo.w())return!0;var x=a.Aa,E=a.ya,b=a.Ka,z=!1,tt=a.gf?a.Db:0,ot=a.Be?a.Db:0,rt=b.clientWidth||x+tt,at=b.clientHeight||E+ot,ut=a.viewportBounds;b=ut.x;var ct=ut.y,mt=ut.width,yt=ut.height;if((rt!==x+tt||at!==E+ot)&&(a.gf=!1,a.Be=!1,ot=tt=0,a.Aa=rt,a.ya=at,z=a.pn=!0,Pl(a)),!a.hf||!a.viewportBounds.w())return!0;var St=a.ku,Mt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Ot=a.documentBounds,bt=0,jt=0,Gt=0,Wt=0,Kt=ut.width,$t=ut.height,Qe=a.rj;a.contentAlignment.sb()?(Ot.width>Kt&&(bt=Qe.left,jt=Qe.right),Ot.height>$t&&(Gt=Qe.top,Wt=Qe.bottom)):(bt=Qe.left,jt=Qe.right,Gt=Qe.top,Wt=Qe.bottom);var dn=Ot.width+bt+jt,rn=Ot.height+Gt+Wt;Qe=a.scale;var We=dn>rt/Qe,Ee=rn>at/Qe;if(!(z||a.gf||a.Be||We||Ee))return!0;bt=Ot.x-bt,rt=ut.x,jt=Ot.right+jt,at=ut.right+tt,Gt=Ot.y-Gt;var Zn=ut.y;Ot=Ot.bottom+Wt,ut=ut.bottom+ot;var zn="1px";if(Wt="1px",a.scrollMode===Ou&&(We||Ee)&&(We&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(We=1,bt+1<rt&&(We=Math.max((rt-bt)*Qe+a.Aa,We)),jt>at+1&&(We=Math.max((jt-at)*Qe+a.Aa,We)),Kt+tt+1<dn&&(We=Math.max((dn-Kt)*Qe+a.Aa,We)),zn=We.toString()+"px"),Ee&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(We=1,Gt+1<Zn&&(We=Math.max((Zn-Gt)*Qe+a.ya,We)),Ot>ut+1&&(We=Math.max((Ot-ut)*Qe+a.ya,We)),$t+ot+1<rn&&(We=Math.max((rn-$t)*Qe+a.ya,We)),Wt=We.toString()+"px")),We=zn!=="1px",Ee=Wt!=="1px",We&&Ee||!We&&!Ee||(Ee&&(at-=a.Db),We&&(ut-=a.Db),dn<Kt+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,bt+1<rt&&(tt=Math.max((rt-bt)*Qe+a.Aa,tt)),jt>at+1&&(tt=Math.max((jt-at)*Qe+a.Aa,tt)),Kt+1<dn&&(tt=Math.max((dn-Kt)*Qe+a.Aa,tt)),zn=tt.toString()+"px"),We=zn!=="1px",tt=a.ya,We!==a.Be&&(tt=We?a.ya-a.Db:a.ya+a.Db),rn<$t+ot||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(ot=1,Gt+1<Zn&&(ot=Math.max((Zn-Gt)*Qe+tt,ot)),Ot>ut+1&&(ot=Math.max((Ot-ut)*Qe+tt,ot)),$t+1<rn&&(ot=Math.max((rn-$t)*Qe+tt,ot)),Wt=ot.toString()+"px"),Ee=Wt!=="1px"),a.qr&&We===a.Be&&Ee===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(We!==a.Be&&(zn==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=We,Mt.style.width=zn,Ee!==a.gf&&(Wt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(ot=At.alloc(),Ee?(y.style.left=a.Db+"px",a.position=ot.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=ot.h(a.pa.x-a.Db/a.scale,a.pa.y)),At.free(ot))),z&&Pl(a),a.gf=Ee,Mt.style.height=Wt,a.gu=!0,z&&(a.pn=!0),y=St.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Kt+1<dn?y=(a.position.x-bt)*Qe:bt+1<rt?y=St.scrollWidth-St.clientWidth:jt>at+1&&(y=a.position.x*Qe)),a.tn)switch(a.bu){case"negative":y=-(St.scrollWidth-y-St.clientWidth);break;case"reverse":y=St.scrollWidth-y-St.clientWidth}return St.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&($t+1<rn?St.scrollTop=(a.position.y-Gt)*Qe:Gt+1<Zn?St.scrollTop=St.scrollHeight-St.clientHeight:Ot>ut+1&&(St.scrollTop=a.position.y*Qe)),rt=a.Aa,at=a.ya,St.style.width=rt+(a.gf?a.Db:0)+"px",St.style.height=at+(a.Be?a.Db:0)+"px",x!==rt||E!==at||a.animationManager.zb?(x=pe.allocAt(b,ct,mt,yt),a.onViewportBoundsChanged(x,a.viewportBounds,Qe,z),pe.free(x),!1):!0}xt=te.prototype,xt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&de("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+y.toString()),y=this.Qj(a.layerName),y===null&&(y=this.Qj("")),y===null&&de('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==y)){var x=y.oi(99999999,a,a.diagram===this);0<=x&&this.cb(Ko,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},xt.oi=function(a){this.partManager.oi(a);var y=this;gd(a,function(x){sd(y,x)}),(a instanceof Ai||a instanceof Jn&&a.placeholder!==null)&&a.v(),a.data!==null&&gd(a,function(x){ay(y.partManager,x)}),fs(a)!==!0&&kh(a)!==!0||this.De.add(a),R1(a,!0,this),z1(a)?(a.actualBounds.w()&&this.N(vd(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(vd(a,a.actualBounds)),this.$b()},xt.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&gd(a,function(x){ly(y.partManager,x,y)}),this.De.remove(a),z1(a)?(a.actualBounds.w()&&this.N(vd(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(vd(a,a.actualBounds)),this.$b()},xt.remove=function(a){yg(this,a,!0)};function yg(a,y,x){var E=y.layer;E!==null&&E.diagram===a&&(y.isSelected=!1,y.isHighlighted=!1,y.C(2),x&&y.Lj(),x=E.pc(-1,y,!1),0<=x&&a.cb(ar,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}xt.Is=function(a,y){if(y===void 0&&(y=!1),jn(a))for(var x=a.length,E=0;E<x;E++){var b=a[E];y&&!b.canDelete()||this.remove(b)}else for(x=new ke,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},xt.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},te.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=Jf(this)),this.toolManager!==null){var b=new qe;if(a!==null)if(jn(a))for(var z=0;z<a.length;z++)Ol(this,b,a[z],x,E);else for(a=a.iterator;a.next();)Ol(this,b,a.value,x,E);else{for(a=this.parts;a.next();)Ol(this,b,a.value,x,E);for(a=this.nodes;a.next();)Ol(this,b,a.value,x,E);for(a=this.links;a.next();)Ol(this,b,a.value,x,E)}Sh(this,b,y,E,x)}};function Ol(a,y,x,E,b,z){if(!y.contains(x)&&(z===void 0&&(z=!1),!E||z||x.canMove()||x.canCopy()))if(b===void 0&&(b=Jf(a)),x instanceof tn){if(y.add(x,a.Pd(b,x,x.location)),x instanceof Jn&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)Ol(a,y,z.value,E,b,b.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var tt=z.value;if(!y.contains(tt)){var ot=tt.fromNode,rt=tt.toNode;ot!==null&&y.contains(ot)&&rt!==null&&y.contains(rt)&&Ol(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)Ol(a,y,x.value,E,b)}else if(x instanceof Ue)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)Ol(a,y,x.value,E,b);else x instanceof Ai||y.add(x,a.Pd(b,x,x.location))}function Sh(a,y,x,E,b){if(y!==null&&y.count!==0){var z=At.alloc(),tt=At.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||qf(a,y);for(var ot=Un(),rt=Un(),at=y.iterator,ut=At.alloc();at.next();){var ct=at.key,mt=at.value;if(ct.Zc()){var yt=Sg(a,ct,y);yt!==null?ot.push(new it(ct,mt,yt)):(!b||ct.canMove())&&(yt=mt.point,z.assign(yt),a.computeMove(ct,z.add(tt),E,ut),ct.location=ut,mt.shifted===void 0&&(mt.shifted=new At),mt.shifted.assign(ut.re(yt)))}else at.key instanceof Ue&&rt.push(at.sa)}for(At.free(ut),b=ot.length,at=0;at<b;at++)ct=ot[at],z.assign(ct.info.point),ct.Su.shifted===void 0&&(ct.Su.shifted=new At),ct.node.location=z.add(ct.Su.shifted);for(b=At.alloc(),at=At.alloc(),ct=rt.length,mt=0;mt<ct;mt++){var St=rt[mt];if(yt=St.key,yt instanceof Ue)if(yt.suspendsRouting){yt.Tg=null,ut=yt.fromNode;var Mt=yt.toNode;if(a.draggedLink!==null&&E.dragsLink)if(Mt=St.value.point,yt.dragComputation===null)y.add(yt,a.Pd(E,yt,tt)),Wu(yt,tt.x-Mt.x,tt.y-Mt.y);else{St=At.allocAt(0,0),(ut=yt.i(0))&&ut.w()&&St.assign(ut);var Ot=ut=At.alloc().assign(St).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Ot=At.alloc(),Qf(a,yt,ut,Ot,E)),ut.assign(yt.dragComputation(yt,ut,Ot)).re(St),y.add(yt,a.Pd(E,yt,ut)),Wu(yt,ut.x-Mt.x,ut.y-Mt.y),At.free(St),At.free(ut),Ot!==ut&&At.free(Ot)}else ut!==null&&(b.assign(ut.location),Ot=y.I(ut),Ot!==null&&b.re(Ot.point)),Mt!==null&&(at.assign(Mt.location),Ot=y.I(Mt),Ot!==null&&at.re(Ot.point)),ut!==null&&Mt!==null?b.Xa(at)?(ut=St.value.point,Mt=z,Mt.assign(b),Mt.re(ut),y.add(yt,a.Pd(E,yt,b)),Wu(yt,Mt.x,Mt.y)):(yt.suspendsRouting=!1,yt.bb()):(St=St.value.point,ut=ut!==null?b:Mt!==null?at:tt,y.add(yt,a.Pd(E,yt,ut)),Wu(yt,ut.x-St.x,ut.y-St.y))}else(yt.fromNode===null||yt.toNode===null)&&(ut=St.value.point,y.add(yt,a.Pd(E,yt,tt)),Wu(yt,tt.x-ut.x,tt.y-ut.y))}At.free(z),At.free(tt),At.free(b),At.free(at),_n(ot),_n(rt),x||(_r(a),xh(a,y))}}te.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new At),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=At.alloc(),Qf(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;var tt=a.minLocation,ot=tt.x;isNaN(ot)&&(ot=z?Math.round(1e3*a.location.x)/1e3:a.location.x),tt=tt.y,isNaN(tt)&&(tt=z?Math.round(1e3*a.location.y)/1e3:a.location.y);var rt=a.maxLocation,at=rt.x;return isNaN(at)&&(at=z?Math.round(1e3*a.location.x)/1e3:a.location.x),rt=rt.y,isNaN(rt)&&(rt=z?Math.round(1e3*a.location.y)/1e3:a.location.y),E.h(Math.max(ot,Math.min(x.x,at)),Math.max(tt,Math.min(x.y,rt))),b!==y&&At.free(b),E};function Jf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function Qf(a,y,x,E,b){if(b===void 0&&(b=Jf(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var tt=b.gridSnapOrigin,ot=tt.x;if(tt=tt.y,b=b.gridSnapCellSpot,z!==null){var rt=z.gridCellSize;isNaN(a)&&(a=rt.width),isNaN(y)&&(y=rt.height),z=z.gridOrigin,isNaN(ot)&&(ot=z.x),isNaN(tt)&&(tt=z.y)}z=At.allocAt(0,0),z.yi(0,0,a,y,b),Jt.No(x.x,x.y,ot+z.x,tt+z.y,a,y,E),At.free(z)}}function qf(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof Ue&&(y.suspendsRouting=!0)}function xh(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof Ue&&(x.suspendsRouting=!1,Kv(x)&&x.bb())}a.Mr=!1}}function Sg(a,y,x){return y=y.containingGroup,y!==null&&(a=Sg(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}xt=te.prototype,xt.Pd=function(a,y,x){if(x===void 0)return new ou(An);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new ou(new At(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new ou(x.copy())};function xg(a,y,x){if(y.diagram!==null&&y.diagram!==a&&de("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&de("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&de("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&de("Cannot move a Layer before or after itself: "+y)),y.diagram!==a){y=y.name,a=a.Wa,x=a.count;for(var E=0;E<x;E++)a.M(E).name===y&&de("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}xt.Al=function(a){xg(this,a,null),a.Xe(this);var y=this.Wa,x=y.count-1;if(!a.isTemporary)for(;0<=x&&y.M(x).isTemporary;)x--;return y.Gb(x+1,a),this.cc!==null&&this.cb(Ko,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},xt.Ww=function(a,y){xg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(ar,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z,a);break}return this.cc!==null&&this.cb(Ko,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},xt.Cy=function(a,y){xg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(ar,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z+1,a);break}return this.cc!==null&&this.cb(Ko,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},xt.kA=function(a){if(a.diagram!==this&&de("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram),a.name!==""){var y=this.Wa,x=y.indexOf(a);if(y.remove(a)){for(y=a.Pa.copy().iterator;y.next();){var E=y.value,b=E.layerName;b!==a.name?E.layerName=b:E.layerName=""}this.cc!==null&&this.cb(ar,"layers",this,a,null,x,null),this.N(),this.Ya()}}},xt.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},xt.Yw=function(a){return this.pf===null&&(this.pf=new be),this.pf.add(a),this.model.Pe(a),this},xt.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},xt.Pe=function(a){return this.zg===null&&(this.zg=new be),this.zg.add(a),this},xt.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},xt.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==Js&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},xt.cb=function(a,y,x,E,b,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var ot=new No;ot.diagram=this,ot.change=a,ot.propertyName=y,ot.object=x,ot.oldValue=E,ot.oldParam=z,ot.newValue=b,ot.newParam=tt,this.ds(ot)},xt.g=function(a,y,x,E,b){this.cb(Eo,a,this,y,x,E,b)},te.prototype.changeState=function(a,y){if(a!==null&&a.diagram===this){var x=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var E=a.change;if(E===Eo){var b=a.object;if(So(b,a.propertyName,a.I(y)),b instanceof Xt){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===Ko){var tt=a.object,ot=a.newParam,rt=a.newValue;if(tt instanceof ze)if(typeof ot=="number"&&rt instanceof Xt){y?tt.pc(ot):tt.Gb(ot,rt);var at=tt.part;at!==null&&at.Wb()}else typeof ot=="number"&&rt instanceof ir&&(rt.isRow?h1(tt,ot,y?void 0:rt):d1(tt,ot,y?void 0:rt));else if(tt instanceof kr){var ut=a.oldParam===!0;typeof ot=="number"&&rt instanceof Ln&&(y?(rt.isSelected=!1,rt.isHighlighted=!1,rt.Wb(),tt.pc(ut?ot:-1,rt,ut)):tt.oi(ot,rt,ut))}else tt instanceof te?typeof ot=="number"&&rt instanceof kr&&(y?this.Wa.mb(ot):(rt.Xe(this),this.Wa.Gb(ot,rt))):de("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===ar){var ct=a.object,mt=a.oldParam,yt=a.oldValue;if(ct instanceof ze)typeof mt=="number"&&yt instanceof Xt?y?ct.Gb(mt,yt):ct.pc(mt):typeof mt=="number"&&yt instanceof ir&&(yt.isRow?h1(ct,mt,y?yt:void 0):d1(ct,mt,y?yt:void 0));else if(ct instanceof kr){var St=a.newParam===!0;typeof mt=="number"&&yt instanceof Ln&&(y?0>ct.Pa.indexOf(yt)&&ct.oi(mt,yt,St):(yt.isSelected=!1,yt.isHighlighted=!1,yt.Wb(),ct.pc(St?mt:-1,yt,St)))}else ct instanceof te?typeof mt=="number"&&yt instanceof kr&&(y?(yt.Xe(this),this.Wa.Gb(mt,yt)):this.Wa.mb(mt)):de("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==Js&&de("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},te.prototype.Ea=function(a){return this.undoManager.Ea(a)},te.prototype.eb=function(a){return this.undoManager.eb(a)},te.prototype.Kf=function(){return this.undoManager.Kf()},te.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},te.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},te.prototype.rp=function(){this.partManager.rp()};function Pg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Pl(a),a.N(),a.Ee=!0,E.zb&&(eu(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Pl(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,tt=a.ya,ot=a.zoomPoint.x,rt=a.zoomPoint.y,at=a.contentAlignment;isNaN(ot)&&(at.$c()?at.Hf(oh)?ot=0:at.Hf(Sa)&&(ot=z-1):ot=at.sb()?at.x*(z-1):z/2),isNaN(rt)&&(at.$c()?at.Hf(vu)?rt=0:at.Hf(ol)&&(rt=tt-1):rt=at.sb()?at.y*(tt-1):tt/2),a.scaleComputation===null||a.animationManager.defaultAnimation.isAnimating||(x=a.scaleComputation(a,x)),x<a.minScale&&(x=a.minScale),x>a.maxScale&&(x=a.maxScale),z=At.allocAt(a.pa.x+ot/y-ot/x,a.pa.y+rt/y-rt/x),a.position=z,At.free(z),a.Ca=x,Pl(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),Ia(a,!1),E.zb&&(eu(E)||E.ce.add(E.H,"scale",y,a.Ca))}}te.prototype.onViewportBoundsChanged=function(a,y,x,E){if(!a.D(y)){E===void 0&&(E=!1),E||(this.Ee=!0),this.vd=!0;var b=this.layout;b===null||!b.isViewportSized||this.autoScale!==$r||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof ko&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),Op(b,this)),this.vb||this.invalidateViewport(a,y),xl(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.canvasSize.width=Math.round(a.width*x),this.fc.canvasSize.height=Math.round(a.height*x),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=E,this.R("ViewportBoundsChanged",this.fc,a),this.isVirtualized&&this.links.each(function(z){z.isAvoiding&&z.actualBounds.Yc(y)&&z.bb()})}};function xl(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=Le.alloc(),b=1,z=1,tt=x.O.s,ot=tt.length,rt=0;rt<ot;rt++){var at=tt[rt],ut=Math.abs(at.interval);2>ut||(pv(at.figure)?z=z*ut/Jt.vx(z,ut):b=b*ut/Jt.vx(b,ut))}if(tt=x.gridCellSize,E.h(z*tt.width,b*tt.height),y!==void 0)b=y.width,z=y.height,a=y.x,tt=y.y;else{if(y=pe.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){pe.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,pe.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=At.alloc(),Jt.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),Le.free(E),x.part.location=y,At.free(y)}}te.prototype.clearSelection=function(a){a===void 0&&(a=!1);var y=this.selection;if(y.count!==0){a||this.R("ChangingSelection",y);for(var x=y.Fa(),E=x.length,b=0;b<E;b++)x[b].isSelected=!1;y.ka(),y.clear(),y.freeze(),a||this.R("ChangedSelection",y)}},te.prototype.select=function(a){a!==null&&a.diagram===this&&(!a.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),a.isSelected=!0,this.R("ChangedSelection",this.selection))},te.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),jn(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof Ln||de("Diagram.selectCollection given something that is not a Part: "+E),E.isSelected=!0}else for(a=a.iterator;a.next();)y=a.value,y instanceof Ln||de("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},te.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var y=a.Fa(),x=y.length,E=0;E<x;E++)y[E].isHighlighted=!1;a.ka(),a.clear(),a.freeze()}},xt=te.prototype,xt.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},xt.Jz=function(a){a=new ke().addAll(a);for(var y=this.highlighteds.copy().hp(a).iterator;y.next();)y.value.isHighlighted=!1;for(a=a.iterator;a.next();)y=a.value,y instanceof Ln||de("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},xt.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=At.alloc();if(a==="pixel")b=x;else if(a==="line")b=x*(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(a==="page")a=E?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,a!==0&&(b=x*Math.max(a-(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(a==="document"){b=this.documentBounds,x=this.viewportBounds,y==="up"?this.position=z.h(x.x,b.y):y==="left"?this.position=z.h(b.x,x.y):y==="down"?this.position=z.h(x.x,b.bottom-x.height):y==="right"&&(this.position=z.h(b.right-x.width,x.y)),At.free(z);return}de("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}b/=this.scale,x=this.position,y==="up"?this.position=z.h(x.x,x.y-b):y==="down"?this.position=z.h(x.x,x.y+b):y==="left"?this.position=z.h(x.x-b,x.y):y==="right"?this.position=z.h(x.x+b,x.y):de("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),At.free(z)},xt.tv=function(a){var y=this.viewportBounds;y.Re(a)||(a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a)},xt.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},xt.op=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),a.copy().transform(this.Ab)},xt.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,tt=y.m11,ot=y.m12,rt=y.m21,at=y.m22,ut=y.dx,ct=y.dy,mt=x*tt+E*rt+ut;y=x*ot+E*at+ct;var yt=b*tt+E*rt+ut;return a=b*ot+E*at+ct,E=x*tt+z*rt+ut,x=x*ot+z*at+ct,tt=b*tt+z*rt+ut,b=b*ot+z*at+ct,z=Math.min(mt,yt),mt=Math.max(mt,yt),yt=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),mt=Math.max(mt,E),yt=Math.min(yt,x),y=Math.max(y,x),z=Math.min(z,tt),mt=Math.max(mt,tt),yt=Math.min(yt,b),y=Math.max(y,b),new pe(z,yt,mt-z,y-yt)},xt.Ps=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),Pi(a.copy(),this.Ab)};function $p(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function wg(a){return a=oc.get(a),a!==null?new a:new Xi}te.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===Js&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(rt){return rt.diagram=b}),a.mouseMoveTools.each(function(rt){return rt.diagram=b}),a.mouseUpTools.each(function(rt){return rt.diagram=b}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else E==="StartingUndo"||E==="StartingRedo"?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc(),this.R("ChangingSelection",this.selection)):E==="StartedTransaction"&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc());else if(this.aa){this.aa=!1;try{if(a.modelChange===""&&x===Js){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),_r(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||Wf(z),E==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),E!=="CommittedTransaction"&&E!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){y.isModified=!1},1);var tt=a.isTransactionFinished;if(tt&&($p(this),this.As.clear(),_p(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var ot=this;Ni(function(){ot.currentTool.standardMouseOver(),ot.Rt=!1},10)}}}finally{this.aa=!0}}}};function sd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)Ph(a,y[E])}function Ph(a,y){if(y instanceof Ts){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof ke&&x.Bg.add(a);var E=y.Eg;if(E!==null&&E.sq===!0&&y.diagram!==null&&y.diagram.Xn.add(y),x.hn)if(x=x.getAttribute("src")||"",E=a.Og.I(x),E===null)E=[],E.push(y),a.Og.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}}function Cg(a,y){if(y instanceof Ts){var x=y.element;if(x!==null&&x instanceof HTMLImageElement&&x.hn){var E=x.getAttribute("src")||"",b=a.Og.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&(a.Og.remove(E),x.Fq&&x.removeEventListener("load",x.Fq),x.Yp&&x.removeEventListener("error",x.Yp),delete x.Fq,delete x.Yp,x.Bg instanceof ke&&x.Bg.remove(a),vc(E));break}}}}}te.prototype.Wd=function(){this.partManager.Wd()},te.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},te.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},te.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},te.prototype.Vb=function(a){return this.partManager.Vb(a)},te.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},xt=te.prototype,xt.Lc=function(a){return this.partManager.Lc(a)},xt.ii=function(a){return this.partManager.ii(a)},xt.Kc=function(a){return this.partManager.Kc(a)},xt.ms=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ms.apply(this.partManager,y instanceof Array?y:mi(vn(y)))},xt.ls=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ls.apply(this.partManager,y instanceof Array?y:mi(vn(y)))};function Pl(a){var y=a.pa,x=a.Ca;a.Rw.h(y.x,y.y,Math.max(a.Aa,0)/x,Math.max(a.ya,0)/x),a.vd=!0}function Lg(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),Ia(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}xt.Va=function(){if(this.Zi){var a=pe.alloc();Lg(this,this.computeBounds(a)),pe.free(a)}},xt.rz=function(){for(var a=new ke,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&a.add(x)}for(y=this.links;y.next();)x=y.value,x.isTopLevel&&a.add(x);return a.iterator},xt.qz=function(){return this.ai.iterator},xt.Uz=function(a){_r(this),a&&$f(this,!0),this.ld?kg(this,!1):(this.Jk=!0,Ca(this))};function $f(a,y){for(var x=a.ai.iterator;x.next();)tm(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function tm(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)tm(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function kg(a,y){if(a.xh&&!a.lt){var x=a.aa;a.aa=!0;var E=a.undoManager.transactionLevel,b=a.layout,z=a.animationManager;try{E===0&&(a.undoManager.isInternalTransaction=!0,a.Ea("Layout")),1>=E&&!z.defaultAnimation.isAnimating&&!z.zb&&(y||Al(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)Mg(a,tt.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),_r(a),b.isValidLayout=!0):a.xh=!0)}finally{y=a.undoManager.isInternalTransaction,E===0&&(a.eb("Layout"),a.undoManager.isInternalTransaction=!1),!y||E!==0&&E!==1||Wf(z),a.aa=x}}}function Mg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)Mg(a,b.value,x,E);b=y.layout,b===null||b.isValidLayout||(!x||b.isRealtime||E===0?(y.rh=!y.location.w(),b.doLayout(y),y.C(32),Jd(a,y),b.isValidLayout=!0):a.xh=!0)}}xt.yz=function(){for(var a=new be,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&x.kh()===null&&a.add(x)}return a.iterator};function ev(a){function y(b){var z=b.toLowerCase(),tt=new be;x.add(b,tt),x.add(z,tt),E.add(b,b),E.add(z,b)}var x=new qe,E=new qe;y("InitialAnimationStarting"),y("AnimationStarting"),y("AnimationFinished"),y("BackgroundSingleClicked"),y("BackgroundDoubleClicked"),y("BackgroundContextClicked"),y("ClipboardChanged"),y("ClipboardPasted"),y("DocumentBoundsChanged"),y("ExternalObjectsDropped"),y("GainedFocus"),y("InitialLayoutCompleted"),y("LayoutCompleted"),y("LinkDrawn"),y("LinkRelinked"),y("LinkReshaped"),y("LostFocus"),y("Modified"),y("ObjectSingleClicked"),y("ObjectDoubleClicked"),y("ObjectContextClicked"),y("PartCreated"),y("PartResized"),y("PartRotated"),y("SelectionMoved"),y("SelectionCopied"),y("SelectionDeleting"),y("SelectionDeleted"),y("SelectionGrouped"),y("SelectionUngrouped"),y("ChangingSelection"),y("ChangedSelection"),y("SubGraphCollapsed"),y("SubGraphExpanded"),y("TextEdited"),y("TreeCollapsed"),y("TreeExpanded"),y("ViewportBoundsChanged"),y("InvalidateDraw"),a.iw=x,a.hw=E}function em(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function tc(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;de("Unknown DiagramEvent name: "+y)}xt.Bj=function(a,y){return a=tc(this,a),a!==null&&a.add(y),this},xt.am=function(a,y){a=tc(this,a),a!==null&&a.remove(y)},xt.R=function(a,y,x){var E=tc(this,a),b=new Su;if(b.diagram=this,a=em(this,a),a!==null&&(b.name=a),y!==void 0&&(b.subject=y),x!==void 0&&(b.parameter=x),y=E.length,y===1)E.M(0)(b);else if(y!==0)for(E=E.Fa(),x=0;x<y;x++)(0,E[x])(b)};function ec(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}xt.Yj=function(a,y){return nc(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},te.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?dg(this,a):a.assign(this.documentBounds)};function nc(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new ep(a.avoidanceCellSize)),b.vs||b.group!==x||b.Yx!==E){if(b.Hx=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.width)),b.Ix=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.height)),x!==null&&(x=nm(a,x)),x===null){y=pe.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var tt=z.value,ot=tt.layer;ot!==null&&ot.visible&&!ot.isTemporary&&ic(a,tt,E,y)}pe.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=pe.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof tn&&ic(a,tt,E,y);pe.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&oS(b);return b}function nm(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?nm(a,y.containingGroup):null}function ic(a,y,x,E){if(y!==x&&y.isVisible()){if(y.avoidable&&!y.isLinkLabel){y=y.getAvoidableRect(E),a=a.Xh;var b=y.x,z=y.y;if(Cc(a,b,z))for(x=(z-a.Od)/a.sc|0,E=Math.min((b+y.width-a.Nd)/a.rc|0,a.di),y=Math.min((z+y.height-a.Od)/a.sc|0,a.ei),b=(b-a.Nd)/a.rc|0;b<=E;b++)if(z=a.ac[b],z.fill)z.fill(Vu,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=Vu}else if(y instanceof Jn)for(y=y.memberParts;y.next();)b=y.value,b instanceof tn&&ic(a,b,x,E)}}function Du(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}te.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():Eg(this)};function Eg(a){a.vk===-1&&(a.vk=Ni(function(){if(a.vk!==-1&&(a.ug(),a.lastInput.event!==null)){var y=a.computeAutoScrollPosition(a.wp);y.Xa(a.position)||(a.position=y,a.lastInput.documentPoint=a.Ps(a.wp),a.doMouseMove(),a.Zi=!0,y=pe.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Lg(a,y),pe.free(y),a.Fc=!0,a.bd(),Eg(a))}},a.vp))}te.prototype.ug=function(){this.vk!==-1&&(me.clearTimeout(this.vk),this.vk=-1)},te.prototype.computeAutoScrollPosition=function(a){var y=this.position,x=this.xp;if(0>=x.top&&0>=x.left&&0>=x.right&&0>=x.bottom)return y;var E=this.viewportBounds,b=this.scale;E=pe.allocAt(0,0,E.width*b,E.height*b);var z=At.allocAt(0,0);if(a.x>=E.x&&a.x<E.x+x.left&&this.allowHorizontalScroll){var tt=Math.max(this.scrollHorizontalLineChange,1);tt|=0,z.x-=tt,a.x<E.x+x.left/2&&(z.x-=tt),a.x<E.x+x.left/4&&(z.x-=4*tt)}else a.x<=E.x+E.width&&a.x>E.x+E.width-x.right&&this.allowHorizontalScroll&&(tt=Math.max(this.scrollHorizontalLineChange,1),tt|=0,z.x+=tt,a.x>E.x+E.width-x.right/2&&(z.x+=tt),a.x>E.x+E.width-x.right/4&&(z.x+=4*tt));return a.y>=E.y&&a.y<E.y+x.top&&this.allowVerticalScroll?(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y-=tt,a.y<E.y+x.top/2&&(z.y-=tt),a.y<E.y+x.top/4&&(z.y-=4*tt)):a.y<=E.y+E.height&&a.y>E.y+E.height-x.bottom&&this.allowVerticalScroll&&(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y+=tt,a.y>E.y+E.height-x.bottom/2&&(z.y+=tt),a.y>E.y+E.height-x.bottom/4&&(z.y+=4*tt)),z.Xa(An)||(y=new At(y.x+z.x/b,y.y+z.y/b)),pe.free(E),At.free(z),y},xt=te.prototype,xt.Cs=function(){return null},xt.av=function(){return null},xt.bs=function(a,y){this.pj.add(a,y)},xt.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof Jn&&(y.$p=null)})};function Qd(a,y,x){function E(){var ut=+new Date;for(z=!0,tt.reset();tt.next();)if(!tt.value[0].al){z=!1;break}z||ut-at>rt?y(x,b,ot):me.requestAnimationFrame(E)}for(var b=x.callback,z=!0,tt=a.Og.iterator;tt.next();)if(!tt.value[0].al){z=!1;break}if(typeof b!="function"||z)return y(x,b,a);var ot=a,rt=x.callbackTimeout||300,at=+new Date;return me.requestAnimationFrame(function(){E()}),null}xt.Wz=function(a){return Io?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},xt.Jx=function(a){return a===void 0&&(a={}),Qd(this,this.Xz,a)},xt.Xz=function(a,y,x){var E=im(x,a,"canvas",null);if(E===null)return null;x=E.Z.canvas;var b=null;if(x!==null)switch(b=a.returnType,b===void 0?b="string":b=b.toLowerCase(),b){case ud+"data":b=E.getImageData(0,0,x.width,x.height);break;case ud:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&de('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),typeof x.toBlob=="function"?(x.toBlob(y,a.type,a.details),"toBlob"):(y(null),null);default:b=x.toDataURL(a.type,a.details)}return typeof y=="function"?(y(b),null):b};function im(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&de("properties argument must be an Object.");var b=y.size||null,z=y.scale||null;y.scale!==void 0&&isNaN(y.scale)&&(z="NaN");var tt=y.maxSize;y.maxSize===void 0&&(tt=x==="SVG"?new Le(1/0,1/0):new Le(2e3,2e3));var ot=y.position||null,rt=y.parts||null,at=y.padding===void 0?1:y.padding,ut=y.background||null,ct=y.omitTemporary;ct===void 0&&(ct=!0);var mt=y.document||document,yt=y.elementFinished||null,St=y.showTemporary;St===void 0&&(St=!ct),y=y.showGrid,y===void 0&&(y=St),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof at=="number"?at=new On(at):at instanceof On||de("MakeImage padding must be a Margin or a number."),at.left=Math.max(at.left,0),at.right=Math.max(at.right,0),at.top=Math.max(at.top,0),at.bottom=Math.max(at.bottom,0),a.ib.Vc(!0),ct=new ja(null,mt,void 0,!0);var Mt=ct.context;if(!(b||z||rt||ot))return ct.width=a.Aa+Math.ceil(at.left+at.right),ct.height=a.ya+Math.ceil(at.top+at.bottom),x==="SVG"?E===null?null:(E.resize(ct.width,ct.height,ct.width,ct.height),E.ownerDocument=mt,E.hs=yt,Zf(a,E.context,at,new Le(ct.width,ct.height),a.Ca,a.pa,rt,ut,St,y),E.context):(a.Xm=!1,Zf(a,Mt,at,new Le(ct.width,ct.height),a.Ca,a.pa,rt,ut,St,y),a.Xm=!0,ct.context);var Ot=a.Pp,bt=a.documentBounds.copy();if(bt.Fv(a.yb),St)for(var jt=a.Wa.s,Gt=jt.length,Wt=0;Wt<Gt;Wt++){var Kt=jt[Wt];if(Kt.visible&&Kt.isTemporary){Kt=Kt.Pa.s;for(var $t=Kt.length,Qe=0;Qe<$t;Qe++){var dn=Kt[Qe];dn.isInDocumentBounds&&dn.isVisible()&&(dn=dn.actualBounds,dn.w()&&bt.ed(dn))}}}if(jt=new At(bt.x,bt.y),rt!==null){for(Gt=new pe(0,0,0,0),Wt=!0,Kt=rt.iterator,Kt.reset();Kt.next();)$t=Kt.value,$t instanceof Ln&&(Qe=$t.layer,Qe!==null&&!Qe.visible||Qe!==null&&!St&&Qe.isTemporary||!$t.isVisible()||($t=$t.actualBounds,$t.w()&&(Wt?(Wt=!1,Gt.assign($t)):Gt.ed($t))));bt.width=Gt.width,bt.height=Gt.height,jt.x=Gt.x,jt.y=Gt.y}return ot!==null&&ot.w()&&(jt=ot,z||(z=Ot)),Gt=ot=0,at!==null&&(ot=at.left+at.right,Gt=at.top+at.bottom),Wt=Kt=0,b!==null&&(Kt=b.width,Wt=b.height,isFinite(Kt)&&(Kt=Math.max(0,Kt-ot)),isFinite(Wt)&&(Wt=Math.max(0,Wt-Gt))),b!==null&&z!==null?(z==="NaN"&&(z=Ot),b.w()?(b=Kt,bt=Wt):isNaN(Wt)?(b=Kt,bt=bt.height*z):(b=bt.width*z,bt=Wt)):b!==null?b.w()?(z=Math.min(Kt/bt.width,Wt/bt.height),b=Kt,bt=Wt):isNaN(Wt)?(z=Kt/bt.width,b=Kt,bt=bt.height*z):(z=Wt/bt.height,b=bt.width*z,bt=Wt):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-ot)/bt.width,(tt.height-Gt)/bt.height),z>Ot?(z=Ot,b=bt.width,bt=bt.height):(b=tt.width,bt=tt.height)):(b=bt.width*z,bt=bt.height*z):(z=Ot,b=bt.width,bt=bt.height),at!==null?(b+=ot,bt+=Gt):at=new On(0),tt!==null&&(Ot=tt.width,tt=tt.height,isNaN(Ot)&&(Ot=2e3),isNaN(tt)&&(tt=2e3),isFinite(Ot)&&(b=Math.min(b,Ot)),isFinite(tt)&&(bt=Math.min(bt,tt))),ct.width=Math.ceil(b),ct.height=Math.ceil(bt),x==="SVG"?E===null?null:(E.resize(ct.width,ct.height,ct.width,ct.height),E.ownerDocument=mt,E.hs=yt,Zf(a,E.context,at,new Le(Math.ceil(b),Math.ceil(bt)),z,jt,rt,ut,St,y),E.context):(a.Xm=!1,Zf(a,Mt,at,new Le(Math.ceil(b),Math.ceil(bt)),z,jt,rt,ut,St,y),a.Xm=!0,ct.context)}Ie.Object.defineProperties(te.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof gt||(a===""&&(a="default"),a=a.toLowerCase(),a!==this.nl&&(this.nl=a,a==="default"||a==="canvas"?(a=this.pj.get("svg"),a!==null&&a.Oa.remove(),this.ta&&(this.ib=this.ta.context)):a==="svg"?(this.pj.contains("svg")?a=this.pj.get("svg"):(a=new wl(this,me.document),this.bs("svg",a)),this.div!==null&&this.div.appendChild(a.Oa),this.ib=a.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):a!=="debug"||this.pj.contains("SVG")||(a=new wl(this,me.document),this.bs("SVG",a),a.Oa.style.backgroundColor="whitesmoke",this.div!==null&&this.div.after(a.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(a){if(this.Ka!==a){var y=this.Ka;y!==null?(y.H=void 0,y.goDiagram=void 0,y.go=void 0,y.innerHTML="",this.ta!==null&&(y=this.ta.Oa,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),y=this.toolManager,y!==null&&(y.mouseDownTools.each(function(x){x.cancelWaitAfter()}),y.mouseMoveTools.each(function(x){x.cancelWaitAfter()}),y.mouseUpTools.each(function(x){x.cancelWaitAfter()})),y.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener(me,"resize",this.Ov,!1),this.removeEventListener(me,"wheel",this.$j,!0),Bl===this&&(Bl=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),ug(this,a),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(a){this.nt!==a&&(this.nt=a,a!==null&&(this.Vt=a.fromPort,this.Wt=a.toPort))}},Mx:{get:function(){return this.Vt},set:function(a){this.Vt=a}},Nx:{get:function(){return this.Wt},set:function(a){this.Wt=a}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a,this.cc.skipsUndoManager=a}},delaysLayout:{get:function(){return this.lt},set:function(a){this.lt=a}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&qn(a,"0 <= value <= 1",te,"opacity"),this.pb=a,this.g("opacity",y,a),this.N())}},validCycle:{get:function(){return this.wu},set:function(a){var y=this.wu;y!==a&&(this.wu=a,this.g("validCycle",y,a))}},layers:{get:function(){return this.Wa.iterator}},isModelReadOnly:{get:function(){var a=this.cc;return a===null?!1:a.isReadOnly},set:function(a){var y=this.cc;y!==null&&(y.isReadOnly=a)}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},isEnabled:{get:function(){return this.Jd},set:function(a){var y=this.Jd;y!==a&&(this.Jd=a,this.g("isEnabled",y,a))}},allowClipboard:{get:function(){return this.Us},set:function(a){var y=this.Us;y!==a&&(this.Us=a,this.g("allowClipboard",y,a))}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowDragOut:{get:function(){return this.Vs},set:function(a){var y=this.Vs;y!==a&&(this.Vs=a,this.g("allowDragOut",y,a))}},allowDrop:{get:function(){return this.Ws},set:function(a){var y=this.Ws;y!==a&&(this.Ws=a,this.g("allowDrop",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowInsert:{get:function(){return this.Ys},set:function(a){var y=this.Ys;y!==a&&(this.Ys=a,this.g("allowInsert",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}},allowUndo:{get:function(){return this.Zs},set:function(a){var y=this.Zs;y!==a&&(this.Zs=a,this.g("allowUndo",y,a))}},allowZoom:{get:function(){return this.at},set:function(a){var y=this.at;y!==a&&(this.at=a,this.g("allowZoom",y,a))}},hasVerticalScrollbar:{get:function(){return this.nn},set:function(a){var y=this.nn;y!==a&&(this.nn=a,this.Ee=!0,this.N(),this.g("hasVerticalScrollbar",y,a),Ia(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.mn},set:function(a){var y=this.mn;y!==a&&(this.mn=a,this.Ee=!0,this.N(),this.g("hasHorizontalScrollbar",y,a),Ia(this,!1))}},allowHorizontalScroll:{get:function(){return this.Xs},set:function(a){var y=this.Xs;y!==a&&(this.Xs=a,this.g("allowHorizontalScroll",y,a),Ia(this,!1))}},allowVerticalScroll:{get:function(){return this.$s},set:function(a){var y=this.$s;y!==a&&(this.$s=a,this.g("allowVerticalScroll",y,a),Ia(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&qn(a,">= 0",te,"scrollHorizontalLineChange"),this.iu=a,this.g("scrollHorizontalLineChange",y,a))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(a){var y=this.mu;y!==a&&(0>a&&qn(a,">= 0",te,"scrollVerticalLineChange"),this.mu=a,this.g("scrollVerticalLineChange",y,a))}},lastInput:{get:function(){return this.cj},set:function(a){this.cj=a}},previousInput:{get:function(){return this.Qg},set:function(a){this.Qg=a}},firstInput:{get:function(){return this.bq},set:function(a){this.bq=a}},currentCursor:{get:function(){return this.it},set:function(a){if(a===""&&(a=this.Op),this.it!==a){var y=this.ta,x=this.Ka;if(y!==null&&x!==null){this.it=a;var E=y.style.cursor;y.style.cursor=a,x.style.cursor=a,y.style.cursor===E&&(y.style.cursor="-webkit-"+a,x.style.cursor="-webkit-"+a,y.style.cursor===E&&(y.style.cursor="-moz-"+a,x.style.cursor="-moz-"+a,y.style.cursor===E&&(y.style.cursor=a,x.style.cursor=a)))}}}},defaultCursor:{get:function(){return this.Op},set:function(a){a===""&&(a="auto");var y=this.Op;y!==a&&(this.Op=a,this.g("defaultCursor",y,a))}},click:{get:function(){return this.zh},set:function(a){var y=this.zh;y!==a&&(this.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.Fh},set:function(a){var y=this.Fh;y!==a&&(this.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.Bh},set:function(a){var y=this.Bh;y!==a&&(this.Bh=a,this.g("contextClick",y,a))}},mouseOver:{get:function(){return this.Qh},set:function(a){var y=this.Qh;y!==a&&(this.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.Oh},set:function(a){var y=this.Oh;y!==a&&(this.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.Nh},set:function(a){var y=this.Nh;y!==a&&(this.Nh=a,this.g("mouseHold",y,a))}},mouseDragOver:{get:function(){return this.Qt},set:function(a){var y=this.Qt;y!==a&&(this.Qt=a,this.g("mouseDragOver",y,a))}},mouseDrop:{get:function(){return this.Lh},set:function(a){var y=this.Lh;y!==a&&(this.Lh=a,this.g("mouseDrop",y,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(a){var y=this.xt;y!==a&&(this.xt=a,this.g("handlesDragDropForTopLevelParts",y,a))}},mouseEnter:{get:function(){return this.Mh},set:function(a){var y=this.Mh;y!==a&&(this.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.Ph},set:function(a){var y=this.Ph;y!==a&&(this.Ph=a,this.g("mouseLeave",y,a))}},toolTip:{get:function(){return this.$h},set:function(a){var y=this.$h;y!==a&&(this.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.Ch},set:function(a){var y=this.Ch;y!==a&&(this.Ch=a,this.g("contextMenu",y,a))}},commandHandler:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a,a.Xe(this))}},toolManager:{get:function(){return this.te},set:function(a){this.te!==a&&(this.te=a,a.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(a){var y=this.ob;y!==a&&(this.ob=a,a.diagram=this,this.currentTool===y&&(this.currentTool=a))}},currentTool:{get:function(){return this.hb},set:function(a){var y=this.hb;y&&(y.isActive&&y.doDeactivate(),y.cancelWaitAfter(),y.doStop()),a===null&&(a=this.defaultTool),a!==null&&(this.hb=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(a){var y=this.Nt;if(y!==a)if(0<=a&&!isNaN(a)){if(this.Nt=a,this.g("maxSelectionCount",y,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0<a)){this.R("ChangingSelection",this.selection),y=this.selection.Fa();for(var x=0;x<a;x++)y[x].isSelected=!1;this.R("ChangedSelection",this.selection)}}else qn(a,">= 0",te,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(a){var y=this.St;y!==a&&(this.St=a,this.g("nodeSelectionAdornmentTemplate",y,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(a){var y=this.wt;y!==a&&(this.wt=a,this.g("groupSelectionAdornmentTemplate",y,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(a){var y=this.Kt;y!==a&&(this.Kt=a,this.g("linkSelectionAdornmentTemplate",y,a))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?a.currentTransaction!==null?!0:this.rn&&this.Ce!==a.historyIndex:this.rn},set:function(a){if(this.rn!==a){this.rn=a;var y=this.undoManager;!a&&y.isEnabled&&(this.Ce=y.historyIndex),a||$p(this)}}},model:{get:function(){return this.cc},set:function(a){var y=this.cc;if(y!==a){this.currentTool.doCancel(),y&&y.undoManager!==a.undoManager&&y.undoManager.isInTransaction&&de("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=lg(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,Al(this.animationManager,"Model"),y&&(this.pf!==null&&this.pf.each(function(z){return y.ik(z)}),y.ik(this.Oc)),this.cc=a,this.partManager=wg(this.cc.type);for(var b=0;b<x.length;b++)this.add(x[b]);a.Pe(this.Hb),this.partManager.addAllModeledParts(),a.ik(this.Hb),a.Pe(this.Oc),this.pf!==null&&this.pf.each(function(z){return a.Pe(z)}),this.vb=E,this.Ya(),this.vb||this.N(),y&&a.undoManager.copyProperties(y.undoManager)}}},aa:{get:function(){return this.rw},set:function(a){this.rw=a}},As:{get:function(){return this.sy}},skipsModelSourceBindings:{get:function(){return this.Iw},set:function(a){this.Iw=a}},Ns:{get:function(){return this.ou},set:function(a){this.ou=a}},nodeTemplate:{get:function(){return this.Lg.I("")},set:function(a){var y=this.Lg.I("");y!==a&&(this.Lg.add("",a),this.g("nodeTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},nodeTemplateMap:{get:function(){return this.Lg},set:function(a){var y=this.Lg;y!==a&&(this.Lg=a,this.g("nodeTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplate:{get:function(){return this.Yi.I("")},set:function(a){var y=this.Yi.I("");y!==a&&(this.Yi.add("",a),this.g("groupTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplateMap:{get:function(){return this.Yi},set:function(a){var y=this.Yi;y!==a&&(this.Yi=a,this.g("groupTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplate:{get:function(){return this.Kh.I("")},set:function(a){var y=this.Kh.I("");y!==a&&(this.Kh.add("",a),this.g("linkTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplateMap:{get:function(){return this.Kh},set:function(a){var y=this.Kh;y!==a&&(this.Kh=a,this.g("linkTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},isMouseCaptured:{get:function(){return this.qw},set:function(a){var y=this.ta;y!==null&&(y=y.Oa,y instanceof SVGElement||(a?(this.lastInput.bubbles=!1,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.addEventListener(me,"pointermove",this.dk,!0),this.addEventListener(me,"pointerdown",this.ui,!0),this.addEventListener(me,"pointerup",this.fk,!0),this.addEventListener(me,"pointerout",this.ek,!0),this.addEventListener(me,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(me,"wheel",this.$j,!0),this.addEventListener(me,"selectstart",this.preventDefault,!1)):(this.removeEventListener(me,"pointermove",this.dk,!0),this.removeEventListener(me,"pointerdown",this.ui,!0),this.removeEventListener(me,"pointerup",this.fk,!0),this.removeEventListener(me,"pointerout",this.ek,!0),this.removeEventListener(me,"pointercancel",this.ck,!0),this.addEventListener(y,"pointermove",this.dk,!1),this.addEventListener(y,"pointerdown",this.ui,!1),this.addEventListener(y,"pointerup",this.fk,!1),this.addEventListener(y,"pointerout",this.ek,!1),this.addEventListener(y,"pointercancel",this.ck,!1),this.removeEventListener(me,"wheel",this.$j,!0),this.removeEventListener(me,"selectstart",this.preventDefault,!1),this.addEventListener(y,"wheel",this.$j,!1)),this.qw=a))}},position:{get:function(){return this.pa},set:function(a){var y=At.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Gp(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?Pl(this):(this.vb=!0,a=this.scale,fg(this,this.Sp,this.Aa/a,this.ya/a,this.zk,!1),this.vb=!1),this.vb||this.onViewportBoundsChanged(x,this.viewportBounds,this.Ca,!1)}At.free(y)}},initialPosition:{get:function(){return this.zt},set:function(a){this.zt.D(a)||(this.zt=a.J())}},initialScale:{get:function(){return this.At},set:function(a){this.At!==a&&(this.At=a)}},grid:{get:function(){return this.fe===null&&(this.fe=Zp(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=Zp(this)),a.type!==ze.Grid&&de("Diagram.grid must be a Panel of type Panel.Grid");var x=y.panel;x!==null&&x.remove(y),this.fe=a,a.name="GRID",x!==null&&x.add(a),xl(this),this.N(),this.g("grid",y,a)}}},viewportBounds:{get:function(){return this.Rw}},viewSize:{get:function(){return this.wo},set:function(a){var y=this.viewSize;y.D(a)||(this.wo=a=a.J(),this.ya=this.Aa=0,a.w()?(this.Aa=a.width,this.ya=a.height):this.Ka!==null&&(this.Aa=this.Ka.clientWidth||1,this.ya=this.Ka.clientHeight||1),Pl(this),this.Ya(),this.g("viewSize",y,a),this.redraw())}},fixedBounds:{get:function(){return this.ut},set:function(a){var y=this.ut;y.D(a)||(a.width!==-1/0&&a.height!==1/0&&a.height!==-1/0||de("fixedBounds width/height must not be Infinity"),this.ut=a=a.J(),this.Ya(),this.g("fixedBounds",y,a))}},scrollMargin:{get:function(){return this.rj},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.rj;y.D(a)||(this.rj=a=a.J(),this.g("scrollMargin",y,a),this.hk())}},scrollMode:{get:function(){return this.sj},set:function(a){var y=this.sj;y!==a&&(this.sj=a,a===Ou&&Ia(this,!1),this.g("scrollMode",y,a),this.Ee=!0,this.N())}},scrollsPageOnFocus:{get:function(){return this.nu},set:function(a){var y=this.nu;y!==a&&(this.nu=a,this.g("scrollsPageOnFocus",y,a))}},positionComputation:{get:function(){return this.Zt},set:function(a){var y=this.Zt;y!==a&&(this.Zt=a,Ia(this,!1),this.g("positionComputation",y,a))}},scaleComputation:{get:function(){return this.fu},set:function(a){var y=this.fu;y!==a&&(this.fu=a,Pg(this,this.scale,this.scale),this.g("scaleComputation",y,a))}},documentBounds:{get:function(){return this.Sp}},isVirtualized:{get:function(){return this.It},set:function(a){var y=this.It;y!==a&&(this.It=a,this.g("isVirtualized",y,a))}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&Pg(this,y,a)}},defaultScale:{get:function(){return this.Pp},set:function(a){this.Pp=a}},autoScale:{get:function(){return this.yh},set:function(a){var y=this.yh;y!==a&&(this.yh=a,this.g("autoScale",y,a),a!==$r&&Ia(this,!1))}},initialAutoScale:{get:function(){return this.Fg},set:function(a){var y=this.Fg;y!==a&&(this.Fg=a,this.g("initialAutoScale",y,a))}},initialViewportSpot:{get:function(){return this.Bt},set:function(a){var y=this.Bt;y!==a&&(a.sb()||de("initialViewportSpot must be a specific Spot: "+a),this.Bt=a,this.g("initialViewportSpot",y,a))}},initialDocumentSpot:{get:function(){return this.yt},set:function(a){var y=this.yt;y!==a&&(a.sb()||de("initialViewportSpot must be a specific Spot: "+a),this.yt=a,this.g("initialDocumentSpot",y,a))}},minScale:{get:function(){return this.Ot},set:function(a){var y=this.Ot;y!==a&&(0<a?(this.Ot=a,this.g("minScale",y,a),a>this.scale&&(this.scale=a)):qn(a,"> 0",te,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(a){var y=this.Mt;y!==a&&(0<a?(this.Mt=a,this.g("maxScale",y,a),a<this.scale&&(this.scale=a)):qn(a,"> 0",te,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(a){this.zu.D(a)||(this.zu=a=a.J())}},contentAlignment:{get:function(){return this.zk},set:function(a){var y=this.zk;y.D(a)||(this.zk=a=a.J(),this.g("contentAlignment",y,a),Ia(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(a){var y=this.pq;y.D(a)||(this.pq=a=a.J(),this.g("initialContentAlignment",y,a))}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.Ya(),this.g("padding",y,a))}},partManager:{get:function(){return this.Pc},set:function(a){var y=this.Pc;y!==a&&(a.diagram!==null&&de("Cannot share PartManagers between Diagrams: "+a.toString()),y&&y.Xe(null),this.Pc=a,a.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;y!==a&&(this.Sc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",y,a),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(a){var y=this.Ht;if(y!==a&&(this.Ht=a,this.g("isTreePathToChildren",y,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Vg(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Iu&&a!==er&&a!==rc&&de("Unknown Diagram.treeCollapsePolicy: "+a),this.uu=a,this.g("treeCollapsePolicy",y,a))}},Ue:{get:function(){return this.pw},set:function(a){this.pw=a}},avoidanceCellSize:{get:function(){return this.aw},set:function(a){this.Xh=null,this.aw=new Le(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(a){this.bw=Math.max(1,a)}},autoScrollInterval:{get:function(){return this.vp},set:function(a){var y=this.vp;y!==a&&(this.vp=a,this.g("autoScrollInterval",y,a))}},autoScrollRegion:{get:function(){return this.xp},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),Ie.Object.defineProperties(te,{licenseKey:{get:function(){return Bg.jc()},set:function(a){Bg.add(a.replace(/\s/g,""))}},version:{get:function(){return ld}}}),te.prototype.makeImageData=te.prototype.Jx,te.prototype.makeImage=te.prototype.Wz,te.prototype.cacheGroupExternalLinks=te.prototype.Fu,te.prototype.addRenderer=te.prototype.bs,te.prototype.makeSVG=te.prototype.av,te.prototype.makeSvg=te.prototype.Cs,te.prototype.stopAutoScroll=te.prototype.ug,te.prototype.doAutoScroll=te.prototype.gs,te.prototype.isUnoccupied=te.prototype.Yj,te.prototype.raiseDiagramEvent=te.prototype.R,te.prototype.removeDiagramListener=te.prototype.am,te.prototype.addDiagramListener=te.prototype.Bj,te.prototype.findTreeRoots=te.prototype.yz,te.prototype.layoutDiagram=te.prototype.Uz,te.prototype.findTopLevelGroups=te.prototype.qz,te.prototype.findTopLevelNodesAndLinks=te.prototype.rz,te.prototype.ensureBounds=te.prototype.Va,te.prototype.findLinksByExample=te.prototype.ls,te.prototype.findNodesByExample=te.prototype.ms,te.prototype.findLinkForData=te.prototype.Kc,te.prototype.findNodeForData=te.prototype.ii,te.prototype.findPartForData=te.prototype.Lc,te.prototype.findLinkForKey=te.prototype.findLinkForKey,te.prototype.findNodeForKey=te.prototype.Vb,te.prototype.findPartForKey=te.prototype.findPartForKey,te.prototype.rebuildParts=te.prototype.Wd,te.prototype.transformViewToDoc=te.prototype.Ps,te.prototype.transformRectDocToView=te.prototype.zA,te.prototype.transformDocToView=te.prototype.op,te.prototype.centerRect=te.prototype.es,te.prototype.scrollToRect=te.prototype.tv,te.prototype.scroll=te.prototype.scroll,te.prototype.highlightCollection=te.prototype.Jz,te.prototype.highlight=te.prototype.Iz,te.prototype.selectCollection=te.prototype.rA,te.prototype.select=te.prototype.select,te.prototype.updateAllRelationshipsFromData=te.prototype.rp,te.prototype.updateAllTargetBindings=te.prototype.updateAllTargetBindings,te.prototype.commit=te.prototype.commit,te.prototype.rollbackTransaction=te.prototype.Kf,te.prototype.commitTransaction=te.prototype.eb,te.prototype.startTransaction=te.prototype.Ea,te.prototype.raiseChanged=te.prototype.g,te.prototype.raiseChangedEvent=te.prototype.cb,te.prototype.removeChangedListener=te.prototype.ik,te.prototype.addChangedListener=te.prototype.Pe,te.prototype.removeModelChangedListener=te.prototype.mA,te.prototype.addModelChangedListener=te.prototype.Yw,te.prototype.findLayer=te.prototype.Qj,te.prototype.removeLayer=te.prototype.kA,te.prototype.addLayerAfter=te.prototype.Cy,te.prototype.addLayerBefore=te.prototype.Ww,te.prototype.addLayer=te.prototype.Al,te.prototype.moveParts=te.prototype.moveParts,te.prototype.copyParts=te.prototype.Kj,te.prototype.removeParts=te.prototype.Is,te.prototype.remove=te.prototype.remove,te.prototype.add=te.prototype.add,te.prototype.clearDelayedGeometries=te.prototype.bx,te.prototype.setProperties=te.prototype.nm,te.prototype.attach=te.prototype.Du,te.prototype.set=te.prototype.set,te.prototype.resetInputOptions=te.prototype.Sx,te.prototype.setInputOption=te.prototype.sA,te.prototype.getInputOption=te.prototype.Ql,te.prototype.resetRenderingHints=te.prototype.Tx,te.prototype.setRenderingHint=te.prototype.Xx,te.prototype.getRenderingHint=te.prototype.Gf,te.prototype.maybeUpdate=te.prototype.bd,te.prototype.requestUpdate=te.prototype.$b,te.prototype.delayInitialization=te.prototype.Xy,te.prototype.isUpdateRequested=te.prototype.Pz,te.prototype.invalidateDocumentBounds=te.prototype.Ya,te.prototype.findObjectsNear=te.prototype.og,te.prototype.findPartsNear=te.prototype.mz,te.prototype.findObjectsIn=te.prototype.Cf,te.prototype.findPartsIn=te.prototype.ux,te.prototype.findObjectsAt=te.prototype.ji,te.prototype.findPartsAt=te.prototype.lz,te.prototype.findObjectAt=te.prototype.ic,te.prototype.findPartAt=te.prototype.Ol,te.prototype.focusObject=te.prototype.zz,te.prototype.alignDocument=te.prototype.Jy,te.prototype.zoomToRect=te.prototype.BA,te.prototype.zoomToFit=te.prototype.zoomToFit,te.prototype.diagramScroll=te.prototype.kx,te.prototype.focus=te.prototype.focus;var oc=new qe,om=null,Io=me.document!==void 0,ad=null,wh="",$r=new ae(te,"None",0),ua=new ae(te,"Uniform",1),Ch=new ae(te,"UniformToFill",2),qd=new ae(te,"CycleAll",10),Ng=new ae(te,"CycleNotDirected",11),Tg=new ae(te,"CycleNotDirectedFast",12),Fg=new ae(te,"CycleNotUndirected",13),bg=new ae(te,"CycleDestinationTree",14),Ag=new ae(te,"CycleSourceTree",15),Ou=new ae(te,"DocumentScroll",1),$d=new ae(te,"InfiniteScroll",2),Iu=new ae(te,"TreeParentCollapsed",21),er=new ae(te,"AllParentsCollapsed",22),rc=new ae(te,"AnyParentsCollapsed",23),Bg=new be,ld="2.3.10",ud="image",tf=null,rm=!1;function Vr(){if(Io){var a=me.document.createElement("canvas"),y=a.getContext("2d"),x=xe("7ca11abfd022028846");y[x]=xe("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",Ze.Dx+"4ae6247590da4bb21c324ba3a84e385776",ci.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",Jt.za],b=1;5>b;b++)y[xe("7ca11abfd7330390")](xe(E[b-1]),10,15*b);for(y[x]=xe("39f046ebb36e4b"),x=1;5>x;x++)y[xe("7ca11abfd7330390")](xe(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(ci.prototype.Cd=ci.prototype.Eu),tf=a}}te.className="Diagram",te.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=me.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof te?y.H:null},te.inherit=function(a,y){function x(){}if(Object.getPrototypeOf(a).prototype)throw Error(`Used go.Diagram.inherit defining already defined class
`+a);x.prototype=y.prototype,a.prototype=new x,a.prototype.constructor=a},te.useDOM=function(a){Io=a?me.document!==void 0:!1},te.isUsingDOM=function(){return Io},te.None=$r,te.Uniform=ua,te.UniformToFill=Ch,te.CycleAll=qd,te.CycleNotDirected=Ng,te.CycleNotDirectedFast=Tg,te.CycleNotUndirected=Fg,te.CycleDestinationTree=bg,te.CycleSourceTree=Ag,te.DocumentScroll=Ou,te.InfiniteScroll=$d,te.TreeParentCollapsed=Iu,te.AllParentsCollapsed=er,te.AnyParentsCollapsed=rc;function sm(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function hd(a,y){if(y.ib.setTransform(y.Mb,0,0,y.Mb,0,0),y.ib.yc(),a.Rc===null)t:{y="f";var x=me[xe("76a715b2f73f148a")][xe("72ba13b5")]||"";if(a.Rc=!0,Io){var E=te[xe("76a115b6ed251eaf4692")];if(E)for(var b=Bg.iterator;b.next()&&(E=b.value,E=xe(E).split(xe("39e9")),!(6>E.length));){var z=xe(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=xe(Ze[xe("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var ot=me[xe("74a900bae4370f8b51")][xe("6fbb13a1c2311e8a57")].toLowerCase();if(tt=ot[xe("73a612b6fb191d")](xe("3aad1ab6e022098b4dc4")),z=xe(E[2]),-1<tt&&(ot=ot[xe("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<ot&&ot<tt),!a.Rc))break;for(tt=x[xe("76ad18b4f73e")],ot=x[xe("73a612b6fb191d")](xe("35e7"))+2;ot<tt;ot++)y+=x[ot];if(tt=y[xe("73a612b6fb191d")](z),0>tt&&z!==xe("7da71ca0ad381e90")&&(tt=y[xe("73a612b6fb191d")](xe("76a715b2ef3e149757"))),0>tt&&(tt=y[xe("73a612b6fb191d")](xe("76a715b2ef3e149757"))),0>tt&&(tt=y[xe("73a612b6fb191d")](xe("2bfa41fdb3784bca12"))),0>tt&&(tt=x[xe("73a612b6fb191d")](xe("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[xe("73a612b6fb191d")](xe("35"))||y[xe("73a612b6fb191d")](xe("35"))===-1),!a.Rc||x[xe("73a612b6fb191d")](xe("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[xe("73a612b6fb191d")](z)),!a.Rc)||(tt=me[xe("76a715b2f73f148a")][xe("69ad17a1e03e")],ot=tt[xe("73a612b6fb191d")](xe("7fb002b6ed25128b4da25b2e")),-1<ot&&(a.Rc=!(tt[xe("73a612b6fb191d")](z)>ot),!a.Rc)))break;if(z[0]==="#"){tt=me.document.createElement("div");for(var rt=E[0].replace(/[A-Za-z]/g,"");4>rt.length;)rt+="9";if(ot=rt,rt=rt.substr(rt.length-4),E="",E+=["gsh","gsf"][parseInt(rt.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(rt.substr(0,1),10)%4],tt[xe("79a417a0f0181a8946")]=E,me.document[xe("78a712aa")]){me.document[xe("78a712aa")][xe("7bb806b6ed32388c4a875b")](tt),rt=me.getComputedStyle(tt).getPropertyValue(xe("78a704b7e62456904c9b12701b6532a8"));var at=me.getComputedStyle(tt).getPropertyValue(xe("75b817b0ea2202"));if(me.document[xe("78a712aa")][xe("68ad1bbcf533388c4a875b")](tt),rt){if(tt=me[xe("77a902b0eb1b1e804a8a")],at==="0."+parseInt(ot,10)%100||rt.indexOf(parseInt(z[1]+z[2],16))!==-1&&rt.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(tt&&tt(xe("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(E="."+E,z=0;z<document.styleSheets.length;z++){tt=document.styleSheets[z].rules||document.styleSheets[z].cssRules;for(var ut in tt)if(E===tt[ut].selectorText){a.Rc=!1;break t}}}}else a.Rc=null,a.Rc=!1}}}else{for(ut=x[xe("76ad18b4f73e")],b=x[xe("73a612b6fb191d")](xe("35e7"))+2;b<ut;b++)y+=x[b];x=y[xe("73a612b6fb191d")](xe("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[xe("73a612b6fb191d")](xe("35")))}}}return 0<a.Rc&&a!==a.wy}sm.className="DiagramHelper";function ou(a){this.j=a===void 0?new At:a,this.o=new At}Ie.Object.defineProperties(ou.prototype,{point:{get:function(){return this.j},set:function(a){this.j=a}},shifted:{get:function(){return this.o},set:function(a){this.o=a}}});var ef="DraggingInfo";ou.className="DraggingInfo";function it(a,y,x){this.node=a,this.info=y,this.Su=x}it.className="DraggingNodeInfoPair";function st(){this.reset()}st.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new Le(NaN,NaN).freeze(),this.gridSnapCellSpot=Sr,this.gridSnapOrigin=new At(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},st.className="DraggingOptions";function ft(a,y){if(typeof a=="string"||me.Element&&a instanceof Element)var x=te.call(this,a)||this;else x=te.call(this)||this,y=a;return dt(x),y&&x.nm(y),x}ee(ft,te);function dt(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=sa,a.layout=new Fr}ft.prototype.reset=function(){te.prototype.reset.call(this),dt(this)},ft.className="Palette";function gt(a,y){if(typeof a=="string"||me.Element&&a instanceof Element)var x=te.call(this,a)||this;else x=te.call(this)||this,y=a;var E=x;x.animationManager.isEnabled=!1,x.vb=!0,x.V=null,x.mn=!1,x.nn=!1,x.F=!0,x.u=!0,x.ia=0,x.o=!1,x.ql=null,x.Xx("drawShadows",!1),a=new Ln;var b=new ei;return b.stroke="magenta",b.strokeWidth=2,b.fill="transparent",b.name="BOXSHAPE",a.selectable=!0,a.selectionAdorned=!1,a.selectionObjectName="BOXSHAPE",a.locationObjectName="BOXSHAPE",a.resizeObjectName="BOXSHAPE",a.cursor="move",a.add(b),x.j=a,x.allowCopy=!1,x.allowDelete=!1,x.allowSelect=!0,x.autoScrollRegion=new On(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new It,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,ot=E.lastInput.documentPoint;z.position=new At(ot.x-tt.width/2,ot.y-tt.height/2)}},x.Pf=function(){E.Ya(),Tt(E)},x.Xd=function(){E.observed!==null&&(E.Ya(),E.N())},x.Ha=function(){1>E.updateDelay?E.N():E.o||(E.o=!0,setTimeout(function(){return E.redraw()},E.updateDelay))},x.Of=function(){E.observed!==null&&Tt(E)},x.autoScale=ua,x.vb=!1,y&&Object.assign(x,y),x}ee(gt,te),gt.prototype.computePixelRatio=function(){return 1},gt.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.ta,y=this.ib;if(a!==null&&y!==null){if(od(this),this.ql===null){var x=new ja(null);x.width=a.width,x.height=a.height,this.ql=x}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),Pt(this)}finally{this.ta=a,this.ib=y}}}te.prototype.redraw.call(this)},gt.prototype.gc=function(){if(this.Ka===null&&de("No div specified"),this.ta===null&&de("No canvas specified"),!(this.ta instanceof wl)&&(Ov(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){od(this);var y=this.ta;a=this.ib,a.Vc(!0),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,y.width,y.height),1>this.updateDelay?Pt(this):this.ql!==null&&(a.drawImage(this.ql.Oa,0,0),y=this.Ab,y.reset(),this.scale!==1&&y.scale(this.scale),this.position.x===0&&this.position.y===0||y.translate(-this.position.x,-this.position.y),a.scale(this.Mb,this.Mb),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.yc()),y=this.Wa.s;for(var x=y.length,E=0;E<x;E++)y[E].gc(a,this);this.Fc=this.vd=!1}}};function Pt(a){var y=a.observed;if(y!==null){var x=a.drawsTemporaryLayers,E=a.drawsGrid&&x,b=y.grid;E&&b!==null&&b.visible&&!isNaN(b.width)&&!isNaN(b.height)&&(b=pe.alloc().assign(a.viewportBounds).ed(y.viewportBounds),xl(y,b),pe.free(b),_r(y));var z=a.Ab;z.reset(),a.scale!==1&&z.scale(a.scale),a.position.x===0&&a.position.y===0||z.translate(-a.position.x,-a.position.y),b=a.ib,b.scale(a.Mb,a.Mb),b.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),b.yc(),y=y.Wa.s,z=y.length;for(var tt=0;tt<z;tt++){var ot=y[tt],rt=a;if(ot.visible&&ot.opacity!==0){var at=ot.diagram.grid.part;if(!x&&ot.isTemporary)E&&at.layer===ot&&(ot=iu(ot,b),at.gc(b,rt),b.globalAlpha=ot);else{for(var ut=iu(ot,b),ct=rt.scale,mt=pe.alloc(),yt=ot.Pa.s,St=yt.length,Mt=0;Mt<St;Mt++){var Ot=yt[Mt];(E||Ot!==at)&&ot.Oj(b,Ot,rt,null,ct,mt,!1)}pe.free(mt),b.globalAlpha=ut}}}}}function Tt(a){var y=a.box;if(y!==null){var x=a.observed;if(x!==null){a.Fc=!0,x=x.viewportBounds;var E=y.selectionObject,b=Le.alloc();b.h(x.width,x.height),E.desiredSize=b,Le.free(b),a=2/a.scale,E instanceof ei&&(E.strokeWidth=a),y.location=new At(x.x-a/2,x.y-a/2),y.isSelected=!0}}}gt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return Vi;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},gt.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},gt.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),Tt(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.Oz=E,this.R("ViewportBoundsChanged",this.fc,a))},Ie.Object.defineProperties(gt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof gt&&de("Overview.observed Diagram may not be an Overview itself: "+a),y!==a){if(y!==null&&(this.remove(this.box),y.am("ViewportBoundsChanged",this.Pf),y.am("DocumentBoundsChanged",this.Xd),y.am("InvalidateDraw",this.Ha),y.am("AnimationFinished",this.Of)),this.V=a,a!==null&&(a.Bj("ViewportBoundsChanged",this.Pf),a.Bj("DocumentBoundsChanged",this.Xd),a.Bj("InvalidateDraw",this.Ha),a.Bj("AnimationFinished",this.Of),this.add(this.box)),this.Ya(),a===null){this.ql=null;var x=this.ta,E=this.ib;x&&E&&(E.setTransform(1,0,0,1,0,0),E.clearRect(0,0,x.width,x.height))}else this.Ha(null),Tt(this),this.N();this.g("observed",y,a)}}},box:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.remove(y),this.add(this.j),Tt(this),this.g("box",y,a))}},drawsTemporaryLayers:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a,this.redraw())}},drawsGrid:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a,this.redraw())}},updateDelay:{get:function(){return this.ia},set:function(a){0>a&&(a=0),this.ia!==a&&(this.ia=a)}}}),gt.className="Overview";function It(){bo.call(this),this.j=null}ee(It,bo),It.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||!a.allowMove||!a.allowSelect)return!1;var y=a.observed;if(y===null)return!1;var x=a.lastInput;return!x.left||a.currentTool!==this&&(!this.isBeyondDragSize()||x.isTouchEvent&&x.timestamp-a.firstInput.timestamp<this.delay)?!1:(this.findDraggablePart()===null&&(x=y.viewportBounds,this.j=new At(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)),!0)},It.prototype.doActivate=function(){this.j=null,bo.prototype.doActivate.call(this)},It.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},It.prototype.moveParts=function(){var a=this.diagram,y=a.observed;if(y!==null){var x=a.box;if(x!==null){if(this.j===null){var E=a.firstInput.documentPoint;x=x.location,this.j=new At(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)}}},It.className="OverviewDraggingTool";function Dt(){vi(this),this.H=Bl,this.Ha=this.u=this.o=!0,this.F=this.V=this.nb=this.ia=!1,this.ij=this.j=null,this.Hb=1.05,this.Jt=NaN,this.sw=null,this.Au=NaN,this.yu=Vi,this.hb=!0,this.cg=null,this.ob=200}Dt.prototype.toString=function(){return"CommandHandler"},Dt.prototype.Xe=function(a){this.H=a},Dt.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=kn?y.meta:y.control,E=y.shift,b=y.alt,z=y.key;!x||z!=="C"&&z!=="Insert"?x&&z==="X"||E&&z==="Del"?this.canCutSelection()&&this.cutSelection():x&&z==="V"||E&&z==="Insert"?this.canPasteSelection()&&this.pasteSelection():x&&z==="Y"||b&&E&&z==="Backspace"?this.canRedo()&&this.redo():x&&z==="Z"||b&&z==="Backspace"?this.canUndo()&&this.undo():z==="Del"||z==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():x&&z==="A"?this.canSelectAll()&&this.selectAll():z==="Esc"?this.canStopCommand()&&this.stopCommand():z==="Up"?a.allowVerticalScroll&&(x?a.scroll("pixel","up"):a.scroll("line","up")):z==="Down"?a.allowVerticalScroll&&(x?a.scroll("pixel","down"):a.scroll("line","down")):z==="Left"?a.allowHorizontalScroll&&(x?a.scroll("pixel","left"):a.scroll("line","left")):z==="Right"?a.allowHorizontalScroll&&(x?a.scroll("pixel","right"):a.scroll("line","right")):z==="PageUp"?E&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&&a.scroll("page","up"):z==="PageDown"?E&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):z==="Home"?x&&a.allowVerticalScroll?a.scroll("document","up"):!x&&a.allowHorizontalScroll&&a.scroll("document","left"):z==="End"?x&&a.allowVerticalScroll?a.scroll("document","down"):!x&&a.allowHorizontalScroll&&a.scroll("document","right"):z===" "?this.canScrollToPart()&&this.scrollToPart():z==="Subtract"?this.canDecreaseZoom()&&this.decreaseZoom():z==="Add"?this.canIncreaseZoom()&&this.increaseZoom():x&&z==="0"?this.canResetZoom()&&this.resetZoom():E&&z==="Z"?this.canZoomToFit()&&this.zoomToFit():x&&!E&&z==="G"?this.canGroupSelection()&&this.groupSelection():x&&E&&z==="G"?this.canUngroupSelection()&&this.ungroupSelection():z==="F2"||y.event&&y.event.key==="F2"?this.canEditTextBlock()&&this.editTextBlock():z==="ContextMenu"||y.event&&y.event.key==="ContextMenu"?this.canShowContextMenu()&&this.showContextMenu():y.bubbles=!0:this.canCopySelection()&&this.copySelection()},Dt.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Dt.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof ko&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Dt.prototype.canStopCommand=function(){return!0},Dt.prototype.selectAll=function(){var a=this.diagram;a.N();try{a.currentCursor="wait",a.R("ChangingSelection",a.selection);for(var y=a.parts;y.next();)y.value.isSelected=!0;for(var x=a.nodes;x.next();)x.value.isSelected=!0;for(var E=a.links;E.next();)E.value.isSelected=!0}finally{a.R("ChangedSelection",a.selection),a.currentCursor=""}},Dt.prototype.canSelectAll=function(){return this.diagram.allowSelect},Dt.prototype.deleteSelection=function(){var a=this.diagram;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Delete"),a.R("SelectionDeleting",a.selection);for(var y=new ke,x=a.selection.iterator;x.next();)Eh(y,x.value,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,function(E){return E.canDelete()});a.Is(y,!0),a.R("SelectionDeleted",y)}finally{a.eb("Delete"),a.R("ChangedSelection",a.selection),a.currentCursor=""}},Dt.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Dt.prototype.copySelection=function(){var a=this.diagram,y=new ke;for(a=a.selection.iterator;a.next();)Eh(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Dt.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Dt.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Dt.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Dt.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)ad=null,wh="";else{x=y.model;var E=!1,b=!1,z=null;try{x.Tl()&&(E=x.Jj,x.Jj=this.copiesParentKey),x.Wj()&&(b=x.Ij,x.Ij=this.copiesGroupKey),z=y.Kj(a,null,!0)}finally{x.Tl()&&(x.Jj=E),x.Wj()&&(x.Ij=b),x=new be,x.addAll(z),ad=x,wh=y.model.dataFormat}}y.R("ClipboardChanged",x)},Dt.prototype.pasteFromClipboard=function(){var a=new ke,y=ad;if(y===null)return a;var x=this.diagram;if(wh!==x.model.dataFormat)return a;var E=x.model,b=!1,z=!1,tt=null;try{E.Tl()&&(b=E.Jj,E.Jj=this.copiesParentKey),E.Wj()&&(z=E.Ij,E.Ij=this.copiesGroupKey),tt=x.Kj(y,x,!1)}finally{for(E.Tl()&&(E.Jj=b),E.Wj()&&(E.Ij=z),y=tt.iterator;y.next();)x=y.value,E=y.key,x.location.w()||(E.location.w()?x.location=E.location:!x.position.w()&&E.position.w()&&(x.position=E.position)),a.add(x)}return a},Dt.prototype.pasteSelection=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Paste");var x=this.pasteFromClipboard();0<x.count&&y.clearSelection(!0);for(var E=x.iterator;E.next();)E.value.isSelected=!0;if(a!==null){var b=y.computePartsBounds(y.selection);if(b.w()){var z=this.computeEffectiveCollection(y.selection,y.Wm);Sh(y,z,new At(a.x-b.centerX,a.y-b.centerY),y.Wm,!1)}}y.R("ClipboardPasted",x)}finally{y.eb("Paste"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Dt.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||ad===null||ad.count===0||wh!==a.model.dataFormat)},Dt.prototype.undo=function(){this.diagram.undoManager.undo()},Dt.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Dt.prototype.redo=function(){this.diagram.undoManager.redo()},Dt.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Dt.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===$r&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Dt.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==$r?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Dt.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===$r&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Dt.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==$r?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Dt.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Dt.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Dt.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;Al(y,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&E===this.Au&&!isNaN(this.Jt)&&a.documentBounds.D(this.yu)?(a.scale=this.Jt,a.position=this.sw,this.Au=NaN,this.yu=Vi):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),Wf(y)},Dt.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Dt.prototype.scrollToPart=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.Va(),a===null){try{this.cg!==null&&(this.cg.next()?a=this.cg.value:this.cg=null)}catch(rt){this.cg=null}a===null&&(0<y.highlighteds.count?this.cg=y.highlighteds.iterator:0<y.selection.count&&(this.cg=y.selection.iterator),this.cg!==null&&this.cg.next()&&(a=this.cg.value))}if(a!==null){var x=y.animationManager;Al(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=Ut(this,a,[a]);if(b.length===1)y.Ea(),y.es(a.actualBounds),y.eb("Scroll To Part");else{var z=function(){y.Ea();for(var rt=b.pop();0<b.length&&rt instanceof tn&&rt.isTreeExpanded&&(!(rt instanceof Jn)||rt.isSubGraphExpanded);)rt=b.pop();0<b.length?(rt instanceof Ln&&y.tv(rt.actualBounds),rt instanceof tn&&!rt.isTreeExpanded&&(rt.isTreeExpanded=!0),rt instanceof Jn&&!rt.isSubGraphExpanded&&(rt.isSubGraphExpanded=!0)):(rt instanceof Ln&&y.es(rt.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){Ni(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",tt),z()}}else{var ot=y.position.copy();y.es(a.actualBounds),ot.Xa(y.position)&&x.Cc()}}};function Ut(a,y,x){if(y.isVisible())return x;if(y instanceof Ai)Ut(a,y.adornedPart,x);else if(y instanceof Ue){var E=y.fromNode;E!==null&&Ut(a,E,x),y=y.toNode,y!==null&&Ut(a,y,x)}else y instanceof tn&&(E=y.labeledLink,E!==null&&Ut(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),Ut(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),Ut(a,y,x));return x}Dt.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof Ln)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Dt.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),Al(y.animationManager,"Collapse Tree");var x=new be;if(a!==null&&a.isTreeExpanded)a.collapseTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof tn&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Dt.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof tn&&a.isTreeExpanded))return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof tn&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Dt.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),Al(y.animationManager,"Expand Tree");var x=new be;if(a!==null&&!a.isTreeExpanded)a.expandTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof tn&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Dt.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof tn)||a.isTreeExpanded)return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof tn&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Dt.prototype.groupSelection=function(){var a=this.diagram,y=a.model;if(y.Xj()){var x=this.archetypeGroupData;if(x!==null){var E=null;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Group");for(var b=new be,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var ot=new be,rt=b.iterator;rt.next();){var at=rt.value;z=!1;for(var ut=b.iterator;ut.next();)if(at.Td(ut.value)){z=!0;break}z||ot.add(at)}if(0<ot.count){var ct=ot.first().containingGroup;if(ct!==null)for(;ct!==null;){b=!1;for(var mt=ot.iterator;mt.next();)if(!mt.value.Td(ct)){b=!0;break}if(b)ct=ct.containingGroup;else break}if(x instanceof Jn)za(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var yt=y.copyNodeData(x);Ve(yt)&&(y.xf(yt),E=a.ii(yt))}if(E!==null){ct!==null&&this.isValidMember(ct,E)&&(E.containingGroup=ct);for(var St=ot.iterator;St.next();){var Mt=St.value;this.isValidMember(E,Mt)&&(Mt.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Dt.prototype.canGroupSelection=function(){var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowGroup||!a.model.Xj()||this.archetypeGroupData===null)return!1;for(a=a.selection.iterator;a.next();){var y=a.value;if(y.Zc()&&y.canGroup())return!0}return!1};function ce(a){var y=Un();for(a=a.iterator;a.next();){var x=a.value;x instanceof Ue||y.push(x)}a=new ke,x=y.length;for(var E=0;E<x;E++){for(var b=y[E],z=!0,tt=0;tt<x;tt++)if(b.Td(y[tt])){z=!1;break}z&&a.add(b)}return _n(y),a}Dt.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof Ue)return!1;if(a!==null){if(a===y||a.Td(y))return!1;var x=a.memberValidation;if(x!==null&&!x(a,y)||a.data===null&&y.data!==null||a.data!==null&&y.data===null)return!1}return x=this.memberValidation,x!==null?x(a,y):!0},Dt.prototype.ungroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.model;if(x.Xj())try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Ungroup");var E=new be;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof Jn&&z.canUngroup()&&E.add(z)}var tt=new be;if(0<E.count){y.clearSelection(!0);for(var ot=E.iterator;ot.next();){var rt=ot.value;rt.expandSubGraph();var at=rt.containingGroup,ut=at!==null&&at.data!==null?x.wa(at.data):void 0;tt.addAll(rt.memberParts);for(var ct=tt.iterator;ct.next();){var mt=ct.value;if(mt.isSelected=!0,!(mt instanceof Ue)){var yt=mt.data;yt!==null?x.mp(yt,ut):mt.containingGroup=at}}y.remove(rt)}}y.R("SelectionUngrouped",E,tt)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Dt.prototype.canUngroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowDelete||!y.allowUngroup||!y.model.Xj())return!1;if(a!==null){if(!(a instanceof Jn))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Jn&&y.canUngroup())return!0;return!1},Dt.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=ce(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Dt.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),Al(y.animationManager,"Collapse SubGraph");var x=new be;if(a!==null&&a.isSubGraphExpanded)a.collapseSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof Jn&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Dt.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof Jn&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Jn&&y.isSubGraphExpanded)return!0;return!1},Dt.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),Al(y.animationManager,"Expand SubGraph");var x=new be;if(a!==null&&!a.isSubGraphExpanded)a.expandSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof Jn&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Dt.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof Jn&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Jn&&!y.isSubGraphExpanded)return!0;return!1},Dt.prototype.editTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.toolManager.findTool("TextEditing");if(x!==null){if(a===null){a=null;for(var E=y.selection.iterator;E.next();){var b=E.value;if(b.canEdit()){a=b;break}}if(a===null)return;a=a.Nl(function(z){return z instanceof io&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Dt.prototype.canEditTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowTextEdit||y.toolManager.findTool("TextEditing")===null)return!1;if(a!==null){if(!(a instanceof io))return!1;if(a=a.part,a!==null&&a.canEdit())return!0}else for(y=y.selection.iterator;y.next();)if(a=y.value,a.canEdit()&&(a=a.Nl(function(x){return x instanceof io&&x.editable}),a!==null))return!0;return!1},Dt.prototype.showContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");if(x!==null&&(a===void 0&&(a=0<y.selection.count?y.selection.first():y),a=x.findObjectWithContextMenu(a),a!==null)){var E=y.lastInput,b=null;a instanceof Xt?b=a.ga(Mi):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new At(b.x+b.width/2,b.y+b.height/2)),b!==null&&(E.viewPoint=y.op(b),E.documentPoint=b,E.left=!1,E.right=!0,E.up=!0),y.currentTool=x,tu(x,!1,a)}},Dt.prototype.canShowContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");return x===null?!1:(a===void 0&&(a=0<y.selection.count?y.selection.first():y),x.findObjectWithContextMenu(a)!==null)},Dt.prototype.computeEffectiveCollection=function(a,y){var x=this.diagram,E=x.toolManager.findTool("Dragging"),b=x.currentTool===E;if(y===void 0&&(y=b?E.dragOptions:x.Wm),E=new qe,a===null)return E;for(var z=a.iterator;z.next();)Ol(x,E,z.value,b,y);if(x.draggedLink!==null&&y.dragsLink)return E;for(z=a.iterator;z.next();)a=z.value,a instanceof Ue&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},Ie.Object.defineProperties(Dt.prototype,{diagram:{get:function(){return this.H}},copiesClipboardData:{get:function(){return this.o},set:function(a){this.o=a}},copiesConnectedLinks:{get:function(){return this.u},set:function(a){this.u=a}},deletesConnectedLinks:{get:function(){return this.Ha},set:function(a){this.Ha=a}},copiesTree:{get:function(){return this.ia},set:function(a){this.ia=a}},deletesTree:{get:function(){return this.nb},set:function(a){this.nb=a}},copiesParentKey:{get:function(){return this.V},set:function(a){this.V=a}},copiesGroupKey:{get:function(){return this.F},set:function(a){this.F=a}},archetypeGroupData:{get:function(){return this.j},set:function(a){this.j=a}},memberValidation:{get:function(){return this.ij},set:function(a){this.ij=a}},defaultScale:{get:function(){return this.diagram.defaultScale},set:function(a){this.diagram.defaultScale=a}},zoomFactor:{get:function(){return this.Hb},set:function(a){1<a||de("zoomFactor must be larger than 1.0, not: "+a),this.Hb=a}},isZoomToFitRestoreEnabled:{get:function(){return this.hb},set:function(a){this.hb=a}},scrollToPartPause:{get:function(){return this.ob},set:function(a){this.ob=a}}}),Dt.className="CommandHandler",Kp=function(){return new Dt};function Xt(){vi(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new At(NaN,NaN).freeze(),this.jd=Ar,this.Ab=new ci,this.wh=new ci,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=Ys,this.uc=new pe(NaN,NaN,NaN,NaN).freeze(),this.Ib=new pe(NaN,NaN,NaN,NaN).freeze(),this.dc=new pe(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=Ir,this.Ag=this.io=0,this.V=this.tb=this.Dh=this.A=this.Ua=null,this.Uc=!1,this.jo=this.Ng=null}var Re,Fe,gn,xn,Nn,Qn,wi,si,Ei,$i;Xt.prototype.cloneProtected=function(a){a.l=this.l|6144,a.pb=this.pb,a.bn=this.bn,a.Ma=this.Ma,a.pa.assign(this.pa),a.jd=this.jd.J(),this.Lb!==null?a.Lb=this.Lb.copy():a.Lb=null,a.Ca=this.Ca,a.Kb=this.Kb,a.Kg=this.Kg.J(),a.uc.assign(this.uc),a.Ib.assign(this.Ib),a.dc.assign(this.dc),a.Yn=this.Yn,this.ba!==null&&(a.ba=this.ba.copy()),a.Jb=this.Jb.J(),a.sk=this.sk.J(),a.io=this.io,a.Ag=this.Ag,this.Ua!==null&&(a.Ua=this.Ua.copy()),this.A!==null&&(a.A=this.A.nc?this.A:this.A.copy()),this.Dh!==null&&(a.Dh=wo(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},Xt.prototype.Vw=function(a){var y=this.Dh;if(jn(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},Xt.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},Xt.prototype.clone=function(){var a=new this.constructor;if(this.cloneProtected(a),this.Dh!==null)for(var y=0;y<this.Dh.length;y++){var x=this.Dh[y];a[x]=this[x]}return a},Xt.prototype.copy=function(){return this.clone()},xt=Xt.prototype,xt.qb=function(a){a.classType===Ue?a.name.indexOf("Orient")===0?this.segmentOrientation=a:de("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===Xt&&(this.stretch=a)},xt.toString=function(){return ti(this.constructor)+"#"+qt(this)},xt.th=function(){this.A!==null&&(this.A.nc=!0)};function ii(a){a.A===null?a.A=new of:a.A.nc&&(a.A=a.A.copy())}xt.Xc=function(){if(this.ba===null){var a=new Dg;a.Xi=hr,a.yj=hr,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},xt.cb=function(a,y,x,E,b,z,tt){var ot=this.part;if(ot!==null&&(ot.gk(a,y,x,E,b,z,tt),x===this&&a===Eo&&Dr(this)&&ho(this,ot,y),z=this.diagram,this.animationTriggers===null||z===null||!z.pi||z.undoManager.isUndoingRedoing||z.animationManager.Dm||(a=this.animationTriggers.get(y),a!==null&&z.animationManager.isEnabled&&!z.animationManager.isTicking&&(this.jo===null&&(this.jo=new qe),tt=z.undoManager.transactionLevel===0,a.startCondition===mh?tt=!0:a.startCondition===td&&(tt=!1),tt?(z=new zr,Wp(a,z),tt=this.jo.get(a),tt!==null&&tt.stop(),this.jo.add(a,z),z.vu=this,z.Nw=a,z.add(this,y,E,b),z.start()):(Al(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof ze&&x===ot&&(ot.l&16777216)!==0&&ot.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)ot=x[b],ot instanceof ze&&gd(ot,function(rt){rt.data!==null&&rt.l&16777216&&rt.La(y)})};function ho(a,y,x){var E=a.ih();if(E!==null)for(var b=a.localBindings.iterator;b.next();){var z=b.value,tt=null;if(z.sourceName!==null){if(tt=MS(z,E,a),tt===null)continue;z.sp(a,tt,x,null)}else if(z.isToModel){var ot=y.diagram;ot===null||ot.skipsModelSourceBindings||z.sp(a,ot.model.modelData,x,E)}else{if(ot=E.data,ot===null)continue;var rt=y.diagram;rt===null||rt.skipsModelSourceBindings||z.sp(a,ot,x,E)}tt===a&&(ot=E.ks(z.Ai),ot!==null&&z.Mv(ot,tt,x))}}xt.ks=function(a){return this.bindingId===a?this:null},xt.g=function(a,y,x){this.cb(Eo,a,this,y,x)},xt.Ge=function(a,y,x,E){var b=this.uc;if(b.h(a,y,x,E),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new ci);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function mr(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}xt.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?Ui(a.x,a.y,0,0,0,E.height)<=y||Ui(a.x,a.y,0,E.height,E.width,E.height)<=y||Ui(a.x,a.y,E.width,E.height,E.width,0)<=y||Ui(a.x,a.y,E.width,0,0,0)<=y:a.zd(0,0)<=y&&a.zd(0,E.height)<=y&&a.zd(E.width,0)<=y&&a.zd(E.width,E.height)<=y},xt.se=function(){return!0},xt.ca=function(a){var y=At.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return At.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),tt=z/2,ot=this.naturalBounds;E=this.Df()*E.scale;var rt=1/E;if(ot.width*E<b&&ot.height*E<b)return a=$o(x.x-tt*rt,x.y-tt*rt,x.width+z*rt,x.height+z*rt,y.x,y.y),At.free(y),a}return b=!1,(this instanceof Ai||this instanceof ei?$o(x.x-5,x.y-5,x.width+10,x.height+10,y.x,y.y):x.ca(y))&&(this.tb&&!this.tb.ca(y)?b=!1:this.areaBackground!==null&&x.ca(y)||this.Ma!==null&&this.dc.ca(a)?b=!0:b=this.gh(a)),At.free(y),b},xt.gh=function(a){var y=this.naturalBounds;return $o(0,0,y.width,y.height,a.x,a.y)},xt.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=pe.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=At.allocAt(a.x,a.y);return y.ca(x.Cd(b))&&(b.h(a.x,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.y),y.ca(x.Cd(b))&&(E=!0)))),At.free(b),pe.free(y),E},xt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=At.allocAt(0,0);return a.ca(y.Ga(b))&&(b.h(0,x.height),a.ca(y.Ga(b))&&(b.h(x.width,x.height),a.ca(y.Ga(b))&&(b.h(x.width,0),a.ca(y.Ga(b))&&(E=!0)))),At.free(b),E},xt.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=At.allocAt(0,0),b=At.allocAt(0,x.height),z=At.allocAt(x.width,x.height),tt=At.allocAt(x.width,0),ot=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(tt)))ot=!0;else{x=pe.allocAt(0,0,x.width,x.height);var rt=At.allocAt(a.x,a.y);x.ca(y.Cd(rt))?ot=!0:(rt.h(a.x,a.bottom),x.ca(y.Cd(rt))?ot=!0:(rt.h(a.right,a.bottom),x.ca(y.Cd(rt))?ot=!0:(rt.h(a.right,a.y),x.ca(y.Cd(rt))&&(ot=!0)))),At.free(rt),pe.free(x),!ot&&(Jt.us(a,E,b)||Jt.us(a,b,z)||Jt.us(a,z,tt)||Jt.us(a,tt,E))&&(ot=!0)}return At.free(E),At.free(b),At.free(z),At.free(tt),ot},xt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof Sn){var x=this.naturalBounds;y.h(a.x*x.width+a.offsetX,a.y*x.height+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},xt.mi=function(a){a===void 0&&(a=new pe);var y=this.naturalBounds,x=this.oe,E=At.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),yo(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),yo(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),yo(a,E.x,E.y,0,0),At.free(E),a},xt.li=function(){var a=this.oe;return a.m11===1&&a.m12===0?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360)),a},xt.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},xt.qs=function(a,y){return y===void 0&&(y=new At),y.assign(a),this.oe.Cd(y),y},xt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},xt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),ot=z.m22*tt,rt=-z.m12*tt,at=-z.m21*tt,ut=z.m11*tt,ct=tt*(z.m21*z.dy-z.m22*z.dx),mt=tt*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,Jt.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(tt=a*ot+y*at+ct,a=a*rt+y*ut+mt,y=x*ot+E*at+ct,x=x*rt+E*ut+mt,b.h(0,0),E=this.naturalBounds,x=Jt.Ff(0,0,E.width,E.height,tt,a,y,x,b),b.transform(z),x)},Xt.prototype.measure=function(a,y,x,E){if(da(this)!==!1){var b=this.Kg,z=b.right+b.left;b=b.top+b.bottom,a=Math.max(a-z,0),y=Math.max(y-b,0),x=Math.max((x||0)-z,0),E=Math.max((E||0)-b,0),z=this.angle,b=this.desiredSize;var tt=this.kq();z===90||z===270?(a=isFinite(b.height)?b.height+tt:a,y=isFinite(b.width)?b.width+tt:y):(a=isFinite(b.width)?b.width+tt:a,y=isFinite(b.height)?b.height+tt:y),b=x||0,tt=E||0;var ot=this instanceof ze;switch(Es(this,!0)){case Fe:tt=b=0,ot&&(y=a=1/0);break;case Re:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(tt=y);break;case xn:isFinite(a)&&a>x&&(b=a),tt=0,ot&&(y=1/0);break;case Nn:isFinite(y)&&y>E&&(tt=y),b=0,ot&&(a=1/0)}ot=this.maxSize;var rt=this.minSize;b>ot.width&&rt.width<ot.width&&(b=ot.width),tt>ot.height&&rt.height<ot.height&&(tt=ot.height),x=Math.max(b,rt.width),E=Math.max(tt,rt.height),ot.width<x&&(x=Math.min(rt.width,x)),ot.height<E&&(E=Math.min(rt.height,E)),a=Math.min(ot.width,a),y=Math.min(ot.height,y),a=Math.max(x,a),y=Math.max(E,y),(z===90||z===270)&&(z=a,a=y,y=z,z=x,x=E,E=z),this.uc.ka(),this.Wl(a,y,x,E),this.uc.freeze(),this.uc.w()||de("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),nr(this,!1)}},Xt.prototype.Wl=function(){},Xt.prototype.Dd=function(){return!1},Xt.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=pe.alloc();z.assign(this.Ib),this.Ib.ka(),fs(this)===!1?this.Ib.h(a,y,x,E):this.eh(a,y,x,E),this.Ib.freeze(),b===void 0?this.tb=null:this.tb=b,x=!1,b!==void 0?x=!0:(b=this.panel,b!==null&&zu(b)&&(b=b.panel),b!==null&&(b=b.dc,E=this.measuredBounds,this.areaBackground!==null&&(E=this.Ib),x=y+E.height,E=a+E.width,x=!(0<=a+.05&&E<=b.width+.05&&0<=y+.05&&x<=b.height+.05),this instanceof io&&(a=this.naturalBounds,this.Lq>a.height||this.Cb>a.width))&&(x=!0)),this.l=x?this.l|256:this.l&-257,this.Ib.w()||de("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Il(this,!1),pe.free(z)},xt=Xt.prototype,xt.eh=function(){};function ts(a,y,x,E,b){if(a.Ib.h(y,x,E,b),!a.desiredSize.w()){var z=a.uc;x=a.Kg,y=x.right+x.left;var tt=x.top+x.bottom;switch(x=z.width+y,z=z.height+tt,E+=y,b+=tt,y=Es(a,!0),x===E&&z===b&&(y=Fe),y){case Fe:(x>E||z>b)&&(nr(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case Re:nr(a,!0),a.measure(E,b,0,0);break;case xn:nr(a,!0),a.measure(E,z,0,0);break;case Nn:nr(a,!0),a.measure(x,b,0,0)}}}xt.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||jv(x,!0),this.N(),po(a,y)||(x.oh(),this.Pn(x)))},xt.Pn=function(a){this.portId!==null&&(jv(a,!0),a instanceof tn&&W1(a,this))},xt.gc=function(a,y){if(!La(this,a,y)&&this.visible){var x=this.opacity;if(x!==0){var E=1;x!==1&&(E=a.globalAlpha,a.globalAlpha=E*x);var b="";this.filter!==""&&(b=a.filter,a.filter=this.filter);var z=this instanceof ze&&zu(this),tt=this.Ib;if(z){var ot=this.Ib,rt=this.dc,at=this.areaBackground,ut=this.Ma;at===null&&ut===null||a.yc(),at!==null&&(zo(this,a,at,!0,!0,rt,ot),at instanceof Ki&&at.type===Ea?(a.beginPath(),a.rect(ot.x,ot.y,ot.width,ot.height),a.ng(at)):a.fillRect(ot.x,ot.y,ot.width,ot.height)),ut!==null&&(zo(this,a,ut,!0,!1,rt,ot),ut instanceof Ki&&ut.type===Ea?(a.beginPath(),a.rect(ot.x,ot.y,ot.width,ot.height),a.ng(ut)):a.fillRect(ot.x,ot.y,ot.width,ot.height)),this.hh(a,y)}if(!z&&(z||tt.width!==0&&tt.height!==0&&!isNaN(tt.x)&&!isNaN(tt.y))){z=this.transform,ot=this.panel,this.l&4096&&Tr(this),at=this.part,rt=!1;var ct=0;at&&y.Gf("drawShadows")&&(rt=at.isShadowed)&&(ut=at.shadowOffset,ct=Math.max(ut.y,ut.x)*y.scale*y.Mb),ut=this.Dd();var mt;if(!(mt=y.$i||!ut)){var yt=this.naturalBounds;mt=this.wh;var St=mt.m11,Mt=mt.m21,Ot=mt.dx,bt=mt.m12,jt=mt.m22,Gt=mt.dy,Wt,Kt=Wt=0;mt=Wt*St+Kt*Mt+Ot;var $t=Wt*bt+Kt*jt+Gt;Wt=yt.width+ct,Kt=0;var Qe=Wt*St+Kt*Mt+Ot;Wt=Wt*bt+Kt*jt+Gt,Kt=Math.min(mt,Qe);var dn=Math.min($t,Wt),rn=Math.max(mt+0,Qe)-Kt,We=Math.max($t+0,Wt)-dn;mt=Kt,$t=dn,Wt=yt.width+ct,Kt=yt.height+ct,Qe=Wt*St+Kt*Mt+Ot,Wt=Wt*bt+Kt*jt+Gt,Kt=Math.min(mt,Qe),dn=Math.min($t,Wt),rn=Math.max(mt+rn,Qe)-Kt,We=Math.max($t+We,Wt)-dn,mt=Kt,$t=dn,Wt=0,Kt=yt.height+ct,Qe=Wt*St+Kt*Mt+Ot,Wt=Wt*bt+Kt*jt+Gt,Kt=Math.min(mt,Qe),dn=Math.min($t,Wt),rn=Math.max(mt+rn,Qe)-Kt,We=Math.max($t+We,Wt)-dn,mt=Kt,$t=dn,ct=y.viewportBounds,yt=ct.x,St=ct.y,mt=!(mt>ct.width+yt||yt>rn+mt||$t>ct.height+St||St>We+$t)}if(mt){if(mt=(this.l&256)!==0,a.clipInsteadOfFill&&(mt=!1),this instanceof io&&(a.font=this.font),mt){if($t=ot.se()?ot.naturalBounds:ot.actualBounds,rn=Math.max(tt.x,$t.x),We=Math.max(tt.y,$t.y),ct=Math.min(tt.right,$t.right)-rn,yt=Math.min(tt.bottom,$t.bottom)-We,St=this.tb,St!==null&&(rn=St.x,We=St.y,ct=St.width,yt=St.height),rn>tt.width+tt.x||tt.x>$t.width+$t.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(rn,We,ct,yt),a.clip()}if(ut){if(!at.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}rt&&($t=at.shadowOffset,a.Ev($t.x*y.scale*this.scale*y.Mb,$t.y*y.scale*this.scale*y.Mb,at.shadowBlur),ru(a),a.shadowColor=at.shadowColor)}rt&&this.shadowVisible===!0?ru(a):rt&&this.shadowVisible===!1&&Rl(a),at=this.naturalBounds,this.areaBackground!==null&&(a.yc(),ha(this,a,at,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),rt&&Mr(this,ot)&&this.shadowVisible===null&&Rl(a),this.Ma!==null&&(a.yc(),Rs(this,a,at,tt)),rt&&(this.Ma!==null||this.areaBackground!==null||Mr(this,ot))?(Za(this,!0),this.shadowVisible===null&&Rl(a)):Za(this,!1),this.hh(a,y),rt&&this.l&512&&ru(a),ut&&rt&&Rl(a),mt&&(a.restore(),a.Vc(this instanceof ze)),z.ws()||(y=1/(z.m11*z.m22-z.m12*z.m21),a.transform(z.m22*y,-z.m12*y,-z.m21*y,z.m11*y,y*(z.m21*z.dy-z.m22*z.dx),y*(z.m12*z.dx-z.m11*z.dy)))}}x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b)}}};function Mr(a,y){return y===null?!1:(zu(y)&&(y=y.panel),(y.l&512)!==0||(y.type===ze.Auto||y.type===ze.Spot)&&y.Pb()!==a)}xt.Dv=function(){};function ha(a,y,x,E){zo(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof Ki&&a.areaBackground.type===Ea?(y.beginPath(),y.rect(E.x,E.y,E.width,E.height),y.ng(a.areaBackground)):y.fillRect(E.x,E.y,E.width,E.height)}function Rs(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,ot=x.width+b,rt=x.height+b;zo(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof Ki&&a.Ma.type===Ea?(y.beginPath(),y.rect(z-b/2,tt-b/2,ot,rt),y.ng(a.Ma)):y.fillRect(z-b/2,tt-b/2,ot,rt)}function Yr(a,y,x){for(var E=y.O.s,b=E.length,z=-1,tt=0;tt<b;tt++)if(E[tt]===a){z=tt;break}if(a=z,a!==-1)if(a===0)y.svg.gd?y.svg.gd.after(x):y.svg.Ma?y.svg.Ma.after(x):y.type===ze.Table?(y=y.svg.getElementsByClassName("gojs-ts"),y=y.length!==0?y[0]:null,y!==null&&y.after(x)):y.svg.prepend(x);else{for(;a!==0&&!y.M(a-1).Ed();)a--;a===0?y.svg.prepend(x):(a=y.M(a-1).svg,a!==null?a.after(x):y.svg.appendChild(x))}}function La(a,y,x){if(!(y instanceof qs))return!1;if(!a.visible||a.opacity===0||a.Dd()&&!a.isVisible())return a.svg!==null&&a.svg.parentNode!==null&&a.svg.remove(),!0;var E=a.panel,b=a.nk(y);if(a.kk(y,x,b))return a.svg.parentElement!==null?(a.Dd()&&(y.ti=a.svg),!0):(a.Dd()?(y.ti!==null?y.ti.after(a.svg):y.Nj.prepend(a.svg),y.ti=a.svg):E&&Yr(a,E,a.svg),!0);if(a.Dd()&&a.isShadowed){var z=a.shadowOffset;y.Ev(z.x*x.scale*a.scale*x.Mb,z.y*x.scale*a.scale*x.Mb,a.shadowBlur),ru(y),y.shadowColor=a.shadowColor}a instanceof io&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof ze;var ot=a instanceof ze?zu(a):!1;a.l&4096&&Tr(a);var rt=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&ot?(Og(y,1,0,0,1,0,0),a.svg=y.ad):z?(Og(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):Og(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var at=tt.copy().Vj();y.rb.ha=[at.m11,at.m12,at.m21,at.m22,at.dx,at.dy],ha(a,y,b,rt),y.rb.ha=[1,0,0,1,0,0],y.yd.gd=y.ad,y.yd.prepend(y.ad)}return z||(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),a.background!==null&&(z?(ot&&(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),Rs(a,y,b,rt),ot&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],Rs(a,y,b,rt)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),tt=y.yd,b=a.part,ot=!1,b&&x.Gf("drawShadows")&&(ot=b.isShadowed),y.clipInsteadOfFill&&(ot=!1),a.Dd()&&ot&&ru(y),ot&&a.shadowVisible===!0?ru(y):ot&&a.shadowVisible===!1&&Rl(y),b=a.panel,ot&&Mr(a,b)&&a.shadowVisible===null&&Rl(y),y.Il&&(at=x.computePixelRatio(),at="drop-shadow("+y.shadowOffsetX/at+"px "+y.shadowOffsetY/at+"px "+y.shadowBlur/at/2+"px "+y.shadowColor+")",a.background!==null&&tt.Ma.setAttributeNS(null,"filter",at),a.areaBackground!==null&&tt.gd.setAttributeNS(null,"filter",at)),ot&&(a.Ma!==null||a.areaBackground!==null||Mr(a,b))?(Za(a,!0),a.shadowVisible===null&&Rl(y)):Za(a,!1),b=ot,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),tt=y.Gv.hs,ot=z?a.svg:y.yd,at=a.svg,!z&&at!==null&&ot!==at&&at.parentNode===a.panel.svg?(a.svg.replaceWith(ot),a.svg=ot,ot!==null&&a.$o(y,E,rt,ot),Ms(y,at),!0):(a.svg=ot,tt!==null&&ot===null&&(lm(y),y.nh.pop()),ot===null||(a.$o(y,E,rt,ot),y.Il&&(x=x.computePixelRatio(),a.Dv(ot,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),b&&a.l&512&&ru(y),a.Dd()&&Rl(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&ot.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&ot.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(ot):y.Nj.prepend(ot),y.ti=ot):E!==null&&Yr(a,E,ot),tt!==null&&tt(a,ot)),!0)}xt.$o=function(a,y,x,E){var b=(this.l&256)!==0;if(a.clipInsteadOfFill&&(b=!1),b){var z=y.se()?y.naturalBounds:y.actualBounds;y=Math.max(x.x,z.x),b=Math.max(x.y,z.y);var tt=Math.min(x.right,z.right)-y;x=Math.min(x.bottom,z.bottom)-b,z=this.tb,z!==null&&(y=z.x,b=z.y,tt=z.width,x=z.height),z=E.getAttribute("clip-path");var ot=null;z!==null&&(ot=a.svg.getElementById(z.split("#")[1].slice(0,-1))),ot===null?(z="CLIP"+se++,ot=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:tt,height:x}),this instanceof ze&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),ot.appendChild(y),a.svg.appendChild(ot),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=ot.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",b.toString()),a.setAttribute("width",tt.toString()),a.setAttribute("height",x.toString()))}else E.removeAttributeNS(null,"clip-path"),Ms(a,E)};function Ms(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function Kr(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=vn(y);for(var E=y.next();!E.done;E=y.next())E=x.getElementById(E.value.split("#")[1].slice(0,-1)),E!==null&&E.remove()}a.svg.remove()}}xt.hh=function(){},xt.lv=function(){this.Uc=!0},xt.kk=function(a,y,x){if(this.Uc)return this.lv(),this.Uc=!1;if(y=this.svg,y===null)return!1;if(!this.visible)return y.remove(),!1;if(y.nodeName!=="g"&&x||y.nodeName==="g"&&!x)return!1;var E=this.transform,b=this instanceof ze?zu(this):!1;if(!(this instanceof ze&&b))if(this instanceof Ts){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&Zy(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",Jy(a)):y.setAttributeNS(null,"transform",Jy(a))}else if(!x||this instanceof ze)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof ei){z=y.getElementsByTagName("path");for(var tt=0;tt<z.length;tt++)z[tt].setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")")}else y.lastElementChild.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");return z=this.Dd()?this.opacity*a.globalAlpha:this.opacity,z===1?y.removeAttribute("opacity"):y.setAttributeNS(null,"opacity",z.toString()),a.rb.ha=[1,0,0,1,0,0],(this.areaBackground!==null||y.gd!==void 0)&&(z=y.gd,this.areaBackground===null?(y.gd.remove(),y.gd=void 0):(tt=E.copy().Vj(),a.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],ha(this,a,this.naturalBounds,this.actualBounds),a.rb.ha=[1,0,0,1,0,0],y.gd?(tt=y.gd.getAttribute("filter"),tt!==null&&a.ad.setAttribute("filter",tt),y.gd.replaceWith(a.ad)):y.prepend(a.ad),y.gd=a.ad),z&&um(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(um(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof ze))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),Rs(this,a,this.naturalBounds,this.actualBounds),y.Ma?(um(a,y.Ma),x=y.Ma.getAttribute("filter"),x!==null&&a.ad.setAttribute("filter",x),y.Ma.replaceWith(a.ad)):y.prepend(a.ad),y.Ma=a.ad),z&&um(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},xt.nk=function(a){if(this.background!==null||this.areaBackground!==null)return!0;var y=(this.l&256)!==0;return a.clipInsteadOfFill&&(y=!1),!!y};function zo(a,y,x,E,b,z,tt){if(x!==null){var ot=1,rt=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===ju)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var at=a.kq();if(ot=z.width,rt=z.height,b?(ot=tt.width,rt=tt.height):E||(ot+=at,rt+=at),(z=y instanceof cd)&&x.xe&&(x.type===fc||x.yk===ot&&x.ft===rt))var ut=x.xe;else{var ct=0,mt=0,yt=0,St=0,Mt=0,Ot=0;if(Ot=Mt=0,b?(Mt=tt.x,Ot=tt.y):E||(Mt-=at/2,Ot-=at/2),ct=x.start.x*ot+x.start.offsetX,mt=x.start.y*rt+x.start.offsetY,yt=x.end.x*ot+x.end.offsetX,St=x.end.y*rt+x.end.offsetY,ct+=Mt,yt+=Mt,mt+=Ot,St+=Ot,x.type===au)ut=y.createLinearGradient(ct,mt,yt,St);else if(x.type===Ea)Ot=isNaN(x.endRadius)?Math.max(ot,rt)/2:x.endRadius,isNaN(x.startRadius)?(Mt=0,Ot=Math.max(ot,rt)/2):Mt=x.startRadius,ut=y.createRadialGradient(ct,mt,Mt,yt,St,Ot);else if(x.type===fc)try{ut=y.createPattern(x.pattern,"repeat")}catch(jt){ut=null}if(x.type!==fc&&(b=x.colorStops,b!==null))for(b=b.iterator;b.next();)ut.addColorStop(b.key,b.value);if(z&&(x.xe=ut,ut!==null&&(x.yk=ot,x.ft=rt),ut===null&&x.type===fc&&x.yk!==-1)){x.yk=-1;var bt=a.diagram;bt!==null&&x.yk===-1&&Ni(function(){bt.redraw()},600)}}E?y.fillStyle=ut:y.strokeStyle=ut}}}xt.rg=function(a){if(a instanceof ze)t:{if(this!==a&&a!==null)for(var y=this.panel;y!==null;){if(y===a){a=!0;break t}y=y.panel}a=!1}else a=!1;return a},xt.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},xt.If=function(){for(var a=this instanceof ze?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Tr(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){Ra(a,!1);return}if(y.translate(a.Ib.x-a.uc.x,a.Ib.y-a.uc.y),a.scale!==1||a.angle!==0){var x=a.naturalBounds;a.no(y,x.x,x.y,x.width,x.height)}Ra(a,!1),ka(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,ka(a,!1)):y.oe!==null&&(x=a.wh,x.reset(),y.se()?x.multiply(y.wh):y.panel!==null&&x.multiply(y.panel.wh),x.multiply(a.Ab),a.Kk=a.scale*y.Kk,ka(a,!1)))}xt.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=At.alloc();z.yi(y,x,E,b,Mi),a.rotate(this.Kb,z.x,z.y),At.free(z)}},xt.v=function(a){if(!da(this)){a===void 0&&(a=!1),nr(this,!0),Il(this,!0);var y=this.panel;y===null||a||y.v()}},xt.Uj=function(){da(this)||(nr(this,!0),Il(this,!0))};function ds(a){if(!fs(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof tn&&a.Bd(),y.$b())),Il(a,!0)}}xt.Uk=function(){!(this.l&2048)&&(Ra(this,!0),ka(this,!0))},xt.Wu=function(){ka(this,!0)},xt.N=function(){var a=this.part;a!==null&&a.N()};function Es(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===ze.Table?al(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===ze.Auto&&E.Pb()===a?Er(a,Re,y):x===Qn?E!==null?E.type===ze.Spot&&E.Pb()===a?Er(a,Re,y):(x=E.defaultStretch,x===Qn?Er(a,Fe,y):Er(a,x,y)):Er(a,Fe,y):Er(a,x,y)}function al(a,y,x,E){var b=a.stretch;if(b!==Qn)return Er(a,b,E);var z=b=null;switch(y.stretch){case Nn:z=!0;break;case Re:z=!0}switch(x.stretch){case xn:b=!0;break;case Re:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===xn||y===Re),z===null&&(z=y===Nn||y===Re),b===!0&&z===!0?Er(a,Re,E):b===!0?Er(a,xn,E):z===!0?Er(a,Nn,E):Er(a,Fe,E)}function Er(a,y,x){if(x)return y;if(y===Fe||(x=a.desiredSize,x.w()))return Fe;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===xn)return Fe;if(y===Re)return Nn}else{if(y===Nn)return Fe;if(y===Re)return xn}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Nn)return Fe;if(y===Re)return xn}else{if(y===xn)return Fe;if(y===Re)return Nn}return y}function Za(a,y){a.l=y?a.l|512:a.l&-513}function Dr(a){return(a.l&1024)!==0}function nf(a,y){a.l=y?a.l|1024:a.l&-1025}function Ra(a,y){a.l=y?a.l|2048:a.l&-2049}function ka(a,y){a.l=y?a.l|4096:a.l&-4097}function da(a){return(a.l&8192)!==0}function nr(a,y){a.l=y?a.l|8192:a.l&-8193}function fs(a){return(a.l&16384)!==0}function Il(a,y){a.l=y?a.l|16384:a.l&-16385}xt.Gj=function(){this.svg=null},xt.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},xt.Av=function(){},xt.zv=function(a){return this.pa=a,ds(this),!0},xt.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},xt.kq=function(){return 0};function dd(a){var y=a.part;if(y instanceof tn&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||W1(y,a)}}function Ky(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof ze?a instanceof tn?a.Bd():a.qm(a,function(x){dd(x)}):dd(a))}xt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new Jo(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&f1(a)&&de("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new be),this.localBindings.add(b),this},xt.set=function(a){return Object.assign(this,a),this},xt.Du=function(a){return nv(this,a),this},xt.apply=function(a){return a(this),this},xt.nm=function(a){return id(this,a),this},xt.pz=function(){return this.ih()},xt.ih=function(){for(var a=this instanceof ze?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},xt.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new qe),this.animationTriggers.add(a.propertyName,a),this};function Ma(a,y){for(var x=1;x<arguments.length;++x);x=arguments;var E=null,b=null;if(typeof a=="function")b=a;else if(typeof a=="string"){var z=sc.I(a);typeof z=="function"?(x=wo(arguments),E=z(x),Ve(E)||de('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=me.go[a]}if(E===null&&(b!=null&&b.constructor||de("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),E=new b),b=1,E instanceof te&&1<x.length){z=E;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&(ug(z,tt),b++)}for(;b<x.length;b++)z=x[b],z===void 0?de("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):nv(E,z);return E}function nv(a,y){if(typeof y=="string")if(a instanceof io)a.text=y;else if(a instanceof ei)a.figure=y;else if(a instanceof Ts)a.source=y;else if(a instanceof ze)y=Ja.I(y),y!==null&&(a.type=y);else if(a instanceof Ki){var x=Mn(Ki,y);x!==null?a.type=x:de("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof Xe?(y=Mn(Xe,y),y!==null&&(a.type=y)):a instanceof Oi&&(y=Mn(Oi,y),y!==null&&(a.type=y));else if(y instanceof Xt)a instanceof ze||de("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof ir){var E;y.isRow&&typeof a.getRowDefinition=="function"?E=a.getRowDefinition(y.index):y.isRow||typeof a.getColumnDefinition!="function"||(E=a.getColumnDefinition(y.index)),E instanceof ir?km(E,y):de("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof ae)typeof a.qb=="function"&&a.qb(y);else if(y instanceof lr)a.type=y;else if(y instanceof Jo)a instanceof Xt||a instanceof ir?a.bind(y):de("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Ka)a instanceof Xt?a.Jv(y):de("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof gr)a instanceof Xe&&a.type===Xe.o?a.figures.add(y):de("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Oi)a instanceof gr?a.segments.add(y):de("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof xo)a instanceof te||a instanceof Jn?a.layout=y:de("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(y))for(x=0;x<y.length;x++)nv(a,y[x]);else if(typeof y=="object"&&y!==null)if(a instanceof Ki){x=new Se;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);id(a,x)}else if(a instanceof ir){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&de("Must specify non-negative integer row for RowColumnDefinition "+y+", not: "+b),a.isRow=!0,a.index=b):y.column!==void 0&&(b=y.column,(b==null||b===1/0||isNaN(b)||0>b)&&de("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new Se;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);id(a,b)}else id(a,y);else de('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Ru(a,y){sc.add(a,y)}function am(a,y,x){x===void 0&&(x=null);var E=a[1];if(typeof x=="function"?x(E):typeof E=="string")return a.splice(1,1),E;if(y===void 0)throw Error("no "+(typeof x=="function"?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return y}Ie.Object.defineProperties(Xt.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new of),this.A.zp=a)}},localBindings:{get:function(){return this.A!==null?this.A.te:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new of),this.A.te=a)}},srcBindings:{get:function(){return this.A!==null?this.A.wm:null},set:function(a){this.srcBindings!==a&&(this.A===null&&(this.A=new of),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(ii(this),this.A.Ci=a,this.Uc=!0,this.N(),this.g("shadowVisible",y,a))}},enabledChanged:{get:function(){return this.A!==null?this.A.Hb:null},set:function(a){var y=this.enabledChanged;y!==a&&(ii(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:ps},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new Lh),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===ps&&(this.angle=0))}},segmentIndex:{get:function(){return this.Ua!==null?this.Ua.u:-1/0},set:function(a){a=Math.round(a);var y=this.segmentIndex;y!==a&&(this.Ua===null&&(this.Ua=new Lh),this.Ua.u=a,this.v(),this.g("segmentIndex",y,a))}},segmentFraction:{get:function(){return this.Ua!==null?this.Ua.o:0},set:function(a){isNaN(a)||0>a?a=0:1<a&&(a=1);var y=this.segmentFraction;y!==a&&(this.Ua===null&&(this.Ua=new Lh),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:An},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new Lh),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:Qn},set:function(a){var y=this.stretch;y!==a&&(ii(this),this.A.hg=a,this.v(),this.g("stretch",y,a))}},name:{get:function(){return this.A!==null?this.A.xa:""},set:function(a){var y=this.name;y!==a&&(ii(this),this.A.xa=a,this.part!==null&&(this.part.Rh=null),this.g("name",y,a))}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&qn(a,"0 <= value <= 1",Xt,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(vd(y,y.actualBounds)))}},filter:{get:function(){return this.bn},set:function(a){var y=this.bn;y!==a&&(this.bn=a,this.Uc=!0,this.g("filter",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(vd(y,y.actualBounds)))}},visible:{get:function(){return(this.l&1)!==0},set:function(a){var y=(this.l&1)!==0;y!==a&&(this.l^=1,this.g("visible",y,a),y=this.panel,y!==null?y.v():this.Dd()&&this.Zb(a),this.N(),Ky(this))}},pickable:{get:function(){return(this.l&2)!==0},set:function(a){var y=(this.l&2)!==0;y!==a&&(this.l^=2,this.g("pickable",y,a))}},fromLinkableDuplicates:{get:function(){return(this.l&4)!==0},set:function(a){var y=(this.l&4)!==0;y!==a&&(this.l^=4,this.g("fromLinkableDuplicates",y,a))}},fromLinkableSelfNode:{get:function(){return(this.l&8)!==0},set:function(a){var y=(this.l&8)!==0;y!==a&&(this.l^=8,this.g("fromLinkableSelfNode",y,a))}},toLinkableDuplicates:{get:function(){return(this.l&16)!==0},set:function(a){var y=(this.l&16)!==0;y!==a&&(this.l^=16,this.g("toLinkableDuplicates",y,a))}},toLinkableSelfNode:{get:function(){return(this.l&32)!==0},set:function(a){var y=(this.l&32)!==0;y!==a&&(this.l^=32,this.g("toLinkableSelfNode",y,a))}},isPanelMain:{get:function(){return(this.l&64)!==0},set:function(a){var y=(this.l&64)!==0;y!==a&&(this.l^=64,this.v(),this.g("isPanelMain",y,a))}},isActionable:{get:function(){return(this.l&128)!==0},set:function(a){var y=(this.l&128)!==0;y!==a&&(this.l^=128,this.g("isActionable",y,a))}},areaBackground:{get:function(){return this.A!==null?this.A.gd:null},set:function(a){var y=this.areaBackground;y!==a&&(a!==null&&sf(a,"GraphObject.areaBackground"),a instanceof Ki&&a.freeze(),ii(this),this.A.gd=a,this.N(),this.g("areaBackground",y,a))}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&sf(a,"GraphObject.background"),a instanceof Ki&&a.freeze(),this.Ma=a,this.N(),this.g("background",y,a))}},part:{get:function(){if(this.Dd())return this;if(this.Ng!==null)return this.Ng;var a;for(a=this.panel;a;){if(a instanceof Ln)return this.Ng=a;a=a.panel}return null}},svg:{get:function(){return this.V},set:function(a){this.V=a}},panel:{get:function(){return this.Me}},layer:{get:function(){var a=this.part;return a!==null?a.layer:null}},diagram:{get:function(){var a=this.part;return a!==null?a.diagram:null}},position:{get:function(){return this.pa},set:function(a){var y=a.x,x=a.y,E=this.pa,b=E.x;E=E.y,(b===y||isNaN(b)&&isNaN(y))&&(E===x||isNaN(E)&&isNaN(x))?this.Av():(a=a.copy(),this.zv(a,b,E)&&this.g("position",new At(b,E),a))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&(0>=a&&de("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ca=a,this.v(),this.g("scale",y,a))}},angle:{get:function(){return this.Kb},set:function(a){var y=this.Kb;y!==a&&(a%=360,0>a&&(a+=360),y!==a&&(this.Kb=a,Ky(this),this.v(),this.g("angle",y,a)))}},desiredSize:{get:function(){return this.jd},set:function(a){var y=a.width,x=a.height,E=this.jd,b=E.width,z=E.height;(b===y||isNaN(b)&&isNaN(y))&&(z===x||isNaN(z)&&isNaN(x))||(this.jd=a=a.J(),this.v(),this instanceof ei&&this.qc(),this.g("desiredSize",E,a),Dr(this)&&(a=this.part,a!==null&&(ho(this,a,"width"),ho(this,a,"height"))))}},width:{get:function(){return this.jd.width},set:function(a){var y=this.jd.width;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new Le(a,this.jd.height).freeze(),this.v(),this instanceof ei&&this.qc(),this.g("desiredSize",y,a),Dr(this)&&(a=this.part,a!==null&&ho(this,a,"width")))}},height:{get:function(){return this.jd.height},set:function(a){var y=this.jd.height;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new Le(this.jd.width,a).freeze(),this.v(),this instanceof ei&&this.qc(),this.g("desiredSize",y,a),Dr(this)&&(a=this.part,a!==null&&ho(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:gi},set:function(a){var y=this.minSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),ii(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:Wo},set:function(a){var y=this.maxSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=1/0),isNaN(a.height)&&(a.height=1/0),a.freeze(),ii(this),this.A.o=a,this.v(),this.g("maxSize",y,a))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.Kg;y.D(a)||(this.Kg=a=a.J(),this.v(),this.g("margin",y,a))}},transform:{get:function(){return this.l&2048&&Tr(this),this.Ab}},oe:{get:function(){return this.l&4096&&Tr(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(ii(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Fe},set:function(a){this.reshapingBehavior!==a&&(ii(this),this.A.Pf=a)}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(a.Mc()&&!a.Xb()&&de("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),ds(this),this.g("alignment",y,a))}},column:{get:function(){return this.Ag},set:function(a){a=Math.round(a);var y=this.Ag;y!==a&&(0>a&&qn(a,">= 0",Xt,"column"),this.Ag=a,this.v(),this.g("column",y,a),this.svg!==null&&this.svg.remove())}},columnSpan:{get:function(){return this.A!==null?this.A.ob:1},set:function(a){a=Math.round(a);var y=this.columnSpan;y!==a&&(1>a&&qn(a,">= 1",Xt,"columnSpan"),ii(this),this.A.ob=a,this.v(),this.g("columnSpan",y,a))}},row:{get:function(){return this.io},set:function(a){a=Math.round(a);var y=this.io;y!==a&&(0>a&&qn(a,">= 0",Xt,"row"),this.io=a,this.v(),this.g("row",y,a),this.svg!==null&&this.svg.remove())}},rowSpan:{get:function(){return this.A!==null?this.A.Bi:1},set:function(a){a=Math.round(a);var y=this.rowSpan;y!==a&&(1>a&&qn(a,">= 1",Xt,"rowSpan"),ii(this),this.A.Bi=a,this.v(),this.g("rowSpan",y,a))}},spanAllocation:{get:function(){return this.A!==null?this.A.Di:null},set:function(a){var y=this.spanAllocation;y!==a&&(ii(this),this.A.Di=a,this.v(),this.g("spanAllocation",y,a))}},alignmentFocus:{get:function(){return this.sk},set:function(a){var y=this.sk;y.D(a)||(this.sk=a=a.J(),this.v(),this.g("alignmentFocus",y,a))}},portId:{get:function(){return this.Yn},set:function(a){var y=this.Yn;if(y!==a){var x=this.part;x===null||x instanceof tn||de("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Hv(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,Y1(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:hr},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),dd(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&qn(a,">= 0",Xt,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),dd(this))}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:0},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.g("toShortLength",y,a),dd(this))}},toLinkable:{get:function(){return this.ba!==null?this.ba.Tr:null},set:function(a){var y=this.toLinkable;y!==a&&(this.Xc(),this.ba.Tr=a,this.g("toLinkable",y,a))}},toMaxLinks:{get:function(){return this.ba!==null?this.ba.Ur:1/0},set:function(a){var y=this.toMaxLinks;y!==a&&(0>a&&qn(a,">= 0",Xt,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:hr},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),dd(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&qn(a,">= 0",Xt,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),dd(this))}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:0},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.g("fromShortLength",y,a),dd(this))}},fromLinkable:{get:function(){return this.ba!==null?this.ba.hq:null},set:function(a){var y=this.fromLinkable;y!==a&&(this.Xc(),this.ba.hq=a,this.g("fromLinkable",y,a))}},fromMaxLinks:{get:function(){return this.ba!==null?this.ba.iq:1/0},set:function(a){var y=this.fromMaxLinks;y!==a&&(0>a&&qn(a,">= 0",Xt,"fromMaxLinks"),this.Xc(),this.ba.iq=a,this.g("fromMaxLinks",y,a))}},cursor:{get:function(){return this.A!==null?this.A.j:""},set:function(a){var y=this.cursor;y!==a&&(ii(this),this.A.j=a,this.g("cursor",y,a))}},click:{get:function(){return this.A!==null?this.A.zh:null},set:function(a){var y=this.click;y!==a&&(ii(this),this.A.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.A!==null?this.A.Fh:null},set:function(a){var y=this.doubleClick;y!==a&&(ii(this),this.A.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.A!==null?this.A.Bh:null},set:function(a){var y=this.contextClick;y!==a&&(ii(this),this.A.Bh=a,this.g("contextClick",y,a))}},mouseEnter:{get:function(){return this.A!==null?this.A.Mh:null},set:function(a){var y=this.mouseEnter;y!==a&&(ii(this),this.A.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.A!==null?this.A.Ph:null},set:function(a){var y=this.mouseLeave;y!==a&&(ii(this),this.A.Ph=a,this.g("mouseLeave",y,a))}},mouseOver:{get:function(){return this.A!==null?this.A.Qh:null},set:function(a){var y=this.mouseOver;y!==a&&(ii(this),this.A.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.A!==null?this.A.Oh:null},set:function(a){var y=this.mouseHover;y!==a&&(ii(this),this.A.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.A!==null?this.A.Nh:null},set:function(a){var y=this.mouseHold;y!==a&&(ii(this),this.A.Nh=a,this.g("mouseHold",y,a))}},mouseDragEnter:{get:function(){return this.A!==null?this.A.Of:null},set:function(a){var y=this.mouseDragEnter;y!==a&&(ii(this),this.A.Of=a,this.g("mouseDragEnter",y,a))}},mouseDragLeave:{get:function(){return this.A!==null?this.A.Xd:null},set:function(a){var y=this.mouseDragLeave;y!==a&&(ii(this),this.A.Xd=a,this.g("mouseDragLeave",y,a))}},mouseDrop:{get:function(){return this.A!==null?this.A.Lh:null},set:function(a){var y=this.mouseDrop;y!==a&&(ii(this),this.A.Lh=a,this.g("mouseDrop",y,a))}},actionDown:{get:function(){return this.A!==null?this.A.V:null},set:function(a){var y=this.actionDown;y!==a&&(ii(this),this.A.V=a,this.g("actionDown",y,a))}},actionMove:{get:function(){return this.A!==null?this.A.ia:null},set:function(a){var y=this.actionMove;y!==a&&(ii(this),this.A.ia=a,this.g("actionMove",y,a))}},actionUp:{get:function(){return this.A!==null?this.A.Ha:null},set:function(a){var y=this.actionUp;y!==a&&(ii(this),this.A.Ha=a,this.g("actionUp",y,a))}},actionCancel:{get:function(){return this.A!==null?this.A.F:null},set:function(a){var y=this.actionCancel;y!==a&&(ii(this),this.A.F=a,this.g("actionCancel",y,a))}},toolTip:{get:function(){return this.A!==null?this.A.$h:null},set:function(a){var y=this.toolTip;y!==a&&(ii(this),this.A.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.A!==null?this.A.Ch:null},set:function(a){var y=this.contextMenu;y!==a&&(ii(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),Xt.prototype.trigger=Xt.prototype.Jv,Xt.prototype.findBindingPanel=Xt.prototype.ih,Xt.prototype.findTemplateBinder=Xt.prototype.pz,Xt.prototype.setProperties=Xt.prototype.nm,Xt.prototype.apply=Xt.prototype.apply,Xt.prototype.attach=Xt.prototype.Du,Xt.prototype.set=Xt.prototype.set,Xt.prototype.isEnabledObject=Xt.prototype.If,Xt.prototype.isVisibleObject=Xt.prototype.Ed,Xt.prototype.isContainedBy=Xt.prototype.rg,Xt.prototype.getNearestIntersectionPoint=Xt.prototype.rs,Xt.prototype.getLocalPoint=Xt.prototype.qs,Xt.prototype.getDocumentScale=Xt.prototype.Df,Xt.prototype.getDocumentAngle=Xt.prototype.li,Xt.prototype.getDocumentBounds=Xt.prototype.mi,Xt.prototype.getDocumentPoint=Xt.prototype.ga,Xt.prototype.intersectsRect=Xt.prototype.Yc,Xt.prototype.containedInRect=Xt.prototype.fh,Xt.prototype.containsRect=Xt.prototype.Re,Xt.prototype.containsPoint=Xt.prototype.ca,Xt.prototype.raiseChanged=Xt.prototype.g,Xt.prototype.raiseChangedEvent=Xt.prototype.cb,Xt.prototype.addCopyProperty=Xt.prototype.Vw;var sc=null;Xt.className="GraphObject",sc=new qe,Ru("Button",function(){function a(x,E){return x.diagram.ic(x.documentPoint,function(b){for(;b.panel!==null&&!b.isActionable;)b=b.panel;return b},function(b){return b===E})!==null}var y=Ma(ze,ze.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof ze){var b=x.fb("ButtonBorder");b!==null&&(b.fill=E?x._buttonFillNormal:x._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Ma(ei,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Sn(0,0,2.76142374915397,2.761423749153969),spot2:new Sn(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return y.mouseEnter=function(x,E){if(E.If()&&E instanceof ze&&(x=E.fb("ButtonBorder"),x instanceof ei)){var b=E._buttonFillOver;E._buttonFillNormal=x.fill,x.fill=b,b=E._buttonStrokeOver,E._buttonStrokeNormal=x.stroke,x.stroke=b}},y.mouseLeave=function(x,E){E.If()&&E instanceof ze&&(x=E.fb("ButtonBorder"),x instanceof ei&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof ze&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof ei){x=x.diagram;var z=x.skipsUndoManager;x.skipsUndoManager=!0;var tt=E._buttonFillPressed;E._buttonFillOver=b.fill,b.fill=tt,tt=E._buttonStrokePressed,E._buttonStrokeOver=b.stroke,b.stroke=tt,x.skipsUndoManager=z}}},y.actionUp=function(x,E){if(E.If()&&E instanceof ze&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof ei){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionCancel=function(x,E){if(E.If()&&E instanceof ze&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof ei){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionMove=function(x,E){if(E.If()&&E instanceof ze&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof ei))){var z=b.skipsUndoManager;b.skipsUndoManager=!0;var tt=E._buttonFillPressed;x.fill!==tt&&(x.fill=tt),tt=E._buttonStrokePressed,x.stroke!==tt&&(x.stroke=tt),b.skipsUndoManager=z}}},y}),Ru("TreeExpanderButton",function(){var a=Ma("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Ma(ei,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:vo},new Jo("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new Jo("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof Ai&&(x=x.adornedPart),x instanceof tn){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isTreeExpanded){if(!E.canCollapseTree(x))return}else if(!E.canExpandTree(x))return;y.handled=!0,x.isTreeExpanded?E.collapseTree(x):E.expandTree(x)}}},a}),Ru("SubGraphExpanderButton",function(){var a=Ma("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Ma(ei,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:vo},new Jo("figure","isSubGraphExpanded",function(y,x){return x=x.panel,y?x._subGraphExpandedFigure:x._subGraphCollapsedFigure}).cp()));return a.click=function(y,x){if(x=x.part,x instanceof Ai&&(x=x.adornedPart),x instanceof Jn){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isSubGraphExpanded){if(!E.canCollapseSubGraph(x))return}else if(!E.canExpandSubGraph(x))return;y.handled=!0,x.isSubGraphExpanded?E.collapseSubGraph(x):E.expandSubGraph(x)}}},a}),Ru("ToolTip",function(){return Ma(Ai,ze.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},Ma(ei,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Sn(0,0,4,6),spot2:new Sn(1,1,-4,-4)}))}),Ru("ContextMenu",function(){return Ma(Ai,ze.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},new Jo("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Ru("ContextMenuButton",function(){var a=Ma("Button");a.stretch=xn;var y=a.fb("ButtonBorder");return y instanceof ei&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new Sn(0,0,2,3),y.spot2=new Sn(1,1,-2,-2)),a}),Ru("PanelExpanderButton",function(a){var y=am(a,"COLLAPSIBLE"),x=Ma("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Ma(ei,{name:"ButtonIcon",strokeWidth:2},new Jo("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof ei&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)"),x.click=function(E,b){var z=b.diagram;if(z!==null&&!z.isReadOnly){var tt=b.ih();tt===null&&(tt=b.part),tt!==null&&(b=tt.fb(y),b!==null&&(E.handled=!0,z.Ea("Collapse/Expand Panel"),b.visible=!b.visible,z.eb("Collapse/Expand Panel")))}},x}),Ru("CheckBoxButton",function(a){var y=am(a);return a=Ma("Button",{desiredSize:new Le(14,14)},Ma(ei,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Re,geometryStretch:gn,visible:!1},y!==""?new Jo("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof ze){var b=x.diagram;if(!(b===null||b.isReadOnly||y!==""&&b.model.isReadOnly)){x.handled=!0;var z=E.fb("ButtonIcon");b.Ea("checkbox"),z.visible=!z.visible,typeof E._doClick=="function"&&E._doClick(x,E),b.eb("checkbox")}}},a}),Ru("CheckBox",function(a){a=am(a),a=Ma("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new On(0,1,0,0)});var y=Ma(ze,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new On(1),_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave,actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});return a.mouseEnter=null,a.mouseLeave=null,a.actionDown=null,a.actionUp=null,a.actionCancel=null,a.actionMove=null,a.click=null,y}),Xt.None=Fe=new ae(Xt,"None",0),Xt.Default=Qn=new ae(Xt,"Default",0),Xt.Vertical=Nn=new ae(Xt,"Vertical",4),Xt.Horizontal=xn=new ae(Xt,"Horizontal",5),Xt.Fill=Re=new ae(Xt,"Fill",3),Xt.Uniform=gn=new ae(Xt,"Uniform",1),Xt.UniformToFill=wi=new ae(Xt,"UniformToFill",2),Xt.FlipVertical=si=new ae(Xt,"FlipVertical",1),Xt.FlipHorizontal=Ei=new ae(Xt,"FlipHorizontal",2),Xt.FlipBoth=$i=new ae(Xt,"FlipBoth",3),Xt.make=Ma,Xt.getBuilders=function(){var a=new qe,y;for(y in sc)if(y!==y.toLowerCase()){var x=sc.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},Xt.defineBuilder=Ru,Xt.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=sc.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof Xt))return y&&E.set(y),E;de('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},Xt.takeBuilderArgument=am;function of(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=gi,this.o=Wo,this.hg=Qn,this.ob=this.Bi=1,this.Pf=Fe,this.Pc=this.Ci=this.gd=null,this.Oc="category"}of.prototype.copy=function(){var a=new of;return a.xa=this.xa,a.zp=this.zp,a.te=this.te,a.nb=this.nb,a.j=this.j,a.zh=this.zh,a.Fh=this.Fh,a.Bh=this.Bh,a.Mh=this.Mh,a.Ph=this.Ph,a.Qh=this.Qh,a.Oh=this.Oh,a.Nh=this.Nh,a.Of=this.Of,a.Xd=this.Xd,a.Lh=this.Lh,a.V=this.V,a.ia=this.ia,a.Ha=this.Ha,a.F=this.F,a.$h=this.$h,a.Ch=this.Ch,a.Hb=this.Hb,a.Di=this.Di,a.hb=this.hb,a.u=this.u.J(),a.o=this.o.J(),a.hg=this.hg,a.Bi=this.Bi,a.ob=this.ob,a.Pf=this.Pf,a.gd=this.gd,a.Ci=this.Ci,a.Pc=this.Pc,a.Oc=this.Oc,a};function Lh(){this.u=-1/0,this.o=0,this.F=An,this.rr=ps,this.j=this.V="None"}Lh.prototype.copy=function(){var a=new Lh;return a.u=this.u,a.o=this.o,a.F=this.F.J(),a.rr=this.rr,a.V=this.V,a.j=this.j,a},Lh.className="LinkElementSettings";function Dg(){this.yj=this.Xi=Ir,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}Dg.prototype.copy=function(){var a=new Dg;return a.Xi=this.Xi.J(),a.yj=this.yj.J(),a.Vi=this.Vi,a.wj=this.wj,a.Wi=this.Wi,a.xj=this.xj,a.hq=this.hq,a.Tr=this.Tr,a.iq=this.iq,a.Ur=this.Ur,a},Dg.className="LinkSettings";function fd(){this.ha=[1,0,0,1,0,0]}fd.prototype.copy=function(){var a=new fd;return a.ha[0]=this.ha[0],a.ha[1]=this.ha[1],a.ha[2]=this.ha[2],a.ha[3]=this.ha[3],a.ha[4]=this.ha[4],a.ha[5]=this.ha[5],a},fd.prototype.translate=function(a,y){this.ha[4]+=this.ha[0]*a+this.ha[2]*y,this.ha[5]+=this.ha[1]*a+this.ha[3]*y},fd.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},fd.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a!==0){if(this.translate(y,x),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.ha[1]*a+this.ha[3]*E,z=this.ha[0]*-E+this.ha[2]*a,tt=this.ha[1]*-E+this.ha[3]*a;this.ha[0]=this.ha[0]*a+this.ha[2]*E,this.ha[1]=b,this.ha[2]=z,this.ha[3]=tt,this.translate(-y,-x)}},fd.className="STransform";function rf(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}rf.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},rf.className="SGradient";function wl(a,y,x){this.ownerDocument=a=y===void 0?me.document:y,this.cA="http://www.w3.org/2000/svg",a!==void 0&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new qs(this,x)}wl.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",this.Oa.setAttributeNS(null,"width",x+"px"),this.Oa.setAttributeNS(null,"height",E+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+x+" "+E),this.context.ww.firstElementChild.setAttributeNS(null,"width",x+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",E+"px"),!0):!1},wl.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),Ve(y))for(var E in y)a.setAttributeNS(E==="href"?"http://www.w3.org/1999/xlink":"",E,y[E]);return x!==void 0&&(a.textContent=x),a},wl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},wl.prototype.focus=function(){this.Oa.focus()},wl.prototype.mx=function(){this.ownerDocument=null},Ie.Object.defineProperties(wl.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(a){this.Oa.setAttribute("width",a+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(a){this.Oa.setAttribute("height",a+"px")}},style:{get:function(){return this.Oa.style}}}),wl.className="SVGSurface";function qs(a,y){this.Gv=a,this.svg=a.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=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.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new fd,this.j=lm(this),this.Nj=lm(this,"gojs-diagram"),this.Hl=this.ti=null;var x=se++,E=this.Ud("clipPath",{id:"mainClip"+x});E.appendChild(this.Ud("rect",{x:0,y:0,width:a.width,height:a.height})),this.ww=E,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(E),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+x+")"),this.eA={},this.isTemporary=!!y,this.filter="",this.bk=null}function Xy(a,y,x,E,b,z,tt){a.Nj===void 0?Og(a,y,x,E,b,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+tt+")")}xt=qs.prototype,xt.arc=function(a,y,x,E,b,z,tt,ot){var rt=2*Math.PI,at=rt-1e-6,ut=x*Math.cos(E),ct=x*Math.sin(E),mt=a+ut,yt=y+ct,St=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(tt-mt)||1e-6<Math.abs(ot-yt))&&this.path.push(["L",mt,+yt]),0>E&&(E=E%rt+rt),E>at?(this.path.push(["A",x,x,0,1,St,a-ut,y-ct]),this.path.push(["A",x,x,0,1,St,mt,yt])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),St,a+x*Math.cos(b),y+x*Math.sin(b)])},xt.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},xt.Se=function(a){this.addPath(this.path,this.rb,a||0)},xt.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},xt.clearRect=function(){},xt.clip=function(){this.Yl.clipPath=!0},xt.closePath=function(){this.path.push(["z"])},xt.createLinearGradient=function(a,y,x,E){var b=new rf("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},xt.createPattern=function(a){var y="";a instanceof HTMLCanvasElement&&(y=a.toDataURL()),a instanceof HTMLImageElement&&(y=a.getAttribute("src"));var x=this.eA;if(x[y])return"url(#"+x[y]+")";var E="PATTERN"+se++,b={x:0,y:0,width:a.width,height:a.height,href:y};return a=this.Ud("pattern",{width:a.width,height:a.height,id:E,patternUnits:"userSpaceOnUse"}),a.appendChild(this.Ud(ud,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},xt.createRadialGradient=function(a,y,x,E,b,z){var tt=new rf("radial");return tt.x1=a,tt.y1=y,tt.r1=x,tt.x2=E,tt.y2=b,tt.r2=z,tt};function Zy(a,y,x,E,b,z,tt,ot,rt){E=ot/E,b=rt/b,z===0&&tt===0||a.rb.translate(z,tt),E===1&&b===1||a.rb.scale(E,b),y===0&&x===0||a.rb.translate(-y,-x)}xt.drawImage=function(a,y,x,E,b,z,tt,ot,rt){var at="";a instanceof HTMLCanvasElement&&(at=a.toDataURL()),a instanceof HTMLImageElement&&(at=a.getAttribute("src"));var ut=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,E===void 0&&(z=y,tt=x,ot=E=ut,rt=b=a),E=E||0,b=b||0,ot=ot||0,rt=rt||0,Zy(this,y,x,E,b,z||0,tt||0,ot,rt),z={x:0,y:0,width:ut||E,height:a||b,href:at},Jt.$(E,ot)&&Jt.$(b,rt)?at.toLowerCase().indexOf(".svg")===-1&&at.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||E!==ut||b!==a)&&(E+=y,b+=x,z["clip-path"]="path('M "+y+","+x+" L "+E+" "+x+" L "+E+" "+b+" L "+y+" "+b+" z')"),ac(this,ud,z,this.rb),this.addElement(ud,z)},xt.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),iv(this,this.Yl)},xt.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},xt.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},ac(this,"fill",a,this.rb),this.addElement("rect",a)},xt.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},ac(this,"fill",a,this.rb),iv(this,a),this.svg.prepend(this.Ud("rect",a))},xt.fillText=function(a,y,x){a=[a,y,x],y=this.textAlign,y==="left"?y="start":y==="right"?y="end":y==="center"&&(y="middle"),y={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":y},ac(this,"fill",y,this.rb),this.addElement("text",y,a[0])},xt.lineTo=function(a,y){this.path.push(["L",a,y])},xt.moveTo=function(a,y){this.path.push(["M",a,y])},xt.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},xt.rect=function(a,y,x,E){this.path.push(["M",a,y],["L",a+x,y],["L",a+x,y+E],["L",a,y+E],["z"])},xt.restore=function(){this.rb=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.lineDashOffset=a.lineDashOffset,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,this.bk=a.bk},xt.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,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,bk:this.bk});for(var a=[],y=0;y<this.path.length;y++)a.push(this.path[y]);this.stack.push(a),this.stack.push(this.rb.copy())},xt.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||Og(this,a,y,x,E,b,z)};function Jy(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}xt.scale=function(a,y){this.rb.scale(a,y)},xt.translate=function(a,y){this.rb.translate(a,y)},xt.transform=function(){},xt.yc=function(){},xt.stroke=function(){qy(this,this.Yl)},xt.jk=function(){this.clipInsteadOfFill||this.stroke()},xt.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},xt.addElement=function(a,y,x){return a=this.Ud(a,y,x),this.yd!==null?this.yd.appendChild(a):this.yd=a,this.ad=a};function ac(a,y,x,E){y==="fill"?iv(a,x):y==="stroke"&&qy(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function iv(a,y){a.fillStyle instanceof rf?y.fill=ov(a,a.fillStyle,!0):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",y["fill-opacity"]=a[4]):y.fill=a.fillStyle}function Qy(a,y,x){x=x?"fill":"stroke",a.fillStyle instanceof rf?y.setAttributeNS(null,"fill",ov(a,a.fillStyle,!0)):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.setAttributeNS(null,x,"rgb("+a[1]+","+a[2]+","+a[3]+")"),y.setAttributeNS(null,x+"-opacity",a[4])):y.setAttributeNS(null,x,a.fillStyle)}function qy(a,y){if(a.strokeStyle instanceof rf)y.stroke=ov(a,a.strokeStyle,!1);else if(/^rgba\(/.test(a.strokeStyle)){var x=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle);y.stroke="rgb("+x[1]+","+x[2]+","+x[3]+")",y["stroke-opacity"]=x[4]}else y.stroke=a.strokeStyle;y["stroke-width"]=a.lineWidth,y["stroke-linecap"]=a.lineCap,y["stroke-linejoin"]=a.lineJoin,y["stroke-miterlimit"]=a.miterLimit,a.Ct&&(y["stroke-dasharray"]=a.Yg.toString(),y["stroke-dashoffset"]=a.uj)}function ov(a,y,x){var E="";if(E=a.Hl!==null?a.Hl.getAttribute(x?"fill":"stroke"):null,E!==null&&E.indexOf("GRAD")!==-1?(E=E.split("#")[1].slice(0,-1),x=a.svg.getElementById(E),x!==null&&x.remove()):E="GRAD"+se++,y.type==="linear")x=a.Ud("linearGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,id:E,gradientUnits:"userSpaceOnUse"});else if(y.type==="radial")x=a.Ud("radialGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,r1:y.r1,r2:y.r2,id:E});else throw Error("invalid gradient");var b=y.gx;y=b.length;for(var z=[],tt=0;tt<y;tt++){var ot=b[tt],rt=ot.color;ot={offset:ot.offset,"stop-color":rt},/^rgba\(/.test(rt)&&(rt=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(rt),ot["stop-color"]="rgb("+rt[1]+","+rt[2]+","+rt[3]+")",ot["stop-opacity"]=rt[4]),z.push(ot)}for(z.sort(function(at,ut){return at.offset>ut.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}xt.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=wo(a[b]),tt=[z.shift()];if(tt[0]==="A")tt.push(z.shift()+","+z.shift(),z.shift(),z.shift()+","+z.shift(),z.shift()+","+z.shift());else for(;z.length;)tt.push(z.shift()+","+z.shift());E.push(tt.join(" "))}if(E=E.join(" "),a=this.Yl,a.clipPath)0<this.nh.length&&this.nh[this.nh.length-1].setAttributeNS(null,"clip-path",'path("'+E+'")');else if(a.d=E,ac(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var ot in a)ot!=="transform"&&y.setAttributeNS(null,ot,a[ot]);else{ot=y.getElementsByTagName("path");for(var rt in a)rt!=="transform"&&ot[x].setAttributeNS(null,rt,a[rt])}else this.addElement("path",a)};function Og(a,y,x,E,b,z,tt){var ot=new fd;ot.ha=[y,x,E,b,z,tt],y={},ac(a,"g",y,ot),ot=a.addElement("g",y),a.nh.push(ot)}function lm(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}xt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function Rl(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function ru(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}xt.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},xt.fs=function(){this.Ct=!1},xt.Vc=function(){},xt.Wx=function(){},qs.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},qs.prototype.getImageData=function(){return null},qs.prototype.measureText=function(){return null};function um(a,y){y=y.getAttribute("fill"),y!==null&&(y=y.split("#"),y.length!==1&&(y=a.svg.getElementById(y[1].slice(0,-1)),y!==null&&a.svg.innerHTML.match(new RegExp(y.id,"g")).length===1&&y.remove()))}qs.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},qs.className="SVGContext",te.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new wl(this,me.document));var y=new wl(this,me.document,!0);a===void 0&&(a=new Se);var x=this;return Qd(this,function(E,b){return E=im(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},te.prototype.makeSvg=te.prototype.Cs,te.prototype.av=function(a){return this.Cs(a)},te.prototype.makeSVG=te.prototype.av;function ja(a,y,x,E){this.ownerDocument=y=y===void 0?me.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new cd(y,x,E),y.H=a}ja.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",!0):!1},ja.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},ja.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},ja.prototype.focus=function(){this.Oa.focus()},ja.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},Ie.Object.defineProperties(ja.prototype,{width:{get:function(){return this.Oa.width},set:function(a){this.Oa.width=a}},height:{get:function(){return this.Oa.height},set:function(a){this.Oa.height=a}},style:{get:function(){return this.Oa.style}}}),ja.className="CanvasSurface";function cd(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&de("Browser does not support HTML Canvas Element"),this.ct=this.et=this.dt="",this.Hm=!1,this.Vg=this.Br=this.Ar=0,this.Il=!1,this.El=new ci,this.isTemporary=!!x}xt=cd.prototype,xt.Wx=function(a){this.Z.imageSmoothingEnabled=a},xt.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},xt.beginPath=function(){this.Z.beginPath()},xt.Se=function(){},xt.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},xt.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},xt.clip=function(){this.Z.clip()},xt.closePath=function(){this.Z.closePath()},xt.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},xt.createPattern=function(a,y){return this.Z.createPattern(a,y)},xt.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},xt.drawImage=function(a,y,x,E,b,z,tt,ot,rt){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,tt,ot,rt)},xt.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},xt.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},xt.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},xt.fillText=function(a,y,x){this.Z.fillText(a,y,x)},xt.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},xt.lineTo=function(a,y){this.Z.lineTo(a,y)},xt.measureText=function(a){return this.Z.measureText(a)},xt.moveTo=function(a,y){this.Z.moveTo(a,y)},xt.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},xt.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},xt.restore=function(){this.Z.restore()},xt.save=function(){this.yc(),this.Z.save()},cd.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},xt=cd.prototype,xt.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},xt.scale=function(a,y){this.El.scale(a,y)},xt.translate=function(a,y){this.El.translate(a,y)},xt.stroke=function(){this.Z.stroke()},xt.transform=function(a,y,x,E,b,z){if(a!==1||y!==0||x!==0||E!==1||b!==0||z!==0){var tt=this.El,ot=tt.m11*a+tt.m21*y;a=tt.m12*a+tt.m22*y,y=tt.m11*x+tt.m21*E,x=tt.m12*x+tt.m22*E,tt.dx=tt.m11*b+tt.m21*z+tt.dx,tt.dy=tt.m12*b+tt.m22*z+tt.dy,tt.m11=ot,tt.m12=a,tt.m21=y,tt.m22=x}},xt.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},xt.ng=function(a,y){if(a instanceof Ki&&a.type===Ea){var x=a.yk;a=a.ft,a>x?(this.scale(x/a,1),this.translate((a-x)/2,0)):x>a&&(this.scale(1,a/x),this.translate(0,(x-a)/2)),this.Hm?this.clip():this.fill(y),a>x?(this.translate(-(a-x)/2,0),this.scale(1/(x/a),1)):x>a&&(this.translate(0,-(x-a)/2),this.scale(1,1/(a/x)))}else this.Hm?this.clip():this.fill(y)},xt.jk=function(){this.Hm||this.stroke()},xt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},xt.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},xt.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(mx),a.lineDashOffset=0)},xt.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},xt.Hs=function(){},Ie.Object.defineProperties(cd.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(a){this.ct!==a&&(this.ct=this.Z.fillStyle=a)}},font:{get:function(){return this.Z.font},set:function(a){this.dt!==a&&(this.dt=this.Z.font=a)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(a){this.Z.globalAlpha=a}},lineCap:{get:function(){return this.Z.lineCap},set:function(a){this.Z.lineCap=a}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(a){this.Z.lineDashOffset=a}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(a){this.Z.lineJoin=a}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(a){this.Z.lineWidth=a}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(a){this.Z.miterLimit=a}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(a){this.Z.shadowBlur=a}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(a){this.Z.shadowColor=a}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(a){this.Z.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(a){this.Z.shadowOffsetY=a}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(a){this.et!==a&&(this.et=this.Z.strokeStyle=a)}},textAlign:{get:function(){return this.Z.textAlign},set:function(a){this.Z.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(a){this.Z.imageSmoothingEnabled=a}},filter:{get:function(){return this.Z.filter},set:function(a){this.Z.filter=a===""?"none":a}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(a){this.Hm=a}}});var mx=Object.freeze([]);cd.className="CanvasSurfaceContext";function Ig(){this.F=this.o=this.u=this.j=0}Ig.className="ColorNumbers";function Ki(a,y){dc||(hv(),dc=!0),vi(this),this._isFrozen=!1,a===void 0?(this.na=ju,this.xk="black"):typeof a=="string"?(this.na=ju,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===au?(this.Qd=sa,this.Lk=Ur):this.Lk=a===Ea?this.Qd=Mi:this.Qd=hr,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}Ki.prototype.copy=function(){var a=new Ki;return a.na=this.na,a.xk=this.xk,a.Qd=this.Qd.J(),a.Lk=this.Lk.J(),a.Gr=this.Gr,a.Xp=this.Xp,this.we!==null&&(a.we=this.we.copy()),a.cr=this.cr,a},xt=Ki.prototype,xt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},xt.ka=function(){return Object.isFrozen(this)&&de("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},xt.qb=function(a){a.classType===Ki&&(this.type=a)},xt.toString=function(){var a="Brush(";if(this.type===ju)a+=this.color;else if(a=this.type===au?a+"Linear ":this.type===Ea?a+"Radial ":this.type===fc?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,this.colorStops!==null)for(var y=this.colorStops.iterator;y.next();)a+=" "+y.key+":"+y.value;return a+")"},xt.addColorStop=function(a,y){return this._isFrozen&&bn(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&qn(a,"0 <= loc <= 1",Ki,"addColorStop:loc"),this.we===null&&(this.we=new qe),this.we.add(a,y),this.na===ju&&(this.type=au),this.xe=null,this},xt.Vz=function(a,y){if(this._isFrozen&&bn(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?cc:y,this.type===ju)su(this.color),this.color=uc(a,y);else if((this.type===au||this.type===Ea)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)su(x.value),this.addColorStop(x.key,uc(a,y));return this};function $y(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?cc:x,su(a),uc(y,x)}xt.Wy=function(a,y){if(this._isFrozen&&bn(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?cc:y,this.type===ju)su(this.color),this.color=uc(-a,y);else if((this.type===au||this.type===Ea)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)su(x.value),this.addColorStop(x.key,uc(-a,y));return this};function t1(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?cc:x,su(a),uc(-y,x)}function rv(a,y,x){su(a),a=ro.j;var E=ro.u,b=ro.o,z=ro.F;return su(y),x===void 0&&(x=.5),"rgba("+Math.round((ro.j-a)*x+a)+", "+Math.round((ro.u-E)*x+E)+", "+Math.round((ro.o-b)*x+b)+", "+Math.round((ro.F-z)*x+z)+")"}xt.Gx=function(){if(this.type===ju)return lc(this.color);if((this.type===au||this.type===Ea)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Ea)return lc(a.first().value);if(a.get(.5)!==null)return lc(a.get(.5));if(a.count===2)return a=a.Fa(),lc(rv(a[0].value,a[1].value));for(var y=a.iterator,x=-1,E=-1,b=1,z=1;y.next();){var tt=y.key,ot=Math.abs(.5-y.key);b>z&&ot<b?(x=tt,b=ot):z>=b&&ot<z&&(E=tt,z=ot)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,lc(rv(a.get(x),a.get(E),1-z/b))}return!1};function lc(a){return a?a instanceof Ki?a.Gx():(su(a),128>(299*ro.j+587*ro.u+114*ro.o)/1e3):!1}function uc(a,y){switch(y){case cc:y=100*av(ro.j);var x=100*av(ro.u),E=100*av(ro.o);return cs.j=.4124564*y+.3575761*x+.1804375*E,cs.u=.2126729*y+.7151522*x+.072175*E,cs.o=.0193339*y+.119192*x+.9503041*E,cs.F=ro.F,y=uv(cs.j/hc[0]),x=uv(cs.u/hc[1]),E=uv(cs.o/hc[2]),jl.j=116*x-16,jl.u=500*(y-x),jl.o=200*(x-E),jl.F=cs.F,jl.j=Math.min(100,Math.max(0,jl.j+100*a)),a=(jl.j+16)/116,y=a-jl.o/200,cs.j=hc[0]*e1(jl.u/500+a),cs.u=hc[1]*(jl.j>hm*dv?Math.pow(a,3):jl.j/hm),cs.o=hc[2]*e1(y),cs.F=jl.F,a=-.969266*cs.j+1.8760108*cs.u+.041556*cs.o,y=.0556434*cs.j+-.2040259*cs.u+1.0572252*cs.o,ro.j=255*lv((3.2404542*cs.j+-1.5371385*cs.u+-.4985314*cs.o)/100),ro.u=255*lv(a/100),ro.o=255*lv(y/100),ro.F=cs.F,ro.j=Math.round(ro.j),255<ro.j?ro.j=255:0>ro.j&&(ro.j=0),ro.u=Math.round(ro.u),255<ro.u?ro.u=255:0>ro.u&&(ro.u=0),ro.o=Math.round(ro.o),255<ro.o?ro.o=255:0>ro.o&&(ro.o=0),"rgba("+ro.j+", "+ro.u+", "+ro.o+", "+ro.F+")";case n1:return sv(),fa.o=Math.min(100,Math.max(0,fa.o+100*a)),"hsla("+fa.j+", "+fa.u+"%, "+fa.o+"%, "+fa.F+")";default:de("Unknown color space: "+y)}}function su(a){dc||(hv(),dc=!0);var y=fv;if(y!==null){y.clearRect(0,0,1,1),y.fillStyle="#000000";var x=y.fillStyle;y.fillStyle=a,y.fillStyle!==x?(y.fillRect(0,0,1,1),a=y.getImageData(0,0,1,1).data,ro.j=a[0],ro.u=a[1],ro.o=a[2],ro.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,ro.j=0,ro.u=0,ro.o=0,ro.F=1)}}function sv(){var a=ro.j/255,y=ro.u/255,x=ro.o/255,E=Math.max(a,y,x),b=Math.min(a,y,x),z=E-b;if(b=(E+b)/2,z===0)var tt=a=0;else{switch(E){case a:tt=(y-x)/z%6;break;case y:tt=(x-a)/z+2;break;case x:tt=(a-y)/z+4}tt*=60,0>tt&&(tt+=360),a=z/(1-Math.abs(2*b-1))}fa.j=Math.round(tt),fa.u=Math.round(100*a),fa.o=Math.round(100*b),fa.F=ro.F}function av(a){return a/=255,.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function lv(a){return .0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function uv(a){return a>dv?Math.pow(a,1/3):(hm*a+16)/116}function e1(a){var y=a*a*a;return y>dv?y:(116*a-16)/hm}function sf(a,y){typeof a!="string"&&(a instanceof Ki||de("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){fv=Io?new ja(null,void 0,{willReadFrequently:!0}).context:null}Ie.Object.defineProperties(Ki.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&bn(this,a),this.na=a,this.start.Mc()&&(a===au?this.start=sa:a===Ea&&(this.start=Mi)),this.end.Mc()&&(a===au?this.end=Ur:a===Ea&&(this.end=Mi)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&bn(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&bn(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&bn(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&bn(this,a),0>a&&qn(a,">= zero",Ki,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&bn(this,a),0>a&&qn(a,">= zero",Ki,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&bn(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&bn(this,a),this.cr=a,this.xe=null}}}),Ki.prototype.isDark=Ki.prototype.Gx,Ki.prototype.darkenBy=Ki.prototype.Wy,Ki.prototype.lightenBy=Ki.prototype.Vz,Ki.prototype.addColorStop=Ki.prototype.addColorStop;var dv=216/24389,hm=24389/27,hc=[95.047,100,108.883],fv=null,ro=new Ig,fa=new Ig,cs=new Ig,jl=new Ig,dc=!1;Ki.className="Brush";var ju;Ki.Solid=ju=new ae(Ki,"Solid",0);var au;Ki.Linear=au=new ae(Ki,"Linear",1);var Ea;Ki.Radial=Ea=new ae(Ki,"Radial",2);var fc;Ki.Pattern=fc=new ae(Ki,"Pattern",4);var cc;Ki.Lab=cc=new ae(Ki,"Lab",5);var n1;Ki.HSL=n1=new ae(Ki,"HSL",6),Ki.randomColor=function(a,y){a===void 0&&(a=128),y===void 0&&(y=Math.max(a,255));var x=Math.abs(y-a);y=Math.floor(a+Math.random()*x).toString(16);var E=Math.floor(a+Math.random()*x).toString(16);return a=Math.floor(a+Math.random()*x).toString(16),2>y.length&&(y="0"+y),2>E.length&&(E="0"+E),2>a.length&&(a="0"+a),"#"+y+E+a},Ki.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;dc||(hv(),dc=!0);var y=fv;if(y===null)return!0;y.fillStyle="#000000";var x=y.fillStyle;return y.fillStyle=a,y.fillStyle!==x?!0:(y.fillStyle="#FFFFFF",x=y.fillStyle,y.fillStyle=a,y.fillStyle!==x)},Ki.lighten=function(a){return $y(a)},Ki.lightenBy=$y,Ki.darken=function(a){return t1(a)},Ki.darkenBy=t1,Ki.mix=rv,Ki.isDark=lc;function lr(){this.xa="Base"}lr.prototype.measure=function(){},lr.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},lr.prototype.arrange=function(){},lr.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},lr.prototype.iA=function(a){a.Uj()},lr.prototype.gc=function(){},Ie.Object.defineProperties(lr.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return ze}}}),lr.prototype.remeasureObject=lr.prototype.iA,lr.prototype.arrangeElement=lr.prototype.Ly,lr.prototype.measureElement=lr.prototype.Yz,lr.className="PanelLayout";function dm(){this.xa="Base"}ee(dm,lr),dm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length;a=lu(a);for(var rt=0;rt<ot;rt++){var at=E[rt];if(at.visible||at===a){var ut=at.margin,ct=ut.right+ut.left;ut=ut.top+ut.bottom,at.measure(y,x,z,tt);var mt=at.measuredBounds;ct=Math.max(mt.width+ct,0),ut=Math.max(mt.height+ut,0),mt=at.position.x;var yt=at.position.y;isFinite(mt)||(mt=0),isFinite(yt)||(yt=0),at instanceof ei&&at.isGeometryPositioned&&(at=at.strokeWidth/2,mt-=at,yt-=at),yo(b,mt,yt,ct,ut)}}},dm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding;for(a=x.x-b.left,x=x.y-b.top,b=0;b<E;b++){var z=y[b],tt=z.measuredBounds,ot=z.margin,rt=z.position.x,at=z.position.y;if(rt=isNaN(rt)?-a:rt-a,at=isNaN(at)?-x:at-x,z instanceof ei&&z.isGeometryPositioned){var ut=z.strokeWidth/2;rt-=ut,at-=ut}z.visible&&z.arrange(rt+ot.left,at+ot.top,tt.width,tt.height)}};function fm(){this.xa="Base"}ee(fm,lr),fm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length;y=Un(),z=lu(a);for(var rt=0;rt<ot;rt++){var at=E[rt];if(at.visible||at===z){var ut=Es(at,!1);if(ut!==Fe&&ut!==xn)y.push(at);else{at.measure(1/0,x,0,tt),ut=at.margin,at=at.measuredBounds;var ct=Math.max(at.height+ut.top+ut.bottom,0);b.width+=Math.max(at.width+ut.right+ut.left,0),b.height=Math.max(b.height,ct)}}}for(E=y.length,a.desiredSize.height?x=Math.min(a.desiredSize.height,a.maxSize.height):b.height!==0&&(x=Math.min(b.height,a.maxSize.height)),a=0;a<E;a++)rt=y[a],(rt.visible||rt===z)&&(ut=rt.margin,ot=ut.right+ut.left,ut=ut.top+ut.bottom,rt.measure(1/0,x,0,tt),rt=rt.measuredBounds,ut=Math.max(rt.height+ut,0),b.width+=Math.max(rt.width+ot,0),b.height=Math.max(b.height,ut));_n(y)},fm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,tt=a.isOpposite,ot=tt?x.width:b.left,rt=0;rt<E;rt++){var at=z,ut=y[rt];if(ut.visible){var ct=ut.measuredBounds,mt=ut.margin,yt=mt.top+mt.bottom,St=z+b.bottom,Mt=ct.height,Ot=Es(ut,!1);(isNaN(ut.desiredSize.height)&&Ot===Re||Ot===Nn)&&(Mt=Math.max(x.height-yt-St,0)),yt=Mt+yt+St,St=ut.alignment,St.Xb()&&(St=a.defaultAlignment),St.sb()||(St=Mi),tt&&(ot-=ct.width+mt.left+mt.right),ut.arrange(ot+St.offsetX+mt.left,at+St.offsetY+mt.top+(x.height*St.y-yt*St.y),ct.width,Mt),tt||(ot+=ct.width+mt.left+mt.right)}}};function cm(){this.xa="Base"}ee(cm,lr),cm.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=Un();for(var ot=lu(a),rt=0;rt<tt;rt++){var at=E[rt];if(at.visible||at===ot){var ut=Es(at,!1);if(ut!==Fe&&ut!==Nn)x.push(at);else{var ct=at.margin;ut=ct.right+ct.left,ct=ct.top+ct.bottom,at.measure(y,1/0,z,0),at=at.measuredBounds,Br(b,Math.max(b.width,Math.max(at.width+ut,0)),b.height+Math.max(at.height+ct,0))}}}if(E=x.length,E!==0){for(a.desiredSize.width?y=Math.min(a.desiredSize.width,a.maxSize.width):b.width!==0&&(y=Math.min(b.width,a.maxSize.width)),a=0;a<E;a++)rt=x[a],(rt.visible||rt===ot)&&(at=rt.margin,tt=at.right+at.left,at=at.top+at.bottom,rt.measure(y,1/0,z,0),rt=rt.measuredBounds,at=Math.max(rt.height+at,0),b.width=Math.max(b.width,Math.max(rt.width+tt,0)),b.height+=at);_n(x)}},cm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,tt=a.isOpposite,ot=tt?x.height:b.top,rt=0;rt<E;rt++){var at=z,ut=y[rt];if(ut.visible){var ct=ut.measuredBounds,mt=ut.margin,yt=mt.left+mt.right,St=z+b.right,Mt=ct.width,Ot=Es(ut,!1);(isNaN(ut.desiredSize.width)&&Ot===Re||Ot===xn)&&(Mt=Math.max(x.width-yt-St,0)),yt=Mt+yt+St,St=ut.alignment,St.Xb()&&(St=a.defaultAlignment),St.sb()||(St=Mi),tt&&(ot-=ct.height+mt.bottom+mt.top),ut.arrange(at+St.offsetX+mt.left+(x.width*St.x-yt*St.x),ot+St.offsetY+mt.top,Mt,ct.height),tt||(ot+=ct.height+mt.bottom+mt.top)}}};function gm(){this.xa="Base"}ee(gm,lr),gm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length,rt=a.Pb(),at=rt.margin,ut=at.right+at.left,ct=at.top+at.bottom;rt.measure(y,x,z,tt);var mt=rt.measuredBounds;z=mt.width,tt=mt.height;var yt=Math.max(z+ut,0),St=Math.max(tt+ct,0),Mt=a.isClipping,Ot=pe.allocAt(-at.left,-at.top,yt,St),bt=pe.allocAt(0,0,z,tt);cv(rt,bt,!0),z=bt.width,tt=bt.height;for(var jt=!0,Gt=lu(a),Wt=0;Wt<ot;Wt++){var Kt=E[Wt];mt=y;var $t=x;if(Kt!==rt&&(Kt.visible||Kt===Gt)){at=Kt.margin;var Qe=at.left,dn=at.top;switch(yt=at.right+at.left,St=at.top+at.bottom,at=Es(Kt,!1),at){case Re:mt=z,$t=tt,dn=Qe=St=yt=0;break;case xn:mt=z,Qe=yt=0;break;case Nn:$t=tt,dn=St=0}Kt.measure(mt,$t,0,0),mt=Kt.measuredBounds,yt=Math.max(mt.width+yt,0),St=Math.max(mt.height+St,0),at=Kt.alignment,at.Xb()&&(at=a.defaultAlignment),at.sb()||(at=Mi);var rn=Kt.alignmentFocus;if(rn.Xb()&&(rn=Mi),$t=null,Kt instanceof ze&&Kt.$e!==""&&($t=Kt.fb(Kt.$e),$t===Kt&&($t=null)),Qe=bt.x-Qe,dn=bt.y-dn,$t!==null){for(Kt.arrange(0,0,mt.width,mt.height),mt=$t.actualBounds,mt=At.allocAt(mt.x+(rn.x*mt.width-rn.offsetX),mt.y+(rn.y*mt.height-rn.offsetY)),$t=$t.panel;$t!==Kt;)$t.transform.Ga(mt),$t=$t.panel;Qe+=at.x*z+at.offsetX-mt.x,dn+=at.y*tt+at.offsetY-mt.y,At.free(mt)}else Qe+=at.x*z+at.offsetX-(rn.x*mt.width+rn.offsetX),dn+=at.y*tt+at.offsetY-(rn.y*mt.height+rn.offsetY);jt?(jt=!1,b.h(Qe,dn,yt,St)):yo(b,Qe,dn,yt,St)}}switch(jt?b.assign(Ot):Mt?b.Uu(bt.x,bt.y,bt.width,bt.height):yo(b,Ot.x,Ot.y,Ot.width,Ot.height),pe.free(Ot),pe.free(bt),at=rt.stretch,at===Qn&&(at=Es(rt,!1)),at){case Fe:return;case Re:if(!isFinite(y)&&!isFinite(x))return;break;case xn:if(!isFinite(y))return;break;case Nn:if(!isFinite(x))return}for(mt=rt.measuredBounds,z=mt.width,tt=mt.height,yt=Math.max(z+ut,0),St=Math.max(tt+ct,0),at=rt.margin,bt=pe.allocAt(-at.left,-at.top,yt,St),cv(rt,bt,!0),z=bt.width,tt=bt.height,y=0;y<ot;y++)x=E[y],x===rt||!x.visible&&x!==Gt||(at=x.margin,yt=at.right+at.left,St=at.top+at.bottom,mt=x.measuredBounds,yt=Math.max(mt.width+yt,0),St=Math.max(mt.height+St,0),ut=x.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=Mi),x=x.alignmentFocus,x.Xb()&&(x=Mi),jt?(jt=!1,b.h(ut.x*z+ut.offsetX-(x.x*mt.width+x.offsetX)-at.left,ut.y*tt+ut.offsetY-(x.y*mt.height+x.offsetY)-at.top,yt,St)):yo(b,ut.x*z+ut.offsetX-(x.x*mt.width+x.offsetX)-at.left,ut.y*tt+ut.offsetY-(x.y*mt.height+x.offsetY)-at.top,yt,St));jt?b.assign(Ot):Mt?b.Uu(bt.x,bt.y,bt.width,bt.height):yo(b,Ot.x,Ot.y,Ot.width,Ot.height),pe.free(bt)},gm.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,tt=z.width,ot=z.height,rt=a.padding;z=rt.left,rt=rt.top;var at=z-x.x,ut=rt-x.y;for(b.arrange(at,ut,tt,ot),tt=pe.allocAt(0,0,tt,ot),cv(b,tt,!1),ot=0;ot<E;ot++){var ct=y[ot];if(ct!==b){at=ct.measuredBounds;var mt=at.width,yt=at.height;ut=ct.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=Mi);var St=ct.alignmentFocus;if(St.Xb()&&(St=Mi),at=null,ct instanceof ze&&ct.$e!==""&&(at=ct.fb(ct.$e),at===ct&&(at=null)),at!==null){var Mt=at.actualBounds;for(St=At.allocAt(Mt.x+(St.x*Mt.width-St.offsetX),Mt.y+(St.y*Mt.height-St.offsetY)),at=at.panel;at!==ct;)at.transform.Ga(St),at=at.panel;at=ut.x*tt.width+ut.offsetX-St.x,ut=ut.y*tt.height+ut.offsetY-St.y,At.free(St)}else at=ut.x*tt.width+ut.offsetX-(St.x*mt+St.offsetX),ut=ut.y*tt.height+ut.offsetY-(St.y*yt+St.offsetY);at+=tt.x-x.x,ut+=tt.y-x.y,ct.visible&&ct.arrange(z+at,rt+ut,mt,yt)}}pe.free(tt)};function cv(a,y,x){var E=null;if(a instanceof ze&&a.$e!==""&&(E=a.fb(a.$e),E===a&&(E=null)),E!==null)for(x&&a.arrange(0,0,y.width,y.height),y.assign(E.actualBounds),E=E.panel;E!==a;)E.transform.pp(y),E=E.panel}function pm(){this.xa="Base"}ee(pm,lr),pm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length,rt=a.Pb(),at=rt.margin,ut=y,ct=x,mt=at.right+at.left,yt=at.top+at.bottom;rt.measure(y,x,z,tt),at=rt.measuredBounds;var St=0,Mt=null;rt instanceof ei&&(Mt=rt,St=Mt.strokeWidth*Mt.scale);var Ot=Math.max(at.width+mt,0);at=Math.max(at.height+yt,0);var bt=vv(rt),jt=bt.x*Ot+bt.offsetX;bt=bt.y*at+bt.offsetY;var Gt=yv(rt),Wt=Gt.x*Ot+Gt.offsetX;for(Gt=Gt.y*at+Gt.offsetY,isFinite(y)&&(ut=Math.max(Math.abs(jt-Wt)-St,0)),isFinite(x)&&(ct=Math.max(Math.abs(bt-Gt)-St,0)),St=Le.alloc(),St.h(0,0),a=lu(a),Gt=0;Gt<ot;Gt++)bt=E[Gt],bt===rt||!bt.visible&&bt!==a||(at=bt.margin,Ot=at.right+at.left,jt=at.top+at.bottom,bt.measure(ut,ct,0,0),at=bt.measuredBounds,Ot=Math.max(at.width+Ot,0),at=Math.max(at.height+jt,0),St.h(Math.max(Ot,St.width),Math.max(at,St.height)));if(ot===1)b.width=Ot,b.height=at,Le.free(St);else{switch(bt=vv(rt),Gt=yv(rt),ot=E=0,Gt.x!==bt.x&&Gt.y!==bt.y&&(E=St.width/Math.abs(Gt.x-bt.x),ot=St.height/Math.abs(Gt.y-bt.y)),Le.free(St),St=0,Mt!==null&&(St=Mt.strokeWidth*Mt.scale,Lv(Mt)===gn&&(E=ot=Math.max(E,ot))),E+=Math.abs(bt.offsetX)+Math.abs(Gt.offsetX)+St,ot+=Math.abs(bt.offsetY)+Math.abs(Gt.offsetY)+St,Mt=rt.stretch,Mt===Qn&&(Mt=Es(rt,!1)),Mt){case Fe:tt=z=0;break;case Re:isFinite(y)&&(E=y),isFinite(x)&&(ot=x);break;case xn:isFinite(y)&&(E=y),tt=0;break;case Nn:z=0,isFinite(x)&&(ot=x)}rt.Uj(),rt.measure(E,ot,z,tt),b.width=rt.measuredBounds.width+mt,b.height=rt.measuredBounds.height+yt}},pm.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=pe.alloc();z.h(0,0,1,1);var tt=E.margin,ot=tt.left;tt=tt.top;var rt=a.padding,at=rt.left;rt=rt.top,E.arrange(at+ot,rt+tt,b.width,b.height);var ut=vv(E),ct=yv(E),mt=ut.y*b.height+ut.offsetY,yt=ct.x*b.width+ct.offsetX;for(ct=ct.y*b.height+ct.offsetY,z.x=ut.x*b.width+ut.offsetX,z.y=mt,yo(z,yt,ct,0,0),z.x+=ot+at,z.y+=tt+rt,b=0;b<x;b++)ot=y[b],ot!==E&&(at=ot.measuredBounds,tt=ot.margin,rt=Math.max(at.width+tt.right+tt.left,0),ut=Math.max(at.height+tt.top+tt.bottom,0),mt=ot.alignment,mt.Xb()&&(mt=a.defaultAlignment),mt.sb()||(mt=Mi),rt=z.width*mt.x+mt.offsetX-rt*mt.x+tt.left+z.x,tt=z.height*mt.y+mt.offsetY-ut*mt.y+tt.top+z.y,ot.visible&&($o(z.x,z.y,z.width,z.height,rt,tt,at.width,at.height)?ot.arrange(rt,tt,at.width,at.height):ot.arrange(rt,tt,at.width,at.height,new pe(z.x,z.y,z.width,z.height))));pe.free(z)};function mm(){this.xa="Base",this.name="Table"}ee(mm,lr),mm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=Un(),ot=Un(),rt=0;rt<z;rt++){var at=E[rt],ut=at instanceof ze?at:null;if(ut!==null&&zu(ut)&&at.visible){ot.push(ut);for(var ct=ut.O.s,mt=ct.length,yt=0;yt<mt;yt++){var St=ct[yt];ut.type===ze.TableRow?St.row=at.row:ut.type===ze.TableColumn&&(St.column=at.column),tt.push(St)}}else tt.push(at)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var Mt=[],Ot=0;Ot<z;Ot++){var bt=tt[Ot];bt.visible&&(nr(bt,!0),Il(bt,!0),Mt[bt.row]||(Mt[bt.row]=[]),Mt[bt.row][bt.column]||(Mt[bt.row][bt.column]=[]),Mt[bt.row][bt.column].push(bt))}_n(tt);var jt=Un(),Gt=Un(),Wt=Un(),Kt={count:0},$t={count:0},Qe=y,dn=x,rn=a.rowDefs,We=a.colDefs,Ee=null;z=rn.length;for(var Zn=0;Zn<z;Zn++)Ee=rn[Zn],Ee!==void 0&&(Ee.actual=0);z=We.length;for(var zn=0;zn<z;zn++)Ee=We[zn],Ee!==void 0&&(Ee.actual=0);for(var Ri=Mt.length,no=0,vr=0;vr<Ri;vr++)Mt[vr]&&(no=Math.max(no,Mt[vr].length));var wr=Math.min(a.topIndex,Ri-1),es=Math.min(a.leftIndex,no-1),yr=0;Ri=Mt.length;for(var Zu=lu(a),Qo=0;Qo<Ri;Qo++)if(Mt[Qo]){no=Mt[Qo].length;var fl=a.Fb(Qo);fl.actual=0;for(var ns=fl.oc=0;ns<no;ns++)if(Mt[Qo][ns]){var Ju=a.Eb(ns);jt[ns]===void 0&&(Ju.actual=0,Ju.oc=0,jt[ns]=!0);for(var pa=Mt[Qo][ns],Ha=pa.length,ea=0;ea<Ha;ea++){var zs=pa[ea];if(zs.visible||zs===Zu){var jh=1<zs.rowSpan||1<zs.columnSpan;jh&&(Qo<wr||ns<es||Gt.push(zs));var cl=zs.margin,Ic=cl.right+cl.left,na=cl.top+cl.bottom,is=al(zs,fl,Ju,!1),Cp=zs.desiredSize,yf=!isNaN(Cp.height),kl=!isNaN(Cp.width)&&yf;if(jh||is===Fe||kl||Qo<wr||ns<es||(Kt[ns]!==void 0||is!==Re&&is!==xn||(Kt[ns]=-1,Kt.count++),$t[Qo]!==void 0||is!==Re&&is!==Nn||($t[Qo]=-1,$t.count++),Wt.push(zs)),zs.measure(1/0,1/0,0,0),!(Qo<wr||ns<es)){var _s=zs.measuredBounds,wd=Math.max(_s.width+Ic,0),ia=Math.max(_s.height+na,0);if(zs.rowSpan===1&&(is===Fe||is===xn)){Ee=a.Fb(Qo);var zh=Ee.Wc();yr=Math.max(ia-Ee.actual,0),yr+zh>dn&&(yr=Math.max(dn-zh,0));var z0=Ee.oa===0;Ee.oc=Ee.oc+yr,Ee.actual=Ee.oa+yr,dn=Math.max(dn-(yr+(z0?zh:0)),0)}if(zs.columnSpan===1&&(is===Fe||is===Nn)){Ee=a.Eb(ns);var Lp=Ee.Wc();yr=Math.max(wd-Ee.actual,0),yr+Lp>Qe&&(yr=Math.max(Qe-Lp,0));var _y=Ee.oa===0;Ee.oc=Ee.oc+yr,Ee.actual=Ee.oa+yr,Qe=Math.max(Qe-(yr+(_y?Lp:0)),0)}jh&&zs.Uj()}}}}}_n(jt);var Kl=0,du=0;z=a.columnCount;for(var Sf=0;Sf<z;Sf++){var _h=We[Sf];_h!==void 0&&(Kl+=isNaN(_h.Hc)?_h.oc:_h.Hc,_h.oc!==0&&(Kl+=_h.Wc()))}z=a.rowCount;for(var Rc=0;Rc<z;Rc++){var Gh=rn[Rc];Gh!==void 0&&(du+=isNaN(Gh.Hc)?Gh.oc:Gh.Hc,Gh.oc!==0&&(du+=Gh.Wc()))}Qe=Math.max(y-Kl,0);var Xl=dn=Math.max(x-du,0),Qu=Qe;z=Wt.length;for(var Gs=0;Gs<z;Gs++){var Ml=Wt[Gs],_0=a.Fb(Ml.row),fu=a.Eb(Ml.column),jc=Ml.measuredBounds,gl=Ml.margin,Cd=gl.right+gl.left,El=gl.top+gl.bottom;Kt[Ml.column]=fu.oc===0&&Kt[Ml.column]!==void 0?Math.max(jc.width+Cd,Kt[Ml.column]):null,$t[Ml.row]=_0.oc===0&&$t[Ml.row]!==void 0?Math.max(jc.height+El,$t[Ml.row]):null}var xf=0,zc=0,nl;for(nl in $t)nl!=="count"&&(xf+=$t[nl]);for(nl in Kt)nl!=="count"&&(zc+=Kt[nl]);for(var br=Le.alloc(),kp=0;kp<z;kp++){var xs=Wt[kp];if(xs.visible||xs===Zu){var qo=a.Fb(xs.row),Ps=a.Eb(xs.column),cu=0;isFinite(Ps.width)?cu=Ps.width:(isFinite(Qe)&&Kt[xs.column]!==null?zc===0?cu=Ps.actual+Qe:cu=Kt[xs.column]/zc*Qu:Kt[xs.column]!==null?cu=Qe:cu=Ps.actual||Qe,cu=Math.max(0,cu-Ps.Wc()));var qu=0;switch(isFinite(qo.height)?qu=qo.height:(isFinite(dn)&&$t[xs.row]!==null?xf===0?qu=qo.actual+dn:qu=$t[xs.row]/xf*Xl:$t[xs.row]!==null?qu=dn:qu=qo.actual||dn,qu=Math.max(0,qu-qo.Wc())),br.h(Math.max(Ps.minimum,Math.min(cu,Ps.maximum)),Math.max(qo.minimum,Math.min(qu,qo.maximum))),is=al(xs,qo,Ps,!1),is){case xn:br.height=Math.max(br.height,qo.actual+dn);break;case Nn:br.width=Math.max(br.width,Ps.actual+Qe)}var Ld=xs.margin,Gy=Ld.right+Ld.left,G0=Ld.top+Ld.bottom;xs.Uj(),xs.measure(br.width,br.height,Ps.minimum,qo.minimum);var _c=xs.measuredBounds,kd=Math.max(_c.width+Gy,0),Pf=Math.max(_c.height+G0,0);isFinite(Qe)&&(kd=Math.min(kd,br.width)),isFinite(dn)&&(Pf=Math.min(Pf,br.height));var Hs=0;Hs=qo.actual,qo.actual=Math.max(qo.actual,Pf),qo.oc=Math.max(qo.oc,Pf),yr=qo.actual-Hs,dn=Math.max(dn-yr,0),$t[xs.row]===null&&(Xl=Math.max(Xl-yr,0)),Hs=Ps.actual,Ps.actual=Math.max(Ps.actual,kd),Ps.oc=Math.max(Ps.oc,kd),yr=Ps.actual-Hs,Qe=Math.max(Qe-yr,0),Kt[xs.column]===null&&(Qu=Math.max(Qu-yr,0))}}_n(Wt);var gu=Le.alloc(),pl=Un(),Aa=Un();if(z=Gt.length,z!==0){for(var Hh=0;Hh<Ri;Hh++)if(Mt[Hh]){no=Mt[Hh].length;var Gc=a.Fb(Hh);pl[Hh]=Gc.actual;for(var Wh=0;Wh<no;Wh++)if(Mt[Hh][Wh]){var H0=a.Eb(Wh);Aa[Wh]=H0.actual}}}for(var Hc=0;Hc<z;Hc++){var Go=Gt[Hc];if(Go.visible||Go===Zu){var il=a.Fb(Go.row),Wa=a.Eb(Go.column);switch(br.h(Math.max(Wa.minimum,Math.min(y,Wa.maximum)),Math.max(il.minimum,Math.min(x,il.maximum))),is=al(Go,il,Wa,!1),is){case Re:Aa[Wa.index]!==0&&(br.width=Math.min(br.width,Aa[Wa.index])),pl[il.index]!==0&&(br.height=Math.min(br.height,pl[il.index]));break;case xn:Aa[Wa.index]!==0&&(br.width=Math.min(br.width,Aa[Wa.index]));break;case Nn:pl[il.index]!==0&&(br.height=Math.min(br.height,pl[il.index]))}isFinite(Wa.width)&&(br.width=Wa.width),isFinite(il.height)&&(br.height=il.height),gu.h(0,0);for(var W0=Wa.minimum,oa=il.minimum,$u=1;$u<Go.rowSpan&&!(Go.row+$u>=a.rowCount);$u++)Ee=a.Fb(Go.row+$u),yr=0,yr=is===Re||is===Nn?Math.max(Ee.minimum,pl[Go.row+$u]===0?Ee.maximum:Math.min(pl[Go.row+$u],Ee.maximum)):Math.max(Ee.minimum,isNaN(Ee.Hc)?Ee.maximum:Math.min(Ee.Hc,Ee.maximum)),gu.height+=yr,oa+=Ee.minimum;for(var Ua=1;Ua<Go.columnSpan&&!(Go.column+Ua>=a.columnCount);Ua++)Ee=a.Eb(Go.column+Ua),yr=0,yr=is===Re||is===xn?Math.max(Ee.minimum,Aa[Go.column+Ua]===0?Ee.maximum:Math.min(Aa[Go.column+Ua],Ee.maximum)):Math.max(Ee.minimum,isNaN(Ee.Hc)?Ee.maximum:Math.min(Ee.Hc,Ee.maximum)),gu.width+=yr,W0+=Ee.minimum;br.width+=gu.width,br.height+=gu.height;var Wc=Go.margin,Uh=Wc.right+Wc.left,Mp=Wc.top+Wc.bottom;Go.measure(br.width,br.height,W0,oa);for(var Uc=Go.measuredBounds,Nl=Math.max(Uc.width+Uh,0),Md=Math.max(Uc.height+Mp,0),Vh=0,Vc=0;Vc<Go.rowSpan&&!(Go.row+Vc>=a.rowCount);Vc++)Ee=a.Fb(Go.row+Vc),Vh+=Ee.total||0;if(Vh<Md){var th=Md-Vh,Zl=Md-Vh;if(Go.spanAllocation!==null)for(var eh=Go.spanAllocation,pu=0;pu<Go.rowSpan&&!(0>=th)&&!(Go.row+pu>=a.rowCount);pu++){Ee=a.Fb(Go.row+pu);var nh=Ee.oa||0,Ed=eh(Go,Ee,Zl);Ee.actual=Math.min(Ee.maximum,nh+Ed),Ee.oa!==nh&&(th-=Ee.oa-nh)}for(;0<th;){var ml=Ee.oa||0;if(isNaN(Ee.height)&&Ee.maximum>ml&&(Ee.actual=Math.min(Ee.maximum,ml+th),Ee.oa!==ml&&(th-=Ee.oa-ml)),Ee.index===0)break;Ee=a.Fb(Ee.index-1)}}for(var wf=0,ih=0;ih<Go.columnSpan&&!(Go.column+ih>=a.columnCount);ih++)Ee=a.Eb(Go.column+ih),wf+=Ee.total||0;if(wf<Nl){var Cf=Nl-wf,Hy=Nl-wf;if(Go.spanAllocation!==null)for(var mu=Go.spanAllocation,Nd=0;Nd<Go.columnSpan&&!(0>=Cf)&&!(Go.column+Nd>=a.columnCount);Nd++){Ee=a.Eb(Go.column+Nd);var Ep=Ee.oa||0,Wy=mu(Go,Ee,Hy);Ee.actual=Math.min(Ee.maximum,Ep+Wy),Ee.oa!==Ep&&(Cf-=Ee.oa-Ep)}for(;0<Cf;){var U0=Ee.oa||0;if(isNaN(Ee.width)&&Ee.maximum>U0&&(Ee.actual=Math.min(Ee.maximum,U0+Cf),Ee.oa!==U0&&(Cf-=Ee.oa-U0)),Ee.index===0)break;Ee=a.Eb(Ee.index-1)}}}}_n(Gt),Le.free(gu),Le.free(br),pl!==void 0&&_n(pl),Aa!==void 0&&_n(Aa);var Lf=0,kf=0,V0=a.desiredSize,gx=a.maxSize;is=Es(a,!0);var Np=du=Kl=0,Tp=0;z=a.columnCount;for(var Y0=0;Y0<z;Y0++)We[Y0]!==void 0&&(Ee=a.Eb(Y0),isFinite(Ee.width)?(Np+=Ee.width,Np+=Ee.Wc()):Mm(Ee)===_g?(Np+=Ee.oa,Np+=Ee.Wc()):Ee.oa!==0&&(Kl+=Ee.oa,Kl+=Ee.Wc()));isFinite(V0.width)?Lf=Math.min(V0.width,gx.width):Lf=is!==Fe&&isFinite(y)?y:Kl,Lf=Math.max(Lf,a.minSize.width),Lf=Math.max(Lf-Np,0);for(var Qx=Kl===0?1:Math.max(Lf/Kl,1),K0=0;K0<z;K0++)We[K0]!==void 0&&(Ee=a.Eb(K0),isFinite(Ee.width)||Mm(Ee)===_g||(Ee.actual=Ee.oa*Qx),Ee.position=b.width,Ee.oa!==0&&(b.width+=Ee.oa,b.width+=Ee.Wc()));z=a.rowCount;for(var X0=0;X0<z;X0++)rn[X0]!==void 0&&(Ee=a.Fb(X0),isFinite(Ee.height)?(Tp+=Ee.height,Tp+=Ee.Wc()):Mm(Ee)===_g?(Tp+=Ee.oa,Tp+=Ee.Wc()):Ee.oa!==0&&(du+=Ee.oa,du+=Ee.Wc()));isFinite(V0.height)?kf=Math.min(V0.height,gx.height):kf=is!==Fe&&isFinite(x)?x:du,kf=Math.max(kf,a.minSize.height),kf=Math.max(kf-Tp,0);for(var qx=du===0?1:Math.max(kf/du,1),Z0=0;Z0<z;Z0++)rn[Z0]!==void 0&&(Ee=a.Fb(Z0),isFinite(Ee.height)||Mm(Ee)===_g||(Ee.actual=Ee.oa*qx),Ee.position=b.height,Ee.oa!==0&&(b.height+=Ee.oa,b.height+=Ee.Wc()));z=ot.length;for(var Uy=0;Uy<z;Uy++){var Fp=ot[Uy],Vy=0,Yy=0;Fp.type===ze.TableRow?(Vy=b.width,Ee=a.Fb(Fp.row),Yy=Ee.actual):(Ee=a.Eb(Fp.column),Vy=Ee.actual,Yy=b.height),Fp.measuredBounds.h(0,0,Vy,Yy),nr(Fp,!1)}_n(ot),a.inRowsCols=Mt},mm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding,z=b.left;b=b.top;var tt=a.inRowsCols;if(tt!==null){for(var ot,rt,at=tt.length,ut=0,ct=0;ct<at;ct++)tt[ct]&&(ut=Math.max(ut,tt[ct].length));rt=a.rowDefs,ot=a.colDefs;var mt=ct=0,yt=Math.min(a.topIndex,at-1);if(0<rt.length){for(;yt!==at&&(rt[yt]===void 0||rt[yt].oa===0);)yt++;yt=Math.max(Math.min(yt,at-1),0),ct=-rt[yt].position}var St=Math.min(a.leftIndex,ut-1);if(0<ot.length){for(;St!==ut&&(ot[St]===void 0||ot[St].oa===0);)St++;St=Math.max(Math.min(St,ut-1),0),mt=-ot[St].position}for(var Mt=0,Ot=0;Mt!==at&&rt[Mt]===void 0;)Mt++;for(;Ot!==at&&ot[Ot]===void 0;)Ot++;ut=a.part,a.Fb(Mt),a.Eb(Ot);for(var bt=0;bt<y.length;bt++){var jt=y[bt];if(jt instanceof ze&&jt.visible&&zu(jt)){if(jt.type===ze.TableRow){ot=a.Fb(jt.row);var Gt=a.Eb(Ot)}else ot=a.Fb(Mt),Gt=a.Eb(jt.column);rt=ot.position+ct+b,ot.oa!==0&&(rt+=ot.Io(Math.max(Mt,yt))),ot=Gt.position+mt+z,Gt.oa!==0&&(ot+=Gt.Io(Math.max(Ot,St))),Gt=jt.measuredBounds,jt.Uk(),jt.actualBounds.ka();var Wt=jt.actualBounds,Kt=pe.allocAt(Wt.x,Wt.y,Wt.width,Wt.height);Wt.x=jt.type===ze.TableRow?z:ot,Wt.y=jt.type===ze.TableColumn?b:rt,Wt.width=Gt.width,Wt.height=Gt.height,jt.actualBounds.freeze(),Il(jt,!1),po(Kt,Wt)||ut===null||(ut.oh(),jt.Pn(ut)),pe.free(Kt)}}for(bt=Le.alloc(),jt=0;jt<at;jt++)if(tt[jt]){for(ut=tt[jt].length,Gt=a.Fb(jt),rt=Gt.position+ct+b,Gt.oa!==0&&(rt+=Gt.Io(Math.max(Mt,yt))),Wt=0;Wt<ut;Wt++)if(tt[jt][Wt]){Kt=a.Eb(Wt),ot=Kt.position+mt+z,Kt.oa!==0&&(ot+=Kt.Io(Math.max(Ot,St)));for(var $t=tt[jt][Wt],Qe=$t.length,dn=0;dn<Qe;dn++){var rn=$t[dn],We=rn.measuredBounds;bt.h(0,0);for(var Ee=1;Ee<rn.rowSpan&&!(jt+Ee>=a.rowCount);Ee++){var Zn=a.Fb(jt+Ee);Zn.oa!==0&&(bt.height+=Zn.total)}for(Ee=1;Ee<rn.columnSpan&&!(Wt+Ee>=a.columnCount);Ee++)Zn=a.Eb(Wt+Ee),Zn.oa!==0&&(bt.width+=Zn.total);var zn=Kt.oa+bt.width,Ri=Gt.oa+bt.height;Ee=ot,Zn=rt;var no=zn,vr=Ri,wr=ot,es=rt,yr=zn,Zu=Ri;ot+zn>x.width&&(yr=Math.max(x.width-ot,0)),rt+Ri>x.height&&(Zu=Math.max(x.height-rt,0));var Qo=rn.alignment;if(Qo.Xb()){Qo=a.defaultAlignment,Qo.sb()||(Qo=Mi);var fl=Qo.x,ns=Qo.y,Ju=Qo.offsetX;Qo=Qo.offsetY;var pa=Kt.alignment,Ha=Gt.alignment;pa.sb()&&(fl=pa.x,Ju=pa.offsetX),Ha.sb()&&(ns=Ha.y,Qo=Ha.offsetY)}else fl=Qo.x,ns=Qo.y,Ju=Qo.offsetX,Qo=Qo.offsetY;(isNaN(fl)||isNaN(ns))&&(ns=fl=.5,Qo=Ju=0),pa=We.width,Ha=We.height;var ea=rn.margin,zs=ea.left+ea.right,jh=ea.top+ea.bottom,cl=al(rn,Gt,Kt,!1);!isNaN(rn.desiredSize.width)||cl!==Re&&cl!==xn||(pa=Math.max(zn-zs,0)),!isNaN(rn.desiredSize.height)||cl!==Re&&cl!==Nn||(Ha=Math.max(Ri-jh,0)),zn=rn.maxSize,Ri=rn.minSize,pa=Math.min(zn.width,pa),Ha=Math.min(zn.height,Ha),pa=Math.max(Ri.width,pa),Ha=Math.max(Ri.height,Ha),zn=Ha+jh,Ee+=no*fl-(pa+zs)*fl+Ju+ea.left,Zn+=vr*ns-zn*ns+Qo+ea.top,rn.visible&&($o(wr,es,yr,Zu,Ee,Zn,We.width,We.height)?rn.arrange(Ee,Zn,pa,Ha):rn.arrange(Ee,Zn,pa,Ha,new pe(wr,es,yr,Zu)))}}}for(Le.free(bt),a=0;a<E;a++)x=y[a],z=x instanceof ze?x:null,z!==null&&zu(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function vm(){this.xa="Base"}ee(vm,lr),vm.prototype.measure=function(){},vm.prototype.arrange=function(){};function ym(){this.xa="Base"}ee(ym,lr),ym.prototype.measure=function(){},ym.prototype.arrange=function(){};function Sm(){this.xa="Base"}ee(Sm,lr),Sm.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&de("Viewbox Panel cannot contain more than one GraphObject."),E=E[0],E.Ca=1,E.Uj(),E.measure(1/0,1/0,z,tt);var ot=E.measuredBounds,rt=E.margin,at=rt.right+rt.left;if(rt=rt.top+rt.bottom,isFinite(y)||isFinite(x)){var ut=E.scale,ct=ot.width;ot=ot.height;var mt=Math.max(y-at,0),yt=Math.max(x-rt,0),St=1;a.viewboxStretch===gn?ct!==0&&ot!==0&&(St=Math.min(mt/ct,yt/ot)):ct!==0&&ot!==0&&(St=Math.max(mt/ct,yt/ot)),St===0&&(St=1e-4),E.Ca*=St,ut!==E.scale&&(nr(E,!0),E.measure(1/0,1/0,z,tt))}ot=E.measuredBounds,b.width=isFinite(y)?y:Math.max(ot.width+at,0),b.height=isFinite(x)?x:Math.max(ot.height+rt,0)},Sm.prototype.arrange=function(a,y,x){y=y[0];var E=y.measuredBounds,b=y.margin,z=Math.max(E.width+(b.right+b.left),0);b=Math.max(E.height+(b.top+b.bottom),0);var tt=y.alignment;tt.Xb()&&(tt=a.defaultAlignment),tt.sb()||(tt=Mi),y.arrange(x.width*tt.x-z*tt.x+tt.offsetX,x.height*tt.y-b*tt.y+tt.offsetY,E.width,E.height)};function Rg(){this.xa="Base"}ee(Rg,lr),Rg.prototype.measure=function(){},Rg.prototype.arrange=function(){},Rg.prototype.gc=function(a,y,x){x=a.Df()*x.scale,0>=x&&(x=1);var E=a.gridCellSize,b=E.width;E=E.height;var z=a.naturalBounds,tt=a.actualBounds,ot=z.width,rt=z.height,at=Math.ceil(ot/b),ut=Math.ceil(rt/E),ct=a.gridOrigin,mt=ct.x;ct=ct.y,y.save(),y.beginPath(),y.rect(0,0,ot,rt),y.clip(),y.Se();for(var yt=[],St=a.O.s,Mt=St.length,Ot=0;Ot<Mt;Ot++){var bt=St[Ot],jt=[];if(yt.push(jt),bt.visible){var Gt=bt.interval;if(!(0>Gt)){bt=pv(bt.figure);for(var Wt=0;Wt<Mt;Wt++)if(Wt!==Ot){var Kt=St[Wt];Kt.visible&&pv(Kt.figure)===bt&&(Kt=Kt.interval,Kt>Gt&&jt.push(Kt))}}}}for(St=a.O.s,Mt=St.length,Ot=0;Ot<Mt;Ot++){var $t=St[Ot];if($t.visible&&(jt=$t.interval||1,bt=Math.abs(jt),!(2>b*bt*x))){if(Gt=$t.segmentIndex,(!isFinite(Gt)||isNaN(Gt))&&(Gt=0),0>Gt&&(Gt=bt-Math.min(-Gt,bt)),Gt=Math.round(Gt%bt),bt=$t.opacity,Wt=1,bt!==1){if(bt===0)continue;Wt=y.globalAlpha,y.globalAlpha=Wt*bt}Kt=yt[Ot];var Qe=!1,dn=$t.strokeDashArray;if(dn!==null&&(Qe=!0,y.js(dn,$t.strokeDashOffset)),$t.figure==="LineV"&&$t.stroke!==null&&0<$t.strokeWidth){for(y.lineWidth=$t.strokeWidth,zo(a,y,$t.stroke,!1,!1,z,tt),y.beginPath(),dn=$t=Math.floor((mt-b)/b);dn<=$t+at;dn++){var rn=dn*b+mt;0<=rn&&rn<=ot&&xm(dn,jt,Gt,Kt)&&(y.moveTo(rn,0),y.lineTo(rn,rt))}y.stroke(),y.Se()}else if($t.figure==="LineH"&&$t.stroke!==null&&0<$t.strokeWidth){for(y.lineWidth=$t.strokeWidth,zo(a,y,$t.stroke,!1,!1,z,tt),y.beginPath(),dn=$t=Math.floor((ct-E)/E);dn<=$t+ut;dn++)rn=dn*E+ct,0<=rn&&rn<=rt&&xm(dn,jt,Gt,Kt)&&(y.moveTo(0,rn),y.lineTo(ot,rn));y.stroke(),y.Se()}else if($t.figure==="BarV"&&$t.fill!==null)for(zo(a,y,$t.fill,!0,!1,z,tt),$t=$t.width,isNaN($t)&&($t=b),rn=dn=Math.floor((mt-b)/b);rn<=dn+at;rn++){var We=rn*b+mt;0<=We+$t&&We<=ot&&xm(rn,jt,Gt,Kt)&&y.fillRect(We,0,$t,rt)}else if($t.figure==="BarH"&&$t.fill!==null)for(zo(a,y,$t.fill,!0,!1,z,tt),$t=$t.height,isNaN($t)&&($t=E),rn=dn=Math.floor((ct-E)/E);rn<=dn+ut;rn++)We=rn*E+ct,0<=We+$t&&We<=rt&&xm(rn,jt,Gt,Kt)&&y.fillRect(0,We,ot,$t);Qe&&y.fs(),bt!==1&&(y.globalAlpha=Wt)}}y.restore(),y.Vc(!1)};function xm(a,y,x,E){if(0>y)return a%y===x;if(a%y!==x)return!1;y=E.length;for(var b=0;b<y;b++)if(a%E[b]===x)return!1;return!0}function Pm(){this.xa="Base"}ee(Pm,lr),Pm.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof Ai||a instanceof Ue){var tt=null,ot=null;if(a instanceof Ue&&(tt=a),a instanceof Ai&&(ot=a,tt=ot.adornedPart,a.j===null&&(a.j=[])),tt instanceof Ue){var rt=tt;if(z===0)Br(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var at=a instanceof Ai?null:tt.path;y=tt.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var ut=rt.points,ct=tt.pointsCount;ot!==null?ot.Ul(!1):tt!==null&&tt.Ul(!1),ot=y.width;var mt=y.height,yt=a.j;if(yt.length=0,at!==null){i1(a,ot,mt,at);var St=at.measuredBounds;x.ed(St),yt.push(St)}St=ci.alloc();for(var Mt=At.alloc(),Ot=At.alloc(),bt=0;bt<z;bt++){var jt=E[bt];if(jt!==at)if(jt.isPanelMain&&jt instanceof ei){i1(a,ot,mt,jt);var Gt=jt.measuredBounds;x.ed(Gt),yt.push(Gt)}else if(2>ct)jt.measure(1/0,1/0,0,0),Gt=jt.measuredBounds,x.ed(Gt),yt.push(Gt);else{var Wt=jt.segmentIndex,Kt=jt.segmentFraction,$t=jt.alignmentFocus;$t.Mc()&&($t=Mi);var Qe=jt.segmentOrientation,dn=jt.segmentOffset;if(isNaN(Wt)){var rn=rt.ua;Gt=Un(),rn.Qu(Kt,Gt);var We=At.allocAt(Gt[0],Gt[1]);if(We.add(rt.i(0)),rn.type===Xe.j?We.offset(-rn.startX,-rn.startY):(rn=rn.figures.first(),rn!==null&&We.offset(-rn.startX,-rn.startY)),rn=Gt[2],Qe!==ps){var Ee=rt.computeAngle(jt,Qe,rn);jt.Kb=Ee}Ee=We.x-y.x;var Zn=We.y-y.y;At.free(We),_n(Gt)}else if(Wt<-ct||Wt>=ct)Gt=At.alloc(),rt.vg(),rt.computeMidPoint(Gt),rn=rt.midAngle,Qe!==ps&&(Ee=rt.computeAngle(jt,Qe,rn),jt.Kb=Ee),Ee=Gt.x-y.x,Zn=Gt.y-y.y,At.free(Gt);else{if(Ee=0,0<=Wt?(Zn=ut.M(Wt),Gt=Wt<ct-1?ut.M(Wt+1):Zn):(Ee=ct+Wt,Zn=ut.M(Ee),Gt=0<Ee?ut.M(Ee-1):Zn),Zn.Xa(Gt)){0<=Wt?(rn=0<Wt?ut.M(Wt-1):Zn,Ee=Wt<ct-2?ut.M(Wt+2):Gt):(rn=Ee<ct-1?ut.M(Ee+1):Zn,Ee=1<Ee?ut.M(Ee-2):Gt),We=rn.Bf(Zn);var zn=Gt.Bf(Ee);rn=We>zn+10?0<=Wt?rn.ab(Zn):Zn.ab(rn):zn>We+10?0<=Wt?Gt.ab(Ee):Ee.ab(Gt):0<=Wt?rn.ab(Ee):Ee.ab(rn)}else rn=0<=Wt?Zn.ab(Gt):Gt.ab(Zn);Qe!==ps&&(Ee=rt.computeAngle(jt,Qe,rn),jt.Kb=Ee),Ee=Zn.x+(Gt.x-Zn.x)*Kt-y.x,Zn=Zn.y+(Gt.y-Zn.y)*Kt-y.y}jt.measure(1/0,1/0,0,0),Gt=jt.measuredBounds,We=jt.naturalBounds;var Ri=0;jt instanceof ei&&(Ri=jt.strokeWidth),zn=We.width+Ri;var no=We.height+Ri;St.reset(),St.translate(-Gt.x,-Gt.y),St.scale(jt.scale,jt.scale),St.rotate(Qe===ps?jt.angle:rn,zn/2,no/2),Qe!==Jg&&Qe!==qg||St.rotate(90,zn/2,no/2),Qe!==Qg&&Qe!==$g||St.rotate(-90,zn/2,no/2),Qe===Qm&&(45<rn&&135>rn||225<rn&&315>rn)&&St.rotate(-rn,zn/2,no/2),We=new pe(0,0,zn,no),Mt.xi(We,$t),St.Ga(Mt),$t=-Mt.x+Ri/2*jt.scale,jt=-Mt.y+Ri/2*jt.scale,Ot.assign(dn),Ri=isNaN(dn.x);var vr=isNaN(dn.y);if(Ri||vr){zn=zn/2+3,no=no/2+3;var wr=45<=rn&&135>=rn,es=225<=rn&&315>=rn;Qe===ps&&(wr||es)?(Ot.x=vr?zn:dn.y,Ot.y=Ri?no:dn.x,wr?0<=Wt||isNaN(Wt)&&.5>Kt||!Ri||(Ot.y=-no):es&&((0<=Wt||isNaN(Wt)&&.5>Kt)&&Ri&&(Ot.y=-no),vr&&(Ot.x=-zn))):(Ri&&(Ot.x=0<=Wt||isNaN(Wt)&&.5>Kt?zn:-zn),vr&&(Ot.y=-no),Ot.rotate(rn))}else Ot.rotate(rn);Ee+=Ot.x,Zn+=Ot.y,We.set(Gt),We.h(Ee+$t,Zn+jt,Gt.width,Gt.height),yt.push(We),x.ed(We)}}if(tt!==null)for(E=tt.labelNodes;E.next();)E.value.measure(1/0,1/0);a.jg=x,a.position.h(y.x+x.x,y.y+x.y),Br(b,x.width||0,x.height||0),ci.free(St),At.free(Mt),At.free(Ot)}}}},Pm.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Ai||a instanceof Ue){var E=a,b=null;a instanceof Ai&&(b=a,E=b.adornedPart);var z=a instanceof Ai?null:E.path,tt=a.j;if(tt.length!==0){var ot=0;if(z!==null&&ot<tt.length){var rt=tt[ot];ot++,z.arrange(rt.x-a.jg.x,rt.y-a.jg.y,rt.width,rt.height)}for(rt=0;rt<x;rt++){var at=y[rt];if(at!==z&&ot<tt.length){var ut=tt[ot];ot++,at.arrange(ut.x-a.jg.x,ut.y-a.jg.y,ut.width,ut.height)}}}if(y=E.points,x=y.count,2<=x&&a instanceof Ue)for(z=a.labelNodes;z.next();){var ct=a;tt=z.value,ot=tt.segmentIndex,rt=tt.segmentFraction;var mt=tt.alignmentFocus;if(at=tt.segmentOrientation,ut=tt.segmentOffset,isNaN(ot)){var yt=ct.ua,St=Un();yt.Qu(rt,St);var Mt=At.allocAt(St[0],St[1]);Mt.add(ct.i(0)),yt.type===Xe.j||(yt=yt.figures.first()),Mt.offset(-yt.startX,-yt.startY),yt=St[2],at!==ps&&(ct=ct.computeAngle(tt,at,yt),tt.angle=ct),ct=Mt.x;var Ot=Mt.y;At.free(Mt),_n(St)}else if(ot<-x||ot>=x)St=At.alloc(),yt=ct,Ot=St,yt.vg(),yt.computeMidPoint(Ot),yt=ct.midAngle,at!==ps&&(ct=ct.computeAngle(tt,at,yt),tt.angle=ct),ct=St.x,Ot=St.y,At.free(St);else{if(Mt=0,0<=ot?(St=y.s[ot],Ot=ot<x-1?y.s[ot+1]:St):(Mt=x+ot,St=y.s[Mt],Ot=0<Mt?y.s[Mt-1]:St),St.Xa(Ot)){0<=ot?(yt=0<ot?y.s[ot-1]:St,Mt=ot<x-2?y.s[ot+2]:Ot):(yt=Mt<x-1?y.s[Mt+1]:St,Mt=1<Mt?y.s[Mt-2]:Ot);var bt=yt.Bf(St),jt=Ot.Bf(Mt);yt=bt>jt+10?0<=ot?yt.ab(St):St.ab(yt):jt>bt+10?0<=ot?Ot.ab(Mt):Mt.ab(Ot):0<=ot?yt.ab(Mt):Mt.ab(yt)}else yt=0<=ot?St.ab(Ot):Ot.ab(St);at!==ps&&(ct=ct.computeAngle(tt,at,yt),tt.angle=ct),ct=St.x+(Ot.x-St.x)*rt,Ot=St.y+(Ot.y-St.y)*rt}if(mt.ys())tt.location=new At(ct,Ot);else{mt.Mc()&&(mt=Mi),St=ci.alloc(),St.reset(),St.scale(tt.scale,tt.scale),St.rotate(tt.angle,0,0);var Gt=tt.naturalBounds;Mt=pe.allocAt(0,0,Gt.width,Gt.height),bt=At.alloc(),bt.xi(Mt,mt),St.Ga(bt),mt=-bt.x,jt=-bt.y;var Wt=Gt.width,Kt=Gt.height;Gt=At.alloc(),Gt.assign(ut);var $t=isNaN(ut.x),Qe=isNaN(ut.y);if($t||Qe){Wt=Wt/2+3,Kt=Kt/2+3;var dn=45<=yt&&135>=yt,rn=225<=yt&&315>=yt;at===ps&&(dn||rn)?(Gt.x=Qe?Wt:ut.y,Gt.y=$t?Kt:ut.x,dn?0<=ot||isNaN(ot)&&.5>rt||!$t||(Gt.y=-Kt):rn&&((0<=ot||isNaN(ot)&&.5>rt)&&$t&&(Gt.y=-Kt),Qe&&(Gt.x=-Wt))):($t&&(Gt.x=0<=ot||isNaN(ot)&&.5>rt?Wt:-Wt),Qe&&(Gt.y=-Kt),Gt.rotate(yt))}else Gt.rotate(yt);ct+=Gt.x,Ot+=Gt.y,St.pp(Mt),mt+=Mt.x,jt+=Mt.y,ot=At.allocAt(ct+mt,Ot+jt),tt.move(ot),At.free(ot),At.free(Gt),At.free(bt),pe.free(Mt),ci.free(St)}}b!==null?b.Ul(!1):E.Ul(!1),E=A1(a),a.location.h(a.position.x+E.x,a.position.y+E.y),At.free(E)}};function i1(a,y,x,E){if(da(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof Ai&&a.type===ze.Link&&a.adornedObject instanceof ei&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof Ue&&a.ua!==null?(a=a.geometry.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):a instanceof Ai&&a.adornedPart.ua!==null?(a=a.adornedPart.ua.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):E.Ge(-(b/2),-(b/2),y+b,x+b),b=E.desiredSize,b.w()||E.ua===null?E.dc.h(0,0,b.width,b.height):E.dc.assign(E.ua.bounds),nr(E,!1)}}function jg(){this.xa="Base"}ee(jg,lr),jg.prototype.measure=function(a,y,x,E,b,z,tt){var ot=a.Pb();a.graduatedBounds=[];var rt=ot.margin,at=rt.right+rt.left,ut=rt.top+rt.bottom;ot.measure(y,x,z,tt);var ct=ot.measuredBounds,mt=new pe(-rt.left,-rt.top,Math.max(ct.width+at,0),Math.max(ct.height+ut,0));a.graduatedBounds.push(mt),b.assign(mt);for(var yt=ot.geometry,St=ot.strokeWidth,Mt=yt.flattenedSegments,Ot=yt.flattenedLengths,bt=yt.flattenedTotalLength,jt=Mt.length,Gt=0,Wt=0,Kt=Un(),$t=0;$t<jt;$t++){var Qe=Mt[$t],dn=[];Wt=Gt=0;for(var rn=Qe.length,We=0;We<rn;We+=2){var Ee=Qe[We],Zn=Qe[We+1];if(We!==0){var zn=180*Math.atan2(Zn-Wt,Ee-Gt)/Math.PI;0>zn&&(zn+=360),dn.push(zn)}Gt=Ee,Wt=Zn}Kt.push(dn)}if(a.graduatedIntervals===null){for(var Ri=[],no=a.O.s,vr=no.length,wr=0;wr<vr;wr++){var es=no[wr],yr=[];if(Ri.push(yr),es.visible){var Zu=es.interval;if(!(0>Zu)){for(var Qo=0;Qo<vr;Qo++)if(Qo!==wr){var fl=no[Qo];if(fl.visible&&es.constructor===fl.constructor){var ns=fl.interval;ns>Zu&&yr.push(ns)}}}}}a.graduatedIntervals=Ri}var Ju=a.graduatedIntervals,pa=a.O.s,Ha=pa.length,ea=0,zs=0,jh=bt;a.graduatedMarks=[];for(var cl,Ic=0;Ic<Ha;Ic++){var na=pa[Ic];if(cl=[],na.visible&&na!==ot){var is=Math.abs(na.interval),Cp=a.graduatedTickUnit;if(!(2>Cp*is*bt/a.graduatedRange&&na.graduatedSkip===null)){var yf=Ot[0][0],kl=0,_s=0;zs=bt*na.graduatedStart-1e-4,jh=bt*na.graduatedEnd+1e-4;var wd=Cp*is,ia=a.graduatedTickBase;if(ia<a.graduatedMin){var zh=(a.graduatedMin-ia)/wd;zh=zh%1===0?zh:Math.floor(zh+1),ia+=zh*wd}else ia>a.graduatedMin+wd&&(ia-=Math.floor((ia-a.graduatedMin)/wd)*wd);for(var z0=Ju[Ic],Lp=ia,_y=1e-6*a.graduatedMax,Kl=1;ia<=a.graduatedMax+_y;Kl++){t:{for(var du=z0.length,Sf=0;Sf<du;Sf++){var _h=(ia-a.graduatedTickBase)%(z0[Sf]*a.graduatedTickUnit),Rc=1e-6*a.graduatedTickUnit;if(_h<Rc&&_h>-Rc){var Gh=!1;break t}}Gh=!0}if(Gh&&(ia>a.graduatedMax&&(ia=a.graduatedMax),na.graduatedSkip===null||na instanceof io&&!na.graduatedSkip(ia,na)||na instanceof ei&&!na.graduatedSkip(ia,na))&&(ea=(ia-a.graduatedMin)*bt/a.graduatedRange,ea>bt&&(ea=bt),zs<=ea&&ea<=jh)){for(var Xl=Kt[kl][_s],Qu=Ot[kl][_s];kl<Ot.length;){for(;ea>yf&&_s<Ot[kl].length-1;)_s++,Xl=Kt[kl][_s],Qu=Ot[kl][_s],yf+=Qu;if(ea<=yf)break;kl++,_s=0,Xl=Kt[kl][_s],Qu=Ot[kl][_s],yf+=Qu}var Gs=Mt[kl],Ml=Gs[2*_s],_0=Gs[2*_s+1],fu=(ea-(yf-Qu))/Qu,jc=new At(Ml+(Gs[2*_s+2]-Ml)*fu+St/2-yt.bounds.x,_0+(Gs[2*_s+3]-_0)*fu+St/2-yt.bounds.y);jc.scale(ot.scale,ot.scale);t:{var gl=Xl,Cd=Kt[kl];if(!(.5005>fu&&.4995<fu)){var El=gl;if(.5>fu?0<_s?El=Cd[_s-1]:Jt.$(Gs[0],Gs[Gs.length-2])&&Jt.$(Gs[1],Gs[Gs.length-1])&&(El=Cd[Cd.length-1]):.5<fu&&(_s+1<Cd.length?El=Cd[_s+1]:Jt.$(Gs[0],Gs[Gs.length-2])&&Jt.$(Gs[1],Gs[Gs.length-1])&&(El=Cd[0])),gl!==El){var xf=Math.abs(gl-El);if(180<xf&&(gl<El?gl+=360:El+=360,xf=Math.abs(gl-El)),5e-4>fu||.9995<fu){Xl=(gl+El)/2%360;break t}if(10>xf){var zc=1-Math.abs(.5-fu);Xl=(gl*zc+El*(1-zc))%360;break t}}}Xl=gl}if(na instanceof io){var nl="";na.graduatedFunction!==null?(nl=na.graduatedFunction(ia,na),nl=nl!=null?nl.toString():""):nl=(+ia.toFixed(2)).toString(),nl!==""&&cl.push({$l:jc,angle:Xl,text:nl})}else cl.push({$l:jc,angle:Xl})}ia=Lp+Kl*wd}}}a.graduatedMarks.push(cl)}_n(Kt);var br=a.graduatedMarks;if(br!==null)for(var kp=E.length,xs=0;xs<kp;xs++){var qo=E[xs],Ps=br[xs];if(qo.visible&&qo!==ot&&Ps.length!==0){if(qo instanceof ei){var cu=a,qu=b,Ld=qo.alignmentFocus;Ld.Mc()&&(Ld=sa);var Gy=qo.angle;qo.Kb=0,qo.measure(1/0,1/0,0,0),qo.Kb=Gy;var G0=qo.measuredBounds,_c=G0.width,kd=G0.height,Pf=pe.allocAt(0,0,_c,kd),Hs=At.alloc();Hs.xi(Pf,Ld),pe.free(Pf);for(var gu=-Hs.x,pl=-Hs.y,Aa=new pe,Hh=Ps.length,Gc=0;Gc<Hh;Gc++)for(var Wh=Ps[Gc],H0=Wh.$l.x,Hc=Wh.$l.y,Go=Wh.angle,il=0;4>il;il++){switch(il){case 0:Hs.h(gu,pl);break;case 1:Hs.h(gu+_c,pl);break;case 2:Hs.h(gu,pl+kd);break;case 3:Hs.h(gu+_c,pl+kd)}Hs.rotate(Go+qo.angle),Hs.offset(H0,Hc),Gc===0&&il===0?Aa.h(Hs.x,Hs.y,0,0):Aa.Ye(Hs),Hs.offset(-H0,-Hc),Hs.rotate(-Go-qo.angle)}At.free(Hs),cu.graduatedBounds!==null&&cu.graduatedBounds.push(Aa),yo(qu,Aa.x,Aa.y,Aa.width,Aa.height)}else if(qo instanceof io){var Wa=a,W0=b;Wa.temporaryTextBlock===null&&(Wa.temporaryTextBlock=new io);var oa=Wa.temporaryTextBlock;y1(oa,qo);var $u=qo.alignmentFocus;$u.Mc()&&($u=sa);for(var Ua=qo.segmentOrientation,Wc=qo.segmentOffset,Uh=new pe,Mp=0,Uc=0,Nl=0,Md=0,Vh=0,Vc=Ps.length,th=0;th<Vc;th++){var Zl=Ps[th];Mp=Zl.$l.x,Uc=Zl.$l.y,Nl=Zl.angle,Vh=Md=qo.angle,Ua!==ps&&(Vh=Ua===Zg||Ua===Jm?Nl+qo.angle:Nl,Md=Ue.computeAngle(Ua,Vh)),oa.Kb=Md,oa.text=Zl.text||"",oa.measure(1/0,1/0,0,0);var eh=oa.measuredBounds,pu=oa.naturalBounds,nh=pu.width,Ed=pu.height,ml=ci.alloc();ml.reset(),ml.translate(-eh.x,-eh.y),ml.scale(oa.scale,oa.scale),ml.rotate(Vh,nh/2,Ed/2),Ua!==Jg&&Ua!==qg||ml.rotate(90,nh/2,Ed/2),Ua!==Qg&&Ua!==$g||ml.rotate(-90,nh/2,Ed/2),Ua===Qm&&(45<Nl&&135>Nl||225<Nl&&315>Nl)&&ml.rotate(-Nl,nh/2,Ed/2);var wf=pe.allocAt(0,0,nh,Ed),ih=At.alloc();ih.xi(wf,$u),ml.Ga(ih);var Cf=-ih.x,Hy=-ih.y,mu=At.alloc();mu.assign(Wc),isNaN(mu.x)&&(mu.x=nh/2+3),isNaN(mu.y)&&(mu.y=-(Ed/2+3)),mu.rotate(Nl),Mp+=mu.x+Cf,Uc+=mu.y+Hy;var Nd=new pe(Mp,Uc,eh.width,eh.height),Ep=new pe(eh.x,eh.y,eh.width,eh.height),Wy=new pe(pu.x,pu.y,pu.width,pu.height);Zl.Sz=Md,Zl.lineCount=oa.lineCount,Zl.lines=[oa.Cb,oa.Ih,oa.df,oa.Le,oa.Qc,oa.Qb,oa.ze],Zl.actualBounds=Nd,Zl.measuredBounds=Ep,Zl.naturalBounds=Wy,th===0?Uh.assign(Nd):Uh.ed(Nd),At.free(mu),At.free(ih),pe.free(wf),ci.free(ml)}Wa.graduatedBounds!==null&&Wa.graduatedBounds.push(Uh),yo(W0,Uh.x,Uh.y,Uh.width,Uh.height)}nr(qo,!1)}}},jg.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var E=a.Pb(),b=a.graduatedMarks;if(b!==null){var z=a.graduatedBounds,tt=0,ot=z[tt];tt++,E!==null&&E.arrange(ot.x-x.x,ot.y-x.y,ot.width,ot.height);for(var rt=y.length,at=0;at<rt;at++){var ut=y[at];ot=b[at],ut.visible&&ut!==E&&ot.length!==0&&(ot=z[tt],tt++,ut.arrange(ot.x-x.x,ot.y-x.y,ot.width,ot.height))}a.graduatedBounds=null}}},jg.prototype.gc=function(a,y,x){var E=x.$i;x.$i=!0;var b=a.naturalBounds,z=b.width,tt=b.height;b=y instanceof qs,y.save(),y.beginPath(),y.rect(-1,-1,z+1,tt+1),y.clip(),y.Se(),z=a.Pb(),z.gc(y,x),tt=a.Df()*x.scale,0>=tt&&(tt=1);for(var ot=z.actualBounds,rt=a.O.s,at=a.graduatedMarks,ut=rt.length,ct=0;ct<ut;ct++){var mt=rt[ct],yt=at[ct],St=yt.length;if(mt.visible&&mt!==z&&yt.length!==0){if(mt instanceof ei){if(!(2>a.graduatedTickUnit*mt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&mt.graduatedSkip===null)){var Mt=mt.measuredBounds,Ot=mt.strokeWidth*mt.scale,bt=mt.alignmentFocus;bt.Mc()&&(bt=sa);for(var jt=0;jt<St;jt++){var Gt=yt[jt].$l,Wt=yt[jt].angle,Kt=bt,$t=mt.Ab;$t.reset(),$t.translate(Gt.x+ot.x,Gt.y+ot.y),$t.rotate(Wt+mt.angle,0,0),$t.translate(-Mt.width*Kt.x+Kt.offsetX+Ot/2,-Mt.height*Kt.y+Kt.offsetY+Ot/2),$t.scale(mt.scale,mt.scale),Ra(mt,!1),mt.wh.set(mt.Ab),mt.Kk=mt.scale,ka(mt,!1),mt.gc(y,x),b&&(a.svg.appendChild(mt.svg),mt.svg=null),mt.Ab.reset()}}}else if(mt instanceof io)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new io),Mt=a.temporaryTextBlock,y1(Mt,mt),Ot=0;Ot<St;Ot++)bt=yt[Ot],bt.actualBounds&&bt.measuredBounds&&bt.naturalBounds&&(Mt.ec=bt.text||"",Mt.Kb=bt.Sz||0,Mt.Gc=bt.lineCount||0,jt=bt.lines,jt!==void 0&&(Mt.Cb=jt[0],Mt.Ih=jt[1],Mt.df=jt[2],Mt.Le=jt[3],Mt.Qc=jt[4],Mt.Qb=jt[5],Mt.ze=jt[6]),bt.naturalBounds&&(Mt.dc=bt.naturalBounds),bt.actualBounds&&(jt=bt.actualBounds,Mt.arrange(jt.x,jt.y,jt.width,jt.height)),jt=bt.actualBounds,Mt.arrange(jt.x,jt.y,jt.width,jt.height),Gt=bt.measuredBounds,bt=bt.naturalBounds,Wt=Mt.Ab,Wt.reset(),Wt.translate(jt.x+ot.x,jt.y+ot.y),Wt.translate(-Gt.x,-Gt.y),Mt.no(Wt,bt.x,bt.y,bt.width,bt.height),Ra(Mt,!1),Mt.wh.set(Mt.Ab),Mt.Kk=Mt.scale,ka(Mt,!1),Mt.Ng=mt.part,Mt.Me=mt.panel,Mt.gc(y,x),Mt.Me=null,Mt.Ng=null,b&&(a.svg.appendChild(Mt.svg),Mt.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function ze(a,y){if(Xt.call(this),this.na=null,a===void 0)this.na=ze.Position;else if(typeof a=="string"){var x=Ja.I(a);x!==null&&(this.na=x)}else a instanceof lr?this.na=a:a&&(this.na=ze.Position,y=a);this.na===null&&de("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===ze.Grid?1048576:0),this.O=new be,this.yb=Ys,this.Tm=Ir,this.Uf=Qn,this.$g=null,this.$e="",this.jg=new pe(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=gn,this.jn=Oo,this.kn=An,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}ee(ze,Xt),ze.prototype.cloneProtected=function(a){Xt.prototype.cloneProtected.call(this,a),a.na=this.na,a.yb=this.yb.J(),a.Tm=this.Tm.J(),a.Uf=this.Uf,a.$e=this.$e,a.jg.assign(this.jg),this.T!==null&&(a.T=this.T.copy(a)),a.xo=this.xo,a.jn=this.jn.J(),a.kn=this.kn.J(),this.ra!==null&&(a.ra=this.ra.copy()),a.ub=this.ub,a.zn=this.zn,a.Hh=this.Hh},ze.prototype.Af=function(a){Xt.prototype.Af.call(this,a),a.O=this.O;for(var y=a.O.s,x=y.length,E=0;E<x;E++)y[E].Me=a;a.$g=null},ze.prototype.copy=function(){var a=Xt.prototype.copy.call(this);if(a!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].copy();b.wi(a),b.Ng=null;var z=a.O,tt=z.count;if(z.Gb(tt,b),z=a.part,z!==null){z.Rh=null,b.portId!==null&&z instanceof tn&&(z.Te=!0);var ot=a.diagram;ot!==null&&ot.undoManager.isUndoingRedoing||z.cb(Ko,"elements",a,null,b,null,tt)}}return a}return null},xt=ze.prototype,xt.toString=function(){return"Panel("+this.type.name+")#"+qt(this)},xt.Pn=function(a){Xt.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},xt.hh=function(a,y){if(this.na===ze.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===ze.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===ze.Table)if(a.yc(),a instanceof qs){var x=a.yd;a.yd=lm(a,"gojs-ts"),gv(this,a),a.nh.pop(),a.yd=x}else gv(this,a);(x=this.isClipping&&this.na===ze.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,tt=0;tt<z;tt++){var ot=b[tt];x&&ot===E&&(a.clipInsteadOfFill=!0),ot.gc(a,y),x&&ot===E&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function gv(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,E=0<a.columnCount?a.colDefs:null;x!==null&&wm(a,y,!0,x,!0),E!==null&&wm(a,y,!1,E,!0),x!==null&&o1(a,y,!0,x),E!==null&&o1(a,y,!1,E),x!==null&&wm(a,y,!0,x,!1),E!==null&&wm(a,y,!1,E,!1)}function o1(a,y,x,E){for(var b=E.length,z=a.actualBounds,tt=a.naturalBounds,ot=!0,rt=0;rt<b;rt++){var at=E[rt];if(at!==void 0&&at.actual!==0)if(ot)ot=!1;else{if(x){if(at.position>tt.height)continue}else if(at.position>tt.width)continue;var ut=at.separatorStrokeWidth;isNaN(ut)&&(ut=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ct=at.separatorStroke;if(ct===null&&(ct=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),ut!==0&&ct!==null){zo(a,y,ct,!1,!1,tt,z),ct=!1;var mt=at.separatorDashArray;mt===null&&(mt=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),mt!==null&&(ct=!0,y.js(mt,0)),y.beginPath(),mt=at.position+ut,x?mt>tt.height&&(ut-=mt-tt.height):mt>tt.width&&(ut-=mt-tt.width),at=at.position+ut/2,y.lineWidth=ut,ut=a.yb,x?(at+=ut.top,mt=tt.width-ut.right,y.moveTo(ut.left,at),y.lineTo(mt,at)):(at+=ut.left,mt=tt.height-ut.bottom,y.moveTo(at,ut.top),y.lineTo(at,mt)),y.stroke(),y.Se(),ct&&y.fs()}}}}function wm(a,y,x,E,b){for(var z=E.length,tt=a.actualBounds,ot=a.naturalBounds,rt=r1(a,!0),at=r1(a,!1),ut=0;ut<z;ut++){var ct=E[ut];if(ct!==void 0&&ct.background!==null&&ct.coversSeparators!==b&&ct.actual!==0){var mt=x?tt.height:tt.width;if(!(ct.position>mt)){var yt=ct.Wc(),St=ct.separatorStrokeWidth;isNaN(St)&&(St=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var Mt=ct.separatorStroke;Mt===null&&(Mt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(Mt===null||ct.index===(x?rt:at))&&(St=0),yt-=St,St=ct.position+St,yt+=ct.actual,St+yt>mt&&(yt=mt-St),0>=yt||(mt=a.yb,zo(a,y,ct.background,!0,!1,ot,tt),x?y.fillRect(mt.left,St+mt.top,tt.width-(mt.left+mt.right),yt):y.fillRect(St+mt.left,mt.top,yt,tt.height-(mt.top+mt.bottom)))}}}}function r1(a,y){for(var x=y?a.rowCount:a.columnCount,E=0;E<x;E++){var b=y?a.rowDefs[E]:a.colDefs[E];if(b!==void 0)return b.index}return 0}function pv(a){return a==="LineV"||a==="BarV"}xt.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},xt.kk=function(a,y,x){if(!Xt.prototype.kk.call(this,a,y,x))return!1;if(this.type===ze.Table)x=this.svg.getElementsByClassName("gojs-ts"),x=x.length!==0?x[0]:null,x!==null&&(x.innerHTML=""),a.yd=x,gv(this,a),a.yd=null;else if(this.na===ze.Grid||this.na===ze.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;x=this.O.s;for(var E=x.length,b=0;b<E;b++)x[b].gc(a,y);return!0},xt.nk=function(){return!0},xt.$o=function(a,y,x,E){if(!this.isClipping)if(this.Dd()&&a.bk!==null){a=a.bk,y=this.O.s;for(var b=0,z=0,tt=0;tt<y.length;tt++)if(y[tt].Ed()){var ot=y[tt].actualBounds;b=tt===0?ot.x:Math.min(ot.x,b),z=tt===0?ot.y:Math.min(ot.y,z)}E.setAttributeNS(null,"clip-path","path('M "+(a.x-x.x-b)+","+(a.y-x.y-z)+" l "+a.width+" 0 l 0 "+a.height+" l -"+a.width+" 0 z')")}else Xt.prototype.$o.call(this,a,y,x,E)},xt.Sj=function(a,y,x,E,b){var z=this.se(),tt=this.transform,ot=1/(tt.m11*tt.m22-tt.m12*tt.m21),rt=tt.m22*ot,at=-tt.m12*ot,ut=-tt.m21*ot,ct=tt.m11*ot,mt=ot*(tt.m21*tt.dy-tt.m22*tt.dx),yt=ot*(tt.m12*tt.dx-tt.m11*tt.dy);if(this.areaBackground!==null)return tt=this.actualBounds,Jt.Ff(tt.left,tt.top,tt.right,tt.bottom,a,y,x,E,b);if(this.background!==null)return z=a*rt+y*ut+mt,ot=a*at+y*ct+yt,a=x*rt+E*ut+mt,rt=x*at+E*ct+yt,b.h(0,0),x=this.naturalBounds,z=Jt.Ff(0,0,x.width,x.height,z,ot,a,rt,b),b.transform(tt),z;z||(rt=1,ut=at=0,ct=1,yt=mt=0),ot=a*rt+y*ut+mt,a=a*at+y*ct+yt,rt=x*rt+E*ut+mt,x=x*at+E*ct+yt,b.h(rt,x),E=(rt-ot)*(rt-ot)+(x-a)*(x-a),at=!1,ct=this.O.s,yt=ct.length,ut=At.alloc(),mt=null,y=1/0;var St=null,Mt=this.isClipping&&this.na===ze.Spot;Mt&&(St=At.alloc(),mt=this.Pb(),(at=mt.Sj(ot,a,rt,x,St))&&(y=(ot-St.x)*(ot-St.x)+(a-St.y)*(a-St.y)));for(var Ot=0;Ot<yt;Ot++){var bt=ct[Ot];bt.visible&&bt!==mt&&bt.Sj(ot,a,rt,x,ut)&&(at=!0,bt=(ot-ut.x)*(ot-ut.x)+(a-ut.y)*(a-ut.y),bt<E&&(E=bt,b.set(ut)))}return Mt&&(y>E&&b.set(St),At.free(St)),At.free(ut),z&&b.transform(tt),at},xt.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();Xt.prototype.Gj.call(this)},xt.v=function(a){if(!da(this)){Xt.prototype.v.call(this,a),a=null,(this.na===ze.Auto||this.na===ze.Link)&&(a=this.Pb());for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if((b===a||b.isPanelMain)&&b.v(!0),!b.desiredSize.w()){var z=Es(b,!1);(b instanceof gs||b instanceof ze||b instanceof io||z!==Fe)&&b.v(!0)}}}},xt.Uj=function(){if(!da(this)){nr(this,!0),Il(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},xt.Uk=function(){if(!(this.l&2048)){Ra(this,!0),ka(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},xt.Wu=function(){ka(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},xt.Wl=function(a,y,x,E){var b=this.jg;b.h(0,0,0,0);var z=this.desiredSize,tt=this.minSize;x===void 0&&(x=tt.width,E=tt.height),x=Math.max(x,tt.width),E=Math.max(E,tt.height);var ot=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,ot.width)),isNaN(z.height)||(y=Math.min(z.height,ot.height)),a=Math.max(x,a),y=Math.max(E,y);var rt=this.yb;a=Math.max(a-rt.left-rt.right,0),y=Math.max(y-rt.top-rt.bottom,0);var at=this.O.s;at.length!==0&&this.na.measure(this,a,y,at,b,x,E),a=b.width+rt.left+rt.right,rt=b.height+rt.top+rt.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(rt=z.height),a=Math.min(ot.width,a),rt=Math.min(ot.height,rt),a=Math.max(tt.width,a),rt=Math.max(tt.height,rt),a=Math.max(x,a),rt=Math.max(E,rt),Br(b,a,rt),Br(this.naturalBounds,a,rt),this.Ge(0,0,a,rt)},xt.Pb=function(){if(this.$g===null){var a=this.O.s,y=a.length;if(y===0)return null;for(var x=0;x<y;x++){var E=a[x];if(E.isPanelMain===!0)return this.$g=E}this.$g=a[0]}return this.$g};function lu(a){return a.part!==null?a.part.locationObject:null}xt.eh=function(a,y,x,E){var b=this.O.s;if(this.actualBounds.h(a,y,x,E),b.length!==0){if(!this.desiredSize.w()){a=Es(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var tt=this.Kg,ot=tt.left+tt.right;switch(tt=tt.top+tt.bottom,y===x&&z===E&&(a=Fe),a){case Fe:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case Re:this.v(!0),this.measure(x+ot,E+tt,0,0);break;case xn:this.v(!0),this.measure(x+ot,z+tt,0,0);break;case Nn:this.v(!0),this.measure(y+ot,E+tt,0,0)}}this.na.arrange(this,b,this.jg)}},xt.gh=function(a){var y=this.naturalBounds,x=lu(this);if($o(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=At.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(Pi(b.set(a),z.transform),z.ca(b)))return At.free(b),!0}return At.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},xt.ks=function(a){if(this.bindingId===a)return this;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].ks(a);if(b!==null)return b}return null},xt.qm=function(a,y){if(y(this,a),a instanceof ze){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function gd(a,y){s1(a,a,y)}function s1(a,y,x){x(y),y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=y[b];z instanceof ze&&s1(a,z,x)}}function vx(a,y){a1(a,a,y)}function a1(a,y,x){if(x(y),y instanceof ze){y=y.O.s;for(var E=y.length,b=0;b<E;b++)a1(a,y[b],x)}}xt.Nl=function(a){return l1(this,this,a)};function l1(a,y,x){if(x(y))return y;if(y instanceof ze){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=l1(a,y[b],x);if(z!==null)return z}}return null}xt.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=zg(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof ze){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function u1(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof ze?x=Math.max(x,u1(b)):b instanceof ei&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}xt.se=function(){return!(this.type===ze.TableRow||this.type===ze.TableColumn)};function zu(a){return a.type===ze.TableRow||a.type===ze.TableColumn}xt.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),fs(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:Pi(At.allocAt(a.x,a.y),this.transform),ot=this.diagram,rt=10,at=5;if(ot!==null&&(rt=ot.Ql("extraTouchArea"),at=rt/2),$o(-(at*b),-(at*b),E.width+rt*b,E.height+rt*b,tt.x,tt.y)){if(!this.isAtomic){b=this.O.s;var ut=b.length;if(ot=At.alloc(),at=(rt=this.isClipping&&this.na===ze.Spot)?this.Pb():null,rt&&(at.se()?Pi(ot.set(a),at.transform):ot.set(a),!at.ca(ot)))return At.free(ot),z||At.free(tt),null;for(var ct=lu(this);ut--;){var mt=b[ut];if((mt.visible||mt===ct)&&(mt.se()?Pi(ot.set(a),mt.transform):ot.set(a),!rt||mt!==at)){var yt=null;if(mt instanceof ze?yt=mt.ic(ot,y,x):mt.pickable===!0&&mt.ca(ot)&&(yt=mt),yt!==null&&(y!==null&&(yt=y(yt)),yt!==null&&(x===null||x(yt))))return At.free(ot),z||At.free(tt),yt}}At.free(ot)}return this.background===null&&this.areaBackground===null?(z||At.free(tt),null):(a=$o(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||At.free(tt),a)}return z||At.free(tt),null},xt.ji=function(a,y,x,E){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var b=this.naturalBounds,z=this.se(),tt=z?a:Pi(At.allocAt(a.x,a.y),this.transform);if(b=$o(0,0,b.width,b.height,tt.x,tt.y),zu(this)||b){if(!this.isAtomic){for(var ot=this.O.s,rt=ot.length,at=At.alloc(),ut=lu(this);rt--;){var ct=ot[rt];if(ct.visible||ct===ut){ct.se()?Pi(at.set(a),ct.transform):at.set(a);var mt=ct;ct=ct instanceof ze?ct:null,(ct!==null?ct.ji(at,y,x,E):mt.ca(at))&&mt.pickable!==!1&&(y!==null&&(mt=y(mt)),mt===null||x!==null&&!x(mt)||E.add(mt))}}At.free(at)}return z||At.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||At.free(tt),!1},xt.Cf=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=ci.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ci.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var ot=lu(this),rt=this.O.s,at=rt.length;at--;){var ut=rt[at];if(ut.visible||ut===ot){var ct=ut.actualBounds,mt=this.naturalBounds;ct.x>mt.width||ct.y>mt.height||0>ct.x+ct.width||0>ct.y+ct.height||(ct=ut,ut=ut instanceof ze?ut:null,mt=ci.alloc(),mt.set(tt),(ut!==null?ut.Cf(a,y,x,E,b,mt):mr(ct,a,E,mt))&&(y!==null&&(ct=y(ct)),ct===null||x!==null&&!x(ct)||b.add(ct)),ci.free(mt))}}return z===void 0&&ci.free(tt),E}return z===void 0&&ci.free(tt),!1};function mv(a,y,x,E){for(var b=a.O.s,z=b.length;z--;){var tt=b[z];if(tt.visible){var ot=tt.actualBounds,rt=a.naturalBounds;ot.x>rt.width||ot.y>rt.height||0>ot.x+ot.width||0>ot.y+ot.height||(tt instanceof ze&&mv(tt,y,x,E),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||E.add(tt))}}}xt.og=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;x===void 0&&(x=null),E===void 0&&(E=null);var tt=this.naturalBounds,ot=this.se(),rt=ot?a:Pi(At.allocAt(a.x,a.y),this.transform),at=ot?y:Pi(At.allocAt(y.x,y.y),this.transform),ut=rt.Bf(at),ct=0<rt.x&&rt.x<tt.width&&0<rt.y&&rt.y<tt.height||Ui(rt.x,rt.y,0,0,0,tt.height)<=ut||Ui(rt.x,rt.y,0,tt.height,tt.width,tt.height)<=ut||Ui(rt.x,rt.y,tt.width,tt.height,tt.width,0)<=ut||Ui(rt.x,rt.y,tt.width,0,0,0)<=ut;if(tt=rt.zd(0,0)<=ut&&rt.zd(0,tt.height)<=ut&&rt.zd(tt.width,0)<=ut&&rt.zd(tt.width,tt.height)<=ut,ot||(At.free(rt),At.free(at)),ct){if(!this.isAtomic){rt=At.alloc(),at=At.alloc(),ut=lu(this);for(var mt=this.O.s,yt=mt.length;yt--;){var St=mt[yt];if(St.visible||St===ut){var Mt=St.actualBounds,Ot=this.naturalBounds;(!ot||!(Mt.x>Ot.width||Mt.y>Ot.height||0>Mt.x+Mt.width||0>Mt.y+Mt.height))&&(St.se()?(Mt=St.transform,Pi(rt.set(a),Mt),Pi(at.set(y),Mt)):(rt.set(a),at.set(y)),Mt=St,St=St instanceof ze?St:null,(St!==null?St.og(rt,at,x,E,b,z):Mt.tx(rt,at,b))&&(x!==null&&(Mt=x(Mt)),Mt===null||E!==null&&!E(Mt)||z.add(Mt)))}}At.free(rt),At.free(at)}return b?ct:tt}return!1};function vv(a){var y=null;return a instanceof ei&&(y=a.spot1,y===Ir&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=Sr),y}function yv(a){var y=null;return a instanceof ei&&(y=a.spot2,y===Ir&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=ya),y}xt.add=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];for(x=0;x<y.length;x++)this.Gb(this.O.count,y[x]);return this},xt.M=function(a){return this.O.M(a)},xt.Gb=function(a,y){y instanceof Ln&&de("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&de("Cannot make a Panel contain itself: "+this.toString()),de("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&de("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+y.toString()+", already contained by "+x.toString()+", cannot be shared by this Panel: "+this.toString()),this.na!==ze.Grid||y instanceof ei||de("Can only add Shapes to a Grid Panel, not: "+y),this.na!==ze.Graduated||y instanceof ei||y instanceof io||de("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+y),y.wi(this),y.Ng=null,this.itemArray!==null){var E=y.data;E!==null&&typeof E=="object"&&(this.ge===null&&(this.ge=new qe),this.ge.add(E,y))}var b=this.O;if(E=-1,x===this){for(var z=-1,tt=this.O.s,ot=tt.length,rt=0;rt<ot;rt++)if(tt[rt]===y){z=rt;break}if(z!==-1){if(z===a||z+1>=b.count&&a>=b.count)return;b.mb(z),E=z}else de("element "+y.toString()+" has panel "+x.toString()+" but is not contained by it.")}(0>a||a>b.count)&&(a=b.count),b.Gb(a,y),(a===0||y.isPanelMain)&&(this.$g=null),da(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof ze&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Lm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof tn&&(x.Te=!0),x.Te&&x instanceof tn&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(ar,"elements",this,y,null,E,null),x.cb(Ko,"elements",this,null,y,null,a)))};function Sv(a,y){a.l=y?a.l|16777216:a.l&-16777217}xt.remove=function(a){for(var y=this.O.s,x=y.length,E=-1,b=0;b<x;b++)if(y[b]===a){E=b;break}E!==-1&&this.pc(E,!0)},xt.mb=function(a){0<=a&&this.pc(a,!0)},xt.pc=function(a,y){var x=this.O,E=x.M(a);if(E.Ng=null,E.wi(null),this.ge!==null){var b=E.data;typeof b=="object"&&this.ge.remove(b)}x.mb(a),nr(this,!1),this.v(),this.$g===E&&(this.$g=null),this.graduatedIntervals=null;var z=this.part;z!==null&&(z.Rh=null,z.ag=NaN,z.Wb(),z instanceof tn&&(E instanceof ze?E.qm(E,function(tt,ot){Hv(z,ot,y)}):Hv(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(ar,"elements",this,E,null,a,null))},xt.Fb=function(a){0>a&&qn(a,">= 0",ze,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new ir;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(Ko,"rowdefs",this,null,x,null,a)}return y[a]},xt.oA=function(a){if(0>a&&qn(a,">= 0",ze,"removeRowDefinition:idx"),this.rowCount!==0){a=Math.round(a);var y=this.rowDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(ar,"rowdefs",this,x,null,a,null),this.v()}}};function h1(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof ir?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}xt.Eb=function(a){0>a&&qn(a,">= 0",ze,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new ir;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(Ko,"coldefs",this,null,x,null,a)}return y[a]},xt.jA=function(a){if(0>a&&qn(a,">= 0",ze,"removeColumnDefinition:idx"),this.columnCount!==0){a=Math.round(a);var y=this.colDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(ar,"coldefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof ir?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}xt.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&km(y,a),this},xt.Hy=function(a,y){return(a=this.Fb(a))&&km(a,new ir(y)),this},xt.By=function(a,y){return(a=this.Eb(a))&&km(a,new ir(y)),this},xt.nz=function(a){if(0>a||this.type!==ze.Table||this.rowCount===0)return-1;for(var y=0,x=this.rowDefs,E=x.length,b=this.topIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},xt.fz=function(a){if(0>a||this.type!==ze.Table||this.columnCount===0)return-1;for(var y=0,x=this.colDefs,E=x.length,b=this.leftIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},xt.Fz=function(a,y){if(y===void 0&&(y=new At(NaN,NaN)),this.type!==ze.Graduated)return y.h(NaN,NaN),y;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var x=this.Pb();return x.geometry.Pu((a-this.graduatedMin)/this.graduatedRange,y),x.transform.Ga(y)},xt.Gz=function(a){if(this.type!==ze.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function f1(a){return a=a.allBindings,a!==null&&a._isFrozen}function za(a){var y=a.allBindings;if(y===null)a.data!==null&&de("Template cannot have .data be non-null: "+a),a.allBindings=y=new be;else if(y._isFrozen)return;var x=new be;Sv(a,!1),a.qm(a,function(at,ut){ut.th();var ct=ut.localBindings;if(ct!==null)for(nf(ut,!1),ct=ct.iterator;ct.next();){var mt=ct.value;mt.mode===ap&&nf(ut,!0);var yt=mt.sourceName;yt!==null&&(yt==="/"&&Sv(at,!0),yt=MS(mt,at,ut),yt!==null&&(x.add(yt),yt.srcBindings===null&&(yt.srcBindings=new be),yt.srcBindings.add(mt))),y.add(mt)}if(ut instanceof ze&&ut.type===ze.Table){if(0<ut.rowCount){for(at=ut.rowDefs,ct=at.length,mt=0;mt<ct;mt++)if(yt=at[mt],yt!==void 0&&yt.be!==null)for(var St=yt.be.iterator;St.next();){var Mt=St.value;Mt.xd=yt,Mt.to=2,Mt.wl=yt.index,y.add(Mt)}}if(0<ut.columnCount){for(ut=ut.colDefs,at=ut.length,ct=0;ct<at;ct++)if(mt=ut[ct],mt!==void 0&&mt.be!==null)for(yt=mt.be.iterator;yt.next();)St=yt.value,St.xd=mt,St.to=1,St.wl=mt.index,y.add(St)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){nf(b,!0);for(var z=b.srcBindings.iterator;z.next();){var tt=z.value;b.localBindings===null&&(b.localBindings=new be),b.localBindings.add(tt)}}b.srcBindings=null}for(E=y.iterator;E.next();)if(b=E.value,z=b.xd,z!==null){b.xd=null;var ot=b.targetProperty,rt=ot.indexOf(".");0<rt&&z instanceof ze&&(tt=ot.substring(0,rt),ot=ot.substr(rt+1),rt=z.fb(tt),rt!==null?(z=rt,b.targetProperty=ot):Di('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof ir?(tt=qt(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof Xt?(tt=qt(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):de("Unknown type of binding target: "+z)}y.freeze(),a instanceof Ln&&a.Zc()&&a.Va()}xt.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vx(y,function(x){x instanceof ze&&(x.allBindings=null,x.ub=null);var E=x.localBindings;E!==null&&(x.localBindings=null,E.each(function(b){x.bind(b.copy())})),E=x.animationTriggers,E!==null&&(x.animationTriggers=null,E.each(function(b){x.Jv(b.value.copy())}))}),a&&za(y),y},xt.La=function(a){var y=this.allBindings;if(y!==null)for(a===void 0&&(a=""),y=y.iterator;y.next();){var x=y.value,E=x.sourceProperty;if((a===""||E===""||E===a)&&(E=x.targetProperty,x.converter!==null||E!=="")){E=this.data;var b=x.sourceName;if(b!==null){if(b==="")E=this;else if(b==="/")E=this;else if(b===".")E=this;else if(b==="..")E=this;else if(E=this.fb(b),E===null)continue}else if(x.isToModel)if(E=this.diagram,E!==null)E=E.model.modelData;else continue;var z=this,tt=x.Ai;if(tt!==-1){if(z=this.ks(tt),z===null)continue}else x.xd!==null&&(z=x.xd);if(b==="/"?E=z.part:b==="."?E=z:b===".."&&(E=z.panel),b=x.to,b!==0){if(!(z instanceof ze))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},xt.sx=function(a){return a==null||this.ge===null?null:this.ge.I(a)};function yx(a,y){a=a.O.s;for(var x=a.length,E=y.length,b=0,z=null;b<x&&(z=a[b],!(z instanceof ze&&z.data!==null));)b++,z=a[b];if(x-b!==E)return!0;if(z===null)return 0<E;for(var tt=0;b<x&&tt<E;){if(z=a[b],!(z instanceof ze)||z.data!==y[tt])return!0;b++,tt++}return!1}function zg(a){if(a.type===ze.Spot||a.type===ze.Auto)return Math.min(a.O.length,1);if(a.type===ze.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof ei&&E.isPanelMain))break}return x}return a.type===ze.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof ze&&zu(a))?1:0}xt.mv=function(){for(var a=zg(this);this.O.length>a;)this.pc(this.O.length-1,!1);c1(this,this.itemArray)};function c1(a,y){var x=zg(a);if(y===null||y.length===0)for(;a.O.length>x;)a.pc(a.O.length-1,!1);else if(a.O.length<=x){x=y.length;for(var E=0;E<x;E++)Cm(a,y[E],E,!0)}else{E=x;for(var b=0;b<y.length;b++,E++){var z=y[b],tt=E<a.O.length?a.O.M(E):null;if(tt instanceof ze){if(tt.data!==z){var ot=Pv(a,tt.data),rt=Pv(a,z),at=rt!==ot;at||(ot=wv(a,ot),at=wv(a,rt)!==ot),at?(a.pc(E,!1),Cm(a,z,b,!1)):tt.data=z}}else Cm(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,xv(a,x,0),da(a)||a.v(),a.graduatedIntervals=null,a.If()||Lm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof tn&&(y.Te=!0),y.Te&&y instanceof tn&&(y.wc=null))}}function Cm(a,y,x,E){if(!(y==null||0>x)){var b=Pv(a,y);if(b=wv(a,b),b!==null){if(za(b),b=b.copy(),b.l&16777216){var z=a.ih();z!==null&&Sv(z,!0)}typeof y=="object"&&(a.ge===null&&(a.ge=new qe),a.ge.add(y,b)),z=x+zg(a),a.Gb(z,b),E&&(b.ub=y,xv(a,z,x),b.ub=null),b.data=y}}}function xv(a,y,x){for(a=a.O;y<a.length;){var E=a.M(y);if(E instanceof ze){var b=y,z=x;E.type===ze.TableRow?E.row=b:E.type===ze.TableColumn&&(E.column=b),E.itemIndex=z}y++,x++}}function Pv(a,y){if(y===null)return"";if(a=a.itemCategoryProperty,typeof a=="function")a=a(y);else if(typeof a=="string"&&typeof y=="object"){if(a==="")return"";a=Vo(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;de("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function wv(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(g1||(g1=!0,Di('No item template Panel found for category "'+y+'" on '+a),Di(" Using default item template."),a=new ze,y=new io,y.bind(new Jo("text","",Yi)),a.add(y),p1=a),E=p1)),E}function Lm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof ze){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof ze&&!z.isEnabled||Lm(a,z,x)}}}function Cl(a,y){y.name=a,Ja.add(a,y)}Ie.Object.defineProperties(ze.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===ze.Grid,this.v(),this.g("type",y,a))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"?(0>a&&qn(a,">= 0",ze,"padding"),a=new On(a)):(0>a.left&&qn(a.left,">= 0",ze,"padding:value.left"),0>a.right&&qn(a.right,">= 0",ze,"padding:value.right"),0>a.top&&qn(a.top,">= 0",ze,"padding:value.top"),0>a.bottom&&qn(a.bottom,">= 0",ze,"padding:value.bottom"));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.v(),this.g("padding",y,a))}},defaultAlignment:{get:function(){return this.Tm},set:function(a){var y=this.Tm;y.D(a)||(this.Tm=a=a.J(),this.v(),this.g("defaultAlignment",y,a))}},defaultStretch:{get:function(){return this.Uf},set:function(a){var y=this.Uf;y!==a&&(this.Uf=a,this.v(),this.g("defaultStretch",y,a))}},defaultSeparatorPadding:{get:function(){return this.T!==null?this.T.Qp:Ys},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Na),this.T.Qp=a,this.v(),this.g("defaultSeparatorPadding",y,a))}},defaultRowSeparatorStroke:{get:function(){return this.T!==null?this.T.ia:null},set:function(a){var y=this.defaultRowSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof Ki)&&(a instanceof Ki&&a.freeze(),this.T===null&&(this.T=new Na),this.T.ia=a,this.N(),this.g("defaultRowSeparatorStroke",y,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.Ha:1},set:function(a){var y=this.defaultRowSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new Na),this.T.Ha=a,this.v(),this.g("defaultRowSeparatorStrokeWidth",y,a))}},defaultRowSeparatorDashArray:{get:function(){return this.T!==null?this.T.V:null},set:function(a){var y=this.defaultRowSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||de("defaultRowSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Na),this.T.V=a,this.N(),this.g("defaultRowSeparatorDashArray",y,a)}}},defaultColumnSeparatorStroke:{get:function(){return this.T!==null?this.T.u:null},set:function(a){var y=this.defaultColumnSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof Ki)&&(a instanceof Ki&&a.freeze(),this.T===null&&(this.T=new Na),this.T.u=a,this.N(),this.g("defaultColumnSeparatorStroke",y,a))}},defaultColumnSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.F:1},set:function(a){var y=this.defaultColumnSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new Na),this.T.F=a,this.v(),this.g("defaultColumnSeparatorStrokeWidth",y,a))}},defaultColumnSeparatorDashArray:{get:function(){return this.T!==null?this.T.o:null},set:function(a){var y=this.defaultColumnSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||de("defaultColumnSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Na),this.T.o=a,this.N(),this.g("defaultColumnSeparatorDashArray",y,a)}}},inRowsCols:{get:function(){return this.T!==null?this.T.nb:null},set:function(a){this.T===null&&(this.T=new Na),this.T.nb=a}},viewboxStretch:{get:function(){return this.xo},set:function(a){var y=this.xo;y!==a&&(this.xo=a,this.v(),this.g("viewboxStretch",y,a))}},gridCellSize:{get:function(){return this.jn},set:function(a){var y=this.jn;if(!y.D(a)){a.w()&&a.width!==0&&a.height!==0||de("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&xl(x),this.N(),this.g("gridCellSize",y,a)}}},gridOrigin:{get:function(){return this.kn},set:function(a){var y=this.kn;if(!y.D(a)){a.w()||de("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&xl(x),this.N(),this.g("gridOrigin",y,a)}}},graduatedMin:{get:function(){return this.ra!==null?this.ra.lq:0},set:function(a){var y=this.graduatedMin;y!==a&&(this.ra===null&&(this.ra=new uu),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),Dr(this)&&(a=this.part,a!==null&&ho(this,a,"graduatedRange")))}},graduatedMax:{get:function(){return this.ra!==null?this.ra.F:100},set:function(a){var y=this.graduatedMax;y!==a&&(this.ra===null&&(this.ra=new uu),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),Dr(this)&&(a=this.part,a!==null&&ho(this,a,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.ra!==null?this.ra.ia:10},set:function(a){var y=this.graduatedTickUnit;y!==a&&0<a&&(this.ra===null&&(this.ra=new uu),this.ra.ia=a,this.v(),this.g("graduatedTickUnit",y,a))}},graduatedTickBase:{get:function(){return this.ra!==null?this.ra.V:0},set:function(a){var y=this.graduatedTickBase;y!==a&&(this.ra===null&&(this.ra=new uu),this.ra.V=a,this.v(),this.g("graduatedTickBase",y,a))}},graduatedMarks:{get:function(){return this.ra!==null?this.ra.u:null},set:function(a){this.ra!==null?this.ra.u=a:a!==null&&(this.ra=new uu,this.ra.u=a)}},graduatedBounds:{get:function(){return this.ra!==null?this.ra.j:null},set:function(a){this.ra!==null?this.ra.j=a:a!==null&&(this.ra=new uu,this.ra.j=a)}},graduatedIntervals:{get:function(){return this.ra!==null?this.ra.o:null},set:function(a){this.ra!==null?this.ra.o=a:a!==null&&(this.ra=new uu,this.ra.o=a)}},temporaryTextBlock:{get:function(){return this.ra!==null?this.ra.Zh:null},set:function(a){this.ra!==null?this.ra.Zh=a:a!==null&&(this.ra=new uu,this.ra.Zh=a)}},panelLayoutState:{get:function(){return this.F},set:function(a){this.F=a}},Te:{get:function(){return(this.l&8388608)!==0},set:function(a){(this.l&8388608)!==0!==a&&(this.l^=8388608)}},rowDefs:{get:function(){return this.T===null&&(this.T=new Na),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Na),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Em},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new Na),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Em},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new Na),this.T.j=a,this.v(),this.g("columnSizing",y,a))}},topIndex:{get:function(){return this.T!==null?this.T.Hb:0},set:function(a){var y=this.topIndex;y!==a&&((!isFinite(a)||0>a)&&de("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Na),this.T.Hb=a,this.v(),this.g("topIndex",y,a))}},leftIndex:{get:function(){return this.T!==null?this.T.hb:0},set:function(a){var y=this.leftIndex;y!==a&&((!isFinite(a)||0>a)&&de("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Na),this.T.hb=a,this.v(),this.g("leftIndex",y,a))}},data:{get:function(){return this.ub},set:function(a){var y=this.ub;if(y!==a){var x=this instanceof Ln&&!(this instanceof Ai);za(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof Ue?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof Ln&&(y!==null&&x.cf.remove(y),a!==null&&x.cf.add(a,this))):(x=this.panel,x!==null&&x.ge!==null&&(y!==null&&x.ge.remove(y),a!==null&&x.ge.add(a,this)))),this.g("data",y,a),E!==null&&E.undoManager.isUndoingRedoing||a!==null&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(a){var y=this.zn;y!==a&&(this.zn=a,this.g("itemIndex",y,a))}},allBindings:{get:function(){return this.A!==null?this.A.nb:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new of),this.A.nb=a)}},itemArray:{get:function(){return this.Hh},set:function(a){var y=this.Hh;if(y!==a||a!==null&&yx(this,a)){var x=this.diagram;y!==a&&(x!==null&&y!==null&&ly(x.partManager,this,x),this.Hh=a,x!==null&&a!==null&&ay(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||c1(this,a)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(a){if(this.itemTemplateMap===null){if(a===null)return;this.itemTemplateMap=new qe}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof Ln||a.isPanelMain)&&de("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv())}},itemTemplateMap:{get:function(){return this.A!==null?this.A.Pc:null},set:function(a){var y=this.itemTemplateMap;if(y!==a){for(var x=a.iterator;x.next(););ii(this),this.A.Pc=a,this.g("itemTemplateMap",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv()}}},itemCategoryProperty:{get:function(){return this.A!==null?this.A.Oc:"category"},set:function(a){var y=this.itemCategoryProperty;y!==a&&(ii(this),this.A.Oc=a,this.g("itemCategoryProperty",y,a))}},isAtomic:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("isAtomic",y,a))}},isClipping:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this instanceof Jn&&(this.tb=null),this.v(),this.g("isClipping",y,a))}},isOpposite:{get:function(){return(this.l&33554432)!==0},set:function(a){var y=(this.l&33554432)!==0;y!==a&&(this.l^=33554432,this.v(),this.g("isOpposite",y,a))}},isEnabled:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;if(y!==a){var x=this.panel===null||this.panel.If();this.l^=4194304,this.g("isEnabled",y,a),y=this.diagram,y!==null&&y.undoManager.isUndoingRedoing||x&&Lm(this,this,a)}}},alignmentFocusName:{get:function(){return this.$e},set:function(a){var y=this.$e;y!==a&&(this.$e=a,this.v(),this.g("alignmentFocusName",y,a))}}}),Ie.Object.defineProperties(ze,{Position:{get:function(){return Ja.I("Position")}},Horizontal:{get:function(){return Ja.I("Horizontal")}},Vertical:{get:function(){return Ja.I("Vertical")}},Spot:{get:function(){return Ja.I("Spot")}},Auto:{get:function(){return Ja.I("Auto")}},Table:{get:function(){return Ja.I("Table")}},Viewbox:{get:function(){return Ja.I("Viewbox")}},TableRow:{get:function(){return Ja.I("TableRow")}},TableColumn:{get:function(){return Ja.I("TableColumn")}},Link:{get:function(){return Ja.I("Link")}},Grid:{get:function(){return Ja.I("Grid")}},Graduated:{get:function(){return Ja.I("Graduated")}}}),ze.prototype.rebuildItemElements=ze.prototype.mv,ze.prototype.findItemPanelForData=ze.prototype.sx,ze.prototype.updateTargetBindings=ze.prototype.La,ze.prototype.copyTemplate=ze.prototype.Uy,ze.prototype.graduatedValueForPoint=ze.prototype.Gz,ze.prototype.graduatedPointForValue=ze.prototype.Fz,ze.prototype.findColumnForLocalX=ze.prototype.fz,ze.prototype.findRowForLocalY=ze.prototype.nz,ze.prototype.addColumnDefinition=ze.prototype.By,ze.prototype.addRowDefinition=ze.prototype.Hy,ze.prototype.addRowColumnDefinition=ze.prototype.Gy,ze.prototype.removeColumnDefinition=ze.prototype.jA,ze.prototype.getColumnDefinition=ze.prototype.Eb,ze.prototype.removeRowDefinition=ze.prototype.oA,ze.prototype.getRowDefinition=ze.prototype.Fb,ze.prototype.removeAt=ze.prototype.mb,ze.prototype.remove=ze.prototype.remove,ze.prototype.insertAt=ze.prototype.Gb,ze.prototype.elt=ze.prototype.M,ze.prototype.add=ze.prototype.add,ze.prototype.findObject=ze.prototype.fb,ze.prototype.findInVisualTree=ze.prototype.Nl,ze.prototype.walkVisualTreeFrom=ze.prototype.qm,ze.prototype.findMainElement=ze.prototype.Pb;var g1=!1,p1=null,Ja=new qe;ze.className="Panel",ze.definePanelLayout=Cl,Cl("Position",new dm),Cl("Vertical",new cm),Cl("Auto",new pm),Cl("Link",new Pm);function uu(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}uu.prototype.copy=function(){var a=new uu;return a.lq=this.lq,a.F=this.F,a.ia=this.ia,a.V=this.V,a.u=this.u,a.j=this.j,a.o=this.o,a.Zh=this.Zh,a},uu.className="GradPanelSettings";function Na(){this.Pc=[],this.Oc=[],this.j=this.ob=Em,this.hb=this.Hb=0,this.Qp=Ys,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Na.prototype.copy=function(a){for(var y=new Na,x=this.Pc,E=x.length,b=y.Pc,z=0;z<E;z++)if(x[z]!==void 0){var tt=x[z].copy();tt.wi(a),b[z]=tt}for(x=this.Oc,E=x.length,b=y.Oc,z=0;z<E;z++)x[z]!==void 0&&(tt=x[z].copy(),tt.wi(a),b[z]=tt);return y.ob=this.ob,y.j=this.j,y.Hb=this.Hb,y.hb=this.hb,y.Qp=this.Qp.J(),y.Ha=this.Ha,y.ia=this.ia,y.V=this.V,y.F=this.F,y.u=this.u,y.o=this.o,y.nb=this.nb,y},Na.className="TablePanelSettings";function ir(a){vi(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=Ir,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Cv,this.hg=Qn,this.lo=this.dg=null,this.mo=NaN,this.Ma=this.tj=null,this.Pm=!1,a&&(Object.assign(this,a),a.column!==void 0?(this.isRow=!1,this.index=a.column):a.row!==void 0&&(this.isRow=!0,this.index=a.row))}ir.prototype.copy=function(){var a=new ir;return a.uq=this.uq,a.Za=this.Za,a.Hc=this.Hc,a.jj=this.jj,a.hj=this.hj,a.Jb=this.Jb,a.oa=this.oa,a.oc=this.oc,a.pa=this.pa,a.hg=this.hg,a.oo=this.oo,this.dg===null?a.dg=null:a.dg=this.dg.J(),a.lo=this.lo,a.mo=this.mo,a.tj=null,this.tj!==null&&(a.separatorDashArray=wo(this.separatorDashArray)),a.Ma=this.Ma,a.Pm=this.Pm,a.be=this.be,a};function km(a,y){y.isRow?a.height=y.height:a.width=y.width,a.minimum=y.minimum,a.maximum=y.maximum,a.alignment=y.alignment,a.stretch=y.stretch,a.sizing=y.sizing,a.dg=y.separatorPadding===null?null:y.separatorPadding.J(),a.separatorStroke=y.separatorStroke,a.separatorStrokeWidth=y.separatorStrokeWidth,a.tj=null,y.separatorDashArray&&(a.tj=wo(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}xt=ir.prototype,xt.qb=function(a){a.classType===ir&&(this.sizing=a)},xt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+qt(this)},xt.wi=function(a){this.Me=a},xt.Io=function(a){var y=0,x=this.Me;if(this.index!==a&&(a=this.separatorStroke,a===null&&x!==null&&(a=this.isRow?x.defaultRowSeparatorStroke:x.defaultColumnSeparatorStroke),a!==null&&(y=this.separatorStrokeWidth,isNaN(y)&&(x!==null?y=this.isRow?x.defaultRowSeparatorStrokeWidth:x.defaultColumnSeparatorStrokeWidth:y=0))),a=this.dg,a===null)if(x!==null)a=x.defaultSeparatorPadding;else return y;return y+(this.isRow?a.top:a.left)},xt.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===ze.Table)for(var b=E?y.rowDefs.length:y.colDefs.length,z=0;z<b;z++){var tt=E?y.rowDefs[z]:y.colDefs[z];if(tt!==void 0&&tt.oa!==0){x=tt.index;break}}if(this.index!==x&&(x=this.separatorStroke,x===null&&y!==null&&(x=E?y.defaultRowSeparatorStroke:y.defaultColumnSeparatorStroke),x!==null&&(a=this.separatorStrokeWidth,isNaN(a)&&(y!==null?a=E?y.defaultRowSeparatorStrokeWidth:y.defaultColumnSeparatorStrokeWidth:a=0))),E=this.dg,E===null)if(y!==null)E=y.defaultSeparatorPadding;else return a;return a+(this.isRow?E.top+E.bottom:E.left+E.right)},xt.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(Eo,a,this,y,x,void 0,void 0),this.be!==null&&(y=E.diagram,y!==null&&!y.skipsModelSourceBindings&&(E=E.ih(),E!==null&&(y=E.data,y!==null)))))for(x=this.be.iterator;x.next();)x.value.sp(this,y,a,E)};function Mm(a){if(a.sizing===Cv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}xt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new Jo(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&f1(y)&&de("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new be),this.be.add(b),this},Ie.Object.defineProperties(ir.prototype,{panel:{get:function(){return this.Me}},isRow:{get:function(){return this.uq},set:function(a){this.uq=a}},index:{get:function(){return this.Za},set:function(a){this.Za=a}},height:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&qn(a,">= 0",ir,"height"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("height",y,a))}},width:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&qn(a,">= 0",ir,"width"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("width",y,a))}},minimum:{get:function(){return this.jj},set:function(a){var y=this.jj;y!==a&&((0>a||!isFinite(a))&&qn(a,">= 0",ir,"minimum"),this.jj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("minimum",y,a))}},maximum:{get:function(){return this.hj},set:function(a){var y=this.hj;y!==a&&(0>a&&qn(a,">= 0",ir,"maximum"),this.hj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("maximum",y,a))}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(this.Jb=a.J(),this.panel!==null&&this.panel.v(),this.Ob("alignment",y,a))}},stretch:{get:function(){return this.hg},set:function(a){var y=this.hg;y!==a&&(this.hg=a,this.panel!==null&&this.panel.v(),this.Ob("stretch",y,a))}},separatorPadding:{get:function(){return this.dg},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.dg;a!==null&&y!==null&&y.D(a)||(a!==null&&(a=a.J()),this.dg=a,this.panel!==null&&this.panel.v(),this.Ob("separatorPadding",y,a))}},separatorStroke:{get:function(){return this.lo},set:function(a){var y=this.lo;y!==a&&(a!==null&&sf(a,"RowColumnDefinition.separatorStroke"),a instanceof Ki&&a.freeze(),this.lo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStroke",y,a))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(a){var y=this.mo;y!==a&&(this.mo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStrokeWidth",y,a))}},separatorDashArray:{get:function(){return this.tj},set:function(a){var y=this.tj;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||de("separatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.tj=a,this.panel!==null&&this.panel.N(),this.Ob("separatorDashArray",y,a)}}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&sf(a,"RowColumnDefinition.background"),a instanceof Ki&&a.freeze(),this.Ma=a,this.panel!==null&&this.panel.N(),this.Ob("background",y,a))}},coversSeparators:{get:function(){return this.Pm},set:function(a){var y=this.Pm;y!==a&&(this.Pm=a,this.panel!==null&&this.panel.N(),this.Ob("coversSeparators",y,a))}},sizing:{get:function(){return this.oo},set:function(a){var y=this.oo;y!==a&&(this.oo=a,this.panel!==null&&this.panel.v(),this.Ob("sizing",y,a))}},actual:{get:function(){return this.oa},set:function(a){this.oa=isNaN(this.Hc)?Math.max(Math.min(this.hj,a),this.jj):Math.max(Math.min(this.hj,this.Hc),this.jj)}},measured:{get:function(){return this.oc},set:function(a){this.oc=a}},total:{get:function(){return this.oa+this.Wc()}},position:{get:function(){return this.pa},set:function(a){this.pa=a}}}),ir.prototype.computeEffectiveSpacing=ir.prototype.Wc,ir.prototype.computeEffectiveSpacingTop=ir.prototype.Io;var Cv=new ae(ir,"Default",0),_g=new ae(ir,"None",1),Em=new ae(ir,"ProportionalExtra",2);ir.className="RowColumnDefinition",ir.Default=Cv,ir.None=_g,ir.ProportionalExtra=Em;function ei(a,y){Xt.call(this),this.Rd=this.ua=null,this.an="None",this.xc=this.Ui="black",this.ig=1,this.Na=this.Yg=null,this.Vn=this.Un=NaN,this.fa=null,typeof a=="string"?this.figure=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}ee(ei,Xt),ei.prototype.cloneProtected=function(a){Xt.prototype.cloneProtected.call(this,a),a.ua=this.ua,a.Rd=this.Rd,a.an=this.an,a.Ui=this.Ui,a.xc=this.xc,a.ig=this.ig,this.Yg!==null&&(a.Yg=wo(this.Yg)),this.Na!==null&&(a.Na=this.Na.nc?this.Na:this.Na.copy()),a.Un=this.Un,a.Vn=this.Vn,this.fa!==null&&(a.fa=this.fa.copy())};function pd(a){a.Na===null?a.Na=new Mv:a.Na.nc&&(a.Na=a.Na.copy())}xt=ei.prototype,xt.th=function(){Xt.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},xt.qb=function(a){a===Fe||a===gn||a===wi||a===Qn?this.geometryStretch=a:Xt.prototype.qb.call(this,a)},xt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+qt(this)};function gc(a,y,x,E){var b=x.length;if(!(4>b)){var z=E.measuredBounds,tt=Math.max(1,z.width);z=z.height;for(var ot=x[0],rt=x[1],at,ut,ct,mt,yt,St,Mt=0,Ot=Un(),bt=2;bt<b;bt+=2)at=x[bt],ut=x[bt+1],ct=at-ot,ot=ut-rt,ct===0&&(ct=.001),mt=ot/ct,yt=Math.atan2(ot,ct),St=Math.sqrt(ct*ct+ot*ot),Ot.push([ct,yt,mt,St]),Mt+=St,ot=at,rt=ut;ot=x[0],rt=x[1],ct=E.measuredBounds.width,E instanceof ei&&(ct-=E.strokeWidth),1>ct&&(ct=1),b=x=ct,at=tt/2,ut=at!==0,bt=0,St=Ot[bt],ct=St[0],yt=St[1],mt=St[2],St=St[3];for(var jt=0;.1<=Mt;){if(jt===0&&(ut?(b=x,b-=at,Mt-=at,ut=!1):b=x,b===0&&(b=1)),b>Mt){_n(Ot);return}b>St?(jt=b-St,b=St):jt=0;var Gt=Math.sqrt(b*b/(1+mt*mt));if(0>ct&&(Gt=-Gt),ot+=Gt,rt+=mt*Gt,a.translate(ot,rt),a.rotate(yt),a.translate(-(tt/2),-(z/2)),jt===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-yt),a.translate(-ot,-rt),Mt-=b,St-=b,jt!==0){if(bt++,bt===Ot.length){_n(Ot);return}St=Ot[bt],ct=St[0],yt=St[1],mt=St[2],St=St[3],b=jt}}_n(Ot)}}xt.hh=function(a,y){var x=this.xc,E=this.Ui;if(x!==null||E!==null){var b=this.ua;if(b!==null){a.yc();var z=this.actualBounds,tt=this.naturalBounds;E!==null&&zo(this,a,E,!0,!1,tt,z);var ot=this.part,rt=this.ig;if(x===null||rt!==0||ot===null||!this.isPanelMain&&ot.Pb()!==this||(rt=ot.type===ze.Link&&ot instanceof Ai&&ot.category==="Selection"&&ot.adornedObject instanceof ei&&ot.adornedPart.Pb()===ot.adornedObject?ot.adornedObject.strokeWidth:0),rt===0&&(x=null),x!==null&&rt!==0&&(zo(this,a,x,!1,!1,tt,z),a.lineWidth=rt,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,ot&&y.Gf("drawShadows")&&(z=ot.isShadowed),a.Il===!1&&(z=!1),ot=!0,x===null||E!==null&&E!=="transparent"||(ot=!1),tt=!1,rt=this.strokeDashArray,rt!==null&&(tt=!0,a.js(rt,this.strokeDashOffset)),b.type===Xe.j)a.beginPath(),a.moveTo(b.startX,b.startY),a.lineTo(b.endX,b.endY),x!==null&&a.jk(),a.Se();else if(b.type===Xe.u){var at=b.startX;rt=b.startY;var ut=b.endX,ct=b.endY;b=Math.min(at,ut);var mt=Math.min(rt,ct);at=Math.abs(ut-at),rt=Math.abs(ct-rt),a.beginPath(),a.rect(b,mt,at,rt),E!==null&&a.ng(E),x!==null&&(ot&&z&&Rl(a),a.jk(),ot&&z&&ru(a)),a.Se()}else if(b.type===Xe.F)at=b.startX,rt=b.startY,ut=b.endX,ct=b.endY,b=Math.abs(ut-at)/2,mt=Math.abs(ct-rt)/2,at=Math.min(at,ut)+b,rt=Math.min(rt,ct)+mt,a.beginPath(),a.moveTo(at,rt-mt),a.bezierCurveTo(at+Jt.wg*b,rt-mt,at+b,rt-Jt.wg*mt,at+b,rt),a.bezierCurveTo(at+b,rt+Jt.wg*mt,at+Jt.wg*b,rt+mt,at,rt+mt),a.bezierCurveTo(at-Jt.wg*b,rt+mt,at-b,rt+Jt.wg*mt,at-b,rt),a.bezierCurveTo(at-b,rt-Jt.wg*mt,at-Jt.wg*b,rt-mt,at,rt-mt),a.closePath(),E!==null&&a.ng(E),x!==null&&(ot&&z&&Rl(a),a.jk(),ot&&z&&ru(a)),a.Se();else if(b.type===Xe.o)for(b=b.figures,rt=b.length,mt=0;mt<rt;mt++){at=b.s[mt],a.beginPath(),a.moveTo(at.startX,at.startY),ut=at.segments.s,ct=ut.length;for(var yt=null,St=0;St<ct;St++){var Mt=ut[St];switch(Mt.type){case pr:a.moveTo(Mt.endX,Mt.endY);break;case ao:a.lineTo(Mt.endX,Mt.endY);break;case Rr:a.bezierCurveTo(Mt.point1X,Mt.point1Y,Mt.point2X,Mt.point2Y,Mt.endX,Mt.endY);break;case aa:a.quadraticCurveTo(Mt.point1X,Mt.point1Y,Mt.endX,Mt.endY);break;case tr:if(Mt.radiusX===Mt.radiusY){var Ot=Math.PI/180;a.arc(Mt.point1X,Mt.point1Y,Mt.radiusX,Mt.startAngle*Ot,(Mt.startAngle+Mt.sweepAngle)*Ot,0>Mt.sweepAngle,yt!==null?yt.endX:at.startX,yt!==null?yt.endY:at.startY)}else if(yt=Zs(Mt,at),Ot=yt.length,Ot===0)a.lineTo(Mt.centerX,Mt.centerY);else for(var bt=0;bt<Ot;bt++){var jt=yt[bt];bt===0&&a.lineTo(jt[0],jt[1]),a.bezierCurveTo(jt[2],jt[3],jt[4],jt[5],jt[6],jt[7])}break;case xa:if(bt=Ot=0,yt!==null&&yt.type===tr){if(yt=Zs(yt,at),jt=yt.length,jt===0){a.lineTo(Mt.endX,Mt.endY);break}yt=yt[jt-1]||null,yt!==null&&(Ot=yt[6],bt=yt[7])}else Ot=yt!==null?yt.endX:at.startX,bt=yt!==null?yt.endY:at.startY;if(yt=Ba(Mt,at,Ot,bt),Ot=yt.length,Ot===0){a.lineTo(Mt.endX,Mt.endY);break}for(bt=0;bt<Ot;bt++)jt=yt[bt],a.bezierCurveTo(jt[2],jt[3],jt[4],jt[5],jt[6],jt[7]);break;default:de("Segment not of valid type: "+Mt.type)}Mt.isClosed&&a.closePath(),yt=Mt}ut=at.isFilled,z?at.isShadowed?(ut===!0&&E!=="transparent"&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&(ut&&ot&&Rl(a),a.jk(),ut&&ot&&ru(a))):(Rl(a),ut&&E!=="transparent"&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&a.jk(),ru(a)):(ut&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&a.jk()),a.Se(mt)}if(tt&&a.fs(),this.pathPattern!==null){if(x=this.pathPattern,x.measure(1/0,1/0),E=x.measuredBounds,x.arrange(0,0,E.width,E.height),z=this.geometry,a.save(),a.beginPath(),E=Un(),z.type===Xe.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),gc(a,y,E,x);else if(z.type===Xe.o)for(z=z.figures.iterator;z.next();){for(ot=z.value,E.length=0,E.push(ot.startX),E.push(ot.startY),tt=ot.startX,b=ot.startY,rt=tt,mt=b,at=ot.segments.s,ut=at.length,ct=0;ct<ut;ct++){switch(St=at[ct],St.type){case pr:gc(a,y,E,x),E.length=0,E.push(St.endX),E.push(St.endY),tt=St.endX,b=St.endY,rt=tt,mt=b;break;case ao:E.push(St.endX),E.push(St.endY),tt=St.endX,b=St.endY;break;case Rr:Jt.Qe(tt,b,St.point1X,St.point1Y,St.point2X,St.point2Y,St.endX,St.endY,.5,E),tt=St.endX,b=St.endY;break;case aa:Jt.ep(tt,b,St.point1X,St.point1Y,St.endX,St.endY,.5,E),tt=St.endX,b=St.endY;break;case tr:if(Mt=Zs(St,ot),yt=Mt.length,yt===0){E.push(St.centerX),E.push(St.centerY),tt=St.centerX,b=St.centerY;break}for(Ot=0;Ot<yt;Ot++)bt=Mt[Ot],Jt.Qe(tt,b,bt[2],bt[3],bt[4],bt[5],bt[6],bt[7],.5,E),tt=bt[6],b=bt[7];break;case xa:if(Mt=Ba(St,ot,tt,b),yt=Mt.length,yt===0){E.push(St.endX),E.push(St.endY),tt=St.endX,b=St.endY;break}for(Ot=0;Ot<yt;Ot++)bt=Mt[Ot],Jt.Qe(tt,b,bt[2],bt[3],bt[4],bt[5],bt[6],bt[7],.5,E),tt=bt[6],b=bt[7];break;default:de("Segment not of valid type: "+St.type)}St.isClosed&&(E.push(rt),E.push(mt),gc(a,y,E,x))}gc(a,y,E,x)}else if(z.type===Xe.u)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.startY),E.push(z.endX),E.push(z.endY),E.push(z.startX),E.push(z.endY),E.push(z.startX),E.push(z.startY),gc(a,y,E,x);else if(z.type===Xe.F){if(b=new gr,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new Oi(tr),tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(z.startX+z.endX)/2,tt.centerY=(z.startY+z.endY)/2,tt.radiusX=Math.abs(z.startX-z.endX)/2,tt.radiusY=Math.abs(z.startY-z.endY)/2,b.add(tt),z=Zs(tt,b),ot=z.length,ot===0)E.push(tt.centerX),E.push(tt.centerY);else for(tt=b.startX,b=b.startY,rt=0;rt<ot;rt++)mt=z[rt],Jt.Qe(tt,b,mt[2],mt[3],mt[4],mt[5],mt[6],mt[7],.5,E),tt=mt[6],b=mt[7];gc(a,y,E,x)}_n(E),a.restore(),a.Vc(!1)}}}},xt.kk=function(a,y,x){return!Xt.prototype.kk.call(this,a,y,x)||this.xc===null&&this.Ui===null||this.ua===null||this.pathPattern!==null||this.geometry.figures.length!==this.svg.getElementsByTagName("path").length?!1:(a.Hl=this.svg,this.hh(a,y),a.Hl=null,!0)},xt.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:Xt.prototype.nk.call(this,a)},xt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("path");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},xt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof Sn){a.Mc()&&de("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var x=this.naturalBounds,E=this.strokeWidth;y.h(a.x*(x.width+E)-E/2+x.x+a.offsetX,a.y*(x.height+E)-E/2+x.y+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},xt.mi=function(a){a===void 0&&(a=new pe);var y=this.naturalBounds,x=this.oe;y=pe.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=At.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),yo(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),yo(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),yo(a,E.x,E.y,0,0),pe.free(y),At.free(E),a},xt.gh=function(a,y){var x=this.geometry;if(x===null||this.fill===null&&this.stroke===null)return!1;var E=x.bounds,b=this.strokeWidth/2;x.type!==Xe.j||y||(b+=2);var z=pe.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return pe.free(z),!1;if(E=b+1e-4,x.type===Xe.j)return this.stroke===null||(E=(x.endX-x.startX)*(a.x-x.startX)+(x.endY-x.startY)*(a.y-x.startY),0>(x.startX-x.endX)*(a.x-x.endX)+(x.startY-x.endY)*(a.y-x.endY)||0>E)?!1:(pe.free(z),Jt.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===Xe.u){y=x.startX;var tt=x.startY,ot=x.endX;if(x=x.endY,z.x=Math.min(y,ot),z.y=Math.min(tt,x),z.width=Math.abs(ot-y),z.height=Math.abs(x-tt),this.fill===null){if(z.Bc(-E,-E),z.ca(a))return pe.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),pe.free(z),a}if(x.type===Xe.F){tt=x.startX,b=x.startY,ot=x.endX;var rt=x.endY;if(x=Math.min(tt,ot),y=Math.min(b,rt),tt=Math.abs(ot-tt)/2,b=Math.abs(rt-b)/2,x=a.x-(x+tt),y=a.y-(y+b),this.fill===null){if(tt-=E,b-=E,0>=tt||0>=b||1>=x*x/(tt*tt)+y*y/(b*b))return pe.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),pe.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===Xe.o)return pe.free(z),this.fill===null?rh(x,a.x,a.y,b):Jl(x,a,b,1<this.strokeWidth,y);de("Unknown Geometry type: "+x.type)},xt.Wl=function(a,y,x,E){var b=this.desiredSize,z=this.ig;if(a=Math.max(a,0),y=Math.max(y,0),this.Rd!==null)var tt=this.geometry.bounds;else{var ot=this.figure,rt=kv[ot];if(rt===void 0){var at=Jt.Ze[ot];typeof at=="string"&&(at=Jt.Ze[at]),typeof at=="function"?(rt=at(null,100,100),kv[ot]=rt):de("Unsupported Figure: "+ot)}tt=rt.bounds}ot=tt.width,rt=tt.height,at=tt.width;var ut=tt.height;switch(Es(this,!0)){case Fe:E=x=0;break;case Re:at=Math.max(a-z,0),ut=Math.max(y-z,0);break;case xn:at=Math.max(a-z,0),E=0;break;case Nn:x=0,ut=Math.max(y-z,0)}isFinite(b.width)&&(at=b.width),isFinite(b.height)&&(ut=b.height);var ct=this.maxSize,mt=this.minSize;switch(x=Math.max(x-z,mt.width),E=Math.max(E-z,mt.height),at=Math.min(ct.width,at),ut=Math.min(ct.height,ut),at=isFinite(at)?Math.max(x,at):Math.max(ot,x),ut=isFinite(ut)?Math.max(E,ut):Math.max(rt,E),x=Lv(this),x){case Fe:break;case Re:ot=at,rt=ut;break;case gn:x=Math.min(at/ot,ut/rt),isFinite(x)||(x=1),ot*=x,rt*=x;break;default:de(x+" is not a valid geometryStretch.")}this.Rd!==null?(ot===0&&(ot=.001),rt===0&&(rt=.001),x=this.Rd!==null?this.Rd:this.ua,tt=x.bounds,E=ot/tt.width,tt=rt/tt.height,isFinite(E)||(E=1),isFinite(tt)||(tt=1),this.ua=E===1&&tt===1?x:x.copy().scale(E,tt)):this.ua!==null&&Jt.$(this.ua.Sk,a-z)&&Jt.$(this.ua.Rk,y-z)||(this.ua=ei.makeGeometry(this,ot,rt)),tt=this.ua.bounds,a===1/0||y===1/0?this.Ge(tt.x-z/2,tt.y-z/2,a===0&&ot===0?0:tt.width+z,y===0&&rt===0?0:tt.height+z):this.Ge(-(z/2),-(z/2),at+z,ut+z),b.w()?(at=b.width,ut=b.height,at=Math.min(ct.width,at),ut=Math.min(ct.height,ut),at=Math.max(mt.width,at),ut=Math.max(mt.height,ut),this.dc.h(0,0,at,ut)):this.dc.assign(tt)};function Lv(a){var y=a.geometryStretch;return a.Rd!==null?y===Qn?Re:y:y===Qn?kv[a.figure].defaultStretch:y}xt.eh=function(a,y,x,E){ts(this,a,y,x,E)},xt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},xt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),ot=z.m22*tt,rt=-z.m12*tt,at=-z.m21*tt,ut=z.m11*tt,ct=tt*(z.m21*z.dy-z.m22*z.dx),mt=tt*(z.m12*z.dx-z.m11*z.dy);z=a*ot+y*at+ct,tt=a*rt+y*ut+mt,ot=x*ot+E*at+ct,rt=x*rt+E*ut+mt,ct=this.ig/2,at=this.ua,at===null&&(this.measure(1/0,1/0),at=this.ua);var yt=at.bounds;if(ut=!1,at.type===Xe.j)if(1.5>=this.strokeWidth)ut=Jt.Ve(at.startX,at.startY,at.endX,at.endY,z,tt,ot,rt,b);else{if(at.startX===at.endX?(E=ct,ut=0):(y=(at.endY-at.startY)/(at.endX-at.startX),ut=ct/Math.sqrt(1+y*y),E=ut*y),y=Un(),a=new At,Jt.Ve(at.startX+E,at.startY+ut,at.endX+E,at.endY+ut,z,tt,ot,rt,a)&&y.push(a),a=new At,Jt.Ve(at.startX-E,at.startY-ut,at.endX-E,at.endY-ut,z,tt,ot,rt,a)&&y.push(a),a=new At,Jt.Ve(at.startX+E,at.startY+ut,at.startX-E,at.startY-ut,z,tt,ot,rt,a)&&y.push(a),a=new At,Jt.Ve(at.endX+E,at.endY+ut,at.endX-E,at.endY-ut,z,tt,ot,rt,a)&&y.push(a),ot=y.length,ot===0)return _n(y),!1;for(ut=!0,rt=1/0,E=0;E<ot;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-tt)*(a.y-tt),x<rt&&(rt=x,b.x=a.x,b.y=a.y);_n(y)}else if(at.type===Xe.u)ut=Jt.Ff(yt.x-ct,yt.y-ct,yt.x+yt.width+ct,yt.y+yt.height+ct,z,tt,ot,rt,b);else if(at.type===Xe.F){y=pe.allocAt(yt.x,yt.y,yt.width,yt.height).Bc(ct,ct);t:if(y.width===0)ut=Jt.Ve(y.x,y.y,y.x,y.y+y.height,z,tt,ot,rt,b);else if(y.height===0)ut=Jt.Ve(y.x,y.y,y.x+y.width,y.y,z,tt,ot,rt,b);else{if(a=y.width/2,at=y.height/2,E=y.x+a,ut=y.y+at,x=9999,z!==ot&&(x=(tt-rt)/(z-ot)),9999>Math.abs(x)){if(rt=tt-ut-x*(z-E),0>a*a*x*x+at*at-rt*rt){b.x=NaN,b.y=NaN,ut=!1;break t}ct=Math.sqrt(a*a*x*x+at*at-rt*rt),ot=(-(a*a*x*rt)+a*at*ct)/(at*at+a*a*x*x)+E,a=(-(a*a*x*rt)-a*at*ct)/(at*at+a*a*x*x)+E,at=x*(ot-E)+rt+ut,rt=x*(a-E)+rt+ut,Math.abs((z-ot)*(z-ot))+Math.abs((tt-at)*(tt-at))<Math.abs((z-a)*(z-a))+Math.abs((tt-rt)*(tt-rt))?(b.x=ot,b.y=at):(b.x=a,b.y=rt)}else{if(ot=at*at,rt=z-E,ot-=ot/(a*a)*rt*rt,0>ot){b.x=NaN,b.y=NaN,ut=!1;break t}rt=Math.sqrt(ot),ot=ut+rt,rt=ut-rt,Math.abs(ot-tt)<Math.abs(rt-tt)?(b.x=z,b.y=ot):(b.x=z,b.y=rt)}ut=!0}pe.free(y)}else if(at.type===Xe.o){mt=At.alloc();var St=ot-z,Mt=rt-tt,Ot=St*St+Mt*Mt,bt=z,jt=tt;if(0<Ot&&yt.contains(bt,jt)&&(mt.x=bt,mt.y=jt,this.ca(mt)))for(St!==0&&.5>Math.abs(St)?(Mt*=.5/St,St=.5):Mt!==0&&.5>Math.abs(Mt)&&(St*=.5/Mt,Mt=.5),bt-=St,jt-=Mt;yt.contains(bt,jt);)bt-=St,jt-=Mt;for(b.x=ot,b.y=rt,Mt=0;Mt<at.figures.count;Mt++){var Gt=at.figures.s[Mt],Wt=Gt.isFilled?bt:z,Kt=Gt.isFilled?jt:tt,$t=Gt.segments;yt=Gt.startX,St=Gt.startY;for(var Qe=yt,dn=St,rn=0;rn<$t.count;rn++){var We=$t.s[rn],Ee=We.type,Zn=We.endX,zn=We.endY,Ri=!1;switch(Ee){case pr:Qe=Zn,dn=zn;break;case ao:Ri=Tm(yt,St,Zn,zn,Wt,Kt,ot,rt,mt);break;case Rr:Ri=Jt.Eo(yt,St,We.point1X,We.point1Y,We.point2X,We.point2Y,Zn,zn,Wt,Kt,ot,rt,.6,mt);break;case aa:Ri=Jt.Eo(yt,St,yt+2/3*(We.point1X-yt),St+2/3*(We.point1Y-St),Zn+2/3*(We.point1X-Zn),zn+2/3*(We.point1Y-zn),Zn,zn,Wt,Kt,ot,rt,.6,mt);break;case tr:case xa:Ee=We.type===tr?Zs(We,Gt):Ba(We,Gt,yt,St);var no=Ee.length;if(no===0){Ri=Tm(yt,St,We.type===tr?We.centerX:We.endX,We.type===tr?We.centerY:We.endY,Wt,Kt,ot,rt,mt);break}for(zn=null,Zn=0;Zn<no;Zn++){if(zn=Ee[Zn],Zn===0&&Tm(yt,St,zn[0],zn[1],Wt,Kt,ot,rt,mt)){var vr=Nm(Wt,Kt,mt,Ot,b);vr<Ot&&(Ot=vr,ut=!0)}Jt.Eo(zn[0],zn[1],zn[2],zn[3],zn[4],zn[5],zn[6],zn[7],Wt,Kt,ot,rt,.6,mt)&&(vr=Nm(Wt,Kt,mt,Ot,b),vr<Ot&&(Ot=vr,ut=!0))}Zn=zn[6],zn=zn[7];break;default:de("Unknown Segment type: "+Ee)}yt=Zn,St=zn,Ri&&(Ri=Nm(Wt,Kt,mt,Ot,b),Ri<Ot&&(Ot=Ri,ut=!0)),We.isClosed&&(Zn=Qe,zn=dn,Tm(yt,St,Zn,zn,Wt,Kt,ot,rt,mt)&&(We=Nm(Wt,Kt,mt,Ot,b),We<Ot&&(Ot=We,ut=!0)))}}z=x-a,tt=E-y,ot=Math.sqrt(z*z+tt*tt),ot!==0&&(z/=ot,tt/=ot),b.x-=z*ct,b.y-=tt*ct,At.free(mt)}else de("Unknown Geometry type: "+at.type);return ut?(this.transform.Ga(b),!0):!1};function Nm(a,y,x,E,b){return a=x.x-a,y=x.y-y,y=a*a+y*y,y<E?(b.x=x.x,b.y=x.y,y):E}function Tm(a,y,x,E,b,z,tt,ot,rt){if(Jt.$(a,x)&&Jt.$(y,E)||Jt.$(b,tt)&&Jt.$(z,ot))return!1;var at=!1,ut=(b-tt)*(y-E)-(z-ot)*(a-x);return ut===0?!1:(rt.x=((b*ot-z*tt)*(a-x)-(b-tt)*(a*E-y*x))/ut,rt.y=((b*ot-z*tt)*(y-E)-(z-ot)*(a*E-y*x))/ut,(a>x?a-x:x-a)<(y>E?y-E:E-y)?(a=y<E?y:E,y=y<E?E:y,(rt.y>a||Jt.$(rt.y,a))&&(rt.y<y||Jt.$(rt.y,y))&&(at=!0)):(y=a<x?a:x,a=a<x?x:a,(rt.x>y||Jt.$(rt.x,y))&&(rt.x<a||Jt.$(rt.x,a))&&(at=!0)),at)}xt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.ua;x===null&&(this.measure(1/0,1/0),x=this.ua),x=x.bounds;var E=this.strokeWidth/2,b=!1,z=At.alloc();return z.h(x.x-E,x.y-E),a.ca(y.Ga(z))&&(z.h(x.x-E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.y-E),a.ca(y.Ga(z))&&(b=!0)))),At.free(z),b},xt.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=ci.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=At.alloc();if(tt.h(E,z),x.Ga(tt),this.gh(tt,!0)||(tt.h(b,z),x.Ga(tt),this.gh(tt,!0))||(tt.h(E,a),x.Ga(tt),this.gh(tt,!0))||(tt.h(b,a),x.Ga(tt),this.gh(tt,!0)))return At.free(tt),!0;var ot=At.alloc(),rt=At.alloc();return x.set(y),x.bv(this.transform),x.Vj(),ot.x=b,ot.y=z,ot.transform(x),tt.x=E,tt.y=z,tt.transform(x),y=!1,md(this,tt,ot,rt)?y=!0:(tt.x=b,tt.y=a,tt.transform(x),md(this,tt,ot,rt)?y=!0:(ot.x=E,ot.y=a,ot.transform(x),md(this,tt,ot,rt)?y=!0:(tt.x=E,tt.y=z,tt.transform(x),md(this,tt,ot,rt)&&(y=!0)))),At.free(tt),ci.free(x),At.free(ot),At.free(rt),y};function md(a,y,x,E){if(!a.rs(y,x,E))return!1;a=y.x,y=y.y;var b=x.x,z=x.y;return x=E.x,E=E.y,a===b?(y<z?(a=y,y=z):a=z,E>=a&&E<=y):(a<b?(E=a,a=b):E=b,x>=E&&x<=a)}xt.tx=function(a,y,x){function E(Ot,bt){for(var jt=Ot.length,Gt=0;Gt<jt;Gt+=2)if(bt.zd(Ot[Gt],Ot[Gt+1])>b)return!0;return!1}if(x&&this.fill!==null&&this.gh(a,!0))return!0;var b=a.Bf(y),z=b;if(1.5<this.strokeWidth&&(b=this.strokeWidth/2+Math.sqrt(b),b*=b),y=this.ua,y===null&&(this.measure(1/0,1/0),y=this.ua,y===null))return!1;if(!x){var tt=y.bounds,ot=tt.x,rt=tt.y,at=tt.x+tt.width;if(tt=tt.y+tt.height,Wn(a.x,a.y,ot,rt)<=b&&Wn(a.x,a.y,at,rt)<=b&&Wn(a.x,a.y,ot,tt)<=b&&Wn(a.x,a.y,at,tt)<=b)return!0}if(ot=y.startX,rt=y.startY,at=y.endX,tt=y.endY,y.type===Xe.j){if(x=(ot-at)*(a.x-at)+(rt-tt)*(a.y-tt),Ui(a.x,a.y,ot,rt,at,tt)<=(0<=(at-ot)*(a.x-ot)+(tt-rt)*(a.y-rt)&&0<=x?b:z))return!0}else{if(y.type===Xe.u)return y=!1,x&&(y=Ui(a.x,a.y,ot,rt,ot,tt)<=b||Ui(a.x,a.y,ot,rt,at,rt)<=b||Ui(a.x,a.y,at,rt,at,tt)<=b||Ui(a.x,a.y,ot,tt,at,tt)<=b),y;if(y.type===Xe.F){y=a.x-(ot+at)/2,z=a.y-(rt+tt)/2;var ut=Math.abs(at-ot)/2,ct=Math.abs(tt-rt)/2;if(ut===0||ct===0)return Ui(a.x,a.y,ot,rt,at,tt)<=b;if(x){if(a=Jt.$y(ut,ct,y,z),a*a<=b)return!0}else return!(Wn(y,z,-ut,0)>=b||Wn(y,z,0,-ct)>=b||Wn(y,z,0,ct)>=b||Wn(y,z,ut,0)>=b)}else if(y.type===Xe.o){if(at=y.bounds,z=at.x,ot=at.y,rt=at.x+at.width,at=at.y+at.height,a.x>rt&&a.x<z&&a.y>at&&a.y<ot&&Ui(a.x,a.y,z,ot,z,at)>b&&Ui(a.x,a.y,z,ot,rt,ot)>b&&Ui(a.x,a.y,rt,at,z,at)>b&&Ui(a.x,a.y,rt,at,rt,ot)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?rh(y,a.x,a.y,z):Jl(y,a,z,!0,!1))return!0}else{for(x=y.figures,y=0;y<x.count;y++){if(z=x.s[y],tt=z.startX,ut=z.startY,a.zd(tt,ut)>b)return!1;for(ot=z.segments.s,rt=ot.length,at=0;at<rt;at++)switch(ct=ot[at],ct.type){case pr:case ao:if(tt=ct.endX,ut=ct.endY,a.zd(tt,ut)>b)return!1;break;case Rr:var mt=Un();if(Jt.Qe(tt,ut,ct.point1X,ct.point1Y,ct.point2X,ct.point2Y,ct.endX,ct.endY,.8,mt),tt=E(mt,a),_n(mt),tt||(tt=ct.endX,ut=ct.endY,a.zd(tt,ut)>b))return!1;break;case aa:if(mt=Un(),Jt.ep(tt,ut,ct.point1X,ct.point1Y,ct.endX,ct.endY,.8,mt),tt=E(mt,a),_n(mt),tt||(tt=ct.endX,ut=ct.endY,a.zd(tt,ut)>b))return!1;break;case tr:case xa:mt=ct.type===tr?Zs(ct,z):Ba(ct,z,tt,ut);var yt=mt.length;if(yt===0){if(tt=ct.type===tr?ct.centerX:ct.endX,ut=ct.type===tr?ct.centerY:ct.endY,a.zd(tt,ut)>b)return!1;break}ct=null;for(var St=Un(),Mt=0;Mt<yt;Mt++)if(ct=mt[Mt],St.length=0,Jt.Qe(ct[0],ct[1],ct[2],ct[3],ct[4],ct[5],ct[6],ct[7],.8,St),E(St,a))return _n(St),!1;_n(St),ct!==null&&(tt=ct[6],ut=ct[7]);break;default:de("Unknown Segment type: "+ct.type)}}return!0}}}return!1},xt.qc=function(){this.ua=null},xt.kq=function(){return this.ig};function m1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=Zg,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=Jr):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new Sn(1-Jr.x,Jr.y)))}ei.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=zl[a.toArrow];else a.fromArrow!=="None"?E=zl[a.fromArrow]:(E=Jt.Ze[a.figure],typeof E=="string"&&(E=Jt.Ze[E]),E===void 0&&de("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=Jt.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function v1(a){var y=zl[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=zl[x],y===void 0){var E=null,b;for(b in Jt.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=Xe.parse(Jt.um[E],!1),zl[E]=a,x!==E&&(zl[x]=E),E}}return typeof y=="string"?y:y instanceof Xe?a:null}Ie.Object.defineProperties(ei.prototype,{geometry:{get:function(){return this.ua!==null?this.ua:this.Rd},set:function(a){var y=this.ua,x=this.Rd;if(y!==a){a!==null?this.Rd=this.ua=a.freeze():this.Rd=this.ua=null;var E=this.part;E!==null&&(E.ag=NaN),this.v(),this.g("geometry",y||x,a),Dr(this)&&(a=this.part,a!==null&&ho(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=Xe.parse(a);var y=a.normalize();this.geometry=a,this.position=a=At.allocAt(-y.x,-y.y),At.free(a)}},isGeometryPositioned:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.v(),this.g("isGeometryPositioned",y,a))}},fill:{get:function(){return this.Ui},set:function(a){var y=this.Ui;y!==a&&(a!==null&&sf(a,"Shape.fill"),a instanceof Ki&&a.freeze(),this.Ui=a,this.N(),this.g("fill",y,a))}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&sf(a,"Shape.stroke"),a instanceof Ki&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},strokeWidth:{get:function(){return this.ig},set:function(a){var y=this.ig;if(y!==a)if(0<=a){this.ig=a,this.v();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeWidth",y,a)}else qn(a,"value >= 0",ei,"strokeWidth:value")}},strokeCap:{get:function(){return this.Na!==null?this.Na.Hr:"butt"},set:function(a){var y=this.strokeCap;y!==a&&(typeof a!="string"||a!=="butt"&&a!=="round"&&a!=="square"?qn(a,'"butt", "round", or "square"',ei,"strokeCap"):(pd(this),this.Na.Hr=a,this.N(),this.g("strokeCap",y,a)))}},strokeJoin:{get:function(){return this.Na!==null?this.Na.Ir:"miter"},set:function(a){var y=this.strokeJoin;y!==a&&(typeof a!="string"||a!=="miter"&&a!=="bevel"&&a!=="round"?qn(a,'"miter", "bevel", or "round"',ei,"strokeJoin"):(pd(this),this.Na.Ir=a,this.N(),this.g("strokeJoin",y,a)))}},strokeMiterLimit:{get:function(){return this.Na!==null?this.Na.Jr:10},set:function(a){var y=this.strokeMiterLimit;if(y!==a&&1<=a){pd(this),this.Na.Jr=a,this.N();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeMiterLimit",y,a)}}},strokeDashArray:{get:function(){return this.Yg},set:function(a){var y=this.Yg;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];0<=z&&isFinite(z)||de("strokeDashArray:value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.Yg=a,this.N(),this.g("strokeDashArray",y,a)}}},strokeDashOffset:{get:function(){return this.Na!==null?this.Na.uj:0},set:function(a){var y=this.strokeDashOffset;y!==a&&0<=a&&(pd(this),this.Na.uj=a,this.N(),this.g("strokeDashOffset",y,a))}},figure:{get:function(){return this.an},set:function(a){var y=this.an;if(y!==a){var x=Jt.Ze[a];typeof x=="function"?x=a:(x=Jt.Ze[a.toLowerCase()])||de("Unknown Shape.figure: "+a),y!==x&&(a=this.part,a!==null&&(a.ag=NaN),this.an=x,this.Rd=null,this.qc(),this.v(),this.g("figure",y,x))}}},toArrow:{get:function(){return this.Ua!==null?this.Ua.V:"None"},set:function(a){var y=this.toArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?de("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Lh),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("toArrow",y,x))}}},fromArrow:{get:function(){return this.Ua!==null?this.Ua.j:"None"},set:function(a){var y=this.fromArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?de("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Lh),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:Ir},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),pd(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:Ir},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),pd(this),this.Na.gg=a,this.v(),this.g("spot2",y,a))}},parameter1:{get:function(){return this.Un},set:function(a){var y=this.Un;y!==a&&(this.Un=a,this.qc(),this.v(),this.g("parameter1",y,a))}},parameter2:{get:function(){return this.Vn},set:function(a){var y=this.Vn;y!==a&&(this.Vn=a,this.qc(),this.v(),this.g("parameter2",y,a))}},naturalBounds:{get:function(){return this.dc}},pathPattern:{get:function(){return this.Na!==null?this.Na.br:null},set:function(a){var y=this.pathPattern;y!==a&&(pd(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:Qn},set:function(a){var y=this.geometryStretch;y!==a&&(pd(this),this.Na.jq=a,this.v(),this.g("geometryStretch",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new _l),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&xl(x),this.v(),x=this.panel,x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new _l),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new _l),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new _l),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),ei.prototype.intersectsRect=ei.prototype.Yc,ei.prototype.containedInRect=ei.prototype.fh,ei.prototype.getNearestIntersectionPoint=ei.prototype.rs,ei.prototype.getDocumentBounds=ei.prototype.mi,ei.prototype.getDocumentPoint=ei.prototype.ga;var zl=new Se,kv=new Se;ei.className="Shape",ei.getFigureGenerators=function(){var a=new qe,y;for(y in Jt.Ze)y!==y.toLowerCase()&&a.add(y,Jt.Ze[y]);return a.freeze(),a},ei.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=Jt.Ze;E[a]=y,E[x]=a},ei.getArrowheadGeometries=function(){var a=new qe;for(E in Jt.um)if(zl[E]===void 0){var y=Xe.parse(Jt.um[E],!1);zl[E]=y,y=E.toLowerCase(),y!==E&&(zl[y]=E)}for(var x in zl)if(x!==x.toLowerCase()){var E=zl[x];E instanceof Xe&&a.add(x,E)}return a.freeze(),a},ei.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=Xe.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||de("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=zl;E[a]=x,E[y]=a};function Mv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=Qn,this.gg=this.fg=Ir}Mv.prototype.copy=function(){var a=new Mv;return a.Hr=this.Hr,a.Ir=this.Ir,a.Jr=this.Jr,a.uj=this.uj,a.br=this.br,a.jq=this.jq,a.fg=this.fg.J(),a.gg=this.gg.J(),a};function io(a,y){return Xt.call(this),Dm||(Ns=Io?new ja(null).context:null,Dm=!0),this.l|=2097152,this.ec="",this.xc="black",this.Ae="13px sans-serif",this.Lq=this.Cb=this.Gc=0,this.da=this.fa=this.Gm=null,this.Ih=0,this.df=null,this.Le=0,this.ze=this.Qb=this.Qc=null,typeof a=="string"?this.text=a:a&&Object.assign(this,a),y&&Object.assign(this,y),this}ee(io,Xt),io.prototype.cloneProtected=function(a){Xt.prototype.cloneProtected.call(this,a),a.ec=this.ec,a.xc=this.xc,a.Ae=this.Ae,a.Gc=this.Gc,a.Cb=this.Cb,a.Lq=this.Lq,a.Gm=this.Gm,this.fa!==null&&(a.fa=this.fa.copy()),this.da!==null&&(a.da=this.da.nc?this.da:this.da.copy()),a.Ih=this.Ih,a.df=this.df,a.Le=this.Le,a.Qc=this.Qc,a.Qb=this.Qb,a.ze=this.ze};function Ll(a){a.da===null?a.da=new Bv:a.da.nc&&(a.da=a.da.copy())}xt=io.prototype,xt.th=function(){Xt.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function y1(a,y){a.l=y.l|6144,a.pb=y.opacity,a.Ma=y.background,a.areaBackground=y.areaBackground,a.jd=y.desiredSize.J(),a.minSize=y.minSize.J(),a.maxSize=y.maxSize.J(),y.Lb!==null?a.Lb=y.Lb.copy():a.Lb=null,a.Ca=y.scale,a.Kb=y.angle,a.stretch=y.stretch,a.Kg=y.margin.J(),a.Jb=y.alignment.J(),a.sk=y.alignmentFocus.J(),a.segmentFraction=y.segmentFraction,a.segmentOffset=y.segmentOffset.J(),a.segmentOrientation=y.segmentOrientation,y.tb!==null&&(a.tb=y.tb.copy()),a.shadowVisible=y.shadowVisible,a.ec=y.ec,a.xc=y.xc,a.Ae=y.Ae,a.fa!==null&&(a.fa=y.fa.copy()),y.da!==null&&(a.da=y.da.nc?y.da:y.da.copy()),a.Ih=y.Ih}xt.qb=function(a){a.classType===io?this.wrap=a:Xt.prototype.qb.call(this,a)},xt.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},xt.v=function(){Xt.prototype.v.call(this)},xt.hh=function(a,y){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var x=this.naturalBounds,E=this.actualBounds,b=x.width,z=x.height,tt=Hg(this),ot=a.textAlign=this.textAlign,rt=y.tn;ot==="start"?ot=rt?"right":"left":ot==="end"&&(ot=rt?"left":"right"),rt=this.isUnderline;var at=this.isStrikethrough;zo(this,a,this.xc,!0,!1,x,E),(rt||at)&&zo(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var ut=this.oe,ct=ut.dx-(tt*ut.m21+ut.dx);ut=ut.dy-(tt*ut.m22+ut.dy);var mt=y.scale;switch(8>(ct*ct+ut*ut)*mt*mt&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof qs&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ct=this.spacingBelow,this.flip){case Ei:a.translate(b,0),a.scale(-1,1);break;case si:a.translate(0,z),a.scale(1,-1);break;case $i:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),ut=this.Gc,mt=(y+tt+ct)*ut,z>mt&&(E=this.verticalAlignment,E=E.y*z-E.y*mt+E.offsetY),ut===1&&this.ze!==null)ct=this.Cb,ct>b&&(ct=b),this.Oj(this.ze,a,0,E+y,b,tt,ct,x,ot,rt,at);else if(this.Qc!==null&&this.Qb!==null)for(mt=0;mt<ut;mt++){var yt=this.Qc[mt];yt>b&&(yt=b),E+=y,this.Oj(this.Qb[mt],a,0,E,b,tt,yt,x,ot,rt,at),E+=tt+ct}switch(this.flip){case Ei:a.scale(-1,1),a.translate(-b,0);break;case si:a.scale(1,-1),a.translate(0,-z);break;case $i:a.scale(-1,-1),a.translate(-b,-z)}}},xt.Oj=function(a,y,x,E,b,z,tt,ot,rt,at,ut){var ct=0;if(ot)rt==="left"?ct=0:rt==="right"?ct=b-tt:rt==="center"&&(ct=(b-tt)/2),y.fillRect(x+ct,E+.25*z,tt,1);else{if(rt==="left"?ct=0:rt==="right"?ct=b:rt==="center"&&(ct=b/2),b=Fm!==null?Fm(this,z):.75*z,y.fillText(a,x+ct,E+b),a=z/20|0,a===0&&(a=1),rt==="right"?ct-=tt:rt==="center"&&(ct-=tt/2),at){ot=bm!==null?bm(this,z):.8*z,rt=x+ct,at=E+ot,b=x+ct+tt,ot=E+ot;var mt=a;y.beginPath(),y.lineWidth=mt,y.moveTo(rt,at),y.lineTo(b,ot),y.stroke(),y.Se(),y instanceof qs&&y.ad.classList.add("gojs-td")}ut&&(ut=E+z-z/2.2|0,a%2!==0&&(ut+=.5),E=x+ct,z=ut,x=x+ct+tt,tt=ut,ct=a,y.beginPath(),y.lineWidth=ct,y.moveTo(E,z),y.lineTo(x,tt),y.stroke(),y.Se(),y instanceof qs&&y.ad.classList.add("gojs-td"))}},xt.kk=function(a,y,x){if(!Xt.prototype.kk.call(this,a,y,x))return!1;if(zo(this,a,this.xc,!0,!1,this.naturalBounds,this.actualBounds),x){if(this.svg.getElementsByTagName("text").length===0)return!0;for(y=this.svg.getElementsByClassName("gojs-td"),x=0;x<y.length;x++)Qy(a,y[x],!1)}else y=this.svg,y.innerHTML=this.text,Qy(a,y,!0);return!0},xt.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:Xt.prototype.nk.call(this,a)},xt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("text");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},xt.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Ns!==null&&k1!==z&&(k1=Ns.font=z),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var tt;if(isNaN(this.desiredSize.width)){if(z=this.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),z.length===0)z=8;else if(this.isMultiline){for(var ot=tt=0,rt=!1;!rt;){var at=z.indexOf(`
`,ot);at===-1&&(at=z.length,rt=!0),ot=z.substr(ot,at-ot),this.formatting===Wg&&(ot=ot.trim()),tt=Math.max(tt,Qa(ot)),ot=at+1}z=tt}else tt=z.indexOf(`
`,0),0<=tt&&(z=z.substr(0,tt)),z=Qa(z);z=Math.min(z,a/this.scale)}else z=this.desiredSize.width;if(this.panel!==null&&(z=Math.min(z,this.panel.maxSize.width)),tt=x1(this,z),isNaN(this.desiredSize.height)?tt=Math.min(tt,y/this.scale):tt=this.desiredSize.height,rt=tt,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Am&&(y=this.Ae,y=this.overflow===Am?S1(y):0,at=this.spacingAbove+this.spacingBelow,at=Math.max(0,Hg(this)+at),rt=Math.min(this.maxLines-1,Math.max(Math.floor(rt/at+.01)-1,0)),!(rt+1>=this.Qb.length))){for(this.l|=16777216,at=this.Qb[rt],y=Math.max(1,a-y);Qa(at)>y&&1<at.length;)at=at.substr(0,at.length-1);at+=Ug,y=Qa(at),this.Qb[rt]=at,this.Qb=this.Qb.slice(0,rt+1),this.Qc[rt]=y,this.Qc=this.Qc.slice(0,rt+1),this.Le=this.Qb.length,this.Cb=Math.max(this.Cb,y),this.Gc=this.Le,this.Gc===1&&(this.ze=this.Qb[0])}(this.wrap===P1||isNaN(this.desiredSize.width))&&(z=isNaN(a)?this.Cb:Math.min(a,this.Cb)),z=Math.max(x,z),tt=Math.max(E,tt),Br(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},xt.eh=function(a,y,x,E){ts(this,a,y,x,E)};function Gg(a,y,x){a.ze===null?(a.ze=y,a.Cb=x):((a.Qb===null||a.Qc===null)&&(a.Qb=[],a.Qc=[],a.Qb.push(a.ze),a.Qc.push(a.Cb)),a.Qb.push(y),a.Qc.push(x),a.Qb.length>a.maxLines&&(a.l|=16777216))}function Ev(a,y,x,E){var b=a.formatting===Wg;b&&(y=y.trim());var z=0,tt=a.Ae,ot=a.spacingAbove+a.spacingBelow;ot=Math.max(0,Hg(a)+ot);var rt=a.overflow===Am?S1(tt):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,ot);else if(tt=y,a.wrap===Nv){a.Le=1;var at=Qa(y);if(rt===0||at<=x)a.Cb=Math.max(a.Cb,at),Gg(a,y,a.Cb),E!==null&&E.h(at,ot);else{for(z=pc(a,tt),tt=tt.substr(z.length),y=pc(a,tt),at=Qa(z+y);0<y.length&&at<=x;)z+=y,tt=tt.substr(y.length),y=pc(a,tt),at=z+y,b&&(at=at.trim()),at=Qa(at);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-rt);Qa(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=Ug;var ut=Qa(z);a.Cb=ut,Gg(a,z,ut),E!==null&&E.h(ut,ot)}}else{for(rt=0,tt.length===0&&(rt=1,Gg(a,tt,0));0<tt.length;){for(y=pc(a,tt),tt=tt.substr(y.length);Qa(y)>x;){var ct=1;for(at=Qa(y.substr(0,ct)),ut=0;at<=x;)ct++,ut=at,at=Qa(y.substr(0,ct));if(ct===1){var mt=at;z=Math.max(z,at)}else mt=ut,z=Math.max(z,ut);if(ct--,1>ct&&(ct=1),Gg(a,y.substr(0,ct),mt),rt++,y=y.substr(ct),a.Gc+rt>a.maxLines)break}for(ut=pc(a,tt),at=Qa(y+ut);0<ut.length&&at<=x;)y+=ut,tt=tt.substr(ut.length),ut=pc(a,tt),at=y+ut,b&&(at=at.trim()),at=Qa(at);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),ut.length===0?(ct=at,z=Math.max(z,at)):(ct=ut=Qa(y),z=Math.max(z,ut)),Gg(a,y,ct),rt++,a.Gc+rt>a.maxLines))break}a.Le=Math.min(a.maxLines,rt),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,ot*a.Le)}}function pc(a,y){if(a.wrap===w1)return y.substr(0,1);for(var x=y.length,E=0,b=Sx;E<x&&!b.test(y.charAt(E));)E++;for(a.formatting===C1&&(x=Math.min(x,E+1));E<x&&b.test(y.charAt(E));)E++;return E>=y.length?y:y.substr(0,E)}function Qa(a){return Ns===null?8*a.length:Ns.measureText(a).width}function Hg(a){if(a.df!==null)return a.df;var y=a.Ae;if(Ns===null){var x=16;return a.df=x}return bv[y]!==void 0&&5e3>L1?x=bv[y]:(x=1.3*Ns.measureText("M").width,bv[y]=x,L1++),a.df=x}function S1(a){if(Ns===null)return 6;if(Bm[a]!==void 0&&5e3>Av)var y=Bm[a];else y=Ns.measureText(Ug).width,Bm[a]=y,Av++;return y}function x1(a,y){var x=a.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,Hg(a)+E),x.length===0)return a.Cb=0,a.Gc=1,E;if(!a.isMultiline){var b=x.indexOf(`
`,0);0<=b&&(x=x.substr(0,b))}b=0;for(var z=a.Gc=0,tt,ot=!1;!ot;){if(tt=x.indexOf(`
`,z),tt===-1&&(tt=x.length,ot=!0),z<=tt){if(z=x.substr(z,tt-z),a.wrap!==Nv){a.Le=0;var rt=Le.alloc();Ev(a,z,y,rt),b+=rt.height,Le.free(rt),a.Gc+=a.Le}else Ev(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(ot=!0)}z=tt+1}return a.Lq=b}Ie.Object.defineProperties(io.prototype,{font:{get:function(){return this.Ae},set:function(a){var y=this.Ae;y!==a&&(this.Ae=a,this.df=null,this.v(),this.g("font",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;a!=null?a=a.toString():a="",y!==a&&(this.ec=a,this.v(),this.g("text",y,a),this.Uc=!0)}},textAlign:{get:function(){return this.da!==null?this.da.Or:"start"},set:function(a){var y=this.textAlign;y===a||a!=="start"&&a!=="end"&&a!=="left"&&a!=="right"&&a!=="center"||(Ll(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:Fe},set:function(a){var y=this.flip;y!==a&&(Ll(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:bd},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Ll(this),this.da.Yr=a,ds(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=Le.alloc();Ev(this,this.ec,999999,a);var y=a.width;Le.free(a),a=x1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),Br(this.dc,y,a)}return this.dc}},isMultiline:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this.v(),this.g("isMultiline",y,a))}},isUnderline:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;y!==a&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",y,a))}},isStrikethrough:{get:function(){return(this.l&8388608)!==0},set:function(a){var y=(this.l&8388608)!==0;y!==a&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",y,a))}},wrap:{get:function(){return this.da!==null?this.da.$r:Tv},set:function(a){var y=this.wrap;y!==a&&(Ll(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:Fv},set:function(a){var y=this.overflow;y!==a&&(Ll(this),this.da.$q=a,this.v(),this.g("overflow",y,a))}},isOverflowed:{get:function(){return(this.l&16777216)!==0}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&sf(a,"TextBlock.stroke"),a instanceof Ki&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return Hg(this)}},editable:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("editable",y,a))}},textEditor:{get:function(){return this.da!==null?this.da.Qr:null},set:function(a){var y=this.textEditor;y!==a&&(Ll(this),this.da.Qr=a,this.g("textEditor",y,a))}},errorFunction:{get:function(){return this.da!==null?this.da.Hd:null},set:function(a){var y=this.errorFunction;y!==a&&(Ll(this),this.da.Hd=a,this.g("errorFunction",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new _l),this.fa.Tk=a,this.v();var x=this.panel;x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new _l),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new _l),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedFunction:{get:function(){return this.fa!==null?this.fa.F:null},set:function(a){var y=this.graduatedFunction;y!==a&&(this.fa===null&&(this.fa=new _l),this.fa.F=a,this.v(),this.g("graduatedFunction",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new _l),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}},textValidation:{get:function(){return this.da!==null?this.da.vj:null},set:function(a){var y=this.textValidation;y!==a&&(Ll(this),this.da.vj=a,this.g("textValidation",y,a))}},textEdited:{get:function(){return this.da!==null?this.da.Pr:null},set:function(a){var y=this.textEdited;y!==a&&(Ll(this),this.da.Pr=a,this.g("textEdited",y,a))}},spacingAbove:{get:function(){return this.da!==null?this.da.Dr:0},set:function(a){var y=this.spacingAbove;y!==a&&(Ll(this),this.da.Dr=a,this.v(),this.g("spacingAbove",y,a))}},spacingBelow:{get:function(){return this.da!==null?this.da.Er:0},set:function(a){var y=this.spacingBelow;y!==a&&(Ll(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:Wg},set:function(a){var y=this.formatting;y!==a&&(Ll(this),this.da.gq=a,this.v(),this.g("formatting",y,a))}},maxLines:{get:function(){return this.da!==null?this.da.Jq:1/0},set:function(a){var y=this.maxLines;y!==a&&(a=Math.floor(a),0>=a&&qn(a,"> 0",io,"maxLines"),Ll(this),this.da.Jq=a,this.v(),this.g("maxLines",y,a))}},metrics:{get:function(){return{arrSize:this.Qc!==null?this.Qc:[this.Cb],arrText:this.Qb!==null?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(a){var y=this.Gm;y!==a&&(this.Gm=a,this.g("choices",y,a))}}});var Fm=null,bm=null,Nv=new ae(io,"None",0),P1=new ae(io,"WrapFit",1),Tv=new ae(io,"WrapDesiredSize",2),w1=new ae(io,"WrapBreakAll",3),Fv=new ae(io,"OverflowClip",0),Am=new ae(io,"OverflowEllipsis",1),Wg=new ae(io,"FormatTrim",0),C1=new ae(io,"FormatNone",0),Sx=/[ \u200b\u00ad]/,bv=new Se,L1=0,Bm=new Se,Av=0,Ug="...",k1="",Ns=null,Dm=!1;io.className="TextBlock";function Bv(){this.nc=!1,this.Hd=null,this.Xf=Fe,this.gq=Wg,this.Jq=1/0,this.$q=Fv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=bd,this.$r=Tv}Bv.prototype.copy=function(){var a=new Bv;return a.Hd=this.Hd,a.Xf=this.Xf,a.gq=this.gq,a.Jq=this.Jq,a.$q=this.$q,a.Dr=this.Dr,a.Er=this.Er,a.Or=this.Or,a.Pr=this.Pr,a.Qr=this.Qr,a.vj=this.vj,a.Yr=this.Yr,a.$r=this.$r,a},io.getEllipsis=function(){return Ug},io.setEllipsis=function(a){Ug=a,Bm=new Se,Av=0},io.getBaseline=function(){return Fm},io.setBaseline=function(a){Fm=a},io.getUnderline=function(){return bm},io.setUnderline=function(a){bm=a},io.isValidFont=function(a){if(Dm||(Ns=Io?new ja(null).context:null,Dm=!0),Ns===null)return!0;var y=Ns.font;if(a===y||a==="10px sans-serif")return!0;Ns.font="10px sans-serif",Ns.font=a;var x=Ns.font;if(x!=="10px sans-serif")return Ns.font=y,!0;Ns.font="19px serif";var E=Ns.font;return Ns.font=a,x=Ns.font,Ns.font=y,x!==E},io.FormatNone=C1,io.FormatTrim=Wg,io.None=Nv,io.OverflowClip=Fv,io.OverflowEllipsis=Am,io.WrapBreakAll=w1,io.WrapDesiredSize=Tv,io.WrapFit=P1;function _l(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}_l.prototype.copy=function(){var a=new _l;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},_l.className="GradElementSettings";function Ts(a,y){Xt.call(this),this.Eg=null,this.qo="",this.Xg=Mo,this.Nk=Re,this.Zg=this.Hd=null,this.Mk=Mi,this.Xf=Fe,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,typeof a=="string"?this.source=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}var mc;ee(Ts,Xt),Ts.prototype.cloneProtected=function(a){Xt.prototype.cloneProtected.call(this,a),a.qo=this.qo,a.element=this.Eg,a.Xg=this.Xg.J(),a.Nk=this.Nk,a.Xf=this.Xf,a.Hd=this.Hd,a.Zg=this.Zg,a.Mk=this.Mk.J(),a.en=this.en,a.rl=this.rl},Ts.prototype.qb=function(a){a===Fe||a===gn||a===wi?this.imageStretch=a:Xt.prototype.qb.call(this,a)},Ts.prototype.toString=function(){return"Picture("+this.source+")#"+qt(this)};function vc(a){a===void 0&&(a=""),a!==""?mc[a]&&(delete mc[a],Om--):(mc=new Se,Om=0)}function M1(a,y){y.qy||(y.Fq=function(x){y.sq=!0,y.ln=!1;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value;b.N();var z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null)for(var ot=tt.length,rt=0;rt<ot;rt++)z=tt[rt],b.Xn.add(z),z.Uc=!0,b.$b(),y.hn&&(y.eu===void 0&&(y.eu=x),z.Zg!==null&&z.Zg(z,x))}y.Bg.clear()}a.desiredSize.w()||(nr(a,!1),a.v())},y.Yp=function(x){y.ln=x;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value,z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null){b=tt.length,z=Un();for(var ot=0;ot<b;ot++)z.push(tt[ot]);if(y.hn)for(ot=0;ot<b;ot++)tt=z[ot],tt.Hd!==null&&tt.Hd(tt,x);_n(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Ts.prototype.hA=function(){if(this.source!==""){vc(this.source);var a=this.source;this.source="",this.source=a}},Ts.prototype.redraw=function(){this.N(),this.Uc=!0},Ts.prototype.hh=function(a,y){var x=this.Eg;if(x!==null){var E=x.getAttribute("src");if(!(x instanceof HTMLImageElement&&(E===null||E==="")||x.ln instanceof Event&&a instanceof cd)){var b=a instanceof qs;E=this.naturalBounds;var z=0,tt=0,ot=this.qn,rt=ot?+x.width:x.naturalWidth;if(ot=ot?+x.height:x.naturalHeight,rt===void 0&&x.videoWidth&&(rt=x.videoWidth),ot===void 0&&x.videoHeight&&(ot=x.videoHeight),rt=rt||E.width,ot=ot||E.height,rt!==0&&ot!==0){var at=rt,ut=ot;this.sourceRect.w()&&(z=this.Xg.x,tt=this.Xg.y,rt=this.Xg.width,ot=this.Xg.height);var ct=rt,mt=ot,yt=this.Nk,St=this.Mk;switch(yt){case Fe:if(this.sourceRect.w())break;ct>=E.width&&(z=z+St.offsetX+(ct*St.x-E.width*St.x)),mt>=E.height&&(tt=tt+St.offsetY+(mt*St.y-E.height*St.y)),rt=Math.min(E.width,ct),ot=Math.min(E.height,mt);break;case Re:ct=E.width,mt=E.height;break;case gn:case wi:yt===gn?(yt=Math.min(E.height/mt,E.width/ct),ct*=yt,mt*=yt):yt===wi&&(yt=Math.max(E.height/mt,E.width/ct),ct*=yt,mt*=yt,ct>=E.width&&(z=(z+St.offsetX+(ct*St.x-E.width*St.x)/ct)*rt),mt>=E.height&&(tt=(tt+St.offsetY+(mt*St.y-E.height*St.y)/mt)*ot),rt*=1/(ct/E.width),ot*=1/(mt/E.height),ct=E.width,mt=E.height)}yt=this.Df()*y.scale;var Mt=ct*yt*mt*yt,Ot=rt*ot/Mt,bt=x.__goCache;yt=null;var jt=xx;if(!b){if(x.sq&&bt!==void 0&&4<Mt&&Ot>jt*jt)for(bt.gi===null&&(N1(bt,4,at,ut,x),N1(bt,16,at,ut,x)),b=bt.gi,at=b.length,ut=0;ut<at&&b[ut].ratio*b[ut].ratio<Ot;ut++)yt=b[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new ja(null).context;try{b.drawImage(this.Eg,0,0)}catch(Gt){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(Gt){this.vl=!0}}if(this.vl)return}}switch(b=ct<E.width?St.offsetX+(E.width*St.x-ct*St.x):0,St=mt<E.height?St.offsetY+(E.height*St.y-mt*St.y):0,this.flip){case Ei:a.translate(Math.min(E.width,ct),0),a.scale(-1,1);break;case si:a.translate(0,Math.min(E.height,mt)),a.scale(1,-1);break;case $i:a.translate(Math.min(E.width,ct),Math.min(E.height,mt)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&bt!==void 0&&yt!==null&&yt.ratio!==1){a.save(),y=yt.ratio;try{a.drawImage(yt.source,z/y,tt/y,Math.min(yt.source.width,rt/y),Math.min(yt.source.height,ot/y),b,St,Math.min(E.width,ct),Math.min(E.height,mt)),a instanceof qs&&(this.bt=[z/y,tt/y,Math.min(yt.source.width,rt/y),Math.min(yt.source.height,ot/y),b,St,Math.min(E.width,ct),Math.min(E.height,mt)])}catch(Gt){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,rt,ot,b,St,Math.min(E.width,ct),Math.min(E.height,mt)),a instanceof qs&&(this.bt=[z,tt,rt,ot,b,St,Math.min(E.width,ct),Math.min(E.height,mt)])}catch(Gt){this.en=!1}switch(this.flip){case Ei:a.scale(-1,1),a.translate(-Math.min(E.width,ct),0);break;case si:a.scale(1,-1),a.translate(0,-Math.min(E.height,mt));break;case $i:a.scale(-1,-1),a.translate(-Math.min(E.width,ct),-Math.min(E.height,mt))}}}}},Ts.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=Es(this,!0),tt=this.Eg,ot=this.qn,rt=0,at=0;(ot||!this.al&&tt&&tt.complete)&&(this.al=!0),tt===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(rt=ot?+tt.width:tt.naturalWidth,at=ot?+tt.height:tt.naturalHeight),isFinite(b.width)||z===Re||z===xn?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:tt!==null&&(a=rt)),x=0):tt!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:rt),isFinite(b.height)||z===Re||z===Nn?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:tt!==null&&(y=at)),E=0):tt!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:at),isFinite(b.width)&&(a=b.width),isFinite(b.height)&&(y=b.height),b=this.maxSize,z=this.minSize,x=Math.max(x||0,z.width),E=Math.max(E||0,z.height),a=Math.min(b.width,a),y=Math.min(b.height,y),a=Math.max(x,a),y=Math.max(E,y),tt===null||tt.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),Br(this.dc,a,y),this.Ge(0,0,a,y)},Ts.prototype.eh=function(a,y,x,E){ts(this,a,y,x,E)},Ie.Object.defineProperties(Ts.prototype,{element:{get:function(){return this.Eg},set:function(a){var y=this.Eg;if(this.Uc=!0,y!==a){this.qn=a instanceof HTMLCanvasElement;var x=a instanceof HTMLImageElement;a===null||x||a instanceof HTMLVideoElement||this.qn||de("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&Cg(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new ke),E!==null&&x&&Ph(E,this),a!==null&&(this.qn||a.complete===!0?(a.hn&&(a.ln instanceof Event&&this.Hd!==null?this.Hd(this,a.ln):a.sq===!0&&!a.ln&&this.Zg!==null&&a.eu&&this.Zg(this,a.eu)),a.sq=!0,this.desiredSize.w()||(nr(this,!1),this.v())):x&&M1(this,a)),this.g("element",y,a),this.N()}}},source:{get:function(){return this.qo},set:function(a){var y=this.qo;if(y!==a){this.Uc=!0,this.qo=a;var x=mc;if(Io){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Om&&(vc(),x=mc),E=sn("img"),E.hn=!0,M1(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,Om++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new E1),this.v(),this.N()}this.g("source",y,a)}}},sourceCrossOrigin:{get:function(){return this.rl},set:function(a){if(this.rl!==a&&(this.rl=a,this.element!==null)){var y=this.element.getAttribute("src");a===null&&typeof y=="string"?this.element.crossOrigin=null:a!==null&&(this.element.crossOrigin=a(this)),this.element.src=y}}},sourceRect:{get:function(){return this.Xg},set:function(a){var y=this.Xg;y.D(a)||(this.Xg=a=a.J(),this.N(),this.g("sourceRect",y,a))}},imageStretch:{get:function(){return this.Nk},set:function(a){var y=this.Nk;y!==a&&(this.Nk=a,this.N(),this.g("imageStretch",y,a))}},flip:{get:function(){return this.Xf},set:function(a){var y=this.Xf;y!==a&&(this.Xf=a,this.N(),this.g("flip",y,a))}},imageAlignment:{get:function(){return this.Mk},set:function(a){var y=this.Mk;y.D(a)||(this.Mk=a=a.J(),this.N(),this.g("imageAlignment",y,a))}},errorFunction:{get:function(){return this.Hd},set:function(a){var y=this.Hd;y!==a&&(this.Hd=a,this.g("errorFunction",y,a))}},successFunction:{get:function(){return this.Zg},set:function(a){var y=this.Zg;y!==a&&(this.Zg=a,this.g("successFunction",y,a))}},naturalBounds:{get:function(){return this.dc}}}),Ts.prototype.redraw=Ts.prototype.redraw,Ts.prototype.reloadSource=Ts.prototype.hA;var Om=0,xx=4;Ts.className="Picture",mc=new Se,Ts.clearCache=vc;function E1(){this.gi=null}function N1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new ja(null),tt=z.context,ot=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new T1(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),tt.setTransform(ot*x,0,0,ot*x,0,0),tt.yc(),tt.drawImage(b,0,0),a.gi.push(y))}E1.className="PictureCacheArray";function T1(a,y){this.source=a,this.ratio=y}T1.className="PictureCacheInstance";function yc(){this.os=new Xe,this.mc=null}yc.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new Xe,this.mc=null};function Sc(a,y,x,E,b,z){a.mc=new gr,a.mc.startX=y,a.mc.startY=x,a.mc.isFilled=E,a.mc.isEvenOdd=z||!1,a.os.figures.add(a.mc),b!==void 0&&(a.mc.isShadowed=b)}function Px(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}yc.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new Oi(pr);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},yc.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new Oi(ao);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function _u(a,y,x,E,b,z,tt){var ot;ot===void 0&&(ot=!1);var rt=new Oi(Rr);rt.point1X=y,rt.point1Y=x,rt.point2X=E,rt.point2Y=b,rt.endX=z,rt.endY=tt,ot&&rt.close(),a.mc.segments.add(rt)}function Im(a,y,x,E,b){var z;z===void 0&&(z=!1);var tt=new Oi(aa);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}yc.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var ot=new Oi(tr);ot.startAngle=a,ot.sweepAngle=y,ot.centerX=x,ot.centerY=E,ot.radiusX=b,ot.radiusY=z!==0?z:b,tt&&ot.close(),this.mc.segments.add(ot)};function wx(a,y,x,E,b,z,tt,ot){var rt;rt===void 0&&(rt=!1),y=new Oi(xa,tt,ot,y,x,E,b,z),rt&&y.close(),a.mc.segments.add(y)}function F1(a){var y=Rm;return y!==null?(Rm=null,y.reset(a),y):(y=new yc,y.reset(a),y)}var Rm=null;yc.className="StreamGeometryContext";function Xr(a,y){var x=a.toLowerCase(),E=Jt.Ze;E[a]=y,E[x]=a}Xr("Rectangle",function(a,y,x){a="r"+y+","+x;var E=Jt.Mf[a];return E!==void 0||(E=new Xe(Xe.u),E.endX=y,E.endY=x,Jt.Nf<Jt.vm&&(Jt.Mf[a]=E,Jt.Nf++)),E}),Xr("Square",function(a,y,x){a="s"+y+","+x;var E=Jt.Mf[a];return E!==void 0||(E=new Xe(Xe.u),E.endX=y,E.endY=x,E.defaultStretch=gn,Jt.Nf<Jt.vm&&(Jt.Mf[a]=E,Jt.Nf++)),E}),Xr("RoundedRectangle",function(a,y,x){a=a?a.parameter1:NaN,(isNaN(a)||0>a)&&(a=5),a=Math.min(a,y/3),a=Math.min(a,x/3);var E="rr"+y+","+x+","+a,b=Jt.Mf[E];if(b!==void 0)return b;var z=a*Jt.wg;return b=new Xe().add(new gr(a,0,!0).add(new Oi(ao,y-a,0)).add(new Oi(Rr,y,a,y-z,0,y,z)).add(new Oi(ao,y,x-a)).add(new Oi(Rr,y-a,x,y,x-z,y-z,x)).add(new Oi(ao,a,x)).add(new Oi(Rr,0,x-a,z,x,0,x-z)).add(new Oi(ao,0,a)).add(new Oi(Rr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new Sn(0,0,z,z),b.spot2=new Sn(1,1,-z,-z)),Jt.Nf<Jt.vm&&(Jt.Mf[E]=b,Jt.Nf++),b}),Xr("Border","RoundedRectangle"),Xr("Ellipse",function(a,y,x){a="e"+y+","+x;var E=Jt.Mf[a];return E!==void 0||(E=new Xe(Xe.F),E.endX=y,E.endY=x,E.spot1=Ff,E.spot2=Ad,Jt.Nf<Jt.vm&&(Jt.Mf[a]=E,Jt.Nf++)),E}),Xr("Circle",function(a,y,x){a="c"+y+","+x;var E=Jt.Mf[a];return E!==void 0||(E=new Xe(Xe.F),E.endX=y,E.endY=x,E.spot1=Ff,E.spot2=Ad,E.defaultStretch=gn,Jt.Nf<Jt.vm&&(Jt.Mf[a]=E,Jt.Nf++)),E}),Xr("TriangleRight",function(a,y,x){return new Xe().add(new gr(0,0).add(new Oi(ao,y,.5*x)).add(new Oi(ao,0,x).close())).pm(0,.25,.5,.75)}),Xr("TriangleDown",function(a,y,x){return new Xe().add(new gr(0,0).add(new Oi(ao,y,0)).add(new Oi(ao,.5*y,x).close())).pm(.25,0,.75,.5)}),Xr("TriangleLeft",function(a,y,x){return new Xe().add(new gr(y,x).add(new Oi(ao,0,.5*x)).add(new Oi(ao,y,0).close())).pm(.5,.25,1,.75)}),Xr("TriangleUp",function(a,y,x){return new Xe().add(new gr(y,x).add(new Oi(ao,0,x)).add(new Oi(ao,.5*y,0).close())).pm(.25,.5,.75,1)}),Xr("Triangle","TriangleUp"),Xr("Diamond",function(a,y,x){return new Xe().add(new gr(.5*y,0).add(new Oi(ao,0,.5*x)).add(new Oi(ao,.5*y,x)).add(new Oi(ao,y,.5*x).close())).pm(.25,.25,.75,.75)}),Xr("LineH",function(a,y,x){return a=new Xe(Xe.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),Xr("LineV",function(a,y,x){return a=new Xe(Xe.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),Xr("None","Rectangle"),Xr("BarH","Rectangle"),Xr("BarV","Rectangle"),Xr("MinusLine","LineH"),Xr("PlusLine",function(a,y,x){return new Xe().add(new gr(0,x/2,!1).add(new Oi(ao,y,x/2)).add(new Oi(pr,y/2,0)).add(new Oi(ao,y/2,x)))}),Xr("XLine",function(a,y,x){return new Xe().add(new gr(0,x,!1).add(new Oi(ao,y,0)).add(new Oi(pr,0,0)).add(new Oi(ao,y,x)))}),Xr("LineRight",function(a,y,x){return new Xe().add(new gr(.25*y,0,!1).add(new Oi(ao,.75*y,.5*x)).add(new Oi(ao,.25*y,x)))}),Xr("LineDown",function(a,y,x){return new Xe().add(new gr(0,.25*x,!1).add(new Oi(ao,.5*y,.75*x)).add(new Oi(ao,y,.25*x)))}),Xr("LineLeft",function(a,y,x){return new Xe().add(new gr(.75*y,0,!1).add(new Oi(ao,.25*y,.5*x)).add(new Oi(ao,.75*y,x)))}),Xr("LineUp",function(a,y,x){return new Xe().add(new gr(0,.75*x,!1).add(new Oi(ao,.5*y,.25*x)).add(new Oi(ao,y,.75*x)))}),Jt.um={"":"",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",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",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:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",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 Dv(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=Ar,this.ir=null,this.jr="",this.lr=Ir,this.Gq="",this.Hq=Sr,this.Pq=_i,this.Kq=Wi,this.Up=null,this.Cq=127,this.zr=To,this.yr="gray",this.Vg=4}Dv.prototype.copy=function(){var a=new Dv;return a.zq=this.zq,a.Kp=this.Kp,a.tr=this.tr,a.vr=this.vr,a.ur=this.ur,a.oq=this.oq,a.fr=this.fr,a.hr=this.hr,a.gr=this.gr.J(),a.ir=this.ir,a.jr=this.jr,a.lr=this.lr.J(),a.Gq=this.Gq,a.Hq=this.Hq.J(),a.Pq=this.Pq.J(),a.Kq=this.Kq.J(),a.Up=this.Up,a.Cq=this.Cq,a.zr=this.zr.J(),a.yr=this.yr,a.Vg=this.Vg,a};function Ln(a,y){a===void 0||a instanceof lr||typeof a=="string"?ze.call(this,a):(ze.call(this),a&&(y=a)),this.G=2408959,this.Tf="",this.P=null,this.Jg="",this.Qf=this.Ug=null,this.ec="",this.Ah=this.Ig=null,this.ke=new At(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new pe,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}ee(Ln,ze),Ln.prototype.cloneProtected=function(a){ze.prototype.cloneProtected.call(this,a),a.G=this.G&-4097|49152,a.Tf=this.Tf,this.P!==null&&(a.P=this.P.nc?this.P:this.P.copy()),a.Jg=this.Jg,a.Qf=null,a.ec=this.ec,a.ke.assign(this.ke),a.Ao=this.Ao},xt=Ln.prototype,xt.Af=function(a){ze.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},xt.toString=function(){var a=ti(this.constructor)+"#"+qt(this);return this.data!==null&&(a+="("+Yi(this.data)+")"),a};function Fs(a){a.P===null?a.P=new Dv:a.P.nc&&(a.P=a.P.copy())}xt.th=function(){ze.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},xt.gk=function(a,y,x,E,b,z,tt){var ot=this.diagram;ot!==null&&(a===Ko&&y==="elements"?b instanceof ze?gd(b,function(rt){ay(ot.partManager,rt),sd(ot,rt)}):Ph(ot,b):a===ar&&y==="elements"&&(b instanceof ze?gd(b,function(rt){ly(ot.partManager,rt,ot)}):Cg(ot,b)),ot.cb(a,y,x,E,b,z,tt))},xt.La=function(a){if(ze.prototype.La.call(this,a),this.data!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];b instanceof ze&&gd(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},Ln.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},Ln.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},Ln.prototype.bh=function(a,y){if(y!==null){var x=null,E=this.Qf;if(E!==null&&(x=E.I(a)),x!==y){if(x!==null){var b=x.diagram;b!==null&&b.remove(x)}E===null&&(this.Qf=E=new qe),y.Tf!==a&&(y.category=a),E.add(a,y),a=this.diagram,a!==null&&(a.add(y),a=y.adornedObject,a!==null&&(a=a.ih(),a!==null&&(y.data=a.data)))}}},Ln.prototype.Jf=function(a){var y=this.Qf;if(y!==null){var x=y.I(a);if(x!==null){var E=x.diagram;E!==null&&E.remove(x)}y.remove(a),y.count===0&&(this.Qf=null)}},Ln.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=Un();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);_n(y)}},Ln.prototype.updateAdornments=function(){var a=this.diagram;if(a!==null){for(var y=this.adornments;y.next();){var x=y.value;x.v(),x.placeholder&&x.placeholder.v()}t:{if(this.isSelected&&this.selectionAdorned&&(y=this.selectionObject,y!==null&&this.actualBounds.w()&&this.isVisible()&&y.Ed()&&y.actualBounds.w())){if(x=this.Pj("Selection"),x===null){if(x=this.selectionAdornmentTemplate,x===null&&(x=this.ph()?a.linkSelectionAdornmentTemplate:this instanceof Jn?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Ai))break t;za(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=ze.Link),x.adornedObject=y)}if(x!==null){x.type===ze.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Cx(this,a),y=this.adornments;y.next();)y.value.La()}},Ln.prototype.Wb=function(){var a=this.diagram;a!==null&&(a.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Ov(a){a.G&16384&&(a.updateAdornments(),a.G&=-16385)}function Cx(a,y){y.toolManager.mouseDownTools.each(function(x){x.isEnabled&&x.updateAdornments(a)}),y.toolManager.updateAdornments(a)}function jm(a){if(kh(a)===!1){Rv(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function b1(a){if(a.G|=2097152,kh(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||D1(a,y,x),x=a.Ib;var E=pe.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),pe.free(E),Rv(a,!1)}}Ln.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new ci);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},Ln.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Mi;this.locationSpot.sb()&&(z=this.locationSpot);var tt=At.alloc();if(this.locationObject!==this)for(y=this.locationObject,x=y.naturalBounds,tt.yi(x.x,x.y,x.width,x.height,z),y.Lb!==null&&y.Lb.Ga(tt),tt.offset(-y.measuredBounds.x,-y.measuredBounds.y),z=y.panel;z!==null&&z!==this;)z.Lb!==null&&z.Lb.Ga(tt),tt.offset(-z.measuredBounds.x,-z.measuredBounds.y),z=z.panel;else tt.yi(y,x,E,b,z);a.rotate(this.Kb,tt.x,tt.y),At.free(tt)}},Ln.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},Ln.prototype.moveTo=function(a,y,x){a=At.allocAt(a,y),this.move(a,x),At.free(a)},Ln.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(a!==null){if(!a.visible)return!1;if(a=a.diagram,a!==null&&a.animationManager.fv(this))return!0}return a=this.containingGroup,!!(a===null||a.isSubGraphExpanded&&a.isVisible())},Ln.prototype.Zb=function(a){var y=this.diagram;a?(this.C(4),this.Wb(),y!==null&&y.De.add(this)):(this.C(8),this.Ej()),this.oh(),y!==null&&(y.Ya(),y.N())},Ln.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new qe),y.I(a)!==null)return y.I(a);var x=ze.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function Gu(a,y,x,E){E===void 0&&(E=new At),x=x.Mc()?Mi:x;var b=y.naturalBounds;if(E.h(b.width*x.x+x.offsetX,b.height*x.y+x.offsetY),y===null||y===a)return E;for(y.transform.Ga(E),y=y.panel;y!==null&&y!==a;)y.transform.Ga(E),y=y.panel;return a.Lb!==null&&a.Lb.Ga(E),E.offset(-a.uc.x,-a.uc.y),E}Ln.prototype.mi=function(a){return a===void 0&&(a=new pe),a.assign(this.actualBounds)},Ln.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function A1(a){var y=At.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof ei?x.strokeWidth:0;if(y.yi(0,0,E.width+b,E.height+b,a.locationSpot),x!==a)for(y.offset(-b/2,-b/2),x.transform.Ga(y),x=x.panel;x!==null&&x!==a;)x.transform.Ga(y),x=x.panel;return a.Lb!==null&&a.Lb.Ga(y),y.offset(-a.uc.x,-a.uc.y),y}function vd(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=u1(a));var E=a.ag,b=2*E;if(!a.isShadowed)return x.h(y.x-1-E,y.y-1-E,y.width+2+b,y.height+2+b),x;E=y.x,b=y.y;var z=y.width;y=y.height;var tt=a.shadowBlur;return a=a.shadowOffset,z+=tt,y+=tt,E-=tt/2,b-=tt/2,0<a.x?z+=a.x:(E+=a.x,z-=a.x),0<a.y?y+=a.y:(b+=a.y,y-=a.y),x.h(E-1,b-1,z+2,y+2),x}Ln.prototype.arrange=function(){if(fs(this)===!1)b1(this);else{Il(this,!1);var a=this.Ib,y=pe.alloc();y.assign(a);var x=Mh(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;D1(this,E,this.location),a.ka(),a.x=E.x,a.y=E.y,a.freeze(),this.Xl(y,a),y.D(a)?this.Fd(x):!this.Zc()||Jt.B(y.width,a.width)&&Jt.B(y.height,a.height)||0<=this.vw&&this.C(16),pe.free(y),Rv(this,!1)}},xt=Ln.prototype,xt.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=pe.alloc();b.assign(x.documentBounds),b.Fv(x.padding),a.x>b.x&&a.y>b.y&&a.right<b.right&&a.bottom<b.bottom&&y.x>b.x&&y.y>b.y&&y.right<b.right&&y.bottom<b.bottom&&(E=!0),pe.free(b)}!(this.G&65536)&&a.D(y)||R1(this,E,x),x.N(),!a.w()&&!y.w()||po(a,y)||(this instanceof tn&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},xt.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&B1(this,E,a,y,x),this.pa=a,this.G&=-2097153,!this.ke.w()||E!==null&&!E.animationManager.isTicking&&E.undoManager.isUndoingRedoing||(E=this.ke,this.ke=new At(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),kh(this)===!1&&fs(this)===!1&&(jm(this),b1(this)),!0};function B1(a,y,x,E,b){y===null||a instanceof Ai||(y=y.animationManager,y.zb&&Uf(y,a,new At(E,b),x))}xt.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;kh(this)||fs(this)?b.h(NaN,NaN):b.h(b.x+a-E.x,b.y+y-E.y),E.h(a,y)}else{if(b.x===a&&b.y===y)return;E.h(E.x+a-b.x,E.y+y-b.y),b.h(a,y)}jm(this)},xt.Av=function(){this.G&=-2097153,jm(this)};function D1(a,y,x){var E=A1(a),b=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?O1(a,y,x,b,E):I1(a,y,x,b,E):z?O1(a,y,x,b,E):tt&&I1(a,y,x,b,E),a.G|=2097152,At.free(E),a.Uk()}function O1(a,y,x,E,b){var z=y.x,tt=y.y;y.h(x.x-b.x,x.y-b.y),E!==null&&(x=E.animationManager,(E=x.defaultAnimation.isAnimating)||!x.zb||a instanceof Ai||Uf(x,a,new At(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new At(z,tt),y.copy()))}function I1(a,y,x,E,b){var z=x.copy();x.h(y.x+b.x,y.y+b.y),x.D(z)||E===null||a.g("location",z,x.copy())}function R1(a,y,x){jv(a,!1),a instanceof tn&&Du(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?Mh(a)?(Vs(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}xt.si=function(){return!0},xt.Zc=function(){return!0},xt.ph=function(){return!1},xt.Dd=function(){return!0};function Iv(a,y,x,E){y.constructor===a.constructor||_1||(_1=!0,Di('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),Di(" Old class: "+ti(a.constructor)+", new class: "+ti(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,tt=a.isHighlighted,ot=!0,rt=!0,at=!1;a instanceof tn&&(ot=a.isTreeLeaf,rt=a.isTreeExpanded,at=a.wasTreeExpanded),y.Af(a),y.cloneProtected(a),a.Tf=E,a.svg!==null&&(a.svg.remove(),a.svg=null,a.Uc=!0),a.v(),a.N(),y=a.diagram,E=!0,y!==null&&(E=y.skipsUndoManager,y.skipsUndoManager=!0),a.ub=b,a.G=z?a.G|4096:a.G&-4097,a.G=tt?a.G|524288:a.G&-524289,a instanceof tn&&(a.U=ot?a.U|4:a.U&-5,a.U=rt?a.U|1:a.U&-2,a.U=at?a.U|2:a.U&-3),b!==null&&a.La(),b=a.layerName,b!==x&&(a.Jg=x,a.layerName=b),y!==null&&(y.skipsUndoManager=E),a.Zc()&&a.C(64)}Ln.prototype.canCopy=function(){if(!this.copyable)return!1;var a=this.layer;return a===null?!0:a.allowCopy?(a=a.diagram,a===null?!0:!!a.allowCopy):!1},Ln.prototype.canDelete=function(){if(!this.deletable)return!1;var a=this.layer;return a===null?!0:a.allowDelete?(a=a.diagram,a===null?!0:!!a.allowDelete):!1},Ln.prototype.canEdit=function(){if(!this.textEditable)return!1;var a=this.layer;return a===null?!0:a.allowTextEdit?(a=a.diagram,a===null?!0:!!a.allowTextEdit):!1},Ln.prototype.canGroup=function(){if(!this.groupable)return!1;var a=this.layer;return a===null?!0:a.allowGroup?(a=a.diagram,a===null?!0:!!a.allowGroup):!1},Ln.prototype.canMove=function(){if(!this.movable)return!1;var a=this.layer;return a===null?!0:a.allowMove?(a=a.diagram,a===null?!0:!!a.allowMove):!1},Ln.prototype.canReshape=function(){if(!this.reshapable)return!1;var a=this.layer;return a===null?!0:a.allowReshape?(a=a.diagram,a===null?!0:!!a.allowReshape):!1},Ln.prototype.canResize=function(){if(!this.resizable)return!1;var a=this.layer;return a===null?!0:a.allowResize?(a=a.diagram,a===null?!0:!!a.allowResize):!1},Ln.prototype.canRotate=function(){if(!this.rotatable)return!1;var a=this.layer;return a===null?!0:a.allowRotate?(a=a.diagram,a===null?!0:!!a.allowRotate):!1},Ln.prototype.canSelect=function(){if(!this.selectable)return!1;var a=this.layer;return a===null?!0:a.allowSelect?(a=a.diagram,a===null?!0:!!a.allowSelect):!1};function kh(a){return(a.G&32768)!==0}function Rv(a,y){a.G=y?a.G|32768:a.G&-32769}function jv(a,y){a.G=y?a.G|65536:a.G&-65537}function Mh(a){return(a.G&131072)!==0}xt=Ln.prototype,xt.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function zm(a,y){a.G=y?a.G|1048576:a.G&-1048577}xt.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},xt.N=function(){var a=this.diagram;a!==null&&!fs(this)&&!kh(this)&&this.isVisible()&&this.Ib.w()&&a.N(vd(this,this.Ib))},xt.v=function(){ze.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof tn&&this.labeledLink!==null&&ds(this.labeledLink),a.$b(!0))},xt.Vo=function(a){a||(a=this.Ah,a!==null&&Uv(a,this))},xt.Wo=function(a){a||(a=this.Ah,a!==null&&Vv(a,this))},xt.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},xt.oz=function(){return zv(this,this)};function zv(a,y){var x=y.containingGroup;return x!==null?1+zv(a,x):y instanceof tn&&(y=y.labeledLink,y!==null)?zv(a,y):0}xt.sz=function(){return j1(this,this)};function j1(a,y){var x=y.containingGroup;return x!==null||y instanceof tn&&(x=y.labeledLink,x!==null)?j1(a,x):y}xt.Td=function(a){return a instanceof Jn?_v(this,this,a):!1};function _v(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!_v(a,E,x)?y instanceof tn&&(y=y.labeledLink,y!==null)?_v(a,y,x):!1:!0}xt.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof Jn&&zm(y,!0),y instanceof tn){var x=y.labeledLink;x!==null&&(y=x)}y=y.containingGroup}for(x=null,y=a;y!==null;){if(y.G&1048576){x=y;break}y instanceof tn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof Jn&&zm(y,!1),y instanceof tn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},Ln.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof tn&&this.isLinkLabel)},Ln.prototype.C=function(a){if(a===void 0&&(a=16777215),this.isLayoutPositioned&&a&this.layoutConditions){var y=this.layer;y!==null&&y.isTemporary||this instanceof tn&&this.isLinkLabel?y=!1:(y=this.diagram,y=!(y!==null&&y.undoManager.isUndoingRedoing))}else y=!1;if(y)if(y=this.Ah,y!==null){var x=y.layout;x!==null?x.C():y.C(a)}else a=this.diagram,a!==null&&(a=a.layout,a!==null&&a.C())};function z1(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function Eh(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof Ai)){if(a.add(y),y instanceof tn){if(x&&y instanceof Jn)for(var tt=y.memberParts;tt.next();)Eh(a,tt.value,x,E,b,z);if(b!==!1)for(tt=y.linksConnected;tt.next();){var ot=tt.value;if(!a.contains(ot)){var rt=ot.fromNode,at=ot.toNode;rt=rt===null||a.contains(rt),at=at===null||a.contains(at),(b?rt&&at:rt||at)&&Eh(a,ot,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)Eh(a,y.value,x,E-1,b,z)}else if(y instanceof Ue)for(y=y.labelNodes;y.next();)Eh(a,y.value,x,E,b,z)}}Ie.Object.defineProperties(Ln.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?ui:this.Qf.iteratorValues}},layer:{get:function(){return this.Ig}},diagram:{get:function(){var a=this.Ig;return a==null?null:a.diagram}},layerName:{get:function(){return this.Jg},set:function(a){var y=this.Jg;if(y!==a){var x=this.diagram;if((x===null||x.Qj(a)!==null&&!x.partManager.addsToTemporaryLayer)&&(this.Jg=a,x!==null&&x.Ya(),this.g("layerName",y,a),y=this.layer,y!==null&&y.name!==a&&(x=y.diagram,x!==null&&(a=x.Qj(a),a!==null&&a!==y)))){var E=y.pc(-1,this,!0);if(0<=E&&x.cb(ar,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(Ko,"parts",a,null,this,!0,E),E=this.layerChanged,E!==null){var b=x.aa;x.aa=!0,E(this,y,a),x.aa=b}}}}},layerChanged:{get:function(){return this.P!==null?this.P.zq:null},set:function(a){var y=this.layerChanged;y!==a&&(Fs(this),this.P.zq=a,this.g("layerChanged",y,a))}},zOrder:{get:function(){return this.Ao},set:function(a){var y=this.Ao;if(y!==a){this.Ao=a;var x=this.layer;x!==null&&Kf(x,-1,this),this.g("zOrder",y,a),a=this.diagram,a!==null&&a.N()}}},locationObject:{get:function(){if(this.nf===null){var a=this.locationObjectName;a!==""?(a=this.fb(a),a!==null?this.nf=a:this.nf=this):this instanceof Ai?this.type!==ze.Link&&this.placeholder!==null?this.nf=this.placeholder:this.nf=this:this.nf=this}return this.nf.visible?this.nf:this}},minLocation:{get:function(){return this.P!==null?this.P.Pq:_i},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Fs(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Wi},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Fs(this),this.P.Kq=a,this.g("maxLocation",y,a))}},locationObjectName:{get:function(){return this.P!==null?this.P.Gq:""},set:function(a){var y=this.locationObjectName;y!==a&&(Fs(this),this.P.Gq=a,this.nf=null,this.v(),this.g("locationObjectName",y,a))}},locationSpot:{get:function(){return this.P!==null?this.P.Hq:Sr},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),Fs(this),this.P.Hq=a,this.v(),this.g("locationSpot",y,a))}},location:{get:function(){return this.ke},set:function(a){var y=a.x,x=a.y,E=this.ke;if(!(E.x===y||isNaN(E.x)&&isNaN(y))||!(E.y===x||isNaN(E.y)&&isNaN(x))){if(a=a.copy(),y=a,this.ph())y=!1;else{if(this.ke=y,this.G|=2097152,fs(this)===!1&&(jm(this),x=this.pa,x.w())){var b=this.diagram;if(b===null||b.animationManager.isTicking||!b.undoManager.isUndoingRedoing){var z=x.copy();x.h(x.x+(y.x-E.x),x.y+(y.y-E.y)),B1(this,b,x,z.x,z.y),this.g("position",z,x.copy())}}y=!0}y&&this.g("location",E,a.copy())}}},category:{get:function(){return this.Tf},set:function(a){var y=this.Tf;if(y!==a){this.svg!==null&&(this.svg.remove(),this.Uc=!0);var x=this.diagram,E=this.data,b=null;if(x!==null&&E!==null&&!(this instanceof Ai)){var z=x.model.undoManager;z.isEnabled&&!z.isUndoingRedoing&&(b=this.clone(),b.O.addAll(this.O))}this.Tf=a,this.g("category",y,a),x===null||E===null||this instanceof Ai?this instanceof Ai&&(b=this.adornedPart,b!==null&&(a=b.Qf,a!==null&&a.remove(y),b.bh(this.category,this))):(z=x.model,z.undoManager.isUndoingRedoing||(this.ph()?(x.partManager.setLinkCategoryForData(E,a),x=x.partManager.findLinkTemplateForCategory(a),x!==null&&(za(x),x=x.copy(),x!==null&&Iv(this,x,y,a))):(z!==null&&z.jm(E,a),x=dS(x.partManager,E,a),x!==null&&(za(x),x=x.copy(),x===null||x instanceof Ue||(E=this.location.copy(),Iv(this,x,y,a),this.location.w()||(this.location=E)))),b!==null&&(y=this.clone(),y.O.addAll(this.O),this.g("self",b,y))))}}},self:{get:function(){return this},set:function(a){Iv(this,a,this.category,a.category)}},copyable:{get:function(){return(this.G&1)!==0},set:function(a){var y=(this.G&1)!==0;y!==a&&(this.G^=1,this.g("copyable",y,a))}},deletable:{get:function(){return(this.G&2)!==0},set:function(a){var y=(this.G&2)!==0;y!==a&&(this.G^=2,this.g("deletable",y,a))}},textEditable:{get:function(){return(this.G&4)!==0},set:function(a){var y=(this.G&4)!==0;y!==a&&(this.G^=4,this.g("textEditable",y,a),this.Wb())}},groupable:{get:function(){return(this.G&8)!==0},set:function(a){var y=(this.G&8)!==0;y!==a&&(this.G^=8,this.g("groupable",y,a))}},movable:{get:function(){return(this.G&16)!==0},set:function(a){var y=(this.G&16)!==0;y!==a&&(this.G^=16,this.g("movable",y,a))}},selectionAdorned:{get:function(){return(this.G&32)!==0},set:function(a){var y=(this.G&32)!==0;y!==a&&(this.G^=32,this.g("selectionAdorned",y,a),this.Wb())}},isInDocumentBounds:{get:function(){return(this.G&64)!==0},set:function(a){var y=(this.G&64)!==0;if(y!==a){this.G^=64;var x=this.diagram;x!==null&&x.Ya(),this.g("isInDocumentBounds",y,a)}}},isLayoutPositioned:{get:function(){return(this.G&128)!==0},set:function(a){var y=(this.G&128)!==0;y!==a&&(this.G^=128,this.g("isLayoutPositioned",y,a),this.C(a?4:8))}},selectable:{get:function(){return(this.G&256)!==0},set:function(a){var y=(this.G&256)!==0;y!==a&&(this.G^=256,this.g("selectable",y,a),this.Wb())}},reshapable:{get:function(){return(this.G&512)!==0},set:function(a){var y=(this.G&512)!==0;y!==a&&(this.G^=512,this.g("reshapable",y,a),this.Wb())}},resizable:{get:function(){return(this.G&1024)!==0},set:function(a){var y=(this.G&1024)!==0;y!==a&&(this.G^=1024,this.g("resizable",y,a),this.Wb())}},rotatable:{get:function(){return(this.G&2048)!==0},set:function(a){var y=(this.G&2048)!==0;y!==a&&(this.G^=2048,this.g("rotatable",y,a),this.Wb())}},isSelected:{get:function(){return(this.G&4096)!==0},set:function(a){var y=(this.G&4096)!==0;if(y!==a){var x=this.diagram;if(!a||this.canSelect()&&!(x!==null&&x.selection.count>=x.maxSelectionCount)){this.G^=4096;var E=!1;if(x!==null){E=x.skipsUndoManager,x.skipsUndoManager=!0;var b=x.selection;b.ka(),a?b.add(this):b.remove(this),b.freeze()}this.g("isSelected",y,a),this.Wb(),a=this.selectionChanged,a!==null&&a(this),x!==null&&(x.$b(),x.skipsUndoManager=E)}}}},isHighlighted:{get:function(){return(this.G&524288)!==0},set:function(a){var y=(this.G&524288)!==0;if(y!==a){this.G^=524288;var x=this.diagram;x!==null&&(x=x.highlighteds,x.ka(),a?x.add(this):x.remove(this),x.freeze()),this.g("isHighlighted",y,a),this.N(),a=this.highlightedChanged,a!==null&&a(this)}}},isShadowed:{get:function(){return(this.G&8192)!==0},set:function(a){var y=(this.G&8192)!==0;y!==a&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",y,a),this.N())}},isAnimated:{get:function(){return(this.G&262144)!==0},set:function(a){var y=(this.G&262144)!==0;y!==a&&(this.G^=262144,this.g("isAnimated",y,a))}},highlightedChanged:{get:function(){return this.P!==null?this.P.oq:null},set:function(a){var y=this.highlightedChanged;y!==a&&(Fs(this),this.P.oq=a,this.g("highlightedChanged",y,a))}},selectionObjectName:{get:function(){return this.P!==null?this.P.vr:""},set:function(a){var y=this.selectionObjectName;y!==a&&(Fs(this),this.P.vr=a,this.Ug=null,this.g("selectionObjectName",y,a))}},selectionAdornmentTemplate:{get:function(){return this.P!==null?this.P.tr:null},set:function(a){var y=this.selectionAdornmentTemplate;y!==a&&(Fs(this),this.P.tr=a,this.g("selectionAdornmentTemplate",y,a))}},selectionObject:{get:function(){if(this.Ug===null){var a=this.selectionObjectName;a!==null&&a!==""?(a=this.fb(a),a!==null?this.Ug=a:this.Ug=this):this instanceof Ue?(a=this.path,a!==null?this.Ug=a:this.Ug=this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return this.P!==null?this.P.ur:null},set:function(a){var y=this.selectionChanged;y!==a&&(Fs(this),this.P.ur=a,this.g("selectionChanged",y,a))}},resizeAdornmentTemplate:{get:function(){return this.P!==null?this.P.fr:null},set:function(a){var y=this.resizeAdornmentTemplate;y!==a&&(Fs(this),this.P.fr=a,this.g("resizeAdornmentTemplate",y,a))}},resizeObjectName:{get:function(){return this.P!==null?this.P.hr:""},set:function(a){var y=this.resizeObjectName;y!==a&&(Fs(this),this.P.hr=a,this.g("resizeObjectName",y,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},resizeCellSize:{get:function(){return this.P!==null?this.P.gr:Ar},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Fs(this),this.P.gr=a,this.g("resizeCellSize",y,a))}},rotateAdornmentTemplate:{get:function(){return this.P!==null?this.P.ir:null},set:function(a){var y=this.rotateAdornmentTemplate;y!==a&&(Fs(this),this.P.ir=a,this.g("rotateAdornmentTemplate",y,a))}},rotateObjectName:{get:function(){return this.P!==null?this.P.jr:""},set:function(a){var y=this.rotateObjectName;y!==a&&(Fs(this),this.P.jr=a,this.g("rotateObjectName",y,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},rotationSpot:{get:function(){return this.P!==null?this.P.lr:Ir},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Fs(this),this.P.lr=a,this.g("rotationSpot",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;y!==a&&(this.ec=a,this.g("text",y,a))}},containingGroup:{get:function(){return this.Ah},set:function(a){if(this.Zc()){var y=this.Ah;if(y!==a){a===null||this!==a&&!a.Td(this)||(this===a&&de("Cannot make a Group a member of itself: "+this.toString()),de("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?Vv(y,this):this instanceof Jn&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Uv(a,this):this instanceof Jn&&x!==null&&x.ai.add(this),this.C(1),x!==null&&x.aa){var E=this.data,b=x.model;if(E!==null&&b.Xj()){var z=b.wa(a!==null?a.data:null);b.mp(E,z)}}if(E=this.containingGroupChanged,E!==null&&(b=!0,x!==null&&(b=x.aa,x.aa=!0),E(this,y,a),x!==null&&(x.aa=b)),this instanceof Jn){for(x=new ke,Eh(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof tn)for(E=E.linksConnected;E.next();)xc(E.value)}if(this instanceof tn){for(x=this.linksConnected;x.next();)xc(x.value);x=this.labeledLink,x!==null&&xc(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&Kf(y,-1,a))}}else de("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return this.P!==null?this.P.Kp:null},set:function(a){var y=this.containingGroupChanged;y!==a&&(Fs(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof tn&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Fs(this),this.P.Cq=a,this.g("layoutConditions",y,a))}},dragComputation:{get:function(){return this.P!==null?this.P.Up:null},set:function(a){var y=this.dragComputation;y!==a&&(Fs(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:To},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Fs(this),this.P.zr=a,this.N(),this.g("shadowOffset",y,a))}},shadowColor:{get:function(){return this.P!==null?this.P.yr:"gray"},set:function(a){var y=this.shadowColor;y!==a&&(Fs(this),this.P.yr=a,this.N(),this.g("shadowColor",y,a))}},shadowBlur:{get:function(){return this.P!==null?this.P.Vg:4},set:function(a){var y=this.shadowBlur;y!==a&&(Fs(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),Ln.prototype.invalidateLayout=Ln.prototype.C,Ln.prototype.findCommonContainingGroup=Ln.prototype.px,Ln.prototype.isMemberOf=Ln.prototype.Td,Ln.prototype.findTopLevelPart=Ln.prototype.sz,Ln.prototype.findSubGraphLevel=Ln.prototype.oz,Ln.prototype.ensureBounds=Ln.prototype.Va,Ln.prototype.getDocumentBounds=Ln.prototype.mi,Ln.prototype.findObject=Ln.prototype.fb,Ln.prototype.moveTo=Ln.prototype.moveTo,Ln.prototype.invalidateAdornments=Ln.prototype.Wb,Ln.prototype.clearAdornments=Ln.prototype.Ej,Ln.prototype.removeAdornment=Ln.prototype.Jf,Ln.prototype.addAdornment=Ln.prototype.bh,Ln.prototype.findAdornment=Ln.prototype.Pj,Ln.prototype.updateTargetBindings=Ln.prototype.La;var _1=!1;Ln.className="Part",Ln.LayoutNone=0,Ln.LayoutAdded=1,Ln.LayoutRemoved=2,Ln.LayoutShown=4,Ln.LayoutHidden=8,Ln.LayoutNodeSized=16,Ln.LayoutGroupLayout=32,Ln.LayoutNodeReplaced=64,Ln.LayoutStandard=127,Ln.LayoutAll=16777215;function Ai(a,y){a===void 0||a instanceof lr||typeof a=="string"?Ln.call(this,a):(Ln.call(this),a&&(y=a)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,y&&Object.assign(this,y)}ee(Ai,Ln),Ai.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},Ai.prototype.updateRelationshipsFromData=function(){},Ai.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof Ue&&y instanceof ei){y=x.path,x.Ul(a),a=y.geometry,x=this.O.s,y=x.length;for(var E=0;E<y;E++){var b=x[E];b.isPanelMain&&b instanceof ei&&(b.ua=a)}}},Ai.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!fs(a))},Ai.prototype.Zc=function(){return!1},Ai.prototype.gk=function(a,y,x,E,b,z,tt){if(a===Ko&&y==="elements"){if(b instanceof gs)this.$a===null&&(this.$a=b);else if(b instanceof ze){var ot=b.Nl(function(rt){return rt instanceof gs});ot instanceof gs&&this.$a===null&&(this.$a=ot)}}else a===ar&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof ze&&this.$a.rg(E)&&(this.$a=null));Ln.prototype.gk.call(this,a,y,x,E,b,z,tt)},Ai.prototype.updateAdornments=function(){},Ai.prototype.Lj=function(){},Ie.Object.defineProperties(Ai.prototype,{placeholder:{get:function(){return this.$a}},adornedObject:{get:function(){return this.ue},set:function(a){var y=this.adornedPart,x=null;a!==null&&(x=a.part),y===null||a!==null&&y===x||y.Jf(this.category),this.ue=a,x!==null&&x.bh(this.category,this)}},adornedPart:{get:function(){var a=this.ue;return a!==null?a.part:null}},containingGroup:{get:function(){return null}}}),Ai.className="Adornment";function Gv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=Tl,this.er=Hm,this.Kr=this.ij=this.Nq=this.Mq=null}Gv.prototype.copy=function(){var a=new Gv;return a.Dq=this.Dq,a.Eq=this.Eq,a.gj=this.gj,a.Vr=this.Vr,a.yp=this.yp.J(),a.er=this.er,a.Mq=this.Mq,a.Nq=this.Nq,a.ij=this.ij,a.Kr=this.Kr,a};function tn(a,y){a===void 0||a instanceof lr||typeof a=="string"?Ln.call(this,a):(Ln.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new be,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}ee(tn,Ln),tn.prototype.cloneProtected=function(a){Ln.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},xt=tn.prototype,xt.Af=function(a){Ln.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function Hu(a){a.Ba===null?a.Ba=new Gv:a.Ba.nc&&(a.Ba=a.Ba.copy())}xt.th=function(){Ln.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function G1(a,y){y!==null&&(a.af===null&&(a.af=new ke),a.af.add(y))}function H1(a,y,x,E){if(y===null||a.af===null)return null;for(var b=a.af.iterator;b.next();){var z=b.value;if(z.Ds===a&&z.cv===y&&z.Ox===x&&z.Px===E||z.Ds===y&&z.cv===a&&z.Ox===E&&z.Px===x)return z}return null}xt.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=H1(this,a,y,x),a!==null&&a.Sl()},xt.gk=function(a,y,x,E,b,z,tt){a===Ko&&y==="elements"?this.wc=null:a===ar&&y==="elements"&&(this.wc=null),Ln.prototype.gk.call(this,a,y,x,E,b,z,tt)},xt.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||($s(x.fromPort),$s(x.toPort),x.bb())}};function W1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&($s(x.fromPort),$s(x.toPort),x.bb())}}function $s(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||$s(y.port)}}xt.si=function(){return!0},tn.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},tn.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},tn.prototype.isVisible=function(){if(!Ln.prototype.isVisible.call(this))return!1;var a=!0,y=Iu,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Iu){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===er){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===rc&&(a=a?this.Oo():this.Po(),0<a.count&&a.any(function(E){return!E.isTreeExpanded})))return!1;return a=this.labeledLink,a!==null?a.isVisible():!0},tn.prototype.Zb=function(a){Ln.prototype.Zb.call(this,a);for(var y=this.linksConnected;y.next();){var x=y.value;if(a&&this.containingGroup!==null){var E=x.To(this);E===null||E.Td(this.containingGroup)||x.bb()}x.Zb(a)}},tn.prototype.qx=function(){var a=new ke,y=new ke;return U1(this,this,a,y),y.iterator};function U1(a,y,x,E){if(y!==null&&!x.has(y)){x.add(y);var b=!0,z=a.diagram;z!==null&&(b=z.isTreePathToChildren),y.linksConnected.each(function(tt){tt.isTreeLink?(b?tt.fromNode===y:tt.toNode===y)&&U1(a,b?tt.toNode:tt.fromNode,x,E):E.add(tt)})}}tn.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new fi(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},xt=tn.prototype,xt.Mo=function(a){a===void 0&&(a=null);var y=new fi(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},xt.Sd=function(a){a===void 0&&(a=null);var y=new fi(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},xt.Mu=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode===this?(a===null||b.fromPortId===a)&&(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new ke,y.add(x),y.add(b)):x=b):b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new ke,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new di(x):ui},xt.Po=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode!==this||a!==null&&b.fromPortId!==a||(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new ke,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new di(x):ui},xt.Oo=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new ke,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new di(x):ui},xt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new fi(this.jb),b=this;return E.predicate=function(z){return!((z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)&&(z.fromNode!==a||z.toNode!==b||x!==null&&z.fromPortId!==x||y!==null&&z.toPortId!==y))},E},xt.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new fi(this.jb),b=this;return E.predicate=function(z){return!(z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)},E};function _m(a,y,x){$s(x);var E=a.jb.contains(y);if(E||a.jb.add(y),!E||y.fromNode===y.toNode){var b=a.linkConnected;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,y,x),tt!==null&&(tt.aa=z)}}!E&&y.isTreeLink&&(x=y.fromNode,y=y.toNode,x!==null&&y!==null&&x!==y&&(E=!0,a=a.diagram,a!==null&&(E=a.isTreePathToChildren),b=E?y:x,z=E?x:y,b.ci||(b.ci=z),!z.isTreeLeaf||a!==null&&a.undoManager.isUndoingRedoing||(E?x===z&&(z.isTreeLeaf=!1):y===z&&(z.isTreeLeaf=!1))))}function Gm(a,y,x){$s(x);var E=a.jb.remove(y),b=null;if(E||y.toNode===y.fromNode){var z=a.linkDisconnected;if(b=a.diagram,z!==null){var tt=!0;b!==null&&(tt=b.aa,b.aa=!0),z(a,y,x),b!==null&&(b.aa=tt)}}E&&y.isTreeLink&&(x=!0,b!==null&&(x=b.isTreePathToChildren),a=x?y.toNode:y.fromNode,y=x?y.fromNode:y.toNode,a!==null&&(a.ci=!1),y===null||y.isTreeLeaf||(y.jb.count===0?(y.ci=null,b!==null&&b.undoManager.isUndoingRedoing||(y.isTreeLeaf=!0)):Vg(y)))}function Vg(a){if(a.ci=!1,a.jb.count!==0){var y=!0,x=a.diagram;if(x===null||!x.undoManager.isUndoingRedoing){for(x!==null&&(y=x.isTreePathToChildren),x=a.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink){if(y){if(E.fromNode===a){a.isTreeLeaf=!1;return}}else if(E.toNode===a){a.isTreeLeaf=!1;return}}}a.isTreeLeaf=!0}}}tn.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},xt=tn.prototype,xt.Vo=function(a){Ln.prototype.Vo.call(this,a),a||(Vg(this),a=this.Yk,a!==null&&$1(a,this))},xt.Wo=function(a){Ln.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},xt.Lj=function(){if(0<this.jb.count){var a=this.diagram;if(a!==null)for(var y=a.commandHandler!==null?a.commandHandler.deletesConnectedLinks:!0,x=this.jb.copy().iterator;x.next();){var E=x.value;y?a.remove(E):(E.fromNode===this&&(E.fromNode=null),E.toNode===this&&(E.toNode=null))}}this.labeledLink=null,Ln.prototype.Lj.call(this)},xt.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;V1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function V1(a){a.wc===null?a.wc=new qe:a.wc.clear(),a.qm(a,function(y,x){Y1(y,x)}),a.wc.count===0&&a.wc.add("",a)}function Y1(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function Hv(a,y,x){var E=y.portId;if(E!==null&&(a.wc!==null&&a.wc.remove(E),y=a.diagram,y!==null&&x)){for(x=null,a=a.findLinksConnected(E);a.next();)E=a.value,x===null&&(x=Un()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);_n(x)}}}xt.Nz=function(a){if(a===null||a===this)return!1;var y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this,y)for(;x!==a;){y=null;for(var E=x.jb.iterator;E.next();){var b=E.value;if(b.isTreeLink&&(y=b.fromNode,y!==x&&y!==this))break}if(y===this||y===null||y===x)return!1;x=y}else for(;x!==a;){for(y=null,E=x.jb.iterator;E.next()&&(b=E.value,!b.isTreeLink||(y=b.toNode,y===x||y===this)););if(y===this||y===null||y===x)return!1;x=y}return!0},xt.xz=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this,a)for(;;){a=null;for(var x=y.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink&&(a=E.fromNode,a!==y&&a!==this))break}if(a===this)return this;if(a===null||a===y)return y;y=a}else for(;;){for(a=null,x=y.jb.iterator;x.next()&&(E=x.value,!E.isTreeLink||(a=E.toNode,a===y||a===this)););if(a===this)return this;if(a===null||a===y)return y;y=a}},xt.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)zm(y,!0),y=y.pg();var x=null;for(y=a;y!==null;){if(y.G&1048576){x=y;break}y=y.pg()}for(y=this;y!==null;)zm(y,!1),y=y.pg();return x},xt.kh=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this.jb.iterator,a){for(;y.next();)if(a=y.value,a.isTreeLink&&a.fromNode!==this)return a}else for(;y.next();)if(a=y.value,a.isTreeLink&&a.toNode!==this)return a;return null},xt.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof tn)return a;a=this.diagram,a=a!==null?a.isTreePathToChildren:!0;for(var y=this.jb.iterator;y.next();){var x=y.value;if(x.isTreeLink&&(x=a?x.fromNode:x.toNode,x!==this))return this.ci=x}return this.ci=null},xt.vz=function(){function a(x,E){E.add(x);var b=x.kh();b!==null&&(E.add(b),x=x.pg(),x!==null&&a(x,E))}var y=new ke;return a(this,y),y},xt.uz=function(){return K1(this,this)};function K1(a,y){return y=y.pg(),y===null?0:1+K1(a,y)}xt.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new fi(this.jb);var x=this;return y.predicate=a?function(E){return!!(E.isTreeLink&&E.fromNode===x)}:function(E){return!!(E.isTreeLink&&E.toNode===x)},y},xt.Ou=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren);var x=y=null,E=this.jb.iterator;if(a)for(;E.next();)a=E.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,y!==null?y.add(a):x!==null&&x!==a?(y=new be,y.add(x),y.add(a)):x=a);else for(;E.next();)a=E.value,a.isTreeLink&&a.toNode===this&&(a=a.fromNode,y!==null?y.add(a):x!==null&&x!==a?(y=new be,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new di(x):ui},xt.wz=function(a){a===void 0&&(a=1/0);var y=new ke;return Eh(y,this,!1,a,!0),y},tn.prototype.collapseTree=function(a){a===void 0&&(a=1),1>a&&(a=1);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new ke;x.add(this),X1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Iu),y.Ue=!1}};function X1(a,y,x,E,b,z,tt){if(1<E)for(var ot=x?a.Mo():a.Sd();ot.next();){var rt=ot.value;rt.isTreeLink&&(rt=rt.To(a),rt===null||rt===a||y.contains(rt)||(y.add(rt),X1(rt,y,x,E-1,b,z,tt)))}else Z1(a,y,x,b,z,tt)}function Z1(a,y,x,E,b,z){for(var tt=b===a?!0:a.isTreeExpanded,ot=x?a.Mo():a.Sd(),rt={};ot.next();){var at=ot.value;if(at.isTreeLink&&(at=at.To(a),at!==null&&at!==a)){var ut=y.contains(at);if(ut||y.add(at),tt){var ct=x?at.Oo():at.Po();rt.uv=a,ct.all(function(mt){return function(yt){return yt===mt.uv||!yt.isTreeExpanded}}(rt))&&E.Aj(at,b),at.oh(),at.Zb(!1)}at.isTreeExpanded&&(at.wasTreeExpanded=at.isTreeExpanded,ut||Z1(at,y,x,E,b,z))}rt={uv:rt.uv}}a.isTreeExpanded=!1}tn.prototype.expandTree=function(a){a===void 0&&(a=2),2>a&&(a=2);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new ke;x.add(this),J1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Iu),y.Ue=!1}};function J1(a,y,x,E,b,z,tt){for(var ot=z===a?!1:a.isTreeExpanded,rt=x?a.Mo():a.Sd(),at={};rt.next();){var ut=rt.value;if(ut.isTreeLink&&(ot||ut.fd||ut.bb(),ut=ut.To(a),ut!==null&&ut!==a&&!y.contains(ut))){if(y.add(ut),!ot){ut.Zb(!0),ut.oh();var ct=x?ut.Oo():ut.Po();at.vv=a,ct.all(function(mt){return function(yt){return yt===mt.vv||!yt.isTreeExpanded}}(at))&&b.Cj(ut,z)}(2<E||ut.wasTreeExpanded)&&(ut.wasTreeExpanded=!1,J1(ut,y,x,E-1,b,z,tt))}at={vv:at.vv}}a.isTreeExpanded=!0}Ie.Object.defineProperties(tn.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Hm},set:function(a){var y=this.portSpreading;y!==a&&(Hu(this),this.Ba.er=a,this.g("portSpreading",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return(this.U&8)!==0},set:function(a){var y=(this.U&8)!==0;if(y!==a){this.U^=8;var x=this.diagram;x!==null&&Du(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:Tl},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),Hu(this),this.Ba.yp=a;var x=this.diagram;x!==null&&Du(x,this),this.g("avoidableMargin",y,a)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return this.Ba!==null?this.Ba.Dq:null},set:function(a){var y=this.linkConnected;y!==a&&(Hu(this),this.Ba.Dq=a,this.g("linkConnected",y,a))}},linkDisconnected:{get:function(){return this.Ba!==null?this.Ba.Eq:null},set:function(a){var y=this.linkDisconnected;y!==a&&(Hu(this),this.Ba.Eq=a,this.g("linkDisconnected",y,a))}},linkValidation:{get:function(){return this.Ba!==null?this.Ba.gj:null},set:function(a){var y=this.linkValidation;y!==a&&(Hu(this),this.Ba.gj=a,this.g("linkValidation",y,a))}},isLinkLabel:{get:function(){return this.Yk!==null}},labeledLink:{get:function(){return this.Yk},set:function(a){var y=this.Yk;if(y!==a){var x=this.diagram,E=this.data;if(y!==null){if(y.wd!==null&&(y.wd.remove(this),y.v()),x!==null&&E!==null&&!x.undoManager.isUndoingRedoing){var b=y.data,z=x.model;if(b!==null&&z.ri()){var tt=z.wa(E);tt!==void 0&&z.Qx(b,tt)}}this.containingGroup=null}this.Yk=a,a!==null&&($1(a,this),x===null||E===null||x.undoManager.isUndoingRedoing||(b=a.data,x=x.model,b!==null&&x.ri()&&(E=x.wa(E),E!==void 0&&x.Bu(b,E))),this.containingGroup=a.containingGroup),ds(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&V1(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return(this.U&1)!==0},set:function(a){var y=(this.U&1)!==0;if(y!==a){this.U^=1;var x=this.diagram;if(this.g("isTreeExpanded",y,a),y=this.treeExpandedChanged,y!==null){var E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?this.Zb(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return(this.U&2)!==0},set:function(a){var y=(this.U&2)!==0;y!==a&&(this.U^=2,this.g("wasTreeExpanded",y,a))}},treeExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Vr:null},set:function(a){var y=this.treeExpandedChanged;y!==a&&(Hu(this),this.Ba.Vr=a,this.g("treeExpandedChanged",y,a))}},isTreeLeaf:{get:function(){return(this.U&4)!==0},set:function(a){var y=(this.U&4)!==0;y!==a&&(this.U^=4,this.g("isTreeLeaf",y,a))}}}),tn.prototype.expandTree=tn.prototype.expandTree,tn.prototype.collapseTree=tn.prototype.collapseTree,tn.prototype.findTreeParts=tn.prototype.wz,tn.prototype.findTreeChildrenNodes=tn.prototype.Ou,tn.prototype.findTreeChildrenLinks=tn.prototype.Qo,tn.prototype.findTreeLevel=tn.prototype.uz,tn.prototype.findTreeParentChain=tn.prototype.vz,tn.prototype.findTreeParentNode=tn.prototype.pg,tn.prototype.findTreeParentLink=tn.prototype.kh,tn.prototype.findCommonTreeParent=tn.prototype.gz,tn.prototype.findTreeRoot=tn.prototype.xz,tn.prototype.isInTreeOf=tn.prototype.Nz,tn.prototype.findPort=tn.prototype.ns,tn.prototype.findLinksTo=tn.prototype.kz,tn.prototype.findLinksBetween=tn.prototype.jz,tn.prototype.findNodesInto=tn.prototype.Oo,tn.prototype.findNodesOutOf=tn.prototype.Po,tn.prototype.findNodesConnected=tn.prototype.Mu,tn.prototype.findLinksInto=tn.prototype.Sd,tn.prototype.findLinksOutOf=tn.prototype.Mo,tn.prototype.findExternalTreeLinksConnected=tn.prototype.qx,tn.prototype.invalidateConnectedLinks=tn.prototype.Bd,tn.prototype.invalidateLinkBundle=tn.prototype.Lz;var Lx=new ae(tn,"SpreadingNone",10),Hm=new ae(tn,"SpreadingEvenly",11),Wv=new ae(tn,"SpreadingPacked",12);tn.className="Node",tn.SpreadingNone=Lx,tn.SpreadingEvenly=Hm,tn.SpreadingPacked=Wv;function Jn(a,y){a===void 0||a instanceof lr||typeof a=="string"?tn.call(this,a):(tn.call(this),a&&(y=a)),this.U|=4608,this.Gn=new ke,this.$a=null,this.Sc=new xo,this.Sc.group=this,this.gl=new ke,this.tb=this.$p=null,y&&Object.assign(this,y)}ee(Jn,tn),Jn.prototype.cloneProtected=function(a){tn.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof gs});y instanceof gs?a.$a=y:a.$a=null,this.Sc!==null?(a.Sc=this.Sc.copy(),a.Sc.group=a):(a.Sc!==null&&(a.Sc.group=null),a.Sc=null),this.tb!==null&&(a.tb=this.tb.copy())},xt=Jn.prototype,xt.Af=function(a){tn.prototype.Af.call(this,a);var y=a.Rj();for(a=a.memberParts;a.next();){var x=a.value;if(x.v(),x.C(8),x.Ej(),x instanceof tn)x.Bd(y);else if(x instanceof Ue)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},xt.gk=function(a,y,x,E,b,z,tt){if(a===Ko&&y==="elements"){if(b instanceof gs)this.$a===null?this.$a=b:this.$a!==b&&de("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof ze){var ot=b.Nl(function(rt){return rt instanceof gs});ot instanceof gs&&(this.$a===null?this.$a=ot:this.$a!==ot&&de("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===ar&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof ze&&this.$a.rg(E)&&(this.$a=null));tn.prototype.gk.call(this,a,y,x,E,b,z,tt)},xt.Xl=function(a,y){tn.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==ze.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof ze&&(a=a.Pb()),this.tb===null&&(this.tb=new pe),a.mi(this.tb),a instanceof ei&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},xt.eh=function(a,y,x,E){this.nf=this.$a,tn.prototype.eh.call(this,a,y,x,E)},xt.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof Ue||y.Va()}),tn.prototype.Va.call(this)},xt.si=function(){if(!tn.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof tn){if(y.isVisible()&&fs(y))return!1}else if(y instanceof Ue&&y.isVisible()&&fs(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Uv(a,y){if(a.Gn.add(y)){y instanceof Jn&&a.gl.add(y);var x=a.memberAdded;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!1)}y instanceof Ue&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Vv(a,y){if(a.Gn.remove(y)){y instanceof Jn&&a.gl.remove(y);var x=a.memberRemoved;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!0)}y instanceof Ue&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}xt.Lj=function(){if(0<this.Gn.count){var a=this.diagram;if(a!==null)for(var y=this.Gn.copy().iterator;y.next();)a.remove(y.value)}tn.prototype.Lj.call(this)},Jn.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=ce(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},Jn.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=ce(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},Jn.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;return a===null||!a.allowUngroup?!1:(a=a.diagram,!!(a===null||a.allowUngroup))},xt=Jn.prototype,xt.Bd=function(a){var y=(this.U&65536)!==0;if(tn.prototype.Bd.call(this,a),!y)for(!(this.U&65536)&&(this.U=this.U^65536),y=this.Lu();y.next();){var x=y.value;if(a===void 0||!a.contains(x)){var E=x.fromNode;E!==null&&E!==this&&E.Td(this)&&!E.isVisible()?($s(x.fromPort),$s(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&($s(x.fromPort),$s(x.toPort),x.bb()))}}},xt.Lu=function(){var a=this.diagram!==null&&this.diagram.Pw;if(a&&this.$p!==null)return this.$p.iterator;var y=this.Rj();y.add(this);for(var x=new ke,E=y.iterator;E.next();){var b=E.value;if(b instanceof tn)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},xt.iz=function(){var a=this.Rj();a.add(this);for(var y=new ke,x=a.iterator;x.next();){var E=x.value;if(E instanceof tn)for(E=E.linksConnected;E.next();){var b=E.value,z=b.fromNode;z===null||a.contains(z)&&z!==this||y.add(z),b=b.toNode,b===null||a.contains(b)&&b!==this||y.add(b)}}return y.iterator},xt.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new ke;return a(this,y),y},xt.Rj=function(){var a=new ke;return Eh(a,this,!0,0,!0),a.remove(this),a},xt.Zb=function(a){tn.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},Jn.prototype.collapseSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();Q1(this,y,a,this),a.Ue=!1}};function Q1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!1),z instanceof Jn&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,Q1(z,y,x,E)),z instanceof tn)z.Bd(y),x.Aj(z,E);else if(z instanceof Ue)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}Jn.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();q1(this,y,a,this),a.Ue=!1}};function q1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof Jn&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,q1(z,y,x,E)),z instanceof tn)z.Bd(y),x.Cj(z,E);else if(z instanceof Ue)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}Jn.prototype.move=function(a,y){y===void 0&&(y=!1);var x=y?this.location:this.position,E=x.x;x=x.y;var b=a.x,z=a.y;if(!(E===b||isNaN(E)&&isNaN(b))||!(x===z||isNaN(x)&&isNaN(z))){for(E=b-(isNaN(E)?0:E),x=z-(isNaN(x)?0:x),z=At.alloc(),tn.prototype.move.call(this,a,y),a=new ke,y=this.Rj().iterator;y.next();)b=y.value,b instanceof Ue&&(b.suspendsRouting&&a.add(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(b.suspendsRouting=!0);for(y.reset();y.next();)if(b=y.value,!(b.ph()||b instanceof tn&&b.isLinkLabel)){var tt=b.position,ot=b.location;tt.w()?(z.x=tt.x+E,z.y=tt.y+x,b.position=z):ot.w()&&(z.x=ot.x+E,z.y=ot.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof Ue&&(b.suspendsRouting=a.contains(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(tt=b.position,z.x=tt.x+E,z.y=tt.y+x,z.w()?b.move(z):b.bb(),Kv(b)&&b.bb());At.free(z)}},Ie.Object.defineProperties(Jn.prototype,{placeholder:{get:function(){return this.$a}},computesBoundsAfterDrag:{get:function(){return(this.U&2048)!==0},set:function(a){var y=(this.U&2048)!==0;y!==a&&(this.U^=2048,this.g("computesBoundsAfterDrag",y,a))}},computesBoundsIncludingLinks:{get:function(){return(this.U&4096)!==0},set:function(a){var y=(this.U&4096)!==0;y!==a&&(this.U^=4096,this.g("computesBoundsIncludingLinks",y,a))}},computesBoundsIncludingLocation:{get:function(){return(this.U&8192)!==0},set:function(a){var y=(this.U&8192)!==0;y!==a&&(this.U^=8192,this.g("computesBoundsIncludingLocation",y,a))}},handlesDragDropForMembers:{get:function(){return(this.U&16384)!==0},set:function(a){var y=(this.U&16384)!==0;y!==a&&(this.U^=16384,this.g("handlesDragDropForMembers",y,a))}},memberParts:{get:function(){return this.Gn.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;if(y!==a){a!==null&&a.diagram!==null&&a.diagram.layout===a&&de("A layout cannot be both the Diagram.layout and a Group.layout: "+a),y!==null&&(y.diagram=null,y.group=null),this.Sc=a;var x=this.diagram;a!==null&&(a.diagram=x,a.group=this),x!==null&&(x.xh=!0),this.g("layout",y,a),x!==null&&x.$b()}}},memberAdded:{get:function(){return this.Ba!==null?this.Ba.Mq:null},set:function(a){var y=this.memberAdded;y!==a&&(Hu(this),this.Ba.Mq=a,this.g("memberAdded",y,a))}},memberRemoved:{get:function(){return this.Ba!==null?this.Ba.Nq:null},set:function(a){var y=this.memberRemoved;y!==a&&(Hu(this),this.Ba.Nq=a,this.g("memberRemoved",y,a))}},memberValidation:{get:function(){return this.Ba!==null?this.Ba.ij:null},set:function(a){var y=this.memberValidation;y!==a&&(Hu(this),this.Ba.ij=a,this.g("memberValidation",y,a))}},ungroupable:{get:function(){return(this.U&256)!==0},set:function(a){var y=(this.U&256)!==0;y!==a&&(this.U^=256,this.g("ungroupable",y,a))}},isSubGraphExpanded:{get:function(){return(this.U&512)!==0},set:function(a){var y=(this.U&512)!==0;if(y!==a){this.U^=512;var x=this.diagram;if(this.g("isSubGraphExpanded",y,a),y=this.subGraphExpandedChanged,y!==null){var E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?(this.$a!==null&&this.$a.v(),this.memberParts.each(function(b){b.updateAdornments()})):a?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return(this.U&1024)!==0},set:function(a){var y=(this.U&1024)!==0;y!==a&&(this.U^=1024,this.g("wasSubGraphExpanded",y,a))}},subGraphExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Kr:null},set:function(a){var y=this.subGraphExpandedChanged;y!==a&&(Hu(this),this.Ba.Kr=a,this.g("subGraphExpandedChanged",y,a))}},rh:{get:function(){return(this.U&32768)!==0},set:function(a){(this.U&32768)!==0!==a&&(this.U^=32768)}}}),Jn.prototype.expandSubGraph=Jn.prototype.expandSubGraph,Jn.prototype.collapseSubGraph=Jn.prototype.collapseSubGraph,Jn.prototype.findSubGraphParts=Jn.prototype.Rj,Jn.prototype.findContainingGroupChain=Jn.prototype.hz,Jn.prototype.findExternalNodesConnected=Jn.prototype.iz,Jn.prototype.findExternalLinksConnected=Jn.prototype.Lu,Jn.prototype.ensureBounds=Jn.prototype.Va,Jn.className="Group";function gs(a){Xt.call(this),this.yb=Ys,this.ko=new pe(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}ee(gs,Xt),gs.prototype.cloneProtected=function(a){Xt.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},gs.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return $o(0,0,y.width,y.height,a.x,a.y)},gs.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof Jn||a instanceof Ai)||de("Placeholder is not inside a Group or Adornment."),a instanceof Jn){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(Br(E,(isFinite(x.width)?Math.max(x.width,y.width):y.width)||0,(isFinite(x.height)?Math.max(x.height,y.height):y.height)||0),this.Ge(0,0,E.width,E.height),E=a.memberParts,x=!1;E.next();)if(E.value.isVisible()){x=!0;break}E=a.diagram,!x||E===null||E.animationManager.Xu(a)||isNaN(y.x)||isNaN(y.y)||(x=At.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),At.free(x))}else{y=this.dc,x=this.yb,E=x.left+x.right;var b=x.top+x.bottom,z=a.adornedObject;a.angle=z.li();var tt=0;z instanceof ei&&(tt=z.strokeWidth);var ot=z.Df(),rt=z.naturalBounds,at=(rt.width+tt)*ot;tt=(rt.height+tt)*ot,a.type!==ze.Link&&(ot=z.ga(a.category==="Selection"?Sr:a.locationSpot,At.alloc()),a.location=ot,At.free(ot)),isNaN(at)||isNaN(tt)?(a=z.ga(Sr,At.alloc()),at=pe.allocAt(a.x,a.y,0,0),at.Ye(z.ga(ya,a)),at.Ye(z.ga(qi,a)),at.Ye(z.ga(rs,a)),Br(y,at.width+E||0,at.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),At.free(a),pe.free(at)):(Br(y,at+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},gs.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},gs.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof Jn&&!y.layer.isTemporary&&y.computesBoundsAfterDrag&&this.ko.w()){var b=x.toolManager.findTool("Dragging");if(b===x.currentTool&&(x=b.computeBorder(y,this.ko,a),x!==null))return x}x=pe.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof Jn&&!y.isSubGraphExpanded?a.h(b.x-z.left,b.y-z.top,0,0):a.h(b.x-z.left,b.y-z.top,Math.max(b.width+z.left+z.right,0),Math.max(b.height+z.top+z.bottom,0)),pe.free(x),E&&y instanceof Jn&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},gs.prototype.computeMemberBounds=function(a){if(!(this.part instanceof Jn))return a.h(0,0,0,0),a;for(var y=this.part,x=1/0,E=1/0,b=-1/0,z=-1/0,tt=y.memberParts;tt.next();){var ot=tt.value;if(ot.isVisible()){if(ot instanceof Ue&&(!y.computesBoundsIncludingLinks||da(ot)||ot.fromNode===y||ot.toNode===y))continue;ot=ot.actualBounds,ot.left<x&&(x=ot.left),ot.top<E&&(E=ot.top),ot.right>b&&(b=ot.right),ot.bottom>z&&(z=ot.bottom)}}return isFinite(x)&&isFinite(E)?a.h(x,E,b-x,z-E):(y=y.location,a.h(y.x,y.y,0,0)),a},Ie.Object.defineProperties(gs.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new On(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),gs.className="Placeholder";function Ue(a){Ln.call(this,ze.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=ps,this.Om=0,this.Qm=ps,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new be().freeze(),this.Tg=this.Mg=null,this.ml=new pe,this.ua=new Xe,this.u=this.o=this.Sf=this.Wf=null,this.su=new At,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}ee(Ue,Ln),Ue.prototype.cloneProtected=function(a){Ln.prototype.cloneProtected.call(this,a),a.Qa=this.Qa&-113,a.ff=this.ff,a.gn=this.gn,a.vf=this.vf,a.uo=this.uo,a.qk=this.qk,a.Om=this.Om,a.Qm=this.Qm,a.Rm=this.Rm,a.qj=this.qj,a.po=this.po,this.ba!==null&&(a.ba=this.ba.copy())},xt=Ue.prototype,xt.Af=function(a){Ln.prototype.Af.call(this,a),this.ff=a.ff,this.vf=a.vf,a.Mg=null,a.bb(),a.Sf=this.Sf;var y=a.fromPort;y!==null&&$s(y),a=a.toPort,a!==null&&$s(a)},xt.qb=function(a){a.classType===Ue?(a.value&2)===2?this.routing=a:a===ca||a===Uu||a===wc?this.curve=a:a===Xg||a===Xm||a===Zm?this.adjusting=a:a!==Jv&&a!==ps&&de("Unknown Link enum value for a Link property: "+a):Ln.prototype.qb.call(this,a)},xt.Xc=function(){this.ba===null&&(this.ba=new Dg)},xt.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),fs(a)||kh(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),fs(a)||kh(a)))},xt.zv=function(){return!1},xt.Av=function(){},xt.Zc=function(){return!1},Ue.prototype.computeAngle=function(a,y,x){return Ue.computeAngle(y,x)},Ue.computeAngle=function(a,y){switch(a){default:case ps:a=0;break;case Zg:a=y;break;case Jg:a=y+90;break;case Qg:a=y-90;break;case Qv:a=y+180;break;case Jm:a=Jt.bp(y),90<a&&270>a&&(a-=180);break;case qg:a=Jt.bp(y+90),90<a&&270>a&&(a-=180);break;case $g:a=Jt.bp(y-90),90<a&&270>a&&(a-=180);break;case Qm:if(a=Jt.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return Jt.bp(a)};function xc(a){var y=a.fromNode,x=a.toNode,E=null;if(y!==null?E=x!==null?y.px(x):y.containingGroup:x!==null?E=x.containingGroup:E=null,y=E,x=a.Ah,x!==y){x!==null&&Vv(x,a),a.Ah=y,y!==null&&Uv(y,a);var b=a.containingGroupChanged;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,x,y),tt!==null&&(tt.aa=z)}!a.fd||a.Lw!==x&&a.Mw!==x||a.bb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=E}xt=Ue.prototype,xt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&Ln.prototype.oh.call(this)},xt.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},xt.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function $1(a,y){a.wd===null&&(a.wd=new ke),a.wd.add(y),a.v()}xt.Vo=function(a){if(Ln.prototype.Vo.call(this,a),yd(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,_m(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||_m(x,this,E)}Yg(this)}},xt.Wo=function(a){if(Ln.prototype.Wo.call(this,a),yd(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Gm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Gm(x,this,E)}Kg(this)}},xt.Lj=function(){if(this.fd=!0,this.wd!==null){var a=this.diagram;if(a!==null)for(var y=this.wd.copy().iterator;y.next();)a.remove(y.value)}this.data!==null&&(a=this.diagram,a!==null&&a.partManager.removeDataForLink(this))},Ue.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},Ue.prototype.move=function(a,y){var x=y?this.location:this.position,E=x.x;isNaN(E)&&(E=0);var b=x.y;for(isNaN(b)&&(b=0),E=a.x-E,b=a.y-b,y===!0?Ln.prototype.move.call(this,a,!1):(a=At.allocAt(x.x+E,x.y+b),Ln.prototype.move.call(this,a,!1),At.free(a)),Wu(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},Ue.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},Ue.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},Ue.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(lo),a;if(y===1)return a.assign(this.i(0)),a;if(y===2){var x=this.i(0),E=this.i(1);return a.h((x.x+E.x)/2,(x.y+E.y)/2),a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===ca))return this.ua.Pu(.5,a),a.add(this.i(0)),x=this.ua.figures.first(),a.offset(-x.startX,-x.startY),a;if(this.computeCurve()===ca){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return Jt.ax(x.x,x.y,E.x,E.y,E.x,E.y,b.x,b.y,a),a}if(E=(y-1)/3|0,x=3*(E/2|0),E%2===1){E=this.i(x),b=this.i(x+1);var z=this.i(x+2);x=this.i(x+3),Jt.ax(E.x,E.y,b.x,b.y,z.x,z.y,x.x,x.y,a)}else a.assign(this.i(x));return a}var tt=this.flattenedLengths;for(x=this.flattenedTotalLength,b=z=E=0;E<x/2&&z<y&&(b=tt[z],!(E+b>x/2));)E+=b,z++;return y=this.i(z),z=this.i(z+1),1>Math.abs(y.x-z.x)?y.y>z.y?a.h(y.x,y.y-(x/2-E)):a.h(y.x,y.y+(x/2-E)):1>Math.abs(y.y-z.y)?y.x>z.x?a.h(y.x-(x/2-E),y.y):a.h(y.x+(x/2-E),y.y):(x=(x/2-E)/b,a.h(y.x+x*(z.x-y.x),y.y+x*(z.y-y.y))),a},Ue.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(a===2)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===ca))return this.ua.wx(.5);if(this.computeCurve()===ca&&4<=a){var y=(a-1)/3|0,x=3*(y/2|0);if(y%2===1){x=Math.floor(x),a=this.i(x),y=this.i(x+1);var E=this.i(x+2);return x=this.i(x+3),Jt.My(a.x,a.y,y.x,y.y,E.x,E.y,x.x,x.y)}if(0<x&&x+1<a)return this.i(x-1).ab(this.i(x+1))}y=this.flattenedLengths,E=this.flattenedTotalLength;var b=0;x=0;for(var z;b<E/2&&x<a&&(z=y[x],!(b+z>E/2));)b+=z,x++;if(y=this.i(x),E=this.i(x+1),1>Math.abs(y.x-E.x)&&1>Math.abs(y.y-E.y)){if(0<x&&x+2<a)return this.i(x-1).ab(this.i(x+2))}else{if(1>Math.abs(y.x-E.x))return y.y>E.y?270:90;if(1>Math.abs(y.y-E.y))return y.x>E.x?180:0}return y.ab(E)},xt=Ue.prototype,xt.i=function(a){return this.Nb.s[a]},xt.dd=function(a,y){this.Nb.cd(a,y)},xt.L=function(a,y,x){this.Nb.cd(a,new At(y,x))},xt.Kz=function(a,y){this.Nb.Gb(a,y)},xt.m=function(a,y,x){this.Nb.Gb(a,new At(y,x))},xt.ne=function(a){this.Nb.add(a)},xt.yf=function(a,y){this.Nb.add(new At(a,y))},xt.pv=function(a){this.Nb.mb(a)},xt.Fj=function(){this.Nb.clear()};function Wu(a,y,x){if(y!==0||x!==0)if(a.pointsCount===0)a.defaultFromPoint&&a.defaultFromPoint.offset(y,x),a.defaultToPoint&&a.defaultToPoint.offset(y,x);else{for(var E=a.fd,b=new be,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new At(tt.x+y,tt.y+x).freeze())}b.freeze(),z=a.Nb,a.Nb=b,tt=a.diagram,isNaN(y)||isNaN(x)||tt!==null&&tt.animationManager.zb?a.v():(a.ke.h(a.ke.x+y,a.ke.y+x),a.pa.h(a.pa.x+y,a.pa.y+x),ds(a)),E?Wm(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),tt!==null&&tt.animationManager.zb&&Yf(tt.animationManager,a,b),a.g("points",z,b)}}xt.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},xt.zf=function(){if(this.Mg!==null){for(var a=this.Mg,y=this.Nb,x=1/0,E=1/0,b=a.s,z=b.length,tt=0;tt<z;tt++){var ot=b[tt];x=Math.min(ot.x,x),E=Math.min(ot.y,E)}ot=tt=1/0;for(var rt=y.s,at=rt.length,ut=0;ut<at;ut++){var ct=rt[ut];tt=Math.min(ct.x,tt),ot=Math.min(ct.y,ot),ct.freeze()}if(y.freeze(),at===z){for(z=0;z<at;z++)if(ut=b[z],ct=rt[z],ut.x-x!==ct.x-tt||ut.y-E!==ct.y-ot){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&Yf(x.animationManager,this,y),Wm(this),this.g("points",a,y)}},xt.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Wm(a){a.Nb.count===0?a.fd=!1:(a.fd=!0,a.cq=null,a.vt=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),Km(a,!1))}xt.bb=function(){if(!this.suspendsRouting){var a=this.diagram;if(a){if(a.As.contains(this)||a.undoManager.isUndoingRedoing||(a=a.animationManager,a.isTicking&&!a.isAnimating))return;this.Tg===null||a.isTicking||(this.Tg=null)}a=this.path,a!==null&&(this.fd=!1,this.v(),a.v())}},xt.vg=function(){if(!this.fd&&!this.computingPoints){var a=!0;try{this.computingPoints=!0,this.uh(),a=this.computePoints()}catch(y){this.computingPoints=!1,this.rv()}finally{this.computingPoints=!1,a?this.zf():this.rv()}}},Ue.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(uf||(uf=new tn,uf.desiredSize=gi,uf.Va()),this.defaultFromPoint&&(uf.location=this.defaultFromPoint,uf.Va(),y=a=uf)):y=this.fromPort,y!==null&&!a.isVisible()){var x=a.findVisibleNode();x!==null&&x!==a?(a=x,y=x.port):a=x}if(this.Lw=a,a===null||!a.location.w())return!1;for(;!(y===null||y.actualBounds.w()&&y.Ed());)y=y.panel;if(y===null)return!1;var E=this.toNode,b=null;if(E===null?(hf||(hf=new tn,hf.desiredSize=gi,hf.Va()),this.defaultToPoint&&(hf.location=this.defaultToPoint,hf.Va(),b=E=hf)):b=this.toPort,b===null||E.isVisible()||(x=E.findVisibleNode(),x!==null&&x!==E?(E=x,b=x.port):E=x),this.Mw=E,E===null||!E.location.w())return!1;for(;!(b===null||b.actualBounds.w()&&b.Ed());)b=b.panel;if(b===null)return!1;var z=this.pointsCount,tt=this.computeSpot(!0,y);x=this.computeSpot(!1,b);var ot=Pc(tt),rt=Pc(x),at=y===b&&y!==null,ut=this.isOrthogonal,ct=this.curve===ca;this.Wf=at&&!ut?ct=!0:!1;var mt=this.computeAdjusting()===ps||at;if(!ut&&!at&&ot&&rt){if(ot=!1,!mt&&3<=z&&(mt=this.getLinkPoint(a,y,tt,!0,!1,E,b),rt=this.getLinkPoint(E,b,x,!1,!1,a,y),ot=this.adjustPoints(0,mt,z-1,rt))&&(mt=this.getLinkPoint(a,y,tt,!0,!1,E,b),rt=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,mt,z-1,rt)),!ot)if(this.Fj(),ct){z=this.getLinkPoint(a,y,tt,!0,!1,E,b),mt=this.getLinkPoint(E,b,x,!1,!1,a,y),ot=mt.x-z.x,rt=mt.y-z.y,at=this.computeCurviness(),ct=ut=0;var yt=z.x+ot/3,St=z.y+rt/3,Mt=yt,Ot=St;Jt.B(rt,0)?Ot=0<ot?Ot-at:Ot+at:(ut=-ot/rt,ct=Math.sqrt(at*at/(ut*ut+1)),0>at&&(ct=-ct),Mt=(0>rt?-1:1)*ct+yt,Ot=ut*(Mt-yt)+St),yt=z.x+2*ot/3,St=z.y+2*rt/3;var bt=yt,jt=St;Jt.B(rt,0)?jt=0<ot?jt-at:jt+at:(bt=(0>rt?-1:1)*ct+yt,jt=ut*(bt-yt)+St),this.Fj(),this.ne(z),this.yf(Mt,Ot),this.yf(bt,jt),this.ne(mt),this.dd(0,this.getLinkPoint(a,y,tt,!0,!1,E,b)),this.dd(3,this.getLinkPoint(E,b,x,!1,!1,a,y))}else z=E,mt=b,E=this.getLinkPoint(a,y,tt,!0,!1,z,mt),b=this.getLinkPoint(z,mt,x,!1,!1,a,y),this.hasCurviness()?(mt=b.x-E.x,x=b.y-E.y,tt=this.computeCurviness(),a=E.x+mt/2,y=E.y+x/2,z=a,ot=y,Jt.B(x,0)?ot=0<mt?ot-tt:ot+tt:(mt=-mt/x,z=Math.sqrt(tt*tt/(mt*mt+1)),0>tt&&(z=-z),z=(0>x?-1:1)*z+a,ot=mt*(z-a)+y),this.ne(E),this.yf(z,ot),this.ne(b)):(this.ne(E),this.ne(b),ot=pe.alloc(),y.mi(ot),rt=ot.ca(b),mt.mi(ot),at=ot.ca(E),(rt||at)&&(tt=y.ga(Vm(tt),new At),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=mt.ga(Vm(x),new At),this.dd(1,this.getLinkPointFromPoint(z,mt,x,E,!1,x))),pe.free(ot))}else{ct=this.isAvoiding,mt&&(ut&&ct||at)&&this.Fj();var Gt=at?this.computeCurviness():0;ct=this.getLinkPoint(a,y,tt,!0,ut,E,b),yt=Mt=St=0,(ut||!ot||at)&&(Ot=this.computeEndSegmentLength(a,y,tt,!0),yt=this.getLinkDirection(a,y,ct,tt,!0,ut,E,b),at&&(ot||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(yt-=ut?90:30,0>Gt&&(yt-=180)),0>yt?yt+=360:360<=yt&&(yt-=360),at&&(Ot+=Math.abs(Gt)*(ut?1:2)),yt===0?St=Ot:yt===90?Mt=Ot:yt===180?St=-Ot:yt===270?Mt=-Ot:(St=Ot*Math.cos(yt*Math.PI/180),Mt=Ot*Math.sin(yt*Math.PI/180)),tt.Mc()&&at&&(Ot=y.ga(Mi,At.alloc()),bt=At.allocAt(Ot.x+1e3*St,Ot.y+1e3*Mt),this.getLinkPointFromPoint(a,y,Ot,bt,!0,ct),At.free(Ot),At.free(bt))),Ot=this.getLinkPoint(E,b,x,!1,ut,a,y);var Wt=jt=bt=0;if(ut||!rt||at){var Kt=this.computeEndSegmentLength(E,b,x,!1);Wt=this.getLinkDirection(E,b,Ot,x,!1,ut,a,y),at&&(rt||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(Wt+=ut?0:30,0>Gt&&(Wt+=180)),0>Wt?Wt+=360:360<=Wt&&(Wt-=360),at&&(Kt+=Math.abs(Gt)*(ut?1:2)),Wt===0?bt=Kt:Wt===90?jt=Kt:Wt===180?bt=-Kt:Wt===270?jt=-Kt:(bt=Kt*Math.cos(Wt*Math.PI/180),jt=Kt*Math.sin(Wt*Math.PI/180)),x.Mc()&&at&&(x=b.ga(Mi,At.alloc()),tt=At.allocAt(x.x+1e3*bt,x.y+1e3*jt),this.getLinkPointFromPoint(E,b,x,tt,!1,Ot),At.free(x),At.free(tt))}x=ct,(ut||!ot||at)&&(x=new At(ct.x+St,ct.y+Mt)),tt=Ot,(ut||!rt||at)&&(tt=new At(Ot.x+bt,Ot.y+jt)),!mt&&!ut&&ot&&3<z&&this.adjustPoints(0,ct,z-2,tt)?this.dd(z-1,Ot):!mt&&!ut&&rt&&3<z&&this.adjustPoints(1,x,z-1,Ot)?this.dd(0,ct):!mt&&(ut?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,ct),this.dd(z-1,Ot)):(this.Fj(),this.ne(ct),(ut||!ot||at)&&this.ne(x),ut&&this.addOrthoPoints(x,yt,tt,Wt,a,E),(ut||!rt||at)&&this.ne(tt),this.ne(Ot))}return!0};function Yv(a,y){return Math.abs(y.x-a.x)>Math.abs(y.y-a.y)?(y.x>=a.x?y.x=a.x+9e9:y.x=a.x-9e9,y.y=a.y):(y.y>=a.y?y.y=a.y+9e9:y.y=a.y-9e9,y.x=a.x),y}Ue.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new At),a===null||y===null)return z.assign(x),z;if(a.isVisible()||(b=a.findVisibleNode(),b!==null&&b!==a&&(y=b.port)),a=null,b=y.panel,b===null||b.se()||(b=b.panel),b===null){b=E.x,E=E.y;var tt=x.x;x=x.y}else{a=b.oe,b=1/(a.m11*a.m22-a.m12*a.m21),tt=a.m22*b;var ot=-a.m12*b,rt=-a.m21*b,at=a.m11*b,ut=b*(a.m21*a.dy-a.m22*a.dx),ct=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*tt+E.y*rt+ut,E=E.x*ot+E.y*at+ct,tt=x.x*tt+x.y*rt+ut,x=x.x*ot+x.y*at+ct}return y.Sj(b,E,tt,x,z),a!==null&&z.transform(a),z};function Um(a,y){var x=y.Zn;return x===null&&(x=new df,x.port=y,x.node=y.part,y.Zn=x),aS(x,a)}Ue.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,ot){if(ot===void 0&&(ot=new At),x.sb()&&!Pc(x))return y.ga(x,ot),ot;if(x.$c()){var rt=Um(this,y);if(rt!==null){if(ot.assign(rt.Zo),b&&this.routing===eS){var at=Um(this,tt);if(at!==null&&rt.Gl<at.Gl){rt=At.alloc(),at=At.alloc();var ut=new pe(y.ga(Sr,rt),y.ga(ya,at)),ct=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,ct,!E,b,a,y,at),(x.Hf(oh)||x.Hf(Sa))&&a.y>=ut.y&&a.y<=ut.y+ut.height?ot.y=a.y:(x.Hf(vu)||x.Hf(ol))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(ot.x=a.x),At.free(rt),At.free(at)}}return ot}}return x=y.ga(Vm(x),At.alloc()),this.pointsCount>(b?6:2)?(tt=E?this.i(1):this.i(this.pointsCount-2),b&&(tt=Yv(x,tt.copy()))):(rt=this.computeSpot(!E,tt),z=At.alloc(),tt=tt.ga(Vm(rt),z),b&&(tt=Yv(x,tt)),At.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,ot),At.free(x),ot},Ue.prototype.getLinkDirection=function(a,y,x,E,b,z,tt,ot){t:if(E.sb())var rt=E.x>E.y?E.x>1-E.y?0:E.x<1-E.y?270:315:E.x<E.y?E.x>1-E.y?90:E.x<1-E.y?180:135:.5>E.x?225:.5<E.x?45:0;else{if(E.$c()&&(rt=Um(this,y),rt!==null))switch(rt.Nc){case 1:rt=270;break t;case 2:rt=180;break t;default:case 4:rt=0;break t;case 8:rt=90;break t}rt=y.ga(Mi,At.alloc()),this.pointsCount>(z?6:2)?(ot=b?this.i(1):this.i(this.pointsCount-2),ot=z?Yv(rt,ot.copy()):x):(x=At.alloc(),ot=ot.ga(Mi,x),At.free(x)),x=Math.abs(ot.x-rt.x)>Math.abs(ot.y-rt.y)?ot.x>=rt.x?0:180:ot.y>=rt.y?90:270,At.free(rt),rt=x}return E.Mc()&&tt.Td(a)&&(rt+=180,360<=rt&&(rt-=360)),Pc(E)||(a=y.li(),a===0)||(45<=a&&135>a?rt+=90:135<=a&&225>a?rt+=180:225<=a&&315>a&&(rt+=270),360<=rt&&(rt-=360)),rt},Ue.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=Um(this,y),a!==null)?a.Ju:(a=E?this.fromEndSegmentLength:this.toEndSegmentLength,y!==null&&isNaN(a)&&(a=E?y.fromEndSegmentLength:y.toEndSegmentLength),isNaN(a)&&(a=10),a)},Ue.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=Mi:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===Ir?hr:y)):(a=y||this.toPort,a===null?a=Mi:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===Ir?hr:y)),a};function Pc(a){return a===hr||a.x===.5&&a.y===.5}function Vm(a){return a.x===.5&&a.y===.5?a:Mi}Ue.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==ps&&4<this.pointsCount?this.computeMidPoint(new At):(a=y.Zn,a=a!==null?aS(a,this):null,a!==null?a.Zo:y.ga(Mi))},Ue.prototype.computeShortLength=function(a){if(a){if(a=this.fromShortLength,isNaN(a)){var y=this.fromPort;y!==null&&(a=y.fromShortLength)}return isNaN(a)?0:a}return a=this.toShortLength,isNaN(a)&&(y=this.toPort,y!==null&&(a=y.toShortLength)),isNaN(a)?0:a},Ue.prototype.Cf=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=ci.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ci.free(tt),!0;if(this.Yc(a,tt)){var ot=!1;if(!this.isAtomic)for(var rt=this.O.s,at=rt.length;at--;){var ut=rt[at];if(ut.visible||ut===this.locationObject){var ct=ut.actualBounds,mt=this.naturalBounds;if(!(ct.x>mt.width||ct.y>mt.height||0>ct.x+ct.width||0>ct.y+ct.height)){if(ct=ci.alloc(),ct.set(tt),ut instanceof ze)ot=ut.Cf(a,y,x,E,b,ct);else if(this.path===ut){if(ut instanceof ei)if(ot=a,mt=E,ut.pickable===!1)ot=!1;else if(ct.multiply(ut.transform),mt)t:{var yt=ot,St=ct;if(ut.fh(yt,St))ot=!0;else{if(St===void 0&&(St=ut.transform,yt.Re(ut.actualBounds))){ot=!0;break t}ot=yt.left,mt=yt.right;var Mt=yt.top;yt=yt.bottom;var Ot=At.alloc(),bt=At.alloc(),jt=At.alloc(),Gt=ci.alloc();Gt.set(St),Gt.bv(ut.transform),Gt.Vj(),bt.x=mt,bt.y=Mt,bt.transform(Gt),Ot.x=ot,Ot.y=Mt,Ot.transform(Gt),St=!1,md(ut,Ot,bt,jt)?St=!0:(Ot.x=mt,Ot.y=yt,Ot.transform(Gt),md(ut,Ot,bt,jt)?St=!0:(bt.x=ot,bt.y=yt,bt.transform(Gt),md(ut,Ot,bt,jt)?St=!0:(Ot.x=ot,Ot.y=Mt,Ot.transform(Gt),md(ut,Ot,bt,jt)&&(St=!0)))),ci.free(Gt),At.free(Ot),At.free(bt),At.free(jt),ot=St}}else ot=ut.fh(ot,ct)}else ot=mr(ut,a,E,ct);ot&&(mt=ut,y!==null&&(mt=y(ut)),mt&&(x===null||x(mt))&&b.add(mt)),ci.free(ct)}}}return z===void 0&&ci.free(tt),ot||this.background!==null||this.areaBackground!==null}return z===void 0&&ci.free(tt),!1},Ue.prototype.computeCurve=function(){if(this.Wf===null){var a=this.fromPort,y=this.isOrthogonal;this.Wf=a!==null&&a===this.toPort&&!y}return this.Wf?ca:this.curve},Ue.prototype.computeCorner=function(){if(this.curve===ca)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},Ue.prototype.findMidLabel=function(){for(var a=this.path,y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if(b!==a&&!b.isPanelMain&&(b.segmentIndex===-1/0||isNaN(b.segmentIndex)))return b}for(a=this.labelNodes;a.next();)if(y=a.value,y.segmentIndex===-1/0||isNaN(y.segmentIndex))return y;return null},Ue.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=iS;a=Math.max(a,this.computeThickness());var y=this.fromPort,x=this.toPort;if(y!==null&&x!==null){var E=this.findMidLabel();if(E!==null){var b=E.naturalBounds,z=E.margin,tt=isNaN(b.width)?30:b.width*E.scale+z.left+z.right;b=isNaN(b.height)?14:b.height*E.scale+z.top+z.bottom,E=E.segmentOrientation,E===Zg||E===Jm||E===Qv?a=Math.max(a,b):E===Qg||E===$g||E===Jg||E===qg?a=Math.max(a,tt):(y=y.ga(Mi).ab(x.ga(Mi))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===ca&&(a*=1.333)}}return a},Ue.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===ps&&x.bb()}},Ue.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=nS;var y=this.Sf;if(y!==null){for(var x=Un(),E=0,b=y.links,z=0;z<b.length;z++){var tt=b[z].computeSpacing();x.push(tt),E+=tt}for(E=-E/2,z=0;z<b.length;z++){if(b[z]===this){a=E+x[z]/2;break}E+=x[z]}y.Ds===this.fromNode&&(a=-a),_n(x)}}return a},Ue.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},Ue.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},Ue.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===Xm)return!1;b===Zm&&(b=Xg)}switch(b){case Xm:var z=this.i(a),tt=this.i(x);if(!z.Xa(y)||!tt.Xa(E)){b=z.x,z=z.y;var ot=tt.x-b,rt=tt.y-z,at=Math.sqrt(ot*ot+rt*rt);if(!Jt.$(at,0)){if(Jt.$(ot,0))var ut=0>rt?-Math.PI/2:Math.PI/2;else ut=Math.atan(rt/Math.abs(ot)),0>ot&&(ut=Math.PI-ut);tt=y.x;var ct=y.y;ot=E.x-tt;var mt=E.y-ct;for(rt=Math.sqrt(ot*ot+mt*mt),Jt.$(ot,0)?mt=0>mt?-Math.PI/2:Math.PI/2:(mt=Math.atan(mt/Math.abs(ot)),0>ot&&(mt=Math.PI-mt)),at=rt/at,ut=mt-ut,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),ot=y.x-b,rt=y.y-z,y=Math.sqrt(ot*ot+rt*rt),Jt.$(y,0)||(Jt.$(ot,0)?rt=0>rt?-Math.PI/2:Math.PI/2:(rt=Math.atan(rt/Math.abs(ot)),0>ot&&(rt=Math.PI-rt)),ot=rt+ut,y*=at,this.L(a,tt+y*Math.cos(ot),ct+y*Math.sin(ot)));this.dd(x,E)}}return!0;case Zm:if(z=this.i(a),ct=this.i(x),!z.Xa(y)||!ct.Xa(E)){b=z.x,z=z.y,tt=ct.x,ct=ct.y,at=(tt-b)*(tt-b)+(ct-z)*(ct-z),ot=y.x,ut=y.y,rt=E.x,mt=E.y;var yt=1;if(rt-ot!==0){var St=(mt-ut)/(rt-ot);yt=Math.sqrt(1+1/(St*St))}else St=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var Mt=y.x,Ot=y.y,bt=.5;at!==0&&(bt=((b-Mt)*(b-tt)+(z-Ot)*(z-ct))/at);var jt=b+bt*(tt-b),Gt=z+bt*(ct-z);y=Math.sqrt((Mt-jt)*(Mt-jt)+(Ot-Gt)*(Ot-Gt)),Ot<St*(Mt-jt)+Gt&&(y=-y),0<St&&(y=-y),Mt=ot+bt*(rt-ot),bt=ut+bt*(mt-ut),St!==0?(y=Mt+y/yt,this.L(a,y,bt-(y-Mt)/St)):this.L(a,Mt,bt+y)}this.dd(x,E)}return!0;case Xg:t:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),tt=this.i(a+2),ot=z.x,ut=z.y,ct=ot,at=ut,Jt.B(b.y,z.y)?Jt.B(z.x,tt.x)?ut=y.y:Jt.B(z.y,tt.y)&&(ot=y.x):Jt.B(b.x,z.x)&&(Jt.B(z.y,tt.y)?ot=y.x:Jt.B(z.x,tt.x)&&(ut=y.y)),this.L(a+1,ot,ut),b=this.i(x),z=this.i(x-1),tt=this.i(x-2),ot=z.x,ut=z.y,rt=ot,mt=ut,Jt.B(b.y,z.y)?Jt.B(z.x,tt.x)?ut=E.y:Jt.B(z.y,tt.y)&&(ot=E.x):Jt.B(b.x,z.x)&&(Jt.B(z.y,tt.y)?ot=E.x:Jt.B(z.x,tt.x)&&(ut=E.y)),this.L(x-1,ot,ut),Kv(this))){this.L(a+1,ct,at),this.L(x-1,rt,mt),x=!1;break t}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},Ue.prototype.addOrthoPoints=function(a,y,x,E,b,z){0>y?y+=360:360<=y&&(y-=360),0>E?E+=360:360<=E&&(E-=360);var tt=E;y=315<=y||45>y?0:45<=y&&135>y?90:135<=y&&225>y?180:270,E=315<=E||45>E?0:45<=E&&135>E?90:135<=E&&225>E?180:270;var ot=b.actualBounds.copy(),rt=z.actualBounds.copy();if(ot.w()&&rt.w()){ot.Bc(tp,tp),rt.Bc(tp,tp),ot.Ye(a),rt.Ye(x);var at=At.alloc(),ut=At.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&rt.right>a.x||E===90&&x.y>a.y&&rt.right>a.x?(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===180?(at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=at.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(at.x=a.x<rt.left?this.computeMidOrthoPosition(a.x,a.y,rt.left,x.y,!1):a.x<rt.right&&(E===270&&a.y<rt.top||E===90&&a.y>rt.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):rt.right,ut.x=at.x,ut.y=x.y):E===0&&a.x<rt.left&&a.y>rt.top&&a.y<rt.bottom&&(at.x=a.x,at.y=a.y<x.y?Math.min(x.y,rt.top):Math.max(x.y,rt.bottom),ut.y=at.y)):(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<ot.top||E===270&&x.y>ot.bottom)&&(E===180&&(rt.ca(a)||ot.ca(x))?at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?at.y=this.computeMidOrthoPosition(a.x,ot.top,x.x,Math.max(x.y,rt.bottom),!0):x.y>a.y&&(E===180||E===270)&&(at.y=this.computeMidOrthoPosition(a.x,ot.bottom,x.x,Math.min(x.y,rt.top),!0)),ut.x=x.x,ut.y=at.y),at.y>ot.top&&at.y<ot.bottom&&(x.x>=ot.left&&x.x<=a.x||a.x<=rt.right&&a.x>=x.x?(E===90||E===270)&&(at.h(Math.max((a.x+x.x)/2,a.x),a.y),ut.h(at.x,x.y)):(at.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?ot.top:Math.min(ot.top,rt.top)):Math.max(x.y,E===0?ot.bottom:Math.max(ot.bottom,rt.bottom)),ut.x=x.x,ut.y=at.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&rt.left<a.x||E===90&&x.y>a.y&&rt.left<a.x?(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===0?(at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=at.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(at.x=a.x>rt.right?this.computeMidOrthoPosition(a.x,a.y,rt.right,x.y,!1):a.x>rt.left&&(E===270&&a.y<rt.top||E===90&&a.y>rt.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):rt.left,ut.x=at.x,ut.y=x.y):E===180&&a.x>rt.right&&a.y>rt.top&&a.y<rt.bottom&&(at.x=a.x,at.y=a.y<x.y?Math.min(x.y,rt.top):Math.max(x.y,rt.bottom),ut.y=at.y)):(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<ot.top||E===270&&x.y>ot.bottom)&&(E===0&&(rt.ca(a)||ot.ca(x))?at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?at.y=this.computeMidOrthoPosition(a.x,ot.top,x.x,Math.max(x.y,rt.bottom),!0):x.y>a.y&&(E===0||E===270)&&(at.y=this.computeMidOrthoPosition(a.x,ot.bottom,x.x,Math.min(x.y,rt.top),!0)),ut.x=x.x,ut.y=at.y),at.y>ot.top&&at.y<ot.bottom&&(x.x<=ot.right&&x.x>=a.x||a.x>=rt.left&&a.x<=x.x?(E===90||E===270)&&(at.h(Math.min((a.x+x.x)/2,a.x),a.y),ut.h(at.x,x.y)):(at.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?ot.top:Math.min(ot.top,rt.top)):Math.max(x.y,E===180?ot.bottom:Math.max(ot.bottom,rt.bottom)),ut.x=x.x,ut.y=at.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&rt.bottom>a.y||E===0&&x.x>a.x&&rt.bottom>a.y?(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===270?(at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=at.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(at.y=a.y<rt.top?this.computeMidOrthoPosition(a.x,a.y,x.x,rt.top,!0):a.y<rt.bottom&&(E===180&&a.x<rt.left||E===0&&a.x>rt.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):rt.bottom,ut.x=x.x,ut.y=at.y):E===90&&a.y<rt.top&&a.x>rt.left&&a.x<rt.right&&(at.x=a.x<x.x?Math.min(x.x,rt.left):Math.max(x.x,rt.right),at.y=a.y,ut.x=at.x)):(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<ot.left||E===180&&x.x>ot.right)&&(E===270&&(rt.ca(a)||ot.ca(x))?at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?at.x=this.computeMidOrthoPosition(ot.left,a.y,Math.max(x.x,rt.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(at.x=this.computeMidOrthoPosition(ot.right,a.y,Math.min(x.x,rt.left),x.y,!1)),ut.x=at.x,ut.y=x.y),at.x>ot.left&&at.x<ot.right&&(x.y>=ot.top&&x.y<=a.y||a.y<=rt.bottom&&a.y>=x.y?(E===0||E===180)&&(at.h(a.x,Math.max((a.y+x.y)/2,a.y)),ut.h(x.x,at.y)):(at.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?ot.left:Math.min(ot.left,rt.left)):Math.max(x.x,E===90?ot.right:Math.max(ot.right,rt.right)),ut.x=at.x,ut.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&rt.top<a.y||E===0&&x.x>a.x&&rt.top<a.y?(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===90?(at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=at.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(at.y=a.y>rt.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,rt.bottom,!0):a.y>rt.top&&(E===180&&a.x<rt.left||E===0&&a.x>rt.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):rt.top,ut.x=x.x,ut.y=at.y):E===270&&a.y>rt.bottom&&a.x>rt.left&&a.x<rt.right&&(at.x=a.x<x.x?Math.min(x.x,rt.left):Math.max(x.x,rt.right),at.y=a.y,ut.x=at.x)):(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<ot.left||E===180&&x.x>ot.right)&&(E===90&&(rt.ca(a)||ot.ca(x))?at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?at.x=this.computeMidOrthoPosition(ot.left,a.y,Math.max(x.x,rt.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(at.x=this.computeMidOrthoPosition(ot.right,a.y,Math.min(x.x,rt.left),x.y,!1)),ut.x=at.x,ut.y=x.y),at.x>ot.left&&at.x<ot.right&&(x.y<=ot.bottom&&x.y>=a.y||a.y>=rt.top&&a.y<=x.y?(E===0||E===180)&&(at.h(a.x,Math.min((a.y+x.y)/2,a.y)),ut.h(x.x,at.y)):(at.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?ot.left:Math.min(ot.left,rt.left)):Math.max(x.x,E===270?ot.right:Math.max(ot.right,rt.right)),ut.x=at.x,ut.y=x.y)));var ct=x;if(this.isAvoiding){var mt=this.diagram;if(mt===null||b===z||this.layer.isTemporary||!ec(mt)||ot.ca(ct)&&!z.Td(b)||rt.ca(a)&&!b.Td(z))y=!1;else{var yt=nc(mt,!0,this.containingGroup,null);if(this.segmentIndex!==17&&yt.Yj(Math.min(a.x,at.x),Math.min(a.y,at.y),Math.abs(a.x-at.x),Math.abs(a.y-at.y))&&yt.Yj(Math.min(at.x,ut.x),Math.min(at.y,ut.y),Math.abs(at.x-ut.x),Math.abs(at.y-ut.y))&&yt.Yj(Math.min(ut.x,ct.x),Math.min(ut.y,ct.y),Math.abs(ut.x-ct.x),Math.abs(ut.y-ct.y)))y=!1;else{b=a,z=ct;var St=x=null;if(mt.isVirtualized){mt=yt.bounds.copy(),mt.Bc(-yt.Ho,-yt.Go);var Mt=At.alloc();Cc(yt,a.x,a.y)||(Jt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,a.x,a.y,at.x,at.y,Mt)?(x=a=Mt.copy(),y=Mt.ab(at)):Jt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,ut.x,ut.y,Mt)?(x=a=Mt.copy(),y=Mt.ab(ut)):Jt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,ct.x,ct.y,Mt)&&(x=a=Mt.copy(),y=Mt.ab(ct))),Cc(yt,ct.x,ct.y)||(Jt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ct.x,ct.y,ut.x,ut.y,Mt)?(St=ct=Mt.copy(),E=ut.ab(Mt)):Jt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,at.x,at.y,Mt)?(St=ct=Mt.copy(),E=at.ab(Mt)):Jt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,a.x,a.y,Mt)&&(St=ct=Mt.copy(),E=a.ab(Mt))),At.free(Mt)}ot=ot.copy().ed(rt),ot.Bc(yt.Ho*yt.Os,yt.Go*yt.Os),rS(yt,a,y,ct,E,ot,!0),rt=Gl(yt,ct.x,ct.y),!yt.abort&&rt>=Lc&&(oS(yt),ot.Bc(yt.Ho*yt.Hx,yt.Go*yt.Ix),rS(yt,a,y,ct,E,ot,!1),rt=Gl(yt,ct.x,ct.y)),!yt.abort&&rt<Lc&&Gl(yt,ct.x,ct.y)!==Vu?(Xv(this,yt,ct.x,ct.y,E,!0,tt),ot=this.i(2),4>this.pointsCount?(y===0||y===180?(ot.x=a.x,ot.y=ct.y):(ot.x=ct.x,ot.y=a.y),this.L(2,ot.x,ot.y),this.m(3,ot.x,ot.y)):(tt=this.i(3),y===0||y===180?Jt.B(ot.x,tt.x)?(ot=y===0?Math.max(ot.x,a.x):Math.min(ot.x,a.x),this.L(2,ot,a.y),this.L(3,ot,tt.y)):Jt.B(ot.y,tt.y)?(Math.abs(a.y-ot.y)<=yt.Go/2&&(this.L(2,ot.x,a.y),this.L(3,tt.x,a.y)),this.m(2,ot.x,a.y)):this.L(2,a.x,ot.y):(y===90||y===270)&&(Jt.B(ot.y,tt.y)?(ot=y===90?Math.max(ot.y,a.y):Math.min(ot.y,a.y),this.L(2,a.x,ot),this.L(3,tt.x,ot)):Jt.B(ot.x,tt.x)?(Math.abs(a.x-ot.x)<=yt.Ho/2&&(this.L(2,a.x,ot.y),this.L(3,a.x,tt.y)),this.m(2,a.x,ot.y)):this.L(2,ot.x,a.y))),x!==null&&(a=this.i(1),tt=this.i(2),a.x!==tt.x&&a.y!==tt.y?y===0||y===180?this.m(2,a.x,tt.y):this.m(2,tt.x,a.y):y===0||y===180?this.m(2,b.x,x.y):this.m(2,x.x,b.y)),St!==null&&(E===0||E===180?this.yf(z.x,St.y):this.yf(St.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(at.copy()),this.ne(ut.copy())),At.free(at),At.free(ut)}},Ue.prototype.computeMidOrthoPosition=function(a,y,x,E,b){var z=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(z=this.computeCurviness()),b?(y+E)/2+z:(a+x)/2+z};function Kv(a){if(a.diagram===null||!a.isAvoiding||!ec(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=nc(a.diagram,!0,a.containingGroup,null);for(var E=1;E<x-2;E++){var b=y[E],z=y[E+1];if(!a.Yj(Math.min(b.x,z.x),Math.min(b.y,z.y),Math.abs(b.x-z.x),Math.abs(b.y-z.y)))return!0}return!1}function Xv(a,y,x,E,b,z,tt){var ot=y.Ho,rt=y.Go,at=Gl(y,x,E),ut=x,ct=E;for(b===0?ut+=ot:b===90?ct+=rt:b===180?ut-=ot:ct-=rt,b!==tt&&at>Sd&&Gl(y,ut,ct)!==at-1&&(Gl(y,x-ot,E)===at-1?(b=180,ut=x-ot,ct=E):Gl(y,x+ot,E)===at-1?(b=0,ut=x+ot,ct=E):Gl(y,x,E-rt)===at-1?(b=270,ut=x,ct=E-rt):Gl(y,x,E+rt)===at-1&&(b=90,ut=x,ct=E+rt));at>Sd&&Gl(y,ut,ct)===at-1;)x=ut,E=ct,b===0?ut+=ot:b===90?ct+=rt:b===180?ut-=ot:ct-=rt,--at;z?at>Sd&&(b===180||b===0?x=Math.floor(x/ot)*ot+ot/2:(b===90||b===270)&&(E=Math.floor(E/rt)*rt+rt/2)):(x=Math.floor(x/ot)*ot+ot/2,E=Math.floor(E/rt)*rt+rt/2),at>Sd&&(z=b,tt=x,ut=E,b===0?(z=90,ut+=rt):b===90?(z=180,tt-=ot):b===180?(z=270,ut-=rt):b===270&&(z=0,tt+=ot),Gl(y,tt,ut)===at-1?Xv(a,y,tt,ut,z,!1,z):(tt=x,ut=E,b===0?(z=270,ut-=rt):b===90?(z=0,tt+=ot):b===180?(z=90,ut+=rt):b===270&&(z=180,tt-=ot),Gl(y,tt,ut)===at-1&&Xv(a,y,tt,ut,z,!1,z))),a.yf(x,E)}Ue.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=Ui(y,a,x.x,x.y,E.x,E.y),z=0,tt=1;tt<this.pointsCount-1;tt++){x=this.i(tt+1);var ot=Ui(y,a,E.x,E.y,x.x,x.y);E=x,ot<b&&(z=tt,b=ot)}return z},Ue.prototype.qc=function(){this.lk=!1,this.v()},Ue.prototype.Ul=function(a){if(!(!a&&(this.fd===!1||(a=this.Pb(),this.lk&&(a===null||a.geometry!==null))))&&(2>this.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),a=this.path,a!==null)){a.ua=this.ua;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];b!==a&&b.isPanelMain&&b instanceof ei&&(b.ua=this.ua)}}},Ue.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&yd(this)&&E.Eh.contains(this)&&(this.ml.width!==0||this.ml.height!==0)&&(E.animationManager.isAnimating||E.currentTool!==E.toolManager)&&(x=!0);var b=this.i(0).copy(),z=b.copy();E=this.Nb.s;var tt=this.computeCurve();if(tt===ca&&3<=y&&!Jt.$(this.smoothness,0))if(y===3){var ot=this.i(1);E=Math.min(b.x,ot.x);var rt=Math.min(b.y,ot.y);ot=this.i(2),E=Math.min(E,ot.x),rt=Math.min(rt,ot.y)}else{if(this.isOrthogonal)for(rt=0;rt<y;rt++)ot=E[rt],z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),rt=this.i(E),z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);E=z.x,rt=z.y}else{for(rt=0;rt<y;rt++)ot=E[rt],z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);E=z.x,rt=z.y}if(E-=this.su.x,rt-=this.su.y,b.x-=E,b.y-=rt,y!==2||yd(this)){if(a.type=Xe.o,ot=F1(a),this.computeShortLength(!0)!==0&&(b=af(this,b,!0,z)),Sc(ot,b.x,b.y,!1),tt===ca&&3<=y&&!Jt.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-rt,b=this.i(2).copy(),b.x-=E,b.y-=rt,this.computeShortLength(!1)!==0&&(b=af(this,b,!1,z)),_u(ot,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=At.allocAt(E,rt),x=At.alloc(),x.assign(this.i(1)),z=At.allocAt(E,rt),b=At.allocAt(E,rt),tt=this.i(0);for(var at,ut=this.smoothness/3,ct=1;ct<this.pointsCount-1;ct++){at=this.i(ct);var mt=tt,yt=at,St=this.i(Zv(this,at,ct,!1));if((!Jt.$(mt.x,yt.x)||!Jt.$(yt.x,St.x))&&(!Jt.$(mt.y,yt.y)||!Jt.$(yt.y,St.y))){var Mt=ut;isNaN(Mt)&&(Mt=this.smoothness/3);var Ot=mt.x;mt=mt.y;var bt=yt.x;yt=yt.y;var jt=St.x;St=St.y;var Gt=Mt*Ym(Ot,mt,bt,yt);Mt*=Ym(bt,yt,jt,St),Jt.$(mt,yt)&&Jt.$(bt,jt)&&(bt>Ot?St>yt?(z.x=bt-Gt,z.y=yt-Gt,b.x=bt+Mt,b.y=yt+Mt):(z.x=bt-Gt,z.y=yt+Gt,b.x=bt+Mt,b.y=yt-Mt):St>yt?(z.x=bt+Gt,z.y=yt-Gt,b.x=bt-Mt,b.y=yt+Mt):(z.x=bt+Gt,z.y=yt+Gt,b.x=bt-Mt,b.y=yt-Mt)),Jt.$(Ot,bt)&&Jt.$(yt,St)&&(yt>mt?(jt>bt?(z.x=bt-Gt,z.y=yt-Gt,b.x=bt+Mt):(z.x=bt+Gt,z.y=yt-Gt,b.x=bt-Mt),b.y=yt+Mt):(jt>bt?(z.x=bt-Gt,z.y=yt+Gt,b.x=bt+Mt):(z.x=bt+Gt,z.y=yt+Gt,b.x=bt-Mt),b.y=yt-Mt)),(Jt.$(Ot,bt)&&Jt.$(bt,jt)||Jt.$(mt,yt)&&Jt.$(yt,St))&&(Ot=.5*(Ot+jt),mt=.5*(mt+St),z.x=Ot,z.y=mt,b.x=Ot,b.y=mt),(ct===1||ct===2&&Jt.$(tt.x,this.i(0).x)&&Jt.$(tt.y,this.i(0).y))&&(x.x=.5*(tt.x+at.x),x.y=.5*(tt.y+at.y)),_u(ot,x.x-E,x.y-rt,z.x-E,z.y-rt,at.x-E,at.y-rt),y.set(z),x.set(b),tt=at}}at=tt.x,tt=tt.y,ut=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(ut=af(this,ut.copy(),!1,An)),at=.5*(at+ut.x),tt=.5*(tt+ut.y),_u(ot,b.x-E,b.y-rt,at-E,tt-rt,ut.x-E,ut.y-rt),At.free(y),At.free(x),At.free(z),At.free(b)}else for(x=3;x<y;x+=3)z=this.i(x-2),x+3>=y&&(x=y-1),b=this.i(x-1),tt=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(tt=af(this,tt.copy(),!1,An)),_u(ot,z.x-E,z.y-rt,b.x-E,b.y-rt,tt.x-E,tt.y-rt);else{for(z=At.alloc(),z.assign(this.i(0)),b=At.alloc(),b.assign(z),tt=this.computeCorner(),ct=1,at=0;ct<y;){if(ct=Zv(this,z,ct,1<ct),ut=this.i(ct),ct>=y-1){if(!z.D(ut))this.computeShortLength(!1)!==0&&(ut=af(this,ut.copy(),!1,An)),lf(this,ot,-E,-rt,z,ut,x);else if(at===0)for(ct=1;ct<y;)b.assign(z),ut=this.i(ct++),lf(this,ot,-E,-rt,z,ut,x),z.assign(ut);break}if(at=Zv(this,ut,ct+1,ct<y-3),ct=-E,Ot=-rt,mt=ut,bt=this.i(at),Mt=x,Jt.B(z.y,mt.y)&&Jt.B(mt.x,bt.x))if(St=Math.min(tt,Math.abs(mt.x-b.x)/2),St=Gt=Math.min(St,Math.abs(bt.y-mt.y)/2),Jt.B(St,0))lf(this,ot,ct,Ot,z,mt,Mt),z.assign(mt);else{var Wt=mt.x,Kt=mt.y;yt=Wt,jt=Kt,mt.x>z.x?Wt=mt.x-St:Wt=mt.x+St,bt.y>mt.y?jt=mt.y+Gt:jt=mt.y-Gt,bt=At.allocAt(Wt,Kt),lf(this,ot,ct,Ot,z,bt,Mt),At.free(bt),Im(ot,mt.x+ct,mt.y+Ot,yt+ct,jt+Ot),z.h(yt,jt)}else Jt.B(z.x,mt.x)&&Jt.B(mt.y,bt.y)?(St=Math.min(tt,Math.abs(mt.y-b.y)/2),St=Gt=Math.min(St,Math.abs(bt.x-mt.x)/2),Jt.B(Gt,0)?(lf(this,ot,ct,Ot,z,mt,Mt),z.assign(mt)):(Wt=mt.x,Kt=mt.y,yt=Wt,jt=Kt,mt.y>z.y?Kt=mt.y-St:Kt=mt.y+St,bt.x>mt.x?yt=mt.x+Gt:yt=mt.x-Gt,bt=At.allocAt(Wt,Kt),lf(this,ot,ct,Ot,z,bt,Mt),At.free(bt),Im(ot,mt.x+ct,mt.y+Ot,yt+ct,jt+Ot),z.h(yt,jt))):(lf(this,ot,ct,Ot,z,mt,Mt),z.assign(mt));b.assign(ut),ct=at}At.free(z)}Rm=ot}else ot=this.i(1).copy(),ot.x-=E,ot.y-=rt,this.computeShortLength(!0)!==0&&(b=af(this,b,!0,z)),this.computeShortLength(!1)!==0&&(ot=af(this,ot,!1,z)),a.type=Xe.j,a.startX=b.x,a.startY=b.y,a.endX=ot.x,a.endY=ot.y;return this.lk=!0,a};function Ym(a,y,x,E){return a=x-a,isNaN(a)||a===1/0||a===-1/0?NaN:(0>a&&(a=-a),y=E-y,isNaN(y)||y===1/0||y===-1/0?NaN:(0>y&&(y=-y),Jt.$(a,0)?y:Jt.$(y,0)?a:Math.sqrt(a*a+y*y)))}function af(a,y,x,E){var b=a.pointsCount;if(2>b)return y;if(x){var z=a.i(1);if(x=z.x-E.x,z=z.y-E.y,E=Ym(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!0),a>b&&(a=b),b=a*(z-y.y)/E,y.x+=a*(x-y.x)/E,y.y+=b}else{if(z=a.i(b-2),x=z.x-E.x,z=z.y-E.y,E=Ym(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!1),a>b&&(a=b),b=a*(y.y-z)/E,y.x-=a*(y.x-x)/E,y.y-=b}return y}function Zv(a,y,x,E){for(var b=a.pointsCount,z=y;Jt.$(y.x,z.x)&&Jt.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!Jt.$(y.x,z.x)&&!Jt.$(y.y,z.y))return x-1;for(var tt=z;Jt.$(y.x,z.x)&&Jt.$(z.x,tt.x)&&(!E||(y.y>=z.y?z.y>=tt.y:z.y<=tt.y))||Jt.$(y.y,z.y)&&Jt.$(z.y,tt.y)&&(!E||(y.x>=z.x?z.x>=tt.x:z.x<=tt.x));){if(x>=b)return b-1;tt=a.i(x++)}return x-2}Ue.prototype.computeJumpLength=function(){return 10};function lf(a,y,x,E,b,z,tt){if(!tt&&yd(a)){tt=a.computeJumpLength();var ot=tt/2,rt=[],at=0;if(a.isVisible()&&(at=kx(a,b,z,rt)),0<at){if(Jt.B(b.y,z.y))if(b.x<z.x)for(var ut=0;ut<at;){var ct=Math.max(b.x,Math.min(rt[ut++]-ot,z.x-tt));y.lineTo(ct+x,z.y+E);for(var mt=ct+x,yt=Math.min(ct+tt,z.x);ut<at&&(ct=rt[ut],ct<yt+tt);)ut++,yt=Math.min(ct+ot,z.x);ct=z.y-tt+E,yt+=x;var St=z.y+E;a.curve===Uu?Sc(y,yt,St,!1):_u(y,mt,ct,yt,ct,yt,St)}else for(--at;0<=at;){for(ut=Math.min(b.x,Math.max(rt[at--]+ot,z.x+tt)),y.lineTo(ut+x,z.y+E),mt=ut+x,ct=Math.max(ut-tt,z.x);0<=at&&(ut=rt[at],ut>ct-tt);)at--,ct=Math.max(ut-ot,z.x);ut=z.y-tt+E,ct+=x,yt=z.y+E,a.curve===Uu?Sc(y,ct,yt,!1):_u(y,mt,ut,ct,ut,ct,yt)}else if(Jt.B(b.x,z.x))if(b.y<z.y)for(ut=0;ut<at;){for(ct=Math.max(b.y,Math.min(rt[ut++]-ot,z.y-tt)),y.lineTo(z.x+x,ct+E),mt=ct+E,ct=Math.min(ct+tt,z.y);ut<at&&(yt=rt[ut],yt<ct+tt);)ut++,ct=Math.min(yt+ot,z.y);yt=z.x-tt+x,St=z.x+x,ct+=E,a.curve===Uu?Sc(y,St,ct,!1):_u(y,yt,mt,yt,ct,St,ct)}else for(--at;0<=at;){for(ut=Math.min(b.y,Math.max(rt[at--]+ot,z.y+tt)),y.lineTo(z.x+x,ut+E),mt=ut+E,ut=Math.max(ut-tt,z.y);0<=at&&(ct=rt[at],ct>ut-tt);)at--,ut=Math.max(ct-ot,z.y);ct=z.x-tt+x,yt=z.x+x,ut+=E,a.curve===Uu?Sc(y,yt,ut,!1):_u(y,ct,mt,ct,ut,yt,ut)}}}y.lineTo(z.x+x,z.y+E)}function kx(a,y,x,E){var b=a.diagram;if(b===null||y.D(x))return 0;for(b=b.layers;b.next();){var z=b.value;if(z!==null&&z.visible){z=z.Pa.s;for(var tt=z.length,ot=0;ot<tt;ot++){var rt=z[ot];if(rt instanceof Ue){if(rt===a)return 0<E.length&&E.sort(function(ut,ct){return ut-ct}),E.length;if(rt.isVisible()&&yd(rt)){var at=rt.routeBounds;at.w()&&a.routeBounds.Yc(at)&&!a.usesSamePort(rt)&&(at=rt.path,at!==null&&at.Ed()&&Mx(y,x,E,rt))}}}}}return 0<E.length&&E.sort(function(ut,ct){return ut-ct}),E.length}function Mx(a,y,x,E){for(var b=Jt.B(a.y,y.y),z=E.pointsCount,tt=E.i(0),ot=At.alloc(),rt=1;rt<z;rt++){var at=E.i(rt);if(rt<z-1){var ut=E.i(rt+1);if(tt.y===at.y&&at.y===ut.y){if(at.x>tt.x&&ut.x>=at.x||at.x<tt.x&&ut.x<=at.x)continue}else if(tt.x===at.x&&at.x===ut.x&&(at.y>tt.y&&ut.y>=at.y||at.y<tt.y&&ut.y<=at.y))continue}t:{ut=a.x;var ct=a.y,mt=y.x,yt=y.y,St=tt.x;tt=tt.y;var Mt=at.x,Ot=at.y;if(Jt.B(ut,mt)){if(!Jt.B(ct,yt)&&Jt.B(tt,Ot)&&Math.min(ct,yt)<tt&&Math.max(ct,yt)>tt&&Math.min(St,Mt)<ut&&Math.max(St,Mt)>ut&&!Jt.B(St,Mt)){ot.x=ut,ot.y=tt,ut=!0;break t}}else if(Jt.B(ct,yt)&&Jt.B(St,Mt)&&Math.min(ut,mt)<St&&Math.max(ut,mt)>St&&Math.min(tt,Ot)<ct&&Math.max(tt,Ot)>ct&&!Jt.B(tt,Ot)){ot.x=St,ot.y=ct,ut=!0;break t}ot.x=0,ot.y=0,ut=!1}ut&&(b?x.push(ot.x):x.push(ot.y)),tt=at}At.free(ot)}function yd(a){return a=a.curve,a===wc||a===Uu}function Km(a,y){(y||yd(a))&&(y=a.diagram,y===null||y.animationManager.isTicking||y.Eh.contains(a)||a.ml.width===0&&a.ml.height===0||y.Eh.add(a,a.ml.copy()))}Ue.prototype.Xo=function(a){var y=this.layer;if(y!==null&&y.visible&&!y.isTemporary){var x=y.diagram;if(x!==null&&!x.animationManager.isTicking){var E=!1;for(x=x.layers;x.next();){var b=x.value;if(b.visible){if(b===y){E=!0;var z=!1;b=b.Pa.s;for(var tt=b.length,ot=0;ot<tt;ot++){var rt=b[ot];rt instanceof Ue&&(rt===this?z=!0:z&&tS(this,rt,a))}}else if(E)for(z=b.Pa.s,b=z.length,tt=0;tt<b;tt++)ot=z[tt],ot instanceof Ue&&tS(this,ot,a)}}}}};function tS(a,y,x){if(y!==null&&y.lk&&y.fd&&yd(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}Ue.prototype.usesSamePort=function(a){var y=this.pointsCount,x=a.pointsCount;if(0<y&&0<x){var E=this.i(0),b=a.i(0);if(E.Xa(b)||(y=this.i(y-1),a=a.i(x-1),y.Xa(a)||E.Xa(a)||y.Xa(b)))return!0}else if(this.fromNode===a.fromNode||this.toNode===a.toNode||this.fromNode===a.toNode||this.toNode===a.fromNode)return!0;return!1},Ue.prototype.isVisible=function(){if(!Ln.prototype.isVisible.call(this))return!1;var a=this.containingGroup,y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this.fromNode,x!==null){if(this.isTreeLink&&y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(var E=x;E!==null;){if(E.labeledLink===this)return!0;E=E.containingGroup}if(x=x.findVisibleNode(),x===null||x===a)return!1}if(x=this.toNode,x!==null){if(this.isTreeLink&&!y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(y=x;y!==null;){if(y.labeledLink===this)return!0;y=y.containingGroup}if(y=x.findVisibleNode(),y===null||y===a)return!1}return!0},Ue.prototype.Zb=function(a){if(Ln.prototype.Zb.call(this,a),a&&Km(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},Ue.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?Xg:this.qk};function Yg(a){var y=a.ef;if(y!==null){var x=a.uf;if(x!==null&&isNaN(a.curviness)){for(var E=a.ff,b=a.vf,z=a=null,tt=y.jb.s,ot=tt.length,rt=0;rt<ot;rt++){var at=tt[rt];(at.ef===y&&at.ff===E&&at.uf===x&&at.vf===b||at.ef===x&&at.ff===b&&at.uf===y&&at.vf===E)&&(z===null?z=at:(a===null&&(a=[],a.push(z)),a.push(at)))}if(a!==null){for(z=H1(y,x,E,b),z===null&&(z=new qm(y,E,x,b),G1(y,z),G1(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function Kg(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(fo(y.links,a),y.Sl()))}Ue.prototype.ph=function(){return!0},Ie.Object.defineProperties(Ue.prototype,{fromNode:{get:function(){return this.ef},set:function(a){var y=this.ef;if(y!==a){var x=this.fromPort;y!==null&&(this.uf!==y&&Gm(y,this,x),Kg(this),this.C(2)),this.ef=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setFromNodeForLink(this,a,y);var b=this.fromPort,z=this.fromPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.uf!==a&&_m(a,this,b),Yg(this),this.C(1)),this.g("fromNode",y,a),xc(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&$s(x),Kg(this),this.ff=a;var E=this.fromPort;E!==null&&$s(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.xv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),Yg(this),this.g("fromPortId",y,a)}}},fromPort:{get:function(){var a=this.ef;return a===null?null:a.ns(this.ff)}},fromPortChanged:{get:function(){return this.gn},set:function(a){var y=this.gn;y!==a&&(this.gn=a,this.g("fromPortChanged",y,a))}},toNode:{get:function(){return this.uf},set:function(a){var y=this.uf;if(y!==a){var x=this.toPort;y!==null&&(this.ef!==y&&Gm(y,this,x),Kg(this),this.C(2)),this.uf=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setToNodeForLink(this,a,y);var b=this.toPort,z=this.toPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.ef!==a&&_m(a,this,b),Yg(this),this.C(1)),this.g("toNode",y,a),xc(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&$s(x),Kg(this),this.vf=a;var E=this.toPort;E!==null&&$s(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.Cv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),Yg(this),this.g("toPortId",y,a)}}},toPort:{get:function(){var a=this.uf;return a===null?null:a.ns(this.vf)}},toPortChanged:{get:function(){return this.uo},set:function(a){var y=this.uo;y!==a&&(this.uo=a,this.g("toPortChanged",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Ir},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),(y.$c()||a.$c())&&this.fromNode!==null&&$s(this.fromPort),this.bb())}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:NaN},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&qn(a,">= 0",Ue,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),this.bb())}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:NaN},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.qc(),this.g("fromShortLength",y,a))}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Ir},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),(y.$c()||a.$c())&&this.toNode!==null&&$s(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:NaN},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&qn(a,">= 0",Ue,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),this.bb())}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:NaN},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.qc(),this.g("toShortLength",y,a))}},isLabeledLink:{get:function(){return this.wd===null?!1:0<this.wd.count}},labelNodes:{get:function(){return this.wd===null?ui:this.wd.iterator}},relinkableFrom:{get:function(){return(this.Qa&1)!==0},set:function(a){var y=(this.Qa&1)!==0;y!==a&&(this.Qa^=1,this.g("relinkableFrom",y,a),this.Wb())}},relinkableTo:{get:function(){return(this.Qa&2)!==0},set:function(a){var y=(this.Qa&2)!==0;y!==a&&(this.Qa^=2,this.g("relinkableTo",y,a),this.Wb())}},resegmentable:{get:function(){return(this.Qa&4)!==0},set:function(a){var y=(this.Qa&4)!==0;y!==a&&(this.Qa^=4,this.g("resegmentable",y,a),this.Wb())}},isTreeLink:{get:function(){return(this.Qa&8)!==0},set:function(a){var y=(this.Qa&8)!==0;y!==a&&(this.Qa^=8,this.g("isTreeLink",y,a),this.fromNode!==null&&Vg(this.fromNode),this.toNode!==null&&Vg(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof ei?a:null}},routeBounds:{get:function(){this.vg();var a=this.ml,y=1/0,x=1/0,E=this.pointsCount;if(E===0)a.h(NaN,NaN,0,0);else{if(E===1)E=this.i(0),y=Math.min(E.x,y),x=Math.min(E.y,x),a.h(E.x,E.y,0,0);else if(E===2){E=this.i(0);var b=this.i(1);y=Math.min(E.x,b.x),x=Math.min(E.y,b.y),a.h(E.x,E.y,0,0),a.Ye(b)}else if(this.computeCurve()===ca&&3<=E&&!this.isOrthogonal)if(b=this.i(0),y=b.x,x=b.y,a.h(y,x,0,0),E===3){E=this.i(1),y=Math.min(E.x,y),x=Math.min(E.y,x);var z=this.i(2);y=Math.min(z.x,y),x=Math.min(z.y,x),Jt.Dl(b.x,b.y,E.x,E.y,E.x,E.y,z.x,z.y,.5,a)}else for(z=3;z<E;z+=3){var tt=this.i(z-2);z+3>=E&&(z=E-1);var ot=this.i(z-1),rt=this.i(z);Jt.Dl(b.x,b.y,tt.x,tt.y,ot.x,ot.y,rt.x,rt.y,.5,a),y=Math.min(rt.x,y),x=Math.min(rt.y,x),b=rt}else for(b=this.i(0),z=this.i(1),y=Math.min(b.x,z.x),x=Math.min(b.y,z.y),a.h(b.x,b.y,0,0),a.Ye(z),b=2;b<E;b++)z=this.i(b),y=Math.min(z.x,y),x=Math.min(z.y,x),a.Ye(z);this.su.h(y-a.x,x-a.y)}return a}},midPoint:{get:function(){return this.vg(),this.computeMidPoint(new At)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Wm(this);for(var a=this.cq=[],y=this.pointsCount,x=0;x<y-1;x++){var E=this.i(x),b=this.i(x+1);Jt.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):Jt.$(E.y,b.y)?(E=b.x-E.x,0>E&&(E=-E)):E=Math.sqrt(E.Bf(b)),a.push(E)}}return this.cq}},flattenedTotalLength:{get:function(){var a=this.vt;if(isNaN(a)){for(var y=this.flattenedLengths,x=y.length,E=a=0;E<x;E++)a+=y[E];this.vt=a}return a}},points:{get:function(){return this.Nb},set:function(a){var y=this.Nb;if(y!==a){var x=null;if(Array.isArray(a)){var E=a.length%2===0;if(E){for(var b=0;b<a.length;b++)if(typeof a[b]!="number"||isNaN(a[b])){E=!1;break}}if(E)for(x=new be,E=0;E<a.length/2;E++)b=new At(a[2*E],a[2*E+1]).freeze(),x.add(b);else{for(E=!0,b=0;b<a.length;b++){var z=a[b];if(!Ve(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new be,E=0;E<a.length;E++)b=a[E],x.add(new At(b.x,b.y).freeze())}}else if(a instanceof be)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else de("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),Wm(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&Yf(a.animationManager,this,x)),this.g("points",y,x)}}},pointsCount:{get:function(){return this.Nb.count}},fd:{get:function(){return(this.Qa&16)!==0},set:function(a){(this.Qa&16)!==0!==a&&(this.Qa^=16)}},suspendsRouting:{get:function(){return(this.Qa&32)!==0},set:function(a){(this.Qa&32)!==0!==a&&(this.Qa^=32)}},computingPoints:{get:function(){return(this.Qa&64)!==0},set:function(a){(this.Qa&64)!==0!==a&&(this.Qa^=64)}},defaultFromPoint:{get:function(){return this.o},set:function(a){this.o=a.copy()}},defaultToPoint:{get:function(){return this.u},set:function(a){this.u=a.copy()}},isOrthogonal:{get:function(){return(this.qj.value&2)===2}},isAvoiding:{get:function(){return(this.qj.value&4)===4}},lk:{get:function(){return(this.Qa&128)!==0},set:function(a){(this.Qa&128)!==0!==a&&(this.Qa^=128)}},geometry:{get:function(){if(!this.lk){if(this.vg(),2>this.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Pc(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Pc(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.qk},set:function(a){var y=this.qk;y!==a&&(this.qk=a,this.g("adjusting",y,a))}},corner:{get:function(){return this.Om},set:function(a){var y=this.Om;y!==a&&(this.Om=a,this.qc(),this.g("corner",y,a))}},curve:{get:function(){return this.Qm},set:function(a){var y=this.Qm;y!==a&&(this.Qm=a,this.bb(),this.qc(),Km(this,y===Uu||y===wc||a===Uu||a===wc),this.g("curve",y,a))}},curviness:{get:function(){return this.Rm},set:function(a){var y=this.Rm;y!==a&&(this.Rm=a,this.bb(),this.qc(),this.g("curviness",y,a))}},routing:{get:function(){return this.qj},set:function(a){var y=this.qj;y!==a&&(this.qj=a,this.Wf=null,this.bb(),Km(this,(y.value&2)===2||(a.value&2)===2),this.g("routing",y,a))}},smoothness:{get:function(){return this.po},set:function(a){var y=this.po;y!==a&&(this.po=a,this.qc(),this.g("smoothness",y,a))}},key:{get:function(){var a=this.diagram;if(a!==null&&a.model.ri())return a.model.Ac(this.data)}}}),Ue.prototype.invalidateOtherJumpOvers=Ue.prototype.Xo,Ue.prototype.findClosestSegment=Ue.prototype.ez,Ue.prototype.updateRoute=Ue.prototype.vg,Ue.prototype.invalidateRoute=Ue.prototype.bb,Ue.prototype.rollbackRoute=Ue.prototype.rv,Ue.prototype.commitRoute=Ue.prototype.zf,Ue.prototype.startRoute=Ue.prototype.uh,Ue.prototype.clearPoints=Ue.prototype.Fj,Ue.prototype.removePoint=Ue.prototype.pv,Ue.prototype.addPointAt=Ue.prototype.yf,Ue.prototype.addPoint=Ue.prototype.ne,Ue.prototype.insertPointAt=Ue.prototype.m,Ue.prototype.insertPoint=Ue.prototype.Kz,Ue.prototype.setPointAt=Ue.prototype.L,Ue.prototype.setPoint=Ue.prototype.dd,Ue.prototype.getPoint=Ue.prototype.i,Ue.prototype.getOtherPort=Ue.prototype.Cz,Ue.prototype.getOtherNode=Ue.prototype.To;var uf=null,hf=null,Jv=new ae(Ue,"Normal",1),Ex=new ae(Ue,"Orthogonal",2),Nx=new ae(Ue,"AvoidsNodes",6),eS=new ae(Ue,"AvoidsNodesStraight",7),ps=new ae(Ue,"None",0),ca=new ae(Ue,"Bezier",9),Uu=new ae(Ue,"JumpGap",10),wc=new ae(Ue,"JumpOver",11),Xg=new ae(Ue,"End",17),Xm=new ae(Ue,"Scale",18),Zm=new ae(Ue,"Stretch",19),Zg=new ae(Ue,"OrientAlong",21),Jg=new ae(Ue,"OrientPlus90",22),Qg=new ae(Ue,"OrientMinus90",23),Qv=new ae(Ue,"OrientOpposite",24),Jm=new ae(Ue,"OrientUpright",25),qg=new ae(Ue,"OrientPlus90Upright",26),$g=new ae(Ue,"OrientMinus90Upright",27),Qm=new ae(Ue,"OrientUpright45",28),nS=16,iS=14,tp=8;Ue.className="Link",Ue.Normal=Jv,Ue.Orthogonal=Ex,Ue.AvoidsNodes=Nx,Ue.AvoidsNodesStraight=eS,Ue.None=ps,Ue.Bezier=ca,Ue.JumpGap=Uu,Ue.JumpOver=wc,Ue.End=Xg,Ue.Scale=Xm,Ue.Stretch=Zm,Ue.OrientAlong=Zg,Ue.OrientPlus90=Jg,Ue.OrientMinus90=Qg,Ue.OrientOpposite=Qv,Ue.OrientUpright=Jm,Ue.OrientPlus90Upright=qg,Ue.OrientMinus90Upright=$g,Ue.OrientUpright45=Qm,Ue.EndSegmentStep=8,Ue.CurvinessStart=nS,Ue.SpacingMin=iS,Ue.OrthoShortCut=tp;function qm(a,y,x,E){vi(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}qm.prototype.Sl=function(){if(!this.qq){var a=this.links;0<a.length&&(a=a[0].diagram,a!==null&&(a.ow.add(this),this.Fe=a.undoManager.isUndoingRedoing))}this.qq=!0},qm.prototype.Nv=function(){if(this.qq){this.qq=!1;var a=this.links;if(0<a.length){var y=a[0],x=y.diagram;x=x===null||x.pi&&!this.Fe,this.Fe=!1,y.arrangeBundledLinks(a,x),a.length===1&&(y.Sf=null,a.length=0)}a.length===0&&(a=this.Ds,this!==null&&a.af!==null&&a.af.remove(this),a=this.cv,this!==null&&a.af!==null&&a.af.remove(this))}},qm.className="LinkBundle";function ep(a){vi(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=a.width,this.sc=a.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}ep.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var y=a.y,x=a.x+a.width,E=a.y+a.height;if(this.Nd=Math.floor((a.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((y-this.sc)/this.sc)*this.sc,this.En=Math.ceil((x+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((E+2*this.sc)/this.sc)*this.sc,a=1+(Math.ceil((this.En-this.Nd)/this.rc)|0),y=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0),this.ac===null||this.di<a-1||this.ei<y-1){for(x=[],E=0;E<=a;E++)x[E]=new Uint32Array(y);this.ac=x,this.di=a-1,this.ei=y-1}if(a=qv,this.ac!==null)for(y=0;y<=this.di;y++)if(x=this.ac[y],x.fill)x.fill(a);else for(E=0;E<=this.ei;E++)x[E]=a}};function Cc(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Gl(a,y,x){return Cc(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):qv}function oS(a){if(a.ac!==null)for(var y=0;y<=a.di;y++)for(var x=a.ac[y],E=0;E<=a.ei;E++)x[E]>=Sd&&(x[E]=qv)}ep.prototype.Yj=function(a,y,x,E){if(a>this.En||a+x<this.Nd||y>this.Fn||y+E<this.Od)return!0;a=(a-this.Nd)/this.rc|0,y=(y-this.Od)/this.sc|0,x=Math.max(0,x)/this.rc+1|0;var b=Math.max(0,E)/this.sc+1|0;if(0>a&&(x+=a,a=0),0>y&&(b+=y,y=0),0>x||0>b)return!0;for(E=Math.min(a+x-1,this.di)|0,x=Math.min(y+b-1,this.ei)|0;a<=E;a++){b=this.ac[a];for(var z=y;z<=x;z++)if(b[z]===Vu)return!1}return!0};function Hl(a,y,x,E,b,z,tt,ot,rt){if(!(y<z||y>tt||x<ot||x>rt)){var at=y|0,ut=x|0,ct=a.ac[at][ut];if(ct>=Sd&&ct<Lc)for(b?ut+=E:at+=E,ct+=1;z<=at&&at<=tt&&ot<=ut&&ut<=rt&&!(ct>=a.ac[at][ut]);)a.ac[at][ut]=ct,ct+=1,b?ut+=E:at+=E;if(at=b?ut:at,b)if(0<E)for(x+=E;x<at;x+=E)Hl(a,y,x,1,!b,z,tt,ot,rt),Hl(a,y,x,-1,!b,z,tt,ot,rt);else for(x+=E;x>at;x+=E)Hl(a,y,x,1,!b,z,tt,ot,rt),Hl(a,y,x,-1,!b,z,tt,ot,rt);else if(0<E)for(y+=E;y<at;y+=E)Hl(a,y,x,1,!b,z,tt,ot,rt),Hl(a,y,x,-1,!b,z,tt,ot,rt);else for(y+=E;y>at;y+=E)Hl(a,y,x,1,!b,z,tt,ot,rt),Hl(a,y,x,-1,!b,z,tt,ot,rt)}}function $m(a,y,x,E,b,z,tt,ot,rt){y|=0,x|=0;var at=Vu,ut=Sd;for(a.ac[y][x]=ut;at===Vu&&y>z&&y<tt&&x>ot&&x<rt;)ut+=1,a.ac[y][x]=ut,b?x+=E:y+=E,at=a.ac[y][x]}function t0(a,y,x,E,b,z,tt,ot,rt){y|=0,x|=0;var at=Vu,ut=Lc;for(a.ac[y][x]=ut;at===Vu&&y>z&&y<tt&&x>ot&&x<rt;)a.ac[y][x]=ut,b?x+=E:y+=E,at=a.ac[y][x]}function rS(a,y,x,E,b,z,tt){if(a.ac!==null){a.abort=!1;var ot=y.x,rt=y.y;if(Cc(a,ot,rt)){ot-=a.Nd,ot/=a.rc,rt-=a.Od,rt/=a.sc;var at=E.x,ut=E.y;if(Cc(a,at,ut))if(at-=a.Nd,at/=a.rc,ut-=a.Od,ut/=a.sc,1>=Math.abs(ot-at)&&1>=Math.abs(rt-ut))a.abort=!0;else{var ct=z.x;E=z.y,y=z.x+z.width;var mt=z.y+z.height;ct-=a.Nd,ct/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,mt-=a.Od,mt/=a.sc,z=Math.max(0,Math.min(a.di,ct|0)),y=Math.min(a.di,Math.max(0,y|0)),ct=Math.max(0,Math.min(a.ei,E|0)),mt=Math.min(a.ei,Math.max(0,mt|0)),E=a.ac,ot|=0,rt|=0,at|=0,ut|=0;var yt=x===0||x===90?1:-1;if(x=x===90||x===270,E[ot][rt]===Vu?($m(a,ot,rt,yt,x,z,y,ct,mt),$m(a,ot,rt,1,!x,z,y,ct,mt),$m(a,ot,rt,-1,!x,z,y,ct,mt)):$m(a,ot,rt,yt,x,ot,rt,ot,rt),E[at][ut]===Vu?(t0(a,at,ut,b===0||b===90?1:-1,b===90||b===270,z,y,ct,mt),t0(a,at,ut,1,!(b===90||b===270),z,y,ct,mt),t0(a,at,ut,-1,!(b===90||b===270),z,y,ct,mt)):t0(a,at,ut,yt,x,at,ut,at,ut),x=Un(),tt&&sS(a,at,ut,b,ot,rt,x))for((x[0]!==at||x[1]!==ut)&&(x.unshift(ut),x.unshift(at)),(x[x.length-2]!==ot||x[x.length-1]!==rt)&&(x.push(ot),x.push(rt)),a=Sd,b=x[x.length-2],tt=x[x.length-1],E[b][tt]=a++,z=x.length-4;0<=z;z-=2)for(b=x[z+2],tt=x[z+3],y=x[z],at=x[z+1];y>b?b++:y<b?b--:at>tt?tt++:at<tt&&tt--,E[b][tt]=a++,b!==y||tt!==at;);else Hl(a,ot,rt,1,!1,z,y,ct,mt),Hl(a,ot,rt,-1,!1,z,y,ct,mt),Hl(a,ot,rt,1,!0,z,y,ct,mt),Hl(a,ot,rt,-1,!0,z,y,ct,mt);_n(x)}}}}function sS(a,y,x,E,b,z,tt){for(var ot=a.ac,rt=y,at=x;;){if(rt===b&&at===z)return!0;var ut=rt,ct=at;if(E===0)if(ut<b)ut++;else break;else if(E===90)if(ct<z)ct++;else break;else if(E===180)if(ut>b)ut--;else break;else if(ct>z)ct--;else break;var mt=ot[ut][ct];if(mt===0||mt===$v)break;rt=ut,at=ct}for(;;){if(ut=E,ct=rt,mt=at,E===0?mt<z?(ut=90,mt++):mt>z&&(ut=270,mt--):E===90?ct<b?(ut=0,ct++):ct>b&&(ut=180,ct--):E===180?mt<z?(ut=90,mt++):mt>z&&(ut=270,mt--):ct<b?(ut=0,ct++):ct>b&&(ut=180,ct--),ct=ot[ct][mt],ut!==E&&ct!==0&&ct!==$v){if(tt.push(rt),tt.push(at),sS(a,rt,at,ut,b,z,tt))return!0;tt.pop(),tt.pop()}if(ot[rt][at]=$v,E===0){if(rt===y)return!1;rt--}else if(E===90){if(at===x)return!1;at--}else if(E===180){if(rt===y)return!1;rt++}else{if(at===x)return!1;at++}}}Ie.Object.defineProperties(ep.prototype,{bounds:{get:function(){return new pe(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(a){0<a&&a!==this.rc&&(this.rc=a,this.initialize(this.bounds))}},Go:{get:function(){return this.sc},set:function(a){0<a&&a!==this.sc&&(this.sc=a,this.initialize(this.bounds))}}});var Vu=0,Sd=1,Lc=999999,qv=Lc+1,$v=Lc+2;ep.className="PositionArray";function df(){vi(this),this.port=this.node=null,this.pe=[],this.ap=!1}df.prototype.toString=function(){for(var a=this.pe,y=this.node.toString()+" "+a.length.toString()+":",x=0;x<a.length;x++){var E=a[x];E!==null&&(y+=`
`+E.toString())}return y};function Tx(a,y,x,E){switch(y=y.offsetY,y){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(y){case 9:return 180<x?270:90;case 6:return 90<x&&270>=x?180:0}switch(a=180*Math.atan2(a.height,a.width)/Math.PI,y){case 3:return x>a&&x<=180+a?180:270;case 5:return x>180-a&&x<=360-a?270:0;case 12:return x>a&&x<=180+a?90:0;case 10:return x>180-a&&x<=360-a?180:90;case 7:return 90<x&&x<=180+a?180:x>180+a&&x<=360-a?270:0;case 13:return 180<x&&x<=360-a?270:x>a&&180>=x?90:0;case 14:return x>a&&x<=180-a?90:x>180-a&&270>=x?180:0;case 11:return x>180-a&&x<=180+a?180:x>180+a?270:90}return E&&y!==15&&(x-=15,0>x&&(x+=360)),x>a&&x<180-a?90:x>=180-a&&x<=180+a?180:x>180+a&&x<360-a?270:0}df.prototype.Sl=function(){this.pe.length=0};function aS(a,y){var x=a.pe;if(x.length===0){t:if(!a.ap){x=a.ap,a.ap=!0;var E=null,b=a.node,z=b instanceof Jn?b:null;if(z===null||z.isSubGraphExpanded)var tt=b.isTreeExpanded?b.findLinksConnected(a.port.portId):b.qx();else{if(!z.actualBounds.w()){a.ap=x;break t}E=z,tt=E.Lu()}z=a.pe.length=0;var ot=a.port.ga(Sr,At.alloc()),rt=a.port.ga(ya,At.alloc());for(b=pe.allocAt(ot.x,ot.y,0,0),b.Ye(rt),At.free(ot),At.free(rt),ot=At.allocAt(b.x+b.width/2,b.y+b.height/2),rt=a.port.li(),tt=tt.iterator;tt.next();){var at=tt.value;if(at.isVisible()&&at.fromPort!==at.toPort){var ut=at.fromPort===a.port||at.fromNode!==null&&at.fromNode.Td(E),ct=at.computeSpot(ut,a.port);if(ct.$c()&&(ut=ut?at.toPort:at.fromPort,ut!==null)){var mt=ut.part;if(mt!==null){var yt=mt.findVisibleNode();yt!==null&&yt!==mt&&(mt=yt,ut=mt.port),ut=at.computeOtherPoint(mt,ut),mt=ot.ab(ut),mt-=rt,0>mt?mt+=360:360<=mt&&(mt-=360),ct=Tx(b,ct,mt,at.isOrthogonal),ct===0?(ct=4,180<mt&&(mt-=360)):ct===90?(ct=8,270<mt&&(mt-=360)):ct===180?ct=2:(ct=1,90>mt&&(mt+=360)),yt=a.pe[z],yt===void 0?(yt=new ty(at,mt,ct),a.pe[z]=yt):(yt.link=at,yt.angle=mt,yt.Nc=ct),yt.hv.set(ut),z++}}}}for(At.free(ot),a.pe.sort(df.prototype.j),rt=a.pe.length,E=-1,z=ot=0;z<rt;z++)tt=a.pe[z],tt!==void 0&&(tt.Nc!==E&&(E=tt.Nc,ot=0),tt.Uo=ot,ot++);for(E=-1,ot=0,z=rt-1;0<=z;z--)rt=a.pe[z],rt!==void 0&&(rt.Nc!==E&&(E=rt.Nc,ot=rt.Uo+1),rt.Gl=ot);if(z=a.pe,ct=a.port,E=a.node.portSpreading,ot=At.alloc(),rt=At.alloc(),tt=At.alloc(),at=At.alloc(),ct.ga(Sr,ot),ct.ga(qi,rt),ct.ga(ya,tt),ct.ga(rs,at),yt=mt=ut=ct=0,E===Wv)for(var St=0;St<z.length;St++){var Mt=z[St];if(Mt!==null){var Ot=Mt.link.computeThickness();switch(Mt.Nc){case 8:mt+=Ot;break;case 2:yt+=Ot;break;case 1:ct+=Ot;break;default:case 4:ut+=Ot}}}var bt=St=0,jt=1,Gt=Mt=0;for(Ot=0;Ot<z.length;Ot++){var Wt=z[Ot];if(Wt!==null){if(St!==Wt.Nc){switch(St=Wt.Nc,St){case 8:var Kt=tt;bt=at;break;case 2:Kt=at,bt=ot;break;case 1:Kt=ot,bt=rt;break;default:case 4:Kt=rt,bt=tt}switch(Mt=bt.x-Kt.x,Gt=bt.y-Kt.y,St){case 8:mt>Math.abs(Mt)?(jt=Math.abs(Mt)/mt,mt=Math.abs(Mt)):jt=1;break;case 2:yt>Math.abs(Gt)?(jt=Math.abs(Gt)/yt,yt=Math.abs(Gt)):jt=1;break;case 1:ct>Math.abs(Mt)?(jt=Math.abs(Mt)/ct,ct=Math.abs(Mt)):jt=1;break;default:case 4:ut>Math.abs(Gt)?(jt=Math.abs(Gt)/ut,ut=Math.abs(Gt)):jt=1}bt=0}var $t=Wt.Zo;if(E===Wv){switch(Wt=Wt.link.computeThickness(),Wt*=jt,$t.set(Kt),St){case 8:$t.x=Kt.x+Mt/2+mt/2-bt-Wt/2;break;case 2:$t.y=Kt.y+Gt/2+yt/2-bt-Wt/2;break;case 1:$t.x=Kt.x+Mt/2-ct/2+bt+Wt/2;break;default:case 4:$t.y=Kt.y+Gt/2-ut/2+bt+Wt/2}bt+=Wt}else{var Qe=.5;E===Hm&&(Qe=(Wt.Uo+1)/(Wt.Gl+1)),$t.x=Kt.x+Mt*Qe,$t.y=Kt.y+Gt*Qe}}}for(At.free(ot),At.free(rt),At.free(tt),At.free(at),Kt=a.pe,z=0;z<Kt.length;z++)E=Kt[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,pe.free(b)}x=a.pe}for(a=0;a<x.length;a++)if(b=x[a],b!==null&&b.link===y)return b;return null}df.prototype.j=function(a,y){return a===y?0:a===null?-1:y===null?1:a.Nc<y.Nc?-1:a.Nc>y.Nc?1:a.angle<y.angle?-1:a.angle>y.angle?1:0},df.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,hr,y.fromPort===this.port),E=a.Uo;if(0>E)return x;var b=a.Gl;if(1>=b||!y.isOrthogonal)return x;y=a.hv;var z=a.Zo;return(a.Nc===2||a.Nc===8)&&(E=b-1-E),((a=a.Nc===2||a.Nc===4)?y.y<z.y:y.x<z.x)?x+8*E:(a?y.y===z.y:y.x===z.x)?x:x+8*(b-1-E)},df.className="Knot";function ty(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new At,this.Gl=this.Uo=0,this.Zo=new At,this.Ju=0}ty.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Nc.toString()+":"+this.Uo.toString()+"/"+this.Gl.toString()+" "+this.Zo.toString()+" "+this.Ju.toString()+" "+this.hv.toString()},ty.className="LinkInfo";function xo(a){vi(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new At(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}xo.prototype.cloneProtected=function(a){a.sn=this.sn,a.Gh=this.Gh,a.yn=this.yn,a.Am.assign(this.Am),a.vn=this.vn,a.un=this.un,a.Em=this.Em,a.xn=!0},xo.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},xo.prototype.qb=function(){},xo.prototype.toString=function(){var a=ti(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},xo.prototype.C=function(){if(this.isValidLayout){var a=this.diagram;if(a!==null&&!a.undoManager.isUndoingRedoing){var y=a.animationManager;!y.isTicking&&(y.defaultAnimation.isAnimating&&y.Cc(),this.isOngoing&&a.pi||this.isInitial&&!a.pi)&&(this.isValidLayout=!1,a.$b())}}},xo.prototype.createNetwork=function(){return new oo(this)},xo.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof te?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof Jn?y.lg(a.memberParts):y.lg(a.iterator),y},xo.prototype.updateParts=function(){this.isValidLayout=!0;var a=this.diagram;if(a===null&&this.network!==null)for(var y=this.network.vertexes.iterator;y.next();){var x=y.value.node;if(x!==null&&(a=x.diagram,a!==null))break}try{a!==null&&a.Ea("Layout"),this.commitLayout()}finally{a!==null&&a.eb("Layout")}},xo.prototype.commitLayout=function(){if(this.network!==null){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();if(this.isRouting)for(a=this.network.edges.iterator;a.next();)a.value.commit()}},xo.prototype.doLayout=function(a){var y=new ke;a instanceof te?(Nh(this,y,a.nodes,!0,this.rh,!0,!1,!0),Nh(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof Jn?Nh(this,y,a.memberParts,!1,this.rh,!0,!1,!0):y.addAll(a.iterator),0<y.count&&(a=this.diagram,a!==null&&a.Ea("Layout"),this.doMinimalNoNetworkLayout(y),a!==null&&a.eb("Layout")),this.isValidLayout=!0},xo.prototype.doMinimalNoNetworkLayout=function(a){var y=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var x=this.arrangementOrigin.x,E=x,b=this.arrangementOrigin.y,z=0,tt=0;for(a=a.iterator;a.next();){var ot=a.value;np(ot);var rt=ot.measuredBounds,at=rt.width;rt=rt.height,ot.moveTo(E,b),ot instanceof Jn&&(ot.rh=!1),E+=Math.max(at,50)+20,tt=Math.max(tt,Math.max(rt,50)),z>=y-1?(z=0,E=x,b+=tt+20,tt=0):z++}},xo.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var y=this.arrangementOrigin.x,x=y,E=this.arrangementOrigin.y,b=0,z=0,tt=this.network.vertexes.iterator;tt.next();){var ot=tt.value.node;if(!(ot===null||ot instanceof Ue)&&(np(ot),this.rh(ot))){var rt=ot.measuredBounds,at=rt.width;rt=rt.height,ot.moveTo(x,E),ot instanceof Jn&&(ot.rh=!1),x+=Math.max(at,50)+20,z=Math.max(z,Math.max(rt,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},xo.prototype.rh=function(a){return!!(!a.location.w()||a instanceof Jn&&a.rh)};function Nh(a,y,x,E,b,z,tt,ot){for(x=x.iterator;x.next();){var rt=x.value;E&&!rt.isTopLevel||b!==null&&!b(rt)||!rt.canLayout()||(z&&rt instanceof tn?rt.isLinkLabel||(rt instanceof Jn&&rt.layout===null?Nh(a,y,rt.memberParts,!1,b,z,tt,ot):(np(rt),y.add(rt))):tt&&rt instanceof Ue?y.add(rt):!ot||!rt.Zc()||rt instanceof tn||(np(rt),y.add(rt)))}}function np(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}xo.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new pe),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},xo.prototype.ex=function(a){var y=new ke;return a instanceof te?(Nh(this,y,a.nodes,!0,null,!0,!0,!0),Nh(this,y,a.links,!0,null,!0,!0,!0),Nh(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof Jn?Nh(this,y,a.memberParts,!1,null,!0,!0,!0):Nh(this,y,a.iterator,!1,null,!0,!0,!0),y},xo.prototype.initialOrigin=function(a){var y=this.group;if(y!==null){var x=y.position.copy();return(isNaN(x.x)||isNaN(x.y))&&x.set(a),y=y.placeholder,y!==null&&(x=y.ga(Sr),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},Ie.Object.defineProperties(xo.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},group:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a,a!==null&&(this.H=a.diagram))}},isOngoing:{get:function(){return this.sn},set:function(a){this.sn!==a&&(this.sn=a)}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a,a||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(a){this.yn!==a&&(this.yn=a)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(a){this.vn!==a&&(this.vn=a)}},isRealtime:{get:function(){return this.un},set:function(a){this.un!==a&&(this.un=a)}},isValidLayout:{get:function(){return this.xn},set:function(a){this.xn!==a&&(this.xn=a,a||(a=this.diagram,a!==null&&(a.xh=!0)))}},network:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,a!==null&&(a.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(a){this.Em!==a&&(this.Em=a,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(a){this.Am.D(a)||(this.Am.assign(a),this.C())}}}),xo.prototype.collectParts=xo.prototype.ex,xo.prototype.getLayoutBounds=xo.prototype.ni,xo.prototype.invalidateLayout=xo.prototype.C,xo.className="Layout";function oo(a){vi(this),this.Sc=a,this.wf=new ke,this.ye=new ke,this.Es=new qe,this.zs=new qe}oo.prototype.clear=function(){if(this.wf)for(var a=this.wf.iterator;a.next();)a.value.clear();if(this.ye)for(a=this.ye.iterator;a.next();)a.value.clear();this.wf=new ke,this.ye=new ke,this.Es=new qe,this.zs=new qe},oo.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(0>=a)return y;if(y+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1<a){for(var x=this.wf.iterator;x.next();)y+=`
`+x.value.toString(a-1);for(x=this.ye.iterator;x.next();)y+=`
`+x.value.toString(a-1)}return y},oo.prototype.createVertex=function(){return new ur(this)},oo.prototype.createEdge=function(){return new ta(this)},oo.prototype.lg=function(a,y,x){if(a!==null){for(y===void 0&&(y=!1),x===void 0&&(x=null),x===null&&(x=function(tt){if(tt instanceof tn)return!tt.isLinkLabel;if(tt instanceof Ue){var ot=tt.fromNode;return ot===null||ot.isLinkLabel?!1:(tt=tt.toNode,!(tt===null||tt.isLinkLabel))}return!1}),a=a.iterator;a.next();){var E=a.value;if(E instanceof tn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof Jn&&E.layout===null)this.lg(E.memberParts,!1);else if(this.ki(E)===null){var b=this.createVertex();b.node=E,this.dh(b)}}}for(a.reset();a.next();)if(E=a.value,E instanceof Ue&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)&&this.Lo(E)===null){var z=E.fromNode;b=E.toNode,z!==null&&b!==null&&z!==b&&(z=this.findGroupVertex(z),b=this.findGroupVertex(b),z!==null&&b!==null&&this.Zj(z,b,E))}}},oo.prototype.findGroupVertex=function(a){if(a===null)return null;var y=a.findVisibleNode();if(y===null)return null;if(a=this.ki(y),a!==null)return a;for(y=y.containingGroup;y!==null;){if(a=this.ki(y),a!==null)return a;y=y.containingGroup}return null},xt=oo.prototype,xt.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},xt.Bl=function(a){if(a===null)return null;var y=this.ki(a);return y===null&&(y=this.createVertex(),y.node=a,this.dh(y)),y},xt.Iu=function(a){if(a!==null&&lS(this,a)){for(var y=a.tg,x=y.count-1;0<=x;x--){var E=y.M(x);this.Mj(E)}for(y=a.mg,a=y.count-1;0<=a;a--)x=y.M(a),this.Mj(x)}};function lS(a,y){if(y===null)return!1;var x=a.wf.remove(y);return x&&(y=y.node,y!==null&&a.Es.remove(y)),x}xt.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},xt.ki=function(a){return a===null?null:this.Es.I(a)},xt.Bo=function(a){if(a!==null){ey(this,a);var y=a.toVertex;y!==null&&y.Cl(a),y=a.fromVertex,y!==null&&y.zl(a)}};function ey(a,y){if(y!==null){a.ye.add(y);var x=y.link;x!==null&&a.Lo(x)===null&&a.zs.add(x,y),y.network=a}}xt.Dy=function(a){if(a===null)return null;var y=a.fromNode,x=a.toNode,E=this.Lo(a);return E===null?(E=this.createEdge(),E.link=a,y!==null&&(E.fromVertex=this.Bl(y)),x!==null&&(E.toVertex=this.Bl(x)),this.Bo(E)):(y!==null?E.fromVertex=this.Bl(y):E.fromVertex=null,x!==null?E.toVertex=this.Bl(x):E.toVertex=null),E},xt.Mj=function(a){if(a!==null){var y=a.toVertex;y!==null&&y.Kl(a),y=a.fromVertex,y!==null&&y.Jl(a),ny(this,a)}};function ny(a,y){y!==null&&a.ye.remove(y)&&(y=y.link,y!==null&&a.zs.remove(y))}xt.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},xt.Lo=function(a){return a===null?null:this.zs.I(a)},xt.Zj=function(a,y,x){if(a===null||y===null)return null;if(a.network===this&&y.network===this){var E=this.createEdge();return E.link=x,E.fromVertex=a,E.toVertex=y,this.Bo(E),E}return null},xt.gm=function(a){if(a!==null){var y=a.fromVertex,x=a.toVertex;y!==null&&x!==null&&(y.Jl(a),x.Kl(a),a.gm(),y.Cl(a),x.zl(a))}},xt.Ko=function(){for(var a=Un(),y=this.ye.iterator;y.next();){var x=y.value;x.fromVertex===x.toVertex&&a.push(x)}for(y=a.length,x=0;x<y;x++)this.Mj(a[x]);_n(a)},oo.prototype.deleteArtificialVertexes=function(){for(var a=Un(),y=this.wf.iterator;y.next();){var x=y.value;x.node===null&&x.data===null&&a.push(x)}for(x=a.length,y=0;y<x;y++)this.Iu(a[y]);for(y=Un(),x=this.ye.iterator;x.next();){var E=x.value;E.link===null&&E.data===null&&y.push(E)}for(x=y.length,E=0;E<x;E++)this.Mj(y[E]);_n(a),_n(y)};function Fx(a){for(var y=Un(),x=a.ye.iterator;x.next();){var E=x.value;E.fromVertex!==null&&E.toVertex!==null||y.push(E)}for(x=y.length,E=0;E<x;E++)a.Mj(y[E]);_n(y)}oo.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Fx(this),this.Ko()),a=new be;for(var y=!0;y;){y=!1;for(var x=this.wf.iterator;x.next();){var E=x.value;if(0<E.tg.count||0<E.mg.count){y=this.layout.createNetwork(),a.add(y),iy(this,y,E),y=!0;break}}}return a.sort(function(b,z){return b===null||z===null||b===z?0:z.vertexes.count-b.vertexes.count}),a};function iy(a,y,x){if(x!==null&&x.network!==y){lS(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(ny(a,b),ey(y,b),iy(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(ny(a,x),ey(y,x),iy(a,y,x.toVertex))}}oo.prototype.dz=function(){for(var a=new ke,y=this.wf.iterator;y.next();)a.add(y.value.node);for(y=this.ye.iterator;y.next();)a.add(y.value.link);return a},Ie.Object.defineProperties(oo.prototype,{layout:{get:function(){return this.Sc},set:function(a){a!==null&&(this.Sc=a)}},vertexes:{get:function(){return this.wf}},edges:{get:function(){return this.ye}}}),oo.prototype.findAllParts=oo.prototype.dz,oo.prototype.splitIntoSubNetworks=oo.prototype.Zx,oo.prototype.deleteSelfEdges=oo.prototype.Ko,oo.prototype.reverseEdge=oo.prototype.gm,oo.prototype.linkVertexes=oo.prototype.Zj,oo.prototype.findEdge=oo.prototype.Lo,oo.prototype.deleteLink=oo.prototype.Yy,oo.prototype.deleteEdge=oo.prototype.Mj,oo.prototype.addLink=oo.prototype.Dy,oo.prototype.addEdge=oo.prototype.Bo,oo.prototype.findVertex=oo.prototype.ki,oo.prototype.deleteNode=oo.prototype.Zy,oo.prototype.deleteVertex=oo.prototype.Iu,oo.prototype.addNode=oo.prototype.Bl,oo.prototype.addVertex=oo.prototype.dh,oo.prototype.addParts=oo.prototype.lg,oo.className="LayoutNetwork";function ur(a){vi(this),this.ob=a,this.j=new pe(0,0,10,10).freeze(),this.o=new At(5,5).freeze(),this.Sh=this.ub=null,this.tg=new be,this.mg=new be}ur.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new be,this.mg=new be},ur.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+qt(this);if(0<a&&(y+=this.node!==null?"("+this.node.toString()+")":"",1<a)){a="";for(var x=!0,E=this.tg.iterator;E.next();){var b=E.value;x?x=!1:a+=",",a+=b.toString(0)}for(b="",x=!0,E=this.mg.iterator;E.next();){var z=E.value;x?x=!1:b+=",",b+=z.toString(0)}y+=" sources: "+a+" destinations: "+b}return y},ur.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;Ve(x)?(x.x=y.x,x.y=y.y,x.width=y.width,x.height=y.height):a.bounds=y.copy()}else if(a=this.node,a!==null){if(y=this.bounds,!(a instanceof Jn)){x=pe.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(Mi);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),pe.free(x);return}pe.free(x)}a.moveTo(y.x,y.y)}},ur.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},ur.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},ur.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},ur.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function oy(a,y){return a=a.Sh,y=y.Sh,a?y?(a=a.text,y=y.text,a<y?-1:a>y?1:0):1:y!==null?-1:0}Ie.Object.defineProperties(ur.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(a){if(this.ub=a,a!==null&&a.bounds){var y=a.bounds;a=y.x;var x=y.y,E=y.width;y=y.height,this.o.h(E/2,y/2),this.j.h(a,x,E,y)}}},node:{get:function(){return this.Sh},set:function(a){if(this.Sh!==a){this.Sh=a,a.Va();var y=this.network.layout,x=pe.alloc(),E=y.ni(a,x);y=E.x;var b=E.y,z=E.width;if(E=E.height,isNaN(y)&&(y=0),isNaN(b)&&(b=0),this.j.h(y,b,z,E),pe.free(x),!(a instanceof Jn)&&(a=a.locationObject.ga(Mi),a.w())){this.o.h(a.x-y,a.y-b);return}this.o.h(z/2,E/2)}}},bounds:{get:function(){return this.j},set:function(a){this.j.D(a)||this.j.assign(a)}},focus:{get:function(){return this.o},set:function(a){this.o.D(a)||this.o.assign(a)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(a){var y=this.j;y.x+this.o.x!==a&&(y.ka(),y.x=a-this.o.x,y.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(a){var y=this.j;y.y+this.o.y!==a&&(y.ka(),y.y=a-this.o.y,y.freeze())}},focusX:{get:function(){return this.o.x},set:function(a){var y=this.o;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},focusY:{get:function(){return this.o.y},set:function(a){var y=this.o;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},x:{get:function(){return this.j.x},set:function(a){var y=this.j;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},y:{get:function(){return this.j.y},set:function(a){var y=this.j;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},width:{get:function(){return this.j.width},set:function(a){var y=this.j;y.width!==a&&(y.ka(),y.width=a,y.freeze())}},height:{get:function(){return this.j.height},set:function(a){var y=this.j;y.height!==a&&(y.ka(),y.height=a,y.freeze())}},network:{get:function(){return this.ob},set:function(a){this.ob=a}},sourceVertexes:{get:function(){for(var a=new ke,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new ke,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new ke,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);for(y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.tg.iterator}},destinationEdges:{get:function(){return this.mg.iterator}},edges:{get:function(){for(var a=new be,y=this.sourceEdges;y.next();)a.add(y.value);for(y=this.destinationEdges;y.next();)a.add(y.value);return a.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}}),ur.prototype.deleteDestinationEdge=ur.prototype.Jl,ur.prototype.addDestinationEdge=ur.prototype.zl,ur.prototype.deleteSourceEdge=ur.prototype.Kl,ur.prototype.addSourceEdge=ur.prototype.Cl,ur.className="LayoutVertex",ur.standardComparer=oy,ur.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.Sh;var x=y.Sh;if(a!==null){if(x!==null){for(y=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),a=x.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),x=0;x<y.length;x++)if(a[x]!==""&&a[x]!==void 0){var E=parseFloat(y[x]),b=parseFloat(a[x]);if(isNaN(E))if(isNaN(b)){if(y[x].localeCompare(a[x])!==0)return y[x].localeCompare(a[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(y[x]!=="")return 1;return a[x]!==""&&a[x]!==void 0?-1:0}return 1}return x!==null?-1:0}return 1}return y!==null?-1:0};function ta(a){vi(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}ta.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},ta.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+qt(this);return 0<a&&(y+=this.$k!==null?"("+this.$k.toString()+")":"",1<a&&(y+=" "+(this.kd?this.kd.toString():"null")+" --> "+(this.qd?this.qd.toString():"null"))),y},ta.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},ta.prototype.commit=function(){},ta.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},Ie.Object.defineProperties(ta.prototype,{network:{get:function(){return this.nb},set:function(a){this.nb=a}},data:{get:function(){return this.ub},set:function(a){this.ub!==a&&(this.ub=a)}},link:{get:function(){return this.$k},set:function(a){this.$k!==a&&(this.$k=a)}},fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}}}),ta.prototype.getOtherVertex=ta.prototype.Ax,ta.className="LayoutEdge";function Fr(a){xo.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new Le(NaN,NaN).freeze(),this.tf=new Le(10,10).freeze(),this.Jb=ip,this.Rb=n0,this.nd=op,this.hd=uS,a&&Object.assign(this,a)}ee(Fr,xo),Fr.prototype.cloneProtected=function(a){xo.prototype.cloneProtected.call(this,a),a.zo=this.zo,a.yo=this.yo,a.yg.assign(this.yg),a.tf.assign(this.tf),a.Jb=this.Jb,a.Rb=this.Rb,a.nd=this.nd,a.hd=this.hd},Fr.prototype.qb=function(a){a.classType===Fr?a===op||a===o0||a===ry||a===i0?this.sorting=a:a===n0||a===ll?this.arrangement=a:a===ip||a===e0?this.alignment=a:de("Unknown enum value: "+a):xo.prototype.qb.call(this,a)},Fr.prototype.doLayout=function(a){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var y=this.ex(a);a=this.diagram;for(var x=y.copy().iterator;x.next();){var E=x.value;if(!E.ph()||E.fromNode===null&&E.toNode===null){if(E.Va(),E instanceof Jn)for(E=E.memberParts;E.next();)y.remove(E.value)}else y.remove(E)}var b=y.Fa();if(b.length!==0){switch(this.sorting){case i0:b.reverse();break;case op:b.sort(this.comparer);break;case o0:b.sort(this.comparer),b.reverse()}var z=this.wrappingColumn;isNaN(z)&&(z=0);var tt=this.wrappingWidth;switch(isNaN(tt)&&a!==null?(y=a.padding,tt=Math.max(a.viewportBounds.width-y.left-y.right,0)):tt=Math.max(this.wrappingWidth,0),0>=z&&0>=tt&&(z=1),y=this.spacing.width,isFinite(y)||(y=0),x=this.spacing.height,isFinite(x)||(x=0),a!==null&&a.Ea("Layout"),E=[],this.alignment){case e0:var ot=y,rt=x,at=pe.alloc(),ut=Math.max(this.cellSize.width,1);if(!isFinite(ut))for(var ct=ut=0;ct<b.length;ct++){var mt=this.ni(b[ct],at);ut=Math.max(ut,mt.width)}if(ut=Math.max(ut+ot,1),ct=Math.max(this.cellSize.height,1),!isFinite(ct))for(mt=ct=0;mt<b.length;mt++){var yt=this.ni(b[mt],at);ct=Math.max(ct,yt.height)}ct=Math.max(ct+rt,1),mt=this.arrangement;for(var St=yt=this.arrangementOrigin.x,Mt=this.arrangementOrigin.y,Ot=0,bt=0,jt=0;jt<b.length;jt++){var Gt=b[jt],Wt=this.ni(Gt,at),Kt=Math.ceil((Wt.width+ot)/ut)*ut,$t=Math.ceil((Wt.height+rt)/ct)*ct;switch(mt){case ll:var Qe=Math.abs(St-Wt.width);break;default:Qe=St+Wt.width}switch((0<z&&Ot>z-1||0<tt&&0<Ot&&Qe-yt>tt)&&(E.push(new pe(0,Mt,tt+ot,bt)),Ot=0,St=yt,Mt+=bt,bt=0),bt=Math.max(bt,$t),mt){case ll:Wt=-Wt.width;break;default:Wt=0}switch(Gt.moveTo(St+Wt,Mt),mt){case ll:St-=Kt;break;default:St+=Kt}Ot++}E.push(new pe(0,Mt,tt+ot,bt)),pe.free(at);break;case ip:for(rt=tt,ut=z,ct=y,mt=x,tt=pe.alloc(),yt=Math.max(this.cellSize.width,1),z=Mt=at=0,ot=At.alloc(),St=0;St<b.length;St++)bt=b[St],Ot=this.ni(bt,tt),bt=Gu(bt,bt.locationObject,bt.locationSpot,ot),at=Math.max(at,bt.x),Mt=Math.max(Mt,Ot.width-bt.x),z=Math.max(z,bt.y);switch(St=this.arrangement,St){case ll:at+=ct;break;default:Mt+=ct}yt=isFinite(yt)?Math.max(yt+ct,1):Math.max(at+Mt,1);var dn=bt=this.arrangementOrigin.x;for(jt=this.arrangementOrigin.y,Mt=0,rt>=at&&(rt-=at),at=Gt=0,Kt=Math.max(this.cellSize.height,1),Wt=z=0,$t=!0,Ot=At.alloc(),Qe=0;Qe<b.length;Qe++){var rn=b[Qe],We=this.ni(rn,tt),Ee=Gu(rn,rn.locationObject,rn.locationSpot,ot);if(0<Mt)switch(St){case ll:dn=(dn-bt-(We.width-Ee.x))/yt,dn=Jt.$(Math.round(dn),dn)?Math.round(dn):Math.floor(dn),dn=dn*yt+bt;break;default:dn=(dn-bt+Ee.x)/yt,dn=Jt.$(Math.round(dn),dn)?Math.round(dn):Math.ceil(dn),dn=dn*yt+bt}else switch(St){case ll:Gt=dn+Ee.x+We.width;break;default:Gt=dn-Ee.x}switch(St){case ll:var Zn=-(dn+Ee.x)+Gt;break;default:Zn=dn+We.width-Ee.x-Gt}if(0<ut&&Mt>ut-1||0<rt&&0<Mt&&Zn>rt){for(E.push(new pe(0,$t?jt-z:jt,rt+ct,Wt+z+mt)),dn=0;dn<Mt&&Qe!==Mt;dn++){Zn=b[Qe-Mt+dn];var zn=Gu(Zn,Zn.locationObject,Zn.locationSpot,Ot);Zn.moveTo(Zn.position.x,Zn.position.y+z-zn.y)}Wt+=mt,jt=$t?jt+Wt:jt+(Wt+z),Mt=Wt=z=0,dn=bt,$t=!1}switch(dn===bt&&(at=St===ll?Math.max(at,We.width-Ee.x):Math.min(at,-Ee.x)),z=Math.max(z,Ee.y),Wt=Math.max(Wt,We.height-Ee.y),isFinite(Kt)&&(Wt=Math.max(Wt,Math.max(We.height,Kt)-Ee.y)),$t?rn.moveTo(dn-Ee.x,jt-Ee.y):rn.moveTo(dn-Ee.x,jt),St){case ll:dn-=Ee.x+ct;break;default:dn+=We.width-Ee.x+ct}Mt++}if(E.push(new pe(0,jt,rt+ct,($t?Wt:Wt+z)+mt)),b.length!==Mt)for(rt=0;rt<Mt;rt++)ut=b[b.length-Mt+rt],ct=Gu(ut,ut.locationObject,ut.locationSpot,ot),ut.moveTo(ut.position.x,ut.position.y+z-ct.y);if(At.free(ot),At.free(Ot),St===ll)for(b=0;b<E.length;b++)z=E[b],z.width+=at,z.x-=at;else for(b=0;b<E.length;b++)z=E[b],z.x>at&&(z.width+=z.x-at,z.x=at);pe.free(tt)}for(ot=z=tt=b=0;ot<E.length;ot++)rt=E[ot],b=Math.min(b,rt.x),tt=Math.min(tt,rt.y),z=Math.max(z,rt.x+rt.width);this.arrangement===ll?this.commitLayers(E,new At(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new At(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Fr.prototype.commitLayers=function(){};function uS(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}Ie.Object.defineProperties(Fr.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(a){this.zo!==a&&(0<a||isNaN(a))&&(this.zo=a,this.isViewportSized=isNaN(a),this.C())}},wrappingColumn:{get:function(){return this.yo},set:function(a){this.yo!==a&&(0<a||isNaN(a))&&(this.yo=a,this.C())}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||(this.yg.assign(a),this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf.D(a)||(this.tf.assign(a),this.C())}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb===a||a!==ip&&a!==e0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==n0&&a!==ll||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==ry&&a!==i0&&a!==op&&a!==o0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var e0=new ae(Fr,"Position",0),ip=new ae(Fr,"Location",1),n0=new ae(Fr,"LeftToRight",2),ll=new ae(Fr,"RightToLeft",3),ry=new ae(Fr,"Forward",4),i0=new ae(Fr,"Reverse",5),op=new ae(Fr,"Ascending",6),o0=new ae(Fr,"Descending",7);Fr.className="GridLayout",Fr.standardComparer=uS,Fr.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),y=y.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(var x=0;x<a.length;x++)if(y[x]!==""&&y[x]!==void 0){var E=parseFloat(a[x]),b=parseFloat(y[x]);if(isNaN(E))if(isNaN(b)){if(a[x].localeCompare(y[x])!==0)return a[x].localeCompare(y[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(a[x]!=="")return 1;return y[x]!==""&&y[x]!==void 0?-1:0}return 1}return y!==null?-1:0},Fr.Position=e0,Fr.Location=ip,Fr.LeftToRight=n0,Fr.RightToLeft=ll,Fr.Forward=ry,Fr.Reverse=i0,Fr.Ascending=op,Fr.Descending=o0;function Xi(){this.On=new ke,this.Dn=new ke,this.Pa=new ke,this.cf=new qe,this.bf=new qe,this.aj=new qe,this.H=null,this.tp=!1}xt=Xi.prototype,xt.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},xt.Xe=function(a){this.H=a},xt.oi=function(a){if(a instanceof tn){if(this.On.add(a),a instanceof Jn){var y=a.containingGroup;y===null?this.H.ai.add(a):y.gl.add(a),y=a.layout,y!==null&&(y.diagram=this.H)}}else a instanceof Ue?this.Dn.add(a):a instanceof Ai||this.Pa.add(a);y=a.data,y===null||a instanceof Ai||(a instanceof Ue?this.bf.add(y,a):this.cf.add(y,a))},xt.pc=function(a){if(a.Ej(),a instanceof tn){if(this.On.remove(a),a instanceof Jn){var y=a.containingGroup;y===null?this.H.ai.remove(a):y.gl.remove(a),y=a.layout,y!==null&&(y.diagram=null)}}else a instanceof Ue?this.Dn.remove(a):a instanceof Ai||this.Pa.remove(a);y=a.data,y===null||a instanceof Ai||(a instanceof Ue?this.bf.remove(y):this.cf.remove(y))},xt.Wd=function(){var a=this.H;if(a!==null){for(var y=a.nodeTemplateMap.iterator;y.next();){var x=y.value,E=y.key;(!x.Zc()||x instanceof Jn)&&de('Invalid node template in Diagram.nodeTemplateMap: template for "'+E+'" must be a Node or a simple Part, not a Group or Link: '+x)}for(y=a.groupTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof Jn||de('Invalid group template in Diagram.groupTemplateMap: template for "'+E+'" must be a Group, not a normal Node or Link: '+x);for(y=a.linkTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof Ue||de('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=Un(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=Un(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=Un(),E=this.nodes.iterator;E.next();){var b=E.value;b.data!==null&&(a.push(b.data),a.push(b.location))}for(E=this.links.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(E=this.parts.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),E=0;E<y.length;E++)b=this.Lc(y[E]),b!==null&&(b.isSelected=!0);for(E=0;E<x.length;E++)b=this.Lc(x[E]),b!==null&&(b.isHighlighted=!0);for(E=0;E<a.length;E+=2)b=this.Lc(a[E]),b!==null&&(b.location=a[E+1]);_n(y),_n(x),_n(a)}},Xi.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},Xi.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&hS(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&$f(this.diagram,!1)};function hS(a,y,x){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(y)){x===void 0&&(x=!0);t:{if(y!=null&&!a.H.undoManager.isUndoingRedoing&&!a.cf.contains(y)){var E=a.Ro(y),b=dS(a,y,E);if(b!==null&&(za(b),b=b.copy(),b!==null)){var z=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,b.Tf=E,b.ub=y,a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=z,E=b;break t}}E=null}E!==null&&x&&a.resolveReferencesForData(y)}}Xi.prototype.insertLink=function(){return null},Xi.prototype.resolveReferencesForData=function(){},Xi.prototype.Ro=function(a){return this.H.model.Ro(a)};function dS(a,y,x){a=a.H;var E=a.model;return E.Xj()&&E.Yu(y)?(y=a.groupTemplateMap.I(x),y===null&&(y=a.groupTemplateMap.I(""),y===null&&(gS||(gS=!0,Di('No Group template found for category "'+x+'"'),Di(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(cS||(cS=!0,Di('No Node template found for category "'+x+'"'),Di(" Using default node template")),y=a.ny))),y}Xi.prototype.getLinkCategoryForData=function(){return""},Xi.prototype.setLinkCategoryForData=function(){},Xi.prototype.setFromNodeForLink=function(){},Xi.prototype.setToNodeForLink=function(){},Xi.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(pS||(pS=!0,Di('No Link template found for category "'+a+'"'),Di(" Using default link template")),x=y.my)),x},Xi.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},Xi.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},Xi.prototype.ip=function(a){a=this.Lc(a),a!==null&&(yg(this.diagram,a,!1),this.unresolveReferencesForPart(a))},Xi.prototype.unresolveReferencesForPart=function(){},Xi.prototype.removeDataForLink=function(){},Xi.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},Xi.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof tn?a:null)},Xi.prototype.findLinkForKey=function(){return null},xt=Xi.prototype,xt.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},xt.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof tn?a:null)},xt.Kc=function(a){return a===null?null:this.bf.I(a)},xt.ms=function(a){for(var y=0;y<arguments.length;++y);y=new ke;for(var x=this.On.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Ve(tt)&&sy(this,b,tt)){y.add(E);break}}}return y.iterator},xt.ls=function(a){for(var y=0;y<arguments.length;++y);y=new ke;for(var x=this.Dn.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Ve(tt)&&sy(this,b,tt)){y.add(E);break}}}return y.iterator};function sy(a,y,x){for(var E in x){var b=y[E],z=x[E];if(jn(z)){if(!jn(b)||b.length<z.length)return!1;for(var tt=0;tt<b.length;tt++){var ot=z[tt];if(ot!==void 0&&!fS(a,b[tt],ot))return!1}}else if(!fS(a,b,z))return!1}return!0}function fS(a,y,x){if(typeof x=="function"){if(!x(y))return!1}else if(x instanceof RegExp){if(!y||!x.test(y.toString()))return!1}else if(Ve(y)&&Ve(x)){if(!sy(a,y,x))return!1}else if(y!==x)return!1;return!0}Xi.prototype.doModelChanged=function(a){if(this.H){var y=this.H;if(a.model===y.model){var x=a.change;if(y.doModelChanged(a),y.aa){y.aa=!1;try{var E=a.modelChange;if(E!=="")if(x===Eo){if(E==="nodeCategory"){var b=this.Lc(a.object),z=a.newValue;b!==null&&typeof z=="string"&&(b.category=z)}else E==="nodeDataArray"&&(this.Gs(a.oldValue),this.addModeledParts(a.newValue));y.isModified=!0}else if(x===Ko){var tt=a.newValue;E==="nodeDataArray"&&Ve(tt)&&hS(this,tt),y.isModified=!0}else if(x===ar){var ot=a.oldValue;E==="nodeDataArray"&&Ve(ot)&&this.ip(ot),y.isModified=!0}else x===Js&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===Eo){var rt=a.propertyName,at=a.object;at===y.model?(rt==="nodeKeyProperty"||rt==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(at,rt),y.isModified=!0}else if(x===Ko||x===ar){var ut=a.change===Ko,ct=ut?a.newParam:a.oldParam,mt=ut?a.newValue:a.oldValue,yt=this.aj.I(a.object);if(Array.isArray(yt))for(a=0;a<yt.length;a++){var St=yt[a];if(ut)Cm(St,mt,ct,!0);else if(!(0>ct)){var Mt=ct+zg(St);St.pc(Mt,!0),xv(St,Mt,ct)}}y.isModified=!0}}finally{y.aa=!0}}}}},Xi.prototype.updateAllTargetBindings=function(a){a===void 0&&(a="");for(var y=this.parts.iterator;y.next();)y.value.La(a);for(y=this.nodes.iterator;y.next();)y.value.La(a);for(y=this.links.iterator;y.next();)y.value.La(a)},Xi.prototype.rp=function(){for(var a=this.H.model,y=new ke,x=a.nodeDataArray,E=0;E<x.length;E++)y.add(x[E]);var b=[];for(this.nodes.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),this.parts.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),b.forEach(function(tt){LS(a,tt,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&CS(a,z,!1)}for(this.refreshDataBoundLinks(),x=this.parts.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.nodes.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.links.iterator;x.next();)x.value.updateRelationshipsFromData()},Xi.prototype.refreshDataBoundLinks=function(){},Xi.prototype.updateRelationshipsFromData=function(){},Xi.prototype.updateDataBindings=function(a,y){if(typeof y=="string"){var x=this.Lc(a);if(x!==null)x.La(y);else{x=null;for(var E=this.aj.iterator;E.next();){for(var b=E.value,z=0;z<b.length;z++){var tt=b[z].sx(a);tt!==null&&(x===null&&(x=Un()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);_n(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function ay(a,y){var x=y.Hh;if(jn(x)){var E=a.aj.I(x);if(E===null)E=[],E.push(y),a.aj.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}function ly(a,y,x){gd(y,function(tt){tt=tt.O.s;for(var ot=tt.length,rt=0;rt<ot;rt++)Cg(x,tt[rt])});var E=y.Hh;if(jn(E)){var b=a.aj.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&a.aj.remove(E);break}}}}Xi.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new qe;if(jn(a))for(var b=0;b<a.length;b++)r0(this,a[b],y,E,x);else for(a=a.iterator;a.next();)r0(this,a.value,y,E,x);if(y!==null){x=y.model,a=y.toolManager.findTool("Dragging"),a=a!==null?a.dragOptions.dragsLink:y.Wm.dragsLink,b=new ke;for(var z=new qe,tt=E.iterator;tt.next();){var ot=tt.value;if(ot instanceof Ue)a||ot.fromNode!==null&&ot.toNode!==null||b.add(ot);else if(ot instanceof tn&&ot.data!==null&&x.Tl()){var rt=ot;ot=tt.key;var at=ot.pg();at!==null&&(at=E.I(at),at!==null?(x.qe(rt.data,x.wa(at.data)),rt=y.Kc(rt.data),ot=ot.kh(),ot!==null&&rt!==null&&z.add(ot,rt)):x.qe(rt.data,void 0))}}if(0<b.count&&y.Is(b,!1),0<z.count)for(x=z.iterator;x.next();)E.add(x.key,x.value)}if(y!==null&&this.H!==null&&(y=y.model,x=y.afterCopyFunction,x!==null)){var ut=new qe;E.each(function(ct){ct.key.data!==null&&ut.add(ct.key.data,ct.value.data)}),x(ut,y,this.H.model)}for(y=E.iterator;y.next();)y.value.La();return E};function r0(a,y,x,E,b){if(y===null||b&&!y.canCopy())return null;if(E.contains(y))return E.I(y);var z=a.copyPartData(y,x);if(!(z instanceof Ln))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof tn){for(var tt=y.linksConnected;tt.next();){var ot=tt.value;if(ot.fromNode===y){var rt=E.I(ot);rt!==null&&(rt.fromNode=z)}ot.toNode===y&&(ot=E.I(ot),ot!==null&&(ot.toNode=z))}if(y instanceof Jn&&z instanceof Jn)for(y=y.memberParts;y.next();)tt=r0(a,y.value,x,E,b),tt instanceof Ue||tt===null||(tt.containingGroup=z)}else if(y instanceof Ue&&z instanceof Ue)for(tt=y.fromNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.fromNode=tt)),tt=y.toNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.toNode=tt)),y=y.labelNodes;y.next();)tt=r0(a,y.value,x,E,b),tt!==null&&tt instanceof tn&&(tt.labeledLink=z);return z}Xi.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof Ue||(E=b.copyNodeData(E),Ve(E)&&(b.xf(E),x=y.Lc(E)))}else za(a),x=a.copy(),x!==null&&(b=this.H,y!==null?y.add(x):E!==null&&b!==null&&b.commandHandler!==null&&b.commandHandler.copiesClipboardData&&(y=b.model,b=null,x instanceof Ue||(b=y.copyNodeData(E)),Ve(b)&&(x.data=b)));return x},Ie.Object.defineProperties(Xi.prototype,{nodes:{get:function(){return this.On}},links:{get:function(){return this.Dn}},parts:{get:function(){return this.Pa}},diagram:{get:function(){return this.H}},addsToTemporaryLayer:{get:function(){return this.tp},set:function(a){this.tp=a}}}),Xi.prototype.updateAllRelationshipsFromData=Xi.prototype.rp,Xi.prototype.findLinksByExample=Xi.prototype.ls,Xi.prototype.findNodesByExample=Xi.prototype.ms,Xi.prototype.findLinkForData=Xi.prototype.Kc,Xi.prototype.findNodeForData=Xi.prototype.ii,Xi.prototype.findPartForData=Xi.prototype.Lc,Xi.prototype.findNodeForKey=Xi.prototype.Vb,Xi.prototype.removeModeledPart=Xi.prototype.ip,Xi.prototype.removeModeledParts=Xi.prototype.Gs,Xi.prototype.rebuildParts=Xi.prototype.Wd;var cS=!1,gS=!1,pS=!1;Xi.className="PartManager";function Pr(a){Xi.apply(this,arguments)}ee(Pr,Xi),Pr.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),mS(this,a.linkDataArray)},Pr.prototype.addModeledParts=function(a){for(Xi.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)xc(a.value);$f(this.diagram,!1)};function mS(a,y){y.forEach(function(x){vS(a,x)}),$f(a.diagram,!1)}function vS(a,y){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.bf.contains(y)){var x=a.getLinkCategoryForData(y),E=a.findLinkTemplateForCategory(x);if(E!==null){za(E);var b=E.copy();if(b!==null){E=a.diagram.skipsModelSourceBindings,a.diagram.skipsModelSourceBindings=!0,b.Tf=x,b.ub=y,x=a.diagram.model;var z=u0(x,y,!0);z!==""&&(b.fromPortId=z),z=ga(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof tn&&(b.fromNode=z)),z=u0(x,y,!1),z!==""&&(b.toPortId=z),z=ga(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof tn&&(b.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(tt){tt=a.Vb(tt),tt!==null&&(tt.labeledLink=b)}),a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=E}}}}Pr.prototype.removeAllModeledParts=function(){var a=this.diagram.model;yS(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function yS(a,y){y.forEach(function(x){a.ip(x)})}Pr.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Pr.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Pr.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Pr.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Pr.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Pr.prototype.findPartForKey=function(a){var y=Xi.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Pr.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Pr.prototype.doModelChanged=function(a){var y=this;if(Xi.prototype.doModelChanged.call(this,a),this.diagram){var x=this.diagram;if(a.model===x.model){var E=a.change;if(x.aa){x.aa=!1;try{var b=a.modelChange;if(b!==""){if(E===Eo){if(b==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var tt=this.Vb(a.newValue);z.fromNode=tt}}else if(b==="linkToKey"){var ot=this.Kc(a.object);if(ot!==null){var rt=this.Vb(a.newValue);ot.toNode=rt}}else if(b==="linkFromPortId"){var at=this.Kc(a.object);if(at!==null){var ut=a.newValue;typeof ut=="string"&&(at.fromPortId=ut)}}else if(b==="linkToPortId"){var ct=this.Kc(a.object);if(ct!==null){var mt=a.newValue;typeof mt=="string"&&(ct.toPortId=mt)}}else if(b==="nodeGroupKey"){var yt=this.Lc(a.object);if(yt!==null){var St=a.newValue;if(St!==void 0){var Mt=this.Vb(St);Mt instanceof Jn?yt.containingGroup=Mt:yt.containingGroup=null}else yt.containingGroup=null}}else if(b==="linkLabelKeys"){var Ot=this.Kc(a.object);if(Ot!==null){var bt=a.oldValue,jt=a.newValue;Array.isArray(bt)&&bt.forEach(function(Ee){0<=jt.indexOf(Ee)||(Ee=y.Vb(Ee),Ee!==null&&(Ee.labeledLink=null))}),Array.isArray(jt)&&jt.forEach(function(Ee){Ee=y.Vb(Ee),Ee!==null&&(Ee.labeledLink=Ot)})}}else if(b==="linkCategory"){var Gt=this.Kc(a.object),Wt=a.newValue;Gt!==null&&typeof Wt=="string"&&(Gt.category=Wt)}else b==="linkDataArray"&&(yS(this,a.oldValue),mS(this,a.newValue));x.isModified=!0}else if(E===Ko){var Kt=a.newValue;if(b==="linkDataArray"&&typeof Kt=="object"&&Kt!==null)vS(this,Kt);else if(b==="linkLabelKeys"&&Fh(Kt)){var $t=this.Kc(a.object),Qe=this.Vb(Kt);$t!==null&&Qe!==null&&(Qe.labeledLink=$t)}x.isModified=!0}else if(E===ar){var dn=a.oldValue;if(b==="linkDataArray"&&typeof dn=="object"&&dn!==null)this.ip(dn);else if(b==="linkLabelKeys"&&Fh(dn)){var rn=this.Vb(dn);rn!==null&&(rn.labeledLink=null)}x.isModified=!0}}else if(E===Eo){var We=a.propertyName;a.object!==x.model||We!=="linkFromKeyProperty"&&We!=="linkToKeyProperty"&&We!=="linkFromPortIdProperty"&&We!=="linkToPortIdProperty"&&We!=="linkLabelKeysProperty"&&We!=="nodeIsGroupProperty"&&We!=="nodeGroupKeyProperty"&&We!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Pr.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new ke,E=y.linkDataArray;E.forEach(function(z){x.add(z)});var b=[];this.links.each(function(z){z.data===null||x.contains(z.data)||b.push(z.data)}),b.forEach(function(z){FS(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&TS(y,z,!1)})},Pr.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;if(a instanceof Ue){var b=ga(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=ga(E,y,!1),b=x.Vb(b),a.toNode=b,y=E.Ef(y),0<y.length||0<a.labelNodes.count){if(y.length===1&&a.labelNodes.count===1){b=y[0];var z=a.labelNodes.first();if(E.wa(z.data)===b)return}b=new ke().addAll(y);var tt=new ke;a.labelNodes.each(function(ot){ot.data!==null&&(ot=E.wa(ot.data),ot!==void 0&&tt.add(ot))}),y=tt.copy(),y.hp(b),b=b.copy(),b.hp(tt),(0<y.count||0<b.count)&&(y.each(function(ot){ot=x.Vb(ot),ot!==null&&ot.labeledLink===a&&(ot.labeledLink=null)}),b.each(function(ot){ot=x.Vb(ot),ot!==null&&ot.labeledLink!==a&&(ot.labeledLink=a)}))}}else!(a instanceof Ai)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof Jn)&&(a.containingGroup=y)}}},Pr.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=rp(y,x),b=this.Lc(a);if(E!==null&&b!==null){E=E.iterator;for(var z={};E.next();){var tt=E.value;y.lb(tt)?b instanceof Jn&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof tn&&(ga(y,tt,!0)===x&&(z.link.fromNode=b),ga(y,tt,!1)===x&&(z.link.toNode=b),tt=y.Ef(tt),Array.isArray(tt)&&tt.some(function(ot){return function(rt){return rt===x?(b.labeledLink=ot.link,!0):!1}}(z)))),z={link:z.link}}hl(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof Jn&&(b.containingGroup=a))}},Pr.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof tn){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)ul(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&ul(y,x,E.data)),a instanceof Jn)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&ul(y,x,E)}}},Pr.prototype.copyPartData=function(a,y){var x=Xi.prototype.copyPartData.call(this,a,y);if(a instanceof Ue)if(a=a.data,a!==null&&y!==null){var E=y.model;a=E.Jo(a),typeof a=="object"&&a!==null&&(E.fi(a),x=y.Kc(a))}else x!==null&&(y=this.diagram,a!==null&&y!==null&&y.commandHandler!==null&&y.commandHandler.copiesClipboardData&&(y=y.model.Jo(a),typeof y=="object"&&y!==null&&(x.data=y)));return x},Pr.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,tt=b.toolManager.findTool("Linking"),ot="";if(a!==null&&(y===null&&(y=a),ot=y.portId,ot===null&&(ot="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=tt.archetypeLinkData,E instanceof Ue){if(za(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=ot,z.toNode=x,z.toPortId=y,b.add(z),a=tt.archetypeLabelNodeData,a instanceof tn&&(za(a),a=a.copy(),a!==null&&(a.labeledLink=z,b.add(a))),z}else if(E!==null&&(E=z.Jo(E),typeof E=="object"&&E!==null))return a!==null&&Mc(z,E,z.wa(a.data),!0),Ec(z,E,ot,!0),x!==null&&Mc(z,E,z.wa(x.data),!1),Ec(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof tn||(a=z.copyNodeData(a),typeof a=="object"&&a!==null&&(z.xf(a),a=z.wa(a),a!==void 0&&z.Bu(E,a))),b.Kc(E);return null},Pr.prototype.findLinkForKey=Pr.prototype.findLinkForKey,Pr.prototype.findPartForKey=Pr.prototype.findPartForKey,Pr.prototype.removeAllModeledParts=Pr.prototype.removeAllModeledParts,Pr.prototype.addModeledParts=Pr.prototype.addModeledParts,Pr.prototype.addAllModeledParts=Pr.prototype.addAllModeledParts,Pr.className="GraphLinksPartManager";function Ta(){Xi.apply(this,arguments),this.Sg=null}ee(Ta,Xi);function s0(a,y,x){if(y!==null&&x!==null&&x.kh()===null){var E=a.diagram.toolManager.findTool("Linking"),b=y,z=x;if(a.diagram.isTreePathToChildren||(b=x,z=y),(E===null||!ss(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(za(E),E=E.copy(),E!==null))){var tt=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,E.Tf=y,E.ub=x.data,E.fromNode=b,E.toNode=z,a.diagram.add(E),E.ub=null,E.data=x.data,a.diagram.skipsModelSourceBindings=tt}}}Ta.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Ta.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Ta.prototype.setFromNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren)E.qe(a.data,E.wa(y));else{var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.toNode!==null?a.toNode.data:null)),this.Sg=b}},Ta.prototype.setToNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren){var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.fromNode!==null?a.fromNode.data:null)),this.Sg=b}else E.qe(a.data,E.wa(y))},Ta.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Ta.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Ta.prototype.doModelChanged=function(a){if(Xi.prototype.doModelChanged.call(this,a),this.diagram){var y=this.diagram;if(a.model===y.model){var x=a.change;if(y.aa){y.aa=!1;try{var E=a.modelChange;if(E!==""){if(x===Eo){if(E==="nodeParentKey"){var b=a.object,z=this.Vb(a.newValue),tt=this.ii(b);if(this.Sg!==null)z!==null&&(this.Sg.data=b,this.Sg.category=this.getLinkCategoryForData(b));else if(tt!==null){var ot=tt.kh();ot!==null?z===null?y.remove(ot):y.isTreePathToChildren?ot.fromNode=z:ot.toNode=z:s0(this,z,tt)}}else if(E==="parentLinkCategory"){var rt=this.ii(a.object),at=a.newValue;if(rt!==null&&typeof at=="string"){var ut=rt.kh();ut!==null&&(ut.category=at)}}y.isModified=!0}}else if(x===Eo){var ct=a.propertyName;a.object===y.model&&ct==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Ta.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof tn&&(y=E.mh(y),y=x.Vb(y),E=a.pg(),y!==E&&(E=a.kh(),y!==null?E!==null?x.isTreePathToChildren?E.fromNode=y:E.toNode=y:s0(this,y,a):E!==null&&yg(x,E,!1)))}}},Ta.prototype.updateDataBindings=function(a,y){Xi.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Ta.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=rp(y,x),b=this.Lc(a);if(E!==null&&b!==null){for(E=E.iterator;E.next();){var z=E.value;y.lb(z)&&b instanceof tn&&y.mh(z)===x&&s0(this,b,this.ii(z))}hl(y,x)}a=y.mh(a),a!==void 0&&b instanceof tn&&(a=this.Vb(a),s0(this,a,b))}},Ta.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof tn){var x=y.wa(a.data),E=this.Kc(a.data);if(E!==null){E.isSelected=!1,E.isHighlighted=!1;var b=E.layer;if(b!==null){var z=b.pc(-1,E,!1);0<=z&&this.diagram.cb(ar,"parts",b,E,null,z,null),z=E.layerChanged,z!==null&&z(E,b,null)}}for(E=this.diagram.isTreePathToChildren,a=a.linksConnected;a.next();)b=a.value,b=(E?b.toNode:b.fromNode).data,y.lb(b)&&ul(y,x,b)}},Ta.prototype.insertLink=function(a,y,x){y=this.diagram.model;var E=a,b=x;return this.diagram.isTreePathToChildren||(E=x,b=a),E!==null&&b!==null?(y.qe(b.data,y.wa(E.data)),b.kh()):null},Ta.prototype.findLinkForKey=Ta.prototype.findLinkForKey,Ta.className="TreePartManager";function mn(a,y){this.kl=new ke,this.il=new ke,this.Wv=`,
"insertedNodeKeys": `,this.jy=`,
"modifiedNodeData": `,this.Yv=`,
"removedNodeKeys": `,this.vh=null,vi(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new qe,this.Th="key",this.Bk=this.bl=null,this.Jm=this.Km=!1,this.Mm=!0,this.xm=null,this.lj="category",this.Vf=new qe,this.Lt=new be,this.Wg=!1,this.o=null,this.undoManager=new Fo,a!==void 0&&(jn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}mn.prototype.cloneProtected=function(a){a.xa=this.xa,a.Sm=this.Sm,a.Gg=this.Gg,a.Th=this.Th,a.bl=this.bl,a.Bk=this.Bk,a.Km=this.Km,a.Jm=this.Jm,a.Mm=this.Mm,a.xm=this.xm,a.lj=this.lj},mn.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},mn.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},mn.prototype.toString=function(a){if(a===void 0&&(a=0),1<a)return this.np();var y=(this.name!==""?this.name:"")+" Model";if(0<a){y+=`
node data:`,a=this.nodeDataArray;for(var x=a.length,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Yi(b)}}return y},mn.prototype.xA=function(a){a.change!==Js&&de("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof xr?(xS(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},mn.prototype.Qv=function(a,y){var x=this,E=!1,b=new ke,z=new ke,tt=new ke,ot=this.vh;a.changes.each(function(ct){ct.model===x&&(ct.modelChange==="nodeDataArray"?ct.change===Ko?b.add(ct.newValue):ct.change===ar&&tt.add(ct.oldValue):x.lb(ct.object)?z.add(ct.object):ct.change!==Eo||x.modelData!==ct.object&&ct.propertyName!=="modelData"?ct.object!==null&&(ot&&ot.contains(ct.object)?ot.get(ct.object).each(function(mt){x.lb(mt)&&z.add(mt)}):ct.object instanceof mn||x.ri()&&x.Jc(ct.object)||PS(x,ct.object).each(function(mt){z.add(mt)})):E=!0)});var rt=this.il;rt.clear(),b.each(function(ct){rt.add(x.wa(ct)),y||z.add(ct)});var at=this.kl;at.clear(),tt.each(function(ct){at.add(x.wa(ct)),y&&z.add(ct)}),a=x.cloneDeep(z.Fa());var ut=null;return E&&(ut===null&&(ut={}),ut.modelData=this.cloneDeep(this.modelData)),0<rt.count&&(ut===null&&(ut={}),y?ut.removedNodeKeys=rt.Fa():ut.insertedNodeKeys=rt.Fa()),0<a.length&&(ut===null&&(ut={}),ut.modifiedNodeData=a),0<at.count&&(ut===null&&(ut={}),y?ut.insertedNodeKeys=at.Fa():ut.removedNodeKeys=at.Fa()),at.clear(),rt.clear(),ut},mn.prototype.cloneDeep=function(a){return kc(this,a,!0)};function kc(a,y,x,E,b,z){function tt(ct,mt){ot?(ct.__gohashid===void 0&&z.push(ct),E.set(ct,mt)):(ct=se++,E.set(ct,mt),b.set(ct,y))}if(!Ve(y))return y;z||(z=[]);var ot=Object.isExtensible(y);if(E||(E=new qe),ot){var rt=E.get(y);if(rt)return rt}else for(b||(b=new qe),rt=b.iterator;rt.next();){var at=rt.key;if(rt.value===y&&(at=E.get(at)))return at}if(Array.isArray(y)){rt=[],tt(y,rt);for(var ut=0;ut<y.length;ut++)rt.push(kc(a,y[ut],!1,E,b,z))}else if(y instanceof At||y instanceof Le||y instanceof pe||y instanceof On||y instanceof Sn)rt=y.copy(),tt(y,rt);else{if(y instanceof Ki||y instanceof Xe||y instanceof ae)return y;if(y instanceof be)rt=new be().addAll(kc(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof ke)rt=new ke().addAll(kc(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof qe)rt=new qe().addAll(kc(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof Date)rt=new Date(y.getTime()),tt(y,rt);else if(y instanceof RegExp)rt=new RegExp(y),tt(y,rt),rt.lastIndex=y.lastIndex;else if(typeof y.copy=="function")rt=y.copy(),tt(y,rt);else for(ut in rt={},tt(y,rt),y)ut!=="__gohashid"&&(rt[ut]=kc(a,y[ut],!1,E,b,z))}return x&&z.forEach(function(ct){delete ct.__gohashid}),rt}xt=mn.prototype,xt.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},xt.rm=function(){var a="";return this.name!==""&&(a+=`,
"name": `+this.quote(this.name)),this.dataFormat!==""&&(a+=`,
"dataFormat": `+this.quote(this.dataFormat)),this.isReadOnly&&(a+=`,
"isReadOnly": `+this.isReadOnly),this.nodeKeyProperty!=="key"&&typeof this.nodeKeyProperty=="string"&&(a+=`,
"nodeKeyProperty": `+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(a+=`,
"copiesArrays": true`),this.copiesArrayObjects&&(a+=`,
"copiesArrayObjects": true`),this.copiesKey||(a+=`,
"copiesKey": false`),this.nodeCategoryProperty!=="category"&&typeof this.nodeCategoryProperty=="string"&&(a+=`,
"nodeCategoryProperty": `+this.quote(this.nodeCategoryProperty)),a},xt.gp=function(a){a.name&&(this.name=a.name),a.dataFormat&&(this.dataFormat=a.dataFormat),a.isReadOnly&&(this.isReadOnly=!0),a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty),a.copiesArrays&&(this.copiesArrays=!0),a.copiesArrayObjects&&(this.copiesArrayObjects=!0),a.copiesKey===!1&&(this.copiesKey=!1),a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function SS(a,y){y=y.modelData,Ve(y)&&(a.dm(y),a.modelData=y)}xt.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!wS(x,a[x])){y=!0;break}return a="",y&&(a=`,
"modelData": `+uy(this,this.modelData)),a+`,
"nodeDataArray": `+Th(this,this.nodeDataArray,!0)},xt.kv=function(a){SS(this,a),a=a.nodeDataArray,jn(a)&&(this.dm(a),this.nodeDataArray=a)};function xS(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var tt=E.get(b);tt===null?(tt=new ke,tt.add(z),E.add(b,tt)):tt.add(z)}}var E=a.vh;E===null&&(E=new qe,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===Eo?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===Ko||z===ar)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function PS(a,y){for(var x=new ke,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];a0(a,y,b,b,x)}return x}function a0(a,y,x,E,b){if(Array.isArray(x))for(var z=0;z<x.length;z++){var tt=x[z];if(tt===y)return b.add(E),!0;if(a0(a,y,tt,E,b))return!0}else if(Ve(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(tt=x[z],tt===y)return b.add(E),!0;if(a0(a,y,tt,E,b))return!0}return!1}xt.Pv=function(a,y){var x=this,E=!1,b=new ke,z=new ke,tt=new ke,ot=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===Ko?b.add(ut.newValue):ut.change===ar&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==Eo||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(ot&&ot.contains(ut.object)?ot.get(ut.object).each(function(ct){x.lb(ct)&&z.add(ct)}):ut.object instanceof mn||x.ri()&&x.Jc(ut.object)||PS(x,ut.object).each(function(ct){z.add(ct)})):E=!0)});var rt=this.il;rt.clear(),b.each(function(ut){rt.add(x.wa(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(x.wa(ut)),y&&z.add(ut)}),a="",E&&(a+=`,
"modelData": `+uy(this,this.modelData)),0<rt.count&&(a+=(y?this.Yv:this.Wv)+Th(this,rt.Fa(),!0)),0<z.count&&(a+=this.jy+Th(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Wv:this.Yv)+Th(this,at.Fa(),!0)),at.clear(),rt.clear(),a},xt.fp=function(a){(a.name!==void 0&&a.name!==this.name||a.dataFormat!==void 0&&a.dataFormat!==this.dataFormat||a.isReadOnly!==void 0&&a.isReadOnly!==this.isReadOnly||a.nodeKeyProperty!==void 0&&a.nodeKeyProperty!==this.nodeKeyProperty||a.copiesArrays!==void 0&&a.copiesArrays!==this.copiesArrays||a.copiesArrayObjects!==void 0&&a.copiesArrayObjects!==this.copiesArrayObjects||a.copiesKey!==void 0&&a.copiesKey!==this.copiesKey||a.nodeCategoryProperty!==void 0&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&&de("applyIncrementalJson cannot change Model properties"),SS(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new qe;if(Array.isArray(x))for(var b=0;b<x.length;b++){var z=x[b],tt=this.wa(z);tt!=null&&E.set(tt,z)}if(Array.isArray(y))for(b=y.length,z=0;z<b;z++){tt=y[z];var ot=this.hc(tt);ot===null&&(ot=(ot=E.get(tt))?ot:this.copyNodeData({}),this.km(ot,tt),this.xf(ot))}if(Array.isArray(x)){for(y=x.length,E=0;E<y;E++)if(b=x[E],z=this.wa(b),z=this.hc(z),z!==null){for(var rt in b)rt==="__gohashid"||rt===this.nodeKeyProperty||this.Wj()&&rt===this.nodeIsGroupProperty||this.setDataProperty(z,rt,b[rt]);this.lm(b,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,rt=0;rt<x;rt++)y=this.hc(a[rt]),y!==null&&this.cm(y)},xt.$x=function(a,y){a.change!==Js&&de("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof xr?(y===void 0&&(y=sp(this,this)),xS(this,x),a=this.Pv(x,a.propertyName==="FinishedUndo"),this.vh=null,y==="2"?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(y)+', "incremental": 1'+this.rm()+a+"}"):'{ "incremental": 0 }'},xt.yA=function(a,y){return this.$x(a,y)},xt.np=function(a){return a===void 0&&(a=sp(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},xt.toJSON=function(a){return this.np(a)},xt.Zw=function(a){var y=null;if(typeof a=="string")try{y=me.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:de("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&de("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},xt.Ky=function(a){return this.Zw(a)},mn.constructGraphLinksModel=function(){return new mn},xt=mn.prototype,xt.dm=function(a){if(jn(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(Ve(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:de("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(Ve(a)){for(y in a)if(x=a[y],Ve(x)&&(x=this.dm(x),a[y]=x,y==="points"&&Array.isArray(x))){for(b=x.length%2===0,E=0;E<x.length;E++)if(typeof x[E]!="number"){b=!1;break}if(b){for(b=new be,E=0;E<x.length/2;E++)b.add(new At(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return bx(a)}return a},xt.sm=function(a){return a===void 0?"undefined":a===null?"null":a===!0?"true":a===!1?"false":typeof a=="string"?this.quote(a):typeof a=="number"?a===1/0?"9e9999":a===-1/0?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.sm(a.valueOf()):jn(a)?Th(this,a):Ve(a)?uy(this,a):typeof a=="function"?"null":a.toString()};function Th(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new cn;b.add("["),x&&1<E&&b.add(`
`);for(var z=0;z<E;z++){var tt=y[z];tt!==void 0&&(0<z&&(b.add(","),x&&b.add(`
`)),b.add(a.sm(tt)))}return x&&1<E&&b.add(`
`),b.add("]"),b.toString()}function wS(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function ms(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof At)y={class:"go.Point",x:ms(x.x),y:ms(x.y)};else if(x instanceof Le)y={class:"go.Size",width:ms(x.width),height:ms(x.height)};else if(x instanceof pe)y={class:"go.Rect",x:ms(x.x),y:ms(x.y),width:ms(x.width),height:ms(x.height)};else if(x instanceof On)y={class:"go.Margin",top:ms(x.top),right:ms(x.right),bottom:ms(x.bottom),left:ms(x.left)};else if(x instanceof Sn)x.sb()?y={class:"go.Spot",x:ms(x.x),y:ms(x.y),offsetX:ms(x.offsetX),offsetY:ms(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof Ki){if(y={class:"go.Brush",type:x.type.name},x.type===ju?y.color=x.color:(x.type===au||x.type===Ea)&&(y.start=x.start,y.end=x.end,x.type===Ea&&(x.startRadius!==0&&(y.startRadius=ms(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=ms(x.endRadius)))),x.colorStops!==null){var E={};for(x=x.colorStops.iterator;x.next();)E[x.key]=x.value;y.colorStops=E}}else x instanceof Xe?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=ms(x.startX)),x.startY!==0&&(y.startY=ms(x.startY)),x.endX!==0&&(y.endX=ms(x.endX)),x.endY!==0&&(y.endY=ms(x.endY)),x.spot1.D(Sr)||(y.spot1=x.spot1),x.spot2.D(ya)||(y.spot2=x.spot2),x.type===Xe.o&&(y.path=Xe.ia(x))):x instanceof ae&&(y={class:"go.EnumValue",classType:sp(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=Vo(y,b);if(!wS(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof be){var tt="[";for(z=z.iterator;z.next();){var ot=z.value;1<tt.length&&(tt+=","),tt+=a.sm(ot.x),tt+=",",tt+=a.sm(ot.y)}tt+="]",E+=tt}else E+=a.sm(z)}return E+"}"}function vs(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function bx(a){if(typeof a!="object")return a;var y=a.class||"";if(y==="NaN")return NaN;if(y==="Date")return new Date(a.value);if(y.indexOf("go.")!==0)return a;y=y.substr(3);var x=a;if(y==="Point")x=new At(vs(a.x),vs(a.y));else if(y==="Size")x=new Le(vs(a.width),vs(a.height));else if(y==="Rect")x=new pe(vs(a.x),vs(a.y),vs(a.width),vs(a.height));else if(y==="Margin")x=new On(vs(a.top),vs(a.right),vs(a.bottom),vs(a.left));else if(y==="Spot")typeof a.enum=="string"?x=bf(a.enum):x=new Sn(vs(a.x),vs(a.y),vs(a.offsetX),vs(a.offsetY));else if(y==="Brush"){if(x=new Ki,x.type=Mn(Ki,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof Sn&&(x.start=a.start),a.end instanceof Sn&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=vs(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=vs(a.endRadius)),a=a.colorStops,Ve(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=Xe.parse(a.path):x=new Xe,x.type=Mn(Xe,a.type),typeof a.startX=="number"&&(x.startX=vs(a.startX)),typeof a.startY=="number"&&(x.startY=vs(a.startY)),typeof a.endX=="number"&&(x.endX=vs(a.endX)),typeof a.endY=="number"&&(x.endY=vs(a.endY)),a.spot1 instanceof Sn&&(x.spot1=a.spot1),a.spot2 instanceof Sn&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=dy(E),typeof E=="function"&&(x=Mn(E,a.name)));return x}xt.Pe=function(a){return this.Lt.add(a),this},xt.ik=function(a){this.Lt.remove(a)},xt.ds=function(a){this.skipsUndoManager||this.undoManager.Tu(a);for(var y=this.Lt,x=y.length,E=0;E<x;E++)y.M(E)(a)},xt.cb=function(a,y,x,E,b,z,tt){or(this,"",a,y,x,E,b,z,tt)},xt.g=function(a,y,x,E,b){or(this,"",Eo,a,this,y,x,E,b)},xt.Fs=function(a,y,x,E,b,z){or(this,"",Eo,y,a,x,E,b,z)};function or(a,y,x,E,b,z,tt,ot,rt){ot===void 0&&(ot=null),rt===void 0&&(rt=null);var at=new No;at.model=a,at.change=x,at.modelChange=y,at.propertyName=E,at.object=b,at.oldValue=z,at.oldParam=ot,at.newValue=tt,at.newParam=rt,a.ds(at)}mn.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===Eo){var x=a.object,E=a.propertyName,b=a.I(y);E===this.nodeKeyProperty&&this.lb(x)&&(y=a.I(!y),y!==void 0&&this.kb.remove(y),b!==void 0&&this.kb.add(b,x)),So(x,E,b)}else a.change===Ko?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,Ve(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&fo(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&Ho(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!jn(E)&&a.propertyName&&(E=Vo(a.object,a.propertyName)),jn(E)&&typeof x=="number"&&(a=a.newValue,y?fo(E,x):Ho(E,x,a))):de("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===ar?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,Ve(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&Ho(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&fo(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!jn(E)&&a.propertyName&&(E=Vo(a.object,a.propertyName)),jn(E)&&typeof x=="number"&&(a=a.oldValue,y?Ho(E,x,a):fo(E,x))):de("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==Js&&de("unknown ChangedEvent: "+a.toString())},mn.prototype.Ea=function(a){return this.undoManager.Ea(a)},mn.prototype.eb=function(a){return this.undoManager.eb(a)},mn.prototype.Kf=function(){return this.undoManager.Kf()},mn.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},xt=mn.prototype,xt.La=function(a,y){y===void 0&&(y=""),or(this,"SourceChanged",Js,y,a,null,null)},xt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=Vo(a,y),y!==void 0)){if(Fh(y))return y;de("Key value for node data "+a+" is not a number or a string: "+y)}}},xt.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=Vo(a,x);E!==y&&this.hc(y)===null&&(So(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),or(this,"nodeKey",Eo,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else So(a,x,y)}};function Fh(a){return typeof a=="number"||typeof a=="string"}xt.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},xt.hc=function(a){return a===null&&de("Model.findNodeDataForKey:key must not be null"),a!==void 0&&Fh(a)?this.kb.I(a):null},xt.$u=function(a){if(a!==null){var y=this.Th;if(y!==""){var x=this.wa(a);if(x===void 0||this.kb.contains(x)){var E=this.bl;if(E!==null&&(x=E(this,a),x!=null&&!this.kb.contains(x))){So(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;So(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;So(a,y,x)}}}}},xt.xf=function(a){a!==null&&(co(a),this.lb(a)||CS(this,a,!0))};function CS(a,y,x){var E=a.wa(y);(E===void 0||a.kb.I(E)!==y)&&(a.$u(y),E=a.wa(y),E===void 0&&de("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,Ho(a.Tc,E,y)),or(a,"nodeDataArray",Ko,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}xt.Fy=function(a){if(jn(a))for(var y=a.length,x=0;x<y;x++)this.xf(a[x]);else for(a=a.iterator;a.next();)this.xf(a.value)},xt.cm=function(a){a!==null&&LS(this,a,!0)};function LS(a,y,x){var E=a.wa(y);if(E!==void 0&&a.kb.remove(E),E=null,x){t:if(x=a.Tc,Array.isArray(x))E=x.indexOf(y);else{E=x.length;for(var b=0;b<E;b++)if(x[b]===y){E=b;break t}E=-1}if(0>E)return;fo(a.Tc,E)}or(a,"nodeDataArray",ar,"nodeDataArray",a,y,null,E,null),a.qp(y)}xt.nA=function(a){if(jn(a))for(var y=a.length,x=0;x<y;x++)this.cm(a[x]);else for(a=a.iterator;a.next();)this.cm(a.value)},xt.$z=function(a){if(a!==this.nodeDataArray&&jn(a)){var y=this.kl;y.clear(),y.addAll(this.kb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.wa(z);if(tt!==void 0){x.add(tt);var ot=this.hc(tt);ot!==z&&(ot!==null?(this.Do(ot,z),this.lm(z,ot)):(z=this.cloneDeep(z),this.km(z,tt),this.xf(z)))}else tt=this.cloneDeep(z),this.xf(tt),x.add(this.wa(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.hc(E))&&this.cm(E);y.clear(),x.clear()}},xt.jp=function(a,y){y!==void 0&&(a=rp(this,a),a instanceof ke&&this.Vf.add(y,a))},xt.Lv=function(){},xt.fm=function(){},xt.em=function(){},xt.qp=function(){};function ul(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new ke,a.Vf.add(y,E)),E.add(x)}}function hl(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof ke&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function rp(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof ke?a:null)}xt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},mn.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):l0(this,a,!0),Ve(a)&&vi(a),a};function l0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=l0(a,y[x],a.copiesArrayObjects);E.push(b)}return vi(E),E}if(x&&Ve(y)){x=(x=y.constructor)?new x:{},b=a.copiesKey||typeof a.nodeKeyProperty!="string"?null:a.nodeKeyProperty;for(E in y)if(E==="__gohashid")x.__gohashid=void 0;else if(E===b)x[b]=void 0;else{var z=Vo(y,E),tt=sp(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof mn||z instanceof Fo||z instanceof xr||z instanceof No||(z=l0(a,z,!1)),So(x,E,z)}return vi(x),x}return y instanceof At||y instanceof Le||y instanceof pe||y instanceof Sn||y instanceof On?y.copy():y}mn.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}}else!kS&&a instanceof Xt&&(kS=!0,Di('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Di(" Is that really your intent?"));var E=Vo(a,y);E!==x&&(So(a,y,x),this.Fs(a,y,E,x))},xt=mn.prototype,xt.set=function(a,y,x){this.setDataProperty(a,y,x)},xt.Do=function(a,y){if(y){var x=this.lb(a),E;for(E in y)E==="__gohashid"||x&&E===this.nodeKeyProperty||this.setDataProperty(a,E,y[E])}},xt.Ay=function(a,y){this.ts(a,-1,y)},xt.ts=function(a,y,x){0>y&&(y=a.length),Ho(a,y,x),or(this,"",Ko,"",a,null,x,null,y)},xt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&de("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];fo(a,y),or(this,"",ar,"",a,x,null,y,null)},xt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=Vo(a,y),y===void 0))return"";if(typeof y=="string")return y;de("getCategoryForNodeData found a non-string category for "+a+": "+y)},xt.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=Vo(a,x);E===void 0&&(E=""),E!==y&&(So(a,x,y),or(this,"nodeCategory",Eo,x,a,E,y))}else So(a,x,y)}},xt.lm=function(a,y){this.jm(y,this.Ro(a))},xt.Tl=function(){return!1},xt.Wj=function(){return!1},xt.ri=function(){return!1},xt.xs=function(){return!1},xt.Xj=function(){return!1};function hy(){return new mn}function sp(a,y){if(typeof y=="function"){if(y.className)return y.className;if(y.name)return y.name}else if(typeof y=="object"&&y!==null&&y.constructor)return sp(a,y.constructor);return typeof y}function dy(a){return qa[a]?qa[a]:me.go!==void 0&&me.go[a]?me.go[a]:null}function Vo(a,y){if(!a||!y)return null;try{if(typeof y=="function")var x=y(a);else typeof a.getAttribute=="function"?(x=a.getAttribute(y),x===null&&(x=void 0)):x=a[y]}catch(E){}return x}function So(a,y,x){if(a&&y)try{typeof y=="function"?y(a,x):typeof a.setAttribute=="function"?a.setAttribute(y,x):a[y]=x}catch(E){}}Ie.Object.defineProperties(mn.prototype,{name:{get:function(){return this.xa},set:function(a){var y=this.xa;y!==a&&(this.xa=a,this.g("name",y,a))}},dataFormat:{get:function(){return this.Sm},set:function(a){var y=this.Sm;y!==a&&(this.Sm=a,this.g("dataFormat",y,a))}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},modelData:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.g("modelData",y,a),this.La(a))}},undoManager:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&(y!==null&&y.Rx(this),this.o=a,a!==null&&a.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a}},nodeKeyProperty:{get:function(){return this.Th},set:function(a){var y=this.Th;y!==a&&(a===""&&de("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&de("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Th=a,this.g("nodeKeyProperty",y,a))}},makeUniqueKeyFunction:{get:function(){return this.bl},set:function(a){var y=this.bl;y!==a&&(this.bl=a,this.g("makeUniqueKeyFunction",y,a))}},nodeDataArray:{get:function(){return this.Tc},set:function(a){var y=this.Tc;if(y!==a){this.kb.clear(),this.Lv();for(var x=a.length,E=0;E<x;E++){var b=a[E];Ve(b)||de("Model.nodeDataArray must only contain Objects, not: "+b),co(b)}for(this.Tc=a,E=new be,b=0;b<x;b++){var z=a[b],tt=this.wa(z);tt===void 0||this.kb.I(tt)!==null?E.add(z):this.kb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.$u(b),z=this.wa(b),z!==void 0&&this.kb.add(z,b);for(or(this,"nodeDataArray",Eo,"nodeDataArray",this,y,a),y=0;y<x;y++)E=a[y],this.fm(E),this.em(E);Array.isArray(a)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{get:function(){return this.Bk},set:function(a){var y=this.Bk;y!==a&&(this.Bk=a,this.g("copyNodeDataFunction",y,a))}},copiesArrays:{get:function(){return this.Km},set:function(a){var y=this.Km;y!==a&&(this.Km=a,this.g("copiesArrays",y,a))}},copiesArrayObjects:{get:function(){return this.Jm},set:function(a){var y=this.Jm;y!==a&&(this.Jm=a,this.g("copiesArrayObjects",y,a))}},copiesKey:{get:function(){return this.Mm},set:function(a){var y=this.Mm;y!==a&&(this.Mm=a,this.g("copiesKey",y,a))}},afterCopyFunction:{get:function(){return this.xm},set:function(a){var y=this.xm;y!==a&&(this.xm=a,this.g("afterCopyFunction",y,a))}},nodeCategoryProperty:{get:function(){return this.lj},set:function(a){var y=this.lj;y!==a&&(this.lj=a,this.g("nodeCategoryProperty",y,a))}},type:{get:function(){return"Model"}}}),mn.prototype.setCategoryForNodeData=mn.prototype.jm,mn.prototype.getCategoryForNodeData=mn.prototype.Ro,mn.prototype.removeArrayItem=mn.prototype.ov,mn.prototype.insertArrayItem=mn.prototype.ts,mn.prototype.addArrayItem=mn.prototype.Ay,mn.prototype.assignAllDataProperties=mn.prototype.Do,mn.prototype.set=mn.prototype.set,mn.prototype.clearUnresolvedReferences=mn.prototype.Qy,mn.prototype.mergeNodeDataArray=mn.prototype.$z,mn.prototype.removeNodeDataCollection=mn.prototype.nA,mn.prototype.removeNodeData=mn.prototype.cm,mn.prototype.addNodeDataCollection=mn.prototype.Fy,mn.prototype.addNodeData=mn.prototype.xf,mn.prototype.makeNodeDataKeyUnique=mn.prototype.$u,mn.prototype.findNodeDataForKey=mn.prototype.hc,mn.prototype.containsNodeData=mn.prototype.lb,mn.prototype.setKeyForNodeData=mn.prototype.km,mn.prototype.getKeyForNodeData=mn.prototype.wa,mn.prototype.updateTargetBindings=mn.prototype.La,mn.prototype.commit=mn.prototype.commit,mn.prototype.rollbackTransaction=mn.prototype.Kf,mn.prototype.commitTransaction=mn.prototype.eb,mn.prototype.startTransaction=mn.prototype.Ea,mn.prototype.raiseDataChanged=mn.prototype.Fs,mn.prototype.raiseChanged=mn.prototype.g,mn.prototype.raiseChangedEvent=mn.prototype.cb,mn.prototype.removeChangedListener=mn.prototype.ik,mn.prototype.addChangedListener=mn.prototype.Pe,mn.prototype.writeJsonValue=mn.prototype.sm,mn.prototype.replaceJsonObjects=mn.prototype.dm,mn.prototype.applyIncrementalJSON=mn.prototype.Ky,mn.prototype.applyIncrementalJson=mn.prototype.Zw,mn.prototype.toJSON=mn.prototype.toJSON,mn.prototype.toJson=mn.prototype.np,mn.prototype.toIncrementalJSON=mn.prototype.yA,mn.prototype.toIncrementalJson=mn.prototype.$x,mn.prototype.toIncrementalData=mn.prototype.xA,mn.prototype.clear=mn.prototype.clear;var kS=!1,qa={};mn.className="Model",mn.fromJSON=mn.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=me.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:de("Unable to construct a Model from: "+a);if(y===null){a=null;var E=x.class;if(typeof E=="string")try{var b=null;E.indexOf("go.")===0?(E=E.substr(3),b=dy(E)):(b=dy(E),b===null&&(b=me[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof mn?y=a:de("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=mn.constructGraphLinksModel()),y.gp(x),y.kv(x),y},mn.safePropertyValue=Vo,mn.safePropertySet=So,qa.Brush=Ki,qa.ChangedEvent=No,qa.Geometry=Xe,qa.Margin=On,qa.Panel=ze,qa.Point=At,qa.Rect=pe,qa.Size=Le,qa.Spot=Sn,qa.Transaction=xr,qa.UndoManager=Fo;function Jo(a,y,x,E){vi(this),this._isFrozen=!1,a===void 0&&(a=""),y===void 0&&(y=a),x===void 0&&(x=null),this.j=-1,this.xd=null,this.xl=a,this.wl=this.to=0,this.Cr=null,this.wn=!1,this.sl=y,this.Im=x,E===void 0?(this.el=ES,this.wk=null):(this.el=ap,this.wk=E),this.st=new ke}Jo.prototype.copy=function(){var a=new Jo;return a.xl=this.xl,a.to=this.to,a.wl=this.wl,a.Cr=this.Cr,a.wn=this.wn,a.sl=this.sl,a.Im=this.Im,a.el=this.el,a.wk=this.wk,a},xt=Jo.prototype,xt.qb=function(a){a.classType===Jo&&(this.mode=a)},xt.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.Kx=function(a){return a===void 0&&(a=null),this.mode=ap,this.backConverter=a,this},xt.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},xt.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function MS(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}xt.Mv=function(a,y,x){var E=this.sl;if(x===void 0||E===""||E===x){x=this.xl;var b=this.Im;if(b===null&&x==="")Di("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=Vo(y,E)),z!==void 0)if(b===null)x!==""&&So(a,x,z);else try{if(x!==""){var tt=b(z,a);So(a,x,tt)}else b(z,a)}catch(ot){}}}},xt.sp=function(a,y,x,E){if(this.el===ap){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,tt=a;if(b!==""&&(tt=Vo(a,b)),tt!==void 0&&!this.st.contains(a))try{this.st.add(a);var ot=E!==null?E.diagram:null,rt=ot!==null?ot.model:null;if(z===null){if(x!=="")rt!==null?rt.setDataProperty(y,x,tt):So(y,x,tt);else if(rt!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var at=E.itemIndex,ut=E.panel.itemArray;rt.ov(ut,at),rt.ts(ut,at,tt)}}else try{if(x!==""){var ct=z(tt,y,rt);rt!==null?rt.setDataProperty(y,x,ct):So(y,x,ct)}else{var mt=z(tt,y,rt);if(mt!==void 0&&rt!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var yt=E.itemIndex,St=E.panel.itemArray;rt.ov(St,yt),rt.ts(St,yt,mt)}}}catch(Mt){}}finally{this.st.remove(a)}}}},Ie.Object.defineProperties(Jo.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&bn(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&bn(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&bn(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&bn(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&bn(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&bn(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&bn(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&bn(this),this.el=a}}}),Jo.prototype.updateSource=Jo.prototype.sp,Jo.prototype.updateTarget=Jo.prototype.Mv,Jo.prototype.ofModel=Jo.prototype.dA,Jo.prototype.ofObject=Jo.prototype.cp,Jo.prototype.makeTwoWay=Jo.prototype.Kx;var Ax="Binding",ES=new ae(Jo,"OneWay",1),ap=new ae(Jo,"TwoWay",2);Jo.className="Binding",Jo.parseEnum=function(a,y){return function(x){return x=Mn(a,x),x===null?y:x}},Jo.toString=Yi,Jo.OneWay=ES,Jo.TwoWay=ap;function Li(a,y,x){mn.call(this),this.Vv=`,
"insertedLinkKeys": `,this.iy=`,
"modifiedLinkData": `,this.Xv=`,
"removedLinkKeys": `,this.md=[],this.$f=new ke,this.wb=new qe,this.Jh="",this.Ri=this.Ak=this.cl=null,this.lf="from",this.mf="to",this.fj=this.ej="",this.dj="category",this.je="",this.jl="isGroup",this.Je="group",this.Lm=!1,y!==void 0&&(this.linkDataArray=y),a!==void 0&&(jn(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}ee(Li,mn),Li.constructGraphLinksModel=mn.constructGraphLinksModel,Li.prototype.cloneProtected=function(a){mn.prototype.cloneProtected.call(this,a),a.Jh=this.Jh,a.cl=this.cl,a.Ak=this.Ak,a.lf=this.lf,a.mf=this.mf,a.ej=this.ej,a.fj=this.fj,a.dj=this.dj,a.je=this.je,a.jl=this.jl,a.Je=this.Je,a.Lm=this.Lm},xt=Li.prototype,xt.clear=function(){mn.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},xt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" GraphLinksModel";if(0<a){y+=`
node data:`,a=this.nodeDataArray;var x=a.length,E;for(E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Yi(b)}for(y+=`
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+ga(this,b,!0)+"-->"+ga(this,b,!1)}return y},xt.Qv=function(a,y){this.linkKeyProperty===""&&de("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=mn.prototype.Qv.call(this,a,y),E=this,b=new ke,z=new ke,tt=new ke,ot=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===Ko?b.add(ut.newValue):ut.change===ar&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&ot&&ot.contains(ut.object)?ot.get(ut.object).each(function(ct){E.Jc(ct)&&z.add(ct)}):ut.object instanceof mn||E.lb(ut.object)||NS(E,ut.object).each(function(ct){z.add(ct)})))});var rt=this.il;rt.clear(),b.each(function(ut){rt.add(E.Ac(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(E.Ac(ut)),y&&z.add(ut)}),a=E.cloneDeep(z.Fa()),0<rt.count&&(x===null&&(x={}),y?x.removedLinkKeys=rt.Fa():x.insertedLinkKeys=rt.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<at.count&&(x===null&&(x={}),y?x.insertedLinkKeys=at.Fa():x.removedLinkKeys=at.Fa()),at.clear(),rt.clear(),x},xt.rm=function(){var a=mn.prototype.rm.call(this),y="";return this.linkCategoryProperty!=="category"&&typeof this.linkCategoryProperty=="string"&&(y+=`,
"linkCategoryProperty": `+this.quote(this.linkCategoryProperty)),this.linkKeyProperty!==""&&typeof this.linkKeyProperty=="string"&&(y+=`,
"linkKeyProperty": `+this.quote(this.linkKeyProperty)),this.linkFromKeyProperty!=="from"&&typeof this.linkFromKeyProperty=="string"&&(y+=`,
"linkFromKeyProperty": `+this.quote(this.linkFromKeyProperty)),this.linkToKeyProperty!=="to"&&typeof this.linkToKeyProperty=="string"&&(y+=`,
"linkToKeyProperty": `+this.quote(this.linkToKeyProperty)),this.linkFromPortIdProperty!==""&&typeof this.linkFromPortIdProperty=="string"&&(y+=`,
"linkFromPortIdProperty": `+this.quote(this.linkFromPortIdProperty)),this.linkToPortIdProperty!==""&&typeof this.linkToPortIdProperty=="string"&&(y+=`,
"linkToPortIdProperty": `+this.quote(this.linkToPortIdProperty)),this.linkLabelKeysProperty!==""&&typeof this.linkLabelKeysProperty=="string"&&(y+=`,
"linkLabelKeysProperty": `+this.quote(this.linkLabelKeysProperty)),this.nodeIsGroupProperty!=="isGroup"&&typeof this.nodeIsGroupProperty=="string"&&(y+=`,
"nodeIsGroupProperty": `+this.quote(this.nodeIsGroupProperty)),this.nodeGroupKeyProperty!=="group"&&typeof this.nodeGroupKeyProperty=="string"&&(y+=`,
"nodeGroupKeyProperty": `+this.quote(this.nodeGroupKeyProperty)),a+y},xt.gp=function(a){mn.prototype.gp.call(this,a),a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty),a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty),a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty),a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty),a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty),a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty),a.linkLabelKeysProperty&&(this.linkLabelKeysProperty=a.linkLabelKeysProperty),a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty),a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)},xt.Rv=function(){var a=mn.prototype.Rv.call(this),y=`,
"linkDataArray": `+Th(this,this.linkDataArray,!0);return a+y},xt.kv=function(a){mn.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function NS(a,y){for(var x=new ke,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];a0(a,y,b,b,x)}return x}xt.Pv=function(a,y){this.linkKeyProperty===""&&de("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=mn.prototype.Pv.call(this,a,y),E=this,b=new ke,z=new ke,tt=new ke,ot=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===Ko?b.add(ut.newValue):ut.change===ar&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&ot&&ot.contains(ut.object)?ot.get(ut.object).each(function(ct){E.Jc(ct)&&z.add(ct)}):ut.object instanceof mn||E.lb(ut.object)||NS(E,ut.object).each(function(ct){z.add(ct)})))});var rt=this.il;rt.clear(),b.each(function(ut){rt.add(E.Ac(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(E.Ac(ut)),y&&z.add(ut)}),a=x,0<rt.count&&(a+=(y?this.Xv:this.Vv)+Th(this,rt.Fa(),!0)),0<z.count&&(a+=this.iy+Th(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Vv:this.Xv)+Th(this,at.Fa(),!0)),at.clear(),rt.clear(),a},xt.fp=function(a){(a.linkCategoryProperty!==void 0&&a.linkCategoryProperty!==this.linkCategoryProperty||a.linkKeyProperty!==void 0&&a.linkKeyProperty!==this.linkKeyProperty||a.linkFromKeyProperty!==void 0&&a.linkFromKeyProperty!==this.linkFromKeyProperty||a.linkToKeyProperty!==void 0&&a.linkToKeyProperty!==this.linkToKeyProperty||a.linkFromPortIdProperty!==void 0&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||a.linkToPortIdProperty!==void 0&&a.linkToPortIdProperty!==this.linkToPortIdProperty||a.linkLabelKeysProperty!==void 0&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||a.nodeIsGroupProperty!==void 0&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||a.nodeGroupKeyProperty!==void 0&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&de("applyIncrementalJson cannot change Model properties"),mn.prototype.fp.call(this,a);var y=a.insertedLinkKeys;if(Array.isArray(y))for(var x=y.length,E=0;E<x;E++){var b=y[E],z=this.jh(b);z===null&&(z=this.Jo({}),this.Ks(z,b),this.fi(z))}if(y=a.modifiedLinkData,Array.isArray(y)){for(x=y.length,E=0;E<x;E++)if(b=y[E],z=this.Ac(b),z=this.jh(z),z!==null){for(var tt in b)tt!=="__gohashid"&&tt!==this.linkKeyProperty&&this.setDataProperty(z,tt,b[tt]);bS(this,b,z)}}if(a=a.removedLinkKeys,Array.isArray(a))for(tt=a.length,y=0;y<tt;y++)x=this.jh(a[y]),x!==null&&this.bm(x)},Li.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===Eo){var x=a.object,E=a.propertyName;if(E===this.linkKeyProperty&&this.Jc(x)){var b=a.I(y);y=a.I(!y),y!==void 0&&this.wb.remove(y),b!==void 0&&this.wb.add(b,x),So(x,E,b);return}}else if(a.change===Ko){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,Ve(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)):(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)):0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue));return}}else if(a.change===ar){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,Ve(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)):(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue):(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)));return}}mn.prototype.changeState.call(this,a,y)}},xt=Li.prototype,xt.Vl=function(a){if(a!==void 0){var y=this.Ri;if(y!==null){var x=this.hc(a);x===null&&(x=this.copyNodeData(y),So(x,this.nodeKeyProperty,a),this.xf(x))}return a}},xt.yx=function(a){return ga(this,a,!0)},xt.wv=function(a,y){Mc(this,a,y,!0)},xt.Bx=function(a){return ga(this,a,!1)},xt.Bv=function(a,y){Mc(this,a,y,!1)};function ga(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=Vo(y,a),a!==void 0))){if(Fh(a))return a;de((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Mc(a,y,x,E){if(x===null&&(x=void 0),y!==null){var b=E?a.lf:a.mf;if(b!=="")if(x=a.Vl(x),a.Jc(y)){var z=Vo(y,b);z!==x&&(hl(a,z,y),So(y,b,x),a.hc(x)===null&&ul(a,x,y),or(a,E?"linkFromKey":"linkToKey",Eo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else So(y,b,x)}}xt.zx=function(a){return u0(this,a,!0)},xt.xv=function(a,y){Ec(this,a,y,!0)},xt.Cx=function(a){return u0(this,a,!1)},xt.Cv=function(a,y){Ec(this,a,y,!1)};function u0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=Vo(y,a),y===void 0?"":y)}function Ec(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=Vo(y,b);z===void 0&&(z=""),z!==x&&(So(y,b,x),or(a,E?"linkFromPortId":"linkToPortId",Eo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else So(y,b,x)}}xt.Ef=function(a){if(a===null)return h0;var y=this.je;return y===""?h0:(a=Vo(a,y),a===void 0?h0:a)},xt.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=Vo(a,x);if(E===void 0&&(E=h0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)hl(this,E[z],a);for(So(a,x,y),b=y.length,z=0;z<b;z++){var tt=y[z];this.hc(tt)===null&&ul(this,tt,a)}or(this,"linkLabelKeys",Eo,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else So(a,x,y)}},xt.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=Vo(a,x);if(E===void 0)x=[],x.push(y),this.Ls(a,x);else if(Array.isArray(E)){var b=E.indexOf(y);0<=b||(b=E.length,E.push(y),this.Jc(a)&&(this.hc(y)===null&&ul(this,y,a),or(this,"linkLabelKeys",Ko,x,a,null,y,null,b)))}else de(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},xt.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=Vo(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(hl(this,y,a),or(this,"linkLabelKeys",ar,x,a,y,null,b,null)))}else E!==void 0&&de(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},xt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=Vo(a,y),y!==void 0)){if(Fh(y))return y;de("Key value for link data "+a+" is not a number or a string: "+y)}}},xt.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=Vo(a,x);E!==y&&this.jh(y)===null&&(So(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),or(this,"linkKey",Eo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else So(a,x,y)}},xt.jh=function(a){return a===null&&de("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&Fh(a)?this.wb.I(a):null},xt.Bs=function(a){if(a!==null){var y=this.Jh;if(y!==""){var x=this.Ac(a);if(x===void 0||this.wb.contains(x)){var E=this.cl;if(E!==null&&(x=E(this,a),x!=null&&!this.wb.contains(x))){So(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;So(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;So(a,y,x)}}}}},xt.Jc=function(a){return a===null?!1:this.$f.contains(a)},xt.fi=function(a){a!==null&&(co(a),this.Jc(a)||TS(this,a,!0))};function TS(a,y,x){if(a.linkKeyProperty!==""){var E=a.Ac(y);if(E!==void 0&&a.wb.I(E)===y)return;a.Bs(y),E=a.Ac(y),E===void 0&&de("GraphLinksModel.makeLinkDataKeyUnique failed on "+y+". Data not added to model."),a.wb.add(E,y)}a.$f.add(y),E=null,x&&(E=a.md.length,a.md.splice(E,0,y)),or(a,"linkDataArray",Ko,"linkDataArray",a,null,y,null,E),fy(a,y)}xt.Ey=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.fi(a[x]);else for(a=a.iterator;a.next();)this.fi(a.value)},xt.bm=function(a){a!==null&&FS(this,a,!0)};function FS(a,y,x){a.$f.remove(y);var E=a.Ac(y);if(E!==void 0&&a.wb.remove(E),E=null,x){if(E=a.md.indexOf(y),0>E)return;a.md.splice(E,1)}if(or(a,"linkDataArray",ar,"linkDataArray",a,y,null,E,null),x=ga(a,y,!0),hl(a,x,y),x=ga(a,y,!1),hl(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],hl(a,x,y)}xt.lA=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.bm(a[x]);else for(a=a.iterator;a.next();)this.bm(a.value)},xt.Zz=function(a){if(this.linkKeyProperty===""&&de("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&jn(a)){var y=this.kl;y.clear(),y.addAll(this.wb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.Ac(z);if(tt!==void 0){x.add(tt);var ot=this.jh(tt);ot!==z&&(ot!==null?(this.Do(ot,z),bS(this,z,ot)):(z=this.cloneDeep(z),this.Ks(z,tt),this.fi(z)))}else tt=this.cloneDeep(z),this.fi(tt),x.add(this.Ac(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.jh(E))&&this.bm(E);y.clear(),x.clear()}};function fy(a,y){var x=ga(a,y,!0);x=a.Vl(x),a.hc(x)===null&&ul(a,x,y),x=ga(a,y,!1),x=a.Vl(x),a.hc(x)===null&&ul(a,x,y);var E=a.Ef(y);if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],a.hc(x)===null&&ul(a,x,y)}xt.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):l0(this,a,!0),Ve(a)&&(vi(a),this.lf!==""&&So(a,this.lf,void 0),this.mf!==""&&So(a,this.mf,void 0),this.je!==""&&So(a,this.je,[])),a},xt.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!Vo(a,y)},xt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=Vo(a,y),y!==void 0)){if(Fh(y))return y;de("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},xt.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=Vo(a,x);E!==y&&(hl(this,E,a),So(a,x,y),this.hc(y)===null&&ul(this,y,a),or(this,"nodeGroupKey",Eo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else So(a,x,y)}},Li.prototype.copyNodeData=function(a){return a===null?null:(a=mn.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||Vo(a,this.Je)===void 0||So(a,this.Je,void 0),a)},Li.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeGroupKeyProperty){this.mp(a,x);return}}else if(this.Jc(a)){if(y===this.linkFromKeyProperty){Mc(this,a,x,!0);return}if(y===this.linkToKeyProperty){Mc(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Ec(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Ec(this,a,x,!1);return}if(y===this.linkKeyProperty){this.Ks(a,x);return}if(y===this.linkCategoryProperty){this.lp(a,x);return}if(y===this.linkLabelKeysProperty){this.Ls(a,x);return}}var E=Vo(a,y);E!==x&&(So(a,y,x),this.Fs(a,y,E,x))},xt=Li.prototype,xt.Do=function(a,y){if(y){var x=this.lb(a),E=this.Jc(a),b;for(b in y)b==="__gohashid"||x&&b===this.nodeKeyProperty||x&&b===this.nodeIsGroupProperty&&Vo(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},xt.jp=function(a,y){mn.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y);for(x=this.$f.iterator;x.next();){var E=x.value,b=a,z=y;if(ga(this,E,!0)===b){var tt=this.lf;So(E,tt,z),or(this,"linkFromKey",Eo,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(ga(this,E,!1)===b&&(tt=this.mf,So(E,tt,z),or(this,"linkToKey",Eo,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)),tt=this.Ef(E),Array.isArray(tt))for(var ot=tt.length,rt=this.je,at=0;at<ot;at++)tt[at]===b&&(tt[at]=z,or(this,"linkLabelKeys",Ko,rt,E,b,z,at,at))}},xt.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;So(a,E,x),or(this,"nodeGroupKey",Eo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},xt.Lv=function(){mn.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)fy(this,a[x])},xt.fm=function(a){mn.prototype.fm.call(this,a),a=this.wa(a);var y=rp(this,a);if(y!==null){var x=Un();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;or(this,"nodeGroupKey",Eo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(ga(this,E,!0)===a&&(b=this.lf,or(this,"linkFromKey",Eo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),ga(this,E,!1)===a&&(b=this.mf,or(this,"linkToKey",Eo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),b=this.Ef(E),Array.isArray(b))for(var z=b.length,tt=this.je,ot=0;ot<z;ot++)b[ot]===a&&(or(this,"linkLabelKeys",Ko,tt,E,a,a,ot,ot),x.push(E))}for(y=0;y<x.length;y++)hl(this,a,x[y]);_n(x)}},xt.em=function(a){mn.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&ul(this,y,a)},xt.qp=function(a){mn.prototype.qp.call(this,a);var y=this.lh(a);hl(this,y,a)},xt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=Vo(a,y),y===void 0))return"";if(typeof y=="string")return y;de("getCategoryForLinkData found a non-string category for "+a+": "+y)},Li.prototype.getLinkCategoryForData=function(a){return this.ps(a)},Li.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=Vo(a,x);E===void 0&&(E=""),E!==y&&(So(a,x,y),or(this,"linkCategory",Eo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else So(a,x,y)}},Li.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},xt=Li.prototype,xt.lm=function(a,y){mn.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function bS(a,y,x){a.lp(x,a.ps(y)),a.wv(x,a.yx(y)),a.Bv(x,a.Bx(y)),a.Ls(x,a.Ef(y)),a.xv(x,a.zx(y)),a.Cv(x,a.Cx(y))}xt.Wj=function(){return!0},xt.ri=function(){return!0},xt.xs=function(){return!0},xt.Xj=function(){return!0},Ie.Object.defineProperties(Li.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){var y=this.Ri;y!==a&&(this.Ri=a,this.g("archetypeNodeData",y,a))}},linkFromKeyProperty:{get:function(){return this.lf},set:function(a){var y=this.lf;y!==a&&(this.lf=a,this.g("linkFromKeyProperty",y,a))}},linkToKeyProperty:{get:function(){return this.mf},set:function(a){var y=this.mf;y!==a&&(this.mf=a,this.g("linkToKeyProperty",y,a))}},linkFromPortIdProperty:{get:function(){return this.ej},set:function(a){var y=this.ej;y!==a&&(this.ej=a,this.g("linkFromPortIdProperty",y,a))}},linkToPortIdProperty:{get:function(){return this.fj},set:function(a){var y=this.fj;y!==a&&(this.fj=a,this.g("linkToPortIdProperty",y,a))}},linkLabelKeysProperty:{get:function(){return this.je},set:function(a){var y=this.je;y!==a&&(this.je=a,this.g("linkLabelKeysProperty",y,a))}},linkDataArray:{get:function(){return this.md},set:function(a){var y=this.md;if(y!==a){this.wb.clear();for(var x=a.length,E=0;E<x;E++){var b=a[E];Ve(b)||de("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),co(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new be,b=0;b<x;b++){var z=a[b],tt=this.Ac(z);tt===void 0||this.wb.I(tt)!==null?E.add(z):this.wb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.Bs(b),z=this.Ac(b),z!==void 0&&this.wb.add(z,b)}for(E=new ke,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,or(this,"linkDataArray",Eo,"linkDataArray",this,y,a),y=0;y<x;y++)fy(this,a[y])}}},linkKeyProperty:{get:function(){return this.Jh},set:function(a){var y=this.Jh;if(y!==a){this.Jh=a,this.wb.clear();for(var x=this.linkDataArray.length,E=0;E<x;E++){var b=this.linkDataArray[E],z=this.Ac(b);z===void 0&&(this.Bs(b),z=this.Ac(b)),z!==void 0&&this.wb.add(z,b)}this.g("linkKeyProperty",y,a)}}},makeUniqueLinkKeyFunction:{get:function(){return this.cl},set:function(a){var y=this.cl;y!==a&&(this.cl=a,this.g("makeUniqueLinkKeyFunction",y,a))}},copyLinkDataFunction:{get:function(){return this.Ak},set:function(a){var y=this.Ak;y!==a&&(this.Ak=a,this.g("copyLinkDataFunction",y,a))}},nodeIsGroupProperty:{get:function(){return this.jl},set:function(a){var y=this.jl;y!==a&&(this.jl=a,this.g("nodeIsGroupProperty",y,a))}},nodeGroupKeyProperty:{get:function(){return this.Je},set:function(a){var y=this.Je;y!==a&&(this.Je=a,this.g("nodeGroupKeyProperty",y,a))}},Ij:{get:function(){return this.Lm},set:function(a){this.Lm!==a&&(this.Lm=a)}},linkCategoryProperty:{get:function(){return this.dj},set:function(a){var y=this.dj;y!==a&&(this.dj=a,this.g("linkCategoryProperty",y,a))}},type:{get:function(){return"GraphLinksModel"}}}),Li.prototype.setCategoryForLinkData=Li.prototype.lp,Li.prototype.getCategoryForLinkData=Li.prototype.ps,Li.prototype.assignAllDataProperties=Li.prototype.Do,Li.prototype.setGroupKeyForNodeData=Li.prototype.mp,Li.prototype.getGroupKeyForNodeData=Li.prototype.lh,Li.prototype.isGroupForNodeData=Li.prototype.Yu,Li.prototype.copyLinkData=Li.prototype.Jo,Li.prototype.mergeLinkDataArray=Li.prototype.Zz,Li.prototype.removeLinkDataCollection=Li.prototype.lA,Li.prototype.removeLinkData=Li.prototype.bm,Li.prototype.addLinkDataCollection=Li.prototype.Ey,Li.prototype.addLinkData=Li.prototype.fi,Li.prototype.containsLinkData=Li.prototype.Jc,Li.prototype.makeLinkDataKeyUnique=Li.prototype.Bs,Li.prototype.findLinkDataForKey=Li.prototype.jh,Li.prototype.setKeyForLinkData=Li.prototype.Ks,Li.prototype.getKeyForLinkData=Li.prototype.Ac,Li.prototype.removeLabelKeyForLinkData=Li.prototype.Qx,Li.prototype.addLabelKeyForLinkData=Li.prototype.Bu,Li.prototype.setLabelKeysForLinkData=Li.prototype.Ls,Li.prototype.getLabelKeysForLinkData=Li.prototype.Ef,Li.prototype.setToPortIdForLinkData=Li.prototype.Cv,Li.prototype.getToPortIdForLinkData=Li.prototype.Cx,Li.prototype.setFromPortIdForLinkData=Li.prototype.xv,Li.prototype.getFromPortIdForLinkData=Li.prototype.zx,Li.prototype.setToKeyForLinkData=Li.prototype.Bv,Li.prototype.getToKeyForLinkData=Li.prototype.Bx,Li.prototype.setFromKeyForLinkData=Li.prototype.wv,Li.prototype.getFromKeyForLinkData=Li.prototype.yx,Li.prototype.clear=Li.prototype.clear;var h0=Object.freeze([]);Li.className="GraphLinksModel",qa.GraphLinksModel=Li,mn.constructGraphLinksModel=mn.constructGraphLinksModel=function(){return new Li},mn.initDiagramModel=hy=function(){return new Li};function ys(a,y){mn.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(jn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}ee(ys,mn),ys.constructGraphLinksModel=mn.constructGraphLinksModel,ys.prototype.cloneProtected=function(a){mn.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},xt=ys.prototype,xt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" TreeModel";if(0<a){y+=`
node data:`,a=this.nodeDataArray;for(var x=a.length,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Yi(b)}}return y},xt.rm=function(){var a=mn.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},xt.gp=function(a){mn.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},xt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&de("applyIncrementalJson cannot change Model properties"),mn.prototype.fp.call(this,a)},xt.Vl=function(a){return a},xt.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=Vo(a,y),y!==void 0)){if(Fh(y))return y;de("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},xt.qe=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Ke;if(x!=="")if(y=this.Vl(y),this.lb(a)){var E=Vo(a,x);E!==y&&(hl(this,E,a),So(a,x,y),this.hc(y)===null&&ul(this,y,a),or(this,"nodeParentKey",Eo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else So(a,x,y)}},xt.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=Vo(a,y),y===void 0)?"":typeof y=="string"?y:(de("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},ys.prototype.getLinkCategoryForData=function(a){return this.ss(a)},ys.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=Vo(a,x);E===void 0&&(E=""),E!==y&&(So(a,x,y),or(this,"parentLinkCategory",Eo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else So(a,x,y)}},ys.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},ys.prototype.copyNodeData=function(a){return a===null?null:(a=mn.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||Vo(a,this.Ke)===void 0||So(a,this.Ke,void 0),a)},ys.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeParentKeyProperty){this.qe(a,x);return}}var E=Vo(a,y);E!==x&&(So(a,y,x),this.Fs(a,y,E,x))},xt=ys.prototype,xt.jp=function(a,y){mn.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},xt.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;So(a,E,x),or(this,"nodeParentKey",Eo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},xt.fm=function(a){mn.prototype.fm.call(this,a),a=this.wa(a);var y=rp(this,a);if(y!==null){var x=Un();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;or(this,"nodeParentKey",Eo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)hl(this,a,x[y]);_n(x)}},xt.em=function(a){mn.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&ul(this,y,a)},xt.qp=function(a){mn.prototype.qp.call(this,a);var y=this.mh(a);hl(this,y,a)},xt.lm=function(a,y){mn.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},xt.Tl=function(){return!0},xt.xs=function(){return!0},Ie.Object.defineProperties(ys.prototype,{nodeParentKeyProperty:{get:function(){return this.Ke},set:function(a){var y=this.Ke;y!==a&&(this.Ke=a,this.g("nodeParentKeyProperty",y,a))}},Jj:{get:function(){return this.Nm},set:function(a){this.Nm!==a&&(this.Nm=a)}},parentLinkCategoryProperty:{get:function(){return this.nj},set:function(a){var y=this.nj;y!==a&&(this.nj=a,this.g("parentLinkCategoryProperty",y,a))}},linkCategoryProperty:{get:function(){return this.parentLinkCategoryProperty},set:function(a){this.parentLinkCategoryProperty=a}},type:{get:function(){return"TreeModel"}}}),ys.prototype.setParentLinkCategoryForNodeData=ys.prototype.Ms,ys.prototype.getParentLinkCategoryForNodeData=ys.prototype.ss,ys.prototype.setParentKeyForNodeData=ys.prototype.qe,ys.prototype.getParentKeyForNodeData=ys.prototype.mh,ys.className="TreeModel",qa.TreeModel=ys;function Ao(a){xo.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=$a,this.Ti=0,this.Zv=new At,this.Jp=this.me=0,this.Xr=new dp,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=$a,this.K=Ss,this.nd=Tc,this.hd=oy,this.tf=6,this.Nn=v0,a&&Object.assign(this,a)}ee(Ao,xo),Ao.prototype.cloneProtected=function(a){xo.prototype.cloneProtected.call(this,a),a.eo=this.eo,a.Cm=this.Cm,a.ro=this.ro,a.ul=this.ul,a.Rb=this.Rb,a.K=this.K,a.nd=this.nd,a.hd=this.hd,a.tf=this.tf,a.Nn=this.Nn},Ao.prototype.qb=function(a){a.classType===Ao?a===p0||a===m0||a===c0||a===g0||a===Tc?this.sorting=a:a===xd||a===Nc||a===Ss||a===Ah?this.direction=a:a===Yu||a===bh||a===$a||a===tl?this.arrangement=a:(a===ff||a===v0)&&(this.nodeDiameterFormula=a):xo.prototype.qb.call(this,a)},Ao.prototype.createNetwork=function(){return new Fc(this)},Ao.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),a=this.network.vertexes,1>=a.count)a.count===1&&(a=a.first(),a.centerX=0,a.centerY=0);else{var y=new be;y.addAll(a.iterator),a=new be;var x=new be,E=this.sort(y),b,z,tt=this.Jp,ot=this.arrangement,rt=this.nodeDiameterFormula,at=this.radius;(!isFinite(at)||0>=at)&&(at=NaN);var ut=this.aspectRatio;(!isFinite(ut)||0>=ut)&&(ut=1);var ct=this.startAngle;isFinite(ct)||(ct=0);var mt=this.sweepAngle;if((!isFinite(mt)||360<mt||1>mt)&&(mt=360),y=this.spacing,isFinite(y)||(y=NaN),ot===tl&&rt===ff?ot=$a:ot===tl&&rt!==ff&&(ot=this.arrangement),(this.direction===xd||this.direction===Nc)&&this.sorting!==Tc){for(rt=0;!(rt>=E.length)&&(a.add(E.M(rt)),!(rt+1>=E.length));rt+=2)x.add(E.M(rt+1));this.direction===xd?(this.arrangement===tl&&a.reverse(),E=new be,E.addAll(a),E.addAll(x)):(this.arrangement===tl&&x.reverse(),E=new be,E.addAll(x),E.addAll(a))}rt=E.length;for(var yt=z=b=0;yt<E.length;yt++){var St=ct+mt*z*(this.direction===Ss?1:-1)/rt,Mt=E.M(yt).diameter;isNaN(Mt)&&(Mt=Bh(E.M(yt),St)),360>mt&&(yt===0||yt===E.length-1)&&(Mt/=2),b+=Mt,z++}if(isNaN(at)||ot===tl){if(isNaN(y)&&(y=6),ot!==$a&&ot!==tl){for(z=-1/0,tt=0;tt<rt;tt++)yt=E.M(tt),b=E.M(tt===rt-1?0:tt+1),isNaN(yt.diameter)&&Bh(yt,0),isNaN(b.diameter)&&Bh(b,0),z=Math.max(z,(yt.diameter+b.diameter)/2);tt=z+y,ot===Yu?at=(z+y)/(2*Math.PI/rt):at=d0(this,tt*(360<=mt?rt:rt-1),ut,ct*Math.PI/180,mt*Math.PI/180)}else at=d0(this,b+(360<=mt?rt:rt-1)*(ot!==tl?y:1.6*y),ut,ct*Math.PI/180,mt*Math.PI/180);z=at*ut}else if(z=at*ut,yt=cy(this,at,z,ct*Math.PI/180,mt*Math.PI/180),isNaN(y))(ot===$a||ot===tl)&&(y=(yt-b)/(360<=mt?rt:rt-1));else if(ot===$a||ot===tl)yt=(yt-b)/(360<=mt?rt:rt-1),yt<y?(at=d0(this,b+y*(360<=mt?rt:rt-1),ut,ct*Math.PI/180,mt*Math.PI/180),z=at*ut):y=yt;else{for(tt=-1/0,b=0;b<rt;b++)St=E.M(b),Mt=E.M(b===rt-1?0:b+1),isNaN(St.diameter)&&Bh(St,0),isNaN(Mt.diameter)&&Bh(Mt,0),tt=Math.max(tt,(St.diameter+Mt.diameter)/2);tt+=y,b=d0(this,tt*(360<=mt?rt:rt-1),ut,ct*Math.PI/180,mt*Math.PI/180),b>at?(at=b,z=at*ut):tt=yt/(360<=mt?rt:rt-1)}if(this.kw=ot,this.lc=at,this.Zm=ut,this.lw=ct,this.Wp=mt,this.Ti=y,this.me=z,this.Jp=tt,y=E,E=this.kw,ot=this.lc,at=this.lw,ut=this.Wp,ct=this.Ti,mt=this.me,rt=this.Jp,this.direction!==xd&&this.direction!==Nc||E!==tl)if(this.direction===xd||this.direction===Nc){switch(tt=0,E){case bh:tt=180*f0(this,ot,mt,at,rt)/Math.PI;break;case $a:rt=y=0,tt=a.first(),tt!==null&&(y=Bh(tt,Math.PI/2)),tt=x.first(),tt!==null&&(rt=Bh(tt,Math.PI/2)),tt=180*f0(this,ot,mt,at,ct+(y+rt)/2)/Math.PI;break;case Yu:tt=ut/y.length}if(this.direction===xd){switch(E){case bh:hp(this,a,at,Ah);break;case $a:up(this,a,at,Ah);break;case Yu:lp(this,a,ut/2,at,Ah)}switch(E){case bh:hp(this,x,at+tt,Ss);break;case $a:up(this,x,at+tt,Ss);break;case Yu:lp(this,x,ut/2,at+tt,Ss)}}else{switch(E){case bh:hp(this,x,at,Ah);break;case $a:up(this,x,at,Ah);break;case Yu:lp(this,x,ut/2,at,Ah)}switch(E){case bh:hp(this,a,at+tt,Ss);break;case $a:up(this,a,at+tt,Ss);break;case Yu:lp(this,a,ut/2,at+tt,Ss)}}}else switch(E){case bh:hp(this,y,at,this.direction);break;case $a:up(this,y,at,this.direction);break;case Yu:lp(this,y,ut,at,this.direction);break;case tl:AS(this,y,ut,at,this.direction)}else AS(this,y,ut,at-ut/2,Ss)}this.updateParts(),this.network=null,this.isValidLayout=!0};function lp(a,y,x,E,b){var z=a.Wp,tt=a.lc;a=a.me,E=E*Math.PI/180,x=x*Math.PI/180;for(var ot=y.length,rt=0;rt<ot;rt++){var at=E+(b===Ss?rt*x/(360<=z?ot:ot-1):-(rt*x)/ot),ut=y.M(rt),ct=tt*Math.tan(at)/a;ct=Math.sqrt((tt*tt+a*a*ct*ct)/(1+ct*ct)),ut.centerX=ct*Math.cos(at),ut.centerY=ct*Math.sin(at),ut.actualAngle=180*at/Math.PI}}function up(a,y,x,E){var b=a.lc,z=a.me,tt=a.Ti;x=x*Math.PI/180;for(var ot=y.length,rt=0;rt<ot;rt++){var at=y.M(rt),ut=y.M(rt===ot-1?0:rt+1),ct=z*Math.sin(x);at.centerX=b*Math.cos(x),at.centerY=ct,at.actualAngle=180*x/Math.PI,isNaN(at.diameter)&&Bh(at,0),isNaN(ut.diameter)&&Bh(ut,0),at=f0(a,b,z,E===Ss?x:-x,(at.diameter+ut.diameter)/2+tt),x+=E===Ss?at:-at}}function hp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Jp;x=x*Math.PI/180;for(var ot=y.length,rt=0;rt<ot;rt++){var at=y.M(rt);at.centerX=b*Math.cos(x),at.centerY=z*Math.sin(x),at.actualAngle=180*x/Math.PI,at=f0(a,b,z,E===Ss?x:-x,tt),x+=E===Ss?at:-at}}function AS(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new dp,360>x){for(z=E+(b===Ss?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,DS(a,y,x,E,b)}else BS(a,y,x,E,b);a.Xr.commit(y)}function BS(a,y,x,E,b){var z=a.lc,tt=a.Ti,ot=a.Zm,rt=z*Math.cos(E*Math.PI/180),at=a.me*Math.sin(E*Math.PI/180),ut=y.Fa();if(ut.length===3)ut[0].centerX=z,ut[0].centerY=0,ut[1].centerX=ut[0].centerX-ut[0].width/2-ut[1].width/2-tt,ut[1].y=ut[0].y,ut[2].centerX=(ut[0].centerX+ut[1].centerX)/2,ut[2].y=ut[0].y-ut[2].height-tt;else if(ut.length===4)ut[0].centerX=z,ut[0].centerY=0,ut[2].centerX=-ut[0].centerX,ut[2].centerY=ut[0].centerY,ut[1].centerX=0,ut[1].y=Math.min(ut[0].y,ut[2].y)-ut[1].height-tt,ut[3].centerX=0,ut[3].y=Math.max(ut[0].y+ut[0].height+tt,ut[2].y+ut[2].height+tt);else{z=At.alloc();for(var ct=0;ct<ut.length&&(ut[ct].centerX=rt,ut[ct].centerY=at,!(ct>=ut.length-1));ct++)OS(a,rt,at,ut,ct,b,z)||IS(a,rt,at,ut,ct,b,z),rt=z.x,at=z.y;if(At.free(z),a.mj++,!(23<a.mj)){rt=ut[0].centerX,at=ut[0].centerY,z=ut[ut.length-1].centerX,ct=ut[ut.length-1].centerY;var mt=Math.abs(rt-z)-((ut[0].width+ut[ut.length-1].width)/2+tt),yt=Math.abs(at-ct)-((ut[0].height+ut[ut.length-1].height)/2+tt);tt=0,1>Math.abs(yt)?Math.abs(rt-z)<(ut[0].width+ut[ut.length-1].width)/2&&(tt=0):tt=0<yt?yt:1>Math.abs(mt)?0:mt,rt=Math.abs(z)>Math.abs(ct)?0<z!=at>ct:0<ct!=rt<z,(rt=b===Ss?rt:!rt)&&(tt=-Math.abs(tt),tt=Math.min(tt,-ut[ut.length-1].width),tt=Math.min(tt,-ut[ut.length-1].height)),a.Xr.compare(tt,ut),1<Math.abs(tt)&&(a.lc=8>a.mj?a.lc-tt/(2*Math.PI):5>ut.length&&10<tt?a.lc/2:a.lc-(0<tt?1.7:-2.3),a.me=a.lc*ot,BS(a,y,x,E,b))}}}function DS(a,y,x,E,b){for(var z=a.lc,tt=a.me,ot=a.Zm,rt=z*Math.cos(E*Math.PI/180),at=tt*Math.sin(E*Math.PI/180),ut=At.alloc(),ct=y.Fa(),mt=0;mt<ct.length&&(ct[mt].centerX=rt,ct[mt].centerY=at,!(mt>=ct.length-1));mt++)OS(a,rt,at,ct,mt,b,ut)||IS(a,rt,at,ct,mt,b,ut),rt=ut.x,at=ut.y;if(At.free(ut),a.mj++,!(23<a.mj)){if(rt=Math.atan2(at,rt),rt=b===Ss?a.gt-rt:rt-a.gt,rt=Math.abs(rt)<Math.abs(rt-2*Math.PI)?rt:rt-2*Math.PI,z=rt*(z+tt)/2,tt=a.Xr,Math.abs(z)<Math.abs(tt.Pl))for(tt.Pl=z,tt.mk=[],tt.tm=[],rt=0;rt<ct.length;rt++)tt.mk[rt]=ct[rt].bounds.x,tt.tm[rt]=ct[rt].bounds.y;1<Math.abs(z)&&(a.lc=8>a.mj?a.lc-z/(2*Math.PI):a.lc-(0<z?1.7:-2.3),a.me=a.lc*ot,DS(a,y,x,E,b))}}function OS(a,y,x,E,b,z,tt){var ot=a.lc,rt=a.me,at=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var ut=!1;if(0<=x!=(z===Ss)){if(z=y+a,z>ot){if(z=y-a,z<-ot)return tt.x=z,tt.y=at,!1;ut=!0}}else if(z=y-a,z<-ot){if(z=y+a,z>ot)return tt.x=z,tt.y=at,!1;ut=!0}return at=Math.sqrt(1-Math.min(1,z*z/(ot*ot)))*rt,0>x!==ut&&(at=-at),Math.abs(x-at)>(E[b].height+E[b+1].height)/2?(tt.x=z,tt.y=at,!1):(tt.x=z,tt.y=at,!0)}function IS(a,y,x,E,b,z,tt){var ot=a.lc,rt=a.me,at=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===Ss)){if(z=x-a,z<-rt){if(z=x+a,z>rt){tt.x=at,tt.y=z;return}E=!0}}else if(z=x+a,z>rt){if(z=x-a,z<-rt){tt.x=at,tt.y=z;return}E=!0}at=Math.sqrt(1-Math.min(1,z*z/(rt*rt)))*ot,0>y!==E&&(at=-at),tt.x=at,tt.y=z}Ao.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Ao.prototype.commitNodes=function(){var a=this.group!==null&&this.group.placeholder!==null&&this.group.isSubGraphExpanded,y=a?this.group.location.copy():null,x=this.actualCenter;a?x=new At(0,0):(x.x=this.arrangementOrigin.x+this.lc,x.y=this.arrangementOrigin.y+this.me);for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;b.x+=x.x,b.y+=x.y,b.commit()}a&&(this.group.Va(),a=this.group.position.copy(),x=this.group.location.copy(),y=y.re(x.re(a)),this.group.move(y),this.Zv=y.re(a))},Ao.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function cy(a,y,x,E,b){var z=a.ty;if(.001>Math.abs(a.Zm-1))return E!==void 0&&b!==void 0?b*y:2*Math.PI*y;a=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x;for(var tt=0,ot=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),rt=0,at=0;at<=z;at++){E!==void 0&&b!==void 0?rt=E+at*b/z:rt=at*Math.PI/(2*z);var ut=Math.sin(rt);tt+=Math.sqrt(1-a*a*ut*ut)*ot}return E!==void 0&&b!==void 0?(y>x?y:x)*tt:4*(y>x?y:x)*tt}function d0(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?cy(a,1,x,E,b):cy(a,1,x))}function f0(a,y,x,E,b){if(.001>Math.abs(a.Zm-1))return b/y;var z=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x,tt=0;a=2*Math.PI/(700*a.network.vertexes.count),y>x&&(E+=Math.PI/2);for(var ot=0;;ot++){var rt=Math.sin(E+ot*a);if(tt+=(y>x?y:x)*Math.sqrt(1-z*z*rt*rt)*a,tt>=b)return ot*a}}Ao.prototype.sort=function(a){switch(this.sorting){case c0:break;case g0:a.reverse();break;case p0:a.sort(this.comparer);break;case m0:a.sort(this.comparer),a.reverse();break;case Tc:return this.ak(Bx(a));default:de("Invalid sorting type.")}return a};function Bx(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new be;for(var E=0;E<a.length;E++){var b=-1,z=-1;if(E===0)for(var tt=0;tt<a.length;tt++){var ot=a.M(tt).edgesCount;ot>b&&(b=ot,z=tt)}else for(tt=0;tt<a.length;tt++)ot=y[tt],ot>b&&(b=ot,z=tt);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),tt=z.sourceEdges;tt.next();)b=a.indexOf(tt.value.fromVertex),0>b||0<=y[b]&&y[b]++;for(z=z.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),0>b||0<=y[b]&&y[b]++}return x}Ao.prototype.ak=function(a){for(var y=[],x=0;x<a.length;x++){var E=a.M(x);y[x]=[];for(var b,z=E.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b);for(E=E.sourceEdges;E.next();)b=a.indexOf(E.value.fromVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b)}for(z=[],x=0;x<y.length;x++)z[x]=0;x=[];var tt=[],ot=[];E=[],b=new be;for(var rt=0,at=0;at<y.length;at++){var ut=y[at].length;if(ut===1)E.push(at);else if(ut===0)b.add(a.M(at));else{if(rt===0)x.push(at);else{for(var ct=ut=1/0,mt=-1,yt=[],St=0;St<x.length;St++)0>y[x[St]].indexOf(x[St===x.length-1?0:St+1])&&yt.push(St===x.length-1?0:St+1);if(yt.length===0)for(St=0;St<x.length;St++)yt.push(St);for(St=0;St<yt.length;St++){for(var Mt=yt[St],Ot=y[at],bt=0,jt=0;jt<tt.length;jt++){var Gt=z[tt[jt]],Wt=z[ot[jt]];if(Gt<Wt){var Kt=Gt;Gt=Wt}else Kt=Wt;if(Kt<Mt&&Mt<=Gt)for(Wt=0;Wt<Ot.length;Wt++){var $t=Ot[Wt];0>x.indexOf($t)||Kt<z[$t]&&z[$t]<Gt||Kt===z[$t]||Gt===z[$t]||bt++}else for(Wt=0;Wt<Ot.length;Wt++)$t=Ot[Wt],0>x.indexOf($t)||Kt<z[$t]&&z[$t]<Gt&&Kt!==z[$t]&&Gt!==z[$t]&&bt++}for(Ot=bt,jt=bt=0;jt<y[at].length;jt++)Kt=x.indexOf(y[at][jt]),0<=Kt&&(Kt=Math.abs(Mt-(Kt>=Mt?Kt+1:Kt)),bt+=Kt<x.length+1-Kt?Kt:x.length+1-Kt);for(jt=0;jt<tt.length;jt++)Kt=z[tt[jt]],Gt=z[ot[jt]],Kt>=Mt&&Kt++,Gt>=Mt&&Gt++,Kt>Gt&&(Wt=Gt,Gt=Kt,Kt=Wt),Gt-Kt<(x.length+2)/2==(Kt<Mt&&Mt<=Gt)&&bt++;(Ot<ut||Ot===ut&&bt<ct)&&(ut=Ot,ct=bt,mt=Mt)}for(x.splice(mt,0,at),ut=0;ut<x.length;ut++)z[x[ut]]=ut;for(ut=0;ut<y[at].length;ut++)ct=y[at][ut],0<=x.indexOf(ct)&&(tt.push(at),ot.push(ct))}rt++}}for(tt=x.length;;){for(z=!0,ot=0;ot<E.length;ot++)if(rt=E[ot],at=y[rt][0],ut=x.indexOf(at),0<=ut){for(mt=ct=0;mt<y[at].length;mt++)yt=x.indexOf(y[at][mt]),0>yt||yt===ut||(St=yt>ut?yt-ut:ut-yt,ct+=yt<ut!=St>tt-St?1:-1);x.splice(0>ct?ut:ut+1,0,rt),E.splice(ot,1),ot--}else z=!1;if(z)break;x.push(E[0]),E.splice(0,1)}for(y=0;y<x.length;y++)b.add(a.M(x[y]));return b},Ie.Object.defineProperties(Ao.prototype,{radius:{get:function(){return this.eo},set:function(a){this.eo!==a&&(0<a||isNaN(a))&&(this.eo=a,this.C())}},aspectRatio:{get:function(){return this.Cm},set:function(a){this.Cm!==a&&0<a&&(this.Cm=a,this.C())}},startAngle:{get:function(){return this.ro},set:function(a){this.ro!==a&&(this.ro=a,this.C())}},sweepAngle:{get:function(){return this.ul},set:function(a){this.ul!==a&&(0<a&&360>=a?this.ul=a:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==tl&&a!==$a&&a!==bh&&a!==Yu||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Ss&&a!==Ah&&a!==xd&&a!==Nc||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==c0&&a!==g0&&a!==p0&&!m0&&a!==Tc||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf!==a&&(this.tf=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(a){this.Nn===a||a!==v0&&a!==ff||(this.Nn=a,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var $a=new ae(Ao,"ConstantSpacing",0),bh=new ae(Ao,"ConstantDistance",1),Yu=new ae(Ao,"ConstantAngle",2),tl=new ae(Ao,"Packed",3),Ss=new ae(Ao,"Clockwise",4),Ah=new ae(Ao,"Counterclockwise",5),xd=new ae(Ao,"BidirectionalLeft",6),Nc=new ae(Ao,"BidirectionalRight",7),c0=new ae(Ao,"Forwards",8),g0=new ae(Ao,"Reverse",9),p0=new ae(Ao,"Ascending",10),m0=new ae(Ao,"Descending",11),Tc=new ae(Ao,"Optimized",12),v0=new ae(Ao,"Pythagorean",13),ff=new ae(Ao,"Circular",14);Ao.className="CircularLayout",Ao.ConstantSpacing=$a,Ao.ConstantDistance=bh,Ao.ConstantAngle=Yu,Ao.Packed=tl,Ao.Clockwise=Ss,Ao.Counterclockwise=Ah,Ao.BidirectionalLeft=xd,Ao.BidirectionalRight=Nc,Ao.Forwards=c0,Ao.Reverse=g0,Ao.Ascending=p0,Ao.Descending=m0,Ao.Optimized=Tc,Ao.Pythagorean=v0,Ao.Circular=ff;function dp(){this.Pl=-1/0,this.tm=this.mk=null}dp.prototype.compare=function(a,y){if(0<a&&0>this.Pl||Math.abs(a)<Math.abs(this.Pl)&&!(0>a&&0<this.Pl))for(this.Pl=a,this.mk=[],this.tm=[],a=0;a<y.length;a++)this.mk[a]=y[a].bounds.x,this.tm[a]=y[a].bounds.y},dp.prototype.commit=function(a){if(this.mk!==null&&this.tm!==null)for(var y=0;y<this.mk.length;y++){var x=a.M(y);x.x=this.mk[y],x.y=this.tm[y]}},dp.className="VertexArrangement";function Fc(a){oo.call(this,a)}ee(Fc,oo),Fc.prototype.createVertex=function(){return new fp(this)},Fc.prototype.createEdge=function(){return new y0(this)},Fc.className="CircularNetwork";function fp(a){ur.call(this,a),this.u=this.Si=NaN}ee(fp,ur);function Bh(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===tl)if(x.nodeDiameterFormula===ff)a.Si=Math.max(a.width,a.height);else{if(x=Math.abs(Math.sin(y)),y=Math.abs(Math.cos(y)),x===0)return a.width;if(y===0)return a.height;a.Si=Math.min(a.height/x,a.width/y)}else a.Si=x.nodeDiameterFormula===ff?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}Ie.Object.defineProperties(fp.prototype,{diameter:{get:function(){return this.Si},set:function(a){this.Si!==a&&(this.Si=a)}},actualAngle:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}}}),fp.className="CircularVertex";function y0(a){ta.call(this,a)}ee(y0,ta),y0.className="CircularEdge";function Gr(a){xo.call(this),this.ah=null,this.An=0,this.$d=new Le(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,a&&Object.assign(this,a)}ee(Gr,xo),Gr.prototype.cloneProtected=function(a){xo.prototype.cloneProtected.call(this,a),a.$d.assign(this.$d),a.Bm=this.Bm,a.sf=this.sf,a.td=this.td,a.dl=this.dl,a.$m=this.$m,a.Zf=this.Zf,a.In=this.In,a.fo=this.fo,a.Hk=this.Hk,a.Gk=this.Gk,a.Ek=this.Ek,a.Fk=this.Fk,a.Vm=this.Vm,a.Um=this.Um},Gr.prototype.createNetwork=function(){return new cf(this)},Gr.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),a=this.maxIterations,0<this.network.vertexes.count){this.network.Ko();for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;x.charge=this.electricalCharge(x),x.mass=this.gravitationalMass(x)}for(y=this.network.edges.iterator;y.next();)x=y.value,x.stiffness=this.springStiffness(x),x.length=this.springLength(x);if(this.Cu(),this.An=0,this.needsClusterLayout()){y=this.network,x=y.Zx();for(var E=x.iterator;E.next();){this.network=E.value;for(var b=this.network.vertexes.iterator;b.next();){var z=b.value;z.Vd=z.vertexes.count,z.sh=1,z.Hj=null,z.We=null}RS(this,0,a)}this.network=y;var tt=E=x.iterator;E=this.arrangementSpacing;var ot=tt.count,rt=!0;z=b=0;for(var at=Un(),ut=0;ut<ot+y.vertexes.count+2;ut++)at[ut]=null;ot=0,tt.reset();for(var ct=pe.alloc();tt.next();)if(ut=tt.value,this.computeBounds(ut,ct),rt)rt=!1,b=ct.x+ct.width/2,z=ct.y+ct.height/2,at[0]=new At(ct.x+ct.width+E.width,ct.y),at[1]=new At(ct.x,ct.y+ct.height+E.height),ot=2;else{var mt=jS(at,ot,b,z,ct.width,ct.height,E),yt=at[mt],St=new At(yt.x+ct.width+E.width,yt.y),Mt=new At(yt.x,yt.y+ct.height+E.height);for(mt+1<ot&&at.splice(mt+1,0,null),at[mt]=St,at[mt+1]=Mt,ot++,mt=yt.x-ct.x,yt=yt.y-ct.y,ut=ut.vertexes.iterator;ut.next();)St=ut.value,St.centerX+=mt,St.centerY+=yt}for(pe.free(ct),ut=y.vertexes.iterator;ut.next();)tt=ut.value,mt=tt.bounds,2>ot?(b=mt.x+mt.width/2,z=mt.y+mt.height/2,at[0]=new At(mt.x+mt.width+E.width,mt.y),at[1]=new At(mt.x,mt.y+mt.height+E.height),ot=2):(rt=jS(at,ot,b,z,mt.width,mt.height,E),ct=at[rt],yt=new At(ct.x+mt.width+E.width,ct.y),mt=new At(ct.x,ct.y+mt.height+E.height),rt+1<ot&&at.splice(rt+1,0,null),at[rt]=yt,at[rt+1]=mt,ot++,tt.centerX=ct.x+tt.width/2,tt.centerY=ct.y+tt.height/2);for(_n(at),E=x.iterator;E.next();){for(x=E.value,b=x.vertexes.iterator;b.next();)y.dh(b.value);for(x=x.edges.iterator;x.next();)y.Bo(x.value)}}_S(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},Gr.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,y=0,x=this.network.vertexes.first().bounds,E=this.network.vertexes.iterator;E.next();){if(E.value.bounds.Yc(x)&&(a++,2<a))return!0;if(10<y)break;y++}return!1},Gr.prototype.computeBounds=function(a,y){var x=!0;for(a=a.vertexes.iterator;a.next();){var E=a.value;x?(x=!1,y.set(E.bounds)):y.ed(E.bounds)}return y};function RS(a,y,x){if(Dx(a,y)){var E=a.Zf;a.Zf*=1+1/(y+1);var b=Ox(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,RS(a,y+1,x),_S(a,z),Ix(a,b),y=b.vertexes.Fa(),y.sort(function(tt,ot){return tt===null||ot===null||tt===ot?0:ot.Vd-tt.Vd}),x=0;x<y.length;x++)Rx(a,y[x]);a.Zf=E}}function Dx(a,y){if(10<y||3>a.network.vertexes.count)return!1;for(a.ah=a.network.vertexes.Fa(),a=a.ah,a.sort(function(x,E){return x===null||E===null||x===E?0:E.Vd-x.Vd}),y=a.length-1;0<=y&&1>=a[y].Vd;)y--;return 1<a.length-y}function Ox(a,y){for(var x=a.network,E=new cf(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var tt=new GS;tt.Rs=z.Vd,tt.Ss=z.width,tt.Qs=z.height,tt.Sv=z.focus.x,tt.Tv=z.focus.y,z.We===null&&(z.We=new be),z.We.add(tt),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var ot=z.value;b=ot.fromVertex,tt=ot.toVertex,b.network===E&&tt.network===E?E.Bo(ot):b.network===E?(ot=b.Hj,ot===null&&(ot=new be,b.Hj=ot),ot.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(ot=tt.Hj,ot===null&&(ot=new be,tt.Hj=ot),ot.add(b),tt.Vd--,tt.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,Jt.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var rt=b.Hj;if(rt!==null&&0<rt.count&&(tt=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=tt))){for(var at=ot=0,ut=rt.count-tt;ut<rt.count;ut++){var ct=rt.M(ut),mt=null;for(z=ct.edges.iterator;z.next();){var yt=z.value;if(yt.Ax(ct)===b){mt=yt;break}}mt!==null&&(at+=mt.length,ot+=ct.width*ct.height)}z=b.centerX,rt=b.centerY,ut=b.width,ct=b.height,mt=b.focus,yt=ut*ct,1>yt&&(yt=1),ot=Jt.sqrt((ot+yt+at*at*4/(tt*tt))/yt),tt=(ot-1)*ut/2,ot=(ot-1)*ct/2,b.bounds=new pe(z-mt.x-tt,rt-mt.y-ot,ut+2*tt,ct+2*ot),b.focus=new At(mt.x+tt,mt.y+ot)}}return a.network=E,x}function Ix(a,y){for(var x=a.network.vertexes.iterator;x.next();){var E=x.value;if(E.network=y,E.We!==null){var b=E.We.M(E.sv);E.Vd=b.Rs;var z=b.Sv,tt=b.Tv;E.bounds=new pe(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new At(z,tt),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function Rx(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var E=y.centerX,b=y.centerY,z=y.width,tt=y.height;y.We!==null&&0<y.We.count&&(tt=y.We.M(0),z=tt.Ss,tt=tt.Qs),z=Jt.sqrt(z*z+tt*tt)/2;for(var ot=!1,rt=tt=0,at=0,ut=y.vertexes.iterator;ut.next();){var ct=ut.value;1>=ct.Vd?rt++:(ot=!0,at++,tt+=Math.atan2(y.centerY-ct.centerY,y.centerX-ct.centerX))}if(rt!==0){for(0<at&&(tt/=at),at=y=0,y=ot?2*Math.PI/(rt+1):2*Math.PI/rt,rt%2===0&&(at=y/2),1<x.count&&x.sort(function(yt,St){return yt===null||St===null||yt===St?0:St.width*St.height-yt.width*yt.height}),ot=rt%2===0?0:1,x=x.iterator;x.next();)if(rt=x.value,!(1<rt.Vd||a.isFixed(rt))){for(ut=null,ct=rt.edges.iterator;ct.next();){ut=ct.value;break}ct=rt.width;var mt=rt.height;ct=Jt.sqrt(ct*ct+mt*mt)/2,ut=z+ut.length+ct,ct=tt+(y*(ot/2>>1)+at)*(ot%2===0?1:-1),rt.centerX=E+ut*Math.cos(ct),rt.centerY=b+ut*Math.sin(ct),ot++}}}}function jS(a,y,x,E,b,z,tt){var ot=9e19,rt=-1,at=0;t:for(;at<y;at++){var ut=a[at],ct=ut.x-x,mt=ut.y-E;if(ct=ct*ct+mt*mt,ct<ot){for(mt=at-1;0<=mt;mt--)if(a[mt].y>ut.y&&a[mt].x-ut.x<b+tt.width)continue t;for(mt=at+1;mt<y;mt++)if(a[mt].x>ut.x&&a[mt].y-ut.y<z+tt.height)continue t;rt=at,ot=ct}}return rt}Gr.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Gr.prototype.addComments=function(a){var y=a.node;if(y!==null)for(y=y.Mu();y.next();){var x=y.value;if(x.category==="Comment"&&x.isVisible()){var E=this.network.ki(x);E===null&&(E=this.network.Bl(x)),E.charge=this.defaultCommentElectricalCharge,x=null;for(var b=E.destinationEdges;b.next();){var z=b.value;if(z.toVertex===a){x=z;break}}if(x===null){for(b=E.sourceEdges;b.next();)if(z=b.value,z.fromVertex===a){x=z;break}}x===null&&(x=this.network.Zj(a,E,null)),x.length=this.defaultCommentSpringLength}}};function zS(a,y){var x=a.bounds,E=x.x;a=x.y;var b=x.width;x=x.height;var z=y.bounds,tt=z.x;y=z.y;var ot=z.width;return z=z.height,E+b<tt?a>y+z?(x=E+b-tt,a=a-y-z,Jt.sqrt(x*x+a*a)):a+x<y?(E=E+b-tt,a=a+x-y,Jt.sqrt(E*E+a*a)):tt-(E+b):E>tt+ot?a>y+z?(x=E-tt-ot,a=a-y-z,Jt.sqrt(x*x+a*a)):a+x<y?(E=E-tt-ot,a=a+x-y,Jt.sqrt(E*E+a*a)):E-(tt+ot):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function _S(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,jx(a)););a.ah=null}function jx(a){a.ah===null&&(a.ah=a.network.vertexes.Fa());var y=a.ah;if(0>=y.length)return!1;var x=y[0];x.forceX=0,x.forceY=0;for(var E=x.centerX,b=E,z=x=x.centerY,tt=1;tt<y.length;tt++){var ot=y[tt];ot.forceX=0,ot.forceY=0;var rt=ot.centerX;ot=ot.centerY,E=Math.min(E,rt),b=Math.max(b,rt),x=Math.min(x,ot),z=Math.max(z,ot)}(b=b-E>z-x)?y.sort(function(Mt,Ot){return Mt===null||Ot===null||Mt===Ot?0:Mt.centerX-Ot.centerX}):y.sort(function(Mt,Ot){return Mt===null||Ot===null||Mt===Ot?0:Mt.centerY-Ot.centerY}),x=a.Zf;var at=E=ot=0;for(z=0;z<y.length;z++){tt=y[z],E=tt.bounds,ot=tt.focus,rt=E.x+ot.x;var ut=E.y+ot.y;E=tt.charge*a.electricalFieldX(rt,ut),at=tt.charge*a.electricalFieldY(rt,ut),E+=tt.mass*a.gravitationalFieldX(rt,ut),at+=tt.mass*a.gravitationalFieldY(rt,ut),tt.forceX+=E,tt.forceY+=at;for(var ct=z+1;ct<y.length;ct++){var mt=y[ct];if(mt!==tt){E=mt.bounds,ot=mt.focus,at=E.x+ot.x;var yt=E.y+ot.y;if(rt-at>x||at-rt>x){if(b)break}else if(ut-yt>x||yt-ut>x){if(!b)break}else{var St=zS(tt,mt);1>St?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new S0),St=E.random(),ot=E.random(),rt>at?(E=Math.abs(mt.bounds.right-tt.bounds.x),E=(1+E)*St):rt<at?(E=Math.abs(mt.bounds.x-tt.bounds.right),E=-(1+E)*St):(E=Math.max(mt.width,tt.width),E=(1+E)*St-E/2),ut>yt?(at=Math.abs(mt.bounds.bottom-tt.bounds.y),at=(1+at)*ot):rt<at?(at=Math.abs(mt.bounds.y-tt.bounds.bottom),at=-(1+at)*ot):(at=Math.max(mt.height,tt.height),at=(1+at)*ot-at/2)):(ot=-(tt.charge*mt.charge)/(St*St),E=(at-rt)/St*ot,at=(yt-ut)/St*ot),tt.forceX+=E,tt.forceY+=at,mt.forceX-=E,mt.forceY-=at}}}}for(b=a.network.edges.iterator;b.next();)ot=b.value,x=ot.fromVertex,z=ot.toVertex,tt=x.bounds,rt=x.focus,E=tt.x+rt.x,tt=tt.y+rt.y,ut=z.bounds,ct=z.focus,rt=ut.x+ct.x,ut=ut.y+ct.y,ct=zS(x,z),1>ct?(ct=a.randomNumberGenerator,ct===null&&(a.randomNumberGenerator=ct=new S0),ot=ct.random(),ct=ct.random(),E=(E>rt?1:-1)*(1+(z.width>x.width?z.width:x.width))*ot,at=(tt>ut?1:-1)*(1+(z.height>x.height?z.height:x.height))*ct):(ot=ot.stiffness*(ct-ot.length),E=(rt-E)/ct*ot,at=(ut-tt)/ct*ot),x.forceX+=E,x.forceY+=at,z.forceX-=E,z.forceY-=at;for(b=E=0;b<y.length;b++)x=y[b],a.isFixed(x)?a.moveFixedVertex(x):E=Math.max(E,a.moveVertex(x)||0);return E>a.epsilonDistance*a.epsilonDistance}Gr.prototype.moveVertex=function(a){var y=a.forceX,x=a.forceY,E=this.moveLimit;return y<-E?y=-E:y>E&&(y=E),x<-E?x=-E:x>E&&(x=E),a.centerX+=y,a.centerY+=x,y*y+x*x},Gr.prototype.moveFixedVertex=function(){},Gr.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},Gr.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=Ir,y.toSpot=Ir)}},Gr.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=pe.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,pe.free(x)}x=pe.alloc();for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;(a!==0||y!==0)&&(x.assign(b.bounds),x.x+=a,x.y+=y,b.bounds=x),b.commit()}pe.free(x)},Gr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Gr.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},Gr.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},Gr.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},Gr.prototype.electricalFieldX=function(){return 0},Gr.prototype.electricalFieldY=function(){return 0},Gr.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},Gr.prototype.gravitationalFieldX=function(){return 0},Gr.prototype.gravitationalFieldY=function(){return 0},Gr.prototype.isFixed=function(a){return a.isFixed},Ie.Object.defineProperties(Gr.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(a){this.Bm!==a&&(this.Bm=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},maxIterations:{get:function(){return this.dl},set:function(a){this.dl!==a&&0<=a&&(this.dl=a,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(a){this.$m!==a&&0<a&&(this.$m=a,this.C())}},infinityDistance:{get:function(){return this.Zf},set:function(a){this.Zf!==a&&1<a&&(this.Zf=a,this.C())}},moveLimit:{get:function(){return this.In},set:function(a){this.In!==a&&1<a&&(this.In=a,this.C())}},randomNumberGenerator:{get:function(){return this.fo},set:function(a){this.fo!==a&&(a!==null&&typeof a.random!="function"&&de('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.fo=a)}},defaultSpringStiffness:{get:function(){return this.Hk},set:function(a){this.Hk!==a&&(this.Hk=a,this.C())}},defaultSpringLength:{get:function(){return this.Gk},set:function(a){this.Gk!==a&&(this.Gk=a,this.C())}},defaultElectricalCharge:{get:function(){return this.Ek},set:function(a){this.Ek!==a&&(this.Ek=a,this.C())}},defaultGravitationalMass:{get:function(){return this.Fk},set:function(a){this.Fk!==a&&(this.Fk=a,this.C())}},defaultCommentSpringLength:{get:function(){return this.Vm},set:function(a){this.Vm!==a&&(this.Vm=a,this.C())}},defaultCommentElectricalCharge:{get:function(){return this.Um},set:function(a){this.Um!==a&&(this.Um=a,this.C())}}}),Gr.className="ForceDirectedLayout";function GS(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}GS.className="ForceDirectedSubnet";function cf(a){oo.call(this,a)}ee(cf,oo),cf.prototype.createVertex=function(){return new cp(this)},cf.prototype.createEdge=function(){return new gp(this)},cf.className="ForceDirectedNetwork";function cp(a){ur.call(this,a),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}ee(cp,ur),Ie.Object.defineProperties(cp.prototype,{isFixed:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},charge:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},mass:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},forceX:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},forceY:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}}}),cp.className="ForceDirectedVertex";function gp(a){ta.call(this,a),this.j=this.o=NaN}ee(gp,ta),Ie.Object.defineProperties(gp.prototype,{stiffness:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},length:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}}}),gp.className="ForceDirectedEdge";function S0(){var a=0;a===void 0&&(a=42),this.seed=a,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}S0.prototype.random=function(){var a=this.seed%this.Q*this.ay-this.seed/this.Q*this.gy;return 0<a?this.seed=a:this.seed=a+this.ey,this.seed*this.by},S0.className="RandomNumberGenerator";function Zi(a){xo.call(this),this.kc=this.ie=25,this.K=0,this.Dk=L0,this.Zk=k0,this.Qk=M0,this.bj=4,this.rk=E0,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new At,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}ee(Zi,xo),Zi.prototype.cloneProtected=function(a){xo.prototype.cloneProtected.call(this,a),a.ie=this.ie,a.kc=this.kc,a.K=this.K,a.Dk=this.Dk,a.Zk=this.Zk,a.Qk=this.Qk,a.bj=this.bj,a.rk=this.rk,a.bg=this.bg,a.sf=this.sf,a.Cn=this.Cn,a.ve=this.ve},Zi.prototype.qb=function(a){a.classType===Zi?a.name.indexOf("Aggressive")===0?this.aggressiveOption=a:a.name.indexOf("Cycle")===0?this.cycleRemoveOption=a:a.name.indexOf("Init")===0?this.initializeOption=a:a.name.indexOf("Layer")===0?this.layeringOption=a:de("Unknown enum value: "+a):xo.prototype.qb.call(this,a)},Zi.prototype.createNetwork=function(){return new Ac(this)},Zi.prototype.doLayout=function(a){for(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Iq=-1,this.Md=this.Hn=0,this.fl=this.Jn=this.kj=null,a=0;a<this.He.length;a++)this.He[a]=null;if(0<this.network.vertexes.count){for(this.network.Ko(),this.cycleRemoveOption!==mp&&this.removeCycles(),a=this.network.vertexes.iterator;a.next();)a.value.layer=-1;for(this.Ia=-1,this.assignLayers(),a.reset();a.next();)this.Ia=Math.max(this.Ia,a.value.layer);this.cycleRemoveOption===mp&&this.removeCycles(),a=this.network;for(var y=[],x=a.edges.iterator;x.next();){var E=x.value;E.valid=!1,y.push(E)}for(x=0;x<y.length;x++){E=y[x];var b=E.fromVertex,z=E.toVertex;if(!(E.valid||(b.node===null&&b.data===null||z.node===null&&z.data===null)&&b.layer===z.layer)){var tt=0,ot=0,rt=0,at=0;if(E.link!==null){if(ot=E.link,ot===null)continue;var ut=b.node;if(tt=z.node,ut===null||tt===null)continue;var ct=ot.fromNode;rt=ot.toNode;for(var mt=ot.fromPort;mt!==null&&!mt.Ed();)mt=mt.panel;for(ot=ot.toPort;ot!==null&&!ot.Ed();)ot=ot.panel;if(E.rev){at=ct;var yt=mt;ct=rt,mt=ot,rt=at,ot=yt}var St=b.focus;at=z.focus;var Mt=E.rev?z.bounds:b.bounds;yt=At.alloc(),ut!==ct?Mt.w()&&ct.isVisible()?ct.actualBounds.w()?(Gu(ct,mt,Mi,yt),yt.x+=ct.actualBounds.x-Mt.x,yt.y+=ct.actualBounds.y-Mt.y):(Gu(ct,mt,Mi,yt),yt.w()||yt.assign(St)):yt.assign(St):Mt.w()?(Gu(ct,mt,Mi,yt),yt.w()||yt.assign(St)):yt.assign(St),ct=E.rev?b.bounds:z.bounds,ut=At.alloc(),tt!==rt?ct.w()&&rt.isVisible()?rt.actualBounds.w()?(Gu(rt,ot,Mi,ut),ut.x+=rt.actualBounds.x-ct.x,ut.y+=rt.actualBounds.y-ct.y):(Gu(rt,ot,Mi,ut),ut.w()||ut.assign(at)):ut.assign(at):ct.w()?(Gu(rt,ot,Mi,ut),ut.w()||ut.assign(at)):ut.assign(at),this.K===90||this.K===270?(tt=Math.round((yt.x-St.x)/this.kc),rt=yt.x,ot=Math.round((ut.x-at.x)/this.kc),at=ut.x):(tt=Math.round((yt.y-St.y)/this.kc),rt=yt.y,ot=Math.round((ut.y-at.y)/this.kc),at=ut.y),At.free(yt),At.free(ut),E.portFromColOffset=tt,E.portFromPos=rt,E.portToColOffset=ot,E.portToPos=at}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(yt=b.layer,ut=z.layer,ct=0,Mt=E.link,Mt!==null){var Ot=Mt.fromPort,bt=Mt.toPort;if(Ot!==null&&bt!==null){var jt=Mt.fromNode;if(mt=Mt.toNode,jt!==null&&mt!==null){var Gt=C0(this,!0),Wt=C0(this,!1),Kt=this.setsPortSpots?Gt:Mt.computeSpot(!0,Ot);St=this.setsPortSpots?Wt:Mt.computeSpot(!1,bt);var $t=Mt.isOrthogonal;Kt.$c()&&Kt.Hf(Wt)&&St.$c()&&St.Hf(Gt)?ct=0:(Gt=Mt.getLinkPoint(jt,Ot,Kt,!0,$t,mt,bt,At.alloc()),Wt=Mt.getLinkDirection(jt,Ot,Gt,Kt,!0,$t,mt,bt),At.free(Gt),Kt.ys()||Wt!==JS(this,E,!0)?this.setsPortSpots&&jt!==null&&jt.ports.count===1&&E.rev&&(ct+=1):ct+=1,Kt=Mt.getLinkPoint(mt,bt,St,!1,$t,jt,Ot,At.alloc()),Mt=Mt.getLinkDirection(mt,bt,Kt,St,!1,$t,jt,Ot),At.free(Kt),St.ys()||Mt!==JS(this,E,!1)?this.setsPortSpots&&mt!==null&&mt.ports.count===1&&E.rev&&(ct+=2):ct+=2)}}}if(mt=ct,ct=mt===1||mt===3,(mt=mt===2||mt===3)&&(St=a.createVertex(),St.node=null,St.Dj=1,St.layer=yt,St.near=b,a.dh(St),b=a.Zj(b,St,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=tt,b.portToColOffset=0,b.portFromPos=rt,b.portToPos=0,b=St),Mt=1,ct&&Mt--,yt-ut>Mt&&0<yt){for(E.valid=!1,St=a.createVertex(),St.node=null,St.Dj=2,St.layer=yt-1,a.dh(St),b=a.Zj(b,St,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=mt?0:tt,b.portToColOffset=0,b.portFromPos=mt?0:rt,b.portToPos=0,b=St,yt--;yt-ut>Mt&&0<yt;)St=a.createVertex(),St.node=null,St.Dj=3,St.layer=yt-1,a.dh(St),b=a.Zj(b,St,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=St,yt--;b=a.Zj(St,z,E.link),b.valid=!ct,ct&&(St.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=ot,b.portFromPos=0,b.portToPos=at}else E.valid=!0}}for(a=this.tc=[],y=0;y<=this.Ia;y++)a[y]=0;for(y=this.network.vertexes.iterator;y.next();)y.value.index=-1;for(this.initializeIndices(),this.Iq=-1,x=this.Md=this.Hn=0;x<=this.Ia;x++)a[x]>a[this.Md]&&(this.Iq=a[x]-1,this.Md=x),a[x]<a[this.Hn]&&(this.Hn=x);for(this.fl=[],x=0;x<a.length;x++)this.fl[x]=[];for(y.reset();y.next();)a=y.value,this.fl[a.layer][a.index]=a;for(this.Ra=-1,a=0;a<=this.Ia;a++){for(y=Dh(this,a),x=0,E=this.tc[a],z=0;z<E;z++)b=y[z],x+=this.nodeMinColumnSpace(b,!0),b.column=x,x+=1,x+=this.nodeMinColumnSpace(b,!1);this.Ra=Math.max(this.Ra,x-1),Oh(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},Zi.prototype.linkMinLength=function(){return 1};function gy(a){var y=a.fromVertex.node||a.fromVertex.data;return a=a.toVertex.node||a.toVertex.data,y===null&&a===null?8:y===null||a===null?4:1}Zi.prototype.nodeMinLayerSpace=function(a,y){return a.node===null&&a.data===null?0:this.K===90||this.K===270?y?a.focus.y+10:a.bounds.height-a.focus.y+10:y?a.focus.x+10:a.bounds.width-a.focus.x+10},Zi.prototype.nodeMinColumnSpace=function(a,y){if(a.node===null&&a.data===null)return 0;var x=y?a.ev:a.dv;return x!==null?x:(x=this.K,x===90||x===270?y?a.ev=a.focus.x/this.kc+1|0:a.dv=(a.bounds.width-a.focus.x)/this.kc+1|0:y?a.ev=a.focus.y/this.kc+1|0:a.dv=(a.bounds.height-a.focus.y)/this.kc+1|0)};function bs(a){a.kj===null&&(a.kj=[]);for(var y=0,x=a.network.vertexes.iterator;x.next();){var E=x.value;a.kj[y]=E.layer,y++,a.kj[y]=E.column,y++,a.kj[y]=E.index,y++}return a.kj}function Fa(a,y){var x=0;for(a=a.network.vertexes.iterator;a.next();){var E=a.value;E.layer=y[x],x++,E.column=y[x],x++,E.index=y[x],x++}}function HS(a,y,x){var E=Dh(a,y),b=a.tc[y];(a.Jn===null||a.Jn.length<b*b)&&(a.Jn=[]);for(var z=a.Jn,tt=0;tt<b;tt++){var ot=0,rt=E[tt],at=rt.near;if(at!==null&&at.layer===rt.layer)if(rt=at.index,rt>tt)for(var ut=tt+1;ut<rt;ut++){var ct=E[ut];ct.near===at&&ct.Dj===at.Dj||ot++}else for(ut=tt-1;ut>rt;ut--)ct=E[ut],ct.near===at&&ct.Dj===at.Dj||ot++;var mt;if(0<=x)for(rt=E[tt].sourceEdgesArrayAccess,at=0;at<rt.length;at++){var yt=rt[at];if(yt.valid&&yt.fromVertex.layer!==y)for(ct=yt.fromVertex.index,ut=yt.portToPos,yt=yt.portFromPos,mt=at+1;mt<rt.length;mt++){var St=rt[mt];if(St.valid&&St.fromVertex.layer!==y){var Mt=St.fromVertex.index,Ot=St.portToPos;St=St.portFromPos,ut<Ot&&(ct>Mt||ct===Mt&&yt>St)&&ot++,Ot<ut&&(Mt>ct||Mt===ct&&St>yt)&&ot++}}}if(0>=x){for(rt=E[tt].destinationEdgesArrayAccess,at=0;at<rt.length;at++)if(yt=rt[at],yt.valid&&yt.toVertex.layer!==y)for(ct=yt.toVertex.index,ut=yt.portToPos,yt=yt.portFromPos,mt=at+1;mt<rt.length;mt++)St=rt[mt],St.valid&&St.toVertex.layer!==y&&(Mt=St.toVertex.index,Ot=St.portToPos,St=St.portFromPos,yt<St&&(ct>Mt||ct===Mt&&ut>Ot)&&ot++,St<yt&&(Mt>ct||Mt===ct&&Ot>ut)&&ot++)}for(z[tt*b+tt]=ot,rt=tt+1;rt<b;rt++){var bt=0,jt=0;if(0<=x){ot=E[tt].sourceEdgesArrayAccess;var Gt=E[rt].sourceEdgesArrayAccess;for(at=0;at<ot.length;at++)if(yt=ot[at],yt.valid&&yt.fromVertex.layer!==y)for(ct=yt.fromVertex.index,yt=yt.portFromPos,mt=0;mt<Gt.length;mt++)St=Gt[mt],St.valid&&St.fromVertex.layer!==y&&(Mt=St.fromVertex.index,St=St.portFromPos,(ct<Mt||ct===Mt&&yt<St)&&jt++,(Mt<ct||Mt===ct&&St<yt)&&bt++)}if(0>=x){for(ot=E[tt].destinationEdgesArrayAccess,Gt=E[rt].destinationEdgesArrayAccess,at=0;at<ot.length;at++)if(yt=ot[at],yt.valid&&yt.toVertex.layer!==y)for(ct=yt.toVertex.index,ut=yt.portToPos,mt=0;mt<Gt.length;mt++)St=Gt[mt],St.valid&&St.toVertex.layer!==y&&(Mt=St.toVertex.index,Ot=St.portToPos,(ct<Mt||ct===Mt&&ut<Ot)&&jt++,(Mt<ct||Mt===ct&&Ot<ut)&&bt++)}z[tt*b+rt]=bt,z[rt*b+tt]=jt}}return Oh(a,y,E),z}Zi.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=HS(this,y,1),E=this.tc[y],b=0;b<E;b++)for(var z=b;z<E;z++)a+=x[b*E+z];return a};function x0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=Dh(E,b),tt=E.tc[b],ot=0,rt=0;rt<tt;rt++){var at=z[rt].destinationEdgesArrayAccess;if(at!==null)for(var ut=0;ut<at.length;ut++){var ct=at[ut];if(ct.valid&&ct.toVertex.layer!==b){var mt=ct.fromVertex.column+ct.portFromColOffset,yt=ct.toVertex.column+ct.portToColOffset;ot+=(Math.abs(mt-yt)+1)*gy(ct)}}}Oh(E,b,z),y+=ot}return y}Zi.prototype.normalize=function(){var a=1/0;this.Ra=-1;for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;a=Math.min(a,x.column-this.nodeMinColumnSpace(x,!0)),this.Ra=Math.max(this.Ra,x.column+this.nodeMinColumnSpace(x,!1))}for(y.reset();y.next();)y.value.column-=a;this.Ra-=a};function py(a,y,x){for(var E=Dh(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var ot=E[tt],rt=null;0>=x&&(rt=ot.sourceEdgesArrayAccess);var at=null;0<=x&&(at=ot.destinationEdgesArrayAccess);var ut=0,ct=0,mt=ot.near;if(mt!==null&&mt.layer===ot.layer&&(ut+=mt.column-1,ct++),rt!==null)for(mt=0;mt<rt.length;mt++){ot=rt[mt];var yt=ot.fromVertex;ot.valid&&!ot.rev&&yt.layer!==y&&(ut+=yt.column,ct++)}if(at!==null)for(rt=0;rt<at.length;rt++)ot=at[rt],mt=ot.toVertex,ot.valid&&!ot.rev&&mt.layer!==y&&(ut+=mt.column,ct++);z[tt]=ct===0?-1:ut/ct}return Oh(a,y,E),z}function WS(a,y,x){for(var E=Dh(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var ot=E[tt],rt=null;0>=x&&(rt=ot.sourceEdgesArrayAccess);var at=null;0<=x&&(at=ot.destinationEdgesArrayAccess);var ut=0,ct=[],mt=ot.near;if(mt!==null&&mt.layer===ot.layer&&(ct[ut]=mt.column-1,ut++),ot=void 0,rt!==null)for(mt=0;mt<rt.length;mt++){ot=rt[mt];var yt=ot.fromVertex;ot.valid&&!ot.rev&&yt.layer!==y&&(ct[ut]=yt.column+ot.portFromColOffset,ut++)}if(at!==null)for(rt=0;rt<at.length;rt++)ot=at[rt],mt=ot.toVertex,ot.valid&&!ot.rev&&mt.layer!==y&&(ct[ut]=mt.column+ot.portToColOffset,ut++);ut===0?z[tt]=-1:(ct.sort(function(St,Mt){return St-Mt}),at=ut>>1,z[tt]=ut&1?ct[at]:ct[at-1]+ct[at]>>1)}return Oh(a,y,E),z}function pp(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();){var ot=tt.value,rt=ot.toVertex,at=y.layer-rt.layer;ot=a.linkMinLength(ot),at===ot&&pp(a,rt,x,E,b,z)}if(z)for(tt=y.sourceEdges;tt.next();)ot=tt.value,rt=ot.fromVertex,at=rt.layer-y.layer,ot=a.linkMinLength(ot),at===ot&&pp(a,rt,x,E,b,z)}}function my(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();)my(a,tt.value.toVertex,x,E,b,z);if(z)for(y=y.sourceEdges;y.next();)my(a,y.value.fromVertex,x,E,b,z)}}Zi.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case Sy:a=this.network;var y=0,x=a.vertexes.count-1,E=[];E.length=x+1;for(var b=a.vertexes.iterator;b.next();)b.value.valid=!0;for(;zx(a)!==null;){for(b=US(a);b!==null;)E[x]=b,x--,b.valid=!1,b=US(a);for(b=VS(a);b!==null;)E[y]=b,y++,b.valid=!1,b=VS(a);b=null;for(var z=0,tt=this.network.vertexes.iterator;tt.next();){var ot=tt.value;if(ot.valid){for(var rt=0,at=ot.destinationEdges;at.next();)at.value.toVertex.valid&&rt++;at=0;for(var ut=ot.sourceEdges;ut.next();)ut.value.fromVertex.valid&&at++;(b===null||z<rt-at)&&(b=ot,z=rt-at)}}b!==null&&(E[y]=b,y++,b.valid=!1)}for(y=0;y<a.vertexes.count;y++)E[y].index=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.index>y.toVertex.index&&(a.gm(y),y.rev=!0);break;case L0:for(E=this.network.vertexes.iterator;E.next();)a=E.value,a.Ll=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;for(this.Kn=0,E.reset();E.next();)y=E.value,y.sourceEdges.count===0&&vy(this,y);for(E.reset();E.next();)y=E.value,y.Ll===-1&&vy(this,y);for(a.reset();a.next();)E=a.value,E.forest||(y=E.fromVertex,x=y.finish,b=E.toVertex,z=b.finish,b.Ll<y.Ll&&x<z&&(this.network.gm(E),E.rev=!0));break;case mp:for(a=this.network,y=a.vertexes.iterator,E=1/0;y.next();)E=Math.min(E,y.value.layer);if(1/0>E){if(0>E)for(y.reset();y.next();)y.value.layer-=E;for(E=[],y.reset();y.next();)x=y.value,b=E[x.layer],b===void 0?E[x.layer]=[x]:b.push(x);for(x=y=0;x<E.length;x++)if(b=E[x],!b||b.length===0)y++;else if(0<x)for(z=0;z<b.length;z++)b[z].layer-=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.layer<y.toVertex.layer&&(a.gm(y),y.rev=!0)}}};function zx(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function US(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.destinationEdges;E.next();)if(E.value.toVertex.valid){x=!1;break}if(x)return y}}return null}function VS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.sourceEdges;E.next();)if(E.value.fromVertex.valid){x=!1;break}if(x)return y}}return null}function vy(a,y){y.Ll=a.Kn,a.Kn++;for(var x=y.destinationEdges;x.next();){var E=x.value,b=E.toVertex;b.Ll===-1&&(E.forest=!0,vy(a,b))}y.finish=a.Kn,a.Kn++}Zi.prototype.assignLayers=function(){switch(this.Zk){case xy:YS(this);break;case Py:for(var a,y=this.network.vertexes.iterator;y.next();)a=XS(this,y.value),this.Ia=Math.max(a,this.Ia);for(y.reset();y.next();)a=y.value,a.layer=this.Ia-a.layer;break;default:case k0:for(YS(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&ZS(this,a);for(a=1/0,y.reset();y.next();)a=Math.min(a,y.value.layer);for(this.Ia=-1,y.reset();y.next();){var x=y.value;x.layer-=a,this.Ia=Math.max(this.Ia,x.layer)}}};function YS(a){for(var y=a.network.vertexes.iterator;y.next();){var x=KS(a,y.value);a.Ia=Math.max(x,a.Ia)}}function KS(a,y){var x=0;if(y.layer===-1){for(var E=y.destinationEdges;E.next();){var b=E.value,z=b.toVertex;b=a.linkMinLength(b),x=Math.max(x,KS(a,z)+b)}y.layer=x}else x=y.layer;return x}function XS(a,y){var x=0;if(y.layer===-1){for(var E=y.sourceEdges;E.next();){var b=E.value,z=b.fromVertex;b=a.linkMinLength(b),x=Math.max(x,XS(a,z)+b)}y.layer=x}else x=y.layer;return x}function ZS(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)ZS(a,x.value.toVertex);for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(var E=y.sourceEdgesArrayAccess,b=E.length,z=0;z<b;z++){var tt=E[z],ot=tt.fromVertex,rt=tt.toVertex;tt=a.linkMinLength(tt),ot.layer-rt.layer>tt&&pp(a,ot,0,-1,!0,!1)}for(pp(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,ot=0,rt=null,tt=a.network.vertexes.iterator;tt.next();){var at=tt.value;if(at.component===1){var ut=0,ct=!1,mt=at.sourceEdgesArrayAccess;b=mt.length;for(var yt=0;yt<b;yt++){var St=mt[yt],Mt=St.fromVertex;ut+=1,Mt.component!==1&&(z+=1,Mt=Mt.layer-at.layer,St=a.linkMinLength(St),E=Math.min(E,Mt-St))}for(mt=at.destinationEdgesArrayAccess,b=mt.length,yt=0;yt<b;yt++)St=mt[yt].toVertex,--ut,St.component!==1?--z:ct=!0;(rt===null||ut<ot)&&!ct&&(rt=at,ot=ut)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else rt.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(pp(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,ot=null,rt=a.network.vertexes.iterator;rt.next();)if(tt=rt.value,tt.component===1){for(at=0,ut=!1,mt=tt.sourceEdgesArrayAccess,ct=mt.length,yt=0;yt<ct;yt++)St=mt[yt].fromVertex,at+=1,St.component!==1?E+=1:ut=!0;for(mt=tt.destinationEdgesArrayAccess,ct=mt.length,yt=0;yt<ct;yt++)St=mt[yt],Mt=St.toVertex,--at,Mt.component!==1&&(--E,Mt=tt.layer-Mt.layer,St=a.linkMinLength(St),b=Math.min(b,Mt-St));(ot===null||at>z)&&!ut&&(ot=tt,z=at)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);y.component=0}else ot.component=0}}}function JS(a,y,x){return a.K===90?x&&!y.rev||!x&&y.rev?270:90:a.K===180?x&&!y.rev||!x&&y.rev?0:180:a.K===270?x&&!y.rev||!x&&y.rev?90:270:x&&!y.rev||!x&&y.rev?180:0}Zi.prototype.initializeIndices=function(){switch(this.Qk){default:case Cy:for(var a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;y.index=this.tc[x],this.tc[x]++}break;case M0:for(a=this.network.vertexes.iterator,y=this.Ia;0<=y;y--)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&QS(this,x);break;case wy:for(a=this.network.vertexes.iterator,y=0;y<=this.Ia;y++)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&qS(this,x)}};function QS(a,y){var x=y.layer;for(y.index=a.tc[x],a.tc[x]++,y=y.destinationEdgesArrayAccess,x=!0;x;){x=!1;for(var E=0;E<y.length-1;E++){var b=y[E],z=y[E+1];b.portFromColOffset>z.portFromColOffset&&(x=!0,y[E]=z,y[E+1]=b)}}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.toVertex,E.index===-1&&QS(a,E))}function qS(a,y){var x=y.layer;y.index=a.tc[x],a.tc[x]++,y=y.sourceEdgesArrayAccess;for(var E=!0;E;)for(E=!1,x=0;x<y.length-1;x++){var b=y[x],z=y[x+1];b.portToColOffset>z.portToColOffset&&(E=!0,y[x]=z,y[x+1]=b)}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.fromVertex,E.index===-1&&qS(a,E))}Zi.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=bs(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)P0(this,E,1),_a(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=bs(this)),E=this.Ia;0<=E;E--)P0(this,E,-1),_a(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=bs(this))}for(Fa(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)P0(this,E,0),_a(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=bs(this)),E=this.Ia;0<=E;E--)P0(this,E,0),_a(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=bs(this))}Fa(this,y);var z,tt,ot;switch(this.rk){case Ly:break;case ky:for(ot=a+1;(E=this.countCrossings())<ot;)for(ot=E,x=this.Ia;0<=x;x--)for(tt=0;tt<=x;tt++){for(z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=_a(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=_a(this,E,1)||z;for(b=this.countCrossings(),b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=_a(this,E,1)||z;for(b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=_a(this,E,-1)||z;for(b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=_a(this,E,0)||z;for(b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=_a(this,E,0)||z;b>=a?Fa(this,y):(a=b,y=bs(this))}break;default:case E0:for(x=this.Ia,tt=0,ot=a+1;(E=this.countCrossings())<ot;){for(ot=E,z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=_a(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=_a(this,E,1)||z;for(b=this.countCrossings(),b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=_a(this,E,1)||z;for(b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=_a(this,E,-1)||z;for(b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=_a(this,E,0)||z;for(b>=a?Fa(this,y):(a=b,y=bs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=_a(this,E,0)||z;b>=a?Fa(this,y):(a=b,y=bs(this))}}Fa(this,y)};function P0(a,y,x){var E=Dh(a,y),b=a.tc[y],z=WS(a,y,x),tt=py(a,y,x);for(x=0;x<b;x++)tt[x]===-1&&(tt[x]=E[x].column),z[x]===-1&&(z[x]=E[x].column);for(var ot=!0,rt;ot;)for(ot=!1,x=0;x<b-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&tt[x+1]<tt[x])&&(ot=!0,rt=z[x],z[x]=z[x+1],z[x+1]=rt,rt=tt[x],tt[x]=tt[x+1],tt[x+1]=rt,rt=E[x],E[x]=E[x+1],E[x+1]=rt);for(x=z=0;x<b;x++)rt=E[x],rt.index=x,z+=a.nodeMinColumnSpace(rt,!0),rt.column=z,z+=1,z+=a.nodeMinColumnSpace(rt,!1);Oh(a,y,E)}function _a(a,y,x){var E=Dh(a,y),b=a.tc[y];x=HS(a,y,x);var z,tt=[];for(z=0;z<b;z++)tt[z]=-1;var ot=[];for(z=0;z<b;z++)ot[z]=-1;for(var rt=!1,at=!0;at;)for(at=!1,z=0;z<b-1;z++){var ut=x[E[z].index*b+E[z+1].index],ct=x[E[z+1].index*b+E[z].index],mt=0,yt=0,St=E[z].column,Mt=E[z+1].column,Ot=a.nodeMinColumnSpace(E[z],!0),bt=a.nodeMinColumnSpace(E[z],!1),jt=a.nodeMinColumnSpace(E[z+1],!0),Gt=a.nodeMinColumnSpace(E[z+1],!1);Ot=St-Ot+jt,bt=Mt-bt+Gt;var Wt=E[z].sourceEdges.iterator;for(Wt.reset();Wt.next();)if(jt=Wt.value,Gt=jt.fromVertex,jt.valid&&Gt.layer===y){for(jt=0;E[jt]!==Gt;)jt++;jt<z&&(mt+=2*(z-jt),yt+=2*(z+1-jt)),jt===z+1&&(mt+=1),jt>z+1&&(mt+=4*(jt-z),yt+=4*(jt-(z+1)))}for(Wt=E[z].destinationEdges.iterator,Wt.reset();Wt.next();)if(jt=Wt.value,Gt=jt.toVertex,jt.valid&&Gt.layer===y){for(jt=0;E[jt]!==Gt;)jt++;jt===z+1&&(yt+=1)}for(Wt=E[z+1].sourceEdges.iterator,Wt.reset();Wt.next();)if(jt=Wt.value,Gt=jt.fromVertex,jt.valid&&Gt.layer===y){for(jt=0;E[jt]!==Gt;)jt++;jt<z&&(mt+=2*(z+1-jt),yt+=2*(z-jt)),jt===z&&(yt+=1),jt>z+1&&(mt+=4*(jt-(z+1)),yt+=4*(jt-z))}for(Wt=E[z+1].destinationEdges.iterator,Wt.reset();Wt.next();)if(jt=Wt.value,Gt=jt.toVertex,jt.valid&&Gt.layer===y){for(jt=0;E[jt]!==Gt;)jt++;jt===z&&(mt+=1)}jt=Gt=0,Wt=tt[E[z].index];var Kt=ot[E[z].index],$t=tt[E[z+1].index],Qe=ot[E[z+1].index];Wt!==-1&&(Gt+=Math.abs(Wt-St),jt+=Math.abs(Wt-bt)),Kt!==-1&&(Gt+=Math.abs(Kt-St),jt+=Math.abs(Kt-bt)),$t!==-1&&(Gt+=Math.abs($t-Mt),jt+=Math.abs($t-Ot)),Qe!==-1&&(Gt+=Math.abs(Qe-Mt),jt+=Math.abs(Qe-Ot)),(yt<mt-.5||yt===mt&&ct<ut-.5||yt===mt&&ct===ut&&jt<Gt-.5)&&(at=rt=!0,E[z].column=bt,E[z+1].column=Ot,ut=E[z],E[z]=E[z+1],E[z+1]=ut)}for(z=0;z<b;z++)E[z].index=z;return Oh(a,y,E),rt}Zi.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&Kx)!==0;if(1e3<this.network.edges.count&&y&&(a=!1),a){var x=[];for(y=0;y<=this.Ia;y++)x[y]=0;for(var E,b=this.network.vertexes.iterator;b.next();){var z=b.value;y=z.layer,E=z.column,z=this.nodeMinColumnSpace(z,!1),x[y]=Math.max(x[y],E+z)}for(b.reset();b.next();)z=b.value,y=z.layer,E=z.column,z.column=(8*(this.Ra-x[y])>>1)+8*E;this.Ra*=8}if(this.bg&2)for(x=!0;x;){for(x=!1,y=this.Md+1;y<=this.Ia;y++)x=bc(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=bc(this,y,-1)||x;x=bc(this,this.Md,0)||x}if(this.bg&4){for(y=this.Md+1;y<=this.Ia;y++)yy(this,y,1);for(y=this.Md-1;0<=y;y--)yy(this,y,-1);yy(this,this.Md,0)}if(a&&($S(this,-1),$S(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=bc(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=bc(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=bc(this,y,0)||x}}else Wx(this)};function bc(a,y,x){for(var E=!1;_x(a,y,x);)E=!0;return E}function _x(a,y,x){var E,b=Dh(a,y),z=a.tc[y],tt=py(a,y,-1);if(0<x)for(E=0;E<z;E++)tt[E]=-1;var ot=py(a,y,1);if(0>x)for(E=0;E<z;E++)ot[E]=-1;for(var rt=!1,at=!0;at;)for(at=!1,E=0;E<z;E++){var ut=b[E].column,ct=a.nodeMinColumnSpace(b[E],!0),mt=a.nodeMinColumnSpace(b[E],!1),yt=0;0>E-1||ut-b[E-1].column-1>ct+a.nodeMinColumnSpace(b[E-1],!1)?yt=ut-1:yt=ut,ct=E+1>=z||b[E+1].column-ut-1>mt+a.nodeMinColumnSpace(b[E+1],!0)?ut+1:ut;var St=mt=0,Mt=0;if(0>=x)for(var Ot=b[E].sourceEdges.iterator;Ot.next();){var bt=Ot.value,jt=bt.fromVertex;if(bt.valid&&jt.layer!==y){var Gt=gy(bt),Wt=bt.portFromColOffset;bt=bt.portToColOffset,jt=jt.column,mt+=(Math.abs(ut+bt-(jt+Wt))+1)*Gt,St+=(Math.abs(yt+bt-(jt+Wt))+1)*Gt,Mt+=(Math.abs(ct+bt-(jt+Wt))+1)*Gt}}if(0<=x)for(Ot=b[E].destinationEdges.iterator;Ot.next();)bt=Ot.value,jt=bt.toVertex,bt.valid&&jt.layer!==y&&(Gt=gy(bt),Wt=bt.portFromColOffset,bt=bt.portToColOffset,jt=jt.column,mt+=(Math.abs(ut+Wt-(jt+bt))+1)*Gt,St+=(Math.abs(yt+Wt-(jt+bt))+1)*Gt,Mt+=(Math.abs(ct+Wt-(jt+bt))+1)*Gt);bt=Wt=Gt=0,Ot=tt[b[E].index],jt=ot[b[E].index],Ot!==-1&&(Gt+=Math.abs(Ot-ut),Wt+=Math.abs(Ot-yt),bt+=Math.abs(Ot-ct)),jt!==-1&&(Gt+=Math.abs(jt-ut),Wt+=Math.abs(jt-yt),bt+=Math.abs(jt-ct)),St<mt||St===mt&&Wt<Gt?(at=rt=!0,b[E].column=yt):(Mt<mt||Mt===mt&&bt<Gt)&&(at=rt=!0,b[E].column=ct)}return Oh(a,y,b),a.normalize(),rt}function yy(a,y,x){var E=Dh(a,y),b=a.tc[y],z=WS(a,y,x),tt=[];for(x=0;x<b;x++)tt[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<b;x++){var ot=E[x].column,rt=a.nodeMinColumnSpace(E[x],!0),at=a.nodeMinColumnSpace(E[x],!1),ut=0;if(tt[x]===-1)if(x===0&&x===b-1)ut=ot;else if(x===0){var ct=E[x+1].column;ct-ot===at+a.nodeMinColumnSpace(E[x+1],!0)?ut=ot-1:ut=ot}else x===b-1?(ct=E[x-1].column,ut=ot-ct===rt+a.nodeMinColumnSpace(E[x-1],!1)?ot+1:ot):(ct=E[x-1].column,rt=ct+a.nodeMinColumnSpace(E[x-1],!1)+rt+1,ct=E[x+1].column,at=ct-a.nodeMinColumnSpace(E[x+1],!0)-at-1,ut=(rt+at)/2|0);else x===0&&x===b-1?ut=tt[x]:x===0?(ct=E[x+1].column,at=ct-a.nodeMinColumnSpace(E[x+1],!0)-at-1,ut=Math.min(tt[x],at)):x===b-1?(ct=E[x-1].column,rt=ct+a.nodeMinColumnSpace(E[x-1],!1)+rt+1,ut=Math.max(tt[x],rt)):(ct=E[x-1].column,rt=ct+a.nodeMinColumnSpace(E[x-1],!1)+rt+1,ct=E[x+1].column,at=ct-a.nodeMinColumnSpace(E[x+1],!0)-at-1,rt<tt[x]&&tt[x]<at?ut=tt[x]:rt>=tt[x]?ut=rt:at<=tt[x]&&(ut=at));ut!==ot&&(z=!0,E[x].column=ut)}Oh(a,y,E),a.normalize()}function Gx(a,y){for(var x=!0,E=a.network.vertexes.iterator;E.next();){var b=E.value,z=a.nodeMinColumnSpace(b,!0),tt=a.nodeMinColumnSpace(b,!1);if(b.column-z<=y&&b.column+tt>=y){x=!1;break}}if(a=!1,x)for(E.reset();E.next();)x=E.value,x.column>y&&(--x.column,a=!0);return a}function Hx(a,y){var x=y+1,E,b=[],z=[];for(E=0;E<=a.Ia;E++)b[E]=!1,z[E]=!1;for(var tt=a.network.vertexes.iterator;tt.next();){E=tt.value;var ot=E.column-a.nodeMinColumnSpace(E,!0),rt=E.column+a.nodeMinColumnSpace(E,!1);ot<=y&&rt>=y&&(b[E.layer]=!0),ot<=x&&rt>=x&&(z[E.layer]=!0)}for(ot=!0,x=!1,E=0;E<=a.Ia;E++)ot=ot&&!(b[E]&&z[E]);if(ot)for(tt.reset();tt.next();)a=tt.value,a.column>y&&(--a.column,x=!0);return x}function $S(a,y){for(var x=0;x<=a.Ra;x++)for(;Gx(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;Hx(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=bs(a),z=x0(a);for(E=z+1;z<E;){E=z,tx(a,x,1);var tt=x0(a);tt>z?Fa(a,b):tt<z&&(z=tt,b=bs(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=bs(a),z=x0(a),E=z+1;z<E;)E=z,tx(a,x,-1),tt=x0(a),tt>z?Fa(a,b):tt<z&&(z=tt,b=bs(a));a.normalize()}function tx(a,y,x){a.le=0;for(var E=a.network.vertexes.iterator;E.next();)E.value.component=-1;if(0<x)for(E.reset();E.next();){var b=E.value;b.column-a.nodeMinColumnSpace(b,!0)<=y&&(b.component=a.le)}if(0>x)for(E.reset();E.next();)b=E.value,b.column+a.nodeMinColumnSpace(b,!1)>=y&&(b.component=a.le);for(a.le++,E.reset();E.next();)y=E.value,y.component===-1&&(my(a,y,a.le,-1,!0,!0),a.le++);var z;for(y=[],z=0;z<a.le*a.le;z++)y[z]=!1;for(b=[],z=0;z<(a.Ia+1)*(a.Ra+1);z++)b[z]=-1;for(E.reset();E.next();){z=E.value;for(var tt=z.layer,ot=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),rt=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));ot<=rt;ot++)b[tt*(a.Ra+1)+ot]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(tt=0;tt<a.Ra;tt++)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt+1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt+1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt+1]]=!0);if(0>x)for(tt=a.Ra;0<tt;tt--)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt-1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt-1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt-1]]=!0)}for(b=[],z=0;z<a.le;z++)b[z]=!0;for(tt=[],tt.push(0);tt.length!==0;)if(rt=tt[tt.length-1],tt.pop(),b[rt])for(b[rt]=!1,z=0;z<a.le;z++)y[rt*a.le+z]&&tt.splice(0,0,z);if(0<x)for(E.reset();E.next();)a=E.value,b[a.component]&&--a.column;if(0>x)for(E.reset();E.next();)x=E.value,b[x.component]&&(x.column+=1)}function Wx(a){for(var y=Un(),x=a.fl.length,E=0;E<=x;E++)y[E]=[];for(E=a.network.vertexes.iterator;E.next();){var b=E.value;y[x-b.layer][b.index]=b}x=new ke,Ux(y,x);var z=null,tt=null,ot=null,rt=null,at=(a.ve&1)!==0,ut=(a.ve&2)!==0,ct=(a.ve&4)!==0,mt=(a.ve&8)!==0;for(at&&(a.verticalAlignment(y,x,!0),z=w0(a,y,!0,!1)),y.reverse(),ct&&(a.verticalAlignment(y,x,!1),ot=w0(a,y,!1,!1)),E=vn(y),b=E.next();!b.done;b=E.next())b.value.reverse();mt&&(a.verticalAlignment(y,x,!1),rt=w0(a,y,!1,!0)),y.reverse(),ut&&(a.verticalAlignment(y,x,!0),tt=w0(a,y,!0,!0)),_n(y),a.u(z,tt,ot,rt),a.network.vertexes.each(function(yt){var St=Un();at&&St.push(z.get(yt)),ut&&St.push(tt.get(yt)),ct&&St.push(ot.get(yt)),mt&&St.push(rt.get(yt)),St.sort(function(Ot,bt){return Ot-bt});var Mt=St.length;Mt=(St[Math.floor((Mt-1)/2)]+St[Math.ceil((Mt-1)/2)])/2,_n(St),yt.zc=Mt})}function Ux(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,tt=a[E],ot=a[E+1],rt=0;z<ot.length;rt++){var at=ot[rt];t:{if(at.node===null){var ut=My(at);if(0<ut.length){ut=ut[0].node===null;break t}}ut=!1}var ct=ut;if(rt===ot.length-1||ct){for(ut=tt.length-1,ct&&(ut=My(at)[0].index);z<=rt;){if(at=ot[z],!at.bo){ct=[];for(var mt=vn(at.sourceEdgesArrayAccess),yt=mt.next();!yt.done;yt=mt.next())yt=yt.value,yt.valid&&ct.push(yt);at.bo=ct}for(at=vn(at.bo),ct=at.next();!ct.done;ct=at.next())ct=ct.value,mt=ct.fromVertex.index,(mt<b||mt>ut)&&y.add(ct);z++}b=ut}}}Zi.prototype.verticalAlignment=function(a,y,x){Vx(a),a=vn(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=vn(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var tt=x?My(z):Xx(z),ot=tt.length;if(0<ot){tt.sort(function(ct,mt){return ct.vi-mt.vi});var rt=(ot-1)/2;for(ot=Math.floor(rt),rt=Math.ceil(rt);ot<=rt;ot++)if(z.align===z){var at=tt[ot],ut=void 0;ut=x?N0(at,z):N0(z,at),!y.contains(ut)&&b<at.vi&&(at.align=z,z.root=at.root,z.align=at.root,b=at.vi)}}}}};function Vx(a){for(var y=0;y<a.length;y++)for(var x=a[y],E=0;E<x.length;E++){var b=x[E];b.root=b,b.align=b,b.Tz=y,b.vi=E}}function w0(a,y,x,E){for(var b=a.K===90||a.K===270,z=vn(y),tt=z.next();!tt.done;tt=z.next()){var ot=vn(tt.value);for(tt=ot.next();!tt.done;tt=ot.next())tt=tt.value,tt.sd=tt,tt.shift=1/0,tt.zc=NaN,tt.qg=0}for(tt=a.K===90||a.K===270,z=vn(y),ot=z.next();!ot.done;ot=z.next()){ot=vn(ot.value);for(var rt=ot.next();!rt.done;rt=ot.next())if(rt=rt.value,rt.root===rt){for(var at=0,ut=rt;ut.align!==rt;){var ct=ut.align,mt=tt?ut.width:ut.height,yt=tt?ct.width:ct.height;if(x){var St=N0(ut,ct),Mt=St.portFromPos,Ot=St.portToPos;St.link!==null&&(ut.node&&ut.node!==St.link.fromNode&&(Mt=tt?ut.focusX:ut.focusY),ct.node&&ct.node!==St.link.toNode&&(Ot=tt?ct.focusX:ct.focusY))}else St=N0(ct,ut),Mt=St.portToPos,Ot=St.portFromPos,St.link!==null&&(ut.node&&ut.node!==St.link.toNode&&(Mt=tt?ut.focusX:ut.focusY),ct.node&&ct.node!==St.link.fromNode&&(Ot=tt?ct.focusX:ct.focusY));mt=E?ut.qg+(mt-Mt)-(yt-Ot):ut.qg+Mt-Ot,ct.qg=mt,at=Math.min(at,mt),ut=ut.align}ut=rt;do ut.qg=ut.qg-at,ut=ut.align;while(ut!==rt)}}for(x=vn(y),tt=x.next();!tt.done;tt=x.next())for(z=vn(tt.value),tt=z.next();!tt.done;tt=z.next())tt=tt.value,tt.root===tt&&ex(a,tt,y);for(x=0;x<y.length;x++)if(!(0>=y[x].length)&&(tt=y[x][0],tt.sd===tt)){tt.sd.shift===1/0&&(tt.sd.shift=0),tt=x,ot=0;do{for(z=y[tt][ot];z.align!==z.root;)z=z.align,tt++,0<z.vi&&(ot=nx(z,y),ot.sd.shift=Math.min(ot.sd.shift,z.sd.shift+z.zc+z.qg-(ot.zc+ot.qg+(b?ot.width:ot.height)+a.columnSpacing)));ot=z.vi+1}while(tt<y.length&&ot<y[tt].length&&z.sd===y[tt][ot].sd)}for(a=new qe,y=vn(y),tt=y.next();!tt.done;tt=y.next())for(x=vn(tt.value),tt=x.next();!tt.done;tt=x.next())tt=tt.value,tt.zc=tt.zc+tt.sd.shift+tt.qg,z=b?tt.width:tt.height,a.add(tt,E?-tt.zc-z:tt.zc);return a}function ex(a,y,x){if(isNaN(y.zc)){y.zc=0;var E=y;do{if(0<E.vi){var b=nx(E,x),z=b.root;ex(a,z,x),y.sd===y&&(y.sd=z.sd);var tt=a.K===90||a.K===270?b.width:b.height;y.sd===z.sd&&(y.zc=Math.max(y.zc,z.zc+b.qg+tt-E.qg+a.columnSpacing))}E=E.align}while(E!==y);for(;E.align!==y;)E=E.align,E.zc=y.zc,E.sd=y.sd}}function nx(a,y){var x=a.Tz;return a=a.vi,1>a&&de("Could not determine previous vertex in layer"),y[x][a-1]}Zi.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=Un(),b=Un(),z=1/0,tt=0;4>tt;tt++)if(y[tt]){var ot=Yx(this,y[tt],E,b,tt);ot<z&&(x=tt,z=ot)}for(z={},tt=0;4>tt;z={delta:z.delta},tt++)y[tt]&&(z.delta=tt===0||tt===2?E[x]-E[tt]:b[x]-b[tt],z.delta!==0&&y[tt].each(function(rt){return function(at){at.value+=rt.delta}}(z)));_n(E),_n(b)};function Yx(a,y,x,E,b){if(!y||y.count===0)return x[b]=0,E[b]=0,1/0;var z=1/0,tt=-1/0;return y.each(function(ot){var rt=ot.key;ot=ot.value,rt=a.K===90||a.K===270?rt.width:rt.height,ot<z&&(z=ot),ot+rt>tt&&(tt=ot+rt)}),x[b]=z,E[b]=tt,tt-z}Zi.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=C0(this,!0),y=C0(this,!1),x=this.network.edges.iterator;x.next();){var E=x.value.link;E!==null&&(E.fromSpot=a,E.toSpot=y)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function C0(a,y){return a.K===270?y?Ks:Ls:a.K===90?y?Ls:Ks:a.K===180?y?Xs:Jr:y?Jr:Xs}Zi.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var a=0;a<=this.Ia;a++)this.he[a]=0,this.Ld[a]=0,this.Kd[a]=0,this.Ta[a]=0;for(a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;this.he[x]=Math.max(this.he[x],this.nodeMinLayerSpace(y,!0)),this.Ld[x]=Math.max(this.Ld[x],this.nodeMinLayerSpace(y,!1))}y=0,x=this.ie;for(var E=0;E<=this.Ia;E++){var b=x;0>=this.he[E]+this.Ld[E]&&(b=0),0<E&&(y+=b/2),this.K===90||this.K===0?(y+=this.Ld[E],this.Kd[E]=y,y+=this.he[E]):(y+=this.he[E],this.Kd[E]=y,y+=this.Ld[E]),E<this.Ia&&(y+=b/2),this.Ta[E]=y}for(x=y,y=this.arrangementOrigin,E=0;E<=this.Ia;E++)this.K===270?this.Kd[E]=y.y+this.Kd[E]:this.K===90?(this.Kd[E]=y.y+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]):this.K===180?this.Kd[E]=y.x+this.Kd[E]:(this.Kd[E]=y.x+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]);x=this.ve!==0,a.reset(),E=this.K===270||this.K===90;for(var z=1/0,tt=b=1/0,ot=-1/0;a.next();){var rt=a.value,at=rt.layer,ut=rt.column|0;E?(tt=y.x+this.kc*ut,at=this.Kd[at]):(tt=this.Kd[at],at=y.y+this.kc*ut),rt.centerX=tt,rt.centerY=at,x&&isFinite(rt.zc)&&(E?rt.node?rt.x=y.x+rt.zc:rt.centerX=y.x+rt.zc:rt.node?rt.y=y.y+rt.zc:rt.centerY=y.y+rt.zc),z=Math.min(rt.x,z),b=Math.min(rt.y,b),E?(tt=z,ot=Math.max(ot,rt.bounds.right)):(tt=b,ot=Math.max(ot,rt.bounds.bottom))}for(this.xw=ot-tt,z=y.x-z,y=y.y-b,this.Rf=new At(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},Zi.prototype.Gu=function(){for(var a=0,y=this.ie,x=0;x<=this.Ia;x++)a+=this.he[x],a+=this.Ld[x];a+=this.Ia*y,y=[],x=this.ve!==0?this.xw:this.kc*this.Ra;for(var E=this.maxLayer;0<=E;E--)this.K===270?E===0?y.push(new pe(0,0,x,Math.abs(this.Ta[0]))):y.push(new pe(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new pe(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new pe(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new pe(0,0,Math.abs(this.Ta[0]),x)):y.push(new pe(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new pe(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new pe(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},Zi.prototype.commitLayers=function(){},Zi.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,y;a.next();)y=a.value.link,y!==null&&(y.uh(),y.Fj(),y.zf());for(a.reset();a.next();)y=a.value.link,y!==null&&y.vg();for(a.reset();a.next();){var x=a.value;if(y=x.link,y!==null){y.uh();var E=y,b=E.fromNode,z=E.toNode,tt=E.fromPort,ot=E.toPort;if(b!==null){var rt=b.findVisibleNode();rt!==null&&rt!==b&&(b=rt,tt=rt.port)}z!==null&&(rt=z.findVisibleNode(),rt!==null&&rt!==z&&(z=rt,ot=rt.port));var at=y.computeSpot(!0,tt);rt=y.computeSpot(!1,ot);var ut=x.fromVertex,ct=x.toVertex;if(x.valid)y.curve===ca&&y.pointsCount===4&&(ut.column===ct.column&&this.alignOption===0?(x=y.getLinkPoint(b,tt,at,!0,!1,z,ot),ot=y.getLinkPoint(z,ot,rt,!1,!1,b,tt),x.w()||x.set(b.actualBounds.center),ot.w()||ot.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+ot.x)/3,(2*x.y+ot.y)/3),y.yf((x.x+2*ot.x)/3,(x.y+2*ot.y)/3),y.yf(ot.x,ot.y)):(x=E=!1,tt!==null&&at===hr&&(E=!0),ot!==null&&rt===hr&&(x=!0),(E||x)&&(rt=null,E&&(rt=y.getLinkPointFromPoint(b,tt,tt.ga(Mi),y.i(3),!0),rt.w()||rt.set(b.actualBounds.center),y.L(0,rt.x,rt.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,ot,ot.ga(Mi),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),rt&&(z=y.i(2),y.L(1,(2*rt.x+z.x)/3,(2*rt.y+z.y)/3)),b&&(z=y.i(1),y.L(2,(2*b.x+z.x)/3,(2*b.y+z.y)/3))))),y.zf();else if(ut.layer===ct.layer)y.zf();else{var mt=!1,yt=!1,St=this.ie,Mt=y.firstPickIndex+1;if(y.isOrthogonal){yt=!0;var Ot=y.pointsCount;4<Ot&&y.points.removeRange(2,Ot-3)}else if(y.curve===ca)mt=!0,Ot=y.pointsCount,4<Ot&&y.points.removeRange(2,Ot-3),Ot===4&&(Mt=2);else{Ot=y.pointsCount;var bt=at===hr,jt=rt===hr;2<Ot&&bt&&jt?y.points.removeRange(1,Ot-2):3<Ot&&bt&&!jt?y.points.removeRange(1,Ot-3):3<Ot&&!bt&&jt?y.points.removeRange(2,Ot-2):4<Ot&&!bt&&!jt&&y.points.removeRange(2,Ot-3)}if(x.rev){for(;ct!==null&&ut!==ct;){var Gt=Ot=null;for(bt=ct.sourceEdges.iterator;bt.next()&&(jt=bt.value,jt.link!==x.link||(Ot=jt.fromVertex,Gt=jt.toVertex,Ot.node!==null)););if(Ot===null)break;if(Ot!==ut){bt=y.i(Mt-1).x,jt=y.i(Mt-1).y;var Wt=Ot.centerX,Kt=Ot.centerY;if(yt)this.K===180||this.K===0?Mt===y.firstPickIndex+1?(y.m(Mt++,bt,jt),y.m(Mt++,bt,Kt)):(Gt!==null?Gt.centerY:jt)!==Kt&&(Gt=this.Ta[Ot.layer-1]+this.Rf.x,y.m(Mt++,Gt,jt),y.m(Mt++,Gt,Kt)):Mt===y.firstPickIndex+1?(y.m(Mt++,bt,jt),y.m(Mt++,Wt,jt)):(Gt!==null?Gt.centerX:bt)!==Wt&&(Gt=this.Ta[Ot.layer-1]+this.Rf.y,y.m(Mt++,bt,Gt),y.m(Mt++,Wt,Gt));else if(Mt===y.firstPickIndex+1){Gt=Math.max(10,this.he[ct.layer]);var $t=Math.max(10,this.Ld[ct.layer]);if(mt)this.K===180?Wt<=ct.bounds.x?(ct=ct.bounds.x,y.m(Mt++,ct-Gt,Kt),y.m(Mt++,ct,Kt),y.m(Mt++,ct+$t,Kt)):(y.m(Mt++,Wt-Gt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt+$t,Kt)):this.K===90?Kt>=ct.bounds.bottom?(ct=ct.bounds.y+ct.bounds.height,y.m(Mt++,Wt,ct+$t),y.m(Mt++,Wt,ct),y.m(Mt++,Wt,ct-Gt)):(y.m(Mt++,Wt,Kt+$t),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt-Gt)):this.K===270?Kt<=ct.bounds.y?(ct=ct.bounds.y,y.m(Mt++,Wt,ct-Gt),y.m(Mt++,Wt,ct),y.m(Mt++,Wt,ct+$t)):(y.m(Mt++,Wt,Kt-Gt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt+$t)):this.K===0&&(Wt>=ct.bounds.right?(ct=ct.bounds.x+ct.bounds.width,y.m(Mt++,ct+$t,Kt),y.m(Mt++,ct,Kt),y.m(Mt++,ct-Gt,Kt)):(y.m(Mt++,Wt+$t,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt-Gt,Kt)));else{y.m(Mt++,bt,jt);var Qe=0;this.K===180||this.K===0?((this.K===180?Wt>=ct.bounds.right:Wt<=ct.bounds.x)&&(Qe=(this.K===0?-Gt:$t)/2),y.m(Mt++,bt+Qe,Kt)):((this.K===270?Kt>=ct.bounds.bottom:Kt<=ct.bounds.y)&&(Qe=(this.K===90?-Gt:$t)/2),y.m(Mt++,Wt,jt+Qe)),y.m(Mt++,Wt,Kt)}}else Gt=Math.max(10,this.he[Ot.layer]),$t=Math.max(10,this.Ld[Ot.layer]),mt?this.K===180?(y.m(Mt++,Wt-Gt-St,Kt),y.m(Mt++,Math.min(Wt-Gt+St/2,Wt),Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Math.max(Wt+$t-St/2,Wt),Kt),y.m(Mt++,Wt+$t+St,Kt)):this.K===90?(y.m(Mt++,Wt,Kt+$t+St),y.m(Mt++,Wt,Math.max(Kt+$t-St/2,Kt)),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Math.min(Kt-Gt+St/2,Kt)),y.m(Mt++,Wt,Kt-Gt-St)):this.K===270?(y.m(Mt++,Wt,Kt-Gt-St),y.m(Mt++,Wt,Math.min(Kt-Gt+St/2,Kt)),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Math.max(Kt+$t-St/2,Kt)),y.m(Mt++,Wt,Kt+$t+St)):(y.m(Mt++,Wt+$t+St,Kt),y.m(Mt++,Math.max(Wt+$t-St/2,Wt),Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Math.min(Wt-Gt+St/2,Wt),Kt),y.m(Mt++,Wt-Gt-St,Kt)):y.m(Mt++,Wt,Kt)}ct=Ot}(ot===null||at!==hr||yt)&&(bt=y.i(Mt-1).x,jt=y.i(Mt-1).y,Wt=y.i(Mt).x,Kt=y.i(Mt).y,yt?(St=this.Ld[ut.layer],this.K===180||this.K===0?(yt=jt,yt>=ut.bounds.y&&yt<=ut.bounds.bottom&&(this.K===180?Wt>=ut.bounds.x:Wt<=ut.bounds.right)&&(ct=ut.centerX+(this.K===180?-St:St),yt<ut.bounds.y+ut.bounds.height/2?yt=ut.bounds.y-this.kc/2:yt=ut.bounds.bottom+this.kc/2,y.m(Mt++,ct,jt),y.m(Mt++,ct,yt)),y.m(Mt++,Wt,yt)):(yt=bt,yt>=ut.bounds.x&&yt<=ut.bounds.right&&(this.K===270?Kt>=ut.bounds.y:Kt<=ut.bounds.bottom)&&(ct=ut.centerY+(this.K===270?-St:St),yt<ut.bounds.x+ut.bounds.width/2?yt=ut.bounds.x-this.kc/2:yt=ut.bounds.right+this.kc/2,y.m(Mt++,bt,ct),y.m(Mt++,yt,ct)),y.m(Mt++,yt,Kt)),y.m(Mt++,Wt,Kt)):mt?(Gt=Math.max(10,this.he[ut.layer]),$t=Math.max(10,this.Ld[ut.layer]),this.K===180&&Wt>=ut.bounds.x?(ct=ut.bounds.x+ut.bounds.width,y.L(Mt-2,ct,jt),y.L(Mt-1,ct+$t,jt)):this.K===90&&Kt<=ut.bounds.bottom?(ct=ut.bounds.y,y.L(Mt-2,bt,ct),y.L(Mt-1,bt,ct-Gt)):this.K===270&&Kt>=ut.bounds.y?(ct=ut.bounds.y+ut.bounds.height,y.L(Mt-2,bt,ct),y.L(Mt-1,bt,ct+$t)):this.K===0&&Wt<=ut.bounds.right&&(ct=ut.bounds.x,y.L(Mt-2,ct,jt),y.L(Mt-1,ct-Gt,jt))):(Gt=Math.max(10,this.he[ut.layer]),$t=Math.max(10,this.Ld[ut.layer]),yt=0,this.K===180||this.K===0?((this.K===180?Wt<=ut.bounds.x:Wt>=ut.bounds.right)&&(yt=(this.K===0?$t:-Gt)/2),y.m(Mt++,Wt+yt,jt)):((this.K===270?Kt<=ut.bounds.y:Kt>=ut.bounds.bottom)&&(yt=(this.K===90?$t:-Gt)/2),y.m(Mt++,bt,Kt+yt)),y.m(Mt++,Wt,Kt)))}else{for(;ut!==null&&ut!==ct;){for(Gt=Ot=null,ut=ut.destinationEdges.iterator;ut.next()&&(bt=ut.value,bt.link!==x.link||(Ot=bt.toVertex,Gt=bt.fromVertex,Gt.node!==null&&(Gt=null),Ot.node!==null)););if(Ot===null)break;Ot!==ct&&(bt=y.i(Mt-1).x,jt=y.i(Mt-1).y,Wt=Ot.centerX,Kt=Ot.centerY,yt?this.K===180||this.K===0?(Gt!==null?Gt.centerY:jt)!==Kt&&(Gt=this.Ta[Ot.layer]+this.Rf.x,Mt===y.firstPickIndex+1&&(Gt=this.K===0?Math.max(Gt,bt):Math.min(Gt,bt)),y.m(Mt++,Gt,jt),y.m(Mt++,Gt,Kt)):(Gt!==null?Gt.centerX:bt)!==Wt&&(Gt=this.Ta[Ot.layer]+this.Rf.y,Mt===y.firstPickIndex+1&&(Gt=this.K===90?Math.max(Gt,jt):Math.min(Gt,jt)),y.m(Mt++,bt,Gt),y.m(Mt++,Wt,Gt)):(Gt=Math.max(10,this.he[Ot.layer]),$t=Math.max(10,this.Ld[Ot.layer]),mt?this.K===180?(y.m(Mt++,Wt+$t+St,Kt),y.m(Mt++,Math.max(Wt+$t-St/2,Wt),Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Math.min(Wt-Gt+St/2,Wt),Kt),y.m(Mt++,Wt-Gt-St,Kt)):this.K===90?(y.m(Mt++,Wt,Kt-Gt-St),y.m(Mt++,Wt,Math.min(Kt-Gt+St/2,Kt)),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Math.max(Kt+$t-St/2,Kt)),y.m(Mt++,Wt,Kt+$t+St)):this.K===270?(y.m(Mt++,Wt,Kt+$t+St),y.m(Mt++,Wt,Math.max(Kt+$t-St/2,Kt)),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Math.min(Kt-Gt+St/2,Kt)),y.m(Mt++,Wt,Kt-Gt-St)):(y.m(Mt++,Wt-Gt-St,Kt),y.m(Mt++,Math.min(Wt-Gt+St/2,Wt),Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Wt,Kt),y.m(Mt++,Math.max(Wt+$t-St/2,Wt),Kt),y.m(Mt++,Wt+$t+St,Kt)):this.K===180?(y.m(Mt++,Wt+$t,Kt),y.m(Mt++,Wt-Gt,Kt)):this.K===90?(y.m(Mt++,Wt,Kt-Gt),y.m(Mt++,Wt,Kt+$t)):this.K===270?(y.m(Mt++,Wt,Kt+$t),y.m(Mt++,Wt,Kt-Gt)):(y.m(Mt++,Wt-Gt,Kt),y.m(Mt++,Wt+$t,Kt)))),ut=Ot}yt&&(bt=y.i(Mt-1).x,jt=y.i(Mt-1).y,Wt=y.i(Mt).x,Kt=y.i(Mt).y,this.K===180||this.K===0?jt!==Kt&&(Gt=this.K===0?Math.min(Math.max((Wt+bt)/2,this.Ta[ct.layer]+this.Rf.x),Wt):Math.max(Math.min((Wt+bt)/2,this.Ta[ct.layer]+this.Rf.x),Wt),y.m(Mt++,Gt,jt),y.m(Mt++,Gt,Kt)):bt!==Wt&&(Gt=this.K===90?Math.min(Math.max((Kt+jt)/2,this.Ta[ct.layer]+this.Rf.y),Kt):Math.max(Math.min((Kt+jt)/2,this.Ta[ct.layer]+this.Rf.y),Kt),y.m(Mt++,bt,Gt),y.m(Mt++,Wt,Gt)))}E!==null&&mt&&4<=y.pointsCount&&(tt!==null&&(tt=at===hr?y.getLinkPointFromPoint(b,tt,tt.ga(Mi),y.i(3),!0):y.i(0),at===hr&&(at=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(tt.x+at.x)/2,at.y),y.L(2,E.x,(at.y+E.y)/2)):(y.L(1,at.x,(tt.y+at.y)/2),y.L(2,(at.x+E.x)/2,E.y))),tt.w()||tt.set(b.actualBounds.center),y.L(0,tt.x,tt.y)),ot!==null&&(b=rt===hr?y.getLinkPointFromPoint(z,ot,ot.ga(Mi),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),rt===hr&&(ot=y.i(y.pointsCount-3),rt=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.x+ot.x)/2,ot.y),y.L(y.pointsCount-2,rt.x,(ot.y+rt.y)/2)):(y.L(y.pointsCount-2,ot.x,(b.y+ot.y)/2),y.L(y.pointsCount-3,(ot.x+rt.x)/2,rt.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},Zi.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new be,y=this.network.edges.iterator;y.next();){var x=y.value.link;x!==null&&x.isOrthogonal&&!a.contains(x)&&a.add(x)}if(0<a.count)if(this.K===90||this.K===270){for(y=0,x=[],a=a.iterator;a.next();){var E=a.value;if(E!==null&&E.isOrthogonal)for(var b=2;b<E.pointsCount-3;b++){var z=E.i(b),tt=E.i(b+1);if(this.B(z.y,tt.y)&&!this.B(z.x,tt.x)){var ot=new Ih;ot.layer=Math.floor(z.y/2);var rt=E.i(0),at=E.i(E.pointsCount-1);if(ot.first=rt.x*rt.x+rt.y,ot.jc=at.x*at.x+at.y,ot.rd=Math.min(z.x,tt.x),ot.Ic=Math.max(z.x,tt.x),ot.index=b,ot.link=E,b+2<E.pointsCount){rt=E.i(b-1),at=E.i(b+2);var ut=0;rt.y<z.y?ut=at.y<z.y?3:z.x<tt.x?2:1:rt.y>z.y&&(ut=at.y>z.y?0:tt.x<z.x?2:1),ot.j=ut}x.push(ot)}}}if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,ot=x[z].jc,rt=z;rt<b;rt++)at=x[rt],at.jc!==ot&&(ut++,ot=at.jc);this.zi(x,this.Ux,z,z+tt);var ct=1;for(ot=x[z].first,rt=z;rt<b;rt++)at=x[rt],at.first!==ot&&(ct++,ot=at.first);for(rt=!0,at=ct,ut<ct?(rt=!1,at=ut,ot=x[z].jc,this.zi(x,this.Js,z,z+tt)):ot=x[z].first,ut=0,ct=z;ct<b;ct++){var mt=x[ct];(rt?mt.first:mt.jc)!==ot&&(ut++,ot=rt?mt.first:mt.jc);var yt=mt.link;z=yt.i(mt.index),tt=yt.i(mt.index+1);var St=this.linkSpacing*(ut-(at-1)/2);y++,yt.uh(),yt.L(mt.index,z.x,z.y+St),yt.L(mt.index+1,tt.x,tt.y+St),yt.zf()}}z=b}a=E}}else{for(y=0,x=[],a=a.iterator;a.next();)if(E=a.value,E!==null&&E.isOrthogonal)for(b=2;b<E.pointsCount-3;b++)z=E.i(b),tt=E.i(b+1),this.B(z.x,tt.x)&&!this.B(z.y,tt.y)&&(ot=new Ih,ot.layer=Math.floor(z.x/2),rt=E.i(0),at=E.i(E.pointsCount-1),ot.first=rt.x+rt.y*rt.y,ot.jc=at.x+at.y*at.y,ot.rd=Math.min(z.y,tt.y),ot.Ic=Math.max(z.y,tt.y),ot.index=b,ot.link=E,b+2<E.pointsCount&&(rt=E.i(b-1),at=E.i(b+2),ut=0,rt.x<z.x?ut=at.x<z.x?3:z.y<tt.y?2:1:rt.x>z.x&&(ut=at.x>z.x?0:tt.y<z.y?2:1),ot.j=ut),x.push(ot));if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,ot=x[z].jc,rt=z;rt<b;rt++)at=x[rt],at.jc!==ot&&(ut++,ot=at.jc);for(this.zi(x,this.Ux,z,z+tt),ct=1,ot=x[z].first,rt=z;rt<b;rt++)at=x[rt],at.first!==ot&&(ct++,ot=at.first);for(rt=!0,at=ct,ut<ct?(rt=!1,at=ut,ot=x[z].jc,this.zi(x,this.Js,z,z+tt)):ot=x[z].first,ut=0,ct=z;ct<b;ct++)mt=x[ct],(rt?mt.first:mt.jc)!==ot&&(ut++,ot=rt?mt.first:mt.jc),yt=mt.link,z=yt.i(mt.index),tt=yt.i(mt.index+1),St=this.linkSpacing*(ut-(at-1)/2),y++,yt.uh(),yt.L(mt.index,z.x+St,z.y),yt.L(mt.index+1,tt.x+St,tt.y),yt.zf()}z=b}a=E}}}},xt=Zi.prototype,xt.Vx=function(a,y){return a instanceof Ih&&y instanceof Ih&&a!==y?a.layer<y.layer?-1:a.layer>y.layer?1:a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},xt.Ux=function(a,y){return a instanceof Ih&&y instanceof Ih&&a!==y?a.first<y.first?-1:a.first>y.first||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},xt.Js=function(a,y){return a instanceof Ih&&y instanceof Ih&&a!==y?a.jc<y.jc?-1:a.jc>y.jc||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},xt.B=function(a,y){return a-=y,-1<a&&1>a},xt.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&de("not in range 0 <= from < length: "+x),z===2)E=a[x],b=a[x+1],0<y(E,b)&&(a[x]=b,a[x+1]=E);else if(x===0)if(E>=b)a.sort(y);else for(x=a.slice(0,E),x.sort(y),y=0;y<E;y++)a[y]=x[y];else if(E>=b)for(E=a.slice(x),E.sort(y),y=x;y<b;y++)a[y]=E[y-x];else for(b=a.slice(x,E),b.sort(y),y=x;y<E;y++)a[y]=b[y-x]};function Dh(a,y){var x=a.tc[y];if(x>=a.He.length){for(var E=[],b=0;b<a.He.length;b++)E[b]=a.He[b];a.He=E}for(a.He[x]===void 0||a.He[x]===null?E=[]:(E=a.He[x],a.He[x]=null),a=a.fl[y],y=0;y<a.length;y++)x=a[y],E[x.index]=x;return E}function Oh(a,y,x){a.He[a.tc[y]]=x}Ie.Object.defineProperties(Zi.prototype,{layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&0<=a&&(this.ie=a,this.C())}},columnSpacing:{get:function(){return this.kc},set:function(a){this.kc!==a&&0<a&&(this.kc=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K!==a&&(a===0||a===90||a===180||a===270?(this.K=a,this.C()):de("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==Sy&&a!==L0&&a!==mp||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==k0&&a!==xy&&a!==Py||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==M0&&a!==wy&&a!==Cy||(this.Qk=a,this.C())}},iterations:{get:function(){return this.bj},set:function(a){this.bj!==a&&0<=a&&(this.bj=a,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(a){this.rk===a||a!==Ly&&a!==E0&&a!==ky||(this.rk=a,this.C())}},packOption:{get:function(){return this.bg},set:function(a){this.bg!==a&&0<=a&&8>a&&(this.bg=a,this.C())}},alignOption:{get:function(){return this.ve},set:function(a){this.ve!==a&&0<=a&&16>a&&(this.ve=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(a){this.Cn!==a&&0<=a&&(this.Cn=a,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var L0=new ae(Zi,"CycleDepthFirst",0),Sy=new ae(Zi,"CycleGreedy",1),mp=new ae(Zi,"CycleFromLayers",2),k0=new ae(Zi,"LayerOptimalLinkLength",0),xy=new ae(Zi,"LayerLongestPathSink",1),Py=new ae(Zi,"LayerLongestPathSource",2),M0=new ae(Zi,"InitDepthFirstOut",0),wy=new ae(Zi,"InitDepthFirstIn",1),Cy=new ae(Zi,"InitNaive",2),Ly=new ae(Zi,"AggressiveNone",0),E0=new ae(Zi,"AggressiveLess",1),ky=new ae(Zi,"AggressiveMore",2),Kx=8;Zi.className="LayeredDigraphLayout",Zi.CycleDepthFirst=L0,Zi.CycleGreedy=Sy,Zi.CycleFromLayers=mp,Zi.LayerOptimalLinkLength=k0,Zi.LayerLongestPathSink=xy,Zi.LayerLongestPathSource=Py,Zi.InitDepthFirstOut=M0,Zi.InitDepthFirstIn=wy,Zi.InitNaive=Cy,Zi.AggressiveNone=Ly,Zi.AggressiveLess=E0,Zi.AggressiveMore=ky,Zi.PackNone=0,Zi.PackExpand=1,Zi.PackStraighten=2,Zi.PackMedian=4,Zi.PackAll=15,Zi.AlignNone=0,Zi.AlignUpperLeft=1,Zi.AlignUpperRight=2,Zi.AlignLowerLeft=4,Zi.AlignLowerRight=8,Zi.AlignAll=15;function Ih(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Ih.className="SegInfo";function Ac(a){oo.call(this,a)}ee(Ac,oo),Ac.prototype.createVertex=function(){return new ba(this)},Ac.prototype.createEdge=function(){return new vp(this)},Ac.className="LayeredDigraphNetwork";function ba(a){ur.call(this,a),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}ee(ba,ur);function ix(a,y){return a.index-y.index}function N0(a,y){if(!a.$n){for(var x=[],E=vn(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=vn(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;de("Unable to find destination edge to given vertex")}function My(a){if(!a.co){for(var y=[],x=vn(a.sourceEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.fromVertex);y.sort(ix),a.co=y}return a.co}function Xx(a){if(!a.ao){for(var y=[],x=vn(a.destinationEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.toVertex);y.sort(ix),a.ao=y}return a.ao}ba.prototype.Cl=function(a){ur.prototype.Cl.call(this,a),this.bo=this.co=null},ba.prototype.Kl=function(a){ur.prototype.Kl.call(this,a),this.bo=this.co=null},ba.prototype.zl=function(a){ur.prototype.zl.call(this,a),this.$n=this.ao=null},ba.prototype.Jl=function(a){ur.prototype.Jl.call(this,a),this.$n=this.ao=null},Ie.Object.defineProperties(ba.prototype,{layer:{get:function(){return this.Ig},set:function(a){this.Ig!==a&&(this.Ig=a)}},column:{get:function(){return this.Ag},set:function(a){this.Ag!==a&&(this.Ag=a)}},index:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za=a)}},component:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},near:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),ba.prototype.deleteDestinationEdge=ba.prototype.Jl,ba.prototype.addDestinationEdge=ba.prototype.zl,ba.prototype.deleteSourceEdge=ba.prototype.Kl,ba.prototype.addSourceEdge=ba.prototype.Cl,ba.className="LayeredDigraphVertex";function vp(a){ta.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}ee(vp,ta),Ie.Object.defineProperties(vp.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},valid:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},rev:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},forest:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToPos:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},portFromColOffset:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},portToColOffset:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),vp.className="LayeredDigraphEdge";function yi(a){xo.call(this),this.Ub=new ke,this.Wn=A0,this.ud=Wl,this.vo=D0,this.Bq=Ry,this.$v=[],this.td=!0,this.Rb=O0,this.$d=new Le(10,10).freeze();var y=new vf(this);this.W=new Ga(y),this.Y=new Ga(y),this.ru=[],a&&Object.assign(this,a)}ee(yi,xo),yi.prototype.cloneProtected=function(a){xo.prototype.cloneProtected.call(this,a),a.Wn=this.Wn,a.vo=this.vo,a.Bq=this.Bq,a.td=this.td,a.Rb=this.Rb,a.$d.assign(this.$d),a.W.copyInheritedPropertiesFrom(this.W),a.Y.copyInheritedPropertiesFrom(this.Y)},yi.prototype.qb=function(a){a.classType===yi?a.name.indexOf("Alignment")===0?this.alignment=a:a.name.indexOf("Arrangement")===0?this.arrangement=a:a.name.indexOf("Compaction")===0?this.compaction=a:a.name.indexOf("Path")===0?this.path=a:a.name.indexOf("Sorting")===0?this.sorting=a:a.name.indexOf("Style")===0?this.treeStyle=a:de("Unknown enum value: "+a):xo.prototype.qb.call(this,a)},yi.prototype.createNetwork=function(){return new vf(this)},yi.prototype.makeNetwork=function(a){function y(E){if(E instanceof tn)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof Ue){var b=E.fromNode;return b===null||b.isLinkLabel||b.category==="Comment"?!1:(E=E.toNode,!(E===null||E.isLinkLabel||E.category==="Comment"))}return!1}var x=this.createNetwork();return a instanceof te?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof Jn?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},yi.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==I0&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof te&&(y=a),this.path===A0&&y!==null?this.ud=y.isTreePathToChildren?Wl:pf:this.ud=this.path===A0?Wl:this.path,0<this.network.vertexes.count){for(this.network.Ko(),a=this.network.vertexes.iterator;a.next();)y=a.value,y.initialized=!1,y.level=0,y.parent=null,y.children=[];if(0<this.Ub.count){for(a=new ke,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof tn?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof Ga&&a.add(x)}this.Ub=a}for(this.Ub.count===0&&this.findRoots(),a=this.Ub.copy().iterator;a.next();)y=a.value,y.initialized||(y.initialized=!0,Ey(this,y));for(y=this.network.vertexes,a=null;a=Zx(y),0<a.count;)y=ox(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,Ey(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Ga&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Ga&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Ga&&lx(this,y);if(this.Cu(),this.layerStyle===R0){for(a=[],y=this.network.vertexes.iterator;y.next();){x=y.value;var E=x.parent;E===null&&(E=x),E=E.angle===0||E.angle===180;var b=a[x.level];b===void 0&&(b=0),a[x.level]=Math.max(b,E?x.width:x.height)}for(y=0;y<a.length;y++)a[y]===void 0&&(a[y]=0);for(this.$v=a,y=this.network.vertexes.iterator;y.next();)x=y.value,E=x.parent,E===null&&(E=x),E.angle===0||E.angle===180?(E.angle===180&&(x.focusX+=a[x.level]-x.width),x.width=a[x.level]):(E.angle===270&&(x.focusY+=a[x.level]-x.height),x.height=a[x.level])}else if(this.layerStyle===jy)for(a=this.network.vertexes.iterator;a.next();){for(y=a.value,x=y.angle===0||y.angle===180,E=-1,b=0;b<y.children.length;b++){var z=y.children[b];E=Math.max(E,x?z.width:z.height)}if(0<=E)for(b=0;b<y.children.length;b++)z=y.children[b],x?(y.angle===180&&(z.focusX+=E-z.width),z.width=E):(y.angle===270&&(z.focusY+=E-z.height),z.height=E)}for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Ga&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new ke,this.isValidLayout=!0};function Zx(a){var y=new ke;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}yi.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case Wl:x.sourceEdges.count===0&&this.Ub.add(x);break;case pf:x.destinationEdges.count===0&&this.Ub.add(x);break;default:de("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=ox(this,a),a!==null&&this.Ub.add(a))};function ox(a,y){var x=999999,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case Wl:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case pf:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:de("Unhandled path value "+a.ud.toString())}}return E}function Ey(a,y){if(y!==null){switch(a.ud){case Wl:if(0<y.destinationEdges.count){for(var x=new be,E=y.destinationVertexes;E.next();){var b=E.value;rx(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case pf:if(0<y.sourceEdges.count){for(x=new be,E=y.sourceVertexes;E.next();)b=E.value,rx(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:de("Unhandled path value"+a.ud.toString())}for(x=y.children,E=x.length,b=0;b<E;b++){var z=x[b];z.initialized=!0,z.level=y.level+1,z.parent=y,a.Ub.remove(z)}for(y=0;y<E;y++)Ey(a,x[y])}}function rx(a,y,x){if(x.initialized){if(y===null)var E=!1;else{for(E=y.parent;E!==null&&E!==x;)E=E.parent;E=E===x}if(E||x.level>y.level)return!1;a.removeChild(x.parent,x)}return!0}yi.prototype.removeChild=function(a,y){if(a!==null&&y!==null){for(var x=a.children,E=0,b=0;b<x.length;b++)x[b]===y&&E++;if(0<E){E=Array(x.length-E);for(var z=b=0;z<x.length;z++)x[z]!==y&&(E[b++]=x[z]);a.children=E}}};function sx(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===Yl&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,tt=z.length,ot=0;ot<tt;ot++){var rt=z[ot];sx(a,rt),x+=rt.descendantCount+1,E=Math.max(E,rt.maxChildrenCount),b=Math.max(b,rt.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function Jx(a,y){switch(a.vo){default:case D0:return y.parent!==null?y.parent:a.W;case Oy:return y.parent===null?a.W:y.parent.parent===null?a.Y:y.parent;case Dy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case By:var x=!0;if(y.childrenCount===0)x=!1;else for(var E=y.children,b=E.length,z=0;z<b;z++)if(0<E[z].childrenCount){x=!1;break}return x&&y.parent!==null?a.Y:y.parent!==null?y.parent:a.W}}yi.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===Yl){for(var y=a.angle,x=a.parent.children,E=0;E<x.length&&a!==x[E];)E++;E%2===0?E!==x.length-1&&(y=y===90?180:y===180?270:y===270?180:270):y=y===90?0:y===180?90:y===270?0:90,a.angle=y}a.initialized=!0};function ax(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)ax(a,y[E])}}yi.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==Yl&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lx(a,y[E])}}yi.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Bc:break;case Sp:a.children.reverse();break;case xp:a.children.sort(a.comparer);break;case Pp:a.children.sort(a.comparer),a.children.reverse();break;default:de("Unhandled sorting value "+a.sorting.toString())}},yi.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},yi.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Rh(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,tt=0,ot=0,rt=a.commentSpacing;if(a.node!==null)for(var at=a.node.Mu();at.next();){var ut=at.value;ut.category==="Comment"&&ut.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(ut),ut.Va(),ut=ut.measuredBounds,y&&!x||!b&&!E&&x||b&&E&&x?(z=Math.max(z,ut.width),tt+=ut.height+Math.abs(ot)):(z+=ut.width+Math.abs(ot),tt=Math.max(tt,ut.height)),ot=rt)}a.comments!==null&&(y&&!x||!b&&!E&&x||b&&E&&x?(z+=Math.abs(a.commentMargin),tt=Math.max(0,tt-a.height)):(tt+=Math.abs(a.commentMargin),z=Math.max(0,z-a.width)),b=pe.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,pe.free(b))};function Rh(a){return a===Ku||a===Yl||a===Xu||a===hu}function yp(a){return a===Ku||a===Yl}function Ny(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Rh(x)){if(yp(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===Xu)return!0}}return!1}yi.prototype.layoutComments=function(a){if(a.comments!==null){var y=a.node.measuredBounds,x=a.parent,E=a.angle,b=0,z=!1;x!==null&&(b=x.angle,z=x.alignment,z=Rh(z)),E=E===90||E===270,x=b===90||b===270;for(var tt=a.childrenCount===0,ot=Ny(a),rt=0,at=a.comments,ut=at.length,ct=At.alloc(),mt=0;mt<ut;mt++){var yt=at[mt],St=yt.measuredBounds;if(E&&!tt||!z&&!x&&tt||z&&x&&tt){if(135<b&&!z||x&&ot)if(0<=a.commentMargin)for(ct.h(a.bounds.x-a.commentMargin-St.width,a.bounds.y+rt),yt.move(ct),yt=yt.Sd();yt.next();){var Mt=yt.value;Mt.fromSpot=Xs,Mt.toSpot=Jr}else for(ct.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+rt),yt.move(ct),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Jr,Mt.toSpot=Xs;else if(0<=a.commentMargin)for(ct.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+rt),yt.move(ct),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Jr,Mt.toSpot=Xs;else for(ct.h(a.bounds.x+a.commentMargin-St.width,a.bounds.y+rt),yt.move(ct),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Xs,Mt.toSpot=Jr;rt=0<=a.commentSpacing?rt+(St.height+a.commentSpacing):rt+(a.commentSpacing-St.height)}else{if(135<b&&!z||!x&&ot)if(0<=a.commentMargin)for(ct.h(a.bounds.x+rt,a.bounds.y-a.commentMargin-St.height),yt.move(ct),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Ks,Mt.toSpot=Ls;else for(ct.h(a.bounds.x+rt,a.bounds.y+2*a.focus.y-a.commentMargin),yt.move(ct),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Ls,Mt.toSpot=Ks;else if(0<=a.commentMargin)for(ct.h(a.bounds.x+rt,a.bounds.y+2*a.focus.y+a.commentMargin),yt.move(ct),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Ls,Mt.toSpot=Ks;else for(ct.h(a.bounds.x+rt,a.bounds.y+a.commentMargin-St.height),yt.move(ct),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Ks,Mt.toSpot=Ls;rt=0<=a.commentSpacing?rt+(St.width+a.commentSpacing):rt+(a.commentSpacing-St.width)}}if(At.free(ct),y=rt-a.commentSpacing-(E?y.height:y.width),this.ud===Wl)for(a=a.destinationEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.fromEndSegmentLength=0<y?y:NaN);else for(a=a.sourceEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.toEndSegmentLength=0<y?y:NaN)}},yi.prototype.layoutTree=function(a){if(a!==null){for(var y=a.children,x=y.length,E=0;E<x;E++)this.layoutTree(y[E]);switch(a.compaction){case B0:ux(this,a);break;case wp:if(a.alignment===Yl)ux(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Rh(x)),E=Ny(a),a.S.h(0,0),a.Da.h(a.width,a.height),a.parent===null||a.comments===null||(y!==180&&y!==270||x)&&!E?a.la.h(0,0):y===180&&!x||(y===90||y===270)&&E?a.la.h(a.width-2*a.focus.x,0):a.la.h(0,a.height-2*a.focus.y),a.Yo=null,a.kp=null;else{var b=el(a);y=b===90||b===270;var z=0,tt=a.children,ot=tt.length;for(x=0;x<ot;x++)E=tt[x],z=Math.max(z,y?E.Da.width:E.Da.height);var rt=a.alignment;E=rt===Ul;var at=rt===Vl,ut=Rh(rt),ct=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var mt=a.nodeSpacing,yt=this.computeNodeIndent(a),St=a.rowSpacing,Mt=0;(E||at||a.hm||a.im&&a.maxGenerationCount===1)&&(Mt=Math.max(0,a.rowIndent)),E=a.width;var Ot=a.height,bt=0,jt=0,Gt=0,Wt=null,Kt=null,$t=0,Qe=0,dn=0,rn=0,We=0,Ee=0,Zn=0,zn=0;if(ut&&!yp(rt)&&135<b&&tt.reverse(),yp(rt))if(1<ot)for(var Ri=0;Ri<ot;Ri++)Ri%2===0&&Ri!==ot-1&&(zn=Math.max(zn,y?tt[Ri].Da.width:tt[Ri].Da.height));else ot===1&&(zn=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(rt){case Ku:jt=135>b?hx(this,a,tt,zn,bt,jt):dx(this,a,tt,zn,bt,jt),zn=jt.x,bt=jt.width,jt=jt.height;break;case Xu:for(Wt=0;Wt<ot;Wt++)Kt=tt[Wt],ct=Kt.Da,Gt=Ee===0?0:St,y?(Kt.S.h(z-ct.width,rn+Gt),bt=Math.max(bt,ct.width),jt=Math.max(jt,rn+Gt+ct.height),rn+=Gt+ct.height):(Kt.S.h(dn+Gt,z-ct.height),bt=Math.max(bt,dn+Gt+ct.width),jt=Math.max(jt,ct.height),dn+=Gt+ct.width),Ee++;break;case hu:for(Wt=0;Wt<ot;Wt++)Kt=tt[Wt],z=Kt.Da,ct=Ee===0?0:St,y?(Kt.S.h(mt/2+a.focus.x,rn+ct),bt=Math.max(bt,z.width),jt=Math.max(jt,rn+ct+z.height),rn+=ct+z.height):(Kt.S.h(dn+ct,mt/2+a.focus.y),bt=Math.max(bt,dn+ct+z.width),jt=Math.max(jt,z.height),dn+=ct+z.width),Ee++}Wt=js(this,2),Kt=js(this,2),y?(Wt[0].h(0,0),Wt[1].h(0,jt),Kt[0].h(bt,0)):(Wt[0].h(0,0),Wt[1].h(bt,0),Kt[0].h(0,jt)),Kt[1].h(bt,jt)}else for(Ri=0;Ri<ot;Ri++){var no=tt[Ri],vr=no.Da;if(y){0<ct&&0<Ee&&dn+mt+vr.width>ct&&(dn<z&&Pd(a,rt,z-dn,0,Zn,Ri-1),We++,Ee=0,Zn=Ri,Gt=jt,dn=0,rn=135<b?-jt-St:jt+St),F0(this,no,0,rn);var wr=0;if(Ee===0)Wt=no.Yo,Kt=no.kp,$t=vr.width,Qe=vr.height,(Wt===null||Kt===null||b!==el(no))&&(Wt=js(this,2),Kt=js(this,2),Wt[0].h(0,0),Wt[1].h(0,Qe),Kt[0].h($t,0),Kt[1].h($t,Qe));else{var es=Un();Qe=fx(this,a,no,Wt,Kt,$t,Qe,es),wr=Qe.x,Wt=es[0],Kt=es[1],$t=Qe.width,Qe=Qe.height,_n(es),dn<vr.width&&0>wr&&(gf(a,-wr,0,Zn,Ri-1),b0(Wt,-wr,0),b0(Kt,-wr,0),wr=0)}no.S.h(wr,rn),bt=Math.max(bt,$t),jt=Math.max(jt,Gt+(We===0?0:St)+vr.height),dn=$t}else 0<ct&&0<Ee&&rn+mt+vr.height>ct&&(rn<z&&Pd(a,rt,0,z-rn,Zn,Ri-1),We++,Ee=0,Zn=Ri,Gt=bt,rn=0,dn=135<b?-bt-St:bt+St),F0(this,no,dn,0),wr=0,Ee===0?(Wt=no.Yo,Kt=no.kp,$t=vr.width,Qe=vr.height,(Wt===null||Kt===null||b!==el(no))&&(Wt=js(this,2),Kt=js(this,2),Wt[0].h(0,0),Wt[1].h($t,0),Kt[0].h(0,Qe),Kt[1].h($t,Qe))):(es=Un(),Qe=fx(this,a,no,Wt,Kt,$t,Qe,es),wr=Qe.x,Wt=es[0],Kt=es[1],$t=Qe.width,Qe=Qe.height,_n(es),rn<vr.height&&0>wr&&(gf(a,0,-wr,Zn,Ri-1),b0(Wt,0,-wr),b0(Kt,0,-wr),wr=0)),no.S.h(dn,wr),jt=Math.max(jt,Qe),bt=Math.max(bt,Gt+(We===0?0:St)+vr.width),rn=Qe;Ee++}switch(0<We&&(y?(jt+=Math.max(0,x),dn<bt&&Pd(a,rt,bt-dn,0,Zn,ot-1),0<Mt&&(at||gf(a,Mt,0,0,ot-1),bt+=Mt)):(bt+=Math.max(0,x),rn<jt&&Pd(a,rt,0,jt-rn,Zn,ot-1),0<Mt&&(at||gf(a,0,Mt,0,ot-1),jt+=Mt))),Mt=at=0,rt){case Dc:y?at+=bt/2-a.focus.x-yt/2:Mt+=jt/2-a.focus.y-yt/2;break;case mf:0<We?y?at+=bt/2-a.focus.x-yt/2:Mt+=jt/2-a.focus.y-yt/2:y?(zn=tt[0].S.x+tt[0].la.x,at+=zn+(tt[ot-1].S.x+tt[ot-1].la.x+2*tt[ot-1].focus.x-zn)/2-a.focus.x-yt/2):(zn=tt[0].S.y+tt[0].la.y,Mt+=zn+(tt[ot-1].S.y+tt[ot-1].la.y+2*tt[ot-1].focus.y-zn)/2-a.focus.y-yt/2);break;case Ul:y?(at-=yt,bt+=yt):(Mt-=yt,jt+=yt);break;case Vl:y?(at+=bt-a.width+yt,bt+=yt):(Mt+=jt-a.height+yt,jt+=yt);break;case Ku:y?1<ot?at+=zn+mt/2-a.focus.x:at+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<ot?Mt+=zn+mt/2-a.focus.y:Mt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case Xu:y?at+=bt+mt/2-a.focus.x:Mt+=jt+mt/2-a.focus.y;break;case hu:break;default:jt=this.customAlignment(a,at,Mt,bt,jt),at=jt[0],Mt=jt[1],bt=jt[2],jt=jt[3]}for(yt=0;yt<ot;yt++)zn=tt[yt],y?zn.S.h(zn.S.x+zn.la.x-at,zn.S.y+(135<b?(ut?-jt:-zn.Da.height)+zn.la.y-x:Ot+x+zn.la.y)):zn.S.h(zn.S.x+(135<b?(ut?-bt:-zn.Da.width)+zn.la.x-x:E+x+zn.la.x),zn.S.y+zn.la.y-Mt);if(ot=tt=0,ut?y?(bt=Ty(a,bt,at),0>at&&(at=0),135<b&&(Mt+=jt+x),jt+=Ot+x,rt===hu&&(tt+=mt/2+a.focus.x),ot+=Ot+x):(135<b&&(at+=bt+x),bt+=E+x,jt=Fy(a,jt,Mt),0>Mt&&(Mt=0),rt===hu&&(ot+=mt/2+a.focus.y),tt+=E+x):y?(a.comments===null?E>bt&&(bt=by(rt,E-bt,0),tt=bt.x,ot=bt.y,bt=E,at=0):bt=Ty(a,bt,at),0>at&&(tt-=at,at=0),135<b&&(Mt+=jt+x),jt=Math.max(Math.max(jt,Ot),jt+Ot+x),ot+=Ot+x):(135<b&&(at+=bt+x),bt=Math.max(Math.max(bt,E),bt+E+x),a.comments===null?Ot>jt&&(jt=by(rt,0,Ot-jt),tt=jt.x,ot=jt.y,jt=Ot,Mt=0):jt=Fy(a,jt,Mt),0>Mt&&(ot-=Mt,Mt=0),tt+=E+x),0<We)b=js(this,4),We=js(this,4),y?(b[2].h(0,Ot+x),b[3].h(b[2].x,jt),We[2].h(bt,b[2].y),We[3].h(We[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(bt,b[2].y),We[2].h(b[2].x,jt),We[3].h(b[3].x,We[2].y));else{for(b=js(this,Wt.length+2),We=js(this,Kt.length+2),rt=0;rt<Wt.length;rt++)ut=Wt[rt],b[rt+2].h(ut.x+tt,ut.y+ot);for(rt=0;rt<Kt.length;rt++)ut=Kt[rt],We[rt+2].h(ut.x+tt,ut.y+ot)}y?(b[0].h(at,0),b[1].h(b[0].x,Ot),b[2].y<b[1].y&&(b[2].x>b[0].x?b[2].assign(b[1]):b[1].assign(b[2])),b[3].y<b[2].y&&(b[3].x>b[0].x?b[3].assign(b[2]):b[2].assign(b[3])),We[0].h(at+E,0),We[1].h(We[0].x,Ot),We[2].y<We[1].y&&(We[2].x<We[0].x?We[2].assign(We[1]):We[1].assign(We[2])),We[3].y<We[2].y&&(We[3].x<We[0].x?We[3].assign(We[2]):We[2].assign(We[3])),b[2].y-=x/2,We[2].y-=x/2):(b[0].h(0,Mt),b[1].h(E,b[0].y),b[2].x<b[1].x&&(b[2].y>b[0].y?b[2].assign(b[1]):b[1].assign(b[2])),b[3].x<b[2].x&&(b[3].y>b[0].y?b[3].assign(b[2]):b[2].assign(b[3])),We[0].h(0,Mt+Ot),We[1].h(E,We[0].y),We[2].x<We[1].x&&(We[2].y<We[0].y?We[2].assign(We[1]):We[1].assign(We[2])),We[3].x<We[2].x&&(We[3].y<We[0].y?We[3].assign(We[2]):We[2].assign(We[3])),b[2].x-=x/2,We[2].x-=x/2),dl(this,Wt),dl(this,Kt),a.Yo=b,a.kp=We,a.la.h(at,Mt),a.Da.h(bt,jt)}break;default:de("Unhandled compaction value "+a.compaction.toString())}}};function ux(a,y){if(y.childrenCount===0){var x=!1,E=0;y.parent!==null&&(E=y.parent.angle,x=y.parent.alignment,x=Rh(x));var b=Ny(y);y.S.h(0,0),y.Da.h(y.width,y.height),y.parent===null||y.comments===null||(E!==180&&E!==270||x)&&!b?y.la.h(0,0):E===180&&!x||(E===90||E===270)&&b?y.la.h(y.width-2*y.focus.x,0):y.la.h(0,y.height-2*y.focus.y)}else{E=el(y),x=E===90||E===270;var z=0;b=y.children;for(var tt=b.length,ot=0;ot<tt;ot++){var rt=b[ot];z=Math.max(z,x?rt.Da.width:rt.Da.height)}var at=y.alignment,ut=at===Ul,ct=at===Vl;ot=Rh(at);var mt=Math.max(0,y.breadthLimit);rt=a.computeLayerSpacing(y);var yt=y.nodeSpacing,St=a.computeNodeIndent(y),Mt=ut||ct?0:St/2,Ot=y.rowSpacing,bt=0;(ut||ct||y.hm||y.im&&y.maxGenerationCount===1)&&(bt=Math.max(0,y.rowIndent)),ut=y.width;var jt=y.height,Gt=0,Wt=0,Kt=0,$t=0,Qe=0,dn=0,rn=0,We=0,Ee=0,Zn=0;if(ot&&!yp(at)&&135<E&&b.reverse(),yp(at))if(1<tt)for(var zn=0;zn<tt;zn++){var Ri=b[zn],no=Ri.Da;zn%2===0&&zn!==tt-1?Ee=Math.max(Ee,(x?no.width:no.height)+a.computeBusNodeSpacing(Ri)-yt):zn%2!==0&&(Zn=Math.max(Zn,(x?no.width:no.height)+a.computeBusNodeSpacing(Ri)-yt))}else tt===1&&(Ee=x?b[0].Da.width:b[0].Da.height);if(ot)switch(at){case Ku:case Yl:Wt=135>E?hx(a,y,b,Ee,Gt,Wt):dx(a,y,b,Ee,Gt,Wt),Ee=Wt.x,Gt=Wt.width,Wt=Wt.height;break;case Xu:for(mt=0;mt<tt;mt++)Mt=b[mt],Kt=Mt.Da,Zn=rn===0?0:Ot,x?(Mt.S.h(z-Kt.width,Qe+Zn),Gt=Math.max(Gt,Kt.width),Wt=Math.max(Wt,Qe+Zn+Kt.height),Qe+=Zn+Kt.height):(Mt.S.h($t+Zn,z-Kt.height),Gt=Math.max(Gt,$t+Zn+Kt.width),Wt=Math.max(Wt,Kt.height),$t+=Zn+Kt.width),rn++;break;case hu:for(z=0;z<tt;z++)mt=b[z],Mt=mt.Da,Kt=rn===0?0:Ot,x?(mt.S.h(yt/2+y.focus.x,Qe+Kt),Gt=Math.max(Gt,Mt.width),Wt=Math.max(Wt,Qe+Kt+Mt.height),Qe+=Kt+Mt.height):(mt.S.h($t+Kt,yt/2+y.focus.y),Gt=Math.max(Gt,$t+Kt+Mt.width),Wt=Math.max(Wt,Mt.height),$t+=Kt+Mt.width),rn++}else for(Zn=0;Zn<tt;Zn++)zn=b[Zn],Ri=zn.Da,x?(0<mt&&0<rn&&$t+yt+Ri.width>mt&&($t<z&&Pd(y,at,z-$t,0,We,Zn-1),dn++,rn=0,We=Zn,Kt=Wt,$t=0,Qe=135<E?-Wt-Ot:Wt+Ot),no=rn===0?Mt:yt,F0(a,zn,0,Qe),zn.S.h($t+no,Qe),Gt=Math.max(Gt,$t+no+Ri.width),Wt=Math.max(Wt,Kt+(dn===0?0:Ot)+Ri.height),$t+=no+Ri.width):(0<mt&&0<rn&&Qe+yt+Ri.height>mt&&(Qe<z&&Pd(y,at,0,z-Qe,We,Zn-1),dn++,rn=0,We=Zn,Kt=Gt,Qe=0,$t=135<E?-Gt-Ot:Gt+Ot),no=rn===0?Mt:yt,F0(a,zn,$t,0),zn.S.h($t,Qe+no),Wt=Math.max(Wt,Qe+no+Ri.height),Gt=Math.max(Gt,Kt+(dn===0?0:Ot)+Ri.width),Qe+=no+Ri.height),rn++;switch(0<dn&&(x?(Wt+=Math.max(0,rt),$t<Gt&&Pd(y,at,Gt-$t,0,We,tt-1),0<bt&&(ct||gf(y,bt,0,0,tt-1),Gt+=bt)):(Gt+=Math.max(0,rt),Qe<Wt&&Pd(y,at,0,Wt-Qe,We,tt-1),0<bt&&(ct||gf(y,0,bt,0,tt-1),Wt+=bt))),bt=ct=0,at){case Dc:x?ct+=Gt/2-y.focus.x-St/2:bt+=Wt/2-y.focus.y-St/2;break;case mf:0<dn?x?ct+=Gt/2-y.focus.x-St/2:bt+=Wt/2-y.focus.y-St/2:x?(a=b[0].S.x+b[0].la.x,ct+=a+(b[tt-1].S.x+b[tt-1].la.x+2*b[tt-1].focus.x-a)/2-y.focus.x-St/2):(a=b[0].S.y+b[0].la.y,bt+=a+(b[tt-1].S.y+b[tt-1].la.y+2*b[tt-1].focus.y-a)/2-y.focus.y-St/2);break;case Ul:x?(ct-=St,Gt+=St):(bt-=St,Wt+=St);break;case Vl:x?(ct+=Gt-y.width+St,Gt+=St):(bt+=Wt-y.height+St,Wt+=St);break;case Ku:case Yl:x?1<tt?ct+=Ee+yt/2-y.focus.x:ct+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?bt+=Ee+yt/2-y.focus.y:bt+=b[0].focus.y-y.focus.y+b[0].la.y;break;case Xu:x?ct+=Gt+yt/2-y.focus.x:bt+=Wt+yt/2-y.focus.y;break;case hu:break;default:a=a.customAlignment(y,ct,bt,Gt,Wt),ct=a[0],bt=a[1],Gt=a[2],Wt=a[3]}for(a=0;a<tt;a++)St=b[a],x?St.S.h(St.S.x+St.la.x-ct,St.S.y+(135<E?(ot?-Wt:-St.Da.height)+St.la.y-rt:jt+rt+St.la.y)):St.S.h(St.S.x+(135<E?(ot?-Gt:-St.Da.width)+St.la.x-rt:ut+rt+St.la.x),St.S.y+St.la.y-bt);x?(Gt=Ty(y,Gt,ct),0>ct&&(ct=0),135<E&&(bt+=Wt+rt),Wt=Math.max(Math.max(Wt,jt),Wt+jt+rt)):(135<E&&(ct+=Gt+rt),Gt=Math.max(Math.max(Gt,ut),Gt+ut+rt),Wt=Fy(y,Wt,bt),0>bt&&(bt=0)),y.la.h(ct,bt),y.Da.h(Gt,Wt)}}yi.prototype.customAlignment=function(a,y,x,E,b){return[y,x,E,b]};function hx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new pe(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new pe(E,0,b,z);for(var ot=y.nodeSpacing,rt=y.rowSpacing,at=el(y)===90,ut=0,ct=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var St=x[yt],Mt=St.Da,Ot=ut===0?0:rt;if(at){var bt=a.computeBusNodeSpacing(St)-ot;St.S.h(E-(Mt.width+bt),mt+Ot),b=Math.max(b,Mt.width+bt),z=Math.max(z,mt+Ot+Mt.height),mt+=Ot+Mt.height}else bt=a.computeBusNodeSpacing(St)-ot,St.S.h(ct+Ot,E-(Mt.height+bt)),z=Math.max(z,Mt.height+bt),b=Math.max(b,ct+Ot+Mt.width),ct+=Ot+Mt.width;ut++}for(ut=0,St=ct,yt=mt,at?(ct=E+ot,mt=0):(ct=0,mt=E+ot),Mt=0;Mt<tt;Mt++)if(Mt%2!==0){Ot=x[Mt],bt=Ot.Da;var jt=ut===0?0:rt;if(at){var Gt=a.computeBusNodeSpacing(Ot)-ot;Ot.S.h(ct+Gt,mt+jt),b=Math.max(b,ct+bt.width+Gt),z=Math.max(z,mt+jt+bt.height),mt+=jt+bt.height}else Gt=a.computeBusNodeSpacing(Ot)-ot,Ot.S.h(ct+jt,mt+Gt),b=Math.max(b,ct+jt+bt.width),z=Math.max(z,mt+bt.height+Gt),ct+=jt+bt.width;ut++}return 1<tt&&tt%2===1&&(x=x[tt-1],tt=x.Da,a=a.computeBusLastRowSpacing(x,at?Math.max(Math.abs(yt),Math.abs(mt)):Math.max(Math.abs(St),Math.abs(ct))),at?(x.S.h(E+ot/2-x.focus.x-x.la.x,z+a),at=E+ot/2-x.focus.x-x.la.x,b=Math.max(b,at+tt.width),0>at&&(b-=at),z=Math.max(z,Math.max(yt,mt)+a+tt.height),0>x.S.x&&(E=T0(y,x.S.x,!1,E,ot))):(x.S.h(b+a,E+ot/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(St,ct)+a+tt.width),mt=E+ot/2-x.focus.y-x.la.y,z=Math.max(z,mt+tt.height),0>mt&&(z-=mt),0>x.S.y&&(E=T0(y,x.S.y,!0,E,ot)))),new pe(E,0,b,z)}function dx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new pe(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new pe(E,0,b,z);for(var ot=y.nodeSpacing,rt=y.rowSpacing,at=el(y)===270,ut=0,ct=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var St=x[yt],Mt=St.Da,Ot=ut===0?0:rt;if(at){var bt=a.computeBusNodeSpacing(St)-ot;mt-=Ot+Mt.height,St.S.h(E-(Mt.width+bt),mt),b=Math.max(b,Mt.width+bt),z=Math.max(z,Math.abs(mt))}else bt=a.computeBusNodeSpacing(St)-ot,ct-=Ot+Mt.width,St.S.h(ct,E-(Mt.height+bt)),z=Math.max(z,Mt.height+bt),b=Math.max(b,Math.abs(ct));ut++}for(ut=0,St=ct,yt=mt,at?(ct=E+ot,mt=0):(ct=0,mt=E+ot),Mt=0;Mt<tt;Mt++)if(Mt%2!==0){Ot=x[Mt],bt=Ot.Da;var jt=ut===0?0:rt;if(at){var Gt=a.computeBusNodeSpacing(Ot)-ot;mt-=jt+bt.height,Ot.S.h(ct+Gt,mt),b=Math.max(b,ct+bt.width+Gt),z=Math.max(z,Math.abs(mt))}else Gt=a.computeBusNodeSpacing(Ot)-ot,ct-=jt+bt.width,Ot.S.h(ct,mt+Gt),z=Math.max(z,mt+bt.height+Gt),b=Math.max(b,Math.abs(ct));ut++}for(1<tt&&tt%2===1&&(rt=x[tt-1],ut=rt.Da,a=a.computeBusLastRowSpacing(rt,at?Math.max(Math.abs(yt),Math.abs(mt)):Math.max(Math.abs(St),Math.abs(ct))),at?(rt.S.h(E+ot/2-rt.focus.x-rt.la.x,-z-ut.height-a),ct=E+ot/2-rt.focus.x-rt.la.x,b=Math.max(b,ct+ut.width),0>ct&&(b-=ct),z=Math.max(z,Math.abs(Math.min(yt,mt))+a+ut.height),0>rt.S.x&&(E=T0(y,rt.S.x,!1,E,ot))):(rt.S.h(-b-ut.width-a,E+ot/2-rt.focus.y-rt.la.y),b=Math.max(b,Math.abs(Math.min(St,ct))+a+ut.width),mt=E+ot/2-rt.focus.y-rt.la.y,z=Math.max(z,mt+ut.height),0>mt&&(z-=mt),0>rt.S.y&&(E=T0(y,rt.S.y,!0,E,ot)))),y=0;y<tt;y++)ot=x[y],at?ot.S.h(ot.S.x,ot.S.y+z):ot.S.h(ot.S.x+b,ot.S.y);return new pe(E,0,b,z)}yi.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},yi.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function T0(a,y,x,E,b){a=a.children;for(var z=a.length,tt=0;tt<z;tt++)x?a[tt].S.h(a[tt].S.x,a[tt].S.y-y):a[tt].S.h(a[tt].S.x-y,a[tt].S.y);return y=a[z-1],Math.max(E,x?y.la.y+y.focus.y-b/2:y.la.x+y.focus.x-b/2)}function Ty(a,y,x){switch(a.alignment){case mf:case Dc:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case Ul:return a.width>y?a.width:y;case Vl:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case Ku:case Yl:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case Xu:return a.width-a.focus.x+a.nodeSpacing/2+y;case hu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function Fy(a,y,x){switch(a.alignment){case mf:case Dc:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case Ul:return a.height>y?a.height:y;case Vl:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case Ku:case Yl:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case Xu:return a.height-a.focus.y+a.nodeSpacing/2+y;case hu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function by(a,y,x){switch(a){case Dc:y/=2,x/=2;break;case mf:y/=2,x/=2;break;case Ul:x=y=0;break;case Vl:break;default:de("Unhandled alignment value "+a.toString())}return new At(y,x)}function Pd(a,y,x,E,b,z){y=by(y,x,E),gf(a,y.x,y.y,b,z)}function gf(a,y,x,E,b){if(y!==0||x!==0)for(a=a.children;E<=b;E++){var z=a[E].S;z.x+=y,z.y+=x}}function F0(a,y,x,E){var b=y.parent;switch(a.ud){case Wl:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case pf:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:de("Unhandled path value "+a.ud.toString())}}function b0(a,y,x){for(var E=0;E<a.length;E++){var b=a[E];b.x+=y,b.y+=x}}function fx(a,y,x,E,b,z,tt,ot){var rt=el(y),at=rt===90||rt===270,ut=y.nodeSpacing;y=E;var ct=b;E=z;var mt=tt,yt=x.Yo,St=x.kp;tt=x.Da;var Mt=at?Math.max(mt,tt.height):Math.max(E,tt.width);if((yt===null||rt!==el(x))&&(yt=js(a,2),St=js(a,2),at?(yt[0].h(0,0),yt[1].h(0,tt.height),St[0].h(tt.width,0),St[1].h(St[0].x,yt[1].y)):(yt[0].h(0,0),yt[1].h(tt.width,0),St[0].h(0,tt.height),St[1].h(yt[1].x,St[0].y))),at){if(mt=9999999,!(ct===null||2>ct.length||yt===null||2>yt.length))for(b=x=0;x<ct.length&&b<yt.length;){z=ct[x];var Ot=yt[b];rt=Ot.x,at=Ot.y,rt+=E;var bt=z;x+1<ct.length&&(bt=ct[x+1]);var jt=Ot;Ot=jt.x,jt=jt.y,b+1<yt.length&&(jt=yt[b+1],Ot=jt.x,jt=jt.y,Ot+=E);var Gt=mt;z.y===at?Gt=rt-z.x:z.y>at&&z.y<jt?Gt=rt+(z.y-at)/(jt-at)*(Ot-rt)-z.x:at>z.y&&at<bt.y&&(Gt=rt-(z.x+(at-z.y)/(bt.y-z.y)*(bt.x-z.x))),Gt<mt&&(mt=Gt),bt.y<=z.y?x++:jt<=at?b++:(bt.y<=jt&&x++,jt<=bt.y&&b++)}if(mt=E-mt,mt+=ut,x=yt,b=mt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=js(a,y.length+x.length),E=z=rt=0;z<x.length&&x[z].y<y[0].y;)at=x[z++],ut[E++].h(at.x+b,at.y);for(;rt<y.length;)at=y[rt++],ut[E++].h(at.x,at.y);for(rt=y[y.length-1].y;z<x.length&&x[z].y<=rt;)z++;for(;z<x.length&&x[z].y>rt;)at=x[z++],ut[E++].h(at.x+b,at.y);for(x=js(a,E),rt=0;rt<E;rt++)x[rt].assign(ut[rt]);dl(a,ut),E=x}if(z=St,rt=mt,ct===null||2>ct.length||z===null||2>z.length)b=null;else{for(ut=js(a,ct.length+z.length),b=at=x=0;x<ct.length&&ct[x].y<z[0].y;)bt=ct[x++],ut[b++].h(bt.x,bt.y);for(;at<z.length;)bt=z[at++],ut[b++].h(bt.x+rt,bt.y);for(z=z[z.length-1].y;x<ct.length&&ct[x].y<=z;)x++;for(;x<ct.length&&ct[x].y>z;)rt=ct[x++],ut[b++].h(rt.x,rt.y);for(z=js(a,b),x=0;x<b;x++)z[x].assign(ut[x]);dl(a,ut),b=z}return z=Math.max(0,mt)+tt.width,tt=Mt,dl(a,y),dl(a,yt),dl(a,ct),dl(a,St),ot[0]=E,ot[1]=b,new pe(mt,0,z,tt)}if(E=9999999,!(ct===null||2>ct.length||yt===null||2>yt.length))for(b=x=0;x<ct.length&&b<yt.length;)z=ct[x],Ot=yt[b],rt=Ot.x,at=Ot.y,at+=mt,bt=z,x+1<ct.length&&(bt=ct[x+1]),jt=Ot,Ot=jt.x,jt=jt.y,b+1<yt.length&&(jt=yt[b+1],Ot=jt.x,jt=jt.y,jt+=mt),Gt=E,z.x===rt?Gt=at-z.y:z.x>rt&&z.x<Ot?Gt=at+(z.x-rt)/(Ot-rt)*(jt-at)-z.y:rt>z.x&&rt<bt.x&&(Gt=at-(z.y+(rt-z.x)/(bt.x-z.x)*(bt.y-z.y))),Gt<E&&(E=Gt),bt.x<=z.x?x++:Ot<=rt?b++:(bt.x<=Ot&&x++,Ot<=bt.x&&b++);if(mt-=E,mt+=ut,x=yt,b=mt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=js(a,y.length+x.length),E=z=rt=0;z<x.length&&x[z].x<y[0].x;)at=x[z++],ut[E++].h(at.x,at.y+b);for(;rt<y.length;)at=y[rt++],ut[E++].h(at.x,at.y);for(rt=y[y.length-1].x;z<x.length&&x[z].x<=rt;)z++;for(;z<x.length&&x[z].x>rt;)at=x[z++],ut[E++].h(at.x,at.y+b);for(x=js(a,E),rt=0;rt<E;rt++)x[rt].assign(ut[rt]);dl(a,ut),E=x}if(z=St,rt=mt,ct===null||2>ct.length||z===null||2>z.length)b=null;else{for(ut=js(a,ct.length+z.length),b=at=x=0;x<ct.length&&ct[x].x<z[0].x;)bt=ct[x++],ut[b++].h(bt.x,bt.y);for(;at<z.length;)bt=z[at++],ut[b++].h(bt.x,bt.y+rt);for(z=z[z.length-1].x;x<ct.length&&ct[x].x<=z;)x++;for(;x<ct.length&&ct[x].x>z;)rt=ct[x++],ut[b++].h(rt.x,rt.y);for(z=js(a,b),x=0;x<b;x++)z[x].assign(ut[x]);dl(a,ut),b=z}return z=Mt,tt=Math.max(0,mt)+tt.height,dl(a,y),dl(a,yt),dl(a,ct),dl(a,St),ot[0]=E,ot[1]=b,new pe(mt,0,z,tt)}function js(a,y){if(a=a.ru[y],a!==void 0&&(a=a.pop(),a!==void 0))return a;a=[];for(var x=0;x<y;x++)a[x]=new At;return a}function dl(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}yi.prototype.arrangeTrees=function(){if(this.Rb===I0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof Ga){var x=y.node;if(x!==null){var E=x.position;x=E.x,E=E.y,isFinite(x)||(x=0),isFinite(E)||(E=0),Ay(this,y,x,E)}}}else{for(a=[],y=this.Ub.iterator;y.next();)x=y.value,x instanceof Ga&&a.push(x);switch(this.sorting){case Bc:break;case Sp:a.reverse();break;case xp:a.sort(this.comparer);break;case Pp:a.sort(this.comparer),a.reverse();break;default:de("Unhandled sorting value "+this.sorting.toString())}for(x=this.arrangementOrigin,y=x.x,x=x.y,E=0;E<a.length;E++){var b=a[E];switch(Ay(this,b,y+b.la.x,x+b.la.y),this.Rb){case O0:x+=b.Da.height+this.$d.height;break;case Iy:y+=b.Da.width+this.$d.width;break;default:de("Unhandled arrangement value "+this.Rb.toString())}}}};function Ay(a,y,x,E){if(y!==null){y.x=x,y.y=E,y=y.children;for(var b=y.length,z=0;z<b;z++){var tt=y[z];Ay(a,tt,x+tt.S.x,E+tt.S.y)}}}yi.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},yi.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},yi.prototype.Gu=function(){if(this.layerStyle===R0){for(var a=this.$v,y=[],x=null,E=this.network.vertexes.iterator;E.next();){var b=E.value;x===null?x=b.bounds.copy():x.ed(b.bounds);var z=y[b.level];z===void 0?z=this.computeLayerSpacing(b):z=Math.max(z,this.computeLayerSpacing(b)),y[b.level]=z}for(E=0;E<y.length;E++)y[E]===void 0&&(y[E]=0);if(this.angle===90||this.angle===270?(x.Bc(this.nodeSpacing/2,this.layerSpacing),E=new At(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new At(-this.layerSpacing/2,-this.nodeSpacing/2)),b=[],x=this.angle===90||this.angle===270?x.width:x.height,z=0,this.angle===180||this.angle===270)for(var tt=0;tt<a.length;tt++)z+=a[tt]+y[tt];for(tt=0;tt<a.length;tt++){var ot=a[tt]+y[tt];this.angle===270?(z-=ot,b.push(new pe(0,z,x,ot))):this.angle===90?(b.push(new pe(0,z,x,ot)),z+=ot):this.angle===180?(z-=ot,b.push(new pe(z,0,ot,x))):(b.push(new pe(z,0,ot,x)),z+=ot)}this.commitLayers(b,E)}},yi.prototype.commitLayers=function(){},yi.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},yi.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof Ga&&cx(this,y)}};function cx(a,y){if(y!==null){a.setPortSpots(y),y=y.children;for(var x=y.length,E=0;E<x;E++)cx(a,y[E])}}yi.prototype.setPortSpots=function(a){var y=a.alignment;if(Rh(y)){var x=this.ud===Wl,E=el(a);switch(E){case 0:var b=Jr;break;case 90:b=Ls;break;case 180:b=Xs;break;default:b=Ks}var z=a.children,tt=z.length;switch(y){case Ku:case Yl:for(y=0;y<tt;y++){var ot=z[y];if(ot=(x?ot.sourceEdges:ot.destinationEdges).first(),ot!==null&&(ot=ot.link,ot!==null)){var rt=E===90||E===270?Xs:Ks;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:rt=Xs;break;case 90:rt=Ks;break;case 180:rt=Jr;break;default:rt=Ls}else y%2===0&&(rt=E===90||E===270?Jr:Ls);x?(a.setsPortSpot&&(ot.fromSpot=b),a.setsChildPortSpot&&(ot.toSpot=rt)):(a.setsPortSpot&&(ot.fromSpot=rt),a.setsChildPortSpot&&(ot.toSpot=b))}}break;case Xu:for(E=E===90||E===270?Jr:Ls,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)));break;case hu:for(E=E===90||E===270?Xs:Ks,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)))}}else if(x=el(a),this.ud===Wl){for(b=a.destinationEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.fromSpot=Jr;break;case 90:E.fromSpot=Ls;break;case 180:E.fromSpot=Xs;break;default:E.fromSpot=Ks}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=Xs;break;case 90:E.toSpot=Ks;break;case 180:E.toSpot=Jr;break;default:E.toSpot=Ls}else E.toSpot=a.childPortSpot}}else for(b=a.sourceEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.toSpot=Jr;break;case 90:E.toSpot=Ls;break;case 180:E.toSpot=Xs;break;default:E.toSpot=Ks}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=Xs;break;case 90:E.fromSpot=Ks;break;case 180:E.fromSpot=Jr;break;default:E.fromSpot=Ls}else E.fromSpot=a.childPortSpot}};function el(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}yi.prototype.computeLayerSpacing=function(a){var y=el(a);y=y===90||y===270;var x=a.layerSpacing;if(0<a.layerSpacingParentOverlap){var E=Math.min(1,a.layerSpacingParentOverlap);x-=y?a.height*E:a.width*E}return x<(y?-a.height:-a.width)&&(x=y?-a.height:-a.width),x},yi.prototype.computeNodeIndent=function(a){var y=el(a),x=a.nodeIndent;if(0<a.nodeIndentPastParent){var E=Math.min(1,a.nodeIndentPastParent);x+=y===90||y===270?a.width*E:a.height*E}return x=Math.max(0,x)},Ie.Object.defineProperties(yi.prototype,{roots:{get:function(){return this.Ub},set:function(a){this.Ub!==a&&(this.Ub=a,this.C())}},path:{get:function(){return this.Wn},set:function(a){this.Wn!==a&&(this.Wn=a,this.C())}},treeStyle:{get:function(){return this.vo},set:function(a){this.Rb===a||a!==D0&&a!==Dy&&a!==By&&a!==Oy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==Ry&&a!==jy&&a!==R0||(this.Bq=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==O0&&a!==Iy&&a!==I0||(this.Rb=a,this.C())}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},rootDefaults:{get:function(){return this.W},set:function(a){this.W!==a&&(this.W=a,this.C())}},alternateDefaults:{get:function(){return this.Y},set:function(a){this.Y!==a&&(this.Y=a,this.C())}},sorting:{get:function(){return this.W.sorting},set:function(a){this.W.sorting===a||a!==Bc&&a!==Sp&&a!==xp&&!Pp||(this.W.sorting=a,this.C())}},comparer:{get:function(){return this.W.comparer},set:function(a){this.W.comparer!==a&&(this.W.comparer=a,this.C())}},angle:{get:function(){return this.W.angle},set:function(a){this.W.angle!==a&&(a===0||a===90||a===180||a===270?(this.W.angle=a,this.C()):de("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.W.alignment},set:function(a){this.W.alignment!==a&&(this.W.alignment=a,this.C())}},nodeIndent:{get:function(){return this.W.nodeIndent},set:function(a){this.W.nodeIndent!==a&&0<=a&&(this.W.nodeIndent=a,this.C())}},nodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(a){this.W.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.W.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!==a&&(this.W.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==B0&&a!==wp||(this.W.compaction=a,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!==a&&(this.W.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.D(a)||(this.W.portSpot=a,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.D(a)||(this.W.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(a){this.Y.sorting===a||a!==Bc&&a!==Sp&&a!==xp&&!Pp||(this.Y.sorting=a,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(this.Y.comparer=a,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(a){this.Y.angle===a||a!==0&&a!==90&&a!==180&&a!==270||(this.Y.angle=a,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!==a&&(this.Y.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&0<=a&&(this.Y.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(a){this.Y.nodeSpacing!==a&&(this.Y.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(this.Y.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(a){this.Y.compaction===a||a!==B0&&a!==wp||(this.Y.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(a){this.Y.breadthLimit!==a&&0<=a&&(this.Y.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(this.Y.rowSpacing=a,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&0<=a&&(this.Y.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(this.Y.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(this.Y.commentMargin=a,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(this.Y.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(a){this.Y.portSpot.D(a)||(this.Y.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(this.Y.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(a){this.Y.childPortSpot.D(a)||(this.Y.childPortSpot=a,this.C())}}});var A0=new ae(yi,"PathDefault",-1),Wl=new ae(yi,"PathDestination",0),pf=new ae(yi,"PathSource",1),Bc=new ae(yi,"SortingForwards",10),Sp=new ae(yi,"SortingReverse",11),xp=new ae(yi,"SortingAscending",12),Pp=new ae(yi,"SortingDescending",13),Dc=new ae(yi,"AlignmentCenterSubtrees",20),mf=new ae(yi,"AlignmentCenterChildren",21),Ul=new ae(yi,"AlignmentStart",22),Vl=new ae(yi,"AlignmentEnd",23),Ku=new ae(yi,"AlignmentBus",24),Yl=new ae(yi,"AlignmentBusBranching",25),Xu=new ae(yi,"AlignmentTopLeftBus",26),hu=new ae(yi,"AlignmentBottomRightBus",27),B0=new ae(yi,"CompactionNone",30),wp=new ae(yi,"CompactionBlock",31),D0=new ae(yi,"StyleLayered",40),By=new ae(yi,"StyleLastParents",41),Dy=new ae(yi,"StyleAlternating",42),Oy=new ae(yi,"StyleRootOnly",43),O0=new ae(yi,"ArrangementVertical",50),Iy=new ae(yi,"ArrangementHorizontal",51),I0=new ae(yi,"ArrangementFixedRoots",52),Ry=new ae(yi,"LayerIndividual",60),jy=new ae(yi,"LayerSiblings",61),R0=new ae(yi,"LayerUniform",62);yi.className="TreeLayout",yi.PathDefault=A0,yi.PathDestination=Wl,yi.PathSource=pf,yi.SortingForwards=Bc,yi.SortingReverse=Sp,yi.SortingAscending=xp,yi.SortingDescending=Pp,yi.AlignmentCenterSubtrees=Dc,yi.AlignmentCenterChildren=mf,yi.AlignmentStart=Ul,yi.AlignmentEnd=Vl,yi.AlignmentBus=Ku,yi.AlignmentBusBranching=Yl,yi.AlignmentTopLeftBus=Xu,yi.AlignmentBottomRightBus=hu,yi.CompactionNone=B0,yi.CompactionBlock=wp,yi.StyleLayered=D0,yi.StyleLastParents=By,yi.StyleAlternating=Dy,yi.StyleRootOnly=Oy,yi.ArrangementVertical=O0,yi.ArrangementHorizontal=Iy,yi.ArrangementFixedRoots=I0,yi.LayerIndividual=Ry,yi.LayerSiblings=jy,yi.LayerUniform=R0;function vf(a){oo.call(this,a)}ee(vf,oo),vf.prototype.createVertex=function(){return new Ga(this)},vf.prototype.createEdge=function(){return new Oc(this)},vf.className="TreeNetwork";function Ga(a){ur.call(this,a),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new At(0,0),this.Da=new Le(0,0),this.la=new At(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Bc,this.hd=oy,this.Kb=0,this.Jb=mf,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=wp,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=Ir,this.wr=!0,this.Dp=Ir}ee(Ga,ur),Ga.prototype.copyInheritedPropertiesFrom=function(a){a!==null&&(this.nd=a.sorting,this.hd=a.comparer,this.Kb=a.angle,this.Jb=a.alignment,this.Uq=a.nodeIndent,this.Vq=a.nodeIndentPastParent,this.Wq=a.nodeSpacing,this.ie=a.layerSpacing,this.Aq=a.layerSpacingParentOverlap,this.Hp=a.compaction,this.Ap=a.breadthLimit,this.nr=a.rowSpacing,this.mr=a.rowIndent,this.Gp=a.commentSpacing,this.Fp=a.commentMargin,this.xr=a.setsPortSpot,this.dr=a.portSpot,this.wr=a.setsChildPortSpot,this.Dp=a.childPortSpot)},Ie.Object.defineProperties(Ga.prototype,{initialized:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},parent:{get:function(){return this.hb},set:function(a){this.hb!==a&&(this.hb=a)}},children:{get:function(){return this.u},set:function(a){if(this.u!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.u=a}}},level:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},descendantCount:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},maxChildrenCount:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},maxGenerationCount:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a)}},comments:{get:function(){return this.td},set:function(a){if(this.td!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.td=a}}},sorting:{get:function(){return this.nd},set:function(a){this.nd!==a&&(this.nd=a)}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a)}},angle:{get:function(){return this.Kb},set:function(a){this.Kb!==a&&(this.Kb=a)}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb!==a&&(this.Jb=a)}},nodeIndent:{get:function(){return this.Uq},set:function(a){this.Uq!==a&&(this.Uq=a)}},nodeIndentPastParent:{get:function(){return this.Vq},set:function(a){this.Vq!==a&&(this.Vq=a)}},nodeSpacing:{get:function(){return this.Wq},set:function(a){this.Wq!==a&&(this.Wq=a)}},layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&(this.ie=a)}},layerSpacingParentOverlap:{get:function(){return this.Aq},set:function(a){this.Aq!==a&&(this.Aq=a)}},compaction:{get:function(){return this.Hp},set:function(a){this.Hp!==a&&(this.Hp=a)}},breadthLimit:{get:function(){return this.Ap},set:function(a){this.Ap!==a&&(this.Ap=a)}},rowSpacing:{get:function(){return this.nr},set:function(a){this.nr!==a&&(this.nr=a)}},rowIndent:{get:function(){return this.mr},set:function(a){this.mr!==a&&(this.mr=a)}},commentSpacing:{get:function(){return this.Gp},set:function(a){this.Gp!==a&&(this.Gp=a)}},commentMargin:{get:function(){return this.Fp},set:function(a){this.Fp!==a&&(this.Fp=a)}},setsPortSpot:{get:function(){return this.xr},set:function(a){this.xr!==a&&(this.xr=a)}},portSpot:{get:function(){return this.dr},set:function(a){this.dr.D(a)||(this.dr=a)}},setsChildPortSpot:{get:function(){return this.wr},set:function(a){this.wr!==a&&(this.wr=a)}},childPortSpot:{get:function(){return this.Dp},set:function(a){this.Dp.D(a)||(this.Dp=a)}},childrenCount:{get:function(){return this.children.length}},relativePosition:{get:function(){return this.S},set:function(a){this.S.set(a)}},subtreeSize:{get:function(){return this.Da},set:function(a){this.Da.set(a)}},subtreeOffset:{get:function(){return this.la},set:function(a){this.la.set(a)}}}),Ga.className="TreeVertex";function Oc(a){ta.call(this,a),this.$t=new At(0,0)}ee(Oc,ta),Oc.prototype.commit=function(){var a=this.link;if(a!==null&&!a.isAvoiding){var y=this.network.layout,x=null,E=null;switch(y.ud){case Wl:x=this.fromVertex,E=this.toVertex;break;case pf:x=this.toVertex,E=this.fromVertex;break;default:de("Unhandled path value "+y.ud.toString())}if(x!==null&&E!==null){var b=this.$t;if(b.x!==0||b.y!==0||x.qA){E=x.bounds;var z=el(x),tt=y.computeLayerSpacing(x),ot=x.rowSpacing;a.vg();var rt=a.curve===ca,at=a.isOrthogonal,ut;if(a.uh(),at||rt){for(ut=2;4<a.pointsCount;)a.pv(2);var ct=a.i(1),mt=a.i(2)}else{for(ut=1;3<a.pointsCount;)a.pv(1);ct=a.i(0),mt=a.i(a.pointsCount-1)}var yt=a.i(a.pointsCount-1);z===0?(x.alignment===Vl?(z=E.bottom+b.y,b.y===0&&ct.y>yt.y+x.rowIndent&&(z=Math.min(z,Math.max(ct.y,z-y.computeNodeIndent(x))))):x.alignment===Ul?(z=E.top+b.y,b.y===0&&ct.y<yt.y-x.rowIndent&&(z=Math.max(z,Math.min(ct.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,rt?(a.m(ut,ct.x,z),ut++,a.m(ut,E.right+tt,z),ut++,a.m(ut,E.right+tt+(b.x-ot)/3,z),ut++,a.m(ut,E.right+tt+2*(b.x-ot)/3,z),ut++,a.m(ut,E.right+tt+(b.x-ot),z),ut++,a.m(ut,mt.x,z)):(at&&(a.m(ut,E.right+tt/2,ct.y),ut++),a.m(ut,E.right+tt/2,z),ut++,a.m(ut,E.right+tt+b.x-(at?ot/2:ot),z),ut++,at&&a.m(ut,a.i(ut-1).x,mt.y))):z===90?(x.alignment===Vl?(z=E.right+b.x,b.x===0&&ct.x>yt.x+x.rowIndent&&(z=Math.min(z,Math.max(ct.x,z-y.computeNodeIndent(x))))):x.alignment===Ul?(z=E.left+b.x,b.x===0&&ct.x<yt.x-x.rowIndent&&(z=Math.max(z,Math.min(ct.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,rt?(a.m(ut,z,ct.y),ut++,a.m(ut,z,E.bottom+tt),ut++,a.m(ut,z,E.bottom+tt+(b.y-ot)/3),ut++,a.m(ut,z,E.bottom+tt+2*(b.y-ot)/3),ut++,a.m(ut,z,E.bottom+tt+(b.y-ot)),ut++,a.m(ut,z,mt.y)):(at&&(a.m(ut,ct.x,E.bottom+tt/2),ut++),a.m(ut,z,E.bottom+tt/2),ut++,a.m(ut,z,E.bottom+tt+b.y-(at?ot/2:ot)),ut++,at&&a.m(ut,mt.x,a.i(ut-1).y))):z===180?(x.alignment===Vl?(z=E.bottom+b.y,b.y===0&&ct.y>yt.y+x.rowIndent&&(z=Math.min(z,Math.max(ct.y,z-y.computeNodeIndent(x))))):x.alignment===Ul?(z=E.top+b.y,b.y===0&&ct.y<yt.y-x.rowIndent&&(z=Math.max(z,Math.min(ct.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,rt?(a.m(ut,ct.x,z),ut++,a.m(ut,E.left-tt,z),ut++,a.m(ut,E.left-tt+(b.x+ot)/3,z),ut++,a.m(ut,E.left-tt+2*(b.x+ot)/3,z),ut++,a.m(ut,E.left-tt+(b.x+ot),z),ut++,a.m(ut,mt.x,z)):(at&&(a.m(ut,E.left-tt/2,ct.y),ut++),a.m(ut,E.left-tt/2,z),ut++,a.m(ut,E.left-tt+b.x+(at?ot/2:ot),z),ut++,at&&a.m(ut,a.i(ut-1).x,mt.y))):z===270?(x.alignment===Vl?(z=E.right+b.x,b.x===0&&ct.x>yt.x+x.rowIndent&&(z=Math.min(z,Math.max(ct.x,z-y.computeNodeIndent(x))))):x.alignment===Ul?(z=E.left+b.x,b.x===0&&ct.x<yt.x-x.rowIndent&&(z=Math.max(z,Math.min(ct.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,rt?(a.m(ut,z,ct.y),ut++,a.m(ut,z,E.top-tt),ut++,a.m(ut,z,E.top-tt+(b.y+ot)/3),ut++,a.m(ut,z,E.top-tt+2*(b.y+ot)/3),ut++,a.m(ut,z,E.top-tt+(b.y+ot)),ut++,a.m(ut,z,mt.y)):(at&&(a.m(ut,ct.x,E.top-tt/2),ut++),a.m(ut,z,E.top-tt/2),ut++,a.m(ut,z,E.top-tt+b.y+(at?ot/2:ot)),ut++,at&&a.m(ut,mt.x,a.i(ut-1).y))):de("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=el(x),y!==el(b)&&(tt=E.computeLayerSpacing(x),ot=x.bounds,x=b.bounds,y===0&&x.left-ot.right<tt+1||y===90&&x.top-ot.bottom<tt+1||y===180&&ot.left-x.right<tt+1||y===270&&ot.top-x.bottom<tt+1||(a.vg(),x=a.curve===ca,b=a.isOrthogonal,E=Rh(this.fromVertex.alignment),a.uh(),y===0?(y=ot.right+tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y-20,a.i(1).y),a.m(2,y-20,x),a.m(3,y,x),a.m(4,y+20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===90?(y=ot.bottom+tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y-20),a.m(2,x,y-20),a.m(3,x,y),a.m(4,x,y+20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)):y===180?(y=ot.left-tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y+20,a.i(1).y),a.m(2,y+20,x),a.m(3,y,x),a.m(4,y-20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===270&&(y=ot.top-tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y+20),a.m(2,x,y+20),a.m(3,x,y),a.m(4,x,y-20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)),a.zf()))}}},Ie.Object.defineProperties(Oc.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},relativePoint:{get:function(){return this.$t},set:function(a){this.$t.set(a)}}}),Oc.className="TreeEdge",ko.prototype.initializeStandardTools=function(){this.gb("Action",new Da,this.mouseDownTools),this.gb("Relinking",new la,this.mouseDownTools),this.gb("LinkReshaping",new Xo,this.mouseDownTools),this.gb("Rotating",new us,this.mouseDownTools),this.gb("Resizing",new Hr,this.mouseDownTools),this.gb("Linking",new ls,this.mouseMoveTools),this.gb("Dragging",new bo,this.mouseMoveTools),this.gb("DragSelecting",new Pa,this.mouseMoveTools),this.gb("Panning",new jr,this.mouseMoveTools),this.gb("ContextMenu",new hs,this.mouseUpTools),this.gb("TextEditing",new uo,this.mouseUpTools),this.gb("ClickCreating",new Nu,this.mouseUpTools),this.gb("ClickSelecting",new hh,this.mouseUpTools)},Cl("Horizontal",new fm),Cl("Spot",new gm),Cl("Table",new mm),Cl("Viewbox",new Sm),Cl("TableRow",new vm),Cl("TableColumn",new ym),Cl("Graduated",new jg),Cl("Grid",new Rg),oc.add("GraphLinksModel",Pr),oc.add("TreeModel",Ta);var j0=me.go,zy={get licenseKey(){return te.licenseKey},set licenseKey(a){te.licenseKey=a},get version(){return te.version},Group:Jn,EnumValue:ae,List:be,Set:ke,Map:qe,Point:At,Size:Le,Rect:pe,Margin:On,Spot:Sn,Geometry:Xe,PathFigure:gr,PathSegment:Oi,InputEvent:Qr,DiagramEvent:Su,ChangedEvent:No,Model:mn,GraphLinksModel:Li,TreeModel:ys,Binding:Jo,Transaction:xr,UndoManager:Fo,CommandHandler:Dt,Tool:bi,DraggingTool:bo,DraggingInfo:ou,DraggingOptions:st,LinkingBaseTool:_o,LinkingTool:ls,RelinkingTool:la,LinkReshapingTool:Xo,ResizingTool:Hr,RotatingTool:us,ClickSelectingTool:hh,ActionTool:Da,ClickCreatingTool:Nu,HTMLInfo:yl,ContextMenuTool:hs,DragSelectingTool:Pa,PanningTool:jr,TextEditingTool:uo,ToolManager:ko,Animation:zr,AnimationManager:Qs,AnimationTrigger:Ka,Layer:kr,Diagram:te,Palette:ft,Overview:gt,Brush:Ki,GraphObject:Xt,Panel:ze,RowColumnDefinition:ir,Shape:ei,TextBlock:io,Picture:Ts,Part:Ln,Adornment:Ai,Node:tn,Link:Ue,Placeholder:gs,Layout:xo,LayoutNetwork:oo,LayoutVertex:ur,LayoutEdge:ta,GridLayout:Fr,PanelLayout:lr,CircularLayout:Ao,CircularNetwork:Fc,CircularVertex:fp,CircularEdge:y0,ForceDirectedLayout:Gr,ForceDirectedNetwork:cf,ForceDirectedVertex:cp,ForceDirectedEdge:gp,LayeredDigraphLayout:Zi,LayeredDigraphNetwork:Ac,LayeredDigraphVertex:ba,LayeredDigraphEdge:vp,TreeLayout:yi,TreeNetwork:vf,TreeVertex:Ga,TreeEdge:Oc};typeof j0=="object"&&j0.version&&Di("WARNING: a `go` object on the root object is already defined. "+("Debug"in j0?"debug ":"")+"version: "+j0.version+", replaced with version: "+zy.version),te.prototype.go=zy,me.go=zy,typeof un.exports=="object"&&(un.exports=typeof Vt.g!="undefined"?Vt.g.go:self.go)}();var wt=typeof Vt.g!="undefined"?Vt.g.go:self.go;const ue=typeof Vt.g!="undefined"?Vt.g.go:self.go,_e=ue.Group,$e=ue.EnumValue,ye=ue.List,oe=ue.Set,Yt=ue.Map,Ne=ue.Point,ge=ue.Size,we=ue.Rect,Ye=ue.Margin,Be=ue.Spot,on=ue.Geometry,Ft=ue.PathFigure,et=ue.PathSegment,nt=ue.InputEvent,ht=ue.DiagramEvent,lt=ue.ChangedEvent,pt=ue.Model,vt=ue.GraphLinksModel,kt=ue.TreeModel,Et=ue.Binding,Ht=ue.Transaction,Zt=ue.UndoManager,ie=ue.CommandHandler,le=ue.Tool,re=ue.DraggingTool,Ge=ue.DraggingInfo,fe=ue.LinkingBaseTool,Ke=ue.LinkingTool,an=ue.RelinkingTool,nn=ue.LinkReshapingTool,Si=ue.ResizingTool,oi=ue.RotatingTool,Bi=ue.ClickSelectingTool,so=ue.ActionTool,Qt=ue.ClickCreatingTool,zt=ue.HTMLInfo,He=ue.ContextMenuTool,En=ue.DragSelectingTool,Fn=ue.PanningTool,Te=ue.TextEditingTool,ln=ue.ToolManager,pn=ue.Animation,ni=ue.AnimationManager,Cn=ue.AnimationTrigger,he=ue.Layer,Ae=ue.Diagram,hn=ue.Palette,De=ue.Overview,Rt=ue.Brush,Lt=ue.GraphObject,Ct=ue.Panel,Bt=ue.RowColumnDefinition,_t=ue.Shape,Nt=ue.TextBlock,Me=ue.TextBlockMetrics,wn=ue.Picture,pi=ue.Part,Gn=ue.Adornment,Yn=ue.Node,Ci=ue.Link,Pn=ue.Placeholder,ki=ue.Layout,ai=ue.LayoutNetwork,eo=ue.LayoutVertex,ri=ue.LayoutEdge,Yo=ue.GridLayout,Ro=ue.PanelLayout,mo=ue.CircularLayout,Ji=ue.CircularNetwork,Cr=ue.CircularVertex,Po=ue.CircularEdge,dr=ue.ForceDirectedLayout,rr=ue.ForceDirectedNetwork,fr=ue.ForceDirectedVertex,Ti=ue.ForceDirectedEdge,jo=ue.LayeredDigraphLayout,As=ue.LayeredDigraphNetwork,ws=ue.LayeredDigraphVertex,Ws=ue.LayeredDigraphEdge,Wr=ue.TreeLayout,os=ue.TreeNetwork,Or=ue.TreeVertex,sr=ue.TreeEdge,Je=ue.version},15979:function(un,Rn,Vt){"use strict";Vt.d(Rn,{hP:function(){return De}});var wt=function(Rt,Lt){return(wt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ct,Bt){Ct.__proto__=Bt}||function(Ct,Bt){for(var _t in Bt)Object.prototype.hasOwnProperty.call(Bt,_t)&&(Ct[_t]=Bt[_t])})(Rt,Lt)};function ue(Rt,Lt){function Ct(){this.constructor=Rt}wt(Rt,Lt),Rt.prototype=Lt===null?Object.create(Lt):(Ct.prototype=Lt.prototype,new Ct)}function _e(Rt,Lt,Ct,Bt){return new(Ct||(Ct=Promise))(function(_t,Nt){function Me(Gn){try{pi(Bt.next(Gn))}catch(Yn){Nt(Yn)}}function wn(Gn){try{pi(Bt.throw(Gn))}catch(Yn){Nt(Yn)}}function pi(Gn){var Yn;Gn.done?_t(Gn.value):(Yn=Gn.value,Yn instanceof Ct?Yn:new Ct(function(Ci){Ci(Yn)})).then(Me,wn)}pi((Bt=Bt.apply(Rt,Lt||[])).next())})}function $e(Rt,Lt){var Ct,Bt,_t,Nt,Me={label:0,sent:function(){if(1&_t[0])throw _t[1];return _t[1]},trys:[],ops:[]};return Nt={next:wn(0),throw:wn(1),return:wn(2)},typeof Symbol=="function"&&(Nt[Symbol.iterator]=function(){return this}),Nt;function wn(pi){return function(Gn){return function(Yn){if(Ct)throw new TypeError("Generator is already executing.");for(;Me;)try{if(Ct=1,Bt&&(_t=2&Yn[0]?Bt.return:Yn[0]?Bt.throw||((_t=Bt.return)&&_t.call(Bt),0):Bt.next)&&!(_t=_t.call(Bt,Yn[1])).done)return _t;switch(Bt=0,_t&&(Yn=[2&Yn[0],_t.value]),Yn[0]){case 0:case 1:_t=Yn;break;case 4:return Me.label++,{value:Yn[1],done:!1};case 5:Me.label++,Bt=Yn[1],Yn=[0];continue;case 7:Yn=Me.ops.pop(),Me.trys.pop();continue;default:if(_t=Me.trys,!((_t=_t.length>0&&_t[_t.length-1])||Yn[0]!==6&&Yn[0]!==2)){Me=0;continue}if(Yn[0]===3&&(!_t||Yn[1]>_t[0]&&Yn[1]<_t[3])){Me.label=Yn[1];break}if(Yn[0]===6&&Me.label<_t[1]){Me.label=_t[1],_t=Yn;break}if(_t&&Me.label<_t[2]){Me.label=_t[2],Me.ops.push(Yn);break}_t[2]&&Me.ops.pop(),Me.trys.pop();continue}Yn=Lt.call(Rt,Me)}catch(Ci){Yn=[6,Ci],Bt=0}finally{Ct=_t=0}if(5&Yn[0])throw Yn[1];return{value:Yn[0]?Yn[1]:void 0,done:!0}}([pi,Gn])}}}function ye(){for(var Rt=0,Lt=0,Ct=arguments.length;Lt<Ct;Lt++)Rt+=arguments[Lt].length;var Bt=Array(Rt),_t=0;for(Lt=0;Lt<Ct;Lt++)for(var Nt=arguments[Lt],Me=0,wn=Nt.length;Me<wn;Me++,_t++)Bt[_t]=Nt[Me];return Bt}var oe=function(){function Rt(){}return Rt.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Rt.setAttributes=function(Lt,Ct){for(var Bt=0,_t=Ct;Bt<_t.length;Bt++){var Nt=_t[Bt],Me=Nt[0],wn=Nt[1];Lt.setAttribute(Me,wn)}},Rt.createRect=function(Lt,Ct,Bt){var _t=document.createElementNS("http://www.w3.org/2000/svg","rect");return _t.setAttribute("width",Lt.toString()),_t.setAttribute("height",Ct.toString()),Bt&&Rt.setAttributes(_t,Bt),_t},Rt.createLine=function(Lt,Ct,Bt,_t,Nt){var Me=document.createElementNS("http://www.w3.org/2000/svg","line");return Me.setAttribute("x1",Lt.toString()),Me.setAttribute("y1",Ct.toString()),Me.setAttribute("x2",Bt.toString()),Me.setAttribute("y2",_t.toString()),Nt&&Rt.setAttributes(Me,Nt),Me},Rt.createPolygon=function(Lt,Ct){var Bt=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Bt.setAttribute("points",Lt),Ct&&Rt.setAttributes(Bt,Ct),Bt},Rt.createCircle=function(Lt,Ct){var Bt=document.createElementNS("http://www.w3.org/2000/svg","circle");return Bt.setAttribute("cx",(Lt/2).toString()),Bt.setAttribute("cy",(Lt/2).toString()),Bt.setAttribute("r",Lt.toString()),Ct&&Rt.setAttributes(Bt,Ct),Bt},Rt.createEllipse=function(Lt,Ct,Bt){var _t=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return _t.setAttribute("cx",(Lt/2).toString()),_t.setAttribute("cy",(Ct/2).toString()),_t.setAttribute("rx",(Lt/2).toString()),_t.setAttribute("ry",(Ct/2).toString()),Bt&&Rt.setAttributes(_t,Bt),_t},Rt.createGroup=function(Lt){var Ct=document.createElementNS("http://www.w3.org/2000/svg","g");return Lt&&Rt.setAttributes(Ct,Lt),Ct},Rt.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Rt.createMarker=function(Lt,Ct,Bt,_t,Nt,Me,wn){var pi=document.createElementNS("http://www.w3.org/2000/svg","marker");return Rt.setAttributes(pi,[["id",Lt],["orient",Ct],["markerWidth",Bt.toString()],["markerHeight",_t.toString()],["refX",Nt.toString()],["refY",Me.toString()]]),pi.appendChild(wn),pi},Rt.createText=function(Lt){var Ct=document.createElementNS("http://www.w3.org/2000/svg","text");return Ct.setAttribute("x","0"),Ct.setAttribute("y","0"),Lt&&Rt.setAttributes(Ct,Lt),Ct},Rt.createTSpan=function(Lt,Ct){var Bt=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Bt.textContent=Lt,Ct&&Rt.setAttributes(Bt,Ct),Bt},Rt.createImage=function(Lt){var Ct=document.createElementNS("http://www.w3.org/2000/svg","image");return Lt&&Rt.setAttributes(Ct,Lt),Ct},Rt.createPoint=function(Lt,Ct){var Bt=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Bt.x=Lt,Bt.y=Ct,Bt},Rt.createPath=function(Lt,Ct){var Bt=document.createElementNS("http://www.w3.org/2000/svg","path");return Bt.setAttribute("d",Lt),Ct&&Rt.setAttributes(Bt,Ct),Bt},Rt}(),Yt=function(){function Rt(){}return Rt.addKey=function(Lt){Rt.key=Lt},Object.defineProperty(Rt,"isLicensed",{get:function(){return!!Rt.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Rt.key)},enumerable:!1,configurable:!0}),Rt}(),Ne=function(){function Rt(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Rt.prototype.rasterize=function(Lt,Ct,Bt){var _t=this;return new Promise(function(Nt){var Me=Bt!==void 0?Bt:document.createElement("canvas");Lt===null&&(_t.markersOnly=!0,_t.naturalSize=!1);var wn=document.createElementNS("http://www.w3.org/2000/svg","svg");wn.setAttribute("xmlns","http://www.w3.org/2000/svg"),wn.setAttribute("width",Ct.width.baseVal.valueAsString),wn.setAttribute("height",Ct.height.baseVal.valueAsString),wn.setAttribute("viewBox","0 0 "+Ct.viewBox.baseVal.width.toString()+" "+Ct.viewBox.baseVal.height.toString()),wn.innerHTML=Ct.innerHTML,_t.naturalSize===!0?(wn.width.baseVal.value=Lt.naturalWidth,wn.height.baseVal.value=Lt.naturalHeight):_t.width!==void 0&&_t.height!==void 0&&(wn.width.baseVal.value=_t.width,wn.height.baseVal.value=_t.height),Me.width=wn.width.baseVal.value,Me.height=wn.height.baseVal.value;var pi=wn.outerHTML,Gn=Me.getContext("2d");_t.markersOnly!==!0&&Gn.drawImage(Lt,0,0,Me.width,Me.height);var Yn=window.URL,Ci=new Image(Me.width,Me.height);Ci.setAttribute("crossOrigin","anonymous");var Pn=new Blob([pi],{type:"image/svg+xml"}),ki=Yn.createObjectURL(Pn);Ci.onload=function(){Gn.drawImage(Ci,0,0),Yn.revokeObjectURL(ki);var ai=Me.toDataURL(_t.imageType,_t.imageQuality);Nt(ai)},Ci.src=ki})},Rt}(),ge=function(){},we=function(){function Rt(Lt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Lt+"_"}return Object.defineProperty(Rt.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Rt.prototype.addClass=function(Lt){return this.styleSheet===void 0&&this.addStyleSheet(),Lt.name=""+this.classNamePrefix+Lt.localName,this.classes.push(Lt),this.styleSheet.sheet.insertRule("."+Lt.name+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length),Lt},Rt.prototype.addRule=function(Lt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Lt),this.styleSheet.sheet.insertRule(Lt.selector+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length)},Rt.prototype.addStyleSheet=function(){var Lt;this.styleSheet=document.createElement("style"),((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).appendChild(this.styleSheet),this.addRule(new Ye("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ye("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ye("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Be("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Be("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Rt.prototype.removeStyleSheet=function(){var Lt;this.styleSheet&&(((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Rt}(),Ye=function(Rt,Lt){this.selector=Rt,this.style=Lt},Be=function(Rt,Lt){this.localName=Rt,this.style=Lt},on=function(){function Rt(Lt,Ct,Bt,_t,Nt){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Lt,this.displayMode=Ct,this.markerItems=Bt,this.uiStyleSettings=_t,this.styles=Nt,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Rt.prototype.show=function(Lt){var Ct=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Bt=document.createElement("div");Bt.className=this.toolbarBlockStyleClass.name,Bt.style.whiteSpace="nowrap",this.uiContainer.appendChild(Bt),this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Bt,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Nt){var Me=document.createElement("div");Me.className=""+Ct.toolbarButtonStyleClass.name,Me.setAttribute("data-type-name",Nt.typeName),Me.innerHTML=Nt.icon,Me.addEventListener("click",function(){Ct.markerToolbarButtonClicked(Me,Nt)}),Ct.buttons.push(Me),Ct.markerButtons.push(Me)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var _t=document.createElement("div");_t.className=this.toolbarBlockStyleClass.name,_t.style.whiteSpace="nowrap",_t.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(_t),this.addActionButton(_t,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(_t,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Rt.prototype.addButtonClickListener=function(Lt){this.buttonClickListeners.push(Lt)},Rt.prototype.removeButtonClickListener=function(Lt){this.buttonClickListeners.indexOf(Lt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Lt),1)},Rt.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Rt.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Lt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Ct=0;Ct<this.markerButtons.length;Ct++)Ct<Lt||Ct===Lt&&this.markerButtons.length-1===Lt?this.markerButtonBlock.appendChild(this.markerButtons[Ct]):(Ct===Lt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Ct]))}},Rt.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},Rt.prototype.resetButtonStyles=function(){var Lt=this;this.buttons.forEach(function(Ct){Ct.className=Ct.className.replace(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name,"").trim(),Ct.className=Ct.className.replace(Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Lt.toolbarActiveButtonStyleColorsClass.name,"").trim(),Ct.className+=" "+(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name)})},Rt.prototype.addActionButton=function(Lt,Ct,Bt){var _t=this,Nt=document.createElement("div");switch(Nt.className=""+this.toolbarButtonStyleClass.name,Nt.innerHTML=Ct,Nt.setAttribute("data-action",Bt),Nt.addEventListener("click",function(){_t.actionToolbarButtonClicked(Nt,Bt)}),Bt){case"select":Nt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Nt.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Nt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Nt.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Nt.style.fill=this.uiStyleSettings.closeButtonColor}Lt.appendChild(Nt),this.buttons.push(Nt)},Rt.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Be("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Be("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Be("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Be("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Be("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var Lt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Be("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
padding: `+Lt+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Be("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Be("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ye("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ye("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Rt.prototype.markerToolbarButtonClicked=function(Lt,Ct){this.setActiveButton(Lt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Bt){return Bt("marker",Ct)}),this.markerButtonOverflowBlock.style.display="none"},Rt.prototype.actionToolbarButtonClicked=function(Lt,Ct){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Bt){return Bt("action",Ct)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Rt.prototype.setActiveButton=function(Lt){this.resetButtonStyles(),Lt.className=Lt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Lt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Rt.prototype.setActiveMarkerButton=function(Lt){var Ct=this.markerButtons.find(function(Bt){return Bt.getAttribute("data-type-name")===Lt});Ct&&this.setActiveButton(Ct)},Rt.prototype.setCurrentMarker=function(Lt){var Ct=this;this.currentMarker=Lt,this.buttons.filter(function(Bt){return/delete|notes/.test(Bt.getAttribute("data-action"))}).forEach(function(Bt){Ct.currentMarker===void 0?(Bt.style.fillOpacity="0.4",Bt.style.pointerEvents="none"):(Bt.style.fillOpacity="1",Bt.style.pointerEvents="all")})},Rt}(),Ft=function(){function Rt(Lt,Ct,Bt,_t){this.panels=[],this.panelButtons=[],this.markerjsContainer=Lt,this.displayMode=Ct,this.uiStyleSettings=Bt,this.styles=_t,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Rt.prototype.addStyles=function(){var Lt;this.toolboxStyleClass=this.styles.addClass(new Be("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Be("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var Ct=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Be("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Be("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Be("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Be("toolbox-panel-row_colors",`
background-color: `+((Lt=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Lt!==void 0?Lt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Be("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Ct)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Ct)+`px;
padding: `+Ct+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Be("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Be("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Rt.prototype.show=function(Lt){var Ct;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Ct=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Ct!==void 0?Ct:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Rt.prototype.setPanelButtons=function(Lt){var Ct,Bt,_t=this;this.panels=Lt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Ct=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Ct!==void 0?Ct:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Bt=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Bt!==void 0?Bt:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Nt){var Me;Nt.uiStyleSettings=_t.uiStyleSettings;var wn=document.createElement("div");wn.className=_t.toolboxButtonStyleClass.name+" "+((Me=_t.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Me!==void 0?Me:_t.toolboxButtonStyleColorsClass.name),wn.innerHTML=Nt.icon,wn.title=Nt.title,wn.addEventListener("click",function(){_t.panelButtonClick(Nt)}),_t.panelButtons.push(wn),_t.buttonRow.appendChild(wn)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Rt.prototype.panelButtonClick=function(Lt){var Ct=this,Bt=-1;if(Lt!==this.activePanel){Bt=this.panels.indexOf(Lt),this.panelRow.innerHTML="";var _t=Lt.getUi();_t.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(_t),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=Lt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Ct.displayMode==="inline"?Ct.panelRow.style.display="none":Ct.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Nt,Me){var wn,pi;Nt.className=Ct.toolboxButtonStyleClass.name+" "+(Me===Bt?""+((wn=Ct.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&wn!==void 0?wn:Ct.toolboxActiveButtonStyleColorsClass.name):""+((pi=Ct.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pi!==void 0?pi:Ct.toolboxButtonStyleColorsClass.name))})},Rt}(),et=function(Rt,Lt){this.title=Rt,this.icon=Lt},nt=function(Rt){function Lt(Ct,Bt,_t,Nt){var Me=Rt.call(this,Ct,Nt||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Me.colors=[],Me.addTransparent=!1,Me.colorBoxes=[],Me.colors=Bt,Me.currentColor=_t,Me.setCurrentColor=Me.setCurrentColor.bind(Me),Me.getColorBox=Me.getColorBox.bind(Me),Me}return ue(Lt,Rt),Lt.prototype.getUi=function(){var Ct=this,Bt=document.createElement("div");return Bt.style.overflow="hidden",Bt.style.whiteSpace="nowrap",this.colors.forEach(function(_t){var Nt=Ct.getColorBox(_t);Bt.appendChild(Nt),Ct.colorBoxes.push(Nt)}),Bt},Lt.prototype.getColorBox=function(Ct){var Bt=this,_t=this.uiStyleSettings.toolbarHeight/4,Nt=this.uiStyleSettings.toolbarHeight-_t,Me=document.createElement("div");Me.style.display="inline-block",Me.style.boxSizing="content-box",Me.style.width=Nt-2+"px",Me.style.height=Nt-2+"px",Me.style.padding="1px",Me.style.marginRight="2px",Me.style.marginBottom="2px",Me.style.borderWidth="2px",Me.style.borderStyle="solid",Me.style.borderRadius=(Nt+2)/2+"px",Me.style.borderColor=Ct===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Me.addEventListener("click",function(){Bt.setCurrentColor(Ct,Me)});var wn=document.createElement("div");return wn.style.display="inline-block",wn.style.width=Nt-2+"px",wn.style.height=Nt-2+"px",wn.style.backgroundColor=Ct,wn.style.borderRadius=Nt/2+"px",Ct==="transparent"&&(wn.style.fill=this.uiStyleSettings.toolboxAccentColor,wn.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Me.appendChild(wn),Me},Lt.prototype.setCurrentColor=function(Ct,Bt){var _t=this;this.currentColor=Ct,this.colorBoxes.forEach(function(Nt){Nt.style.borderColor=Nt===Bt?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Ct)},Lt}(et),ht=function(){function Rt(Lt,Ct,Bt){this._state="new",this._isSelected=!1,this._container=Lt,this._overlayContainer=Ct,this.globalSettings=Bt,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Rt.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Rt.prototype.ownsTarget=function(Lt){return!1},Object.defineProperty(Rt.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Rt.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Rt.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Rt.prototype.pointerDown=function(Lt,Ct){},Rt.prototype.dblClick=function(Lt,Ct){},Rt.prototype.manipulate=function(Lt){},Rt.prototype.pointerUp=function(Lt){this.stateChanged()},Rt.prototype.dispose=function(){},Rt.prototype.addMarkerVisualToContainer=function(Lt){this.container.childNodes.length>0?this.container.insertBefore(Lt,this.container.childNodes[0]):this.container.appendChild(Lt)},Rt.prototype.getState=function(){return{typeName:Rt.typeName,state:this.state,notes:this.notes}},Rt.prototype.restoreState=function(Lt){this._state=Lt.state,this.notes=Lt.notes},Rt.prototype.scale=function(Lt,Ct){},Rt.prototype.colorChanged=function(Lt){this.onColorChanged&&this.onColorChanged(Lt),this.stateChanged()},Rt.prototype.fillColorChanged=function(Lt){this.onFillColorChanged&&this.onFillColorChanged(Lt),this.stateChanged()},Rt.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Lt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Lt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Lt)&&this.onStateChanged(this)}},Rt.typeName="MarkerBase",Rt}(),lt=function(){function Rt(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Rt.prototype.findGripByVisual=function(Lt){return this.topLeft.ownsTarget(Lt)?this.topLeft:this.topCenter.ownsTarget(Lt)?this.topCenter:this.topRight.ownsTarget(Lt)?this.topRight:this.centerLeft.ownsTarget(Lt)?this.centerLeft:this.centerRight.ownsTarget(Lt)?this.centerRight:this.bottomLeft.ownsTarget(Lt)?this.bottomLeft:this.bottomCenter.ownsTarget(Lt)?this.bottomCenter:this.bottomRight.ownsTarget(Lt)?this.bottomRight:void 0},Rt}(),pt=function(){function Rt(){this.GRIP_SIZE=10,this.visual=oe.createGroup(),this.visual.appendChild(oe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(oe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Rt.prototype.ownsTarget=function(Lt){return Lt===this.visual||Lt===this.visual.childNodes[0]||Lt===this.visual.childNodes[1]},Rt}(),vt=function(){function Rt(){}return Rt.toITransformMatrix=function(Lt){return{a:Lt.a,b:Lt.b,c:Lt.c,d:Lt.d,e:Lt.e,f:Lt.f}},Rt.toSVGMatrix=function(Lt,Ct){return Lt.a=Ct.a,Lt.b=Ct.b,Lt.c=Ct.c,Lt.d=Ct.d,Lt.e=Ct.e,Lt.f=Ct.f,Lt},Rt}(),kt=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.left=0,Nt.top=0,Nt.width=0,Nt.height=0,Nt.defaultSize={x:50,y:20},Nt.offsetX=0,Nt.offsetY=0,Nt.rotationAngle=0,Nt.CB_DISTANCE=10,Nt._suppressMarkerCreateEvent=!1,Nt.container.transform.baseVal.appendItem(oe.createTransform()),Nt.setupControlBox(),Nt}return ue(Lt,Rt),Object.defineProperty(Lt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"visual",{get:function(){return this._visual},set:function(Ct){this._visual=Ct;var Bt=oe.createTransform();this._visual.transform.baseVal.appendItem(Bt)},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Ct){return!!Rt.prototype.ownsTarget.call(this,Ct)||!!(this.controlGrips.findGripByVisual(Ct)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Ct))},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.state==="new"&&(this.left=Ct.x,this.top=Ct.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var _t=this.unrotatePoint(Ct);if(this.manipulationStartX=_t.x,this.manipulationStartY=_t.y,this.offsetX=_t.x-this.left,this.offsetY=_t.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Bt),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Bt)){this.activeGrip=this.rotatorGrip;var Nt=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Nt.x-this.width/2,this.top=Nt.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Me=this.container.transform.baseVal.getItem(0);Me.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Me,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Lt.prototype.pointerUp=function(Ct){var Bt=this.state;Rt.prototype.pointerUp.call(this,Ct),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Ct),this._state="select",Bt==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Lt.prototype.moveVisual=function(Ct){this.visual.style.transform="translate("+Ct.x+"px, "+Ct.y+"px)"},Lt.prototype.manipulate=function(Ct){var Bt=this.unrotatePoint(Ct);this.state==="creating"?this.resize(Ct):this.state==="move"?(this.left=this.manipulationStartLeft+(Bt.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Bt.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Bt):this.state==="rotate"&&this.rotate(Ct)},Lt.prototype.resize=function(Ct){var Bt=this.manipulationStartLeft,_t=this.manipulationStartWidth,Nt=this.manipulationStartTop,Me=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Bt=this.manipulationStartLeft+Ct.x-this.manipulationStartX,_t=this.manipulationStartWidth+this.manipulationStartLeft-Bt;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:_t=this.manipulationStartWidth+Ct.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Nt=this.manipulationStartTop+Ct.y-this.manipulationStartY,Me=this.manipulationStartHeight+this.manipulationStartTop-Nt;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Me=this.manipulationStartHeight+Ct.y-this.manipulationStartY}_t>=0?(this.left=Bt,this.width=_t):(this.left=Bt+_t,this.width=-_t),Me>=0?(this.top=Nt,this.height=Me):(this.top=Nt+Me,this.height=-Me),this.setSize()},Lt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Lt.prototype.rotate=function(Ct){if(Math.abs(Ct.x-this.centerX)>.1){var Bt=Math.sign(Ct.x-this.centerX);this.rotationAngle=180*Math.atan((Ct.y-this.centerY)/(Ct.x-this.centerX))/Math.PI+90*Bt,this.applyRotation()}},Lt.prototype.applyRotation=function(){var Ct=this.container.transform.baseVal.getItem(0);Ct.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ct,0)},Lt.prototype.rotatePoint=function(Ct){if(this.rotationAngle===0)return Ct;var Bt=this.container.getCTM(),_t=oe.createPoint(Ct.x,Ct.y);return{x:(_t=_t.matrixTransform(Bt)).x,y:_t.y}},Lt.prototype.unrotatePoint=function(Ct){if(this.rotationAngle===0)return Ct;var Bt=this.container.getCTM();Bt=Bt.inverse();var _t=oe.createPoint(Ct.x,Ct.y);return{x:(_t=_t.matrixTransform(Bt)).x,y:_t.y}},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=oe.createGroup();var Ct=oe.createTransform();Ct.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Ct),this.container.appendChild(this.controlBox),this.controlRect=oe.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=oe.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new lt,this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){var Ct=this.controlBox.transform.baseVal.getItem(0);Ct.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Ct,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},Lt.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},Lt.prototype.createGrip=function(){var Ct=new pt;return Ct.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(Ct.visual),Ct},Lt.prototype.positionGrips=function(){var Ct=this.controlGrips.topLeft.GRIP_SIZE,Bt=-Ct/2,_t=Bt,Nt=(this.width+this.CB_DISTANCE)/2-Ct/2,Me=(this.height+this.CB_DISTANCE)/2-Ct/2,wn=this.height+this.CB_DISTANCE-Ct/2,pi=this.width+this.CB_DISTANCE-Ct/2;this.positionGrip(this.controlGrips.topLeft.visual,Bt,_t),this.positionGrip(this.controlGrips.topCenter.visual,Nt,_t),this.positionGrip(this.controlGrips.topRight.visual,pi,_t),this.positionGrip(this.controlGrips.centerLeft.visual,Bt,Me),this.positionGrip(this.controlGrips.centerRight.visual,pi,Me),this.positionGrip(this.controlGrips.bottomLeft.visual,Bt,wn),this.positionGrip(this.controlGrips.bottomCenter.visual,Nt,wn),this.positionGrip(this.controlGrips.bottomRight.visual,pi,wn),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Nt,_t-3*this.CB_DISTANCE)},Lt.prototype.positionGrip=function(Ct,Bt,_t){var Nt=Ct.transform.baseVal.getItem(0);Nt.setTranslate(Bt,_t),Ct.transform.baseVal.replaceItem(Nt,0)},Lt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Lt.prototype.showControlBox=function(){this.controlBox.style.display=""},Lt.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:vt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:vt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Ct){Rt.prototype.restoreState.call(this,Ct);var Bt=Ct;this.left=Bt.left,this.top=Bt.top,this.width=Bt.width,this.height=Bt.height,this.rotationAngle=Bt.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Bt.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Bt.containerTransformMatrix))},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt);var _t=this.rotatePoint({x:this.left,y:this.top}),Nt=this.unrotatePoint({x:_t.x*Ct,y:_t.y*Bt});this.left=Nt.x,this.top=Nt.y,this.width=this.width*Ct,this.height=this.height*Bt,this.adjustControlBox()},Lt}(ht),Et=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.fillColor="transparent",Nt.strokeColor="transparent",Nt.strokeWidth=0,Nt.strokeDasharray="",Nt.opacity=1,Nt.setStrokeColor=Nt.setStrokeColor.bind(Nt),Nt.setFillColor=Nt.setFillColor.bind(Nt),Nt.setStrokeWidth=Nt.setStrokeWidth.bind(Nt),Nt.setStrokeDasharray=Nt.setStrokeDasharray.bind(Nt),Nt.createVisual=Nt.createVisual.bind(Nt),Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.visual)},Lt.prototype.createVisual=function(){this.visual=oe.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.state==="new"&&(this.createVisual(),this.moveVisual(Ct),this._state="creating")},Lt.prototype.manipulate=function(Ct){Rt.prototype.manipulate.call(this,Ct)},Lt.prototype.resize=function(Ct){Rt.prototype.resize.call(this,Ct),this.setSize()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Ct){Rt.prototype.pointerUp.call(this,Ct),this.setSize()},Lt.prototype.setStrokeColor=function(Ct){this.strokeColor=Ct,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Ct),this.stateChanged()},Lt.prototype.setFillColor=function(Ct){this.fillColor=Ct,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Ct){this.strokeWidth=Ct,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Ct){this.strokeDasharray=Ct,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Ct){var Bt=Ct;this.fillColor=Bt.fillColor,this.strokeColor=Bt.strokeColor,this.strokeWidth=Bt.strokeWidth,this.strokeDasharray=Bt.strokeDasharray,this.opacity=Bt.opacity,this.createVisual(),Rt.prototype.restoreState.call(this,Ct),this.setSize()},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt),this.setSize()},Lt.title="Rectangle marker",Lt}(kt),Ht=function(Rt){function Lt(Ct,Bt,_t,Nt){var Me=Rt.call(this,Ct,Nt||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Me.widths=[],Me.widthBoxes=[],Me.widths=Bt,Me.currentWidth=_t,Me.setCurrentWidth=Me.setCurrentWidth.bind(Me),Me}return ue(Lt,Rt),Lt.prototype.getUi=function(){var Ct=this,Bt=document.createElement("div");return Bt.style.display="flex",Bt.style.overflow="hidden",Bt.style.flexGrow="2",this.widths.forEach(function(_t){var Nt=document.createElement("div");Nt.style.display="flex",Nt.style.flexGrow="2",Nt.style.alignItems="center",Nt.style.justifyContent="space-between",Nt.style.padding="5px",Nt.style.borderWidth="2px",Nt.style.borderStyle="solid",Nt.style.borderColor=_t===Ct.currentWidth?Ct.uiStyleSettings.toolboxAccentColor:"transparent",Nt.addEventListener("click",function(){Ct.setCurrentWidth(_t,Nt)}),Bt.appendChild(Nt);var Me=document.createElement("div");Me.innerText=_t.toString(),Me.style.marginRight="5px",Nt.appendChild(Me);var wn=document.createElement("div");wn.style.minHeight="20px",wn.style.flexGrow="2",wn.style.display="flex",wn.style.alignItems="center";var pi=document.createElement("hr");pi.style.minWidth="20px",pi.style.border="0px",pi.style.borderTop=_t+"px solid "+Ct.uiStyleSettings.toolboxColor,pi.style.flexGrow="2",wn.appendChild(pi),Nt.appendChild(wn),Ct.widthBoxes.push(Nt)}),Bt},Lt.prototype.setCurrentWidth=function(Ct,Bt){var _t=this;this.currentWidth=Ct,this.widthBoxes.forEach(function(Nt){Nt.style.borderColor=Nt===Bt?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Lt}(et),Zt=function(Rt){function Lt(Ct,Bt,_t,Nt){var Me=Rt.call(this,Ct,Nt||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Me.styles=[],Me.styleBoxes=[],Me.styles=Bt,Me.currentStyle=_t,Me.setCurrentStyle=Me.setCurrentStyle.bind(Me),Me}return ue(Lt,Rt),Lt.prototype.getUi=function(){var Ct=this,Bt=document.createElement("div");return Bt.style.display="flex",Bt.style.overflow="hidden",Bt.style.flexGrow="2",this.styles.forEach(function(_t){var Nt=document.createElement("div");Nt.style.display="flex",Nt.style.alignItems="center",Nt.style.justifyContent="space-between",Nt.style.padding="5px",Nt.style.borderWidth="2px",Nt.style.borderStyle="solid",Nt.style.overflow="hidden",Nt.style.maxWidth=100/Ct.styles.length-5+"%",Nt.style.borderColor=_t===Ct.currentStyle?Ct.uiStyleSettings.toolboxAccentColor:"transparent",Nt.addEventListener("click",function(){Ct.setCurrentStyle(_t,Nt)}),Bt.appendChild(Nt);var Me=document.createElement("div");Me.style.minHeight="20px",Me.style.flexGrow="2",Me.style.overflow="hidden";var wn=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Ct.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(_t!==""?'stroke-dasharray="'+_t+'"':"")+` />
</svg>`;Me.innerHTML=wn,Nt.appendChild(Me),Ct.styleBoxes.push(Nt)}),Bt},Lt.prototype.setCurrentStyle=function(Ct,Bt){var _t=this;this.currentStyle=Ct,this.styleBoxes.forEach(function(Nt){Nt.style.borderColor=Nt===Bt?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Lt}(et),ie=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.strokeColor=_t.defaultColor,Nt.strokeWidth=_t.defaultStrokeWidth,Nt.strokeDasharray=_t.defaultStrokeDasharray,Nt.strokePanel=new nt("Line color",_t.defaultColorSet,_t.defaultColor),Nt.strokePanel.onColorChanged=Nt.setStrokeColor,Nt.strokeWidthPanel=new Ht("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Nt.strokeWidthPanel.onWidthChanged=Nt.setStrokeWidth,Nt.strokeStylePanel=new Zt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Nt.strokeStylePanel.onStyleChanged=Nt.setStrokeDasharray,Nt}return ue(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Rt.prototype.getState.call(this);return Ct.typeName=Lt.typeName,Ct},Lt.typeName="FrameMarker",Lt.title="Frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Lt}(Et),le=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},re=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.x1=0,Nt.y1=0,Nt.x2=0,Nt.y2=0,Nt.defaultLength=50,Nt.manipulationStartX=0,Nt.manipulationStartY=0,Nt.manipulationStartX1=0,Nt.manipulationStartY1=0,Nt.manipulationStartX2=0,Nt.manipulationStartY2=0,Nt.setupControlBox(),Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!!Rt.prototype.ownsTarget.call(this,Ct)||!(!this.grip1.ownsTarget(Ct)&&!this.grip2.ownsTarget(Ct))},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.manipulationStartX=Ct.x,this.manipulationStartY=Ct.y,this.state==="new"&&(this.x1=Ct.x,this.y1=Ct.y,this.x2=Ct.x,this.y2=Ct.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Bt)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Bt)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Lt.prototype.pointerUp=function(Ct){var Bt=this.state;Rt.prototype.pointerUp.call(this,Ct),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(Ct),this._state="select",Bt==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Lt.prototype.adjustVisual=function(){},Lt.prototype.manipulate=function(Ct){this.state==="creating"?this.resize(Ct):this.state==="move"?(this.x1=this.manipulationStartX1+Ct.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Ct.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Ct.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Ct.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Ct)},Lt.prototype.resize=function(Ct){switch(this.activeGrip){case this.grip1:this.x1=Ct.x,this.y1=Ct.y;break;case this.grip2:case void 0:this.x2=Ct.x,this.y2=Ct.y}this.adjustVisual(),this.adjustControlBox()},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=oe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){this.positionGrips()},Lt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Lt.prototype.createGrip=function(){var Ct=new pt;return Ct.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(Ct.visual),Ct},Lt.prototype.positionGrips=function(){var Ct=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Ct/2,this.y1-Ct/2),this.positionGrip(this.grip2.visual,this.x2-Ct/2,this.y2-Ct/2)},Lt.prototype.positionGrip=function(Ct,Bt,_t){var Nt=Ct.transform.baseVal.getItem(0);Nt.setTranslate(Bt,_t),Ct.transform.baseVal.replaceItem(Nt,0)},Lt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Ct){Rt.prototype.restoreState.call(this,Ct);var Bt=Ct;this.x1=Bt.x1,this.y1=Bt.y1,this.x2=Bt.x2,this.y2=Bt.y2},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt),this.x1=this.x1*Ct,this.y1=this.y1*Bt,this.x2=this.x2*Ct,this.y2=this.y2*Bt,this.adjustVisual(),this.adjustControlBox()},Lt}(ht),Ge=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.strokeColor="transparent",Nt.strokeWidth=0,Nt.strokeDasharray="",Nt.setStrokeColor=Nt.setStrokeColor.bind(Nt),Nt.setStrokeWidth=Nt.setStrokeWidth.bind(Nt),Nt.setStrokeDasharray=Nt.setStrokeDasharray.bind(Nt),Nt.strokeColor=_t.defaultColor,Nt.strokeWidth=_t.defaultStrokeWidth,Nt.strokeDasharray=_t.defaultStrokeDasharray,Nt.strokePanel=new nt("Line color",_t.defaultColorSet,_t.defaultColor),Nt.strokePanel.onColorChanged=Nt.setStrokeColor,Nt.strokeWidthPanel=new Ht("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Nt.strokeWidthPanel.onWidthChanged=Nt.setStrokeWidth,Nt.strokeStylePanel=new Zt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Nt.strokeStylePanel.onStyleChanged=Nt.setStrokeDasharray,Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.visual&&Ct!==this.selectorLine&&Ct!==this.visibleLine)},Lt.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorLine=oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Lt.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),oe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setStrokeColor=function(Ct){this.strokeColor=Ct,this.adjustVisual(),this.colorChanged(Ct)},Lt.prototype.setStrokeWidth=function(Ct){this.strokeWidth=Ct,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Ct){this.strokeDasharray=Ct,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Rt.prototype.getState.call(this));return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){Rt.prototype.restoreState.call(this,Ct);var Bt=Ct;this.strokeColor=Bt.strokeColor,this.strokeWidth=Bt.strokeWidth,this.strokeDasharray=Bt.strokeDasharray,this.createVisual(),this.adjustVisual()},Lt.typeName="LineMarker",Lt.title="Line marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Lt}(re),fe=function(Rt){function Lt(Ct,Bt,_t,Nt){var Me=Rt.call(this,Ct,Nt||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Me.fonts=[],Me.fontBoxes=[],Me.fonts=Bt,Me.currentFont=_t,Me.setCurrentFont=Me.setCurrentFont.bind(Me),Me}return ue(Lt,Rt),Lt.prototype.getUi=function(){var Ct=this,Bt=document.createElement("div");return Bt.style.overflow="hidden",Bt.style.flexGrow="2",this.fonts.forEach(function(_t){var Nt=document.createElement("div");Nt.style.display="inline-block",Nt.style.alignItems="center",Nt.style.justifyContent="space-between",Nt.style.padding="5px",Nt.style.borderWidth="2px",Nt.style.borderStyle="solid",Nt.style.overflow="hidden",Nt.style.maxWidth=100/Ct.fonts.length-5+"%",Nt.style.borderColor=_t===Ct.currentFont?Ct.uiStyleSettings.toolboxAccentColor:"transparent",Nt.addEventListener("click",function(){Ct.setCurrentFont(_t,Nt)}),Bt.appendChild(Nt);var Me=document.createElement("div");Me.style.display="flex",Me.style.minHeight="20px",Me.style.flexGrow="2",Me.style.fontFamily=_t,Me.style.overflow="hidden";var wn=document.createElement("div");wn.style.whiteSpace="nowrap",wn.style.overflow="hidden",wn.style.textOverflow="ellipsis",wn.innerHTML="The quick brown fox jumps over the lazy dog",Me.appendChild(wn),Nt.appendChild(Me),Ct.fontBoxes.push(Nt)}),Bt},Lt.prototype.setCurrentFont=function(Ct,Bt){var _t=this;this.currentFont=Ct,this.fontBoxes.forEach(function(Nt){Nt.style.borderColor=Nt===Bt?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Lt}(et),Ke=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.color="transparent",Nt.padding=5,Nt.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Nt.text=Nt.DEFAULT_TEXT,Nt.isMoved=!1,Nt.color=_t.defaultColor,Nt.fontFamily=_t.defaultFontFamily,Nt.defaultSize={x:100,y:30},Nt.setColor=Nt.setColor.bind(Nt),Nt.setFont=Nt.setFont.bind(Nt),Nt.renderText=Nt.renderText.bind(Nt),Nt.sizeText=Nt.sizeText.bind(Nt),Nt.textEditDivClicked=Nt.textEditDivClicked.bind(Nt),Nt.showTextEditor=Nt.showTextEditor.bind(Nt),Nt.setSize=Nt.setSize.bind(Nt),Nt.positionTextEditor=Nt.positionTextEditor.bind(Nt),Nt.colorPanel=new nt("Color",_t.defaultColorSet,_t.defaultColor),Nt.colorPanel.onColorChanged=Nt.setColor,Nt.fontFamilyPanel=new fe("Font",_t.defaultFontFamilies,_t.defaultFontFamily),Nt.fontFamilyPanel.onFontChanged=Nt.setFont,Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){if(Rt.prototype.ownsTarget.call(this,Ct)||Ct===this.visual||Ct===this.textElement||Ct===this.bgRectangle)return!0;var Bt=!1;return this.textElement.childNodes.forEach(function(_t){_t===Ct&&(Bt=!0)}),Bt},Lt.prototype.createVisual=function(){this.visual=oe.createGroup(),this.bgRectangle=oe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=oe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.isMoved=!1,this.pointerDownPoint=Ct,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Ct),this._state="creating")},Lt.prototype.renderText=function(){var Ct=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Bt){Ct.textElement.appendChild(oe.createTSpan(Bt.trim()===""?" ":Bt.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Lt.prototype.getTextScale=function(){var Ct=this.textElement.getBBox(),Bt=1;if(Ct.width>0&&Ct.height>0){var _t=(1*this.width-this.width*this.padding*2/100)/Ct.width,Nt=(1*this.height-this.height*this.padding*2/100)/Ct.height;Bt=Math.min(_t,Nt)}return Bt},Lt.prototype.getTextPosition=function(Ct){var Bt=this.textElement.getBBox(),_t=0,Nt=0;return Bt.width>0&&Bt.height>0&&(_t=(this.width-Bt.width*Ct)/2,Nt=this.height/2-Bt.height*Ct/2),{x:_t,y:Nt}},Lt.prototype.sizeText=function(){var Ct=this.textElement.getBBox(),Bt=this.getTextScale(),_t=this.getTextPosition(Bt);_t.y-=Ct.y*Bt,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+_t.x+"px, "+_t.y+"px) scale("+Bt+", "+Bt+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(_t.x,_t.y),this.textElement.transform.baseVal.getItem(1).setScale(Bt,Bt))},Lt.prototype.manipulate=function(Ct){Rt.prototype.manipulate.call(this,Ct),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Ct.x-this.pointerDownPoint.x)>5||Math.abs(Ct.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Ct){Rt.prototype.resize.call(this,Ct),this.isMoved=!0,this.setSize(),this.sizeText()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},Lt.prototype.pointerUp=function(Ct){var Bt=this.state;Bt==="creating"&&(this._suppressMarkerCreateEvent=!0),Rt.prototype.pointerUp.call(this,Ct),this.setSize(),(Bt==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.showTextEditor=function(){var Ct=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Bt){Bt.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Bt=Number.parseFloat(Ct.textEditor.style.fontSize);Ct.textEditor.clientWidth>=Number.parseInt(Ct.textEditor.style.maxWidth)&&Bt>.9;)Bt-=.1,Ct.textEditor.style.fontSize=Math.max(Bt,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Bt){Bt.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Bt){if(Bt.clipboardData){var _t=Bt.clipboardData.getData("text"),Nt=window.getSelection();if(!Nt.rangeCount)return!1;Nt.deleteFromDocument(),Nt.getRangeAt(0).insertNode(document.createTextNode(_t)),Bt.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Ct.textEditDivClicked(Ct.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Lt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Ct=this.getTextScale(),Bt=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),_t=this.textElement.getBBox(),Nt={x:_t.width*Ct,y:_t.height*Ct};Bt.x-=Nt.x/2,Bt.y-=Nt.y/2,this.textEditor.style.top=Bt.y+"px",this.textEditor.style.left=Bt.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Bt.x+"px",this.textEditor.style.fontSize=Math.max(16*Ct,12)+"px",this.textElement.style.display="none"}},Lt.prototype.textEditDivClicked=function(Ct){this.text=Ct.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Lt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Rt.prototype.deselect.call(this)},Lt.prototype.dblClick=function(Ct,Bt){Rt.prototype.dblClick.call(this,Ct,Bt),this.showTextEditor()},Lt.prototype.setColor=function(Ct){this.textElement&&oe.setAttributes(this.textElement,[["fill",Ct]]),this.color=Ct,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Ct)},Lt.prototype.setFont=function(Ct){this.textElement&&oe.setAttributes(this.textElement,[["font-family",Ct]]),this.fontFamily=Ct,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Lt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Lt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Rt.prototype.getState.call(this));return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){var Bt=Ct;this.color=Bt.color,this.fontFamily=Bt.fontFamily,this.padding=Bt.padding,this.text=Bt.text,this.createVisual(),Rt.prototype.restoreState.call(this,Ct),this.setSize()},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt),this.setSize(),this.sizeText(),this.positionTextEditor()},Lt.typeName="TextMarker",Lt.title="Text marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',Lt}(kt),an=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.color="transparent",Nt.lineWidth=3,Nt.drawing=!1,Nt.pixelRatio=1,Nt.color=_t.defaultColor,Nt.lineWidth=_t.defaultStrokeWidth,Nt.pixelRatio=_t.freehandPixelRatio,Nt.setColor=Nt.setColor.bind(Nt),Nt.addCanvas=Nt.addCanvas.bind(Nt),Nt.finishCreation=Nt.finishCreation.bind(Nt),Nt.setLineWidth=Nt.setLineWidth.bind(Nt),Nt.colorPanel=new nt("Color",_t.defaultColorSet,_t.defaultColor),Nt.colorPanel.onColorChanged=Nt.setColor,Nt.lineWidthPanel=new Ht("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Nt.lineWidthPanel.onWidthChanged=Nt.setLineWidth,Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.visual&&Ct!==this.drawingImage)},Lt.prototype.createVisual=function(){this.visual=oe.createGroup(),this.drawingImage=oe.createImage(),this.visual.appendChild(this.drawingImage);var Ct=oe.createTransform();this.visual.transform.baseVal.appendItem(Ct),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Ct,Bt){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(Ct.x,Ct.y),this.drawing=!0):Rt.prototype.pointerDown.call(this,Ct,Bt)},Lt.prototype.manipulate=function(Ct){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Ct.x,Ct.y),this.canvasContext.stroke()):Rt.prototype.manipulate.call(this,Ct)},Lt.prototype.resize=function(Ct){Rt.prototype.resize.call(this,Ct),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Ct){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Rt.prototype.pointerUp.call(this,Ct)},Lt.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},Lt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.select.call(this)},Lt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.deselect.call(this)},Lt.prototype.finishCreation=function(){for(var Ct=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Bt=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],_t=Bt[0],Nt=Bt[1],Me=Bt[2],wn=Bt[3],pi=!1,Gn=0;Gn<this.canvasElement.height;Gn++)for(var Yn=0;Yn<this.canvasElement.width;Yn++)Ct.data[Gn*this.canvasElement.width*4+4*Yn+3]>0&&(pi=!0,Gn<Nt&&(Nt=Gn),Yn<_t&&(_t=Yn),Gn>wn&&(wn=Gn),Yn>Me&&(Me=Yn));if(pi){this.left=_t/this.pixelRatio,this.top=Nt/this.pixelRatio,this.width=(Me-_t)/this.pixelRatio,this.height=(wn-Nt)/this.pixelRatio;var Ci=document.createElement("canvas");Ci.width=Me-_t,Ci.height=wn-Nt,Ci.getContext("2d").putImageData(this.canvasContext.getImageData(_t,Nt,Me-_t,wn-Nt),0,0),this.drawingImgUrl=Ci.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Lt.prototype.setDrawingImage=function(){oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},Lt.prototype.setColor=function(Ct){this.color=Ct,this.colorChanged(Ct)},Lt.prototype.setLineWidth=function(Ct){this.lineWidth=Ct},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Object.assign({drawingImgUrl:this.drawingImgUrl},Rt.prototype.getState.call(this));return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){this.createVisual(),Rt.prototype.restoreState.call(this,Ct),this.drawingImgUrl=Ct.drawingImgUrl,this.setDrawingImage()},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt),this.setDrawingImage()},Lt.typeName="FreehandMarker",Lt.title="Freehand marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',Lt}(kt),nn=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,_t||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Nt.typeBoxes=[],Nt.currentType=Bt,Nt.setCurrentType=Nt.setCurrentType.bind(Nt),Nt}return ue(Lt,Rt),Lt.prototype.getUi=function(){var Ct=this,Bt=document.createElement("div");Bt.style.display="flex",Bt.style.overflow="hidden",Bt.style.flexGrow="2";for(var _t=function(wn){var pi="both";switch(wn){case 0:pi="both";break;case 1:pi="start";break;case 2:pi="end";break;case 3:pi="none"}var Gn=document.createElement("div");if(Gn.style.display="flex",Gn.style.flexGrow="2",Gn.style.alignItems="center",Gn.style.justifyContent="space-between",Gn.style.padding="5px",Gn.style.borderWidth="2px",Gn.style.borderStyle="solid",Gn.style.borderColor=pi===Nt.currentType?Nt.uiStyleSettings.toolboxAccentColor:"transparent",Gn.addEventListener("click",function(){Ct.setCurrentType(pi,Gn)}),Bt.appendChild(Gn),pi==="both"||pi==="start"){var Yn=document.createElement("div");Yn.style.display="flex",Yn.style.alignItems="center",Yn.style.minHeight="20px",Yn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(Nt.uiStyleSettings!==void 0?Nt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Yn.style.marginLeft="5px",Gn.appendChild(Yn)}var Ci=document.createElement("div");Ci.style.display="flex",Ci.style.alignItems="center",Ci.style.minHeight="20px",Ci.style.flexGrow="2";var Pn=document.createElement("hr");if(Pn.style.minWidth="20px",Pn.style.border="0px",Pn.style.borderTop="3px solid "+(Nt.uiStyleSettings!==void 0?Nt.uiStyleSettings.toolboxColor:"#eeeeee"),Pn.style.flexGrow="2",Ci.appendChild(Pn),Gn.appendChild(Ci),pi==="both"||pi==="end"){var ki=document.createElement("div");ki.style.display="flex",ki.style.alignItems="center",ki.style.minHeight="20px",ki.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(Nt.uiStyleSettings!==void 0?Nt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ki.style.marginRight="5px",Gn.appendChild(ki)}Nt.typeBoxes.push(Gn)},Nt=this,Me=0;Me<4;Me++)_t(Me);return Bt},Lt.prototype.setCurrentType=function(Ct,Bt){var _t=this;this.currentType=Ct,this.typeBoxes.forEach(function(Nt){Nt.style.borderColor=Nt===Bt?_t.uiStyleSettings!==void 0?_t.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Lt}(et),Si=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.arrowType="end",Nt.arrowBaseHeight=10,Nt.arrowBaseWidth=10,Nt.getArrowPoints=Nt.getArrowPoints.bind(Nt),Nt.setArrowType=Nt.setArrowType.bind(Nt),Nt.arrowTypePanel=new nn("Arrow type","end"),Nt.arrowTypePanel.onArrowTypeChanged=Nt.setArrowType,Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.arrow1&&Ct!==this.arrow2)},Lt.prototype.getArrowPoints=function(Ct,Bt){var _t=this.arrowBaseWidth+2*this.strokeWidth,Nt=this.arrowBaseHeight+2*this.strokeWidth;return Ct-_t/2+","+(Bt+Nt/2)+" "+Ct+","+(Bt-Nt/2)+" "+(Ct+_t/2)+","+(Bt+Nt/2)},Lt.prototype.createTips=function(){this.arrow1=oe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=oe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow2)},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(Rt.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",oe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),oe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var Ct=0;Math.abs(this.x1-this.x2)>.1&&(Ct=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var Bt=this.arrow1.transform.baseVal.getItem(0);Bt.setRotate(Ct,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Bt,0);var _t=this.arrow2.transform.baseVal.getItem(0);_t.setRotate(Ct+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(_t,0)}},Lt.prototype.setArrowType=function(Ct){this.arrowType=Ct,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Object.assign({arrowType:this.arrowType},Rt.prototype.getState.call(this));return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){Rt.prototype.restoreState.call(this,Ct);var Bt=Ct;this.arrowType=Bt.arrowType,this.createTips(),this.adjustVisual()},Lt.typeName="ArrowMarker",Lt.title="Arrow marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Lt}(Ge),oi=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.fillColor=_t.defaultFillColor,Nt.strokeWidth=0,Nt.fillPanel=new nt("Color",_t.defaultColorSet,_t.defaultFillColor),Nt.fillPanel.onColorChanged=Nt.setFillColor,Nt}return ue(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Rt.prototype.getState.call(this);return Ct.typeName=Lt.typeName,Ct},Lt.typeName="CoverMarker",Lt.title="Cover marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Lt}(Et),Bi=function(Rt){function Lt(Ct,Bt,_t,Nt){var Me=Rt.call(this,Ct,Nt||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Me.opacities=[],Me.opacityBoxes=[],Me.opacities=Bt,Me.currentOpacity=_t,Me.setCurrentOpacity=Me.setCurrentOpacity.bind(Me),Me}return ue(Lt,Rt),Lt.prototype.getUi=function(){var Ct=this,Bt=document.createElement("div");return Bt.style.display="flex",Bt.style.overflow="hidden",Bt.style.flexGrow="2",Bt.style.justifyContent="space-between",this.opacities.forEach(function(_t){var Nt=document.createElement("div");Nt.style.display="flex",Nt.style.alignItems="center",Nt.style.justifyContent="center",Nt.style.padding="5px",Nt.style.borderWidth="2px",Nt.style.borderStyle="solid",Nt.style.borderColor=_t===Ct.currentOpacity?Ct.uiStyleSettings.toolboxAccentColor:"transparent",Nt.addEventListener("click",function(){Ct.setCurrentOpacity(_t,Nt)}),Bt.appendChild(Nt);var Me=document.createElement("div");Me.innerText=100*_t+"%",Nt.appendChild(Me),Ct.opacityBoxes.push(Nt)}),Bt},Lt.prototype.setCurrentOpacity=function(Ct,Bt){var _t=this;this.currentOpacity=Ct,this.opacityBoxes.forEach(function(Nt){Nt.style.borderColor=Nt===Bt?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Lt}(et),so=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.setOpacity=Nt.setOpacity.bind(Nt),Nt.fillColor=_t.defaultHighlightColor,Nt.strokeWidth=0,Nt.opacity=_t.defaultHighlightOpacity,Nt.fillPanel=new nt("Color",_t.defaultColorSet,Nt.fillColor),Nt.fillPanel.onColorChanged=Nt.setFillColor,Nt.opacityPanel=new Bi("Opacity",_t.defaultOpacitySteps,Nt.opacity),Nt.opacityPanel.onOpacityChanged=Nt.setOpacity,Nt}return ue(Lt,Rt),Lt.prototype.setOpacity=function(Ct){this.opacity=Ct,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Rt.prototype.getState.call(this);return Ct.typeName=Lt.typeName,Ct},Lt.typeName="HighlightMarker",Lt.title="Highlight marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',Lt}(oi),Qt='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',zt='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',He=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.bgColor="transparent",Nt.tipPosition={x:0,y:0},Nt.tipBase1Position={x:0,y:0},Nt.tipBase2Position={x:0,y:0},Nt.tipMoving=!1,Nt.color=_t.defaultStrokeColor,Nt.bgColor=_t.defaultFillColor,Nt.fontFamily=_t.defaultFontFamily,Nt.defaultSize={x:100,y:30},Nt.setBgColor=Nt.setBgColor.bind(Nt),Nt.getTipPoints=Nt.getTipPoints.bind(Nt),Nt.positionTip=Nt.positionTip.bind(Nt),Nt.setTipPoints=Nt.setTipPoints.bind(Nt),Nt.colorPanel=new nt("Text color",_t.defaultColorSet,Nt.color,Qt),Nt.colorPanel.onColorChanged=Nt.setColor,Nt.bgColorPanel=new nt("Fill color",_t.defaultColorSet,Nt.bgColor,zt),Nt.bgColorPanel.onColorChanged=Nt.setBgColor,Nt.fontFamilyPanel=new fe("Font",_t.defaultFontFamilies,_t.defaultFontFamily),Nt.fontFamilyPanel.onFontChanged=Nt.setFont,Nt.tipGrip=new pt,Nt.tipGrip.visual.transform.baseVal.appendItem(oe.createTransform()),Nt.controlBox.appendChild(Nt.tipGrip.visual),Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return Rt.prototype.ownsTarget.call(this,Ct)||this.tipGrip.ownsTarget(Ct)||this.tip===Ct},Lt.prototype.createTip=function(){oe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=oe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},Lt.prototype.pointerDown=function(Ct,Bt){this.state==="new"&&Rt.prototype.pointerDown.call(this,Ct,Bt),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Bt)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Rt.prototype.pointerDown.call(this,Ct,Bt)},Lt.prototype.pointerUp=function(Ct){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Rt.prototype.pointerUp.call(this,Ct);else{var Bt=this.state==="creating";Rt.prototype.pointerUp.call(this,Ct),this.setTipPoints(Bt),this.positionTip()}},Lt.prototype.manipulate=function(Ct){if(this.tipMoving){var Bt=this.unrotatePoint(Ct);this.tipPosition={x:Bt.x-this.manipulationStartLeft,y:Bt.y-this.manipulationStartTop},this.positionTip()}else Rt.prototype.manipulate.call(this,Ct)},Lt.prototype.setBgColor=function(Ct){this.bgRectangle&&this.tip&&(oe.setAttributes(this.bgRectangle,[["fill",Ct]]),oe.setAttributes(this.tip,[["fill",Ct]])),this.bgColor=Ct,this.fillColorChanged(Ct)},Lt.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},Lt.prototype.setTipPoints=function(Ct){Ct===void 0&&(Ct=!1);var Bt=Math.min(this.height/2,15),_t=this.height/5;Ct&&(this.tipPosition={x:Bt+_t/2,y:this.height+20});var Nt=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Nt<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(_t=this.width/5,Bt=Math.min(this.width/2,15),this.tipBase1Position={x:Bt,y:0},this.tipBase2Position={x:Bt+_t,y:0}):(this.tipBase1Position={x:0,y:Bt},this.tipBase2Position={x:0,y:Bt+_t}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Nt<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(_t=this.width/5,Bt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Bt-_t,y:0},this.tipBase2Position={x:this.width-Bt,y:0}):(this.tipBase1Position={x:this.width,y:Bt},this.tipBase2Position={x:this.width,y:Bt+_t}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Nt<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(_t=this.width/5,Bt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Bt-_t,y:this.height},this.tipBase2Position={x:this.width-Bt,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Bt-_t},this.tipBase2Position={x:this.width,y:this.height-Bt}):Nt<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(_t=this.width/5,Bt=Math.min(this.width/2,15),this.tipBase1Position={x:Bt,y:this.height},this.tipBase2Position={x:Bt+_t,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Bt},this.tipBase2Position={x:0,y:this.height-Bt-_t})},Lt.prototype.resize=function(Ct){Rt.prototype.resize.call(this,Ct),this.positionTip()},Lt.prototype.positionTip=function(){oe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Ct=this.tipGrip.visual.transform.baseVal.getItem(0);Ct.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Ct,0)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.select=function(){this.positionTip(),Rt.prototype.select.call(this)},Lt.prototype.getState=function(){var Ct=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Rt.prototype.getState.call(this));return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){var Bt=Ct;this.bgColor=Bt.bgColor,this.tipPosition=Bt.tipPosition,Rt.prototype.restoreState.call(this,Ct),this.createTip(),this.setTipPoints()},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt),this.tipPosition={x:this.tipPosition.x*Ct,y:this.tipPosition.y*Bt},this.positionTip()},Lt.typeName="CalloutMarker",Lt.title="Callout marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',Lt}(Ke),En=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.fillColor="transparent",Nt.strokeColor="transparent",Nt.strokeWidth=0,Nt.strokeDasharray="",Nt.opacity=1,Nt.strokeColor=_t.defaultColor,Nt.strokeWidth=_t.defaultStrokeWidth,Nt.strokeDasharray=_t.defaultStrokeDasharray,Nt.fillColor=_t.defaultFillColor,Nt.setStrokeColor=Nt.setStrokeColor.bind(Nt),Nt.setFillColor=Nt.setFillColor.bind(Nt),Nt.setStrokeWidth=Nt.setStrokeWidth.bind(Nt),Nt.setStrokeDasharray=Nt.setStrokeDasharray.bind(Nt),Nt.setOpacity=Nt.setOpacity.bind(Nt),Nt.createVisual=Nt.createVisual.bind(Nt),Nt.strokePanel=new nt("Line color",ye(_t.defaultColorSet,["transparent"]),_t.defaultColor),Nt.strokePanel.onColorChanged=Nt.setStrokeColor,Nt.fillPanel=new nt("Fill color",ye(_t.defaultColorSet,["transparent"]),Nt.fillColor,zt),Nt.fillPanel.onColorChanged=Nt.setFillColor,Nt.strokeWidthPanel=new Ht("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Nt.strokeWidthPanel.onWidthChanged=Nt.setStrokeWidth,Nt.strokeStylePanel=new Zt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Nt.strokeStylePanel.onStyleChanged=Nt.setStrokeDasharray,Nt.opacityPanel=new Bi("Opacity",_t.defaultOpacitySteps,Nt.opacity),Nt.opacityPanel.onOpacityChanged=Nt.setOpacity,Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.visual)},Lt.prototype.createVisual=function(){this.visual=oe.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.state==="new"&&(this.createVisual(),this.moveVisual(Ct),this._state="creating")},Lt.prototype.manipulate=function(Ct){Rt.prototype.manipulate.call(this,Ct)},Lt.prototype.resize=function(Ct){Rt.prototype.resize.call(this,Ct),this.setSize()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),oe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},Lt.prototype.pointerUp=function(Ct){Rt.prototype.pointerUp.call(this,Ct),this.setSize()},Lt.prototype.setStrokeColor=function(Ct){this.strokeColor=Ct,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Ct),this.stateChanged()},Lt.prototype.setFillColor=function(Ct){this.fillColor=Ct,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Ct),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Ct){this.strokeWidth=Ct,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Ct){this.strokeDasharray=Ct,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.setOpacity=function(Ct){this.opacity=Ct,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Rt.prototype.getState.call(this));return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){var Bt=Ct;this.fillColor=Bt.fillColor,this.strokeColor=Bt.strokeColor,this.strokeWidth=Bt.strokeWidth,this.strokeDasharray=Bt.strokeDasharray,this.opacity=Bt.opacity,this.createVisual(),Rt.prototype.restoreState.call(this,Ct),this.setSize()},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt),this.setSize()},Lt.typeName="EllipseMarker",Lt.title="Ellipse marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Lt}(kt),Fn=function(Rt){function Lt(Ct,Bt,_t){return Rt.call(this,Ct,Bt,_t)||this}return ue(Lt,Rt),Object.defineProperty(Lt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.tip1&&Ct!==this.tip2)},Lt.prototype.createTips=function(){this.tip1=oe.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=oe.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.tip2)},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(Rt.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(oe.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var Ct=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Bt=this.tip1.transform.baseVal.getItem(0);Bt.setRotate(Ct,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Bt,0);var _t=this.tip2.transform.baseVal.getItem(0);_t.setRotate(Ct+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(_t,0)}},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Rt.prototype.getState.call(this);return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){Rt.prototype.restoreState.call(this,Ct),this.createTips(),this.adjustVisual()},Lt.typeName="MeasurementMarker",Lt.title="Measurement marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',Lt}(Ge),Te=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.strokePanel.colors=_t.defaultColorSet,Nt.fillColor="transparent",Nt}return ue(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Rt.prototype.getState.call(this);return Ct.typeName=Lt.typeName,Ct},Lt.typeName="EllipseFrameMarker",Lt.title="Ellipse frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Lt}(En),ln=function(){function Rt(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Rt.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Rt.prototype.addUndoStep=function(Lt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Lt)||(this.undoStack.push(Lt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Lt)&&this.redoStack.splice(0,this.redoStack.length))},Rt.prototype.replaceLastUndoStep=function(Lt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Lt)},Rt.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Rt.prototype.undo=function(){if(this.undoStack.length>1){var Lt=this.undoStack.pop();return Lt!==void 0&&this.redoStack.push(Lt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Rt.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Rt}(),pn=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.strokeColor="transparent",Nt.strokeWidth=0,Nt.strokeDasharray="",Nt.curveX=0,Nt.curveY=0,Nt.manipulationStartCurveX=0,Nt.manipulationStartCurveY=0,Nt.setStrokeColor=Nt.setStrokeColor.bind(Nt),Nt.setStrokeWidth=Nt.setStrokeWidth.bind(Nt),Nt.setStrokeDasharray=Nt.setStrokeDasharray.bind(Nt),Nt.positionGrips=Nt.positionGrips.bind(Nt),Nt.addControlGrips=Nt.addControlGrips.bind(Nt),Nt.adjustVisual=Nt.adjustVisual.bind(Nt),Nt.setupControlBox=Nt.setupControlBox.bind(Nt),Nt.resize=Nt.resize.bind(Nt),Nt.strokeColor=_t.defaultColor,Nt.strokeWidth=_t.defaultStrokeWidth,Nt.strokeDasharray=_t.defaultStrokeDasharray,Nt.strokePanel=new nt("Line color",_t.defaultColorSet,_t.defaultColor),Nt.strokePanel.onColorChanged=Nt.setStrokeColor,Nt.strokeWidthPanel=new Ht("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Nt.strokeWidthPanel.onWidthChanged=Nt.setStrokeWidth,Nt.strokeStylePanel=new Zt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Nt.strokeStylePanel.onStyleChanged=Nt.setStrokeDasharray,Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.visual&&Ct!==this.selectorCurve&&Ct!==this.visibleCurve&&!this.curveGrip.ownsTarget(Ct))},Lt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Lt.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorCurve=oe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=oe.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Ct.x,this.curveY=Ct.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Bt)&&(this.activeGrip=this.curveGrip,this._state="resize")},Lt.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),oe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setupControlBox=function(){Rt.prototype.setupControlBox.call(this),this.curveControlLine1=oe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=oe.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},Lt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Rt.prototype.addControlGrips.call(this)},Lt.prototype.positionGrips=function(){Rt.prototype.positionGrips.call(this);var Ct=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Ct/2,this.curveY-Ct/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},Lt.prototype.manipulate=function(Ct){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Ct.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Ct.y-this.manipulationStartY),Rt.prototype.manipulate.call(this,Ct)},Lt.prototype.resize=function(Ct){this.activeGrip===this.curveGrip&&(this.curveX=Ct.x,this.curveY=Ct.y),Rt.prototype.resize.call(this,Ct),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Lt.prototype.setStrokeColor=function(Ct){this.strokeColor=Ct,this.adjustVisual(),this.colorChanged(Ct)},Lt.prototype.setStrokeWidth=function(Ct){this.strokeWidth=Ct,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Ct){this.strokeDasharray=Ct,this.adjustVisual()},Lt.prototype.scale=function(Ct,Bt){this.curveX=this.curveX*Ct,this.curveY=this.curveY*Bt,Rt.prototype.scale.call(this,Ct,Bt)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Rt.prototype.getState.call(this));return Ct.typeName=Lt.typeName,Ct},Lt.prototype.restoreState=function(Ct){Rt.prototype.restoreState.call(this,Ct);var Bt=Ct;this.strokeColor=Bt.strokeColor,this.strokeWidth=Bt.strokeWidth,this.strokeDasharray=Bt.strokeDasharray,this.curveX=Bt.curveX,this.curveY=Bt.curveY,this.createVisual(),this.adjustVisual()},Lt.typeName="CurveMarker",Lt.title="Curve marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',Lt}(re),ni=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,Bt,_t)||this;return Nt.fillColor="transparent",Nt.strokeColor="transparent",Nt.strokeWidth=0,Nt.strokeDasharray="",Nt.textColor="transparent",Nt.fontSize="1rem",Nt.isMoved=!1,Nt.captionText="Caption",Nt.PADDING=5,Nt.captionBoxWidth=0,Nt.captionBoxHeight=0,Nt.strokeColor=_t.defaultColor,Nt.strokeWidth=_t.defaultStrokeWidth,Nt.strokeDasharray=_t.defaultStrokeDasharray,Nt.fillColor=_t.defaultFillColor,Nt.textColor=_t.defaultStrokeColor,Nt.fontFamily=_t.defaultFontFamily,Nt.fontSize=_t.defaultCaptionFontSize,Nt.captionText=_t.defaultCaptionText,Nt.setStrokeColor=Nt.setStrokeColor.bind(Nt),Nt.setFillColor=Nt.setFillColor.bind(Nt),Nt.setStrokeWidth=Nt.setStrokeWidth.bind(Nt),Nt.setStrokeDasharray=Nt.setStrokeDasharray.bind(Nt),Nt.createVisual=Nt.createVisual.bind(Nt),Nt.sizeCaption=Nt.sizeCaption.bind(Nt),Nt.setCaptionText=Nt.setCaptionText.bind(Nt),Nt.showTextEditor=Nt.showTextEditor.bind(Nt),Nt.positionTextEditor=Nt.positionTextEditor.bind(Nt),Nt.finishTextEditing=Nt.finishTextEditing.bind(Nt),Nt.setFont=Nt.setFont.bind(Nt),Nt.setTextColor=Nt.setTextColor.bind(Nt),Nt.strokePanel=new nt("Line color",ye(_t.defaultColorSet,["transparent"]),Nt.strokeColor),Nt.strokePanel.onColorChanged=Nt.setStrokeColor,Nt.fillPanel=new nt("Fill color",ye(_t.defaultColorSet,["transparent"]),Nt.fillColor,zt),Nt.fillPanel.onColorChanged=Nt.setFillColor,Nt.strokeWidthPanel=new Ht("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Nt.strokeWidthPanel.onWidthChanged=Nt.setStrokeWidth,Nt.strokeStylePanel=new Zt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Nt.strokeStylePanel.onStyleChanged=Nt.setStrokeDasharray,Nt.fontFamilyPanel=new fe("Font",_t.defaultFontFamilies,_t.defaultFontFamily),Nt.fontFamilyPanel.onFontChanged=Nt.setFont,Nt.textColorPanel=new nt("Text color",_t.defaultColorSet,Nt.textColor,Qt),Nt.textColorPanel.onColorChanged=Nt.setTextColor,Nt}return ue(Lt,Rt),Lt.prototype.ownsTarget=function(Ct){return!(!Rt.prototype.ownsTarget.call(this,Ct)&&Ct!==this.visual&&Ct!==this.frame&&Ct!==this.captionBg&&Ct!==this.captionElement)},Lt.prototype.createVisual=function(){this.visual=oe.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=oe.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=oe.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=oe.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},Lt.prototype.setCaptionText=function(Ct){this.captionText=Ct,this.captionElement.textContent=this.captionText,this.sizeCaption()},Lt.prototype.pointerDown=function(Ct,Bt){Rt.prototype.pointerDown.call(this,Ct,Bt),this.isMoved=!1,this.pointerDownPoint=Ct,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Ct),this._state="creating")},Lt.prototype.manipulate=function(Ct){Rt.prototype.manipulate.call(this,Ct),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Ct.x-this.pointerDownPoint.x)>5||Math.abs(Ct.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Ct){Rt.prototype.resize.call(this,Ct),this.setSize()},Lt.prototype.sizeCaption=function(){var Ct=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=Ct.width+2*this.PADDING,this.captionBoxHeight=Ct.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),oe.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),oe.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},Lt.prototype.showTextEditor=function(){var Ct=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(Bt){Bt.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(Bt){Bt.key==="Enter"&&Ct.finishTextEditing(Ct.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(Bt){Bt.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){Ct.finishTextEditing(Ct.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){Ct.finishTextEditing(Ct.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Lt.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},Lt.prototype.finishTextEditing=function(Ct){this.setCaptionText(Ct.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Lt.prototype.setFont=function(Ct){this.captionElement&&oe.setAttributes(this.captionElement,[["font-family",Ct]]),this.fontFamily=Ct,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Lt.prototype.setTextColor=function(Ct){this.captionElement&&oe.setAttributes(this.captionElement,[["fill",Ct]]),this.textColor=Ct,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),oe.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Lt.prototype.pointerUp=function(Ct){Rt.prototype.pointerUp.call(this,Ct),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.dblClick=function(Ct,Bt){Rt.prototype.dblClick.call(this,Ct,Bt),this.showTextEditor()},Lt.prototype.setStrokeColor=function(Ct){this.strokeColor=Ct,this.frame&&oe.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Ct),this.stateChanged()},Lt.prototype.setFillColor=function(Ct){this.fillColor=Ct,this.captionBg&&oe.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Ct),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Ct){this.strokeWidth=Ct,this.frame&&oe.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Ct){this.strokeDasharray=Ct,this.frame&&oe.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Ct=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},Rt.prototype.getState.call(this));return Ct.typeName=this.typeName,Ct},Lt.prototype.restoreState=function(Ct){var Bt=Ct;this.fillColor=Bt.fillColor,this.strokeColor=Bt.strokeColor,this.strokeWidth=Bt.strokeWidth,this.strokeDasharray=Bt.strokeDasharray,this.textColor=Bt.textColor,this.fontFamily=Bt.fontFamily,this.captionText=Bt.captionText,this.fontSize=Bt.fontSize,this.createVisual(),Rt.prototype.restoreState.call(this,Ct),this.setSize()},Lt.prototype.scale=function(Ct,Bt){Rt.prototype.scale.call(this,Ct,Bt),this.setSize()},Lt.typeName="CaptionFrameMarker",Lt.title="Caption frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',Lt}(kt),Cn=function(){function Rt(Lt,Ct){Ct===void 0&&(Ct=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Lt,this.cancelable=Ct}return Object.defineProperty(Rt.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Rt.prototype.preventDefault=function(){this._defaultPrevented=!0},Rt}(),he=function(Rt){function Lt(Ct,Bt,_t){var Nt=Rt.call(this,Ct,!1)||this;return Nt.dataUrl=Bt,Nt.state=_t,Nt}return ue(Lt,Rt),Lt}(Cn),Ae=function(Rt){function Lt(Ct,Bt,_t){_t===void 0&&(_t=!1);var Nt=Rt.call(this,Ct,_t)||this;return Nt.marker=Bt,Nt}return ue(Lt,Rt),Lt}(Cn),hn=function(){function Rt(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Rt.prototype.addEventListener=function(Lt,Ct){this[Lt].push(Ct)},Rt.prototype.removeEventListener=function(Lt,Ct){var Bt=this[Lt].indexOf(Ct);Bt>-1&&this[Lt].splice(Bt,1)},Rt}(),De=function(){function Rt(Lt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new le,this._isOpen=!1,this.undoRedoManager=new ln,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new hn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Rt.instanceCounter++,this.styles=new we(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Lt,this.targetRoot=document.body,this.width=Lt.clientWidth,this.height=Lt.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Rt.prototype,"ALL_MARKER_TYPES",{get:function(){return[ie,an,Si,Ke,Te,En,so,He,Fn,oi,Ge,pn,ni]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ie,an,Si,Ke,En,so,He]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ie,an,Si,Ke,so]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Lt){var Ct=this;this._availableMarkerTypes.splice(0),Lt.forEach(function(Bt){if(typeof Bt=="string"){var _t=Ct.ALL_MARKER_TYPES.find(function(Nt){return Nt.typeName===Bt});_t!==void 0&&Ct._availableMarkerTypes.push(_t)}else Ct._availableMarkerTypes.push(Bt)})},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Lt){this._zoomLevel=Lt,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Rt.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Yt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Rt.prototype.show=function(){var Lt=this;this.styles.styleSheetRoot===void 0&&ge.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ge.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Ct){return Ct(new Cn(Lt))})},Rt.prototype.render=function(){return _e(this,void 0,void 0,function(){var Lt;return $e(this,function(Ct){switch(Ct.label){case 0:return this.setCurrentMarker(),(Lt=new Ne).naturalSize=this.renderAtNaturalSize,Lt.imageType=this.renderImageType,Lt.imageQuality=this.renderImageQuality,Lt.markersOnly=this.renderMarkersOnly,Lt.width=this.renderWidth,Lt.height=this.renderHeight,[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Ct.sent(),[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Ct.sent()]}})})},Rt.prototype.close=function(Lt){var Ct=this;if(Lt===void 0&&(Lt=!1),this.isOpen){var Bt=!1;Lt||this.eventListeners.beforeclose.forEach(function(_t){var Nt=new Cn(Ct,!0);_t(Nt),Nt.defaultPrevented&&(Bt=!0)}),Bt||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(_t){return _t(new Cn(Ct))}),this.detachEvents(),this._isOpen=!1)}},Rt.prototype.addMarkersToToolbar=function(){for(var Lt,Ct=[],Bt=0;Bt<arguments.length;Bt++)Ct[Bt]=arguments[Bt];(Lt=this._availableMarkerTypes).push.apply(Lt,Ct)},Rt.prototype.addRenderEventListener=function(Lt){this.addEventListener("render",function(Ct){Lt(Ct.dataUrl,Ct.state)})},Rt.prototype.removeRenderEventListener=function(Lt){},Rt.prototype.addCloseEventListener=function(Lt){this.addEventListener("close",function(){Lt()})},Rt.prototype.removeCloseEventListener=function(Lt){},Rt.prototype.setupResizeObserver=function(){var Lt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Lt.resize(Lt.target.clientWidth,Lt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Lt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Rt.prototype.onPopupTargetResize=function(){var Lt=1*this.target.clientWidth/this.target.clientHeight,Ct=this.editorCanvas.clientWidth/Lt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Lt:this.editorCanvas.clientWidth,Bt=Ct<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Lt;this.resize(Ct,Bt)},Rt.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Rt.prototype.resize=function(Lt,Ct){this._isResizing=!0;var Bt=Lt/this.imageWidth,_t=Ct/this.imageHeight;this.imageWidth=Math.round(Lt),this.imageHeight=Math.round(Ct),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Bt,_t),this._isResizing=!1},Rt.prototype.scaleMarkers=function(Lt,Ct){var Bt,_t=this;this._currentMarker&&this._currentMarker instanceof Ke?this._currentMarker.scale(Lt,Ct):(Bt=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Nt){Nt!==_t._currentMarker&&Nt.scale(Lt,Ct)}),Bt!==void 0&&this.setCurrentMarker(Bt)},Rt.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},Rt.prototype.setTopLeft=function(){var Lt=this.editingTarget.getBoundingClientRect(),Ct=this.editorCanvas.getBoundingClientRect();this.left=Lt.left-Ct.left,this.top=Lt.top-Ct.top},Rt.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},Rt.prototype.addDefs=function(){for(var Lt,Ct=[],Bt=0;Bt<arguments.length;Bt++)Ct[Bt]=arguments[Bt];this.defs=oe.createDefs(),this.addDefsToImage(),(Lt=this.defs).append.apply(Lt,Ct)},Rt.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Rt.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},Rt.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Rt.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Rt.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},Rt.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Rt.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},Rt.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var Lt=document.createElement("a");Lt.href="https://markerjs.com/",Lt.target="_blank",Lt.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',Lt.title="Powered by marker.js",Lt.style.display="grid",Lt.style.alignItems="center",Lt.style.justifyItems="center",Lt.style.padding="3px",Lt.style.width="20px",Lt.style.height="20px",this.logoUI.appendChild(Lt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Rt.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Rt.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Rt.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Rt.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var Lt=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Lt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new on(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ft(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Rt.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Rt.prototype.removeMarker=function(Lt){this.markerImage.removeChild(Lt.container),this.markers.indexOf(Lt)>-1&&this.markers.splice(this.markers.indexOf(Lt),1),Lt.dispose()},Rt.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Rt.prototype.toolbarButtonClicked=function(Lt,Ct){if(Lt==="marker"&&Ct!==void 0)this.createNewMarker(Ct);else if(Lt==="action")switch(Ct){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Rt.prototype.deleteSelectedMarker=function(){var Lt=this;if(this._currentMarker!==void 0){var Ct=!1;if(this.eventListeners.markerbeforedelete.forEach(function(_t){var Nt=new Ae(Lt,Lt._currentMarker,!0);_t(Nt),Nt.defaultPrevented&&(Ct=!0)}),!Ct){var Bt=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(_t){return _t(new Ae(Lt,Bt))})}}},Rt.prototype.clear=function(){var Lt=this,Ct=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Me){var wn=new Ae(Lt,void 0,!0);Me(wn),wn.defaultPrevented&&(Ct=!0)}),!Ct)){this.setCurrentMarker();for(var Bt=function(Me){var wn=_t.markers[Me];_t.setCurrentMarker(_t.markers[Me]),_t._currentMarker.dispose(),_t.markerImage.removeChild(_t._currentMarker.container),_t.markers.splice(_t.markers.indexOf(_t._currentMarker),1),_t.eventListeners.markerdelete.forEach(function(pi){return pi(new Ae(Lt,wn))})},_t=this,Nt=this.markers.length-1;Nt>=0;Nt--)Bt(Nt);this.addUndoStep()}},Object.defineProperty(Rt.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Rt.prototype.showNotesEditor=function(){var Lt;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(Lt=this._currentMarker.notes)!==null&&Lt!==void 0?Lt:"",this.overlayContainer.appendChild(this.notesArea))},Rt.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Rt.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Rt.prototype.addUndoStep=function(){var Lt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Ct=this.getState(),Bt=this.undoRedoManager.getLastUndoStep();if(!Bt||Bt.width===Ct.width&&Bt.height===Ct.height){var _t=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Ct),_t<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Nt){return Nt(new Cn(Lt))})}else this.undoRedoManager.replaceLastUndoStep(Ct),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Cn(Lt))})}},Rt.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Rt.prototype.undoStep=function(){var Lt=this,Ct=this.undoRedoManager.undo();Ct!==void 0&&(this.restoreState(Ct),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Bt){return Bt(new Cn(Lt))}))},Rt.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Rt.prototype.redoStep=function(){var Lt=this,Ct=this.undoRedoManager.redo();Ct!==void 0&&(this.restoreState(Ct),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Bt){return Bt(new Cn(Lt))}))},Rt.prototype.stepZoom=function(){var Lt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Lt<this.zoomSteps.length-1?this.zoomSteps[Lt+1]:this.zoomSteps[0]},Rt.prototype.panTo=function(Lt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Lt.x,top:this.prevPanPoint.y-Lt.y}),this.prevPanPoint=Lt},Rt.prototype.startRenderAndClose=function(){return _e(this,void 0,void 0,function(){var Lt,Ct,Bt=this;return $e(this,function(_t){switch(_t.label){case 0:return[4,this.render()];case 1:return Lt=_t.sent(),Ct=this.getState(),this.eventListeners.render.forEach(function(Nt){return Nt(new he(Bt,Lt,Ct))}),this.close(!0),[2]}})})},Rt.prototype.getState=function(Lt){Lt===!0&&this.setCurrentMarker();var Ct={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Bt){return Ct.markers.push(Bt.getState())}),Ct},Rt.prototype.restoreState=function(Lt){var Ct=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Lt.markers.forEach(function(Bt){var _t=Ct._availableMarkerTypes.find(function(Me){return Me.typeName===Bt.typeName});if(_t!==void 0){var Nt=Ct.addNewMarker(_t);Nt.restoreState(Bt),Ct.markers.push(Nt)}}),Lt.width&&Lt.height&&(Lt.width!==this.imageWidth||Lt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Lt.width,this.imageHeight/Lt.height),this.eventListeners.restorestate.forEach(function(Bt){return Bt(new Cn(Ct))})},Rt.prototype.addNewMarker=function(Lt){var Ct=oe.createGroup();return this.markerImage.appendChild(Ct),new Lt(Ct,this.overlayContainer,this.settings)},Rt.prototype.createNewMarker=function(Lt){var Ct,Bt=this;(Ct=typeof Lt=="string"?this._availableMarkerTypes.find(function(_t){return _t.typeName===Lt}):Lt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Ct),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(Ct.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(_t){return _t(new Ae(Bt,Bt._currentMarker))}))},Rt.prototype.markerCreated=function(Lt){var Ct=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Lt),this.setCurrentMarker(Lt),Lt instanceof an&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(an):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Bt){return Bt(new Ae(Ct,Ct._currentMarker))})},Rt.prototype.colorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Lt,this.settings.defaultStrokeColor=Lt)},Rt.prototype.fillColorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Lt)},Rt.prototype.markerStateChanged=function(Lt){var Ct=this;this.eventListeners.markerchange.forEach(function(Bt){return Bt(new Ae(Ct,Lt))})},Rt.prototype.setCurrentMarker=function(Lt){var Ct=this;this._currentMarker!==Lt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Bt){return Bt(new Ae(Ct,Ct._currentMarker))})),this._currentMarker=Lt,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Bt){return Bt(new Ae(Ct,Ct._currentMarker))}))},Rt.prototype.onPointerDown=function(Lt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Lt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Ct=this.markers.find(function(Bt){return Bt.ownsTarget(Lt.target)});Ct!==void 0?(this.setCurrentMarker(Ct),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Lt.clientX,y:Lt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY))},Rt.prototype.onDblClick=function(Lt){if(this._isFocused||this.focus(),this.mode==="select"){var Ct=this.markers.find(function(Bt){return Bt.ownsTarget(Lt.target)});Ct!==void 0&&Ct!==this._currentMarker&&this.setCurrentMarker(Ct),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target):this.setCurrentMarker()}},Rt.prototype.onPointerMove=function(Lt){this.touchPoints!==1&&Lt.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Lt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)):this.zoomLevel>1&&this.panTo({x:Lt.clientX,y:Lt.clientY}))},Rt.prototype.onPointerUp=function(Lt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)),this.isDragging=!1,this.addUndoStep()},Rt.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Rt.prototype.onKeyUp=function(Lt){this._currentMarker===void 0||this.notesArea!==void 0||Lt.key!=="Delete"&&Lt.key!=="Backspace"||this.deleteSelectedMarker()},Rt.prototype.clientToLocalCoordinates=function(Lt,Ct){var Bt=this.markerImage.getBoundingClientRect();return{x:(Lt-Bt.left)/this.zoomLevel,y:(Ct-Bt.top)/this.zoomLevel}},Rt.prototype.onWindowResize=function(){this.positionUI()},Rt.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Lt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Lt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Rt.prototype.addLicenseKey=function(Lt){Yt.addKey(Lt)},Rt.prototype.addEventListener=function(Lt,Ct){this.eventListeners.addEventListener(Lt,Ct)},Rt.prototype.removeEventListener=function(Lt,Ct){this.eventListeners.removeEventListener(Lt,Ct)},Rt.prototype.renderState=function(Lt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Lt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Rt.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Rt.prototype.focus=function(){var Lt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Ct){return Ct(new Cn(Lt))}))},Rt.prototype.blur=function(){var Lt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Ct){return Ct(new Cn(Lt))}))},Rt.instanceCounter=0,Rt}()},42289:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return co}});function wt(qt){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},wt(qt)}function ue(qt,se){if(wt(qt)!="object"||!qt)return qt;var ve=qt[Symbol.toPrimitive];if(ve!==void 0){var je=ve.call(qt,se||"default");if(wt(je)!="object")return je;throw new TypeError("@@toPrimitive must return a primitive value.")}return(se==="string"?String:Number)(qt)}function _e(qt){var se=ue(qt,"string");return wt(se)=="symbol"?se:se+""}function $e(qt,se,ve){return(se=_e(se))in qt?Object.defineProperty(qt,se,{value:ve,enumerable:!0,configurable:!0,writable:!0}):qt[se]=ve,qt}function ye(qt,se){var ve=Object.keys(qt);if(Object.getOwnPropertySymbols){var je=Object.getOwnPropertySymbols(qt);se&&(je=je.filter(function(fn){return Object.getOwnPropertyDescriptor(qt,fn).enumerable})),ve.push.apply(ve,je)}return ve}function oe(qt){for(var se=1;se<arguments.length;se++){var ve=arguments[se]!=null?arguments[se]:{};se%2?ye(Object(ve),!0).forEach(function(je){$e(qt,je,ve[je])}):Object.getOwnPropertyDescriptors?Object.defineProperties(qt,Object.getOwnPropertyDescriptors(ve)):ye(Object(ve)).forEach(function(je){Object.defineProperty(qt,je,Object.getOwnPropertyDescriptor(ve,je))})}return qt}function Yt(qt){if(Array.isArray(qt))return qt}function Ne(qt,se){var ve=qt==null?null:typeof Symbol!="undefined"&&qt[Symbol.iterator]||qt["@@iterator"];if(ve!=null){var je,fn,Kn,yn,qe=[],At=!0,An=!1;try{if(Kn=(ve=ve.call(qt)).next,se===0){if(Object(ve)!==ve)return;At=!1}else for(;!(At=(je=Kn.call(ve)).done)&&(qe.push(je.value),qe.length!==se);At=!0);}catch(_i){An=!0,fn=_i}finally{try{if(!At&&ve.return!=null&&(yn=ve.return(),Object(yn)!==yn))return}finally{if(An)throw fn}}return qe}}function ge(qt,se){(se==null||se>qt.length)&&(se=qt.length);for(var ve=0,je=Array(se);ve<se;ve++)je[ve]=qt[ve];return je}function we(qt,se){if(qt){if(typeof qt=="string")return ge(qt,se);var ve={}.toString.call(qt).slice(8,-1);return ve==="Object"&&qt.constructor&&(ve=qt.constructor.name),ve==="Map"||ve==="Set"?Array.from(qt):ve==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ve)?ge(qt,se):void 0}}function Ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Be(qt,se){return Yt(qt)||Ne(qt,se)||we(qt,se)||Ye()}function on(qt){if(Array.isArray(qt))return qt}function Ft(qt,se){var ve=qt==null?null:typeof Symbol!="undefined"&&qt[Symbol.iterator]||qt["@@iterator"];if(ve!=null){var je,fn,Kn,yn,qe=[],At=!0,An=!1;try{if(Kn=(ve=ve.call(qt)).next,se===0){if(Object(ve)!==ve)return;At=!1}else for(;!(At=(je=Kn.call(ve)).done)&&(qe.push(je.value),qe.length!==se);At=!0);}catch(_i){An=!0,fn=_i}finally{try{if(!At&&ve.return!=null&&(yn=ve.return(),Object(yn)!==yn))return}finally{if(An)throw fn}}return qe}}function et(qt,se){(se==null||se>qt.length)&&(se=qt.length);for(var ve=0,je=new Array(se);ve<se;ve++)je[ve]=qt[ve];return je}function nt(qt,se){if(qt){if(typeof qt=="string")return et(qt,se);var ve=Object.prototype.toString.call(qt).slice(8,-1);if(ve==="Object"&&qt.constructor&&(ve=qt.constructor.name),ve==="Map"||ve==="Set")return Array.from(qt);if(ve==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ve))return et(qt,se)}}function ht(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lt(qt,se){return on(qt)||Ft(qt,se)||nt(qt,se)||ht()}var pt=Vt(67294),vt=Vt(73935);function kt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Et={};function Ht(qt,se){}function Zt(qt,se){}function ie(){Et={}}function le(qt,se,ve){!se&&!Et[ve]&&(qt(!1,ve),Et[ve]=!0)}function re(qt,se){le(Ht,qt,se)}function Ge(qt,se){le(Zt,qt,se)}var fe=null;function Ke(qt){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},Ke(qt)}var an=Vt(18459);function nn(qt,se,ve){var je=pt.useRef({});return(!("value"in je.current)||ve(je.current.condition,se))&&(je.current.value=qt(),je.current.condition=se),je.current.value}function Si(qt,se){typeof qt=="function"?qt(se):Ke(qt)==="object"&&qt&&"current"in qt&&(qt.current=se)}function oi(){for(var qt=arguments.length,se=new Array(qt),ve=0;ve<qt;ve++)se[ve]=arguments[ve];var je=se.filter(function(fn){return fn});return je.length<=1?je[0]:function(fn){se.forEach(function(Kn){Si(Kn,fn)})}}function Bi(){for(var qt=arguments.length,se=new Array(qt),ve=0;ve<qt;ve++)se[ve]=arguments[ve];return nn(function(){return oi.apply(void 0,se)},se,function(je,fn){return je.length===fn.length&&je.every(function(Kn,yn){return Kn===fn[yn]})})}function so(qt){var se,ve,je=(0,an.isMemo)(qt)?qt.type.type:qt.type;return!(typeof je=="function"&&!((se=je.prototype)!==null&&se!==void 0&&se.render)||typeof qt=="function"&&!((ve=qt.prototype)!==null&&ve!==void 0&&ve.render))}var Qt=pt.createContext(null),zt=Qt;function He(qt){if(Array.isArray(qt))return et(qt)}function En(qt){if(typeof Symbol!="undefined"&&qt[Symbol.iterator]!=null||qt["@@iterator"]!=null)return Array.from(qt)}function Fn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Te(qt){return He(qt)||En(qt)||nt(qt)||Fn()}var ln=kt()?pt.useLayoutEffect:pt.useEffect,pn=ln,ni=function(se,ve){var je=React.useRef(!0);ln(function(){if(!je.current)return se()},ve),ln(function(){return je.current=!1,function(){je.current=!0}},[])},Cn=[];function he(qt,se){var ve=pt.useState(function(){if(!kt())return null;var Qi=document.createElement("div");return Qi}),je=lt(ve,1),fn=je[0],Kn=pt.useRef(!1),yn=pt.useContext(zt),qe=pt.useState(Cn),At=lt(qe,2),An=At[0],_i=At[1],Wi=yn||(Kn.current?void 0:function(Qi){_i(function(Do){var Ii=[Qi].concat(Te(Do));return Ii})});function To(){fn.parentElement||document.body.appendChild(fn),Kn.current=!0}function lo(){var Qi;(Qi=fn.parentElement)===null||Qi===void 0||Qi.removeChild(fn),Kn.current=!1}return pn(function(){return qt?yn?yn(To):To():lo(),lo},[qt]),pn(function(){An.length&&(An.forEach(function(Qi){return Qi()}),_i(Cn))},[An]),[fn,Wi]}function Ae(qt,se){if(!qt)return!1;if(qt.contains)return qt.contains(se);for(var ve=se;ve;){if(ve===qt)return!0;ve=ve.parentNode}return!1}var hn="data-rc-order",De="rc-util-key",Rt=new Map;function Lt(){var qt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=qt.mark;return se?se.startsWith("data-")?se:"data-".concat(se):De}function Ct(qt){if(qt.attachTo)return qt.attachTo;var se=document.querySelector("head");return se||document.body}function Bt(qt){return qt==="queue"?"prependQueue":qt?"prepend":"append"}function _t(qt){return Array.from((Rt.get(qt)||qt).children).filter(function(se){return se.tagName==="STYLE"})}function Nt(qt){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!kt())return null;var ve=se.csp,je=se.prepend,fn=document.createElement("style");fn.setAttribute(hn,Bt(je)),ve!=null&&ve.nonce&&(fn.nonce=ve==null?void 0:ve.nonce),fn.innerHTML=qt;var Kn=Ct(se),yn=Kn.firstChild;if(je){if(je==="queue"){var qe=_t(Kn).filter(function(At){return["prepend","prependQueue"].includes(At.getAttribute(hn))});if(qe.length)return Kn.insertBefore(fn,qe[qe.length-1].nextSibling),fn}Kn.insertBefore(fn,yn)}else Kn.appendChild(fn);return fn}function Me(qt){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=Ct(se);return _t(ve).find(function(je){return je.getAttribute(Lt(se))===qt})}function wn(qt){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=Me(qt,se);if(ve){var je=Ct(se);je.removeChild(ve)}}function pi(qt,se){var ve=Rt.get(qt);if(!ve||!Ae(document,ve)){var je=Nt("",se),fn=je.parentNode;Rt.set(qt,fn),qt.removeChild(je)}}function Gn(){Rt.clear()}function Yn(qt,se){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},je=Ct(ve);pi(je,ve);var fn=Me(se,ve);if(fn){var Kn,yn;if((Kn=ve.csp)!==null&&Kn!==void 0&&Kn.nonce&&fn.nonce!==((yn=ve.csp)===null||yn===void 0?void 0:yn.nonce)){var qe;fn.nonce=(qe=ve.csp)===null||qe===void 0?void 0:qe.nonce}return fn.innerHTML!==qt&&(fn.innerHTML=qt),fn}var At=Nt(qt,ve);return At.setAttribute(Lt(ve),se),At}var Ci;function Pn(qt){if(typeof document=="undefined")return 0;if(qt||Ci===void 0){var se=document.createElement("div");se.style.width="100%",se.style.height="200px";var ve=document.createElement("div"),je=ve.style;je.position="absolute",je.top="0",je.left="0",je.pointerEvents="none",je.visibility="hidden",je.width="200px",je.height="150px",je.overflow="hidden",ve.appendChild(se),document.body.appendChild(ve);var fn=se.offsetWidth;ve.style.overflow="scroll";var Kn=se.offsetWidth;fn===Kn&&(Kn=ve.clientWidth),document.body.removeChild(ve),Ci=fn-Kn}return Ci}function ki(qt){var se=qt.match(/^(.*)px$/),ve=Number(se==null?void 0:se[1]);return Number.isNaN(ve)?Pn():ve}function ai(qt){if(typeof document=="undefined"||!qt||!(qt instanceof Element))return{width:0,height:0};var se=getComputedStyle(qt,"::-webkit-scrollbar"),ve=se.width,je=se.height;return{width:ki(ve),height:ki(je)}}function eo(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var ri="rc-util-locker-".concat(Date.now()),Yo=0;function Ro(qt){var se=!!qt,ve=pt.useState(function(){return Yo+=1,"".concat(ri,"_").concat(Yo)}),je=lt(ve,1),fn=je[0];pn(function(){if(se){var Kn=ai(document.body).width,yn=eo();Yn(`
html body {
overflow-y: hidden;
`.concat(yn?"width: calc(100% - ".concat(Kn,"px);"):"",`
}`),fn)}else wn(fn);return function(){wn(fn)}},[se,fn])}var mo=!1;function Ji(qt){return typeof qt=="boolean"&&(mo=qt),mo}var Cr=function(se){return se===!1?!1:!kt()||!se?null:typeof se=="string"?document.querySelector(se):typeof se=="function"?se():se},Po=pt.forwardRef(function(qt,se){var ve=qt.open,je=qt.autoLock,fn=qt.getContainer,Kn=qt.debug,yn=qt.autoDestroy,qe=yn===void 0?!0:yn,At=qt.children,An=pt.useState(ve),_i=lt(An,2),Wi=_i[0],To=_i[1],lo=Wi||ve;pt.useEffect(function(){(qe||ve)&&To(ve)},[ve,qe]);var Qi=pt.useState(function(){return Cr(fn)}),Do=lt(Qi,2),Ii=Do[0],Pi=Do[1];pt.useEffect(function(){var Wo=Cr(fn);Pi(Wo!=null?Wo:null)});var Ui=he(lo&&!Ii,Kn),Wn=lt(Ui,2),Dn=Wn[0],xi=Wn[1],Le=Ii!=null?Ii:Dn;Ro(je&&ve&&kt()&&(Le===Dn||Le===document.body));var gi=null;if(At&&so(At)&&se){var ji=At;gi=ji.ref}var Lo=Bi(gi,se);if(!lo||!kt()||Ii===void 0)return null;var vo=Le===!1||Ji(),Oo=At;return se&&(Oo=pt.cloneElement(At,{ref:Lo})),pt.createElement(zt.Provider,{value:xi},vo?Oo:(0,vt.createPortal)(Oo,Le))}),dr=Po,rr=dr;function fr(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ti=fr()?pt.useLayoutEffect:pt.useEffect,jo=function(se,ve){var je=pt.useRef(!0);Ti(function(){return se(je.current)},ve),Ti(function(){return je.current=!1,function(){je.current=!0}},[])},As=function(se,ve){jo(function(je){if(!je)return se()},ve)},ws=jo,Ws=pt.createContext(null),Wr=pt.createContext({}),os=Ws;function Or(){return Or=Object.assign?Object.assign.bind():function(qt){for(var se=1;se<arguments.length;se++){var ve=arguments[se];for(var je in ve)({}).hasOwnProperty.call(ve,je)&&(qt[je]=ve[je])}return qt},Or.apply(null,arguments)}var sr=Vt(94184),Je=Vt.n(sr),xt=Vt(62874),en={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(se){var ve=se.keyCode;if(se.altKey&&!se.ctrlKey||se.metaKey||ve>=en.F1&&ve<=en.F12)return!1;switch(ve){case en.ALT:case en.CAPS_LOCK:case en.CONTEXT_MENU:case en.CTRL:case en.DOWN:case en.END:case en.ESC:case en.HOME:case en.INSERT:case en.LEFT:case en.MAC_FF_META:case en.META:case en.NUMLOCK:case en.NUM_CENTER:case en.PAGE_DOWN:case en.PAGE_UP:case en.PAUSE:case en.PRINT_SCREEN:case en.RIGHT:case en.SHIFT:case en.UP:case en.WIN_KEY:case en.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(se){if(se>=en.ZERO&&se<=en.NINE||se>=en.NUM_ZERO&&se<=en.NUM_MULTIPLY||se>=en.A&&se<=en.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&se===0)return!0;switch(se){case en.SPACE:case en.QUESTION_MARK:case en.NUM_PLUS:case en.NUM_MINUS:case en.NUM_PERIOD:case en.NUM_DIVISION:case en.SEMICOLON:case en.DASH:case en.EQUALS:case en.COMMA:case en.PERIOD:case en.SLASH:case en.APOSTROPHE:case en.SINGLE_QUOTE:case en.OPEN_SQUARE_BRACKET:case en.BACKSLASH:case en.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},vn=en;function mi(qt){"@babel/helpers - typeof";return mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},mi(qt)}function li(qt,se){if(mi(qt)!=="object"||qt===null)return qt;var ve=qt[Symbol.toPrimitive];if(ve!==void 0){var je=ve.call(qt,se||"default");if(mi(je)!=="object")return je;throw new TypeError("@@toPrimitive must return a primitive value.")}return(se==="string"?String:Number)(qt)}function hi(qt){var se=li(qt,"string");return mi(se)==="symbol"?se:String(se)}function Fi(qt,se,ve){return se=hi(se),se in qt?Object.defineProperty(qt,se,{value:ve,enumerable:!0,configurable:!0,writable:!0}):qt[se]=ve,qt}function to(qt,se){var ve=Object.keys(qt);if(Object.getOwnPropertySymbols){var je=Object.getOwnPropertySymbols(qt);se&&(je=je.filter(function(fn){return Object.getOwnPropertyDescriptor(qt,fn).enumerable})),ve.push.apply(ve,je)}return ve}function Ce(qt){for(var se=1;se<arguments.length;se++){var ve=arguments[se]!=null?arguments[se]:{};se%2?to(Object(ve),!0).forEach(function(je){Fi(qt,je,ve[je])}):Object.getOwnPropertyDescriptors?Object.defineProperties(qt,Object.getOwnPropertyDescriptors(ve)):to(Object(ve)).forEach(function(je){Object.defineProperty(qt,je,Object.getOwnPropertyDescriptor(ve,je))})}return qt}var Oe=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,ee=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Ie="".concat(Oe," ").concat(ee).split(/[\s\n]+/),Tn="aria-",Hn="data-";function Bn(qt,se){return qt.indexOf(se)===0}function me(qt){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve;se===!1?ve={aria:!0,data:!0,attr:!0}:se===!0?ve={aria:!0}:ve=Ce({},se);var je={};return Object.keys(qt).forEach(function(fn){(ve.aria&&(fn==="role"||Bn(fn,Tn))||ve.data&&Bn(fn,Hn)||ve.attr&&Ie.includes(fn))&&(je[fn]=qt[fn])}),je}function Ze(qt,se){if(qt==null)return{};var ve={};for(var je in qt)if({}.hasOwnProperty.call(qt,je)){if(se.indexOf(je)!==-1)continue;ve[je]=qt[je]}return ve}function Xn(qt,se){if(qt==null)return{};var ve,je,fn=Ze(qt,se);if(Object.getOwnPropertySymbols){var Kn=Object.getOwnPropertySymbols(qt);for(je=0;je<Kn.length;je++)ve=Kn[je],se.indexOf(ve)===-1&&{}.propertyIsEnumerable.call(qt,ve)&&(fn[ve]=qt[ve])}return fn}var Ni=Vt(33993);function sn(qt,se,ve){var je=pt.useRef({});return(!("value"in je.current)||ve(je.current.condition,se))&&(je.current.value=qt(),je.current.condition=se),je.current.value}var de=Symbol.for("react.element"),bn=Symbol.for("react.transitional.element"),qn=Symbol.for("react.fragment");function Di(qt){return qt&&_typeof(qt)==="object"&&(qt.$$typeof===de||qt.$$typeof===bn)&&qt.type===qn}var Ve=Number(pt.version.split(".")[0]),jn=function(se,ve){typeof se=="function"?se(ve):mi(se)==="object"&&se&&"current"in se&&(se.current=ve)},wo=function(){for(var se=arguments.length,ve=new Array(se),je=0;je<se;je++)ve[je]=arguments[je];var fn=ve.filter(Boolean);return fn.length<=1?fn[0]:function(Kn){ve.forEach(function(yn){jn(yn,Kn)})}},Ho=function(){for(var se=arguments.length,ve=new Array(se),je=0;je<se;je++)ve[je]=arguments[je];return sn(function(){return wo.apply(void 0,ve)},ve,function(fn,Kn){return fn.length!==Kn.length||fn.every(function(yn,qe){return yn!==Kn[qe]})})},fo=function(se){var ve,je;if(!se)return!1;if(Un(se)&&Ve>=19)return!0;var fn=isMemo(se)?se.type.type:se.type;return!(typeof fn=="function"&&!((ve=fn.prototype)!==null&&ve!==void 0&&ve.render)&&fn.$$typeof!==ForwardRef||typeof se=="function"&&!((je=se.prototype)!==null&&je!==void 0&&je.render)&&se.$$typeof!==ForwardRef)};function Un(qt){return isValidElement(qt)&&!isFragment(qt)}var _n=function(se){return Un(se)&&fo(se)},ti=function(se){if(se&&Un(se)){var ve=se;return ve.props.propertyIsEnumerable("ref")?ve.props.ref:ve.ref}return null},Yi=["prefixCls","className","containerRef"],Co=function(se){var ve=se.prefixCls,je=se.className,fn=se.containerRef,Kn=Xn(se,Yi),yn=pt.useContext(Wr),qe=yn.panel,At=Ho(qe,fn);return pt.createElement("div",Or({className:Je()("".concat(ve,"-content"),je),role:"dialog",ref:At},me(se,{aria:!0}),{"aria-modal":"true"},Kn))},ne=Co,xe={},Pe=[],kn=function(se){Pe.push(se)};function zi(qt,se){if(0)var ve}function ae(qt,se){if(0)var ve}function Mn(){xe={}}function cn(qt,se,ve){!se&&!xe[ve]&&(qt(!1,ve),xe[ve]=!0)}function Se(qt,se){cn(zi,qt,se)}function $n(qt,se){cn(ae,qt,se)}Se.preMessage=kn,Se.resetWarned=Mn,Se.noteOnce=$n;var Vn=Se;function ui(qt){return typeof qt=="string"&&String(Number(qt))===qt?(Vn(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(qt)):qt}function di(qt){warning(!("wrapperClassName"in qt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!qt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var fi={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function In(qt,se){var ve,je,fn,Kn=qt.prefixCls,yn=qt.open,qe=qt.placement,At=qt.inline,An=qt.push,_i=qt.forceRender,Wi=qt.autoFocus,To=qt.keyboard,lo=qt.classNames,Qi=qt.rootClassName,Do=qt.rootStyle,Ii=qt.zIndex,Pi=qt.className,Ui=qt.id,Wn=qt.style,Dn=qt.motion,xi=qt.width,Le=qt.height,gi=qt.children,ji=qt.mask,Lo=qt.maskClosable,vo=qt.maskMotion,Oo=qt.maskClassName,Wo=qt.maskStyle,Ar=qt.afterOpenChange,cr=qt.onClose,Bs=qt.onMouseEnter,Us=qt.onMouseOver,pe=qt.onMouseLeave,Br=qt.onClick,Cs=qt.onKeyDown,ma=qt.onKeyUp,po=qt.styles,Ds=qt.drawerRender,Os=pt.useRef(),Vs=pt.useRef(),yo=pt.useRef();pt.useImperativeHandle(se,function(){return Os.current});var $o=function(Uo){var Mi=Uo.keyCode,va=Uo.shiftKey;switch(Mi){case vn.TAB:{if(Mi===vn.TAB){if(!va&&document.activeElement===yo.current){var rs;(rs=Vs.current)===null||rs===void 0||rs.focus({preventScroll:!0})}else if(va&&document.activeElement===Vs.current){var Ur;(Ur=yo.current)===null||Ur===void 0||Ur.focus({preventScroll:!0})}}break}case vn.ESC:{cr&&To&&(Uo.stopPropagation(),cr(Uo));break}}};pt.useEffect(function(){if(yn&&Wi){var qi;(qi=Os.current)===null||qi===void 0||qi.focus({preventScroll:!0})}},[yn]);var Hi=pt.useState(!1),Vi=Be(Hi,2),Mo=Vi[0],Bo=Vi[1],On=pt.useContext(os),ra;typeof An=="boolean"?ra=An?{}:{distance:0}:ra=An||{};var Zr=(ve=(je=(fn=ra)===null||fn===void 0?void 0:fn.distance)!==null&&je!==void 0?je:On==null?void 0:On.pushDistance)!==null&&ve!==void 0?ve:180,Ys=pt.useMemo(function(){return{pushDistance:Zr,push:function(){Bo(!0)},pull:function(){Bo(!1)}}},[Zr]);pt.useEffect(function(){if(yn){var qi;On==null||(qi=On.push)===null||qi===void 0||qi.call(On)}else{var Uo;On==null||(Uo=On.pull)===null||Uo===void 0||Uo.call(On)}},[yn]),pt.useEffect(function(){return function(){var qi;On==null||(qi=On.pull)===null||qi===void 0||qi.call(On)}},[]);var Tl=ji&&pt.createElement(xt.Z,Or({key:"mask"},vo,{visible:yn}),function(qi,Uo){var Mi=qi.className,va=qi.style;return pt.createElement("div",{className:Je()("".concat(Kn,"-mask"),Mi,lo==null?void 0:lo.mask,Oo),style:oe(oe(oe({},va),Wo),po==null?void 0:po.mask),onClick:Lo&&yn?cr:void 0,ref:Uo})}),Fl=typeof Dn=="function"?Dn(qe):Dn,Sn={};if(Mo&&Zr)switch(qe){case"top":Sn.transform="translateY(".concat(Zr,"px)");break;case"bottom":Sn.transform="translateY(".concat(-Zr,"px)");break;case"left":Sn.transform="translateX(".concat(Zr,"px)");break;default:Sn.transform="translateX(".concat(-Zr,"px)");break}qe==="left"||qe==="right"?Sn.width=ui(xi):Sn.height=ui(Le);var hr={onMouseEnter:Bs,onMouseOver:Us,onMouseLeave:pe,onClick:Br,onKeyDown:Cs,onKeyUp:ma},Sr=pt.createElement(xt.Z,Or({key:"panel"},Fl,{visible:yn,forceRender:_i,onVisibleChanged:function(Uo){Ar==null||Ar(Uo)},removeOnLeave:!1,leavedClassName:"".concat(Kn,"-content-wrapper-hidden")}),function(qi,Uo){var Mi=qi.className,va=qi.style,rs=pt.createElement(ne,Or({id:Ui,containerRef:Uo,prefixCls:Kn,className:Je()(Pi,lo==null?void 0:lo.content),style:oe(oe({},Wn),po==null?void 0:po.content)},me(qt,{aria:!0}),hr),gi);return pt.createElement("div",Or({className:Je()("".concat(Kn,"-content-wrapper"),lo==null?void 0:lo.wrapper,Mi),style:oe(oe(oe({},Sn),va),po==null?void 0:po.wrapper)},me(qt,{data:!0})),Ds?Ds(rs):rs)}),sa=oe({},Do);return Ii&&(sa.zIndex=Ii),pt.createElement(os.Provider,{value:Ys},pt.createElement("div",{className:Je()(Kn,"".concat(Kn,"-").concat(qe),Qi,$e($e({},"".concat(Kn,"-open"),yn),"".concat(Kn,"-inline"),At)),style:sa,tabIndex:-1,ref:Os,onKeyDown:$o},Tl,pt.createElement("div",{tabIndex:0,ref:Vs,style:fi,"aria-hidden":"true","data-sentinel":"start"}),Sr,pt.createElement("div",{tabIndex:0,ref:yo,style:fi,"aria-hidden":"true","data-sentinel":"end"})))}var be=pt.forwardRef(In),Gi=be,ke=function(se){var ve=se.open,je=ve===void 0?!1:ve,fn=se.prefixCls,Kn=fn===void 0?"rc-drawer":fn,yn=se.placement,qe=yn===void 0?"right":yn,At=se.autoFocus,An=At===void 0?!0:At,_i=se.keyboard,Wi=_i===void 0?!0:_i,To=se.width,lo=To===void 0?378:To,Qi=se.mask,Do=Qi===void 0?!0:Qi,Ii=se.maskClosable,Pi=Ii===void 0?!0:Ii,Ui=se.getContainer,Wn=se.forceRender,Dn=se.afterOpenChange,xi=se.destroyOnClose,Le=se.onMouseEnter,gi=se.onMouseOver,ji=se.onMouseLeave,Lo=se.onClick,vo=se.onKeyDown,Oo=se.onKeyUp,Wo=se.panelRef,Ar=pt.useState(!1),cr=Be(Ar,2),Bs=cr[0],Us=cr[1],pe=pt.useState(!1),Br=Be(pe,2),Cs=Br[0],ma=Br[1];ws(function(){ma(!0)},[]);var po=Cs?je:!1,Ds=pt.useRef(),Os=pt.useRef();ws(function(){po&&(Os.current=document.activeElement)},[po]);var Vs=function(Mo){var Bo;if(Us(Mo),Dn==null||Dn(Mo),!Mo&&Os.current&&!((Bo=Ds.current)!==null&&Bo!==void 0&&Bo.contains(Os.current))){var On;(On=Os.current)===null||On===void 0||On.focus({preventScroll:!0})}},yo=pt.useMemo(function(){return{panel:Wo}},[Wo]);if(!Wn&&!Bs&&!po&&xi)return null;var $o={onMouseEnter:Le,onMouseOver:gi,onMouseLeave:ji,onClick:Lo,onKeyDown:vo,onKeyUp:Oo},Hi=oe(oe({},se),{},{open:po,prefixCls:Kn,placement:qe,autoFocus:An,keyboard:Wi,width:lo,mask:Do,maskClosable:Pi,inline:Ui===!1,afterOpenChange:Vs,ref:Ds},$o);return pt.createElement(Wr.Provider,{value:yo},pt.createElement(rr,{open:po||Wn||Bs,autoDestroy:!1,getContainer:Ui,autoLock:Do&&(po||Bs)},pt.createElement(Gi,Hi)))},vi=ke,co=vi},26819:function(un,Rn){"use strict";var Vt;var wt=typeof Symbol=="function"&&Symbol.for,ue=wt?Symbol.for("react.element"):60103,_e=wt?Symbol.for("react.portal"):60106,$e=wt?Symbol.for("react.fragment"):60107,ye=wt?Symbol.for("react.strict_mode"):60108,oe=wt?Symbol.for("react.profiler"):60114,Yt=wt?Symbol.for("react.provider"):60109,Ne=wt?Symbol.for("react.context"):60110,ge=wt?Symbol.for("react.async_mode"):60111,we=wt?Symbol.for("react.concurrent_mode"):60111,Ye=wt?Symbol.for("react.forward_ref"):60112,Be=wt?Symbol.for("react.suspense"):60113,on=wt?Symbol.for("react.suspense_list"):60120,Ft=wt?Symbol.for("react.memo"):60115,et=wt?Symbol.for("react.lazy"):60116,nt=wt?Symbol.for("react.block"):60121,ht=wt?Symbol.for("react.fundamental"):60117,lt=wt?Symbol.for("react.responder"):60118,pt=wt?Symbol.for("react.scope"):60119;function vt(Et){if(typeof Et=="object"&&Et!==null){var Ht=Et.$$typeof;switch(Ht){case ue:switch(Et=Et.type,Et){case ge:case we:case $e:case oe:case ye:case Be:return Et;default:switch(Et=Et&&Et.$$typeof,Et){case Ne:case Ye:case et:case Ft:case Yt:return Et;default:return Ht}}case _e:return Ht}}}function kt(Et){return vt(Et)===we}Vt=ge,Vt=we,Vt=Ne,Vt=Yt,Vt=ue,Vt=Ye,Vt=$e,Vt=et,Vt=Ft,Vt=_e,Vt=oe,Vt=ye,Vt=Be,Vt=function(Et){return kt(Et)||vt(Et)===ge},Vt=kt,Vt=function(Et){return vt(Et)===Ne},Vt=function(Et){return vt(Et)===Yt},Vt=function(Et){return typeof Et=="object"&&Et!==null&&Et.$$typeof===ue},Vt=function(Et){return vt(Et)===Ye},Vt=function(Et){return vt(Et)===$e},Vt=function(Et){return vt(Et)===et},Rn.isMemo=function(Et){return vt(Et)===Ft},Vt=function(Et){return vt(Et)===_e},Vt=function(Et){return vt(Et)===oe},Vt=function(Et){return vt(Et)===ye},Vt=function(Et){return vt(Et)===Be},Vt=function(Et){return typeof Et=="string"||typeof Et=="function"||Et===$e||Et===we||Et===oe||Et===ye||Et===Be||Et===on||typeof Et=="object"&&Et!==null&&(Et.$$typeof===et||Et.$$typeof===Ft||Et.$$typeof===Yt||Et.$$typeof===Ne||Et.$$typeof===Ye||Et.$$typeof===ht||Et.$$typeof===lt||Et.$$typeof===pt||Et.$$typeof===nt)},Vt=vt},18459:function(un,Rn,Vt){"use strict";un.exports=Vt(26819)},16651:function(un,Rn){"use strict";var Vt;var wt=Symbol.for("react.element"),ue=Symbol.for("react.portal"),_e=Symbol.for("react.fragment"),$e=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),oe=Symbol.for("react.provider"),Yt=Symbol.for("react.context"),Ne=Symbol.for("react.server_context"),ge=Symbol.for("react.forward_ref"),we=Symbol.for("react.suspense"),Ye=Symbol.for("react.suspense_list"),Be=Symbol.for("react.memo"),on=Symbol.for("react.lazy"),Ft=Symbol.for("react.offscreen"),et;et=Symbol.for("react.module.reference");function nt(ht){if(typeof ht=="object"&&ht!==null){var lt=ht.$$typeof;switch(lt){case wt:switch(ht=ht.type,ht){case _e:case ye:case $e:case we:case Ye:return ht;default:switch(ht=ht&&ht.$$typeof,ht){case Ne:case Yt:case ge:case on:case Be:case oe:return ht;default:return lt}}case ue:return lt}}}Vt=Yt,Vt=oe,Vt=wt,Vt=ge,Vt=_e,Vt=on,Vt=Be,Vt=ue,Vt=ye,Vt=$e,Vt=we,Vt=Ye,Vt=function(){return!1},Vt=function(){return!1},Vt=function(ht){return nt(ht)===Yt},Vt=function(ht){return nt(ht)===oe},Vt=function(ht){return typeof ht=="object"&&ht!==null&&ht.$$typeof===wt},Vt=function(ht){return nt(ht)===ge},Vt=function(ht){return nt(ht)===_e},Vt=function(ht){return nt(ht)===on},Vt=function(ht){return nt(ht)===Be},Vt=function(ht){return nt(ht)===ue},Vt=function(ht){return nt(ht)===ye},Vt=function(ht){return nt(ht)===$e},Vt=function(ht){return nt(ht)===we},Vt=function(ht){return nt(ht)===Ye},Vt=function(ht){return typeof ht=="string"||typeof ht=="function"||ht===_e||ht===ye||ht===$e||ht===we||ht===Ye||ht===Ft||typeof ht=="object"&&ht!==null&&(ht.$$typeof===on||ht.$$typeof===Be||ht.$$typeof===oe||ht.$$typeof===Yt||ht.$$typeof===ge||ht.$$typeof===et||ht.getModuleId!==void 0)},Vt=nt},33993:function(un,Rn,Vt){"use strict";Vt(16651)},31457:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return Ae}});var wt=Vt(4942),ue=Vt(87462),_e=Vt(71002),$e=Vt(1413),ye=Vt(97685),oe=Vt(94184),Yt=Vt.n(oe),Ne=Vt(67294);function ge(hn){var De=Ne.useRef();De.current=hn;var Rt=Ne.useCallback(function(){for(var Lt,Ct=arguments.length,Bt=new Array(Ct),_t=0;_t<Ct;_t++)Bt[_t]=arguments[_t];return(Lt=De.current)===null||Lt===void 0?void 0:Lt.call.apply(Lt,[De].concat(Bt))},[]);return Rt}function we(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ye=we()?Ne.useLayoutEffect:Ne.useEffect,Be=function(De,Rt){var Lt=Ne.useRef(!0);Ye(function(){return De(Lt.current)},Rt),Ye(function(){return Lt.current=!1,function(){Lt.current=!0}},[])},on=function(De,Rt){Be(function(Lt){if(!Lt)return De()},Rt)},Ft=null;function et(hn){var De=Ne.useRef(!1),Rt=Ne.useState(hn),Lt=(0,ye.Z)(Rt,2),Ct=Lt[0],Bt=Lt[1];Ne.useEffect(function(){return De.current=!1,function(){De.current=!0}},[]);function _t(Nt,Me){Me&&De.current||Bt(Nt)}return[Ct,_t]}function nt(hn){return hn!==void 0}function ht(hn,De){var Rt=De||{},Lt=Rt.defaultValue,Ct=Rt.value,Bt=Rt.onChange,_t=Rt.postState,Nt=et(function(){return nt(Ct)?Ct:nt(Lt)?typeof Lt=="function"?Lt():Lt:typeof hn=="function"?hn():hn}),Me=(0,ye.Z)(Nt,2),wn=Me[0],pi=Me[1],Gn=Ct!==void 0?Ct:wn,Yn=_t?_t(Gn):Gn,Ci=ge(Bt),Pn=et([Gn]),ki=(0,ye.Z)(Pn,2),ai=ki[0],eo=ki[1];on(function(){var Yo=ai[0];wn!==Yo&&Ci(wn,Yo)},[ai]),on(function(){nt(Ct)||pi(Ct)},[Ct]);var ri=ge(function(Yo,Ro){pi(Yo,Ro),eo([Gn],Ro)});return[Yn,ri]}var lt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(De){var Rt=De.keyCode;if(De.altKey&&!De.ctrlKey||De.metaKey||Rt>=lt.F1&&Rt<=lt.F12)return!1;switch(Rt){case lt.ALT:case lt.CAPS_LOCK:case lt.CONTEXT_MENU:case lt.CTRL:case lt.DOWN:case lt.END:case lt.ESC:case lt.HOME:case lt.INSERT:case lt.LEFT:case lt.MAC_FF_META:case lt.META:case lt.NUMLOCK:case lt.NUM_CENTER:case lt.PAGE_DOWN:case lt.PAGE_UP:case lt.PAUSE:case lt.PRINT_SCREEN:case lt.RIGHT:case lt.SHIFT:case lt.UP:case lt.WIN_KEY:case lt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(De){if(De>=lt.ZERO&&De<=lt.NINE||De>=lt.NUM_ZERO&&De<=lt.NUM_MULTIPLY||De>=lt.A&&De<=lt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&De===0)return!0;switch(De){case lt.SPACE:case lt.QUESTION_MARK:case lt.NUM_PLUS:case lt.NUM_MINUS:case lt.NUM_PERIOD:case lt.NUM_DIVISION:case lt.SEMICOLON:case lt.DASH:case lt.EQUALS:case lt.COMMA:case lt.PERIOD:case lt.SLASH:case lt.APOSTROPHE:case lt.SINGLE_QUOTE:case lt.OPEN_SQUARE_BRACKET:case lt.BACKSLASH:case lt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},pt=lt,vt=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,kt=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Et="".concat(vt," ").concat(kt).split(/[\s\n]+/),Ht="aria-",Zt="data-";function ie(hn,De){return hn.indexOf(De)===0}function le(hn){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Rt;De===!1?Rt={aria:!0,data:!0,attr:!0}:De===!0?Rt={aria:!0}:Rt=(0,$e.Z)({},De);var Lt={};return Object.keys(hn).forEach(function(Ct){(Rt.aria&&(Ct==="role"||ie(Ct,Ht))||Rt.data&&ie(Ct,Zt)||Rt.attr&&Et.includes(Ct))&&(Lt[Ct]=hn[Ct])}),Lt}var re={},Ge=[],fe=function(De){Ge.push(De)};function Ke(hn,De){if(0)var Rt}function an(hn,De){if(0)var Rt}function nn(){re={}}function Si(hn,De,Rt){!De&&!re[Rt]&&(hn(!1,Rt),re[Rt]=!0)}function oi(hn,De){Si(Ke,hn,De)}function Bi(hn,De){Si(an,hn,De)}oi.preMessage=fe,oi.resetWarned=nn,oi.noteOnce=Bi;var so=null,Qt=Vt(81626),zt=[10,20,50,100],He=function(De){var Rt=De.pageSizeOptions,Lt=Rt===void 0?zt:Rt,Ct=De.locale,Bt=De.changeSize,_t=De.pageSize,Nt=De.goButton,Me=De.quickGo,wn=De.rootPrefixCls,pi=De.disabled,Gn=De.buildOptionText,Yn=De.showSizeChanger,Ci=De.sizeChangerRender,Pn=Ne.useState(""),ki=(0,ye.Z)(Pn,2),ai=ki[0],eo=ki[1],ri=function(){return!ai||Number.isNaN(ai)?void 0:Number(ai)},Yo=typeof Gn=="function"?Gn:function(Ti){return"".concat(Ti," ").concat(Ct.items_per_page)},Ro=function(jo){eo(jo.target.value)},mo=function(jo){Nt||ai===""||(eo(""),!(jo.relatedTarget&&(jo.relatedTarget.className.indexOf("".concat(wn,"-item-link"))>=0||jo.relatedTarget.className.indexOf("".concat(wn,"-item"))>=0))&&(Me==null||Me(ri())))},Ji=function(jo){ai!==""&&(jo.keyCode===pt.ENTER||jo.type==="click")&&(eo(""),Me==null||Me(ri()))},Cr=function(){return Lt.some(function(jo){return jo.toString()===_t.toString()})?Lt:Lt.concat([_t]).sort(function(jo,As){var ws=Number.isNaN(Number(jo))?0:Number(jo),Ws=Number.isNaN(Number(As))?0:Number(As);return ws-Ws})},Po="".concat(wn,"-options");if(!Yn&&!Me)return null;var dr=null,rr=null,fr=null;return Yn&&Ci&&(dr=Ci({disabled:pi,size:_t,onSizeChange:function(jo){Bt==null||Bt(Number(jo))},"aria-label":Ct.page_size,className:"".concat(Po,"-size-changer"),options:Cr().map(function(Ti){return{label:Yo(Ti),value:Ti}})})),Me&&(Nt&&(fr=typeof Nt=="boolean"?Ne.createElement("button",{type:"button",onClick:Ji,onKeyUp:Ji,disabled:pi,className:"".concat(Po,"-quick-jumper-button")},Ct.jump_to_confirm):Ne.createElement("span",{onClick:Ji,onKeyUp:Ji},Nt)),rr=Ne.createElement("div",{className:"".concat(Po,"-quick-jumper")},Ct.jump_to,Ne.createElement("input",{disabled:pi,type:"text",value:ai,onChange:Ro,onKeyUp:Ji,onBlur:mo,"aria-label":Ct.page}),Ct.page,fr)),Ne.createElement("li",{className:Po},dr,rr)},En=He,Fn=function(De){var Rt=De.rootPrefixCls,Lt=De.page,Ct=De.active,Bt=De.className,_t=De.showTitle,Nt=De.onClick,Me=De.onKeyPress,wn=De.itemRender,pi="".concat(Rt,"-item"),Gn=Yt()(pi,"".concat(pi,"-").concat(Lt),(0,wt.Z)((0,wt.Z)({},"".concat(pi,"-active"),Ct),"".concat(pi,"-disabled"),!Lt),Bt),Yn=function(){Nt(Lt)},Ci=function(ai){Me(ai,Nt,Lt)},Pn=wn(Lt,"page",Ne.createElement("a",{rel:"nofollow"},Lt));return Pn?Ne.createElement("li",{title:_t?String(Lt):null,className:Gn,onClick:Yn,onKeyDown:Ci,tabIndex:0},Pn):null},Te=Fn,ln=function(De,Rt,Lt){return Lt};function pn(){}function ni(hn){var De=Number(hn);return typeof De=="number"&&!Number.isNaN(De)&&isFinite(De)&&Math.floor(De)===De}function Cn(hn,De,Rt){var Lt=typeof hn=="undefined"?De:hn;return Math.floor((Rt-1)/Lt)+1}var he=function(De){var Rt=De.prefixCls,Lt=Rt===void 0?"rc-pagination":Rt,Ct=De.selectPrefixCls,Bt=Ct===void 0?"rc-select":Ct,_t=De.className,Nt=De.current,Me=De.defaultCurrent,wn=Me===void 0?1:Me,pi=De.total,Gn=pi===void 0?0:pi,Yn=De.pageSize,Ci=De.defaultPageSize,Pn=Ci===void 0?10:Ci,ki=De.onChange,ai=ki===void 0?pn:ki,eo=De.hideOnSinglePage,ri=De.align,Yo=De.showPrevNextJumpers,Ro=Yo===void 0?!0:Yo,mo=De.showQuickJumper,Ji=De.showLessItems,Cr=De.showTitle,Po=Cr===void 0?!0:Cr,dr=De.onShowSizeChange,rr=dr===void 0?pn:dr,fr=De.locale,Ti=fr===void 0?Qt.Z:fr,jo=De.style,As=De.totalBoundaryShowSizeChanger,ws=As===void 0?50:As,Ws=De.disabled,Wr=De.simple,os=De.showTotal,Or=De.showSizeChanger,sr=Or===void 0?Gn>ws:Or,Je=De.sizeChangerRender,xt=De.pageSizeOptions,en=De.itemRender,vn=en===void 0?ln:en,mi=De.jumpPrevIcon,li=De.jumpNextIcon,hi=De.prevIcon,Fi=De.nextIcon,to=Ne.useRef(null),Ce=ht(10,{value:Yn,defaultValue:Pn}),Oe=(0,ye.Z)(Ce,2),ee=Oe[0],Ie=Oe[1],Tn=ht(1,{value:Nt,defaultValue:wn,postState:function(gi){return Math.max(1,Math.min(gi,Cn(void 0,ee,Gn)))}}),Hn=(0,ye.Z)(Tn,2),Bn=Hn[0],me=Hn[1],Ze=Ne.useState(Bn),Xn=(0,ye.Z)(Ze,2),Ni=Xn[0],sn=Xn[1];(0,Ne.useEffect)(function(){sn(Bn)},[Bn]);var de=ai!==pn,bn="current"in De,qn=Math.max(1,Bn-(Ji?3:5)),Di=Math.min(Cn(void 0,ee,Gn),Bn+(Ji?3:5));function Ve(Le,gi){var ji=Le||Ne.createElement("button",{type:"button","aria-label":gi,className:"".concat(Lt,"-item-link")});return typeof Le=="function"&&(ji=Ne.createElement(Le,(0,$e.Z)({},De))),ji}function jn(Le){var gi=Le.target.value,ji=Cn(void 0,ee,Gn),Lo;return gi===""?Lo=gi:Number.isNaN(Number(gi))?Lo=Ni:gi>=ji?Lo=ji:Lo=Number(gi),Lo}function wo(Le){return ni(Le)&&Le!==Bn&&ni(Gn)&&Gn>0}var Ho=Gn>ee?mo:!1;function fo(Le){(Le.keyCode===pt.UP||Le.keyCode===pt.DOWN)&&Le.preventDefault()}function Un(Le){var gi=jn(Le);switch(gi!==Ni&&sn(gi),Le.keyCode){case pt.ENTER:Yi(gi);break;case pt.UP:Yi(gi-1);break;case pt.DOWN:Yi(gi+1);break;default:break}}function _n(Le){Yi(jn(Le))}function ti(Le){var gi=Cn(Le,ee,Gn),ji=Bn>gi&&gi!==0?gi:Bn;Ie(Le),sn(ji),rr==null||rr(Bn,Le),me(ji),ai==null||ai(ji,Le)}function Yi(Le){if(wo(Le)&&!Ws){var gi=Cn(void 0,ee,Gn),ji=Le;return Le>gi?ji=gi:Le<1&&(ji=1),ji!==Ni&&sn(ji),me(ji),ai==null||ai(ji,ee),ji}return Bn}var Co=Bn>1,ne=Bn<Cn(void 0,ee,Gn);function xe(){Co&&Yi(Bn-1)}function Pe(){ne&&Yi(Bn+1)}function kn(){Yi(qn)}function zi(){Yi(Di)}function ae(Le,gi){if(Le.key==="Enter"||Le.charCode===pt.ENTER||Le.keyCode===pt.ENTER){for(var ji=arguments.length,Lo=new Array(ji>2?ji-2:0),vo=2;vo<ji;vo++)Lo[vo-2]=arguments[vo];gi.apply(void 0,Lo)}}function Mn(Le){ae(Le,xe)}function cn(Le){ae(Le,Pe)}function Se(Le){ae(Le,kn)}function $n(Le){ae(Le,zi)}function Vn(Le){var gi=vn(Le,"prev",Ve(hi,"prev page"));return Ne.isValidElement(gi)?Ne.cloneElement(gi,{disabled:!Co}):gi}function ui(Le){var gi=vn(Le,"next",Ve(Fi,"next page"));return Ne.isValidElement(gi)?Ne.cloneElement(gi,{disabled:!ne}):gi}function di(Le){(Le.type==="click"||Le.keyCode===pt.ENTER)&&Yi(Ni)}var fi=null,In=le(De,{aria:!0,data:!0}),be=os&&Ne.createElement("li",{className:"".concat(Lt,"-total-text")},os(Gn,[Gn===0?0:(Bn-1)*ee+1,Bn*ee>Gn?Gn:Bn*ee])),Gi=null,ke=Cn(void 0,ee,Gn);if(eo&&Gn<=ee)return null;var vi=[],co={rootPrefixCls:Lt,onClick:Yi,onKeyPress:ae,showTitle:Po,itemRender:vn,page:-1},qt=Bn-1>0?Bn-1:0,se=Bn+1<ke?Bn+1:ke,ve=mo&&mo.goButton,je=(0,_e.Z)(Wr)==="object"?Wr.readOnly:!Wr,fn=ve,Kn=null;Wr&&(ve&&(typeof ve=="boolean"?fn=Ne.createElement("button",{type:"button",onClick:di,onKeyUp:di},Ti.jump_to_confirm):fn=Ne.createElement("span",{onClick:di,onKeyUp:di},ve),fn=Ne.createElement("li",{title:Po?"".concat(Ti.jump_to).concat(Bn,"/").concat(ke):null,className:"".concat(Lt,"-simple-pager")},fn)),Kn=Ne.createElement("li",{title:Po?"".concat(Bn,"/").concat(ke):null,className:"".concat(Lt,"-simple-pager")},je?Ni:Ne.createElement("input",{type:"text","aria-label":Ti.jump_to,value:Ni,disabled:Ws,onKeyDown:fo,onKeyUp:Un,onChange:Un,onBlur:_n,size:3}),Ne.createElement("span",{className:"".concat(Lt,"-slash")},"/"),ke));var yn=Ji?1:2;if(ke<=3+yn*2){ke||vi.push(Ne.createElement(Te,(0,ue.Z)({},co,{key:"noPager",page:1,className:"".concat(Lt,"-item-disabled")})));for(var qe=1;qe<=ke;qe+=1)vi.push(Ne.createElement(Te,(0,ue.Z)({},co,{key:qe,page:qe,active:Bn===qe})))}else{var At=Ji?Ti.prev_3:Ti.prev_5,An=Ji?Ti.next_3:Ti.next_5,_i=vn(qn,"jump-prev",Ve(mi,"prev page")),Wi=vn(Di,"jump-next",Ve(li,"next page"));Ro&&(fi=_i?Ne.createElement("li",{title:Po?At:null,key:"prev",onClick:kn,tabIndex:0,onKeyDown:Se,className:Yt()("".concat(Lt,"-jump-prev"),(0,wt.Z)({},"".concat(Lt,"-jump-prev-custom-icon"),!!mi))},_i):null,Gi=Wi?Ne.createElement("li",{title:Po?An:null,key:"next",onClick:zi,tabIndex:0,onKeyDown:$n,className:Yt()("".concat(Lt,"-jump-next"),(0,wt.Z)({},"".concat(Lt,"-jump-next-custom-icon"),!!li))},Wi):null);var To=Math.max(1,Bn-yn),lo=Math.min(Bn+yn,ke);Bn-1<=yn&&(lo=1+yn*2),ke-Bn<=yn&&(To=ke-yn*2);for(var Qi=To;Qi<=lo;Qi+=1)vi.push(Ne.createElement(Te,(0,ue.Z)({},co,{key:Qi,page:Qi,active:Bn===Qi})));if(Bn-1>=yn*2&&Bn!==3&&(vi[0]=Ne.cloneElement(vi[0],{className:Yt()("".concat(Lt,"-item-after-jump-prev"),vi[0].props.className)}),vi.unshift(fi)),ke-Bn>=yn*2&&Bn!==ke-2){var Do=vi[vi.length-1];vi[vi.length-1]=Ne.cloneElement(Do,{className:Yt()("".concat(Lt,"-item-before-jump-next"),Do.props.className)}),vi.push(Gi)}To!==1&&vi.unshift(Ne.createElement(Te,(0,ue.Z)({},co,{key:1,page:1}))),lo!==ke&&vi.push(Ne.createElement(Te,(0,ue.Z)({},co,{key:ke,page:ke})))}var Ii=Vn(qt);if(Ii){var Pi=!Co||!ke;Ii=Ne.createElement("li",{title:Po?Ti.prev_page:null,onClick:xe,tabIndex:Pi?null:0,onKeyDown:Mn,className:Yt()("".concat(Lt,"-prev"),(0,wt.Z)({},"".concat(Lt,"-disabled"),Pi)),"aria-disabled":Pi},Ii)}var Ui=ui(se);if(Ui){var Wn,Dn;Wr?(Wn=!ne,Dn=Co?0:null):(Wn=!ne||!ke,Dn=Wn?null:0),Ui=Ne.createElement("li",{title:Po?Ti.next_page:null,onClick:Pe,tabIndex:Dn,onKeyDown:cn,className:Yt()("".concat(Lt,"-next"),(0,wt.Z)({},"".concat(Lt,"-disabled"),Wn)),"aria-disabled":Wn},Ui)}var xi=Yt()(Lt,_t,(0,wt.Z)((0,wt.Z)((0,wt.Z)((0,wt.Z)((0,wt.Z)({},"".concat(Lt,"-start"),ri==="start"),"".concat(Lt,"-center"),ri==="center"),"".concat(Lt,"-end"),ri==="end"),"".concat(Lt,"-simple"),Wr),"".concat(Lt,"-disabled"),Ws));return Ne.createElement("ul",(0,ue.Z)({className:xi,style:jo,ref:to},In),be,Ii,Wr?Kn:vi,Ui,Ne.createElement(En,{locale:Ti,rootPrefixCls:Lt,disabled:Ws,selectPrefixCls:Bt,changeSize:ti,pageSize:ee,pageSizeOptions:xt,quickGo:Ho?Yi:null,goButton:fn,showSizeChanger:sr,sizeChangerRender:Je}))},Ae=he},58212:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return so}});function wt(){return wt=Object.assign?Object.assign.bind():function(Qt){for(var zt=1;zt<arguments.length;zt++){var He=arguments[zt];for(var En in He)Object.prototype.hasOwnProperty.call(He,En)&&(Qt[En]=He[En])}return Qt},wt.apply(this,arguments)}function ue(Qt){"@babel/helpers - typeof";return ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(zt){return typeof zt}:function(zt){return zt&&typeof Symbol=="function"&&zt.constructor===Symbol&&zt!==Symbol.prototype?"symbol":typeof zt},ue(Qt)}function _e(Qt,zt){if(ue(Qt)!=="object"||Qt===null)return Qt;var He=Qt[Symbol.toPrimitive];if(He!==void 0){var En=He.call(Qt,zt||"default");if(ue(En)!=="object")return En;throw new TypeError("@@toPrimitive must return a primitive value.")}return(zt==="string"?String:Number)(Qt)}function $e(Qt){var zt=_e(Qt,"string");return ue(zt)==="symbol"?zt:String(zt)}function ye(Qt,zt,He){return zt=$e(zt),zt in Qt?Object.defineProperty(Qt,zt,{value:He,enumerable:!0,configurable:!0,writable:!0}):Qt[zt]=He,Qt}function oe(Qt){if(Array.isArray(Qt))return Qt}function Yt(Qt,zt){var He=Qt==null?null:typeof Symbol!="undefined"&&Qt[Symbol.iterator]||Qt["@@iterator"];if(He!=null){var En,Fn,Te,ln,pn=[],ni=!0,Cn=!1;try{if(Te=(He=He.call(Qt)).next,zt===0){if(Object(He)!==He)return;ni=!1}else for(;!(ni=(En=Te.call(He)).done)&&(pn.push(En.value),pn.length!==zt);ni=!0);}catch(he){Cn=!0,Fn=he}finally{try{if(!ni&&He.return!=null&&(ln=He.return(),Object(ln)!==ln))return}finally{if(Cn)throw Fn}}return pn}}function Ne(Qt,zt){(zt==null||zt>Qt.length)&&(zt=Qt.length);for(var He=0,En=new Array(zt);He<zt;He++)En[He]=Qt[He];return En}function ge(Qt,zt){if(Qt){if(typeof Qt=="string")return Ne(Qt,zt);var He=Object.prototype.toString.call(Qt).slice(8,-1);if(He==="Object"&&Qt.constructor&&(He=Qt.constructor.name),He==="Map"||He==="Set")return Array.from(Qt);if(He==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(He))return Ne(Qt,zt)}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ye(Qt,zt){return oe(Qt)||Yt(Qt,zt)||ge(Qt,zt)||we()}function Be(Qt,zt){if(Qt==null)return{};var He={},En=Object.keys(Qt),Fn,Te;for(Te=0;Te<En.length;Te++)Fn=En[Te],!(zt.indexOf(Fn)>=0)&&(He[Fn]=Qt[Fn]);return He}function on(Qt,zt){if(Qt==null)return{};var He=Be(Qt,zt),En,Fn;if(Object.getOwnPropertySymbols){var Te=Object.getOwnPropertySymbols(Qt);for(Fn=0;Fn<Te.length;Fn++)En=Te[Fn],!(zt.indexOf(En)>=0)&&Object.prototype.propertyIsEnumerable.call(Qt,En)&&(He[En]=Qt[En])}return He}var Ft=Vt(67294),et=Vt(94184),nt=Vt.n(et);function ht(Qt){if(Array.isArray(Qt))return Qt}function lt(Qt,zt){var He=Qt==null?null:typeof Symbol!="undefined"&&Qt[Symbol.iterator]||Qt["@@iterator"];if(He!=null){var En,Fn,Te,ln,pn=[],ni=!0,Cn=!1;try{if(Te=(He=He.call(Qt)).next,zt===0){if(Object(He)!==He)return;ni=!1}else for(;!(ni=(En=Te.call(He)).done)&&(pn.push(En.value),pn.length!==zt);ni=!0);}catch(he){Cn=!0,Fn=he}finally{try{if(!ni&&He.return!=null&&(ln=He.return(),Object(ln)!==ln))return}finally{if(Cn)throw Fn}}return pn}}function pt(Qt,zt){(zt==null||zt>Qt.length)&&(zt=Qt.length);for(var He=0,En=new Array(zt);He<zt;He++)En[He]=Qt[He];return En}function vt(Qt,zt){if(Qt){if(typeof Qt=="string")return pt(Qt,zt);var He=Object.prototype.toString.call(Qt).slice(8,-1);if(He==="Object"&&Qt.constructor&&(He=Qt.constructor.name),He==="Map"||He==="Set")return Array.from(Qt);if(He==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(He))return pt(Qt,zt)}}function kt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Et(Qt,zt){return ht(Qt)||lt(Qt,zt)||vt(Qt,zt)||kt()}function Ht(Qt){var zt=Ft.useRef();zt.current=Qt;var He=Ft.useCallback(function(){for(var En,Fn=arguments.length,Te=new Array(Fn),ln=0;ln<Fn;ln++)Te[ln]=arguments[ln];return(En=zt.current)===null||En===void 0?void 0:En.call.apply(En,[zt].concat(Te))},[]);return He}function Zt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ie=Zt()?Ft.useLayoutEffect:Ft.useEffect,le=function(zt,He){var En=Ft.useRef(!0);ie(function(){return zt(En.current)},He),ie(function(){return En.current=!1,function(){En.current=!0}},[])},re=function(zt,He){le(function(En){if(!En)return zt()},He)},Ge=null;function fe(Qt){var zt=Ft.useRef(!1),He=Ft.useState(Qt),En=Et(He,2),Fn=En[0],Te=En[1];Ft.useEffect(function(){return zt.current=!1,function(){zt.current=!0}},[]);function ln(pn,ni){ni&&zt.current||Te(pn)}return[Fn,ln]}function Ke(Qt){return Qt!==void 0}function an(Qt,zt){var He=zt||{},En=He.defaultValue,Fn=He.value,Te=He.onChange,ln=He.postState,pn=fe(function(){return Ke(Fn)?Fn:Ke(En)?typeof En=="function"?En():En:typeof Qt=="function"?Qt():Qt}),ni=Et(pn,2),Cn=ni[0],he=ni[1],Ae=Fn!==void 0?Fn:Cn,hn=ln?ln(Ae):Ae,De=Ht(Te),Rt=fe([Ae]),Lt=Et(Rt,2),Ct=Lt[0],Bt=Lt[1];re(function(){var Nt=Ct[0];Cn!==Nt&&De(Cn,Nt)},[Ct]),re(function(){Ke(Fn)||he(Fn)},[Fn]);var _t=Ht(function(Nt,Me){he(Nt,Me),Bt([Ae],Me)});return[hn,_t]}var nn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(zt){var He=zt.keyCode;if(zt.altKey&&!zt.ctrlKey||zt.metaKey||He>=nn.F1&&He<=nn.F12)return!1;switch(He){case nn.ALT:case nn.CAPS_LOCK:case nn.CONTEXT_MENU:case nn.CTRL:case nn.DOWN:case nn.END:case nn.ESC:case nn.HOME:case nn.INSERT:case nn.LEFT:case nn.MAC_FF_META:case nn.META:case nn.NUMLOCK:case nn.NUM_CENTER:case nn.PAGE_DOWN:case nn.PAGE_UP:case nn.PAUSE:case nn.PRINT_SCREEN:case nn.RIGHT:case nn.SHIFT:case nn.UP:case nn.WIN_KEY:case nn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(zt){if(zt>=nn.ZERO&&zt<=nn.NINE||zt>=nn.NUM_ZERO&&zt<=nn.NUM_MULTIPLY||zt>=nn.A&&zt<=nn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&zt===0)return!0;switch(zt){case nn.SPACE:case nn.QUESTION_MARK:case nn.NUM_PLUS:case nn.NUM_MINUS:case nn.NUM_PERIOD:case nn.NUM_DIVISION:case nn.SEMICOLON:case nn.DASH:case nn.EQUALS:case nn.COMMA:case nn.PERIOD:case nn.SLASH:case nn.APOSTROPHE:case nn.SINGLE_QUOTE:case nn.OPEN_SQUARE_BRACKET:case nn.BACKSLASH:case nn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Si=nn,oi=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Bi=Ft.forwardRef(function(Qt,zt){var He,En=Qt.prefixCls,Fn=En===void 0?"rc-switch":En,Te=Qt.className,ln=Qt.checked,pn=Qt.defaultChecked,ni=Qt.disabled,Cn=Qt.loadingIcon,he=Qt.checkedChildren,Ae=Qt.unCheckedChildren,hn=Qt.onClick,De=Qt.onChange,Rt=Qt.onKeyDown,Lt=on(Qt,oi),Ct=an(!1,{value:ln,defaultValue:pn}),Bt=Ye(Ct,2),_t=Bt[0],Nt=Bt[1];function Me(Yn,Ci){var Pn=_t;return ni||(Pn=Yn,Nt(Pn),De==null||De(Pn,Ci)),Pn}function wn(Yn){Yn.which===Si.LEFT?Me(!1,Yn):Yn.which===Si.RIGHT&&Me(!0,Yn),Rt==null||Rt(Yn)}function pi(Yn){var Ci=Me(!_t,Yn);hn==null||hn(Ci,Yn)}var Gn=nt()(Fn,Te,(He={},ye(He,"".concat(Fn,"-checked"),_t),ye(He,"".concat(Fn,"-disabled"),ni),He));return Ft.createElement("button",wt({},Lt,{type:"button",role:"switch","aria-checked":_t,disabled:ni,className:Gn,ref:zt,onKeyDown:wn,onClick:pi}),Cn,Ft.createElement("span",{className:"".concat(Fn,"-inner")},Ft.createElement("span",{className:"".concat(Fn,"-inner-checked")},he),Ft.createElement("span",{className:"".concat(Fn,"-inner-unchecked")},Ae)))});Bi.displayName="Switch";var so=Bi},73299:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return sr}});var wt=Vt(87462),ue=Vt(1413),_e=Vt(71002),$e=Vt(97685),ye=Vt(4942),oe=Vt(45987),Yt=Vt(67294),Ne=Vt(73935),ge=Vt(94184),we=Vt.n(ge),Ye=Vt(48555),Be=Yt.forwardRef(function(Je,xt){var en=Je.height,vn=Je.offsetY,mi=Je.offsetX,li=Je.children,hi=Je.prefixCls,Fi=Je.onInnerResize,to=Je.innerProps,Ce=Je.rtl,Oe=Je.extra,ee={},Ie={display:"flex",flexDirection:"column"};if(vn!==void 0){var Tn;ee={height:en,position:"relative",overflow:"hidden"},Ie=(0,ue.Z)((0,ue.Z)({},Ie),{},(Tn={transform:"translateY(".concat(vn,"px)")},(0,ye.Z)(Tn,Ce?"marginRight":"marginLeft",-mi),(0,ye.Z)(Tn,"position","absolute"),(0,ye.Z)(Tn,"left",0),(0,ye.Z)(Tn,"right",0),(0,ye.Z)(Tn,"top",0),Tn))}return Yt.createElement("div",{style:ee},Yt.createElement(Ye.Z,{onResize:function(Bn){var me=Bn.offsetHeight;me&&Fi&&Fi()}},Yt.createElement("div",(0,wt.Z)({style:Ie,className:we()((0,ye.Z)({},"".concat(hi,"-holder-inner"),hi)),ref:xt},to),li,Oe)))});Be.displayName="Filler";var on=Be,Ft=function(xt){return+setTimeout(xt,16)},et=function(xt){return clearTimeout(xt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ft=function(xt){return window.requestAnimationFrame(xt)},et=function(xt){return window.cancelAnimationFrame(xt)});var nt=0,ht=new Map;function lt(Je){ht.delete(Je)}var pt=function(xt){var en=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;nt+=1;var vn=nt;function mi(li){if(li===0)lt(vn),xt();else{var hi=Ft(function(){mi(li-1)});ht.set(vn,hi)}}return mi(en),vn};pt.cancel=function(Je){var xt=ht.get(Je);return lt(xt),et(xt)};var vt=pt;function kt(Je,xt){var en="touches"in Je?Je.touches[0]:Je;return en[xt?"pageX":"pageY"]}var Et=Yt.forwardRef(function(Je,xt){var en,vn=Je.prefixCls,mi=Je.rtl,li=Je.scrollOffset,hi=Je.scrollRange,Fi=Je.onStartMove,to=Je.onStopMove,Ce=Je.onScroll,Oe=Je.horizontal,ee=Je.spinSize,Ie=Je.containerSize,Tn=Je.style,Hn=Je.thumbStyle,Bn=Yt.useState(!1),me=(0,$e.Z)(Bn,2),Ze=me[0],Xn=me[1],Ni=Yt.useState(null),sn=(0,$e.Z)(Ni,2),de=sn[0],bn=sn[1],qn=Yt.useState(null),Di=(0,$e.Z)(qn,2),Ve=Di[0],jn=Di[1],wo=!mi,Ho=Yt.useRef(),fo=Yt.useRef(),Un=Yt.useState(!1),_n=(0,$e.Z)(Un,2),ti=_n[0],Yi=_n[1],Co=Yt.useRef(),ne=function(){clearTimeout(Co.current),Yi(!0),Co.current=setTimeout(function(){Yi(!1)},3e3)},xe=hi-Ie||0,Pe=Ie-ee||0,kn=xe>0,zi=Yt.useMemo(function(){if(li===0||xe===0)return 0;var fi=li/xe;return fi*Pe},[li,xe,Pe]),ae=function(In){In.stopPropagation(),In.preventDefault()},Mn=Yt.useRef({top:zi,dragging:Ze,pageY:de,startTop:Ve});Mn.current={top:zi,dragging:Ze,pageY:de,startTop:Ve};var cn=function(In){Xn(!0),bn(kt(In,Oe)),jn(Mn.current.top),Fi(),In.stopPropagation(),In.preventDefault()};Yt.useEffect(function(){var fi=function(ke){ke.preventDefault()},In=Ho.current,be=fo.current;return In.addEventListener("touchstart",fi),be.addEventListener("touchstart",cn),function(){In.removeEventListener("touchstart",fi),be.removeEventListener("touchstart",cn)}},[]);var Se=Yt.useRef();Se.current=xe;var $n=Yt.useRef();$n.current=Pe,Yt.useEffect(function(){if(Ze){var fi,In=function(ke){var vi=Mn.current,co=vi.dragging,qt=vi.pageY,se=vi.startTop;if(vt.cancel(fi),co){var ve=kt(ke,Oe)-qt,je=se;!wo&&Oe?je-=ve:je+=ve;var fn=Se.current,Kn=$n.current,yn=Kn?je/Kn:0,qe=Math.ceil(yn*fn);qe=Math.max(qe,0),qe=Math.min(qe,fn),fi=vt(function(){Ce(qe,Oe)})}},be=function(){Xn(!1),to()};return window.addEventListener("mousemove",In),window.addEventListener("touchmove",In),window.addEventListener("mouseup",be),window.addEventListener("touchend",be),function(){window.removeEventListener("mousemove",In),window.removeEventListener("touchmove",In),window.removeEventListener("mouseup",be),window.removeEventListener("touchend",be),vt.cancel(fi)}}},[Ze]),Yt.useEffect(function(){ne()},[li]),Yt.useImperativeHandle(xt,function(){return{delayHidden:ne}});var Vn="".concat(vn,"-scrollbar"),ui={position:"absolute",visibility:ti&&kn?null:"hidden"},di={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return Oe?(ui.height=8,ui.left=0,ui.right=0,ui.bottom=0,di.height="100%",di.width=ee,wo?di.left=zi:di.right=zi):(ui.width=8,ui.top=0,ui.bottom=0,wo?ui.right=0:ui.left=0,di.width="100%",di.height=ee,di.top=zi),Yt.createElement("div",{ref:Ho,className:we()(Vn,(en={},(0,ye.Z)(en,"".concat(Vn,"-horizontal"),Oe),(0,ye.Z)(en,"".concat(Vn,"-vertical"),!Oe),(0,ye.Z)(en,"".concat(Vn,"-visible"),ti),en)),style:(0,ue.Z)((0,ue.Z)({},ui),Tn),onMouseDown:ae,onMouseMove:ne},Yt.createElement("div",{ref:fo,className:we()("".concat(Vn,"-thumb"),(0,ye.Z)({},"".concat(Vn,"-thumb-moving"),Ze)),style:(0,ue.Z)((0,ue.Z)({},di),Hn),onMouseDown:cn}))}),Ht=Et;function Zt(Je){var xt=Je.children,en=Je.setRef,vn=Yt.useCallback(function(mi){en(mi)},[]);return Yt.cloneElement(xt,{ref:vn})}function ie(Je,xt,en,vn,mi,li,hi){var Fi=hi.getKey;return Je.slice(xt,en+1).map(function(to,Ce){var Oe=xt+Ce,ee=li(to,Oe,{style:{width:vn}}),Ie=Fi(to);return Yt.createElement(Zt,{key:Ie,setRef:function(Hn){return mi(to,Hn)}},ee)})}function le(Je){return Je instanceof HTMLElement||Je instanceof SVGElement}function re(Je){return le(Je)?Je:Je instanceof Yt.Component?Ne.findDOMNode(Je):null}var Ge=Vt(15671),fe=Vt(43144),Ke=function(){function Je(){(0,Ge.Z)(this,Je),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,fe.Z)(Je,[{key:"set",value:function(en,vn){this.maps[en]=vn,this.id+=1}},{key:"get",value:function(en){return this.maps[en]}}]),Je}(),an=Ke;function nn(Je,xt,en){var vn=Yt.useState(0),mi=(0,$e.Z)(vn,2),li=mi[0],hi=mi[1],Fi=(0,Yt.useRef)(new Map),to=(0,Yt.useRef)(new an),Ce=(0,Yt.useRef)();function Oe(){vt.cancel(Ce.current)}function ee(){var Tn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Oe();var Hn=function(){Fi.current.forEach(function(me,Ze){if(me&&me.offsetParent){var Xn=re(me),Ni=Xn.offsetHeight;to.current.get(Ze)!==Ni&&to.current.set(Ze,Xn.offsetHeight)}}),hi(function(me){return me+1})};Tn?Hn():Ce.current=vt(Hn)}function Ie(Tn,Hn){var Bn=Je(Tn),me=Fi.current.get(Bn);Hn?(Fi.current.set(Bn,Hn),ee()):Fi.current.delete(Bn),!me!=!Hn&&(Hn?xt==null||xt(Tn):en==null||en(Tn))}return(0,Yt.useEffect)(function(){return Oe},[]),[Ie,ee,to.current,li]}function Si(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var oi=Si()?Yt.useLayoutEffect:Yt.useEffect,Bi=function(xt,en){var vn=Yt.useRef(!0);oi(function(){return xt(vn.current)},en),oi(function(){return vn.current=!1,function(){vn.current=!0}},[])},so=function(xt,en){Bi(function(vn){if(!vn)return xt()},en)},Qt=Bi;function zt(Je){var xt=Yt.useRef();xt.current=Je;var en=Yt.useCallback(function(){for(var vn,mi=arguments.length,li=new Array(mi),hi=0;hi<mi;hi++)li[hi]=arguments[hi];return(vn=xt.current)===null||vn===void 0?void 0:vn.call.apply(vn,[xt].concat(li))},[]);return en}function He(Je){var xt=React.useRef(!1),en=React.useState(Je),vn=_slicedToArray(en,2),mi=vn[0],li=vn[1];React.useEffect(function(){return xt.current=!1,function(){xt.current=!0}},[]);function hi(Fi,to){to&&xt.current||li(Fi)}return[mi,hi]}function En(Je){return Je!==void 0}function Fn(Je,xt){var en=xt||{},vn=en.defaultValue,mi=en.value,li=en.onChange,hi=en.postState,Fi=useState(function(){return En(mi)?mi:En(vn)?typeof vn=="function"?vn():vn:typeof Je=="function"?Je():Je}),to=_slicedToArray(Fi,2),Ce=to[0],Oe=to[1],ee=mi!==void 0?mi:Ce,Ie=hi?hi(ee):ee,Tn=useEvent(li),Hn=useState([ee]),Bn=_slicedToArray(Hn,2),me=Bn[0],Ze=Bn[1];useLayoutUpdateEffect(function(){var Ni=me[0];Ce!==Ni&&Tn(Ce,Ni)},[me]),useLayoutUpdateEffect(function(){En(mi)||Oe(mi)},[mi]);var Xn=useEvent(function(Ni,sn){Oe(Ni,sn),Ze([ee],sn)});return[Ie,Xn]}var Te=Vt(31461);function ln(Je,xt,en){var vn=React.useRef({});return(!("value"in vn.current)||en(vn.current.condition,xt))&&(vn.current.value=Je(),vn.current.condition=xt),vn.current.value}function pn(Je,xt){typeof Je=="function"?Je(xt):_typeof(Je)==="object"&&Je&&"current"in Je&&(Je.current=xt)}function ni(){for(var Je=arguments.length,xt=new Array(Je),en=0;en<Je;en++)xt[en]=arguments[en];var vn=xt.filter(function(mi){return mi});return vn.length<=1?vn[0]:function(mi){xt.forEach(function(li){pn(li,mi)})}}function Cn(){for(var Je=arguments.length,xt=new Array(Je),en=0;en<Je;en++)xt[en]=arguments[en];return useMemo(function(){return ni.apply(void 0,xt)},xt,function(vn,mi){return vn.length!==mi.length||vn.every(function(li,hi){return li!==mi[hi]})})}function he(Je){var xt,en,vn=isMemo(Je)?Je.type.type:Je.type;return!(typeof vn=="function"&&!((xt=vn.prototype)!==null&&xt!==void 0&&xt.render)||typeof Je=="function"&&!((en=Je.prototype)!==null&&en!==void 0&&en.render))}function Ae(Je){return!isValidElement(Je)||isFragment(Je)?!1:he(Je)}function hn(Je,xt,en,vn){if(!xt.length)return en;var mi=_toArray(xt),li=mi[0],hi=mi.slice(1),Fi;return!Je&&typeof li=="number"?Fi=[]:Array.isArray(Je)?Fi=_toConsumableArray(Je):Fi=_objectSpread({},Je),vn&&en===void 0&&hi.length===1?delete Fi[li][hi[0]]:Fi[li]=hn(Fi[li],hi,en,vn),Fi}function De(Je,xt,en){var vn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return xt.length&&vn&&en===void 0&&!get(Je,xt.slice(0,-1))?Je:hn(Je,xt,en,vn)}function Rt(Je){return _typeof(Je)==="object"&&Je!==null&&Object.getPrototypeOf(Je)===Object.prototype}function Lt(Je){return Array.isArray(Je)?[]:{}}var Ct=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function Bt(){for(var Je=arguments.length,xt=new Array(Je),en=0;en<Je;en++)xt[en]=arguments[en];var vn=Lt(xt[0]);return xt.forEach(function(mi){function li(hi,Fi){var to=new Set(Fi),Ce=get(mi,hi),Oe=Array.isArray(Ce);if(Oe||Rt(Ce)){if(!to.has(Ce)){to.add(Ce);var ee=get(vn,hi);Oe?vn=De(vn,hi,[]):(!ee||_typeof(ee)!=="object")&&(vn=De(vn,hi,Lt(Ce))),Ct(Ce).forEach(function(Ie){li([].concat(_toConsumableArray(hi),[Ie]),to)})}}else vn=De(vn,hi,Ce)}li([])}),vn}var _t={},Nt=[],Me=function(xt){Nt.push(xt)};function wn(Je,xt){if(0)var en}function pi(Je,xt){if(0)var en}function Gn(){_t={}}function Yn(Je,xt,en){!xt&&!_t[en]&&(Je(!1,en),_t[en]=!0)}function Ci(Je,xt){Yn(wn,Je,xt)}function Pn(Je,xt){Yn(pi,Je,xt)}Ci.preMessage=Me,Ci.resetWarned=Gn,Ci.noteOnce=Pn;var ki=null,ai=10;function eo(Je,xt,en,vn,mi,li,hi,Fi){var to=Yt.useRef(),Ce=Yt.useState(null),Oe=(0,$e.Z)(Ce,2),ee=Oe[0],Ie=Oe[1];return Qt(function(){if(ee&&ee.times<ai){if(!Je.current){Ie(function(ne){return(0,ue.Z)({},ne)});return}li();var Tn=ee.targetAlign,Hn=ee.originAlign,Bn=ee.index,me=ee.offset,Ze=Je.current.clientHeight,Xn=!1,Ni=Tn,sn=null;if(Ze){for(var de=Tn||Hn,bn=0,qn=0,Di=0,Ve=Math.min(xt.length-1,Bn),jn=0;jn<=Ve;jn+=1){var wo=mi(xt[jn]);qn=bn;var Ho=en.get(wo);Di=qn+(Ho===void 0?vn:Ho),bn=Di}for(var fo=de==="top"?me:Ze-me,Un=Ve;Un>=0;Un-=1){var _n=mi(xt[Un]),ti=en.get(_n);if(ti===void 0){Xn=!0;break}if(fo-=ti,fo<=0)break}switch(de){case"top":sn=qn-me;break;case"bottom":sn=Di-Ze+me;break;default:{var Yi=Je.current.scrollTop,Co=Yi+Ze;qn<Yi?Ni="top":Di>Co&&(Ni="bottom")}}sn!==null&&hi(sn),sn!==ee.lastTop&&(Xn=!0)}Xn&&Ie(function(ne){return(0,ue.Z)((0,ue.Z)({},ne),{},{times:ne.times+1,targetAlign:Ni,lastTop:sn})})}},[ee,Je.current]),function(Tn){if(Tn==null){Fi();return}if(vt.cancel(to.current),typeof Tn=="number")hi(Tn);else if(Tn&&(0,_e.Z)(Tn)==="object"){var Hn,Bn=Tn.align;"index"in Tn?Hn=Tn.index:Hn=xt.findIndex(function(Xn){return mi(Xn)===Tn.key});var me=Tn.offset,Ze=me===void 0?0:me;Ie({times:0,index:Hn,offset:Ze,originAlign:Bn})}}}function ri(Je,xt,en,vn){var mi=en-Je,li=xt-en,hi=Math.min(mi,li)*2;if(vn<=hi){var Fi=Math.floor(vn/2);return vn%2?en+Fi+1:en-Fi}return mi>li?en-(vn-li):en+(vn-mi)}function Yo(Je,xt,en){var vn=Je.length,mi=xt.length,li,hi;if(vn===0&&mi===0)return null;vn<mi?(li=Je,hi=xt):(li=xt,hi=Je);var Fi={__EMPTY_ITEM__:!0};function to(Hn){return Hn!==void 0?en(Hn):Fi}for(var Ce=null,Oe=Math.abs(vn-mi)!==1,ee=0;ee<hi.length;ee+=1){var Ie=to(li[ee]),Tn=to(hi[ee]);if(Ie!==Tn){Ce=ee,Oe=Oe||Ie!==to(hi[ee+1]);break}}return Ce===null?null:{index:Ce,multiple:Oe}}function Ro(Je,xt,en){var vn=Yt.useState(Je),mi=(0,$e.Z)(vn,2),li=mi[0],hi=mi[1],Fi=Yt.useState(null),to=(0,$e.Z)(Fi,2),Ce=to[0],Oe=to[1];return Yt.useEffect(function(){var ee=Yo(li||[],Je||[],xt);(ee==null?void 0:ee.index)!==void 0&&(en==null||en(ee.index),Oe(Je[ee.index])),hi(Je)},[Je]),[Ce]}var mo=(typeof navigator=="undefined"?"undefined":(0,_e.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Ji=mo,Cr=function(Je,xt){var en=(0,Yt.useRef)(!1),vn=(0,Yt.useRef)(null);function mi(){clearTimeout(vn.current),en.current=!0,vn.current=setTimeout(function(){en.current=!1},50)}var li=(0,Yt.useRef)({top:Je,bottom:xt});return li.current.top=Je,li.current.bottom=xt,function(hi){var Fi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,to=hi<0&&li.current.top||hi>0&&li.current.bottom;return Fi&&to?(clearTimeout(vn.current),en.current=!1):(!to||en.current)&&mi(),!en.current&&to}};function Po(Je,xt,en,vn,mi){var li=(0,Yt.useRef)(0),hi=(0,Yt.useRef)(null),Fi=(0,Yt.useRef)(null),to=(0,Yt.useRef)(!1),Ce=Cr(xt,en);function Oe(me,Ze){vt.cancel(hi.current),li.current+=Ze,Fi.current=Ze,!Ce(Ze)&&(Ji||me.preventDefault(),hi.current=vt(function(){var Xn=to.current?10:1;mi(li.current*Xn),li.current=0}))}function ee(me,Ze){mi(Ze,!0),Ji||me.preventDefault()}var Ie=(0,Yt.useRef)(null),Tn=(0,Yt.useRef)(null);function Hn(me){if(Je){vt.cancel(Tn.current),Tn.current=vt(function(){Ie.current=null},2);var Ze=me.deltaX,Xn=me.deltaY,Ni=me.shiftKey,sn=Ze,de=Xn;(Ie.current==="sx"||!Ie.current&&Ni&&Xn&&!Ze)&&(sn=Xn,de=0,Ie.current="sx");var bn=Math.abs(sn),qn=Math.abs(de);Ie.current===null&&(Ie.current=vn&&bn>qn?"x":"y"),Ie.current==="y"?Oe(me,de):ee(me,sn)}}function Bn(me){Je&&(to.current=me.detail===Fi.current)}return[Hn,Bn]}var dr=14/15;function rr(Je,xt,en){var vn=(0,Yt.useRef)(!1),mi=(0,Yt.useRef)(0),li=(0,Yt.useRef)(null),hi=(0,Yt.useRef)(null),Fi,to=function(Ie){if(vn.current){var Tn=Math.ceil(Ie.touches[0].pageY),Hn=mi.current-Tn;mi.current=Tn,en(Hn)&&Ie.preventDefault(),clearInterval(hi.current),hi.current=setInterval(function(){Hn*=dr,(!en(Hn,!0)||Math.abs(Hn)<=.1)&&clearInterval(hi.current)},16)}},Ce=function(){vn.current=!1,Fi()},Oe=function(Ie){Fi(),Ie.touches.length===1&&!vn.current&&(vn.current=!0,mi.current=Math.ceil(Ie.touches[0].pageY),li.current=Ie.target,li.current.addEventListener("touchmove",to),li.current.addEventListener("touchend",Ce))};Fi=function(){li.current&&(li.current.removeEventListener("touchmove",to),li.current.removeEventListener("touchend",Ce))},Qt(function(){return Je&&xt.current.addEventListener("touchstart",Oe),function(){var ee;(ee=xt.current)===null||ee===void 0||ee.removeEventListener("touchstart",Oe),Fi(),clearInterval(hi.current)}},[Je])}var fr=20;function Ti(){var Je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,en=Je/xt*100;return isNaN(en)&&(en=0),en=Math.max(en,fr),en=Math.min(en,Je/2),Math.floor(en)}function jo(Je,xt,en,vn){var mi=Yt.useMemo(function(){return[new Map,[]]},[Je,en.id,vn]),li=(0,$e.Z)(mi,2),hi=li[0],Fi=li[1],to=function(Oe){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe,Ie=hi.get(Oe),Tn=hi.get(ee);if(Ie===void 0||Tn===void 0)for(var Hn=Je.length,Bn=Fi.length;Bn<Hn;Bn+=1){var me,Ze=Je[Bn],Xn=xt(Ze);hi.set(Xn,Bn);var Ni=(me=en.get(Xn))!==null&&me!==void 0?me:vn;if(Fi[Bn]=(Fi[Bn-1]||0)+Ni,Xn===Oe&&(Ie=Bn),Xn===ee&&(Tn=Bn),Ie!==void 0&&Tn!==void 0)break}return{top:Fi[Ie-1]||0,bottom:Fi[Tn]}};return to}var As=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],ws=[],Ws={overflowY:"auto",overflowAnchor:"none"};function Wr(Je,xt){var en=Je.prefixCls,vn=en===void 0?"rc-virtual-list":en,mi=Je.className,li=Je.height,hi=Je.itemHeight,Fi=Je.fullHeight,to=Fi===void 0?!0:Fi,Ce=Je.style,Oe=Je.data,ee=Je.children,Ie=Je.itemKey,Tn=Je.virtual,Hn=Je.direction,Bn=Je.scrollWidth,me=Je.component,Ze=me===void 0?"div":me,Xn=Je.onScroll,Ni=Je.onVirtualScroll,sn=Je.onVisibleChange,de=Je.innerProps,bn=Je.extraRender,qn=Je.styles,Di=(0,oe.Z)(Je,As),Ve=!!(Tn!==!1&&li&&hi),jn=Ve&&Oe&&(hi*Oe.length>li||!!Bn),wo=Hn==="rtl",Ho=we()(vn,(0,ye.Z)({},"".concat(vn,"-rtl"),wo),mi),fo=Oe||ws,Un=(0,Yt.useRef)(),_n=(0,Yt.useRef)(),ti=(0,Yt.useState)(0),Yi=(0,$e.Z)(ti,2),Co=Yi[0],ne=Yi[1],xe=(0,Yt.useState)(0),Pe=(0,$e.Z)(xe,2),kn=Pe[0],zi=Pe[1],ae=(0,Yt.useState)(!1),Mn=(0,$e.Z)(ae,2),cn=Mn[0],Se=Mn[1],$n=function(){Se(!0)},Vn=function(){Se(!1)},ui=Yt.useCallback(function(Hi){return typeof Ie=="function"?Ie(Hi):Hi==null?void 0:Hi[Ie]},[Ie]),di={getKey:ui};function fi(Hi){ne(function(Vi){var Mo;typeof Hi=="function"?Mo=Hi(Vi):Mo=Hi;var Bo=xi(Mo);return Un.current.scrollTop=Bo,Bo})}var In=(0,Yt.useRef)({start:0,end:fo.length}),be=(0,Yt.useRef)(),Gi=Ro(fo,ui),ke=(0,$e.Z)(Gi,1),vi=ke[0];be.current=vi;var co=nn(ui,null,null),qt=(0,$e.Z)(co,4),se=qt[0],ve=qt[1],je=qt[2],fn=qt[3],Kn=Yt.useMemo(function(){if(!Ve)return{scrollHeight:void 0,start:0,end:fo.length-1,offset:void 0};if(!jn){var Hi;return{scrollHeight:((Hi=_n.current)===null||Hi===void 0?void 0:Hi.offsetHeight)||0,start:0,end:fo.length-1,offset:void 0}}for(var Vi=0,Mo,Bo,On,ra=fo.length,Zr=0;Zr<ra;Zr+=1){var Ys=fo[Zr],Tl=ui(Ys),Fl=je.get(Tl),Sn=Vi+(Fl===void 0?hi:Fl);Sn>=Co&&Mo===void 0&&(Mo=Zr,Bo=Vi),Sn>Co+li&&On===void 0&&(On=Zr),Vi=Sn}return Mo===void 0&&(Mo=0,Bo=0,On=Math.ceil(li/hi)),On===void 0&&(On=fo.length-1),On=Math.min(On+1,fo.length-1),{scrollHeight:Vi,start:Mo,end:On,offset:Bo}},[jn,Ve,Co,fo,fn,li]),yn=Kn.scrollHeight,qe=Kn.start,At=Kn.end,An=Kn.offset;In.current.start=qe,In.current.end=At;var _i=Yt.useState({width:0,height:li}),Wi=(0,$e.Z)(_i,2),To=Wi[0],lo=Wi[1],Qi=function(Vi){lo({width:Vi.width||Vi.offsetWidth,height:Vi.height||Vi.offsetHeight})},Do=(0,Yt.useRef)(),Ii=(0,Yt.useRef)(),Pi=Yt.useMemo(function(){return Ti(To.width,Bn)},[To.width,Bn]),Ui=Yt.useMemo(function(){return Ti(To.height,yn)},[To.height,yn]),Wn=yn-li,Dn=(0,Yt.useRef)(Wn);Dn.current=Wn;function xi(Hi){var Vi=Hi;return Number.isNaN(Dn.current)||(Vi=Math.min(Vi,Dn.current)),Vi=Math.max(Vi,0),Vi}var Le=Co<=0,gi=Co>=Wn,ji=Cr(Le,gi),Lo=function(){return{x:wo?-kn:kn,y:Co}},vo=(0,Yt.useRef)(Lo()),Oo=zt(function(){if(Ni){var Hi=Lo();(vo.current.x!==Hi.x||vo.current.y!==Hi.y)&&(Ni(Hi),vo.current=Hi)}});function Wo(Hi,Vi){var Mo=Hi;Vi?((0,Ne.flushSync)(function(){zi(Mo)}),Oo()):fi(Mo)}function Ar(Hi){var Vi=Hi.currentTarget.scrollTop;Vi!==Co&&fi(Vi),Xn==null||Xn(Hi),Oo()}var cr=function(Vi){var Mo=Vi,Bo=Bn-To.width;return Mo=Math.max(Mo,0),Mo=Math.min(Mo,Bo),Mo},Bs=zt(function(Hi,Vi){Vi?((0,Ne.flushSync)(function(){zi(function(Mo){var Bo=Mo+(wo?-Hi:Hi);return cr(Bo)})}),Oo()):fi(function(Mo){var Bo=Mo+Hi;return Bo})}),Us=Po(Ve,Le,gi,!!Bn,Bs),pe=(0,$e.Z)(Us,2),Br=pe[0],Cs=pe[1];rr(Ve,Un,function(Hi,Vi){return ji(Hi,Vi)?!1:(Br({preventDefault:function(){},deltaY:Hi}),!0)}),Qt(function(){function Hi(Mo){Ve&&Mo.preventDefault()}var Vi=Un.current;return Vi.addEventListener("wheel",Br),Vi.addEventListener("DOMMouseScroll",Cs),Vi.addEventListener("MozMousePixelScroll",Hi),function(){Vi.removeEventListener("wheel",Br),Vi.removeEventListener("DOMMouseScroll",Cs),Vi.removeEventListener("MozMousePixelScroll",Hi)}},[Ve]),Qt(function(){Bn&&zi(function(Hi){return cr(Hi)})},[To.width,Bn]);var ma=function(){var Vi,Mo;(Vi=Do.current)===null||Vi===void 0||Vi.delayHidden(),(Mo=Ii.current)===null||Mo===void 0||Mo.delayHidden()},po=eo(Un,fo,je,hi,ui,function(){return ve(!0)},fi,ma);Yt.useImperativeHandle(xt,function(){return{getScrollInfo:Lo,scrollTo:function(Vi){function Mo(Bo){return Bo&&(0,_e.Z)(Bo)==="object"&&("left"in Bo||"top"in Bo)}Mo(Vi)?(Vi.left!==void 0&&zi(cr(Vi.left)),po(Vi.top)):po(Vi)}}}),Qt(function(){if(sn){var Hi=fo.slice(qe,At+1);sn(Hi,fo)}},[qe,At,fo]);var Ds=jo(fo,ui,je,hi),Os=bn==null?void 0:bn({start:qe,end:At,virtual:jn,offsetX:kn,offsetY:An,rtl:wo,getSize:Ds}),Vs=ie(fo,qe,At,Bn,se,ee,di),yo=null;li&&(yo=(0,ue.Z)((0,ye.Z)({},to?"height":"maxHeight",li),Ws),Ve&&(yo.overflowY="hidden",Bn&&(yo.overflowX="hidden"),cn&&(yo.pointerEvents="none")));var $o={};return wo&&($o.dir="rtl"),Yt.createElement("div",(0,wt.Z)({style:(0,ue.Z)((0,ue.Z)({},Ce),{},{position:"relative"}),className:Ho},$o,Di),Yt.createElement(Ye.Z,{onResize:Qi},Yt.createElement(Ze,{className:"".concat(vn,"-holder"),style:yo,ref:Un,onScroll:Ar,onMouseEnter:ma},Yt.createElement(on,{prefixCls:vn,height:yn,offsetX:kn,offsetY:An,scrollWidth:Bn,onInnerResize:ve,ref:_n,innerProps:de,rtl:wo,extra:Os},Vs))),jn&&yn>li&&Yt.createElement(Ht,{ref:Do,prefixCls:vn,scrollOffset:Co,scrollRange:yn,rtl:wo,onScroll:Wo,onStartMove:$n,onStopMove:Vn,spinSize:Ui,containerSize:To.height,style:qn==null?void 0:qn.verticalScrollBar,thumbStyle:qn==null?void 0:qn.verticalScrollBarThumb}),jn&&Bn&&Yt.createElement(Ht,{ref:Ii,prefixCls:vn,scrollOffset:kn,scrollRange:Bn,rtl:wo,onScroll:Wo,onStartMove:$n,onStopMove:Vn,spinSize:Pi,containerSize:To.width,horizontal:!0,style:qn==null?void 0:qn.horizontalScrollBar,thumbStyle:qn==null?void 0:qn.horizontalScrollBarThumb}))}var os=Yt.forwardRef(Wr);os.displayName="List";var Or=os,sr=Or},66392:function(un,Rn){"use strict";var Vt;var wt=Symbol.for("react.element"),ue=Symbol.for("react.portal"),_e=Symbol.for("react.fragment"),$e=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),oe=Symbol.for("react.provider"),Yt=Symbol.for("react.context"),Ne=Symbol.for("react.server_context"),ge=Symbol.for("react.forward_ref"),we=Symbol.for("react.suspense"),Ye=Symbol.for("react.suspense_list"),Be=Symbol.for("react.memo"),on=Symbol.for("react.lazy"),Ft=Symbol.for("react.offscreen"),et;et=Symbol.for("react.module.reference");function nt(ht){if(typeof ht=="object"&&ht!==null){var lt=ht.$$typeof;switch(lt){case wt:switch(ht=ht.type,ht){case _e:case ye:case $e:case we:case Ye:return ht;default:switch(ht=ht&&ht.$$typeof,ht){case Ne:case Yt:case ge:case on:case Be:case oe:return ht;default:return lt}}case ue:return lt}}}Vt=Yt,Vt=oe,Vt=wt,Vt=ge,Vt=_e,Vt=on,Vt=Be,Vt=ue,Vt=ye,Vt=$e,Vt=we,Vt=Ye,Vt=function(){return!1},Vt=function(){return!1},Vt=function(ht){return nt(ht)===Yt},Vt=function(ht){return nt(ht)===oe},Vt=function(ht){return typeof ht=="object"&&ht!==null&&ht.$$typeof===wt},Vt=function(ht){return nt(ht)===ge},Vt=function(ht){return nt(ht)===_e},Vt=function(ht){return nt(ht)===on},Vt=function(ht){return nt(ht)===Be},Vt=function(ht){return nt(ht)===ue},Vt=function(ht){return nt(ht)===ye},Vt=function(ht){return nt(ht)===$e},Vt=function(ht){return nt(ht)===we},Vt=function(ht){return nt(ht)===Ye},Vt=function(ht){return typeof ht=="string"||typeof ht=="function"||ht===_e||ht===ye||ht===$e||ht===we||ht===Ye||ht===Ft||typeof ht=="object"&&ht!==null&&(ht.$$typeof===on||ht.$$typeof===Be||ht.$$typeof===oe||ht.$$typeof===Yt||ht.$$typeof===ge||ht.$$typeof===et||ht.getModuleId!==void 0)},Vt=nt},31461:function(un,Rn,Vt){"use strict";Vt(66392)},4977:function(un){"use strict";un.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},17423:function(un,Rn,Vt){"use strict";Vt.d(Rn,{Z:function(){return Ne}});const wt=ge=>typeof ge=="object"&&ge!=null&&ge.nodeType===1,ue=(ge,we)=>(!we||ge!=="hidden")&&ge!=="visible"&&ge!=="clip",_e=(ge,we)=>{if(ge.clientHeight<ge.scrollHeight||ge.clientWidth<ge.scrollWidth){const Ye=getComputedStyle(ge,null);return ue(Ye.overflowY,we)||ue(Ye.overflowX,we)||(Be=>{const on=(Ft=>{if(!Ft.ownerDocument||!Ft.ownerDocument.defaultView)return null;try{return Ft.ownerDocument.defaultView.frameElement}catch(et){return null}})(Be);return!!on&&(on.clientHeight<Be.scrollHeight||on.clientWidth<Be.scrollWidth)})(ge)}return!1},$e=(ge,we,Ye,Be,on,Ft,et,nt)=>Ft<ge&&et>we||Ft>ge&&et<we?0:Ft<=ge&&nt<=Ye||et>=we&&nt>=Ye?Ft-ge-Be:et>we&&nt<Ye||Ft<ge&&nt>Ye?et-we+on:0,ye=ge=>{const we=ge.parentElement;return we==null?ge.getRootNode().host||null:we},oe=(ge,we)=>{var Ye,Be,on,Ft;if(typeof document=="undefined")return[];const{scrollMode:et,block:nt,inline:ht,boundary:lt,skipOverflowHiddenElements:pt}=we,vt=typeof lt=="function"?lt:Fn=>Fn!==lt;if(!wt(ge))throw new TypeError("Invalid target");const kt=document.scrollingElement||document.documentElement,Et=[];let Ht=ge;for(;wt(Ht)&&vt(Ht);){if(Ht=ye(Ht),Ht===kt){Et.push(Ht);break}Ht!=null&&Ht===document.body&&_e(Ht)&&!_e(document.documentElement)||Ht!=null&&_e(Ht,pt)&&Et.push(Ht)}const Zt=(Be=(Ye=window.visualViewport)==null?void 0:Ye.width)!=null?Be:innerWidth,ie=(Ft=(on=window.visualViewport)==null?void 0:on.height)!=null?Ft:innerHeight,{scrollX:le,scrollY:re}=window,{height:Ge,width:fe,top:Ke,right:an,bottom:nn,left:Si}=ge.getBoundingClientRect(),{top:oi,right:Bi,bottom:so,left:Qt}=(Fn=>{const Te=window.getComputedStyle(Fn);return{top:parseFloat(Te.scrollMarginTop)||0,right:parseFloat(Te.scrollMarginRight)||0,bottom:parseFloat(Te.scrollMarginBottom)||0,left:parseFloat(Te.scrollMarginLeft)||0}})(ge);let zt=nt==="start"||nt==="nearest"?Ke-oi:nt==="end"?nn+so:Ke+Ge/2-oi+so,He=ht==="center"?Si+fe/2-Qt+Bi:ht==="end"?an+Bi:Si-Qt;const En=[];for(let Fn=0;Fn<Et.length;Fn++){const Te=Et[Fn],{height:ln,width:pn,top:ni,right:Cn,bottom:he,left:Ae}=Te.getBoundingClientRect();if(et==="if-needed"&&Ke>=0&&Si>=0&&nn<=ie&&an<=Zt&&Ke>=ni&&nn<=he&&Si>=Ae&&an<=Cn)return En;const hn=getComputedStyle(Te),De=parseInt(hn.borderLeftWidth,10),Rt=parseInt(hn.borderTopWidth,10),Lt=parseInt(hn.borderRightWidth,10),Ct=parseInt(hn.borderBottomWidth,10);let Bt=0,_t=0;const Nt="offsetWidth"in Te?Te.offsetWidth-Te.clientWidth-De-Lt:0,Me="offsetHeight"in Te?Te.offsetHeight-Te.clientHeight-Rt-Ct:0,wn="offsetWidth"in Te?Te.offsetWidth===0?0:pn/Te.offsetWidth:0,pi="offsetHeight"in Te?Te.offsetHeight===0?0:ln/Te.offsetHeight:0;if(kt===Te)Bt=nt==="start"?zt:nt==="end"?zt-ie:nt==="nearest"?$e(re,re+ie,ie,Rt,Ct,re+zt,re+zt+Ge,Ge):zt-ie/2,_t=ht==="start"?He:ht==="center"?He-Zt/2:ht==="end"?He-Zt:$e(le,le+Zt,Zt,De,Lt,le+He,le+He+fe,fe),Bt=Math.max(0,Bt+re),_t=Math.max(0,_t+le);else{Bt=nt==="start"?zt-ni-Rt:nt==="end"?zt-he+Ct+Me:nt==="nearest"?$e(ni,he,ln,Rt,Ct+Me,zt,zt+Ge,Ge):zt-(ni+ln/2)+Me/2,_t=ht==="start"?He-Ae-De:ht==="center"?He-(Ae+pn/2)+Nt/2:ht==="end"?He-Cn+Lt+Nt:$e(Ae,Cn,pn,De,Lt+Nt,He,He+fe,fe);const{scrollLeft:Gn,scrollTop:Yn}=Te;Bt=pi===0?0:Math.max(0,Math.min(Yn+Bt/pi,Te.scrollHeight-ln/pi+Me)),_t=wn===0?0:Math.max(0,Math.min(Gn+_t/wn,Te.scrollWidth-pn/wn+Nt)),zt+=Yn-Bt,He+=Gn-_t}En.push({el:Te,top:Bt,left:_t})}return En},Yt=ge=>ge===!1?{block:"end",inline:"nearest"}:(we=>we===Object(we)&&Object.keys(we).length!==0)(ge)?ge:{block:"start",inline:"nearest"};function Ne(ge,we){if(!ge.isConnected||!(on=>{let Ft=on;for(;Ft&&Ft.parentNode;){if(Ft.parentNode===document)return!0;Ft=Ft.parentNode instanceof ShadowRoot?Ft.parentNode.host:Ft.parentNode}return!1})(ge))return;const Ye=(on=>{const Ft=window.getComputedStyle(on);return{top:parseFloat(Ft.scrollMarginTop)||0,right:parseFloat(Ft.scrollMarginRight)||0,bottom:parseFloat(Ft.scrollMarginBottom)||0,left:parseFloat(Ft.scrollMarginLeft)||0}})(ge);if((on=>typeof on=="object"&&typeof on.behavior=="function")(we))return we.behavior(oe(ge,we));const Be=typeof we=="boolean"||we==null?void 0:we.behavior;for(const{el:on,top:Ft,left:et}of oe(ge,Yt(we))){const nt=Ft-Ye.top+Ye.bottom,ht=et-Ye.left+Ye.right;on.scroll({top:nt,left:ht,behavior:Be})}}}}]);