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.
1252 lines
2.3 MiB
1252 lines
2.3 MiB
(self.webpackChunk=self.webpackChunk||[]).push([[5816],{8336:function(){"use strict"},12469:function(){"use strict"},99587:function(Zn,ei){"use strict";ei.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},8423:function(Zn,ei){"use strict";ei.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},12327:function(Zn,ei,Le){"use strict";var le=Le(59301),Ue=Object.defineProperty,pt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,Oe=(ot,We,Tt)=>We in ot?Ue(ot,We,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):ot[We]=Tt,at=(ot,We)=>{for(var Tt in We||(We={}))St.call(We,Tt)&&Oe(ot,Tt,We[Tt]);if(pt)for(var Tt of pt(We))yt.call(We,Tt)&&Oe(ot,Tt,We[Tt]);return ot};const Ct=ot=>React.createElement("svg",at({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},ot),React.createElement("title",null,"\u7F16\u7EC4 18"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("circle",{fill:"#FCB041",cx:7,cy:7,r:7}),React.createElement("path",{d:"M7.531 9.638a.616.616 0 1 1-1.231 0v-.02a.616.616 0 1 1 1.231 0v.02Zm0-2.25a.616.616 0 1 1-1.231 0V4.117a.616.616 0 1 1 1.231 0v3.273Z",fill:"#FFF",fillRule:"nonzero"})));ei.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},63720:function(){"use strict";function Zn(De,ne,te,de){te===void 0&&(te=0),de===void 0&&(de=1/0),this._name=De,this._defaultValue=ne,this._minimum=te,this._maximum=de}Object.defineProperty(Zn.prototype,"name",{get:function(){return this._name},set:function(De){if(typeof De!="string"||De==="")throw new Error("Shape name must be a valid string.");this._name=De}}),Object.defineProperty(Zn.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(De){if(typeof De!="number"||isNaN(De))throw new Error("The default value must be a real number, not: "+De);this._defaultValue=De}}),Object.defineProperty(Zn.prototype,"minimum",{get:function(){return this._minimum},set:function(De){if(typeof De!="number"||isNaN(De))throw new Error("Minimum must be a real number, not: "+De);this._minimum=De}}),Object.defineProperty(Zn.prototype,"maximum",{get:function(){return this._maximum},set:function(De){if(typeof De!="number"||isNaN(De))throw new Error("Maximum must be a real number, not: "+De);this._maximum=De}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(De,ne){var te=go.Shape._FigureParameters[De];return te?te[ne]:null},go.Shape.setFigureParameter=function(De,ne,te){if(!(te instanceof Zn))throw new Error("Third argument to Shape.setFigureParameter is not FigureParameter: "+te);if(te.defaultValue<te.minimum||te.defaultValue>te.maximum)throw new Error("defaultValue must be between minimum and maximum, not: "+te.defaultValue);var de=go.Shape._FigureParameters[De];de||(de=[],go.Shape._FigureParameters[De]=de),de[ne]=te};var ei=[];function Le(De,ne){var te=ei.pop();return te===void 0?new go.Point(De,ne):(te.x=De,te.y=ne,te)}function le(){var De=ei.pop();return De===void 0?new go.Point:De}function Ue(De){ei.push(De)}function pt(De,ne,te,de,se,pe,ye,we,Ce){Ce||(Ce=new go.Point);var _e=De-te,Ze=se-ye,st=NaN,nt=NaN;if(_e===0)if(Ze===0)De===te&&(st=De,nt=ne);else{var Ye=(pe-we)/Ze,ct=pe-Ye*se;st=De,nt=Ye*st+ct}else if(Ze===0){var $e=(ne-de)/_e,Et=ne-$e*De;st=se,nt=$e*st+Et}else{var $e=(ne-de)/_e,Ye=(pe-we)/Ze,Et=ne-$e*De,ct=pe-Ye*se;st=(ct-Et)/($e-Ye),nt=$e*st+Et}return Ce.x=st,Ce.y=nt,Ce}function St(De,ne,te,de,se,pe,ye,we,Ce,_e,Ze,st,nt,Ye){var ct=1-Ce,$e=Ce,Et=De*ct+te*$e,Pt=ne*ct+de*$e,Bt=te*ct+se*$e,fn=de*ct+pe*$e,qt=se*ct+ye*$e,vn=pe*ct+we*$e,tn=Et*ct+Bt*$e,it=Pt*ct+fn*$e,rt=Bt*ct+qt*$e,dn=fn*ct+vn*$e,ni=tn*ct+rt*$e,Kn=it*ct+dn*$e;_e.x=Et,_e.y=Pt,Ze.x=tn,Ze.y=it,st.x=ni,st.y=Kn,nt.x=rt,nt.y=dn,Ye.x=qt,Ye.y=vn}var yt=new go.Spot(.156,.156),Oe=new go.Spot(.844,.844),at=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new Zn("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=5),de=Math.min(de,ne/3),de=Math.min(de,te/3);var se=de*at,pe=new go.Geometry().add(new go.PathFigure(de,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne-de,0)).add(new go.PathSegment(go.PathSegment.Bezier,ne,de,ne-se,0,ne,se)).add(new go.PathSegment(go.PathSegment.Line,ne,te-de)).add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne,te-se,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,de,te)).add(new go.PathSegment(go.PathSegment.Bezier,0,te-de,se,te,0,te-se)).add(new go.PathSegment(go.PathSegment.Line,0,de)).add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,se,se,0).close()));return se>1&&(pe.spot1=new go.Spot(0,0,se,se),pe.spot2=new go.Spot(1,1,-se,-se)),pe}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(0,.25,.5,.75)}),go.Shape.defineFigureGenerator("TriangleDown",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te).close())).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("TriangleLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,te).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,0).close())).setSpots(.5,.25,1,.75)}),go.Shape.defineFigureGenerator("TriangleUp",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,te).add(new go.PathSegment(go.PathSegment.Line,0,te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,0).close())).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("Triangle","TriangleUp"),go.Shape.defineFigureGenerator("Diamond",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,0).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te).close())).setSpots(.25,.25,.75,.75)}),go.Shape.defineFigureGenerator("LineH",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=0,de.startY=te/2,de.endX=ne,de.endY=te/2,de}),go.Shape.defineFigureGenerator("LineV",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=ne/2,de.startY=0,de.endX=ne/2,de.endY=te,de}),go.Shape.defineFigureGenerator("BarH","Rectangle"),go.Shape.defineFigureGenerator("BarV","Rectangle"),go.Shape.defineFigureGenerator("MinusLine","LineH"),go.Shape.defineFigureGenerator("PlusLine",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te/2,!1).add(new go.PathSegment(go.PathSegment.Line,ne,te/2)).add(new go.PathSegment(go.PathSegment.Move,ne/2,0)).add(new go.PathSegment(go.PathSegment.Line,ne/2,te)))}),go.Shape.defineFigureGenerator("XLine",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,0,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)))}),go.Shape.defineFigureGenerator("LineRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.25*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,.75*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.25*ne,te)))}),go.Shape.defineFigureGenerator("LineDown",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,.25*te,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.75*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)))}),go.Shape.defineFigureGenerator("LineLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.75*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,.25*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.75*ne,te)))}),go.Shape.defineFigureGenerator("LineUp",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,.75*te,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.25*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)))}),go.Shape.defineFigureGenerator("AsteriskLine",function(De,ne,te){var de=.2/Math.SQRT2;return new go.Geometry().add(new go.PathFigure(de*ne,(1-de)*te,!1).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,de*te)).add(new go.PathSegment(go.PathSegment.Move,de*ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,(1-de)*te)).add(new go.PathSegment(go.PathSegment.Move,0,te/2)).add(new go.PathSegment(go.PathSegment.Line,ne,te/2)).add(new go.PathSegment(go.PathSegment.Move,ne/2,0)).add(new go.PathSegment(go.PathSegment.Line,ne/2,te)))}),go.Shape.defineFigureGenerator("CircleLine",function(De,ne,te){var de=ne/2,se=new go.Geometry().add(new go.PathFigure(ne,ne/2,!1).add(new go.PathSegment(go.PathSegment.Arc,0,360,de,de,de,de).close()));return se.spot1=yt,se.spot2=Oe,se.defaultStretch=go.GraphObject.Uniform,se}),go.Shape.defineFigureGenerator("Line1",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=0,de.startY=0,de.endX=ne,de.endY=te,de}),go.Shape.defineFigureGenerator("Line2",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=ne,de.startY=0,de.endX=0,de.endY=te,de}),go.Shape.defineFigureGenerator("Curve1",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,ne,te,at*ne,0,ne,(1-at)*te)))}),go.Shape.defineFigureGenerator("Curve2",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,ne,te,0,at*te,(1-at)*ne,te)))}),go.Shape.defineFigureGenerator("Curve3",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,te,ne,at*te,at*ne,te)))}),go.Shape.defineFigureGenerator("Curve4",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,te,(1-at)*ne,0,0,(1-at)*te)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(0,.5,.5,1)}),go.Shape.defineFigureGenerator("TriangleDownRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(.5,.5,1,1)}),go.Shape.defineFigureGenerator("TriangleUpLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(0,0,.5,.5)}),go.Shape.defineFigureGenerator("TriangleUpRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te).close())).setSpots(.5,0,1,.5)}),go.Shape.defineFigureGenerator("RightTriangle","TriangleDownLeft"),go.Shape.setFigureParameter("Parallelogram1",0,new Zn("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=.1:de<-1?de=-1:de>1&&(de=1);var se=Math.abs(de)*ne;if(de===0){var pe=new go.Geometry(go.Geometry.Rectangle);return pe.startX=0,pe.startY=0,pe.endX=ne,pe.endY=te,pe}else{var pe=new go.Geometry;return de>0?pe.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):pe.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&pe.setSpots(se/ne,0,(ne-se)/ne,1),pe}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new Zn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=10:de<-ne?de=-ne:de>ne&&(de=ne);var se=Math.abs(de);if(de===0){var pe=new go.Geometry(go.Geometry.Rectangle);return pe.startX=0,pe.startY=0,pe.endX=ne,pe.endY=te,pe}else{var pe=new go.Geometry;return de>0?pe.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):pe.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&pe.setSpots(se/ne,0,(ne-se)/ne,1),pe}}),go.Shape.setFigureParameter("Trapezoid1",0,new Zn("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=.2:de<.5?de=-.5:de>.5&&(de=.5);var se=Math.abs(de)*ne;if(de===0){var pe=new go.Geometry(go.Geometry.Rectangle);return pe.startX=0,pe.startY=0,pe.endX=ne,pe.endY=te,pe}else{var pe=new go.Geometry;return de>0?pe.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):pe.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&pe.setSpots(se/ne,0,(ne-se)/ne,1),pe}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new Zn("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=20:de<-ne?de=-ne/2:de>ne&&(de=ne/2);var se=Math.abs(de);if(de===0){var pe=new go.Geometry(go.Geometry.Rectangle);return pe.startX=0,pe.startY=0,pe.endX=ne,pe.endY=te,pe}else{var pe=new go.Geometry;return de>0?pe.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):pe.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&pe.setSpots(se/ne,0,(ne-se)/ne,1),pe}}),go.Shape.setFigureParameter("ManualOperation",0,new Zn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=10:de<-ne?de=-ne/2:de>ne&&(de=ne/2);var se=Math.abs(de);if(de===0){var pe=new go.Geometry(go.Geometry.Rectangle);return pe.startX=0,pe.startY=0,pe.endX=ne,pe.endY=te,pe}else{var pe=new go.Geometry;return de>0?pe.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())):pe.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())),se<ne/2&&pe.setSpots(se/ne,0,(ne-se)/ne,1),pe}});var Ct=[];function ot(){var De=Ct.pop();return De===void 0?[]:De}function We(De){De.length=0,Ct.push(De)}function Tt(De){for(var ne=ot(),te=.5,de=.5,se=Math.PI*1.5,pe=0,ye=0;ye<De;ye++)pe=2*Math.PI/De*ye+se,ne[ye]=new go.Point(de+te*Math.cos(pe),de+te*Math.sin(pe));return ne.push(ne[0]),ne}function dt(De){var ne=kt(De),te=ot();te[0]=ne[0];for(var de=1,se=1;de<ne.length;de+=2,se+=3)te[se]=ne[de],te[se+1]=ne[de],te[se+2]=ne[de+1];return We(ne),te}function kt(De){for(var ne=Tt(De),te=ot(),de=Math.floor(ne.length/2),se=ne.length-1,pe=De%2===0?2:1,ye=0;ye<se;ye++){var we=ne[ye],Ce=ne[ye+1],_e=ne[(de+ye-1)%se],Ze=ne[(de+ye+pe)%se];te[ye*2]=we,te[ye*2+1]=pt(we.x,we.y,_e.x,_e.y,Ce.x,Ce.y,Ze.x,Ze.y,new go.Point)}return te[te.length]=te[0],We(ne),te}go.Shape.defineFigureGenerator("Pentagon",function(De,ne,te){var de=Tt(5),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<5;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.2,.22),se.spot2=new go.Spot(.8,.9),se}),go.Shape.defineFigureGenerator("Hexagon",function(De,ne,te){var de=Tt(6),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<6;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.07,.25),se.spot2=new go.Spot(.93,.75),se}),go.Shape.defineFigureGenerator("Heptagon",function(De,ne,te){var de=Tt(7),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<7;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.2,.15),se.spot2=new go.Spot(.8,.85),se}),go.Shape.defineFigureGenerator("Octagon",function(De,ne,te){var de=Tt(8),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<8;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.15,.15),se.spot2=new go.Spot(.85,.85),se}),go.Shape.defineFigureGenerator("Nonagon",function(De,ne,te){var de=Tt(9),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<9;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.17,.13),se.spot2=new go.Spot(.82,.82),se}),go.Shape.defineFigureGenerator("Decagon",function(De,ne,te){var de=Tt(10),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<10;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.16,.16),se.spot2=new go.Spot(.84,.84),se}),go.Shape.defineFigureGenerator("Dodecagon",function(De,ne,te){var de=Tt(12),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<12;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.16,.16),se.spot2=new go.Spot(.84,.84),se}),go.Shape.defineFigureGenerator("FivePointedStar",function(De,ne,te){var de=kt(5),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<10;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.266,.333),se.spot2=new go.Spot(.733,.733),se}),go.Shape.defineFigureGenerator("SixPointedStar",function(De,ne,te){var de=kt(6),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<12;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.17,.25),se.spot2=new go.Spot(.83,.75),se}),go.Shape.defineFigureGenerator("SevenPointedStar",function(De,ne,te){var de=kt(7),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<14;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.666),se}),go.Shape.defineFigureGenerator("EightPointedStar",function(De,ne,te){var de=kt(8),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<16;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.25,.25),se.spot2=new go.Spot(.75,.75),se}),go.Shape.defineFigureGenerator("NinePointedStar",function(De,ne,te){var de=kt(9),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<18;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.666),se}),go.Shape.defineFigureGenerator("TenPointedStar",function(De,ne,te){var de=kt(10),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<20;ye++)pe.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return pe.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.281,.261),se.spot2=new go.Spot(.723,.748),se}),go.Shape.defineFigureGenerator("FivePointedBurst",function(De,ne,te){var de=dt(5),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<de.length;ye+=3)pe.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return pe.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("SixPointedBurst",function(De,ne,te){var de=dt(6),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<de.length;ye+=3)pe.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return pe.segments.last().close(),We(de),se.spot1=new go.Spot(.17,.222),se.spot2=new go.Spot(.833,.777),se}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(De,ne,te){var de=dt(7),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<de.length;ye+=3)pe.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return pe.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("EightPointedBurst",function(De,ne,te){var de=dt(8),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<de.length;ye+=3)pe.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return pe.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("NinePointedBurst",function(De,ne,te){var de=dt(9),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<de.length;ye+=3)pe.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return pe.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("TenPointedBurst",function(De,ne,te){var de=dt(10),se=new go.Geometry,pe=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(pe);for(var ye=1;ye<de.length;ye+=3)pe.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return pe.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.setFigureParameter("FramedRectangle",0,new Zn("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new Zn("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(De,ne,te){var de=De?De.parameter1:NaN,se=De?De.parameter2:NaN;isNaN(de)&&(de=8),isNaN(se)&&(se=8);var pe=new go.Geometry,ye=new go.PathFigure(0,0,!0);return pe.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de<ne/2&&se<te/2&&(ye.add(new go.PathSegment(go.PathSegment.Move,de,se)),ye.add(new go.PathSegment(go.PathSegment.Line,de,te-se)),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,te-se)),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,se).close())),pe.setSpots(0,0,1,1,de,se,-de,-se),pe}),go.Shape.setFigureParameter("Ring",0,new Zn("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=8);var se=ne/2,pe=new go.Geometry,ye=new go.PathFigure(ne,ne/2,!0);pe.add(ye),ye.add(new go.PathSegment(go.PathSegment.Arc,0,360,se,se,se,se).close());var we=Math.max(se-de,0);return we>0&&(ye.add(new go.PathSegment(go.PathSegment.Move,ne/2+we,ne/2)),ye.add(new go.PathSegment(go.PathSegment.Arc,0,-360,se,se,we,we).close())),pe.spot1=yt,pe.spot2=Oe,pe.defaultStretch=go.GraphObject.Uniform,pe}),go.Shape.defineFigureGenerator("Cloud",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.08034461*ne,.1944299*te,!0).add(new go.PathSegment(go.PathSegment.Bezier,.2008615*ne,.05349299*te,-.09239631*ne,.07836421*te,.1406031*ne,-.0542823*te)).add(new go.PathSegment(go.PathSegment.Bezier,.4338609*ne,.074219*te,.2450511*ne,-.00697547*te,.3776197*ne,-.01112067*te)).add(new go.PathSegment(go.PathSegment.Bezier,.6558228*ne,.07004196*te,.4539471*ne,0,.6066018*ne,-.02526587*te)).add(new go.PathSegment(go.PathSegment.Bezier,.8921095*ne,.08370865*te,.6914277*ne,-.01904177*te,.8921095*ne,-.01220843*te)).add(new go.PathSegment(go.PathSegment.Bezier,.9147671*ne,.3194596*te,1.036446*ne,.04105738*te,1.020377*ne,.3022052*te)).add(new go.PathSegment(go.PathSegment.Bezier,.9082935*ne,.562044*te,1.04448*ne,.360238*te,.992256*ne,.5219009*te)).add(new go.PathSegment(go.PathSegment.Bezier,.9212406*ne,.8217117*te,1.032337*ne,.5771781*te,1.018411*ne,.8120651*te)).add(new go.PathSegment(go.PathSegment.Bezier,.7592566*ne,.9156953*te,1.028411*ne,.9571472*te,.8556702*ne,1.052487*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5101666*ne,.9310455*te,.7431877*ne,1.009325*te,.5624123*ne,1.021761*te)).add(new go.PathSegment(go.PathSegment.Bezier,.2609328*ne,.9344623*te,.4820677*ne,1.031761*te,.3030112*ne,1.002796*te)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*ne,.870098*te,.2329994*ne,1.01518*te,.03213784*ne,1.01518*te)).add(new go.PathSegment(go.PathSegment.Bezier,.06829292*ne,.6545475*te,-.02812061*ne,.9032597*te,-.01205169*ne,.6835638*te)).add(new go.PathSegment(go.PathSegment.Bezier,.06427569*ne,.4265613*te,-.01812061*ne,.6089503*te,-.00606892*ne,.4555777*te)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*ne,.1944299*te,-.01606892*ne,.3892545*te,-.01205169*ne,.1944299*te))).setSpots(.1,.1,.9,.9)}),go.Shape.defineFigureGenerator("StopSign",function(De,ne,te){var de=1/(Math.SQRT2+2);return new go.Geometry().add(new go.PathFigure(de*ne,0,!0).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,ne,(1-de)*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,te)).add(new go.PathSegment(go.PathSegment.Line,de*ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,(1-de)*te)).add(new go.PathSegment(go.PathSegment.Line,0,de*te).close())).setSpots(de/2,de/2,1-de/2,1-de/2)}),go.Shape.setFigureParameter("Pie",0,new Zn("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new Zn("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(De,ne,te){var de=De?De.parameter1:NaN,se=De?De.parameter2:NaN;isNaN(de)&&(de=0),isNaN(se)&&(se=315);var pe=de%360;pe<0&&(pe+=360);var ye=se%360,we=Math.min(ne,te)/2;return new go.Geometry().add(new go.PathFigure(we,we).add(new go.PathSegment(go.PathSegment.Arc,pe,ye,we,we,we,we).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(De,ne,te){var de=at/Math.SQRT2*.5,se=Math.SQRT2/2,pe=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(ne,te,!0).add(new go.PathSegment(go.PathSegment.Bezier,se*ne,pe*te,ne,(1-de)*te,(se+de)*ne,(pe+de)*te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close()))}),go.Shape.setFigureParameter("ThickCross",0,new Zn("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=30);var se=Math.min(de,ne)/2,pe=ne/2,ye=te/2;return new go.Geometry().add(new go.PathFigure(pe-se,0,!0).add(new go.PathSegment(go.PathSegment.Line,pe+se,0)).add(new go.PathSegment(go.PathSegment.Line,pe+se,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye+se)).add(new go.PathSegment(go.PathSegment.Line,pe+se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,pe+se,te)).add(new go.PathSegment(go.PathSegment.Line,pe-se,te)).add(new go.PathSegment(go.PathSegment.Line,pe-se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye-se)).add(new go.PathSegment(go.PathSegment.Line,pe-se,ye-se).close()))}),go.Shape.setFigureParameter("ThinCross",0,new Zn("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=10);var se=Math.min(de,ne)/2,pe=ne/2,ye=te/2;return new go.Geometry().add(new go.PathFigure(pe-se,0,!0).add(new go.PathSegment(go.PathSegment.Line,pe+se,0)).add(new go.PathSegment(go.PathSegment.Line,pe+se,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye+se)).add(new go.PathSegment(go.PathSegment.Line,pe+se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,pe+se,te)).add(new go.PathSegment(go.PathSegment.Line,pe-se,te)).add(new go.PathSegment(go.PathSegment.Line,pe-se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye-se)).add(new go.PathSegment(go.PathSegment.Line,pe-se,ye-se).close()))}),go.Shape.setFigureParameter("ThickX",0,new Zn("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(De,ne,te){var de=De?De.parameter1:NaN;if((isNaN(de)||de<0)&&(de=30),ne===0||te===0){var se=new go.Geometry(go.Geometry.Rectangle);return se.startX=0,se.startY=0,se.endX=ne,se.endY=te,se}else{var pe=ne/2,ye=te/2,we=Math.atan2(te,ne),Ce=de-Math.min(Math.cos(we)*de/2,pe),_e=de-Math.min(Math.sin(we)*de/2,ye),se=new go.Geometry,Ze=new go.PathFigure(Ce,0,!0);return se.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Line,pe,.2*te)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne-Ce,0)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne,_e)),Ze.add(new go.PathSegment(go.PathSegment.Line,.8*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne,te-_e)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne-Ce,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,pe,.8*te)),Ze.add(new go.PathSegment(go.PathSegment.Line,Ce,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,te-_e)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,_e).close()),se}}),go.Shape.setFigureParameter("ThinX",0,new Zn("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=10);var se=new go.Geometry,pe=new go.PathFigure(.1*ne,0,!0);return se.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.9*ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.1*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.1*ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.9*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.1*te).close()),se}),go.Shape.setFigureParameter("SquareIBeam",0,new Zn("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.2);var se=new go.Geometry,pe=new go.PathFigure(0,0,!0);return se.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,de*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(.5+de/2)*ne,de*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(.5+de/2)*ne,(1-de)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,(1-de)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,(1-de)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(.5-de/2)*ne,(1-de)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(.5-de/2)*ne,de*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,de*te).close()),se}),go.Shape.setFigureParameter("RoundedIBeam",0,new Zn("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.5);var se=new go.Geometry,pe=new go.PathFigure(0,0,!0);return se.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Bezier,ne,te,Math.abs(1-de)*ne,.25*te,Math.abs(1-de)*ne,.75*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,0,0,de*ne,.75*te,de*ne,.25*te).close()),se}),go.Shape.defineFigureGenerator("HalfEllipse",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,at*ne,0,ne,(.5-at/2)*te)).add(new go.PathSegment(go.PathSegment.Bezier,0,te,ne,(.5+at/2)*te,at*ne,te).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,te,ne,0,ne,te)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.5*ne,.75*te,.5*ne,.25*te).close())).setSpots(.311,.266,.744,.744)}),go.Shape.defineFigureGenerator("Heart",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,te,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,.3*te,.1*ne,.8*te,0,.5*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.3*te,0,0,.45*ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,ne,.3*te,.55*ne,0,ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,.5*te,.9*ne,.8*te).close())).setSpots(.14,.29,.86,.78)}),go.Shape.defineFigureGenerator("Spade",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,0,!0).add(new go.PathSegment(go.PathSegment.Line,.51*ne,.01*te)).add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,.6*ne,.2*te,ne,.25*te)).add(new go.PathSegment(go.PathSegment.Bezier,.55*ne,.7*te,ne,.8*te,.6*ne,.8*te)).add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,te,.5*ne,.75*te,.55*ne,.95*te)).add(new go.PathSegment(go.PathSegment.Line,.25*ne,te)).add(new go.PathSegment(go.PathSegment.Bezier,.45*ne,.7*te,.45*ne,.95*te,.5*ne,.75*te)).add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,.4*ne,.8*te,0,.8*te)).add(new go.PathSegment(go.PathSegment.Bezier,.49*ne,.01*te,0,.25*te,.4*ne,.2*te).close())).setSpots(.14,.26,.86,.78)}),go.Shape.defineFigureGenerator("Club",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.4*ne,.6*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.15*ne,te,.5*ne,.75*te,.45*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.6*ne,.6*te,.55*ne,.95*te,.5*ne,.75*te));var pe=.2,ye=.3,we=0,Ce=pe*at;return se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5+pe+we)*te,(.5-pe+ye)*ne,(.5+Ce+we)*te,(.5-Ce+ye)*ne,(.5+pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pe+ye)*ne,(.5+we)*te,(.5+Ce+ye)*ne,(.5+pe+we)*te,(.5+pe+ye)*ne,(.5+Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-pe+we)*te,(1-.5+pe+ye)*ne,(.5-Ce+we)*te,(.5+Ce+ye)*ne,(.5-pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.65*ne,.36771243*te,(.5-Ce+ye)*ne,(.5-pe+we)*te,(.5-pe+ye+.05)*ne,(.5-Ce+we-.02)*te)),pe=.2,ye=0,we=-.3,Ce=pe*at,se.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pe+ye)*ne,(.5+we)*te,(.5+Ce+ye)*ne,(.5+pe+we)*te,(.5+pe+ye)*ne,(.5+Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-pe+we)*te,(1-.5+pe+ye)*ne,(.5-Ce+we)*te,(.5+Ce+ye)*ne,(.5-pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pe+ye)*ne,(.5+we)*te,(.5-Ce+ye)*ne,(.5-pe+we)*te,(.5-pe+ye)*ne,(.5-Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Ce+ye)*ne,(.5+pe+we)*te,(.5-pe+ye)*ne,(.5+Ce+we)*te,(.5-Ce+ye)*ne,(.5+pe+we)*te)),pe=.2,ye=-.3,we=0,Ce=pe*at,se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-pe+we)*te,(1-.5+pe+ye-.05)*ne,(.5-Ce+we-.02)*te,(.5+Ce+ye)*ne,(.5-pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pe+ye)*ne,(.5+we)*te,(.5-Ce+ye)*ne,(.5-pe+we)*te,(.5-pe+ye)*ne,(.5-Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5+pe+we)*te,(.5-pe+ye)*ne,(.5+Ce+we)*te,(.5-Ce+ye)*ne,(.5+pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,.6*te,(.5+Ce+ye)*ne,(.5+pe+we)*te,(.5+pe+ye)*ne,(.5+Ce+we)*te).close()),de.setSpots(.06,.33,.93,.68),de}),go.Shape.defineFigureGenerator("YinYang",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.5,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,180,ne*.5,ne*.5,ne*.5,ne*.5)),se.add(new go.PathSegment(go.PathSegment.Arc,90,-180,ne*.5,ne*.75,ne*.25,ne*.25)),se.add(new go.PathSegment(go.PathSegment.Arc,90,180,ne*.5,ne*.25,ne*.25,ne*.25));var pe=.1,ye=.5,we=.25;return se.add(new go.PathSegment(go.PathSegment.Move,(ye+pe)*ne,we*te)),se.add(new go.PathSegment(go.PathSegment.Arc,0,-360,ne*ye,te*we,pe*ne,pe*ne).close()),se=new go.PathFigure(ne*.5,0,!1),de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,-180,ne*.5,ne*.5,ne*.5,ne*.5)),we=.75,se=new go.PathFigure((ye+pe)*ne,we*te,!0),de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,0,360,ne*ye,te*we,pe*ne,pe*ne).close()),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("Peace",function(De,ne,te){var de=.8535533905932737,se=.5*ne,pe=.5*te;return new go.Geometry().add(new go.PathFigure(se,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,se,pe,se,pe)).add(new go.PathSegment(go.PathSegment.Line,se,te)).add(new go.PathSegment(go.PathSegment.Move,se,pe)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,de*te)).add(new go.PathSegment(go.PathSegment.Move,se,pe)).add(new go.PathSegment(go.PathSegment.Line,de*ne,de*te)))}),go.Shape.defineFigureGenerator("NotAllowed",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=.5,ye=.5,we=.5,Ce=new go.PathFigure(ye*ne,(we-pe)*te);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),pe=.4,se=at*.4;var _e=le(),Ze=le(),st=le(),nt=le();St(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.42,_e,Ze,st,nt,nt);var Ye=le(),ct=le(),$e=le();St(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.58,nt,nt,$e,Ye,ct);var Et=le(),Pt=le(),Bt=le();St(ye,we+pe,ye-se,we+pe,ye-pe,we+se,ye-pe,we,.42,Et,Pt,Bt,nt,nt);var fn=le(),qt=le(),vn=le();return St(ye,we+pe,ye-se,we+pe,ye-pe,we+se,ye-pe,we,.58,nt,nt,vn,fn,qt),Ce.add(new go.PathSegment(go.PathSegment.Move,vn.x*ne,vn.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,fn.x*ne,fn.y*te,qt.x*ne,qt.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,st.x*ne,st.y*te,_e.x*ne,_e.y*te,Ze.x*ne,Ze.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,vn.x*ne,vn.y*te).close()),Ce.add(new go.PathSegment(go.PathSegment.Move,Bt.x*ne,Bt.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,$e.x*ne,$e.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,Ye.x*ne,Ye.y*te,ct.x*ne,ct.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,Bt.x*ne,Bt.y*te,Et.x*ne,Et.y*te,Pt.x*ne,Pt.y*te).close()),Ue(_e),Ue(Ze),Ue(st),Ue(nt),Ue(Ye),Ue(ct),Ue($e),Ue(Et),Ue(Pt),Ue(Bt),Ue(fn),Ue(qt),Ue(vn),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("Fragile",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.25*ne,0)).add(new go.PathSegment(go.PathSegment.Line,.2*ne,.15*te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.25*te)).add(new go.PathSegment(go.PathSegment.Line,.29*ne,.33*te)).add(new go.PathSegment(go.PathSegment.Line,.35*ne,.25*te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.15*te)).add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,.55*ne,.5*te,ne,.25*te,.75*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.55*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.45*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.45*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.5*te,0,.25*te).close()))}),go.Shape.setFigureParameter("HourGlass",0,new Zn("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=30),de>ne&&(de=ne);var se=(ne-de)/2,pe=se+de;return new go.Geometry().add(new go.PathFigure(pe,.5*te).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te)).add(new go.PathSegment(go.PathSegment.Line,se,.5*te)).add(new go.PathSegment(go.PathSegment.Line,0,0)).add(new go.PathSegment(go.PathSegment.Line,ne,0).close()))}),go.Shape.defineFigureGenerator("Lightning",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,.55*te).add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.45*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.45*te)).add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.55*te).close()))}),go.Shape.defineFigureGenerator("GenderMale",function(De,ne,te){var de=new go.Geometry,se=at*.4,pe=.4,ye=.5,we=.5,Ce=le(),_e=le(),Ze=le(),st=le(),nt=new go.PathFigure((ye-pe)*ne,we*te,!1);de.add(nt),nt.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),St(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.44,Ze,st,_e,Ce,Ce),nt.add(new go.PathSegment(go.PathSegment.Bezier,_e.x*ne,_e.y*te,Ze.x*ne,Ze.y*te,st.x*ne,st.y*te));var Ye=Le(_e.x,_e.y);St(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.56,Ce,Ce,_e,Ze,st);var ct=Le(_e.x,_e.y);nt.add(new go.PathSegment(go.PathSegment.Line,(Ye.x*.1+.95*.9)*ne,Ye.y*.1*te)),nt.add(new go.PathSegment(go.PathSegment.Line,.85*ne,Ye.y*.1*te)),nt.add(new go.PathSegment(go.PathSegment.Line,.85*ne,0)),nt.add(new go.PathSegment(go.PathSegment.Line,ne,0)),nt.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),nt.add(new go.PathSegment(go.PathSegment.Line,(ct.x*.1+.9)*ne,.15*te)),nt.add(new go.PathSegment(go.PathSegment.Line,(ct.x*.1+.9)*ne,(ct.y*.1+.05*.9)*te)),nt.add(new go.PathSegment(go.PathSegment.Line,ct.x*ne,ct.y*te)),nt.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,Ze.x*ne,Ze.y*te,st.x*ne,st.y*te)),nt.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),nt.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te)),pe=.35,se=at*.35;var $e=new go.PathFigure(ye*ne,(we-pe)*te,!1);de.add($e),$e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),$e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te)),$e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),$e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te));var Et=new go.PathFigure((ye-pe)*ne,we*te,!1);return de.add(Et),Ue(Ce),Ue(_e),Ue(Ze),Ue(st),Ue(Ye),Ue(ct),de.spot1=new go.Spot(.202,.257),de.spot2=new go.Spot(.792,.739),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("GenderFemale",function(De,ne,te){var de=new go.Geometry,se=.375,pe=0,ye=-.125,we=se*at,Ce=new go.PathFigure((.525+pe)*ne,(.5+se+ye)*te,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+se+pe)*ne,(.5+ye)*te,(.5+we+pe)*ne,(.5+se+ye)*te,(.5+se+pe)*ne,(.5+we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pe)*ne,(.5-se+ye)*te,(1-.5+se+pe)*ne,(.5-we+ye)*te,(.5+we+pe)*ne,(.5-se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5-se+pe)*ne,(.5+ye)*te,(.5-we+pe)*ne,(.5-se+ye)*te,(.5-se+pe)*ne,(.5-we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.475+pe)*ne,(.5+se+ye)*te,(.5-se+pe)*ne,(.5+we+ye)*te,(.5-we+pe)*ne,(.5+se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.475*ne,.85*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.85*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.475*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.475*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.525*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.85*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.85*te).close()),se=.325,pe=0,ye=-.125,we=se*at;var Ce=new go.PathFigure((1-.5+se+pe)*ne,(.5+ye)*te,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pe)*ne,(.5+se+ye)*te,(.5+se+pe)*ne,(.5+we+ye)*te,(.5+we+pe)*ne,(.5+se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5-se+pe)*ne,(.5+ye)*te,(.5-we+pe)*ne,(.5+se+ye)*te,(.5-se+pe)*ne,(.5+we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pe)*ne,(.5-se+ye)*te,(.5-se+pe)*ne,(.5-we+ye)*te,(.5-we+pe)*ne,(.5-se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+se+pe)*ne,(.5+ye)*te,(.5+we+pe)*ne,(.5-se+ye)*te,(1-.5+se+pe)*ne,(.5-we+ye)*te));var Ce=new go.PathFigure((.525+pe)*ne,(.5+se+ye)*te,!1);return de.add(Ce),de.spot1=new go.Spot(.232,.136),de.spot2=new go.Spot(.682,.611),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("LogicImplies",function(De,ne,te){var de=De?De.parameter1:NaN;return isNaN(de)&&(de=.2),new go.Geometry().add(new go.PathFigure((1-de)*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,te)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te))).setSpots(0,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicIff",function(De,ne,te){var de=De?De.parameter1:NaN;return isNaN(de)&&(de=.2),new go.Geometry().add(new go.PathFigure((1-de)*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,te)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Move,de*ne,0)).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,de*ne,te))).setSpots(.2,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicNot",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)))}),go.Shape.defineFigureGenerator("LogicAnd",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te))).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("LogicOr",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,ne,0))).setSpots(.219,0,.78,.409)}),go.Shape.defineFigureGenerator("LogicXor",function(De,ne,te){var de=new go.Geometry().add(new go.PathFigure(.5*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Arc,0,360,.5*ne,.5*te,.5*ne,.5*te)));return de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("LogicTruth",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,.5*ne,0)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)))}),go.Shape.defineFigureGenerator("LogicFalsity",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Move,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)))}),go.Shape.defineFigureGenerator("LogicThereExists",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Move,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te)))}),go.Shape.defineFigureGenerator("LogicForAll",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,.25*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.75*ne,.5*te))).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("LogicIsDefinedAs",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Move,0,te)).add(new go.PathSegment(go.PathSegment.Line,ne,te))).setSpots(.01,.01,.99,.49)}),go.Shape.defineFigureGenerator("LogicIntersect",function(De,ne,te){var de=.5;return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,0,de*te)).add(new go.PathSegment(go.PathSegment.Arc,180,180,de*ne,de*te,de*ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,ne,te))).setSpots(0,.5,1,1)}),go.Shape.defineFigureGenerator("LogicUnion",function(De,ne,te){var de=.5;return new go.Geometry().add(new go.PathFigure(ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,de*te)).add(new go.PathSegment(go.PathSegment.Arc,0,180,de*ne,de*te,de*ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,0,0))).setSpots(0,0,1,.5)}),go.Shape.setFigureParameter("Arrow",0,new Zn("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new Zn("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=De?De.parameter2:NaN;isNaN(se)&&(se=.3);var pe=(1-de)*ne,ye=(.5-se/2)*te,we=(.5+se/2)*te,Ce=new go.Geometry,_e=new go.PathFigure(0,ye,!0);Ce.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,pe,ye)),_e.add(new go.PathSegment(go.PathSegment.Line,pe,0)),_e.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),_e.add(new go.PathSegment(go.PathSegment.Line,pe,te)),_e.add(new go.PathSegment(go.PathSegment.Line,pe,we)),_e.add(new go.PathSegment(go.PathSegment.Line,0,we).close()),Ce.spot1=new go.Spot(0,ye/te);var Ze=pt(0,we/te,1,we/te,pe/ne,1,1,.5,le());return Ce.spot2=new go.Spot(Ze.x,Ze.y),Ue(Ze),Ce}),go.Shape.setFigureParameter("Arrow2",0,new Zn("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new Zn("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=30),de>ne&&(de=ne);var se=De?De.parameter2:NaN;isNaN(se)&&(se=30),se=Math.min(se,te/2);var pe=ne-de,ye=(te-se)/2,we=ye+se,Ce=new go.Geometry,_e=new go.PathFigure(0,ye,!0);Ce.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,pe,ye)),_e.add(new go.PathSegment(go.PathSegment.Line,pe,0)),_e.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),_e.add(new go.PathSegment(go.PathSegment.Line,pe,te)),_e.add(new go.PathSegment(go.PathSegment.Line,pe,we)),_e.add(new go.PathSegment(go.PathSegment.Line,0,we).close()),Ce.spot1=new go.Spot(0,ye/te);var Ze=pt(0,we/te,1,we/te,pe/ne,1,1,.5,le());return Ce.spot2=new go.Spot(Ze.x,Ze.y),Ue(Ze),Ce}),go.Shape.defineFigureGenerator("Chevron",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("DoubleArrow",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.214*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,1*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.786*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,1*te).close()),de}),go.Shape.setFigureParameter("DoubleEndArrow",0,new Zn("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=(.5-de/2)*te,pe=(.5+de/2)*te,ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,pe)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close());var Ce=pt(0,.5,.3,0,0,se/te,.1,se/te,le());return ye.spot1=new go.Spot(Ce.x,Ce.y),Ce=pt(.7,1,1,.5,0,pe/te,1,pe/te,Ce),ye.spot2=new go.Spot(Ce.x,Ce.y),Ue(Ce),ye}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new Zn("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new Zn("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=40);var se=De?De.parameter2:NaN;isNaN(se)&&(se=100);var pe=(te-de)/2,ye=pe+de,we=(te-se)/2,Ce=we+se;(de>te||se>te)&&(se>de?(de=de*te/se,pe=(te-de)/2,ye=pe+de,we=0,Ce=te):(pe=0,ye=te,we=0,Ce=te));var _e=new go.Geometry,Ze=new go.PathFigure(ne,.5*te,!0);_e.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,we)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,pe)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,we).close());var st=pt(0,.5,.3,we/te,0,pe/te,1,pe/te,le());return _e.spot1=new go.Spot(st.x,st.y),st=pt(.7,Ce/te,1,.5,0,ye/te,1,ye/te,st),_e.spot2=new go.Spot(st.x,st.y),Ue(st),_e}),go.Shape.setFigureParameter("IBeamArrow",0,new Zn("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=(.5-de/2)*te,pe=(.5+de/2)*te,ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,pe)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,0,te)),we.add(new go.PathSegment(go.PathSegment.Line,0,0)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,0)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close()),ye.spot1=new go.Spot(0,se/te);var Ce=pt(.7,1,1,.5,0,pe/te,1,pe/te,le());return ye.spot2=new go.Spot(Ce.x,Ce.y),Ue(Ce),ye}),go.Shape.setFigureParameter("IBeamArrow2",0,new Zn("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new Zn("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=40);var se=De?De.parameter2:NaN;isNaN(se)&&(se=100);var pe=(te-de)/2,ye=pe+de,we=(te-se)/2,Ce=we+se;(de>te||se>te)&&(se>de?(de=de*te/se,pe=(te-de)/2,ye=pe+de,we=0,Ce=te):(pe=0,ye=te,we=0,Ce=te));var _e=new go.Geometry,Ze=new go.PathFigure(ne,.5*te,!0);_e.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,we)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,we)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,pe)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,we).close()),_e.spot1=new go.Spot(0,pe/te);var st=pt(.7,Ce/te,1,.5,0,ye/te,1,ye/te,le());return _e.spot2=new go.Spot(st.x,st.y),Ue(st),_e}),go.Shape.setFigureParameter("Pointer",0,new Zn("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.1);var se=new go.Geometry,pe=new go.PathFigure(ne,.5*te,!0);se.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Line,de*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),se.spot1=new go.Spot(de,.35);var ye=pt(.2,.65,1,.65,0,1,1,.5,le());return se.spot2=new go.Spot(ye.x,ye.y),Ue(ye),se}),go.Shape.setFigureParameter("RoundedPointer",0,new Zn("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=new go.Geometry,pe=new go.PathFigure(ne,.5*te,!0);se.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,0,0,de*ne,.75*te,de*ne,.25*te).close()),se.spot1=new go.Spot(de,.35);var ye=pt(0,.65,1,.65,0,1,1,.5,le());return se.spot2=new go.Spot(ye.x,ye.y),Ue(ye),se}),go.Shape.setFigureParameter("SplitEndArrow",0,new Zn("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.4);var se=(.5-de/2)*te,pe=(.5+de/2)*te,ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),we.add(new go.PathSegment(go.PathSegment.Line,0,pe)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,0,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close()),ye.spot1=new go.Spot(.2,.3);var Ce=pt(.7,1,1,.5,0,pe/te,1,pe/te,le());return ye.spot2=new go.Spot(Ce.x,Ce.y),Ue(Ce),ye}),go.Shape.setFigureParameter("SplitEndArrow2",0,new Zn("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=50);var se=(te-de)/2,pe=se+de;de>te&&(se=0,pe=te);var ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),we.add(new go.PathSegment(go.PathSegment.Line,0,pe)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,0,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close()),ye.spot1=new go.Spot(.2,se/te);var Ce=pt(.7,1,1,.5,0,pe/te,1,pe/te,le());return ye.spot2=new go.Spot(Ce.x,Ce.y),Ue(Ce),ye}),go.Shape.setFigureParameter("SquareArrow",0,new Zn("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.7);var se=new go.Geometry,pe=new go.PathFigure(ne,.5*te,!0);return se.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,de*ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,0)),pe.add(new go.PathSegment(go.PathSegment.Line,de*ne,0).close()),se.spot1=go.Spot.TopLeft,se.spot2=new go.Spot(de,1),se}),go.Shape.defineFigureGenerator("Cone1",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=at*.1,ye=new go.PathFigure(0,.9*te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.9+pe)*te,(.5+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,(.5-se)*ne,te,0,(.9+pe)*te).close()),de.spot1=new go.Spot(.25,.5),de.spot2=new go.Spot(.75,.97),de}),go.Shape.defineFigureGenerator("Cone2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.9*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.9*te,(1-.85/.9)*ne,te,.85/.9*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,.9*te).close());var pe=new go.PathFigure(0,.9*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Bezier,ne,.9*te,(1-.85/.9)*ne,.8*te,.85/.9*ne,.8*te)),de.spot1=new go.Spot(.25,.5),de.spot2=new go.Spot(.75,.82),de}),go.Shape.defineFigureGenerator("Cube1",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.85*te).close());var pe=new go.PathFigure(.5*ne,te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.3*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.15*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.3*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),de.spot1=new go.Spot(0,.3),de.spot2=new go.Spot(.5,.85),de}),go.Shape.defineFigureGenerator("Cube2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.3*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0).close());var pe=new go.PathFigure(0,.3*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.3*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Move,.7*ne,.3*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),de.spot1=new go.Spot(0,.3),de.spot2=new go.Spot(.7,1),de}),go.Shape.defineFigureGenerator("Cylinder1",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,te/3);var se=new go.Geometry,pe=at*.5,ye=new go.PathFigure(0,de,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,at*de,(.5-pe)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,1*ne,de,(.5+pe)*ne,0,1*ne,at*de)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-de)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,1*te,1*ne,te-at*de,(.5+pe)*ne,1*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-de,(.5-pe)*ne,1*te,0,te-at*de)),ye.add(new go.PathSegment(go.PathSegment.Line,0,de));var we=new go.PathFigure(ne,de,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,2*de,1*ne,2*de-at*de,(.5+pe)*ne,2*de)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,de,(.5-pe)*ne,2*de,0,2*de-at*de)),se.spot1=new go.Spot(0,0,0,2*de),se.spot2=new go.Spot(1,1),se}),go.Shape.defineFigureGenerator("Cylinder2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,te/3);var se=new go.Geometry,pe=at*.5,ye=new go.PathFigure(0,te-de,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,0,de)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,at*de,(.5-pe)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,de,(.5+pe)*ne,0,ne,at*de)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-de)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,te-at*de,(.5+pe)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-de,(.5-pe)*ne,te,0,te-at*de));var we=new go.PathFigure(0,te-de,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te-2*de,0,te-de-at*de,(.5-pe)*ne,te-2*de)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne,te-de,(.5+pe)*ne,te-2*de,ne,te-de-at*de)),se.spot1=new go.Spot(0,0),se.spot2=new go.Spot(1,1,0,-2*de),se}),go.Shape.defineFigureGenerator("Cylinder3",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,ne/3);var se=new go.Geometry,pe=at*.5,ye=new go.PathFigure(de,0,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,ne-at*de,0,ne,(.5-pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne,(.5+pe)*te,ne-at*de,te)),ye.add(new go.PathSegment(go.PathSegment.Line,de,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,at*de,te,0,(.5+pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,(.5-pe)*te,at*de,0));var we=new go.PathFigure(de,0,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,2*de,.5*te,de+at*de,0,2*de,(.5-pe)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,de,te,2*de,(.5+pe)*te,de+at*de,te)),se.spot1=new go.Spot(0,0,2*de,0),se.spot2=new go.Spot(1,1),se}),go.Shape.defineFigureGenerator("Cylinder4",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,ne/3);var se=new go.Geometry,pe=at*.5,ye=new go.PathFigure(ne-de,0,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,ne-at*de,0,ne,(.5-pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne,(.5+pe)*te,ne-at*de,te)),ye.add(new go.PathSegment(go.PathSegment.Line,de,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,at*de,te,0,(.5+pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,(.5-pe)*te,at*de,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,0));var we=new go.PathFigure(ne-de,0,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,ne-2*de,.5*te,ne-de-at*de,0,ne-2*de,(.5-pe)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne-2*de,(.5+pe)*te,ne-de-at*de,te)),se.spot1=new go.Spot(0,0),se.spot2=new go.Spot(1,1,-2*de,0),se}),go.Shape.defineFigureGenerator("Prism1",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.25*ne,.25*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var pe=new go.PathFigure(.25*ne,.25*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),de.spot1=new go.Spot(.408,.172),de.spot2=new go.Spot(.833,.662),de}),go.Shape.defineFigureGenerator("Prism2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.25*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var pe=new go.PathFigure(0,te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),pe.add(new go.PathSegment(go.PathSegment.Move,0,.25*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.5*te)),de.spot1=new go.Spot(.25,.5),de.spot2=new go.Spot(.75,.75),de}),go.Shape.defineFigureGenerator("Pyramid1",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.75*te).close());var pe=new go.PathFigure(.5*ne,0,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),de.spot1=new go.Spot(.25,.367),de.spot2=new go.Spot(.75,.875),de}),go.Shape.defineFigureGenerator("Pyramid2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.85*te).close());var pe=new go.PathFigure(.5*ne,0,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.7*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.85*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.7*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),de.spot1=new go.Spot(.25,.367),de.spot2=new go.Spot(.75,.875),de}),go.Shape.defineFigureGenerator("Actor",function(De,ne,te){var de=new go.Geometry,se=.2,pe=.1,ye=at*se,we=at*pe,Ce=.5,_e=.1,Ze=new go.PathFigure(Ce*ne,(_e+pe)*te,!0);de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-se)*ne,_e*te,(Ce-ye)*ne,(_e+pe)*te,(Ce-se)*ne,(_e+we)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-pe)*te,(Ce-se)*ne,(_e-we)*te,(Ce-ye)*ne,(_e-pe)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+se)*ne,_e*te,(Ce+ye)*ne,(_e-pe)*te,(Ce+se)*ne,(_e-we)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+pe)*te,(Ce+se)*ne,(_e+we)*te,(Ce+ye)*ne,(_e+pe)*te));var st=.05,nt=at*st;Ce=.05,_e=.25;var Ye=new go.PathFigure(.5*ne,.2*te,!0);return de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Line,.95*ne,.2*te)),Ce=.95,_e=.25,Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+st)*ne,_e*te,(Ce+nt)*ne,(_e-st)*te,(Ce+st)*ne,(_e-nt)*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,ne,.6*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.6*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.35*te)),st=.025,nt=at*st,Ce=.825,_e=.35,Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-st)*te,(Ce+st)*ne,(_e-nt)*te,(Ce+nt)*ne,(_e-st)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-st)*ne,_e*te,(Ce-nt)*ne,(_e-st)*te,(Ce-st)*ne,(_e-nt)*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.7*te)),st=.05,nt=at*st,Ce=.5,_e=.7,Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-st)*te,(Ce+st)*ne,(_e-nt)*te,(Ce+nt)*ne,(_e-st)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-st)*ne,_e*te,(Ce-nt)*ne,(_e-st)*te,(Ce-st)*ne,(_e-nt)*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.45*ne,te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.35*te)),st=.025,nt=at*st,Ce=.175,_e=.35,Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-st)*te,(Ce+st)*ne,(_e-nt)*te,(Ce+nt)*ne,(_e-st)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-st)*ne,_e*te,(Ce-nt)*ne,(_e-st)*te,(Ce-st)*ne,(_e-nt)*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.6*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,0,.6*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),st=.05,nt=at*st,Ce=.05,_e=.25,Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-st)*te,(Ce-st)*ne,(_e-nt)*te,(Ce-nt)*ne,(_e-st)*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.2*te)),de.spot1=new go.Spot(.2,.2),de.spot2=new go.Spot(.8,.65),de}),go.Shape.setFigureParameter("Card",0,new Zn("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.2);var se=new go.Geometry,pe=new go.PathFigure(ne,0,!0);return se.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,de*te)),pe.add(new go.PathSegment(go.PathSegment.Line,de*ne,0).close()),se.spot1=new go.Spot(0,de),se.spot2=go.Spot.BottomRight,se}),go.Shape.defineFigureGenerator("Collate",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te));var pe=new go.PathFigure(.5*ne,.5*te,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),de.spot1=new go.Spot(.25,0),de.spot2=new go.Spot(.75,.25),de}),go.Shape.defineFigureGenerator("CreateRequest",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var pe=new go.PathFigure(0,0,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(0,se*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,se*te)),ye.add(new go.PathSegment(go.PathSegment.Move,0,(1-se)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,(1-se)*te)),de}),go.Shape.defineFigureGenerator("Database",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=at*.1,ye=new go.PathFigure(ne,.1*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.9+pe)*te,(.5+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,(.5-se)*ne,te,0,(.9+pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,(.1-pe)*te,(.5-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.1*te,(.5+se)*ne,0,ne,(.1-pe)*te));var we=new go.PathFigure(ne,.1*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.2*te,ne,(.1+pe)*te,(.5+se)*ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*te,(.5-se)*ne,.2*te,0,(.1+pe)*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.3*te,ne,(.2+pe)*te,(.5+se)*ne,.3*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*te,(.5-se)*ne,.3*te,0,(.2+pe)*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,.3*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.4*te,ne,(.3+pe)*te,(.5+se)*ne,.4*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*te,(.5-se)*ne,.4*te,0,(.3+pe)*te)),de.spot1=new go.Spot(0,.4),de.spot2=new go.Spot(1,.9),de}),go.Shape.defineFigureGenerator("DataStorage",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,te,ne,0,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.9*te,.25*ne,.1*te).close()),de.spot1=new go.Spot(.226,0),de.spot2=new go.Spot(.81,1),de}),go.Shape.defineFigureGenerator("DiskStorage",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=at*.1,ye=new go.PathFigure(ne,.1*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.9+pe)*te,(.5+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,(.5-se)*ne,te,0,(.9+pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,(.1-pe)*te,(.5-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.1*te,(.5+se)*ne,0,ne,(.1-pe)*te));var we=new go.PathFigure(ne,.1*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.2*te,ne,(.1+pe)*te,(.5+se)*ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*te,(.5-se)*ne,.2*te,0,(.1+pe)*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.3*te,ne,(.2+pe)*te,(.5+se)*ne,.3*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*te,(.5-se)*ne,.3*te,0,(.2+pe)*te)),de.spot1=new go.Spot(0,.3),de.spot2=new go.Spot(1,.9),de}),go.Shape.defineFigureGenerator("Display",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.25*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,te,ne,0,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te).close()),de.spot1=new go.Spot(.25,0),de.spot2=new go.Spot(.75,1),de}),go.Shape.defineFigureGenerator("DividedEvent",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)?se=.2:se<.15&&(se=.15);var pe=at*.2,ye=new go.PathFigure(0,.2*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,0,0,(.2-pe)*te,(.2-pe)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,.8*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.2*te,(.8+pe)*ne,0,ne,(.2-pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,te,ne,(.8+pe)*te,(.8+pe)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*te,(.2-pe)*ne,te,0,(.8+pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.2*te));var we=new go.PathFigure(0,se*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,se*te)),de}),go.Shape.defineFigureGenerator("DividedProcess",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;(isNaN(se)||se<.1)&&(se=.1);var pe=new go.PathFigure(0,0,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(0,se*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,se*te)),de}),go.Shape.defineFigureGenerator("Document",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(0,.7*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.5*ne,.4*te,.5*ne,te).close()),de.spot1=go.Spot.TopLeft,de.spot2=new go.Spot(1,.6),de}),go.Shape.defineFigureGenerator("ExternalOrganization",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;(isNaN(se)||se<.2)&&(se=.2);var pe=new go.PathFigure(0,0,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(se*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,0,se*te)),ye.add(new go.PathSegment(go.PathSegment.Move,ne,se*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Move,0,(1-se)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Move,(1-se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,(1-se)*te)),de}),go.Shape.defineFigureGenerator("ExternalProcess",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te).close());var pe=new go.PathFigure(.1*ne,.4*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.9*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.6*ne,.1*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.1*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.4*ne,.9*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.9*te)),de.spot1=new go.Spot(.25,.25),de.spot2=new go.Spot(.75,.75),de}),go.Shape.defineFigureGenerator("File",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var pe=new go.PathFigure(.75*ne,0,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.25*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),de.spot1=new go.Spot(0,.25),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("Interrupt",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te));var pe=new go.PathFigure(ne,.5*te,!1);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te));var ye=new go.PathFigure(ne,.5*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.5,.75),de}),go.Shape.defineFigureGenerator("InternalStorage",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN,pe=De?De.parameter2:NaN;isNaN(se)&&(se=.1),isNaN(pe)&&(pe=.1);var ye=new go.PathFigure(0,0,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var we=new go.PathFigure(se*ne,0,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),we.add(new go.PathSegment(go.PathSegment.Move,0,pe*te)),we.add(new go.PathSegment(go.PathSegment.Line,ne,pe*te)),de}),go.Shape.defineFigureGenerator("Junction",function(De,ne,te){var de=new go.Geometry,se=1/Math.SQRT2,pe=(1-1/Math.SQRT2)/2,ye=at*.5,we=.5,Ce=new go.PathFigure(ne,we*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,te,ne,(we+ye)*te,(we+ye)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,we*te,(we-ye)*ne,te,0,(we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,0,0,(we-ye)*te,(we-ye)*ne,0)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ne,we*te,(we+ye)*ne,0,ne,(we-ye)*te));var _e=new go.PathFigure((pe+se)*ne,(pe+se)*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,pe*ne,pe*te)),_e.add(new go.PathSegment(go.PathSegment.Move,pe*ne,(pe+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Line,(pe+se)*ne,pe*te)),de}),go.Shape.defineFigureGenerator("LinedDocument",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(0,.7*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.5*ne,.4*te,.5*ne,te).close());var pe=new go.PathFigure(.1*ne,0,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.75*te)),de.spot1=new go.Spot(.1,0),de.spot2=new go.Spot(1,.6),de}),go.Shape.defineFigureGenerator("LoopLimit",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te).close()),de.spot1=new go.Spot(0,.25),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("MagneticTape",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=.5,ye=new go.PathFigure(.5*ne,te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,pe*te,(pe-se)*ne,te,0,(pe+se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,pe*ne,0,0,(pe-se)*te,(pe-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,pe*te,(pe+se)*ne,0,ne,(pe-se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,(pe+.1)*ne,.9*te,ne,(pe+se)*te,(pe+se)*ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),de.spot1=new go.Spot(.15,.15),de.spot2=new go.Spot(.85,.8),de}),go.Shape.defineFigureGenerator("ManualInput",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te).close()),de.spot1=new go.Spot(0,.25),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("MessageFromUser",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.7);var pe=new go.PathFigure(0,0,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,se*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=go.Spot.TopLeft,de}),go.Shape.defineFigureGenerator("MicroformProcessing",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.25);var pe=new go.PathFigure(0,0,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,se*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,(1-se)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("MicroformRecording",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(1,.75),de}),go.Shape.defineFigureGenerator("MultiDocument",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,.44*te,.96*ne,.47*te,.93*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.54*te,.86*ne,.57*te,.83*ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.4*ne,.4*te,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,0).close());var pe=new go.PathFigure(.1*ne,.2*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.54*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.1*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.1*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.44*te)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.8,.77),de}),go.Shape.defineFigureGenerator("MultiProcess",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,.1*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.2*te).close());var pe=new go.PathFigure(.2*ne,.1*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.1*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.1*ne,.2*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.9*te)),de.spot1=new go.Spot(0,.2),de.spot2=new go.Spot(.8,1),de}),go.Shape.defineFigureGenerator("OfflineStorage",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var pe=1-se,ye=new go.PathFigure(0,0,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te).close());var we=new go.PathFigure(.5*se*ne,se*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,(1-.5*se)*ne,se*te)),de}),go.Shape.defineFigureGenerator("OffPageConnector",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=go.Spot.TopLeft,de.spot2=new go.Spot(.75,1),de}),go.Shape.defineFigureGenerator("Or",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=.5,ye=new go.PathFigure(ne,pe*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,pe*ne,te,ne,(pe+se)*te,(pe+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,pe*te,(pe-se)*ne,te,0,(pe+se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,pe*ne,0,0,(pe-se)*te,(pe-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,pe*te,(pe+se)*ne,0,ne,(pe-se)*te));var we=new go.PathFigure(ne,.5*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),we.add(new go.PathSegment(go.PathSegment.Move,.5*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),de}),go.Shape.defineFigureGenerator("PaperTape",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(0,.7*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.3*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.3*te,.5*ne,.6*te,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.5*ne,.4*te,.5*ne,te).close()),de.spot1=new go.Spot(0,.49),de.spot2=new go.Spot(1,.75),de}),go.Shape.defineFigureGenerator("PrimitiveFromCall",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN,pe=De?De.parameter2:NaN;isNaN(se)&&(se=.1),isNaN(pe)&&(pe=.3);var ye=new go.PathFigure(0,0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-pe)*ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN,pe=De?De.parameter2:NaN;isNaN(se)&&(se=.1),isNaN(pe)&&(pe=.3);var ye=new go.PathFigure(0,0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,(1-pe)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-pe)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("Procedure",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var pe=new go.PathFigure(0,0,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure((1-se)*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,(1-se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Move,se*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),de}),go.Shape.defineFigureGenerator("Process",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var pe=new go.PathFigure(0,0,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(se*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("Sort",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te).close());var pe=new go.PathFigure(0,.5*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),de.spot1=new go.Spot(.25,.25),de.spot2=new go.Spot(.75,.5),de}),go.Shape.defineFigureGenerator("Start",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.25);var pe=new go.PathFigure(se*ne,0,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*ne,.5*te,.25*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*ne,.5*te,.25*ne,.5*te));var ye=new go.PathFigure(se*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Move,(1-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-se)*ne,te)),de.spot1=new go.Spot(se,0),de.spot2=new go.Spot(1-se,1),de}),go.Shape.defineFigureGenerator("Terminator",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.25*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*ne,.5*te,.25*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*ne,.5*te,.25*ne,.5*te)),de.spot1=new go.Spot(.23,0),de.spot2=new go.Spot(.77,1),de}),go.Shape.defineFigureGenerator("TransmittalTape",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var pe=new go.PathFigure(0,0,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,.75*ne,(1-se)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,(1-se)*te).close()),de.spot1=go.Spot.TopLeft,de}),go.Shape.defineFigureGenerator("AndGate",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=new go.PathFigure(0,0,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),pe.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(.5+se)*ne,0,ne,(.5-se)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.5+se)*te,(.5+se)*ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=go.Spot.TopLeft,de.spot2=new go.Spot(.55,1),de}),go.Shape.defineFigureGenerator("Buffer",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.5,.75),de}),go.Shape.defineFigureGenerator("Clock",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=.5,ye=new go.PathFigure(ne,pe*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,pe*ne,te,ne,(pe+se)*te,(pe+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,pe*te,(pe-se)*ne,te,0,(pe+se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,pe*ne,0,0,(pe-se)*te,(pe-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,pe*te,(pe+se)*ne,0,ne,(pe-se)*te));var we=new go.PathFigure(ne,pe*te,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,pe*te));var Ce=new go.PathFigure(.8*ne,.75*te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.75*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.75*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.75*te)),de}),go.Shape.defineFigureGenerator("Ground",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Move,.3*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Move,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,te)),de}),go.Shape.defineFigureGenerator("Inverter",function(De,ne,te){var de=new go.Geometry,se=at*.1,pe=.1,ye=.9,we=.5,Ce=new go.PathFigure(.8*ne,.5*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,0,te)),Ce.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ce.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.5*te));var _e=new go.PathFigure((ye+pe)*ne,we*te,!0);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we-pe)*te,(ye+pe)*ne,(we-se)*te)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.4,.75),de}),go.Shape.defineFigureGenerator("NandGate",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=at*.4,ye=at*.1,we=.1,Ce=.9,_e=.5,Ze=new go.PathFigure(.8*ne,.5*te,!0);de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,te,.8*ne,(.5+pe)*te,(.4+se)*ne,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ze.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.5*te,(.4+se)*ne,0,.8*ne,(.5-pe)*te));var st=new go.PathFigure((Ce+we)*ne,_e*te,!0);return de.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+we)*te,(Ce+we)*ne,(_e+ye)*te,(Ce+ye)*ne,(_e+we)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne,_e*te,(Ce-ye)*ne,(_e+we)*te,(Ce-we)*ne,(_e+ye)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-we)*te,(Ce-we)*ne,(_e-ye)*te,(Ce-ye)*ne,(_e-we)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne,_e*te,(Ce+ye)*ne,(_e-we)*te,(Ce+we)*ne,(_e-ye)*te)),de.spot1=new go.Spot(0,.05),de.spot2=new go.Spot(.55,.95),de}),go.Shape.defineFigureGenerator("NorGate",function(De,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=0,we=.5,Ce=new go.PathFigure(.8*ne,.5*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.7*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.75*te,.25*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.5*te,(ye+pe)*ne,(we-se)*te,.7*ne,(we-pe)*te)),se=.1,pe=at*.1,ye=.9,we=.5;var _e=new go.PathFigure((ye-se)*ne,we*te,!0);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te)),de.spot1=new go.Spot(.2,.25),de.spot2=new go.Spot(.6,.75),de}),go.Shape.defineFigureGenerator("OrGate",function(De,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=0,we=.5,Ce=new go.PathFigure(0,0,!0);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(ye+pe+pe)*ne,(we-se)*te,.8*ne,(we-pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.8*ne,(we+pe)*te,(ye+pe+pe)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.75*te,.25*ne,.25*te).close()),de.spot1=new go.Spot(.2,.25),de.spot2=new go.Spot(.75,.75),de}),go.Shape.defineFigureGenerator("XnorGate",function(De,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=.2,we=.5,Ce=new go.PathFigure(.1*ne,0,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,te,.35*ne,.25*te,.35*ne,.75*te));var _e=new go.PathFigure(.8*ne,.5*te,!0);de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,te,.7*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,0,.45*ne,.75*te,.45*ne,.25*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.5*te,(ye+pe)*ne,(we-se)*te,.7*ne,(we-pe)*te)),se=.1,pe=at*.1,ye=.9,we=.5;var Ze=new go.PathFigure((ye-se)*ne,we*te,!0);return de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te)),de.spot1=new go.Spot(.4,.25),de.spot2=new go.Spot(.65,.75),de}),go.Shape.defineFigureGenerator("XorGate",function(De,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=.2,we=.5,Ce=new go.PathFigure(.1*ne,0,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,te,.35*ne,.25*te,.35*ne,.75*te));var _e=new go.PathFigure(.2*ne,0,!0);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(ye+pe)*ne,(we-se)*te,.9*ne,(we-pe)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,te,.9*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,0,.45*ne,.75*te,.45*ne,.25*te).close()),de.spot1=new go.Spot(.4,.25),de.spot2=new go.Spot(.8,.75),de}),go.Shape.defineFigureGenerator("Capacitor",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("Resistor",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.5*te)),de}),go.Shape.defineFigureGenerator("Inductor",function(De,ne,te){var de=new go.Geometry,se=at*.1,pe=.1,ye=.1,we=.5,Ce=new go.PathFigure((ye-se*.5)*ne,te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.3,Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+pe)*ne,0,(ye+se)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.5,Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+pe)*ne,0,(ye+se)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.7,Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+pe)*ne,0,(ye+se)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.9,Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se*.5)*ne,te,(ye+pe)*ne,0,(ye+se)*ne,te)),de}),go.Shape.defineFigureGenerator("ACvoltageSource",function(De,ne,te){var de=new go.Geometry,se=at*.5,pe=.5,ye=.5,we=.5,Ce=new go.PathFigure((ye-pe)*ne,we*te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we-pe)*te,(ye+pe)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Move,(ye-pe+.1)*ne,we*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe-.1)*ne,we*te,ye*ne,(we-pe)*te,ye*ne,(we+pe)*te)),de}),go.Shape.defineFigureGenerator("DCvoltageSource",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.75*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("Diode",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.5,.75),de}),go.Shape.defineFigureGenerator("Wifi",function(De,ne,te){var de=new go.Geometry,se=ne,pe=te;ne=ne*.38,te=te*.6;var ye=at*.8,we=.8,Ce=0,_e=.5,Ze=(se-ne)/2,st=(pe-te)/2,nt=new go.PathFigure(Ce*ne+Ze,(_e+we)*te+st,!0);de.add(nt),nt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne+Ze,_e*te+st,(Ce-ye)*ne+Ze,(_e+we)*te+st,(Ce-we)*ne+Ze,(_e+ye)*te+st)),nt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+st,(Ce-we)*ne+Ze,(_e-ye)*te+st,(Ce-ye)*ne+Ze,(_e-we)*te+st)),nt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we+ye*.5)*ne+Ze,_e*te+st,Ce*ne+Ze,(_e-we)*te+st,(Ce-we+ye*.5)*ne+Ze,(_e-ye)*te+st)),nt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+st,(Ce-we+ye*.5)*ne+Ze,(_e+ye)*te+st,Ce*ne+Ze,(_e+we)*te+st).close()),ye=at*.4,we=.4,Ce=.2,_e=.5;var Ye=new go.PathFigure(Ce*ne+Ze,(_e+we)*te+st,!0);de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne+Ze,_e*te+st,(Ce-ye)*ne+Ze,(_e+we)*te+st,(Ce-we)*ne+Ze,(_e+ye)*te+st)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+st,(Ce-we)*ne+Ze,(_e-ye)*te+st,(Ce-ye)*ne+Ze,(_e-we)*te+st)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we+ye*.5)*ne+Ze,_e*te+st,Ce*ne+Ze,(_e-we)*te+st,(Ce-we+ye*.5)*ne+Ze,(_e-ye)*te+st)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+st,(Ce-we+ye*.5)*ne+Ze,(_e+ye)*te+st,Ce*ne+Ze,(_e+we)*te+st).close()),ye=at*.2,we=.2,Ce=.5,_e=.5;var ct=new go.PathFigure((Ce-we)*ne+Ze,_e*te+st,!0);de.add(ct),ct.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+st,(Ce-we)*ne+Ze,(_e-ye)*te+st,(Ce-ye)*ne+Ze,(_e-we)*te+st)),ct.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne+Ze,_e*te+st,(Ce+ye)*ne+Ze,(_e-we)*te+st,(Ce+we)*ne+Ze,(_e-ye)*te+st)),ct.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+st,(Ce+we)*ne+Ze,(_e+ye)*te+st,(Ce+ye)*ne+Ze,(_e+we)*te+st)),ct.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne+Ze,_e*te+st,(Ce-ye)*ne+Ze,(_e+we)*te+st,(Ce-we)*ne+Ze,(_e+ye)*te+st)),ye=at*.4,we=.4,Ce=.8,_e=.5;var $e=new go.PathFigure(Ce*ne+Ze,(_e-we)*te+st,!0);de.add($e),$e.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne+Ze,_e*te+st,(Ce+ye)*ne+Ze,(_e-we)*te+st,(Ce+we)*ne+Ze,(_e-ye)*te+st)),$e.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+st,(Ce+we)*ne+Ze,(_e+ye)*te+st,(Ce+ye)*ne+Ze,(_e+we)*te+st)),$e.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we-ye*.5)*ne+Ze,_e*te+st,Ce*ne+Ze,(_e+we)*te+st,(Ce+we-ye*.5)*ne+Ze,(_e+ye)*te+st)),$e.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+st,(Ce+we-ye*.5)*ne+Ze,(_e-ye)*te+st,Ce*ne+Ze,(_e-we)*te+st).close()),ye=at*.8,we=.8,Ce=1,_e=.5;var Et=new go.PathFigure(Ce*ne+Ze,(_e-we)*te+st,!0);return de.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne+Ze,_e*te+st,(Ce+ye)*ne+Ze,(_e-we)*te+st,(Ce+we)*ne+Ze,(_e-ye)*te+st)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+st,(Ce+we)*ne+Ze,(_e+ye)*te+st,(Ce+ye)*ne+Ze,(_e+we)*te+st)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we-ye*.5)*ne+Ze,_e*te+st,Ce*ne+Ze,(_e+we)*te+st,(Ce+we-ye*.5)*ne+Ze,(_e+ye)*te+st)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+st,(Ce+we-ye*.5)*ne+Ze,(_e-ye)*te+st,Ce*ne+Ze,(_e-we)*te+st).close()),de}),go.Shape.defineFigureGenerator("Email",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pe=new go.PathFigure(0,0,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),pe.add(new go.PathSegment(go.PathSegment.Move,0,te)),pe.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.54*te)),pe.add(new go.PathSegment(go.PathSegment.Move,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.54*te)),de}),go.Shape.defineFigureGenerator("Ethernet",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.35*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,0).close());var pe=new go.PathFigure(.1*ne,te,!0,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.1*ne,te).close());var ye=new go.PathFigure(.6*ne,te,!0,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.6*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.6*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.6*ne,te).close());var we=new go.PathFigure(0,.5*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.4*te)),we.add(new go.PathSegment(go.PathSegment.Move,.75*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.6*te)),we.add(new go.PathSegment(go.PathSegment.Move,.25*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.6*te)),de}),go.Shape.defineFigureGenerator("Power",function(De,ne,te){var de=new go.Geometry,se=at*.4,pe=.4,ye=.5,we=.5,Ce=le(),_e=le(),Ze=le(),st=le();St(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.5,Ce,Ce,_e,Ze,st);var nt=Le(_e.x,_e.y),Ye=new go.PathFigure(_e.x*ne,_e.y*te,!0);de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,Ze.x*ne,Ze.y*te,st.x*ne,st.y*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te)),St(ye-pe,we,ye-pe,we-se,ye-se,we-pe,ye,we-pe,.5,Ze,st,_e,Ce,Ce),Ye.add(new go.PathSegment(go.PathSegment.Bezier,_e.x*ne,_e.y*te,Ze.x*ne,Ze.y*te,st.x*ne,st.y*te)),se=at*.3,pe=.3,St(ye-pe,we,ye-pe,we-se,ye-se,we-pe,ye,we-pe,.5,Ze,st,_e,Ce,Ce),Ye.add(new go.PathSegment(go.PathSegment.Line,_e.x*ne,_e.y*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,st.x*ne,st.y*te,Ze.x*ne,Ze.y*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),St(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.5,Ce,Ce,_e,Ze,st),Ye.add(new go.PathSegment(go.PathSegment.Bezier,_e.x*ne,_e.y*te,st.x*ne,st.y*te,Ze.x*ne,Ze.y*te).close());var Ye=new go.PathFigure(.45*ne,0,!0);return de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.5*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.5*te)),Ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,0).close()),Ue(Ce),Ue(_e),Ue(Ze),Ue(st),Ue(nt),de.spot1=new go.Spot(.25,.45),de.spot2=new go.Spot(.75,.8),de}),go.Shape.defineFigureGenerator("Fallout",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te/2,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,180,360,ne/2,te/2,ne/2,te/2));function pe(ye,we,Ce){ye.add(new go.PathSegment(go.PathSegment.Move,(.3+we)*ne,(.8+Ce)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.5+we)*ne,(.5+Ce)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.1+we)*ne,(.5+Ce)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.3+we)*ne,(.8+Ce)*te).close())}return pe(se,0,0),pe(se,.4,0),pe(se,.2,-.3),de}),go.Shape.defineFigureGenerator("IrritationHazard",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.2*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.3*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.2*te).close()),de.spot1=new go.Spot(.3,.3),de.spot2=new go.Spot(.7,.7),de}),go.Shape.defineFigureGenerator("ElectricalHazard",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.37*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.11*te)),se.add(new go.PathSegment(go.PathSegment.Line,.77*ne,.04*te)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,.49*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.37*te)),se.add(new go.PathSegment(go.PathSegment.Line,.63*ne,.86*te)),se.add(new go.PathSegment(go.PathSegment.Line,.77*ne,.91*te)),se.add(new go.PathSegment(go.PathSegment.Line,.34*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.34*ne,.78*te)),se.add(new go.PathSegment(go.PathSegment.Line,.44*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.56*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.68*te).close()),de}),go.Shape.defineFigureGenerator("FireHazard",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.29*ne,0,-.25*ne,.63*te,.45*ne,.44*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.51*ne,.42*te,.48*ne,.17*te,.54*ne,.35*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.59*ne,.18*te,.59*ne,.29*te,.58*ne,.28*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,.6*te,.8*ne,.34*te,.88*ne,.43*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.88*ne,.31*te,.87*ne,.48*te,.88*ne,.43*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,te,1.17*ne,.76*te,.82*ne,.8*te).close()),de.spot1=new go.Spot(.07,.445),de.spot2=new go.Spot(.884,.958),de}),go.Shape.defineFigureGenerator("BpmnActivityLoop",function(De,ne,te){var de=new go.Geometry,se=.5,pe=0,ye=0,we=se*at,Ce=.4*Math.SQRT2/2+.5,_e=.5-.5*Math.SQRT2/2,Ze=1,st=.5,nt=.5,Ye=0,ct=new go.PathFigure(Ce*ne,(1-_e)*te,!1);return de.add(ct),ct.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,st*te,Ze*ne,.7*te,Ze*ne,st*te)),ct.add(new go.PathSegment(go.PathSegment.Bezier,(nt+pe)*ne,(Ye+pe)*te,(.5+se+pe)*ne,(.5-we+pe)*te,(.5+we+pe)*ne,(.5-se+pe)*te)),ct.add(new go.PathSegment(go.PathSegment.Bezier,(.5-se+pe)*ne,(.5+ye)*te,(.5-we+pe)*ne,(.5-se+ye)*te,(.5-se+pe)*ne,(.5-we+ye)*te)),ct.add(new go.PathSegment(go.PathSegment.Bezier,(.35+pe)*ne,.9*te,(.5-se+pe)*ne,(.5+we+ye)*te,(.5-we+pe)*ne,.9*te)),ct.add(new go.PathSegment(go.PathSegment.Move,(.25+pe)*ne,.8*te)),ct.add(new go.PathSegment(go.PathSegment.Line,(.35+pe)*ne,.9*te)),ct.add(new go.PathSegment(go.PathSegment.Line,(.2+pe)*ne,.95*te)),de}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Move,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Move,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se);var pe=new go.PathFigure(ne,te,!1);de.add(pe);var ye=new go.PathFigure(0,.5*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.5*te,.2*ne,.35*te,.3*ne,.35*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,.7*ne,.65*te,.8*ne,.65*te)),de}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te).close()),de}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.2*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te).close());var se=new go.PathFigure(0,.2*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),de}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.7*ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,0,.6*ne,.5*te,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.7*ne,te,.4*ne,.5*te,ne,.5*te).close());var pe=new go.PathFigure(.45*ne,.73*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.73*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.38*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.63*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.31*ne,.27*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.56*ne,.27*te)),de}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se);var pe=new go.PathFigure(.335*ne,(1-.555)*te,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.335*ne,(1-.405)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.405)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.555)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,ne,.68*te,(1-.12)*ne,.46*te,(1-.02)*ne,.54*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.68*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,.335*ne,(1-.555)*te,.02*ne,.54*te,.12*ne,.46*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.365*ne,(1-.595)*te));var ye=.5-.285,we=.5,Ce=ye,_e=Math.PI/4,Ze=4*(1-Math.cos(_e))/(3*Math.sin(_e)),st=Ze*.5,nt=ye,Ye=ye,ct=Ze*nt,$e=Ze*Ye;pe.add(new go.PathSegment(go.PathSegment.Bezier,(we-nt)*ne,Ce*te,(we-(ct+nt)/2)*ne,(Ce+(Ye+$e)/2)*te,(we-nt)*ne,(Ce+$e)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,(Ce-Ye)*te,(we-nt)*ne,(Ce-$e)*te,(we-ct)*ne,(Ce-Ye)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(we+nt)*ne,Ce*te,(we+ct)*ne,(Ce-Ye)*te,(we+nt)*ne,(Ce-$e)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*ne,(1-.595)*te,(we+nt)*ne,(Ce+$e)*te,(we+(ct+nt)/2)*ne,(Ce+(Ye+$e)/2)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*ne,(1-.595)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.555)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.405)*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.335*ne,(1-.405)*te));var Et=new go.PathFigure(.2*ne,te,!1);de.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.8*te));var Pt=new go.PathFigure(.8*ne,te,!1);return de.add(Pt),Pt.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.8*te)),de}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,te).close());var pe=new go.PathFigure(.2*ne,.2*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.8*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.8*te)),de}),go.Shape.defineFigureGenerator("BpmnEventError",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se);var pe=new go.PathFigure(ne,te,!1);de.add(pe);var ye=new go.PathFigure(.1*ne,te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("Caution",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.05*ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,.8*te,0,te,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.55*ne,.1*te,.5*ne,0,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.95*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,te,ne,te,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.05*ne,te));var pe=.05;return se.add(new go.PathSegment(go.PathSegment.Move,(.5-pe)*ne,.875*te)),se.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*ne,.875*te,pe*ne,pe*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.325*te,.575*ne,.725*te,.625*ne,.375*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.75*te,.375*ne,.375*te,.425*ne,.725*te)),de}),go.Shape.defineFigureGenerator("Recycle",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.45*ne,.95*te,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.185*ne,.85*te,.17*ne,.95*te,.15*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.235*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.625*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,.275*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.05*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.05*ne,.575*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.1875*ne,.95*te,0,.675*te,0,.7*te)),se.add(new go.PathSegment(go.PathSegment.Move,.45*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.775*te)),se.add(new go.PathSegment(go.PathSegment.Line,.22*ne,.775*te));var pe=new go.PathFigure(.475*ne,.2*te,!1);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.225*ne,.3*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.275*ne,.175*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.325*ne,.05*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,.05*te,.35*ne,0,.375*ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.375*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.475*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.315*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.32*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.05*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,.575*ne,0,.65*ne,.05*te,.625*ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,.38*ne,.0105*te));var ye=new go.PathFigure(.675*ne,.575*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.875*ne,.525*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.85*ne,.95*te,ne,.8*te,ne,.85*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.95*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.85*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.725*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Move,.675*ne,.575*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.775*ne,.775*te)),de}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(De,ne,te){var de=new go.Geometry,se=.5,pe=at*.5,ye=new go.PathFigure(ne,se*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,se*ne,te,ne,(se+pe)*te,(se+pe)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,se*te,(se-pe)*ne,te,0,(se+pe)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,se*ne,0,0,(se-pe)*te,(se-pe)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,se*te,(se+pe)*ne,0,ne,(se-pe)*te));var we=new go.PathFigure(se*ne,0,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,se*ne,.15*te)),we.add(new go.PathSegment(go.PathSegment.Move,se*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,se*ne,.85*te)),we.add(new go.PathSegment(go.PathSegment.Move,0,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.15*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.85*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Move,se*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.58*ne,.1*te)),we.add(new go.PathSegment(go.PathSegment.Move,se*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.78*ne,.54*te)),de}),go.Shape.defineFigureGenerator("Package",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.15*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var pe=new go.PathFigure(0,.15*te,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,0,0)),pe.add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.15*te).close()),de.spot1=new go.Spot(0,.1),de.spot2=new go.Spot(1,1),de}),go.Shape.defineFigureGenerator("Class",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pe=new go.PathFigure(0,.2*te,!1);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te).close());var ye=new go.PathFigure(0,.5*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("Component",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te).close());var pe=new go.PathFigure(0,.2*te,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.2*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.2*te).close());var ye=new go.PathFigure(0,.6*te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.6*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.6*te).close()),de}),go.Shape.defineFigureGenerator("Boat Shipment",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.15*ne,.6*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.6*te));var pe=new go.PathFigure(.15*ne,.6*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.6*te)),de}),go.Shape.defineFigureGenerator("Customer/Supplier",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te).close()),de}),go.Shape.defineFigureGenerator("Workcell",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("Supermarket",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.33*te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.66*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.66*te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,.66*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),de}),go.Shape.defineFigureGenerator("TruckShipment",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pe=new go.PathFigure(ne,.8*te,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.8*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te).close());var ye=.1,we=at*.1,Ce=.2,_e=.9,Ze=new go.PathFigure((Ce-ye)*ne,_e*te,!0);de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-ye)*te,(Ce-ye)*ne,(_e-we)*te,(Ce-we)*ne,(_e-ye)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+ye)*ne,_e*te,(Ce+we)*ne,(_e-ye)*te,(Ce+ye)*ne,(_e-we)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+ye)*te,(Ce+ye)*ne,(_e+we)*te,(Ce+we)*ne,(_e+ye)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-ye)*ne,_e*te,(Ce-we)*ne,(_e+ye)*te,(Ce-ye)*ne,(_e+we)*te).close()),ye=.1,we=at*.1,Ce=.8,_e=.9;var st=new go.PathFigure((Ce-ye)*ne,_e*te,!0);return de.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-ye)*te,(Ce-ye)*ne,(_e-we)*te,(Ce-we)*ne,(_e-ye)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+ye)*ne,_e*te,(Ce+we)*ne,(_e-ye)*te,(Ce+ye)*ne,(_e-we)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+ye)*te,(Ce+ye)*ne,(_e+we)*te,(Ce+we)*ne,(_e+ye)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-ye)*ne,_e*te,(Ce-we)*ne,(_e+ye)*te,(Ce-ye)*ne,(_e+we)*te).close()),de}),go.Shape.defineFigureGenerator("KanbanPost",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.2*ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,0)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),de}),go.Shape.defineFigureGenerator("Forklift",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,0));var pe=new go.PathFigure(0,.5*te,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.8*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,0,.5*te));var ye=new go.PathFigure(.5*ne,.8*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.8*te));var we=new go.PathFigure(.5*ne,.7*te,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te));var Ce=.1,_e=at*.1,Ze=.1,st=.9,nt=new go.PathFigure((Ze-Ce)*ne,st*te,!0);de.add(nt),nt.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(st-Ce)*te,(Ze-Ce)*ne,(st-_e)*te,(Ze-_e)*ne,(st-Ce)*te)),nt.add(new go.PathSegment(go.PathSegment.Bezier,(Ze+Ce)*ne,st*te,(Ze+_e)*ne,(st-Ce)*te,(Ze+Ce)*ne,(st-_e)*te)),nt.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(st+Ce)*te,(Ze+Ce)*ne,(st+_e)*te,(Ze+_e)*ne,(st+Ce)*te)),nt.add(new go.PathSegment(go.PathSegment.Bezier,(Ze-Ce)*ne,st*te,(Ze-_e)*ne,(st+Ce)*te,(Ze-Ce)*ne,(st+_e)*te)),Ce=.1,_e=at*.1,Ze=.4,st=.9;var Ye=new go.PathFigure((Ze-Ce)*ne,st*te,!0);return de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(st-Ce)*te,(Ze-Ce)*ne,(st-_e)*te,(Ze-_e)*ne,(st-Ce)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ze+Ce)*ne,st*te,(Ze+_e)*ne,(st-Ce)*te,(Ze+Ce)*ne,(st-_e)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(st+Ce)*te,(Ze+Ce)*ne,(st+_e)*te,(Ze+_e)*ne,(st+Ce)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Ze-Ce)*ne,st*te,(Ze-_e)*ne,(st+Ce)*te,(Ze-Ce)*ne,(st+_e)*te)),de}),go.Shape.defineFigureGenerator("RailShipment",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,.4*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.4*te).close());var pe=new go.PathFigure(.45*ne,.7*te,!1);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.7*te));var ye=new go.PathFigure(.55*ne,.4*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.4*te).close());var Ze=.05,st=at*.05,nt=.175,Ye=.95,we=new go.PathFigure((nt-Ze)*ne,Ye*te,!0);de.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye-Ze)*te,(nt-Ze)*ne,(Ye-st)*te,(nt-st)*ne,(Ye-Ze)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,(nt+Ze)*ne,Ye*te,(nt+st)*ne,(Ye-Ze)*te,(nt+Ze)*ne,(Ye-st)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye+Ze)*te,(nt+Ze)*ne,(Ye+st)*te,(nt+st)*ne,(Ye+Ze)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,(nt-Ze)*ne,Ye*te,(nt-st)*ne,(Ye+Ze)*te,(nt-Ze)*ne,(Ye+st)*te));var Ze=.05,st=at*.05,nt=.375,Ye=.95,Ce=new go.PathFigure((nt-Ze)*ne,Ye*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye-Ze)*te,(nt-Ze)*ne,(Ye-st)*te,(nt-st)*ne,(Ye-Ze)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(nt+Ze)*ne,Ye*te,(nt+st)*ne,(Ye-Ze)*te,(nt+Ze)*ne,(Ye-st)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye+Ze)*te,(nt+Ze)*ne,(Ye+st)*te,(nt+st)*ne,(Ye+Ze)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(nt-Ze)*ne,Ye*te,(nt-st)*ne,(Ye+Ze)*te,(nt-Ze)*ne,(Ye+st)*te));var Ze=.05,st=at*.05,nt=.625,Ye=.95,_e=new go.PathFigure((nt-Ze)*ne,Ye*te,!0);de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye-Ze)*te,(nt-Ze)*ne,(Ye-st)*te,(nt-st)*ne,(Ye-Ze)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(nt+Ze)*ne,Ye*te,(nt+st)*ne,(Ye-Ze)*te,(nt+Ze)*ne,(Ye-st)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye+Ze)*te,(nt+Ze)*ne,(Ye+st)*te,(nt+st)*ne,(Ye+Ze)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(nt-Ze)*ne,Ye*te,(nt-st)*ne,(Ye+Ze)*te,(nt-Ze)*ne,(Ye+st)*te));var Ze=.05,st=at*.05,nt=.825,Ye=.95,ct=new go.PathFigure((nt-Ze)*ne,Ye*te,!0);de.add(ct),ct.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye-Ze)*te,(nt-Ze)*ne,(Ye-st)*te,(nt-st)*ne,(Ye-Ze)*te)),ct.add(new go.PathSegment(go.PathSegment.Bezier,(nt+Ze)*ne,Ye*te,(nt+st)*ne,(Ye-Ze)*te,(nt+Ze)*ne,(Ye-st)*te)),ct.add(new go.PathSegment(go.PathSegment.Bezier,nt*ne,(Ye+Ze)*te,(nt+Ze)*ne,(Ye+st)*te,(nt+st)*ne,(Ye+Ze)*te)),ct.add(new go.PathSegment(go.PathSegment.Bezier,(nt-Ze)*ne,Ye*te,(nt-st)*ne,(Ye+Ze)*te,(nt-Ze)*ne,(Ye+st)*te).close());var $e=new go.PathFigure(0,te,!1);return de.add($e),$e.add(new go.PathSegment(go.PathSegment.Line,ne,te).close()),de}),go.Shape.defineFigureGenerator("Warehouse",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pe=new go.PathFigure(0,.2*te,!1);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te).close());var ye=new go.PathFigure(.15*ne,te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.15*ne,te).close());var we=.05,Ce=at*.05,_e=.35,Ze=.775,st=new go.PathFigure((_e-we)*ne,Ze*te,!0);return de.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,_e*ne,(Ze-we)*te,(_e-we)*ne,(Ze-Ce)*te,(_e-Ce)*ne,(Ze-we)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,(_e+we)*ne,Ze*te,(_e+Ce)*ne,(Ze-we)*te,(_e+we)*ne,(Ze-Ce)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,_e*ne,(Ze+we)*te,(_e+we)*ne,(Ze+Ce)*te,(_e+Ce)*ne,(Ze+we)*te)),st.add(new go.PathSegment(go.PathSegment.Bezier,(_e-we)*ne,Ze*te,(_e-Ce)*ne,(Ze+we)*te,(_e-we)*ne,(Ze+Ce)*te).close()),de}),go.Shape.defineFigureGenerator("ControlCenter",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,.1*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te).close()),de}),go.Shape.defineFigureGenerator("Bluetooth",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.75*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),de}),go.Shape.defineFigureGenerator("Bookmark",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.4*te)),de}),go.Shape.defineFigureGenerator("Bookmark",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.4*te)),de}),go.Shape.defineFigureGenerator("Globe",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,.75*ne,0,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,.75*te,.75*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,.25*ne,te,0,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,.25*te,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,.15*ne,.25*te,.15*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,.85*ne,.75*te,.85*ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Move,.1675*ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8325*ne,.15*te,.35*ne,.3*te,.65*ne,.3*te)),se.add(new go.PathSegment(go.PathSegment.Move,.1675*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8325*ne,.85*te,.35*ne,.7*te,.65*ne,.7*te)),de}),go.Shape.defineFigureGenerator("Wave",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.25*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.25*te,.1*ne,0,.2*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.7*ne,.25*te,.425*ne,.5*te,.575*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.25*te,.8*ne,0,.9*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Move,0,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.75*te,.1*ne,.5*te,.2*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.7*ne,.75*te,.425*ne,te,.575*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.75*te,.8*ne,.5*te,.9*ne,.5*te)),de}),go.Shape.defineFigureGenerator("Operator",function(De,ne,te){var de=new go.Geometry,se=.3,pe=at*.3,ye=.5,we=.7,Ce=new go.PathFigure((ye-se)*ne,we*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te));var _e=new go.PathFigure(0,.7*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ne,.7*te,0,0,ne,0)),de}),go.Shape.defineFigureGenerator("TripleFanBlades",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.65*te,.65*ne,.3*te,.65*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,.35*ne,.5*te,.35*ne,.3*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.65*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.3*ne,.6*te,.1*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.65*te,.2*ne,te,.35*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.65*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,te,.7*ne,.6*te,.9*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.65*te,.8*ne,te,.65*ne,.95*te)),de}),go.Shape.defineFigureGenerator("CentrifugalPump",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,0,.075*te,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,te,0,te,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.4*te,.8*ne,te,.85*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),de}),go.Shape.defineFigureGenerator("Battery",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,.4*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.1*te));var pe=new go.PathFigure(0,.6*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Move,0,.4*te)),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.4*te)),de}),go.Shape.defineFigureGenerator("Delete",function(De,ne,te){var de=new go.Geometry,se=.5,pe=at*.5,ye=.5,we=.5,Ce=new go.PathFigure((ye-se)*ne,we*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te));var _e=new go.PathFigure(.15*ne,.5*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.5*te)),de}),go.Shape.defineFigureGenerator("Flag",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.1*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,0,.1*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.1*te,.15*ne,0,.35*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.1*te,.65*ne,.2*te,.85*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.5*te,.85*ne,.6*te,.65*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,.35*ne,.4*te,.15*ne,.4*te).close()),de}),go.Shape.defineFigureGenerator("Help",function(De,ne,te){var de=new go.Geometry,se=.5,pe=at*.5,ye=.5,we=.5,Ce=new go.PathFigure((ye-se)*ne,we*te,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te).close()),se=.05,pe=at*.05,ye=.5,we=.8;var _e=new go.PathFigure((ye-se)*ne,we*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te).close()),_e.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.7*te)),_e.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.2*te,.75*ne,.475*te,.75*ne,.225*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.35*te,.4*ne,.2*te,.3*ne,.25*te)),de}),go.Shape.defineFigureGenerator("Location",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,te,!0).add(new go.PathSegment(go.PathSegment.Line,.75*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,.975*ne,.025*te,.5*ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,.25*ne,.5*te,.5*ne,0,.025*ne,.025*te).close()).add(new go.PathSegment(go.PathSegment.Move,.5*ne,.2*te)).add(new go.PathSegment(go.PathSegment.Arc,270,360,.5*ne,.3*te,.1*ne,.1*te).close()))}),go.Shape.defineFigureGenerator("Lock",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te));var pe=new go.PathFigure(.2*ne,.5*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.3*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.3*te,.25*ne,0,.75*ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.3*te)),de}),go.Shape.defineFigureGenerator("Unlocked",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te));var pe=new go.PathFigure(.2*ne,.5*te,!1);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.5*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.3*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.3*te,.25*ne,0,.75*ne,0)),pe.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.35*te)),de}),go.Shape.defineFigureGenerator("Gear",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.9375*ne,.56246875*te,!0).add(new go.PathSegment(go.PathSegment.Line,.9375*ne,.4375*te)).add(new go.PathSegment(go.PathSegment.Line,.80621875*ne,.4375*te)).add(new go.PathSegment(go.PathSegment.Bezier,.763*ne,.3316875*te,.79840625*ne,.39915625*te,.7834375*ne,.3635*te)).add(new go.PathSegment(go.PathSegment.Line,.8566875*ne,.23796875*te)).add(new go.PathSegment(go.PathSegment.Line,.76825*ne,.14959375*te)).add(new go.PathSegment(go.PathSegment.Line,.67596875*ne,.24184375*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5625*ne,.19378125*te,.64228125*ne,.2188125*te,.603875*ne,.2021875*te)).add(new go.PathSegment(go.PathSegment.Line,.5625*ne,.0625*te)).add(new go.PathSegment(go.PathSegment.Line,.4375*ne,.0625*te)).add(new go.PathSegment(go.PathSegment.Line,.4375*ne,.19378125*te)).add(new go.PathSegment(go.PathSegment.Bezier,.32775*ne,.239375*te,.39759375*ne,.20190625*te,.36053125*ne,.2176875*te)).add(new go.PathSegment(go.PathSegment.Line,.2379375*ne,.14959375*te)).add(new go.PathSegment(go.PathSegment.Line,.14953125*ne,.2379375*te)).add(new go.PathSegment(go.PathSegment.Line,.23934375*ne,.3278125*te)).add(new go.PathSegment(go.PathSegment.Bezier,.19378125*ne,.4375*te,.21765625*ne,.36059375*te,.201875*ne,.397625*te)).add(new go.PathSegment(go.PathSegment.Line,.0625*ne,.4375*te)).add(new go.PathSegment(go.PathSegment.Line,.0625*ne,.5625*te)).add(new go.PathSegment(go.PathSegment.Line,.1938125*ne,.5625*te)).add(new go.PathSegment(go.PathSegment.Bezier,.241875*ne,.67596875*te,.20221875*ne,.603875*te,.21884375*ne,.64228125*te)).add(new go.PathSegment(go.PathSegment.Line,.1495625*ne,.76825*te)).add(new go.PathSegment(go.PathSegment.Line,.238*ne,.8566875*te)).add(new go.PathSegment(go.PathSegment.Line,.3316875*ne,.76296875*te)).add(new go.PathSegment(go.PathSegment.Bezier,.43753125*ne,.80621875*te,.36353125*ne,.78340625*te,.3991875*ne,.79840625*te)).add(new go.PathSegment(go.PathSegment.Line,.43753125*ne,.9375*te)).add(new go.PathSegment(go.PathSegment.Line,.5625*ne,.9375*te)).add(new go.PathSegment(go.PathSegment.Line,.5625*ne,.80621875*te)).add(new go.PathSegment(go.PathSegment.Bezier,.67225*ne,.760625*te,.602375*ne,.79809375*te,.63946875*ne,.78234375*te)).add(new go.PathSegment(go.PathSegment.Line,.76828125*ne,.8566875*te)).add(new go.PathSegment(go.PathSegment.Line,.85671875*ne,.76825*te)).add(new go.PathSegment(go.PathSegment.Line,.76065625*ne,.67221875*te)).add(new go.PathSegment(go.PathSegment.Bezier,.80621875*ne,.56246875*te,.78234375*ne,.63940625*te,.798125*ne,.602375*te)).add(new go.PathSegment(go.PathSegment.Line,.9375*ne,.56246875*te).close()).add(new go.PathSegment(go.PathSegment.Move,.5*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Arc,90,360,.5*ne,.5*te,.1*ne,.1*te).close()))}),go.Shape.defineFigureGenerator("Hand",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,.3*te,0,.375*te,.05*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.45*ne,.075*te,.3*ne,.225*te,.4*ne,.175*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.525*ne,.075*te,.46*ne,.05*te,.525*ne,.05*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.4*te,.525*ne,.275*te,.475*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,.55*te,ne,.4*te,ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.6*ne,.7*te,.675*ne,.55*te,.675*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.575*ne,.85*te,.65*ne,.7*te,.65*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.535*ne,te,.61*ne,.85*te,.61*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,.435*ne,te,0,te).close()),de}),go.Shape.defineFigureGenerator("Map",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.2*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),se.add(new go.PathSegment(go.PathSegment.Move,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.8*te)),de}),go.Shape.defineFigureGenerator("Eject",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.7)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.7).close());var pe=new go.PathFigure(0,te*.6,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne,.6*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0).close()),de}),go.Shape.defineFigureGenerator("Pencil",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.2*ne,.1*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.1*ne,.2*te).close()))}),go.Shape.defineFigureGenerator("Building",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*1,te*1,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.85)),se.add(new go.PathSegment(go.PathSegment.Line,.046*ne,te*.85)),se.add(new go.PathSegment(go.PathSegment.Line,.046*ne,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,.046*ne,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*ne,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*ne,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*ne,te*.85)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.85).close());var pe=new go.PathFigure(.126*ne,.85*te,!1);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,.126*ne,.45*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.322*ne,.45*te)),pe.add(new go.PathSegment(go.PathSegment.Line,.322*ne,.85*te).close());var ye=new go.PathFigure(.402*ne,.85*te,!1);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.402*ne,.45*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.598*ne,.45*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.598*ne,.85*te).close());var we=new go.PathFigure(.678*ne,.85*te,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.678*ne,.45*te)),we.add(new go.PathSegment(go.PathSegment.Line,.874*ne,.45*te)),we.add(new go.PathSegment(go.PathSegment.Line,.874*ne,.85*te).close());var Ce=new go.PathFigure(.5*ne,.1*te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*ne,.3*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*ne,.3*te).close()),de}),go.Shape.defineFigureGenerator("Staircase",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te*1,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*.8)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.8)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.6)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.6)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.4)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*.4)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*.2)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.2)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.15)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.15)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.95).close()),de}),go.Shape.defineFigureGenerator("5Bars",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te*1,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.184,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.184,te*(1-.184)).close());var pe=new go.PathFigure(ne*.204,te,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.204,te*(1-.184))),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.388,te*(1-.184*2))),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.388,te*1).close());var ye=new go.PathFigure(ne*.408,te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.408,te*(1-.184*2))),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.592,te*(1-.184*3))),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.592,te*1).close());var we=new go.PathFigure(ne*.612,te,!0);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*.612,te*(1-.184*3))),we.add(new go.PathSegment(go.PathSegment.Line,ne*.796,te*(1-.184*4))),we.add(new go.PathSegment(go.PathSegment.Line,ne*.796,te*1).close());var Ce=new go.PathFigure(ne*.816,te,!0);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.816,te*(1-.184*4))),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-.184*5))),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1).close()),de}),go.Shape.defineFigureGenerator("PC",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,0).close());var pe=new go.PathFigure(ne*.055,.07*te,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.07)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.1)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.055,te*.1).close());var ye=new go.PathFigure(ne*.055,.13*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.13)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.16)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.055,te*.16).close());var we=new go.PathFigure(ne*.055,.18*te,!0);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.18)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.21)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.055,te*.21).close());var Ce=new go.PathFigure(ne*1,0,!0);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.4,0)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.65)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.65).close()),de}),go.Shape.defineFigureGenerator("Plane",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.55*ne,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.475*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.35*ne,.525*te,0,.4*te,.225*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.475*te)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,.2*te,.975*ne,0,ne,.08*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Line,.55*ne,te).close()),de}),go.Shape.defineFigureGenerator("Key",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*1,te*.5,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.9,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.7,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.85,.575*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.9,.6*te).close()),se.add(new go.PathSegment(go.PathSegment.Move,.17*ne,.425*te)),se.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*ne,.5*te,.075*ne,.075*te).close()),de}),go.Shape.defineFigureGenerator("FilmTape",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,180,ne*0,ne*.3,ne*.055)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.08,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.08,te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*1),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*1),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*2),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*2),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*3),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*3),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*4),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*4),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*5),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*5),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*6),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*6),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*7),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*7),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*8),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*8),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*9),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*9),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*10),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*10),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*11),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*11),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*12),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*12),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*13),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*13),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*14),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*14),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*15),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*15),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1));var pe=new go.PathFigure(0,0,!1);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*0)),pe.add(new go.PathSegment(go.PathSegment.Arc,270,-180,ne*1,ne*.3,ne*.055)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1));var ye=new go.PathFigure(ne*.11,te*.1,!1);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*1+.028*0),te*.1)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*1+.028*0),te*.8)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.11,te*.8).close());var we=new go.PathFigure(ne*(.11+.24133333*1+.028*1),te*.1,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*2+.028*1),te*.1)),we.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*2+.028*1),te*.8)),we.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*1+.028*1),te*.8).close());var Ce=new go.PathFigure(ne*(.11+.24133333*2+.028*2),te*.1,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*3+.028*2),te*.1)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*3+.028*2),te*.8)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*2+.028*2),te*.8).close()),de}),go.Shape.defineFigureGenerator("FloppyDisk",function(De,ne,te){var de=new go.Geometry,se=8,pe=se*at,ye=new go.PathFigure(se,0,!1);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.86,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.14)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-se)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-se,te,ne,te-pe,ne-pe,te)),ye.add(new go.PathSegment(go.PathSegment.Line,se,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-se,pe,te,0,te-pe)),ye.add(new go.PathSegment(go.PathSegment.Line,0,se)),ye.add(new go.PathSegment(go.PathSegment.Bezier,se,0,0,pe,pe,0).close());var we=new go.PathFigure(ne*.83,0,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*.83,te*.3)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*.3)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*0).close());var Ce=new go.PathFigure(ne*.83,te*1,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.83,te*.5)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*.5)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*1).close());var _e=new go.PathFigure(ne*.78,te*.05,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.05)),_e.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.25)),_e.add(new go.PathSegment(go.PathSegment.Line,ne*.78,te*.25).close()),de}),go.Shape.defineFigureGenerator("SpeechBubble",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=15),de=Math.min(de,ne/3),de=Math.min(de,te/3);var se=de*at,pe=te*.8,ye=new go.Geometry,we=new go.PathFigure(de,0,!0);return ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne-de,0)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne,de,ne-se,0,ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,ne,pe-de)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,pe,ne,pe-se,ne-se,pe)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.7,pe)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.55,pe)),we.add(new go.PathSegment(go.PathSegment.Line,de,pe)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,pe-de,se,pe,0,pe-se)),we.add(new go.PathSegment(go.PathSegment.Line,0,de)),we.add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,se,se,0).close()),se>1?(ye.spot1=new go.Spot(0,0,se,se),ye.spot2=new go.Spot(1,.8,-se,-se)):(ye.spot1=go.Spot.TopLeft,ye.spot2=new go.Spot(1,.8)),ye}),go.Shape.defineFigureGenerator("Repeat",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*.45,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*.9)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.9)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*.45).close());var pe=new go.PathFigure(ne*1,te*.55,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*1)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.55)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*.55)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*.1)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.1)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*.55).close()),de}),go.Shape.defineFigureGenerator("Windows",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close()).add(new go.PathSegment(go.PathSegment.Move,.4*ne,.4*te)).add(new go.PathSegment(go.PathSegment.Line,.4*ne,.8*te)).add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)).add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te).close()).add(new go.PathSegment(go.PathSegment.Move,.2*ne,.1*te)).add(new go.PathSegment(go.PathSegment.Line,.2*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.1*te).close()).add(new go.PathSegment(go.PathSegment.Move,.1*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Line,.1*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te).close()))}),go.Shape.defineFigureGenerator("Terminal",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*.1,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.9)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*.9).close());var pe=new go.PathFigure(ne*.1,te*.2,!0);de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.1,te*.25)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.22,te*.285)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.1,te*.32)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.1,te*.37)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.275,te*.32)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.275,te*.25).close());var ye=new go.PathFigure(ne*.28,te*.37,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.37)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.41)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.28,te*.41).close()),de}),go.Shape.defineFigureGenerator("Beaker",function(De,ne,te){var de=new go.Geometry,se=15,pe=se*at,ye=new go.PathFigure(ne*.62,te*.475,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-se)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-se,te,ne,te-pe,ne-pe,te)),ye.add(new go.PathSegment(go.PathSegment.Line,se,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-se,pe,te,0,te-pe)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.38,te*.475)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.38,te*.03)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.62,te*.03).close()),pe>1?(de.spot1=new go.Spot(0,0,pe,pe),de.spot2=new go.Spot(1,1,-pe,-pe)):(de.spot1=go.Spot.TopLeft,de.spot2=go.Spot.BottomRight),de}),go.Shape.defineFigureGenerator("Download",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*1,!0);de.add(se);var pe=.1/.3;se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.755,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.93,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.61,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.39,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.07,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.755),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.8),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*(1-pe)).close());var ye=new go.PathFigure(ne*.4,te*0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.26,te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.66)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.26),te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*0).close()),de}),go.Shape.defineFigureGenerator("Bin",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*1,!0);de.add(se);var pe=.1/.3;return se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.755,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.93,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.61,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.39,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.07,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.755),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.8),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*(1-pe)).close()),de}),go.Shape.defineFigureGenerator("Upload",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*1,!0);de.add(se);var pe=.1/.3;se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.755,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.93,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.61,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.39,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.07,te*(1-pe))),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.755),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.8),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*(1-pe)).close());var ye=new go.PathFigure(ne*.5,te*0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.26,te*.25)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.25)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.63)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.63)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.25)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.74,te*.25).close()),de}),go.Shape.defineFigureGenerator("EmptyDrink",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.15,te*0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.85,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*1).close()),de}),go.Shape.defineFigureGenerator("Drink",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.15,te*0,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.85,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*1).close());var pe=new go.PathFigure(ne*.235,te*.28,!0);return de.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.765,te*.28)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.655,te*.97)),pe.add(new go.PathSegment(go.PathSegment.Line,ne*.345,te*.97).close()),de}),go.Shape.defineFigureGenerator("4Arrows",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.5,te*0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,te*.25)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.25)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.5)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.65)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.65)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*.5)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.25)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.25).close()),de}),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")},43001: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 Zn={},ei="5.0",Le={},le=null,Ue=!1,pt=!1,St=null,yt=!1,Oe=null,at=null,Ct=0;Ct<arguments.length;Ct++){var ot=arguments[Ct];if(ot!==null)switch(typeof ot){case"number":ei=ot.toFixed(1);break;case"string":ot.match(new RegExp("^[0-9]\\.[0-9]+$"))?ei=ot:St=ot;break;case"object":typeof ot.is3D!="undefined"?le=ot:Le=ot;break;case"boolean":Ue=ot,pt=!0;break}}le===null&&(le={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},Le.material_id!==void 0&&!pt&&(Ue=!0)),St!==null&&Le.id===void 0&&(Le.id=St);var We="",Tt="",dt=!1,kt=null,De=null,ne=null,te=!1,de=null,se=null,pe=null,ye=null,we=null;Le.height!==void 0&&(Le.height=Math.round(Le.height)),Le.width!==void 0&&(Le.width=Math.round(Le.width));var Ce=function(Rt){return parseFloat(Rt)>4?parseFloat(Rt):5};Zn.setHTML5Codebase=function(Rt,En){at=Rt,dn(Rt,En)},Zn.setJavaCodebase=Zn.setJavaCodebaseVersion=Zn.isCompiledInstalled=Zn.setPreCompiledScriptPath=Zn.setPreCompiledResourcePath=function(){},Zn.setHTML5CodebaseVersion=function(Rt,En){var Bn=parseFloat(Rt);if(Bn!==NaN&&Bn<5){console.log("The GeoGebra HTML5 codebase version "+Bn+" is deprecated. Using version latest instead.");return}Oe=Rt,rt(Rt,En)},Zn.getHTML5CodebaseVersion=function(){return De},Zn.getParameters=function(){return Le},Zn.setFontsCSSURL=function(Rt){ye=Rt},Zn.setGiacJSURL=function(Rt){},Zn.setJNLPFile=function(Rt){We=Rt},Zn.setJNLPBaseDir=function(Rt){},Zn.inject=function(){function Rt(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var En="auto",Bn=Le.id,ui,It=!1,On=0;On<arguments.length;On++){var ht=arguments[On];typeof ht=="string"?(ht=ht.toLowerCase(),ht.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?En=ht:Bn=arguments[On]):typeof ht=="boolean"?It=ht:ht instanceof HTMLElement&&(ui=ht)}kn();function kn(){if(!yt){setTimeout(kn,200);return}En=tn(En);var Oi=ui||document.getElementById(Bn);if(!Oi){console.log("possibly bug on ajax loading? ");return}if(Zn.removeExistingApplet(Oi,!1),Le.width===void 0&&Oi.clientWidth&&(Le.width=Oi.clientWidth),Le.height===void 0&&Oi.clientHeight&&(Le.height=Oi.clientHeight),!(Le.width&&Le.height)&&En==="html5"&&(delete Le.width,delete Le.height),kt=En,En==="screenshot")Pt(Oi,Le);else{var ze=!1;Le.hasOwnProperty("playButton")&&Le.playButton||Le.hasOwnProperty("clickToLoad")&&Le.clickToLoad?ze=!0:Le.hasOwnProperty("playButtonAutoDecide")&&Le.playButtonAutoDecide&&(ze=(!_e()||Rt())&&Ze()),ze?(kt="screenshot",fn(Oi,Le,It,En)):Et(Oi,Le,It)}}};function _e(){try{return window.self!==window.top}catch(Rt){return!0}}function Ze(){return Le.hasOwnProperty("screenshotGenerator")&&Le.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Zn.getViews=function(){return le},Zn.isJavaInstalled=function(){return!1};var st=function(Rt){var En=function(On){var ht=JSON.parse(On),kn=function(Me){return Me.type=="G"||Me.type=="E"},Oi=ht.elements?ht.elements.filter(kn)[0]:ht;if(!Oi||!Oi.url){Bn();return}Le.fileName=Oi.url,nt(Oi.settings||{}),le.is3D=!0;var ze="https://www.geogebra.org/images/";Zn.setPreviewImage(de||Oi.previewUrl,ze+"GeoGebra_loading.png",ze+"applet_play.png"),Rt()},Bn=function(){Le.onError&&Le.onError(),ni("Error: Fetching material (id "+Le.material_id+") failed.",Le)},ui=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",It="/materials/"+Le.material_id+"?scope=basic";Ye("https://"+ui+"/api/proxy.php?path="+encodeURIComponent(It),En,Bn)};function nt(Rt){var En=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Bn){Rt[Bn]=!!Rt[Bn]}),En.forEach(function(Bn){Le[Bn]===void 0&&Rt[Bn]!==void 0&&(Le[Bn]=Rt[Bn])}),Le.showToolBarHelp===void 0&&(Le.showToolBarHelp=Le.showToolBar)}function Ye(Rt,En,Bn){var ui=new XMLHttpRequest;ui.open("GET",Rt),ui.onload=function(){En(ui.responseText)},ui.onerror=Bn,ui.send()}Zn.isHTML5Installed=function(){return!0},Zn.getLoadedAppletType=function(){return kt},Zn.setPreviewImage=function(Rt,En,Bn){de=Rt,se=En,pe=Bn},Zn.removeExistingApplet=function(Rt,En){var Bn;typeof Rt=="string"&&(Rt=document.getElementById(Rt)),kt=null;var ui=null;for(Bn=0;Bn<Rt.childNodes.length;Bn++){var It=Rt.childNodes[Bn],On=It.className;On==="applet_screenshot"?En?(It.style.display="block",kt="screenshot"):It.style.display="none":On!=="applet_scaler prerender"&&(Rt.removeChild(It),ui=On&&On.indexOf("appletParameters")!=-1?It.id:null,Bn--)}var ht=Le.id!==void 0?Le.id:ui,kn=window[ht];kn&&typeof kn.getBase64=="function"&&(kn.remove(),window[ht]=null)},Zn.refreshHitPoints=function(){if(Ce(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Rt=Zn.getAppletObject();return Rt&&typeof Rt.recalculateEnvironments=="function"?(Rt.recalculateEnvironments(),!0):!1},Zn.startAnimation=function(){var Rt=Zn.getAppletObject();return Rt&&typeof Rt.startAnimation=="function"?(Rt.startAnimation(),!0):!1},Zn.stopAnimation=function(){var Rt=Zn.getAppletObject();return Rt&&typeof Rt.stopAnimation=="function"?(Rt.stopAnimation(),!0):!1},Zn.getAppletObject=function(){var Rt=Le.id!==void 0?Le.id:"ggbApplet";return window[Rt]},Zn.resize=function(){};var ct=function(Rt,En,Bn){var ui=document.createElement("param");ui.setAttribute("name",En),ui.setAttribute("value",Bn),Rt.appendChild(ui)},$e=function(Rt){return Rt&&Rt!=="false"},Et=function(Rt,En,Bn){Ce(De)<=4.2&&(Bn=!0);var ui=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==De||ggbHTML5LoadedCodebaseIsWebSimple&&!te)&&(ui=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var It=document.createElement("div");It.classList.add("appletParameters","notranslate");var On=En.width,ht=En.height;if(En.disableAutoScale=En.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():En.disableAutoScale,En.width!==void 0)if(Ce(De)<=4.4)$e(En.showToolBar)&&(En.height-=7),$e(En.showAlgebraInput)&&(En.height-=37),En.width<605&&$e(En.showToolBar)&&(En.width=605,On=605);else{var kn=100;($e(En.showToolBar)||$e(En.showMenuBar))&&(En.hasOwnProperty("customToolBar")&&(En.customToolbar=En.customToolBar),kn=$e(En.showMenuBar)?245:155),On<kn&&(En.width=kn,On=kn)}It.style.border="none",It.style.display="inline-block";for(var Oi in En)En.hasOwnProperty(Oi)&&Oi!=="appletOnLoad"&&It.setAttribute("data-param-"+Oi,En[Oi]);ye&&It.setAttribute("data-param-fontscssurl",ye),Zn.resize=function(){GGBAppletUtils.responsiveResize(Rt,En)},window.addEventListener("resize",function(Ot){Zn.resize()});var ze=typeof En.appletOnLoad=="function"?En.appletOnLoad:function(){};if(!Bn&&En.width!==void 0){En.hasOwnProperty("showSplash")||It.setAttribute("data-param-showSplash","false");var Me=Rt.querySelector(".applet_scaler.prerender"),Ee=Me!==null;if(Ee)var Te=Me.querySelector(".ggb_preview");else{var Te=vn(On,ht,En.borderColor,!1);Me=document.createElement("div"),Me.className="applet_scaler",Me.style.position="relative",Me.style.display="block",Me.style.width=On+"px",Me.style.height=ht+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Me,"66%"),Ce(De)>=5?(En.appletOnLoad=function(Ot){var un=Rt.querySelector(".ggb_preview");un&&un.parentNode.removeChild(un),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Me),window.GGBT_wsf_view&&$(window).trigger("resize"),ze(Ot)},Ee||Me.appendChild(Te)):It.appendChild(Te),Me.appendChild(It),Ee||Rt.appendChild(Me),setTimeout(function(){Zn.resize()},1)}else{var He=document.createElement("div");He.className="applet_scaler",He.style.position="relative",He.style.display="block",He.appendChild(It),Rt.appendChild(He),En.appletOnLoad=function(Ot){Zn.resize(),ze(Ot)}}function Ae(Ot,un){un&&typeof un.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Ot,un.appletOnLoad):renderGGBElement(Ot),ni("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",un)}function et(Ot,un){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Ot,params:un}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Sn){Ae(Sn.article,Sn.params)}),html5AppletsToProcess=null)},Ce(De)<5&&(Ot.className+=" geogebraweb")):Ae(Ot,un)}if(ui){scriptLoadStarted=!0;for(var on=0;on<It.childNodes.length;on++){var Kt=It.childNodes[on].tagName;Kt==="TABLE"&&(It.removeChild(It.childNodes[on]),on--)}if(ggbHTML5LoadedScript!==null){var pn=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');pn!=null&&pn.parentNode.removeChild(pn)}var Nt=document.createElement("script"),Dt=function(){et(It,En)};Nt.src=Tt+ne,ggbHTML5LoadedCodebaseIsWebSimple=te,ggbHTML5LoadedCodebaseVersion=De,ggbHTML5LoadedScript=Nt.src,ni("GeoGebra HTML5 codebase loaded: '"+Tt+"'.",En),!at&&(!Oe||Oe=="5.0")?(te?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Dt()):Tt.requirejs?__webpack_require__.e(7963).then(function(){var Ot=[__webpack_require__(87963)];Dt.apply(null,Ot)}.bind(this)).catch(__webpack_require__.oe):(Nt.onload=Dt,Rt.appendChild(Nt))}else et(It,En);En.height=ht,En.width=On},Pt=function(Rt,En,Bn){var ui=vn(En.width,En.height,En.borderColor,Bn),It=document.createElement("div");It.style.position="relative",It.style.display="block",It.style.width=En.width+"px",It.style.height=En.height+"px",It.className="applet_screenshot applet_scaler"+(Bn?" applet_screenshot_play":""),It.appendChild(ui);var On=GGBAppletUtils.getScale(En,Rt,Bn);Bn?(Rt.appendChild(qt()),window.GGBT_wsf_view||(Rt.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(It,"66%"),Rt.appendChild(It),On!==1&&!isNaN(On)&&(GGBAppletUtils.scaleElement(It,On),It.style.width=En.width+"px",It.style.height=En.height+"px",It.parentNode.style.width=En.width*On+"px",It.parentNode.style.height=En.height*On+"px"),Zn.resize=function(){Bt(Rt,ui,It,Bn)},window.addEventListener("resize",function(ht){Zn.resize()}),Zn.resize()};function Bt(Rt,En,Bn,ui){if(Rt.contains(En)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Rt.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Rt)}var It=GGBAppletUtils.getScale(Le,Rt,ui);Bn.parentNode!==null&&(!isNaN(It)&&It!==1?(GGBAppletUtils.scaleElement(Bn,It),Bn.parentNode.style.width=Le.width*It+"px",Bn.parentNode.style.height=Le.height*It+"px"):(GGBAppletUtils.scaleElement(Bn,1),Bn.parentNode.style.width=Le.width+"px",Bn.parentNode.style.height=Le.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Rt),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Zn.onExitFullscreen=function(Rt,En){En.appendChild(Rt)};var fn=function(Rt,En,Bn,ui){Pt(Rt,En,!0);for(var It=function(){var kn=[];for(ht=0;ht<Rt.childNodes.length;ht++)kn.push(Rt.childNodes[ht]);if(window.GGBT_wsf_view){var Oi=window.GGBT_wsf_view.renderFullScreen(Rt,En.id),ze=document.getElementById("fullscreencontainer"),Me=jQuery(Rt).find(".fullscreencontent");Me.length>0?(Oi.remove(),Me.attr("id","fullscreencontent").show(),jQuery(ze).append(Me),window.dispatchEvent(new Event("resize"))):Et(Oi,En,!1),window.GGBT_wsf_view.launchFullScreen(ze)}else kt=ui,Et(Rt,En,!1);if(!window.GGBT_wsf_view)for(ht=0;ht<kn.length;ht++)Rt.removeChild(kn[ht])},On=Rt.getElementsByClassName("ggb_preview_play"),ht=0;ht<On.length;ht++)On[ht].addEventListener("click",It,!1),On[ht].addEventListener("ontouchstart",It,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Rt),Ze()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},qt=function(){var Rt=document.createElement("div");if(Rt.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var En='.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");}',Bn=document.createElement("style");Bn.styleSheet?Bn.styleSheet.cssText=En:Bn.appendChild(document.createTextNode(En)),document.getElementsByTagName("head")[0].appendChild(Bn)}return Rt},vn=function(Rt,En,Bn,ui){var It=document.createElement("div");It.className="ggb_preview",It.style.position="absolute",It.style.zIndex="90",It.style.width=Rt-2+"px",It.style.height=En-2+"px",It.style.top="0px",It.style.left="0px",It.style.overflow="hidden",It.style.backgroundColor="white";var On="lightgrey";Bn!==void 0&&(Bn==="none"?On="transparent":On=Bn),It.style.border="1px solid "+On;var ht=document.createElement("img");if(ht.style.position="relative",ht.style.zIndex="1000",ht.style.top="-1px",ht.style.left="-1px",de!==null&&ht.setAttribute("src",de),ht.style.opacity=.7,se!==null){var kn,Oi,ze;if(!ui){kn=document.createElement("img"),kn.style.position="absolute",kn.style.zIndex="1001",kn.style.opacity=1,ht.style.opacity=.3,Oi=360,Oi>Rt/4*3&&(Oi=Rt/4*3),ze=Oi/5.8,kn.setAttribute("src",se),kn.setAttribute("width",Oi),kn.setAttribute("height",ze);var Me=(Rt-Oi)/2,Ee=(En-ze)/2;kn.style.left=Me+"px",kn.style.top=Ee+"px",It.appendChild(kn)}}return It.appendChild(ht),It},tn=function(Rt){return Rt=Rt.toLowerCase(),Rt==="html5"||Rt==="screenshot"?Rt:"html5"},it=["web","webSimple","web3d","tablet","tablet3d","phone"],rt=function(Rt,En){if(De=Rt,En){dn(De,!0);return}var Bn=!Ue;if(Bn){var ui=Ce(De);!isNaN(ui)&&ui<4.4&&(Bn=!1)}var It,On;window.location.protocol.substr(0,4)==="http"?It=window.location.protocol:It="http:";var ht=De.indexOf("//");ht>0?On=De:ht===0?On=It+De:On="https://www.geogebra.org/apps/5.2.814.0/";for(var kn in it)if(De.slice(it[kn].length*-1)===it[kn]||De.slice((it[kn].length+1)*-1)===it[kn]+"/"){dn(On,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Bn&&!le.is3D&&!le.AV&&!le.SV&&!le.CV&&!le.EV2&&!le.CP&&!le.PC&&!le.DA&&!le.FI&&!le.PV&&!$e(Le.showToolBar)&&!$e(Le.showMenuBar)&&!$e(Le.showAlgebraInput)&&!$e(Le.enableRightClick)&&(!Le.appName||Le.appName=="classic")?On+="webSimple/":On+="web3d/",dn(On,!1)},dn=function(Rt,En){if(Rt.requirejs){Tt=Rt;return}Rt.slice(-1)!=="/"&&(Rt+="/"),Tt=Rt,En===null&&(En=Rt.indexOf("http")===-1),dt=En,ne="web.nocache.js",te=!1;var Bn=Tt.split("/");Bn.length>1&&(!En&&Bn[Bn.length-2]==="webSimple"?(ne="webSimple.nocache.js",te=!0):it.indexOf(Bn[Bn.length-2])>=0&&(ne=Bn[Bn.length-2]+".nocache.js")),Bn=Rt.split("/"),De=Bn[Bn.length-3],De.substr(0,4)==="test"?De=De.substr(4,1)+"."+De.substr(5,1):(De.substr(0,3)==="war"||De.substr(0,4)==="beta")&&(De="5.0");var ui=parseFloat(De);ui!==NaN&&ui<5&&Rt.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+ui+" is deprecated. Using version latest instead."),rt("5.0",En))},ni=function(Rt,En){window.console&&window.console.log&&(!En||typeof En.showLogging=="undefined"||En.showLogging&&En.showLogging!=="false")&&console.log(Rt)};Le.material_id!==void 0?st(Kn):Kn();function Kn(){var Rt=ei;Oe!==null?Rt=Oe:parseFloat(Rt)<5&&(Rt="5.0"),rt(Rt,!1),at!==null&&dn(at,dt),yt=!0}return Zn},GGBAppletUtils=function(){"use strict";function Zn(){return window.GGBT_wsf_edit!==void 0}function ei(yt,Oe){Oe!=1?(yt.style.transformOrigin="0% 0% 0px",yt.style.webkitTransformOrigin="0% 0% 0px",yt.style.transform="scale("+Oe+","+Oe+")",yt.style.webkitTransform="scale("+Oe+","+Oe+")",yt.style.maxWidth="initial",yt.querySelector(".ggb_preview")!==null&&(yt.querySelector(".ggb_preview").style.maxWidth="initial"),yt.querySelectorAll(".ggb_preview img")[0]!==void 0&&(yt.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),yt.querySelectorAll(".ggb_preview img")[1]!==void 0&&(yt.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(yt.style.transform="none",yt.style.webkitTransform="none")}function Le(yt,Oe,at,Ct,ot,We){var Tt=null;if(We!=null&&We!="")for(var dt=yt.parentNode;dt!=null;)if((" "+dt.className+" ").indexOf(" "+We+" ")>-1){Tt=dt;break}else dt=dt.parentNode;var kt=0,De=0,ne=0,te=0,de=0,se=0,pe=0;if(Tt)kt=Tt.offsetWidth,De=Math.max(Ct?Tt.offsetWidth:0,Tt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(kt=Math.min(window.innerWidth,document.documentElement.clientWidth),De=Math.min(window.innerHeight,document.documentElement.clientHeight),ne=kt):(kt=window.innerWidth,De=window.innerHeight,ne=window.innerWidth),yt){var ye=yt.getBoundingClientRect();ye.left>0&&ye.left<=kt&&(ot===void 0||!ot)&&(document.dir==="rtl"?(de=kt-ye.width-ye.left,se=ne<=480?10:30):(se=ye.left,de=ne<=480?10:30),te=se+de)}if(yt&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var we=yt.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(te=40,pe=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(te=0,pe=40)}}return yt&&((at===void 0||!at)&&Oe>0&&Oe+te<kt?kt=Oe:kt-=te,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(at===void 0||!at)&&(De-=pe)),{width:kt,height:De}}function le(yt,Oe,at,Ct,ot){if(yt.isScreenshoGenerator)return 1;var We=Ct!==void 0&&Ct,Tt=yt.noScaleMargin!=null&&yt.noScaleMargin,dt=function(we){return we&&we!=="false"},kt=dt(yt.autoHeight),De=Le(Oe,yt.width,at,kt,We&&window.GGBT_wsf_view||Tt,ot),ne=parseInt(De.width),te=yt.width,de=yt.height;if(te===void 0){var se=Oe.querySelector(".appletParameters");se&&(te=se.offsetWidth,de=se.offsetHeight)}var pe=ne/te,ye=We?1:De.height/de;return at!==void 0&&!at&&(pe=Math.min(1,pe),ye=Math.min(1,ye)),Math.min(pe,ye)}function Ue(yt,Oe,at){var Ct=1,ot,We=!1;if(yt.hasOwnProperty("allowUpscale")&&(We=yt.allowUpscale),yt.hasOwnProperty("scale")&&(Ct=parseFloat(yt.scale),(isNaN(Ct)||Ct===null||Ct===0)&&(Ct=1),Ct>1&&(We=!0)),Oe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(We=!0),!(yt.hasOwnProperty("disableAutoScale")&&yt.disableAutoScale))ot=le(yt,Oe,We,at,yt.scaleContainerClass);else return Ct;return We&&(!yt.hasOwnProperty("scale")||Ct===1)?ot:Math.min(Ct,ot)}function pt(yt){var Oe=Math.min(window.innerWidth,document.documentElement.clientWidth),at=Math.min(window.innerHeight,document.documentElement.clientHeight),Ct=yt.getBoundingClientRect(),ot=(Oe-Ct.width)/2,We=(at-Ct.height)/2;We<0&&(We=0),yt.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ot<40?yt.style.left="40px":yt.style.left=ot+"px",yt.style.top=We+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(We<40?yt.style.top="40px":yt.style.top=We+"px",yt.style.left=ot+"px")}function St(yt,Oe){var at=yt.querySelector(".appletParameters");if(at){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Oe.id!==at.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(yt)}if(at.parentElement&&/fullscreen/.test(at.parentElement.className))return;var Ct=Ue(Oe,yt);Zn()&&at.setAttribute("data-param-scale",Ct);for(var ot=null,We=0;We<yt.childNodes.length;We++)if(yt.childNodes[We].className!==void 0&&yt.childNodes[We].className.match(/^applet_scaler/)){ot=yt.childNodes[We];break}if(ot!==null&&ot.querySelector(".noscale")!==null)return;var Tt=Oe.id!==void 0?Oe.id:"ggbApplet",dt=window[Tt];(dt==null||!dt.recalculateEnvironments)&&ot!==null&&!ot.className.match(/fullscreen/)&&(ot.parentNode.style.transform="",!isNaN(Ct)&&Ct!==1?(ot.parentNode.style.width=Oe.width*Ct+"px",ot.parentNode.style.height=Oe.height*Ct+"px",ei(ot,Ct)):(ei(ot,1),ot.parentNode.style.width=Oe.width+"px",ot.parentNode.style.height=Oe.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&pt(yt),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(at).parents(".content-added-content"))}}return{responsiveResize:St,isFlexibleWorksheetEditor:Zn,positionCenter:pt,getScale:Ue,scaleElement:ei}}();__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 Zn=n.location.search;return Zn.indexOf(J)!=-1||Zn.indexOf(K)!=-1}function q(Zn,ei){}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(Zn){var ei=s[L].bindings;s[L].bindings=function(){for(var Le=ei?ei():{},le=Zn[webModule.__softPermutationId],Ue=O;Ue<le.length;Ue++){var pt=le[Ue];Le[pt[O]]=pt[P]}return Le}};var t;function u(){return v(),t}function v(){if(!t){var Zn=o.createElement(Q);if(Zn.id=L,Zn.style.cssText=R+S,Zn.tabIndex=-1,o.body.appendChild(Zn),t=Zn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var ei=document.compatMode==U?V:W;t.write(ei+X),t.close()}}}function w(Zn){function ei(le){function Ue(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var pt=Ue();if(pt){le();return}function St(){if(!pt){if(!Ue())return;pt=!0,le(),o.removeEventListener&&o.removeEventListener(Z,St,!1),yt&&clearInterval(yt)}}o.addEventListener&&o.addEventListener(Z,St,!1);var yt=setInterval(function(){St()},$)}function Le(le){var Ue=u(),pt=Ue.body,St=Ue.createElement(_);St.language=ab,St.crossOrigin=W,St.src=le,webModule.__errFn&&(St.onerror=function(){webModule.__errFn(L,new Error(bb+le))}),pt.appendChild(St)}ei(function(){Le(Zn)})}webModule.__startLoadingFragment=function(Zn){return C(Zn)},webModule.__installRunAsyncCode=function(Zn){var ei=u(),Le=ei.body,le=ei.createElement(_);le.language=ab,le.text=Zn,Le.appendChild(le),Le.removeChild(le)};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(Zn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Zn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Zn){var ei=c[Zn];return ei==null?null:ei},r=d,webModule.__errFn=e}function B(){function Zn(yt){var Oe=yt.lastIndexOf(rb);Oe==-1&&(Oe=yt.length);var at=yt.indexOf(sb);at==-1&&(at=yt.length);var Ct=yt.lastIndexOf(tb,Math.min(at,Oe));return Ct>=O?yt.substring(O,Ct+P):W}function ei(yt){if(!yt.match(/^\w+:\/\//)){var Oe=o.createElement(ub);Oe.src=yt+vb,yt=Zn(Oe.src)}return yt}function Le(){var yt=__gwt_getMetaProperty(wb);return yt!=null?yt:W}function le(){for(var yt=o.getElementsByTagName(_),Oe=O;Oe<yt.length;++Oe)if(yt[Oe].src.indexOf(xb)!=-1)return Zn(yt[Oe].src);return W}function Ue(){var yt=o.getElementsByTagName(yb);return yt.length>O?yt[yt.length-P].href:W}function pt(){var yt=o.location;return yt.href==yt.protocol+zb+yt.host+yt.pathname+yt.search+yt.hash}var St=Le();return St==W&&(St=le()),St==W&&(St=Ue()),St==W&&pt()&&(St=Zn(o.location.href)),St=ei(St),St}function C(Zn){return Zn.match(/^\//)||Zn.match(/^[a-zA-Z]+:\/\//)?Zn:webModule.__moduleBase+Zn}function D(){var Zn=[],ei=O,Le=[],le=[];function Ue(yt){var Oe=le[yt](),at=Le[yt];if(Oe in at)return Oe;var Ct=[];for(var ot in at)Ct[at[ot]]=ot;throw r&&r(yt,Ct,Oe),null}if(__gwt_isKnownPropertyValue=function(yt,Oe){return Oe in Le[yt]},webModule.__getPropMap=function(){var yt={};for(var Oe in Le)Le.hasOwnProperty(Oe)&&(yt[Oe]=Ue(Oe));return yt},webModule.__computePropValue=Ue,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var pt;try{pt=Cb;var St=pt.indexOf(Db);St!=-1&&(ei=parseInt(pt.substring(St+P),$),pt=pt.substring(O,St))}catch(yt){}return webModule.__softPermutationId=ei,C(pt+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})()},46699:function(Zn,ei,Le){"use strict";Le.d(ei,{Ax:function(){return St},Ds:function(){return yt},KI:function(){return at},SI:function(){return pt},f1:function(){return Ue}});var le=Le(346);function Ue(Ct){let ot=!0;if(Ct.length>0){for(let We=0;We<Ct.length;We++)if(Ct[We].compile_success==0||!Ct[We].compile_success){ot=!1;break}}else ot=!1;return ot}function pt(Ct,ot=""){let We=[];for(let Tt=0;Tt<Ct.length;Tt++){let dt=Ct[Tt],kt=ot?`${ot}/${dt.name}`:`${dt.name}`;We.push({title:dt.name,type:dt.type,isLeaf:dt.type!=="tree",key:kt})}return We}function St(Ct,ot,We){for(let Tt=0;Tt<Ct.length;Tt++){let dt=Ct[Tt];if(dt.key===ot){dt.children=We;break}dt.children&&St(dt.children,ot,We)}return Ct}function yt(Ct,ot,We){let Tt;return function(){let dt=this,kt=arguments,De=function(){Tt=null,We||Ct.apply(dt,kt)},ne=We&&!Tt;clearTimeout(Tt),Tt=setTimeout(De,ot),ne&&Ct.apply(dt,kt)}}const Oe=!0,at=le.Z.API_SERVER},84842:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return De}});var le=Le(99571),Ue=Le(59301),pt=Object.defineProperty,St=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,ot=(ne,te,de)=>te in ne?pt(ne,te,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[te]=de,We=(ne,te)=>{for(var de in te||(te={}))at.call(te,de)&&ot(ne,de,te[de]);if(Oe)for(var de of Oe(te))Ct.call(te,de)&&ot(ne,de,te[de]);return ne},Tt=(ne,te)=>St(ne,yt(te)),dt=(ne,te)=>{var de={};for(var se in ne)at.call(ne,se)&&te.indexOf(se)<0&&(de[se]=ne[se]);if(ne!=null&&Oe)for(var se of Oe(ne))te.indexOf(se)<0&&Ct.call(ne,se)&&(de[se]=ne[se]);return de},kt=(ne,te,de)=>new Promise((se,pe)=>{var ye=_e=>{try{Ce(de.next(_e))}catch(Ze){pe(Ze)}},we=_e=>{try{Ce(de.throw(_e))}catch(Ze){pe(Ze)}},Ce=_e=>_e.done?se(_e.value):Promise.resolve(_e.value).then(ye,we);Ce((de=de.apply(ne,te)).next())});const De=ne=>{var te=ne,{children:de}=te,se=dt(te,["children"]);const[pe,ye]=(0,Ue.useState)(!1);return Ue.createElement(le.ZP,Tt(We({},se),{loading:pe,onClick:we=>kt(void 0,null,function*(){try{ye(!0),yield se.onClick(we),ye(!1)}catch(Ce){console.error(Ce),ye(!1)}})}),de)}},54650:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return kt}});var le=Le(59301),Ue=Le(6767),pt=Le(37568),St={codeBox:"codeBox___WpkVl"},yt=Le(92310),Oe=Le.n(yt),at=Object.defineProperty,Ct=(De,ne,te)=>ne in De?at(De,ne,{enumerable:!0,configurable:!0,writable:!0,value:te}):De[ne]=te,ot=(De,ne,te)=>Ct(De,typeof ne!="symbol"?ne+"":ne,te),We=(De,ne,te)=>new Promise((de,se)=>{var pe=Ce=>{try{we(te.next(Ce))}catch(_e){se(_e)}},ye=Ce=>{try{we(te.throw(Ce))}catch(_e){se(_e)}},we=Ce=>Ce.done?de(Ce.value):Promise.resolve(Ce.value).then(pe,ye);we((te=te.apply(De,ne)).next())});class Tt extends le.Component{constructor(ne){super(ne),ot(this,"canvas"),ot(this,"randomNum",(te,de)=>Math.floor(Math.random()*(de-te)+te)),ot(this,"drawPic",()=>{this.randomCode()}),ot(this,"reloadPic",()=>{this.drawPic()}),ot(this,"changeCode",te=>{console.log(te.target.value,222),this.setState({value:te.target.value,showError:!1})}),ot(this,"onVerify",()=>{let te;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(te=!0,Ue.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(te=!0,Ue.ZP.error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):this.state.value.toLowerCase()===this.state.code.toLowerCase()&&(te=!1),this.setState({showError:te}),te}),this.canvas=le.createRef(),this.state={value:"",code:"",codeLength:4,fontSizeMin:20,fontSizeMax:22,backgroundColorMin:240,backgroundColorMax:250,colorMin:10,colorMax:20,lineColorMin:40,lineColorMax:180,contentWidth:96,contentHeight:38,showError:!1}}componentDidMount(){this.drawPic()}randomColor(ne,te){const de=this.randomNum(ne,te),se=this.randomNum(ne,te),pe=this.randomNum(ne,te);return`rgb(${de}, ${se}, ${pe})`}drawText(ne,te,de){ne.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);const se=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);ne.font=se+"px SimHei";const pe=10,ye=(this.state.contentWidth-40)/(this.state.code.length-1);let we=pe;de>0&&(we=pe+de*ye);let Ce=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);se>40&&(Ce=40);const _e=this.randomNum(-10,10);ne.translate(we,Ce),ne.rotate(_e*Math.PI/180),ne.fillText(te,0,0),ne.rotate(-_e*Math.PI/180),ne.translate(-we,-Ce)}drawLine(ne){for(let te=0;te<1;te++)ne.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),ne.beginPath(),ne.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),ne.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),ne.stroke()}drawDot(ne){for(let te=0;te<100;te++)ne.fillStyle=this.randomColor(0,255),ne.beginPath(),ne.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),ne.fill()}randomCode(){let ne="";const te="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";for(let de=0;de<this.state.codeLength;de++){const se=Math.floor(Math.random()*57);ne+=te[se]}this.setState({code:ne},()=>{const se=this.canvas.current.getContext("2d");se.textBaseline="bottom",se.fillStyle=this.randomColor(this.state.backgroundColorMin,this.state.backgroundColorMax),se.fillRect(0,0,this.state.contentWidth,this.state.contentHeight);for(let pe=0;pe<this.state.code.length;pe++)this.drawText(se,this.state.code[pe],pe);this.drawLine(se),this.drawDot(se)})}render(){const{className:ne,width:te=300}=this.props;return le.createElement("div",{className:Oe()(St.codeBox,ne),style:{width:te}},le.createElement("aside",null,le.createElement(pt.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),le.createElement("div",null,le.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),le.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const dt=(De,ne)=>{let te;Modal.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:React.createElement("div",null,React.createElement("p",null,ne),React.createElement(Tt,{ref:de=>te=de})),onOk:()=>We(void 0,null,function*(){if(te.onVerify())return Promise.reject();De()})})};var kt=Tt},30371:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ot}});var le=Le(59301),Ue=Le(37568),pt=Le(96599),St=Le(6767),yt={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},Oe=Le(62772);const{TextArea:at}=Ue.default;class Ct extends le.Component{constructor(Tt){super(Tt),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Tt,onAnswerChange:dt,addChildAnswer:kt,exerciseIsPublish:De,answers:ne,activeOptionErrorIndex:te,flex:de="0 0 1000px"}=this.props;console.log("----",ne);let{inputVisible:se,EditInputIndex:pe}=this.state;return le.createElement("div",{className:yt.flex},le.createElement("div",{className:`${yt.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Tt+1,"):"),le.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},ne==null?void 0:ne.map((ye,we)=>le.createElement(le.Fragment,null,pe!==we?(ye==null?void 0:ye.length)>0?le.createElement(pt.default,{className:"edit-tag",key:ye,closable:!((ne==null?void 0:ne.length)===1&&we===0),onClose:Ce=>{Ce.preventDefault(),(ne==null?void 0:ne.length)===1&&we===0?this.props.deleteChildAnswermain(Tt,we):this.props.deleteChildAnswer(Tt,we)}},le.createElement("span",{onDoubleClick:Ce=>{this.setState({EditInputIndex:we}),Ce.preventDefault()}},ye)):le.createElement(Ue.default,{defaultValue:ye,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Ce=>{if(Ce.target.value.replaceAll(" ","").length<=0){St.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}dt(Tt,we,Ce.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):le.createElement(Ue.default,{defaultValue:ye,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Ce=>{if(Ce.target.value.replaceAll(" ","").length<=0){St.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}dt(Tt,we,Ce.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!se&&le.createElement(pt.default,{className:"site-tag-plus",onClick:()=>{kt(Tt),this.setState({inputVisible:!0})}},le.createElement(Oe.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var ot=Ct},61011:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return De}});var le=Le(59301),Ue=Le(39793),pt=Object.defineProperty,St=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,ot=(ne,te,de)=>te in ne?pt(ne,te,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[te]=de,We=(ne,te)=>{for(var de in te||(te={}))at.call(te,de)&&ot(ne,de,te[de]);if(Oe)for(var de of Oe(te))Ct.call(te,de)&&ot(ne,de,te[de]);return ne},Tt=(ne,te)=>St(ne,yt(te)),dt=(ne,te,de)=>ot(ne,typeof te!="symbol"?te+"":te,de);const kt="\u2581";class De extends le.Component{constructor(){super(...arguments),dt(this,"getChCountBeforeCursor",(te,de)=>{const se=de.line;let pe=0;for(let we=0;we<se;we++)pe+=te.getLine(we).split(kt).length-1;const ye=te.getLine(se).substring(0,de.ch);return pe+=ye.split(kt).length-1,pe}),dt(this,"onCMBeforeChange",(te,de)=>{const se=te.getRange(de.from,de.to);let pe=0;if(de.text.forEach(ye=>{pe+=ye.split(kt).length-1}),se&&se.indexOf(kt)!=-1){const ye=se.split(kt).length-1,we=this.getChCountBeforeCursor(te,de.from);console.log(`\u5220\u9664${ye}\u4E2A\uFF0C \u4E4B\u524D\u6709${we}\u4E2A\uFF0C\u65B0\u589E${pe}\u4E2A`),this.props.deleteEmptyDisabled?de.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(we,ye,pe)}else if(pe){const ye=this.getChCountBeforeCursor(te,de.from);console.log(`\u65B0\u589E${pe}\u4E2A\uFF0C\u4E4B\u524D\u6709${ye}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(ye,0,pe)}})}render(){return le.createElement(Ue.Z,Tt(We({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},81868:function(Zn,ei,Le){"use strict";Le.d(ei,{d4:function(){return kt},VP:function(){return ot}});var le=Le(59301),Ue={digitalLabel:"digitalLabel___hkWuZ",active:"active___jawU1",titleEditor:"titleEditor___wX1lW",title:"title___SuT2h",editIcon:"editIcon___XrTIi",paperTab:"paperTab___GUxeB",tabItem:"tabItem___or0fY",dottedLine:"dottedLine___Ln0Xr"};const pt=({number:De,active:ne,className:te})=>le.createElement("div",{className:`${Ue.digitalLabel} ${ne?Ue.active:""} ${te}`},De);var St=Le(25399),yt=Le(37568),Oe=Le(6767),at=Le(59301),Ct=(De,ne,te)=>new Promise((de,se)=>{var pe=Ce=>{try{we(te.next(Ce))}catch(_e){se(_e)}},ye=Ce=>{try{we(te.throw(Ce))}catch(_e){se(_e)}},we=Ce=>Ce.done?de(Ce.value):Promise.resolve(Ce.value).then(pe,ye);we((te=te.apply(De,ne)).next())});const ot=({defaultValue:De,onFinish:ne})=>{const[te,de]=(0,le.useState)(!1),[se,pe]=(0,le.useState)(De);return(0,le.useEffect)(()=>{pe(De)},[De]),at.createElement("div",{className:Ue.titleEditor},te?at.createElement(yt.default,{autoFocus:!0,maxLength:60,style:{textAlign:"center",marginTop:20,marginBottom:20},value:se,onChange:ye=>{pe(ye.target.value)},onBlur:()=>Ct(void 0,null,function*(){var ye;if(((ye=se==null?void 0:se.replaceAll(" ",""))==null?void 0:ye.length)<=0){Oe.ZP.error("\u8BD5\u5377\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");return}(yield ne(se))&&de(!1)}),onPressEnter:()=>Ct(void 0,null,function*(){var ye;if(((ye=se==null?void 0:se.replaceAll(" ",""))==null?void 0:ye.length)<=0){Oe.ZP.error("\u8BD5\u5377\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");return}(yield ne(se))&&de(!1)})}):at.createElement("div",{className:Ue.title,onDoubleClick:()=>de(!0)},se,at.createElement(St.Z,{title:"\u7F16\u8F91\u8BD5\u5377\u540D\u79F0"},at.createElement("i",{className:`${Ue.editIcon} iconfont icon-bianji_Hover`,onClick:()=>de(!0)}))))};var We=Le(77019),Tt=Le(5269),dt=(De,ne,te)=>new Promise((de,se)=>{var pe=Ce=>{try{we(te.next(Ce))}catch(_e){se(_e)}},ye=Ce=>{try{we(te.throw(Ce))}catch(_e){se(_e)}},we=Ce=>Ce.done?de(Ce.value):Promise.resolve(Ce.value).then(pe,ye);we((te=te.apply(De,ne)).next())});const kt=({onChange:De=()=>dt(void 0,null,function*(){}),tabs:ne,activeKey:te,defaultActiveKey:de,className:se=""})=>{var pe,ye,we,Ce,_e,Ze,st;const[nt,Ye]=(0,le.useState)(de===void 0?(pe=ne[0])==null?void 0:pe.key:de);return(0,le.useEffect)(()=>{te!==void 0&&Ye(te)},[te]),le.createElement(We.Z,{justify:"center",align:"middle",className:`${Ue.paperTab} ${se}`},le.createElement(Tt.Z,{className:`${Ue.tabItem} ${nt===((ye=ne[0])==null?void 0:ye.key)?Ue.active:""}`,onClick:()=>dt(void 0,null,function*(){var ct;yield De(ne[0].key),Ye((ct=ne[0])==null?void 0:ct.key)})},le.createElement(pt,{number:1,active:nt===((we=ne[0])==null?void 0:we.key),className:"mr10"}),le.createElement("span",null,(Ce=ne[0])==null?void 0:Ce.label)),le.createElement(Tt.Z,{flex:"188px",className:`${Ue.dottedLine} ml30 mr30`}),le.createElement(Tt.Z,{className:`${Ue.tabItem} ${nt===((_e=ne[1])==null?void 0:_e.key)?Ue.active:""}`,onClick:()=>dt(void 0,null,function*(){var ct,$e;yield De((ct=ne[1])==null?void 0:ct.key),Ye(($e=ne[1])==null?void 0:$e.key)})},le.createElement(pt,{number:2,active:nt===((Ze=ne[1])==null?void 0:Ze.key),className:"mr10"}),le.createElement("span",null,(st=ne[1])==null?void 0:st.label)))}},94361:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Oe}});var le=Le(37639),Ue={text:"text___FxbAX",wrap:"wrap___UlBQ1",contact:"contact____pUDq",img:"img___BapAv"},pt=Le(32637),St=Le(59301),Oe=({type:at,style:Ct})=>{const ot=St.createElement("div",{className:Ue.wrap,onClick:We=>{We.preventDefault(),We.stopPropagation()}},St.createElement("p",null,at==="shixun"||at==="paths"?"\u5F53\u524D\u5B9E\u8DF5\u9879\u76EE\u662F\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002":"\u5F53\u524D\u8BD5\u5377\u5305\u542B\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002",St.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002",at==="paths"?"\u53D1\u9001\u5230\u8BFE\u5802":"\u53D1\u5E03","\u4F7F\u7528\u4E4B\u524D\uFF0C\u8BF7\u5148\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u83B7\u53D6\u6388\u6743\u7801\u3002"),St.createElement("div",{className:Ue.contact},St.createElement("div",{className:Ue.img},St.createElement("img",{src:pt,width:"124px",height:"124px"})),St.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")));return St.createElement(le.Z,{content:ot},St.createElement("span",{className:Ue.text,style:Ct},"\u9AD8\u6D88\u8017"))}},9507:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Tt}});var le=Le(59301),Ue={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},pt=Le(92310),St=Le.n(pt),yt=Le(29787),Oe=Le(2859),at=Le(38986),Ct=Le(51257),ot=(dt,kt,De)=>new Promise((ne,te)=>{var de=ye=>{try{pe(De.next(ye))}catch(we){te(we)}},se=ye=>{try{pe(De.throw(ye))}catch(we){te(we)}},pe=ye=>ye.done?ne(ye.value):Promise.resolve(ye.value).then(de,se);pe((De=De.apply(dt,kt)).next())}),Tt=({data:dt,className:kt,fullWidth:De,style:ne={},onClose:te,onOk:de,showFullTools:se,noAssociationId:pe})=>{const ye=(0,le.useRef)(null),we=(0,le.useRef)(null),Ce=(0,le.useRef)(null),_e=(0,le.useRef)(null),[Ze,st]=(0,le.useState)(!1),[nt,Ye]=(0,le.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,le.useEffect)(()=>(Ce.current||(Ce.current=document.createElement("style"),document.head.appendChild(Ce.current)),dt!=null&&dt.visible?(document.body.setAttribute("data-custom","y-hidden"),Ce.current.innerHTML=" html { overflow-y: hidden; }",dt!=null&&dt.src&&ct()):(document.body.removeAttribute("data-custom"),Ce.current&&(document.head.removeChild(Ce.current),Ce.current=null)),()=>{document.body.removeAttribute("data-custom"),Ce.current&&(document.head.removeChild(Ce.current),Ce.current=null)}),[dt==null?void 0:dt.visible]);const ct=()=>ot(void 0,null,function*(){st(!0),Ye("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Bt=yield(0,Ct.ZJ)(dt==null?void 0:dt.src);ye.current.src="",ye.current.src=Bt,ye.current.onload=function(){Pt()},st(!1),Ye("")}),$e=Bt=>ot(void 0,null,function*(){st(!0),Ye("\u6B63\u5728\u4FDD\u5B58\u4E2D");const fn=yield(0,at.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:dt.title,file:Bt.dataUrl}});fn!=null&&fn.id&&!pe?(yield(0,at.ZP)(`/api/attachments/${dt.id}/add_subitem.json`,{method:"post",body:{subitem_id:fn==null?void 0:fn.id,settings:JSON.stringify(Bt.state)}})).status===0&&de():fn!=null&&fn.id&&de(fn),st(!1),Ye("")}),Et=()=>{const Bt=document.querySelector('a[href="https://markerjs.com/"]');Bt&&Bt.parentNode&&(Bt.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(qt=>{const vn=document.querySelector(qt.name);vn&&vn.setAttribute("title",qt.title)})},Pt=()=>{we.current=new Oe.hP(ye.current),we.current.targetRoot=_e.current,we.current.addEventListener("render",$e),we.current.addEventListener("beforeclose",te),se&&(we.current.availableMarkerTypes=we.current.ALL_MARKER_TYPES,we.current.uiStyleSettings.redoButtonVisible=!0,we.current.uiStyleSettings.notesButtonVisible=!0,we.current.uiStyleSettings.zoomButtonVisible=!0,we.current.uiStyleSettings.zoomOutButtonVisible=!0,we.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=we.current.uiStyleSettings,we.current.show(),dt!=null&&dt.snapshotData&&we.current.restoreState(dt.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Et()},300)};return le.createElement(le.Fragment,null,(dt==null?void 0:dt.visible)&&le.createElement(yt.Z,{spinning:Ze,tip:nt,style:{position:"absolute",width:"100vw"}},le.createElement("div",{ref:_e,className:St()(Ue.imageDimensions,kt,De?Ue.fullWidth:""),style:ne},le.createElement("img",{className:Ue.img,ref:ye}))))}},19105:function(Zn,ei,Le){"use strict";var le=Le(59301),Ue=Le(99587),pt=Le(48136),St=Le(76562),yt=Le(62957),Oe=Le(59301);const at=(0,le.forwardRef)(({callback:Ct,width:ot,onChange:We,disabled:Tt,readOnly:dt,type:kt="",value:De="",style:ne={}},te)=>{const de=(0,le.useRef)(),se=(0,le.useRef)(),[pe,ye]=(0,le.useState)(0),[we,Ce]=(0,le.useState)(0),[_e,Ze]=(0,le.useState)(!1),st=()=>{var $e=document.createElement("div");$e.innerHTML=de.current.getValue();var Et=$e.innerText;return Ct&&Ct(Et),Et};(0,le.useImperativeHandle)(te,()=>({getData:st}));const nt=$e=>{$e.preventDefault();const Et=$e.clientX-pe,Pt=$e.clientY-we;document.body.onmousemove=Bt=>{let fn=Bt.clientX-Et,qt=Bt.clientY-Pt;const vn=document.getElementsByClassName("markdown-popup-form")[0],tn=window.innerWidth-vn.offsetWidth,it=window.innerHeight-vn.offsetHeight;fn=Math.max(0,Math.min(fn,tn)),qt=Math.max(0,Math.min(qt,it)),Ye(Bt.clientX,Bt.clientY,Et,Pt)&&(ye(fn),Ce(qt))},document.body.onmouseup=function(){document.body.onmousemove=null}},Ye=($e,Et,Pt,Bt)=>{const fn=document.body.clientHeight,qt=document.body.clientWidth;return $e<20&&Pt>$e||$e>qt-20&&Pt<$e||Et<20&&Bt>Et||Et>fn-20&&Bt<Et?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,le.useEffect)(()=>{_e&&setTimeout(()=>{const $e=document.getElementsByClassName("markdown-popup-form")[0],Et=window.innerWidth/2-$e.offsetWidth/2,Pt=window.innerHeight/2-$e.offsetHeight/2;ye(Et),Ce(Pt)},0)},[_e]);const ct=()=>{Tt||dt||Ze(!0)};return Oe.createElement("div",{style:ne},Oe.createElement("div",{style:{width:ot||"100%",position:"relative"},className:`${Ue.Z.mathFillWrap} ${Tt||dt?"cursorDefault":""}`,onClick:()=>ct()},Oe.createElement("math-field",{disabled:Tt,locale:"zh_cn",class:`${Ue.Z.mathField} ${kt}`,readOnly:dt,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:de,style:{width:"100%",fontSize:De?18:14},value:De||""})),Oe.createElement(yt.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:pe,top:we},title:Oe.createElement("div",{style:{cursor:"move"},onMouseDown:nt},"\u8F93\u5165\u516C\u5F0F"),open:_e,onOk:()=>{const $e=se.current.getData();de.current.setValue($e),We($e),Ze(!1)},onCancel:()=>{Ze(!1)},destroyOnClose:!0,className:"markdown-popup-form"},Oe.createElement(St.Z,{value:De,ref:se,onChange:We,showSaveButton:!1})))});ei.Z=at},76562:function(Zn,ei,Le){"use strict";var le=Le(59301),Ue=Le(77019),pt=Le(5269),St=Le(20554),yt=Le(99571),Oe=Le(76902),at=Le(99587),Ct=Le(48136),ot=Le(59301);const We=(0,le.forwardRef)(({callback:Tt,showSaveButton:dt,value:kt=""},De)=>{const ne=(0,le.useRef)(),te=[{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 "}]}]}],de=[{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}`}]}]}],se=we=>{ne.current.setValue(ne.current.getValue()+" "+we.value+" ")},pe=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ot.createElement(Ue.Z,{className:at.Z.lists,gutter:[10,10]},te.map((we,Ce)=>ot.createElement(pt.Z,{flex:"110px",className:at.Z.item},ot.createElement("div",null,ot.createElement(Oe.Z,{value:`$$${we.value}$$`}),we.name),ot.createElement("div",{className:at.Z.children},we.children.map((_e,Ze)=>ot.createElement("div",{key:Ze},ot.createElement("h1",null,_e.name),ot.createElement(Ue.Z,{gutter:[10,10]},_e.data.map((st,nt)=>ot.createElement(pt.Z,{key:nt,onClick:()=>se(st),className:at.Z.diamond},ot.createElement(Oe.Z,{value:"`$$"+st.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ot.createElement(Ue.Z,{className:at.Z.lists,gutter:[10,10]},de.map((we,Ce)=>ot.createElement(pt.Z,{flex:"110px",className:at.Z.item},ot.createElement("div",null,ot.createElement(Oe.Z,{value:"`$$"+we.value+"$$`"}),we.name),ot.createElement("div",{className:at.Z.children},we.children.map((_e,Ze)=>ot.createElement("div",{key:Ze},_e.name&&ot.createElement("h1",null,_e.name),ot.createElement(Ue.Z,{gutter:[10,10]},_e.data.map((st,nt)=>ot.createElement(pt.Z,{key:nt,onClick:()=>se(st),className:at.Z.diamond},ot.createElement(Oe.Z,{value:"`$$"+st.value+"$$`"}))))))))))}],ye=()=>{var we=document.createElement("div");we.innerHTML=ne.current.getValue();var Ce=we.innerText;return Tt&&Tt(Ce),Ce};return(0,le.useImperativeHandle)(De,()=>({getData:ye})),ot.createElement("div",{className:at.Z.mathWrap},ot.createElement(St.default,{defaultActiveKey:"1",items:pe}),ot.createElement("math-field",{locale:"zh_cn",className:at.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:ne,style:{width:800,marginTop:30,fontSize:18}},kt||""),dt&&ot.createElement("div",{className:at.Z.button},ot.createElement(yt.ZP,{size:"large",onClick:ye,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});ei.Z=We},28426:function(Zn,ei,Le){"use strict";var le=Le(59301),Ue=Le(93314),pt=Le(99571),St=Object.defineProperty,yt=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,We=(De,ne,te)=>ne in De?St(De,ne,{enumerable:!0,configurable:!0,writable:!0,value:te}):De[ne]=te,Tt=(De,ne)=>{for(var te in ne||(ne={}))Ct.call(ne,te)&&We(De,te,ne[te]);if(at)for(var te of at(ne))ot.call(ne,te)&&We(De,te,ne[te]);return De},dt=(De,ne)=>yt(De,Oe(ne));const kt=({img:De,buttonProps:ne={},styles:te={},customText:de,ButtonText:se,ButtonClick:pe,Buttonclass:ye,ButtonTwo:we,imgStyles:Ce,loading:_e=!1,className:Ze=""})=>le.createElement("section",{className:`tc animated fadeIn ${Ze}`,style:Tt({color:"#999",margin:"100px auto",visibility:_e?"hidden":"visible"},te)},le.createElement("img",{src:De||Ue,style:dt(Tt({},Ce),{pointerEvents:"none",userSelect:"none"})}),le.createElement("p",{className:"mt20 font14"},de||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),se&&le.createElement(pt.ZP,Tt({className:ye,onClick:pe},ne),se),we&&we);ei.Z=kt},45677:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(59301),Ue={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},pt=Le(99571),St=Le(70557),yt=Le(75975),Oe=Le(25399),at=Le(51257),Ct=Le(81722),ot=Le(28426),We=Le(346),Tt=Le(44203),dt=Le(59301),kt=Object.defineProperty,De=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(we,Ce,_e)=>Ce in we?kt(we,Ce,{enumerable:!0,configurable:!0,writable:!0,value:_e}):we[Ce]=_e,se=(we,Ce)=>{for(var _e in Ce||(Ce={}))ne.call(Ce,_e)&&de(we,_e,Ce[_e]);if(De)for(var _e of De(Ce))te.call(Ce,_e)&&de(we,_e,Ce[_e]);return we},pe=(we,Ce,_e)=>new Promise((Ze,st)=>{var nt=$e=>{try{ct(_e.next($e))}catch(Et){st(Et)}},Ye=$e=>{try{ct(_e.throw($e))}catch(Et){st(Et)}},ct=$e=>$e.done?Ze($e.value):Promise.resolve($e.value).then(nt,Ye);ct((_e=_e.apply(we,Ce)).next())}),ye=({editOffice:we="view",data:Ce,issaver:_e,onSaver:Ze,theme:st,type:nt,filename:Ye,monacoEditor:ct,className:$e,style:Et,close:Pt,onClose:Bt,hasMask:fn,disabledDownload:qt,onImgDimensions:vn,showNodata:tn,recordInfo:it})=>{const[rt,dn]=(0,le.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[ni,Kn]=(0,le.useState)(""),[Rt,En]=(0,le.useState)(),Bn=window.ENV==="build"?"/react/build":"",ui=location.host.startsWith("localhost")?We.Z.PROXY_SERVER:We.Z.API_SERVER,On=10*(1024*1024),ht=(0,le.useRef)();Ce!=null&&Ce.startsWith("/api")&&nt!=="txt"&&(Ce=We.Z.API_SERVER+Ce);const kn=Te=>Te.substring(Te.lastIndexOf("/")+1).split(".").pop();Ye&&ct&&(ct.filename=Ye),(0,le.useEffect)(()=>{var Te,He;const Ae=(He=(Te=document.cookie)==null?void 0:Te.replace(/\s/g,""))==null?void 0:He.split(";");Ae==null||Ae.map(et=>{let on=et.split("=");on[0]==="_educoder_session"&&Kn(on[1])})},[]),(0,le.useEffect)(()=>{nt==="office"&&(Ce.indexOf("bigfilescdn.")>-1||Ce.indexOf("bigfiles1")>-1?En({url:Ce,fileType:kn(Ce),model:Ce.indexOf("model=edit")?"edit":"view"}):ze())},[nt,Ce]);function Oi(Te){return pe(this,null,function*(){Te.data.type==="pdfdata"&&(Ze(Te.data.data),window.removeEventListener("message",Oi,!1)),console.log("mess---:",Te.data)})}const ze=()=>pe(void 0,null,function*(){console.log("data:",Ce);let Te=Ce;Ce.startsWith("http")||(Te=location.origin+Te);let He=new URL(Te).pathname.split("/").pop();const Ae=yield(0,Ct.gJ)({attachment_id:He});Ae.url=ui+Ae.url,En(Ae)}),Me=()=>{if(Ce.startsWith("http")||Ce.startsWith("blob:")){Ee();return}(0,at.Sv)(Ye||"educoder",Ce,Ye)},Ee=()=>{it&&(0,Tt.fc)({id:it==null?void 0:it.id,watch_type:1,course_id:it==null?void 0:it.course_id}),(0,at.Nd)(Ye||"educoder",decodeURIComponent(Ce))};return dt.createElement("div",{style:se({},Et||{}),className:`${fn&&Ue.bgBlack} ${nt?Ue.wrp:"hide"}`},Pt&&dt.createElement("div",{className:Ue.close,ref:ht},!!vn&&dt.createElement(Oe.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>ht.current},dt.createElement("span",{onClick:()=>{Bt(),vn()}},dt.createElement("i",{className:"icon-yulanpizhu"}))),!qt&&dt.createElement(Oe.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>ht.current},dt.createElement("span",{onClick:Ee},dt.createElement("i",{className:"icon-quxiaozhiding"}))),_e&&dt.createElement(Oe.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>ht.current},dt.createElement("span",{className:"",onClick:()=>{const Te=document.getElementById("pdfiframe");window.addEventListener("message",Oi,!1),setTimeout(()=>{Te.contentWindow.postMessage("getData","*")},300)}},dt.createElement("i",{className:"icon-baocun"}))),dt.createElement(Oe.Z,{title:"\u5173\u95ED",getPopupContainer:()=>ht.current},dt.createElement("span",{className:"",onClick:()=>{Bt()}},dt.createElement("i",{className:"icon-guanbi1"})))),dt.createElement("div",{className:`${Ue[$e]} ${$e} ${Ue.monaco} ${nt==="txt"?"show":"hide"}`},nt==="txt"&&dt.createElement(dt.Fragment,null,dt.createElement(yt.ZP,se({},ct)))),nt==="audio"&&dt.createElement("audio",{src:`${(Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Ce}`,autoPlay:!0}),nt==="video"&&dt.createElement(dt.Fragment,null,(Ce==null?void 0:Ce.indexOf("http"))>-1?dt.createElement("video",{controls:!0,src:`${Ce}`,autoPlay:!0}):dt.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Ce}`,autoPlay:!0})),nt==="office"&&Rt&&dt.createElement("iframe",{src:`${Bn}/office.html?key=${Rt.key}&url=${btoa(Rt.url)}&callbackUrl=${ui+(Rt.callbackUrl||"")}&fileType=${Rt.fileType}&title=${Rt.title||""}&model=${we}&officeServer=${We.Z.ONLYOFFICE}&disabledDownload=${!!qt}`}),nt==="html"&&dt.createElement("iframe",{src:Ce+"&disposition=inline"}),nt==="pdf"&&dt.createElement("iframe",{id:"pdfiframe",src:`${Bn}/js/pdfview/index.html?filename=${Ye||"educoder.pdf"}&url=${encodeURIComponent(Ce)}&disabledDownload=${!!qt}&model=${we}`}),nt==="image"&&dt.createElement("img",{src:`${(Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Ce}`}),(nt==="other"||nt==="download")&&dt.createElement(dt.Fragment,null,tn?dt.createElement(ot.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:dt.createElement(pt.ZP,{icon:dt.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Me,disabled:qt},"\u4E0B\u8F7D")}):dt.createElement(pt.ZP,{type:"primary",size:"middle",onClick:Me,disabled:qt},dt.createElement(St.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},68571:function(Zn,ei,Le){"use strict";Le.d(ei,{t:function(){return Ee}});var le=Le(59301),Ue=Le(37568),pt=Le(28284),St=Le(62957),yt=Le(77019),Oe=Le(5269),at=Le(71051),Ct=Le(82326),ot=Le(47889),We=Le(31457),Tt=Le(25690),dt=Le(8423),kt=Le(6767),De=Le(99571),ne=Le(29787),te=Le(24334),de={flex_box_center:"flex_box_center___kOQ8P",flex_space_between:"flex_space_between___fY6jt",flex_box_vertical_center:"flex_box_vertical_center___bDSSI",flex_box_center_end:"flex_box_center_end___mQ6mU",flex_box_column:"flex_box_column___F15G0",result:"result___UYRo8",left:"left___TRaH5",right:"right___twp9s",box:"box___vwndt",li:"li___hRe2d"},se=Le(38986),pe=Le(81072),ye=Le(39793),we=Le(56102),Ce=Le(37345),_e=Le(59301),Ze=Object.defineProperty,st=Object.defineProperties,nt=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,Et=(Te,He,Ae)=>He in Te?Ze(Te,He,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Te[He]=Ae,Pt=(Te,He)=>{for(var Ae in He||(He={}))ct.call(He,Ae)&&Et(Te,Ae,He[Ae]);if(Ye)for(var Ae of Ye(He))$e.call(He,Ae)&&Et(Te,Ae,He[Ae]);return Te},Bt=(Te,He)=>st(Te,nt(He)),fn=(Te,He,Ae)=>new Promise((et,on)=>{var Kt=Dt=>{try{Nt(Ae.next(Dt))}catch(Ot){on(Ot)}},pn=Dt=>{try{Nt(Ae.throw(Dt))}catch(Ot){on(Ot)}},Nt=Dt=>Dt.done?et(Dt.value):Promise.resolve(Dt.value).then(Kt,pn);Nt((Ae=Ae.apply(Te,He)).next())}),vn=({buttonProps:Te,buttonText:He,form:Ae,hackIdentifier:et="",answerKey:on,data:Kt})=>{const[pn,Nt]=(0,le.useState)(!1),[Dt,Ot]=(0,le.useState)(!1),[un,Sn]=(0,le.useState)(!1),[An,Dn]=(0,le.useState)({}),[Ai,en]=(0,le.useState)(""),[Qt,ln]=(0,le.useState)(""),di=(0,le.useRef)(et),cn=(0,le.useRef)(""),Yt=(0,le.useRef)(!1);(0,le.useEffect)(()=>{un&&Di()},[un]),(0,le.useEffect)(()=>()=>{sessionStorage.removeItem("projectFill")},[]);const ii=()=>new Date().getTime(),Vi=Kt==null?void 0:Kt.code,bi=()=>{var Rn,Jn;let Ni=Vi?Kt==null?void 0:Kt.code:(Rn=Ae.getFieldValue("hack_codes"))==null?void 0:Rn.code,ji=Vi?Kt==null?void 0:Kt.answer_content:Ae.getFieldValue(on),Gi=Vi?Kt==null?void 0:Kt.input:(Jn=Ae.getFieldValue("hack_sets"))==null?void 0:Jn.input;ji==null||ji.forEach(Fr=>{const be=Fr.value||Fr.answer_text||"";Ni=Ni.replace(/(@▁@|@▁▁@)/,be)}),ln(Gi),en(Ni),Dn({}),Sn(!0)},Di=()=>fn(void 0,null,function*(){var Rn,Jn,Ni,ji;const Gi=ii(),Fr=Vi?Kt==null?void 0:Kt.time_limit:(Rn=Ae.getFieldsValue())==null?void 0:Rn.hack.time_limit,be=Vi?(Jn=Kt==null?void 0:Kt.answer_content)==null?void 0:Jn.length:(ji=(Ni=Ae.getFieldsValue())==null?void 0:Ni.standard_answers)==null?void 0:ji.length;Nt(!0),yield(0,pe.bM)(cn.current,{test_hack_code:Ai,test_input:Qt});function gn(){return fn(this,null,function*(){const{status:li,data:Hn}=yield(0,pe.rX)(cn.current,"submit"),ki=ii()-Gi>(Fr+3)*1e3*be;if(Yt.current){if(ki){kt.ZP.error("\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"),Nt(!1);return}if(li===0){Nt(!1),Dn(Bt(Pt({},Hn),{showText:!0}));return}setTimeout(gn,1e3)}})}gn()}),Mr=()=>fn(void 0,null,function*(){var Rn,Jn,Ni,ji,Gi,Fr,be;if(!Kt){try{yield Ae.validateFields()}catch(oi){(Ni=(Jn=(Rn=oi==null?void 0:oi.errorFields)==null?void 0:Rn[0])==null?void 0:Jn.name)!=null&&Ni.includes("standard_answers")?kt.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):kt.ZP.error(oi.errorFields[0].errors[0]),Ae.scrollToField(oi.errorFields[0].name,{behavior:"smooth",block:"center"});return}Ot(!0);let li="";const Hn=Ae.getFieldsValue();di.current?li=yield(0,se.ZP)(`/api/problems/${di.current}.json`,{method:"put",body:Bt(Pt({},Hn),{hack:Bt(Pt({},Hn==null?void 0:Hn.hack),{sub_discipline_id:(be=(Fr=Hn==null?void 0:Hn.hack)==null?void 0:Fr.sub_discipline_id)==null?void 0:be[1],difficult:Hn.difficulty,item_banks_group_id:Hn.item_banks_group_id}),hack_codes:Bt(Pt({},Hn.hack_codes),{code:te.Base64.encode(Hn.hack_codes.code)}),update_hack_sets:[Pt({},Hn.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}):(li=yield(0,se.ZP)("/api/problems.json",{method:"post",body:Bt(Pt({},Hn),{hack:Bt(Pt({},Hn==null?void 0:Hn.hack),{sub_discipline_id:(Gi=(ji=Hn==null?void 0:Hn.hack)==null?void 0:ji.sub_discipline_id)==null?void 0:Gi[1],difficult:Hn.difficulty,item_banks_group_id:Hn.item_banks_group_id}),hack_codes:Bt(Pt({},Hn.hack_codes),{code:te.Base64.encode(Hn.hack_codes.code)}),hack_sets:[Pt({},Hn.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}),di.current=li==null?void 0:li.identifier,sessionStorage.projectFill=li==null?void 0:li.identifier)}const gn=yield(0,se.ZP)(`/api/problems/${di.current}/start.json`,{method:"get"});if((gn==null?void 0:gn.status)===0){cn.current=gn==null?void 0:gn.identifier,Yt.current=!0,Ot(!1),bi();return}Ot(!1)}),Gn=Rn=>{const{status:Jn,error_msg:Ni,execute_time:ji,output:Gi,input:Fr,expected_output:be}=Rn;let gn=null;switch(Jn){case Ce.h.OK:gn=_e.createElement(_e.Fragment,null,_e.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",ji/1e3,"\u79D2"),_e.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A\u8C03\u8BD5\u901A\u8FC7"));break;case Ce.h.NOMATCH:gn=_e.createElement(_e.Fragment,null,_e.createElement("div",null,"\u8F93\u5165\uFF1A"),_e.createElement("pre",{style:{fontFamily:"initial"}},Fr),_e.createElement("div",null,"\u8F93\u51FA\uFF1A"),_e.createElement("pre",{style:{fontFamily:"initial"}},Gi&&te.Base64.decode(Gi)),_e.createElement("div",null,"\u9884\u671F\u8F93\u51FA\uFF1A"),_e.createElement("pre",{style:{fontFamily:"initial"}},be&&te.Base64.decode(be)));break;case Ce.h.EXECUTEFAILURE:gn=_e.createElement(_e.Fragment,null,_e.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",_e.createElement("pre",null,Fr)),_e.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),_e.createElement("pre",{className:"error"},te.Base64.decode(Ni)));break;case Ce.h.COMPILEFAILURE:gn=_e.createElement(_e.Fragment,null,_e.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",_e.createElement("pre",null,Fr)),_e.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),_e.createElement("pre",{className:"error"},te.Base64.decode(Ni)));break;case Ce.h.PODFAILURE:gn=_e.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case Ce.h.TIMEOUT:gn=_e.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return _e.createElement(_e.Fragment,null," ",gn," ")};return _e.createElement("div",null,_e.createElement(De.ZP,Bt(Pt({loading:Dt},Te),{onClick:Mr}),He),_e.createElement(St.default,{open:un,title:"\u8C03\u8BD5\u4EE3\u7801",destroyOnClose:!0,width:1200,okText:"\u8FD0\u884C\u6D4B\u8BD5",confirmLoading:pn,cancelButtonProps:{style:{display:"none"}},onOk:()=>Di(),onCancel:()=>{Yt.current=!1,Sn(!1)}},_e.createElement("div",{className:de.result},_e.createElement("div",{className:de.left},_e.createElement("div",{className:"mb20"},_e.createElement("span",{className:"c-black"},"\u6267\u884C\u4EE3\u7801"),!Kt&&_e.createElement(we.CopyToClipboard,{text:Ai,onCopy:()=>kt.ZP.success("\u590D\u5236\u6210\u529F")},_e.createElement("span",{style:{float:"right"},className:"current c-light-primary"},_e.createElement("i",{className:"iconfont icon-fuzhi8 mr5"}),"\u590D\u5236"))),_e.createElement(ye.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:Ai,onChange:Rn=>en(Rn)})),_e.createElement("div",{className:de.right},_e.createElement("div",{className:"c-black mb20"},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"),_e.createElement("div",{className:de.box},_e.createElement("div",{className:de.li},_e.createElement(Ue.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165",value:Qt,onChange:Rn=>ln(Rn.target.value),bordered:!1,style:{height:180}}))),_e.createElement("div",{className:"c-black mb20 mt30"},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"),_e.createElement("div",{className:de.box},_e.createElement(ne.Z,{spinning:pn,tip:"\u4EE3\u7801\u6267\u884C\u4E2D"},_e.createElement("div",{className:de.li,style:{height:196,overflow:"auto",padding:10}},Gn(An))))))))},tn=Le(87169),it=Le(59301),rt=Object.defineProperty,dn=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,Kn=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Bn=(Te,He,Ae)=>He in Te?rt(Te,He,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Te[He]=Ae,ui=(Te,He)=>{for(var Ae in He||(He={}))Rt.call(He,Ae)&&Bn(Te,Ae,He[Ae]);if(Kn)for(var Ae of Kn(He))En.call(He,Ae)&&Bn(Te,Ae,He[Ae]);return Te},It=(Te,He)=>dn(Te,ni(He)),On=(Te,He)=>{var Ae={};for(var et in Te)Rt.call(Te,et)&&He.indexOf(et)<0&&(Ae[et]=Te[et]);if(Te!=null&&Kn)for(var et of Kn(Te))He.indexOf(et)<0&&En.call(Te,et)&&(Ae[et]=Te[et]);return Ae};const{TextArea:ht}=Ue.default,kn=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],Oi=({value:Te,onChange:He})=>it.createElement(Switch,{checked:Te,onChange:Ae=>{He(Ae)}}),ze="@\u2581@",Me="@\u2581\u2581@",Ee=({questionTitlePlaceholder:Te,form:He,scoreByBlank:Ae=!1,hackidentifier:et,answerKey:on})=>{const[Kt,pn]=(0,le.useState)(!1),[Nt,Dt]=(0,le.useState)(!1),un=(0,Tt.useParams)().type==="edit",Sn=(cn,Yt)=>{const ii=Yt.line;let Vi=0;for(let Di=0;Di<ii;Di++)Vi+=cn.getLine(Di).split(ze).length-1;for(let Di=0;Di<ii;Di++)Vi+=cn.getLine(Di).split(Me).length-1;const bi=cn.getLine(ii).substring(0,Yt.ch);return Vi+=bi.split(ze).length-1,Vi+=bi.split(Me).length-1,Vi},An=(cn,Yt,ii,Vi)=>{const bi=cn.getRange(Yt.from,Yt.to);let Di=0;if(Yt.text.forEach(Mr=>{Di+=Mr.split(ze).length-1}),Yt.text.forEach(Mr=>{Di+=Mr.split(Me).length-1}),Yt.origin!=="setValue"){if(bi&&(bi.indexOf(ze)!==-1||bi.indexOf(Me)!==-1)){const Mr=bi.split(ze).length-1+bi.split(Me).length-1,Gn=Sn(cn,Yt.from);if(console.log(`\u5220\u9664${Mr}\u4E2A\uFF0C \u524D\u9762\u6709${Gn}\u4E2A\uFF0C\u65B0\u589E${Di}\u4E2A`),Mr>1){const Rn=Array.from({length:Mr},(Jn,Ni)=>Gn+Ni);Vi(Rn)}else Vi(Gn)}else if(Di>0){const Mr=Sn(cn,Yt.from);console.log(`\u65B0\u589E${Di}\u4E2A\uFF0C\u4E4B\u524D\u6709${Mr}\u4E2A`),ii(Di,Mr)}}},Dn=()=>{const cn=He.getFieldValue(on);He.setFieldsValue({[on]:cn==null?void 0:cn.map((Yt,ii)=>It(ui({},Yt),{position:ii+1}))})},Ai=(0,le.useRef)(),en=(cn,Yt)=>{for(let ii=0;ii<cn;ii++)Ai.current({position:null,answer_text:""},Yt+ii);Dn()},Qt=(0,le.useRef)(),ln=cn=>{Qt.current(cn),Dn()},di=pt.default.useWatch(on,He);return it.createElement("div",{className:dt.Z.wrap},it.createElement(pt.default.Item,{label:"\u8BD5\u9898\u63CF\u8FF0",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}]},it.createElement(We.h,{scrollId:"name",watch:!0,height:140})),it.createElement("div",{className:dt.Z.questionTitleEditorWrap},it.createElement(pt.default.Item,{label:"\u7A0B\u5E8F\u4EE3\u7801",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}]},it.createElement(We.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:(cn,Yt)=>{const ii=He.getFieldValue(on);console.log("--preAnswerData",ii,Yt),He.setFieldsValue({[on]:ii==null?void 0:ii.map((Vi,bi)=>{var Di;return It(ui({},Vi),{position:bi+1,multi_line:(Di=Yt==null?void 0:Yt[bi])==null?void 0:Di.multiLine})})})},placeholder:Te,onCMBeforeChange:(cn,Yt)=>{An(cn,Yt,en,ln)}}))),it.createElement(pt.default.List,{name:on,rules:[{validator(cn,Yt){if(!(Yt!=null&&Yt.length))return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const ii of Yt){const{answer_text:Vi}=ii||{};if((Vi==null?void 0:Vi.length)===0)return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(cn,{add:Yt,remove:ii},{errors:Vi})=>(Ai.current=Yt,Qt.current=ii,it.createElement(it.Fragment,null,it.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},it.createElement(pt.default.Item,{label:"\u586B\u7A7A\u9879\u7B54\u6848",required:!0,labelCol:{span:24}}),it.createElement("div",{onClick:()=>{St.default.warning({title:"\u7ED9\u5206\u8BF4\u660E",icon:null,width:700,centered:!0,content:it.createElement("div",null,it.createElement("div",null,"1.\u5B66\u751F\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801",it.createElement("span",{style:{color:"#e30000"}},"\u8FDB\u884C\u8BC4\u6D4B"),"\u624D\u80FD\u5F97\u5206\u3002"),it.createElement("div",{style:{marginTop:10}},"2.\u8BD5\u9898\u7B97\u5206\u65F6\uFF0C\u7CFB\u7EDF\u4F1A\u5C06\u7A0B\u5E8F\u91CC\u9762\u7684\u6240\u6709\u7A7A\u66FF\u6362\u6210\u5B66\u751F\u7684\u7B54\u6848\u8FDB\u884C\u8BC4\u6D4B\u3002\u8F93\u51FA\u7684\u7ED3\u679C\u4E0E\u6D4B\u8BD5\u96C6\u6BD4\u5BF9\uFF0C\u5B8C\u5168\u6B63\u786E\u5219\u5F97\u6EE1\u5206\uFF1B\u82E5\u4E0D\u5B8C\u5168\u6B63\u786E\uFF0C\u5219\u4F9D\u6B21\u5C06\u6BCF\u4E2A\u7A7A\u6362\u6210\u5B66\u751F\u63D0\u4EA4\u7684\u7B54\u6848\uFF0C\u540C\u65F6\u5C06\u5176\u4ED6\u7A7A\u66FF\u6362\u6210\u6807\u51C6\u7B54\u6848\uFF0C\u8FD0\u884C\u7A0B\u5E8F\u3002\u5982\u679C\u8FD9\u4E2A\u7A7A\u7684\u5B66\u751F\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7ED3\u5408\u80FD\u5F97\u5230\u6B63\u786E\u8F93\u51FA\uFF0C\u5219\u8FD9\u4E2A\u7A7A\u5F97\u5230\u8BE5\u7A7A\u7684\u6EE1\u5206\uFF0C\u5426\u5219\u8BE5\u7A7A\u5F970\u5206\u3002"))})},style:{minHeight:32,color:"#3061D0",cursor:"pointer"}},it.createElement(tn.Z,{style:{marginRight:3,color:"#3061D0"}}),it.createElement("span",null," \u7ED9\u5206\u8BF4\u660E"))),cn.map((bi,Di)=>{var Mr=bi,{key:Gn,name:Rn}=Mr,Jn=On(Mr,["key","name"]),Ni,ji;return it.createElement(yt.Z,{className:"mb20",key:Gn,align:"middle",wrap:!1},it.createElement(Oe.Z,{flex:"0 0 auto",className:`${dt.Z.blankIndex}`},"\u586B\u7A7A\u9879",Di+1),it.createElement(Oe.Z,{flex:1},it.createElement(yt.Z,{align:"top",justify:"space-between",wrap:!1},it.createElement(Oe.Z,null,it.createElement(pt.default.Item,It(ui({},Jn),{name:[Rn,"answer_text"],noStyle:!0}),(Ni=di==null?void 0:di[Rn])!=null&&Ni.multi_line||(ji=di==null?void 0:di[Rn])!=null&&ji.multiLine?it.createElement(ht,{spellCheck:!1,style:{marginLeft:10,width:550}}):it.createElement(Ue.default,{style:{marginLeft:10,width:550},className:dt.Z.blankInput,size:"large",maxLength:1e3,onBlur:Gi=>{}}))),Ae&&it.createElement(Oe.Z,{flex:"224px"},it.createElement(pt.default.Item,It(ui({},Jn),{name:[Rn,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),it.createElement(at.Z,{size:"large",className:dt.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"}))))))})))),it.createElement("div",{onClick:()=>pn(!0)},it.createElement(pt.default.Item,{name:["hack","analysis"],label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},it.createElement(We.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Kt}))),it.createElement(pt.default.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},it.createElement(Ct.default,{size:"large"},kn.map(cn=>it.createElement(Ct.default.Option,{key:cn.title,value:cn.key}," ",cn.title)))),it.createElement(pt.default.Item,{label:"\u6700\u5927\u8BC4\u6D4B\u65F6\u957F\uFF08\u79D2\uFF09",style:{marginTop:30},labelCol:{span:24},required:!0},it.createElement(pt.default.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],noStyle:!0},it.createElement(at.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})),it.createElement("span",{className:"ml10 font14"},"\u79D2")),it.createElement(pt.default.Item,{label:"\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406",style:{marginTop:30},name:["hack","submit_rule"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406"}]},it.createElement(ot.ZP.Group,{style:{marginTop:-10}},it.createElement(ot.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),it.createElement(ot.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),it.createElement(ot.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"))),it.createElement(pt.default.Item,{label:"\u6D4B\u8BD5\u7528\u4F8B",required:!0,style:{marginTop:30}}),it.createElement("div",{style:{background:"#F6F7F9",padding:15}},it.createElement(pt.default.Item,{label:"\u8F93\u5165",labelCol:{span:24},name:["hack_sets","input"]},it.createElement(ht,{rows:4})),it.createElement(pt.default.Item,{label:"\u8F93\u51FA",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},it.createElement(ht,{rows:4}))),it.createElement(vn,{form:He,answerKey:on,hackIdentifier:et,buttonText:"\u8FD0\u884C\u8C03\u8BD5",buttonProps:{ghost:!0,icon:it.createElement("i",{className:"iconfont icon-ceshi"}),style:{background:"rgba(55,173,131,0.05)",borderRadius:19,border:"1px solid #37AD83",width:116,height:38,display:"inline-flex",fontSize:14,alignItems:"center",justifyContent:"center",marginTop:20,cursor:"pointer",color:"#37AD83"}}}))}},81727:function(Zn,ei,Le){"use strict";Le.d(ei,{u:function(){return _e}});var le=Le(59301),Ue=Le(77019),pt=Le(5269),St=Le(25399),yt=Le(28284),Oe=Le(8423),at=Le(32134),Ct=Le(12893),ot=Le(31457),We=Le(59301),Tt=Object.defineProperty,dt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(Ze,st,nt)=>st in Ze?Tt(Ze,st,{enumerable:!0,configurable:!0,writable:!0,value:nt}):Ze[st]=nt,se=(Ze,st)=>{for(var nt in st||(st={}))ne.call(st,nt)&&de(Ze,nt,st[nt]);if(De)for(var nt of De(st))te.call(st,nt)&&de(Ze,nt,st[nt]);return Ze},pe=(Ze,st)=>dt(Ze,kt(st)),ye=(Ze,st)=>{var nt={};for(var Ye in Ze)ne.call(Ze,Ye)&&st.indexOf(Ye)<0&&(nt[Ye]=Ze[Ye]);if(Ze!=null&&De)for(var Ye of De(Ze))st.indexOf(Ye)<0&&te.call(Ze,Ye)&&(nt[Ye]=Ze[Ye]);return nt};const we=["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"],Ce=({value:Ze,onChange:st,choiceTextKey:nt,answerKey:Ye,index:ct,isEdit:$e,setInputActive:Et,form:Pt,choiceOptionsPath:Bt,allowChangeMode:fn,showAddIcon:qt,addItem:vn,deleteItem:tn})=>{console.log(Ze,"value");const it=(Ze==null?void 0:Ze[Ye])===1,rt=()=>{const ni=Pt.getFieldValue(Bt);Pt.setFieldValue(Bt,ni.map(Kn=>pe(se({},Kn),{[Ye]:0})))},dn=()=>{it?st(pe(se({},Ze),{[Ye]:0})):(fn||rt(),st(pe(se({},Ze),{[Ye]:1})))};return We.createElement(Ue.Z,{className:Oe.Z.choiceWrap,align:"middle",wrap:!1},We.createElement(pt.Z,{onClick:dn,className:`${Oe.Z.choiceIndex} ${it?Oe.Z.activeAnswer:""}`},we[ct]),We.createElement(pt.Z,{flex:1,className:`${Oe.Z.editorWrap} ml15`,onClick:Et},We.createElement(ot.x,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:$e,value:Ze==null?void 0:Ze[nt],onChange:ni=>{st(pe(se({},Ze),{[nt]:ni}))}})),We.createElement(pt.Z,{flex:"0 0 auto",className:"ml15"},We.createElement("div",{onClick:dn,className:`${Oe.Z.setAnswerBtn} ${it?Oe.Z.activeAnswer:""}`},it?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),We.createElement(pt.Z,{className:Oe.Z.actionWrapper},We.createElement(St.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},We.createElement(at.Z,{className:Oe.Z.addIcon,onClick:vn,style:{visibility:qt?"visible":"hidden"}})),We.createElement(St.Z,{title:"\u5220\u9664"},We.createElement(Ct.Z,{className:Oe.Z.deleteIcon,onClick:tn,style:{visibility:ct>1?"visible":"hidden"}}))))},_e=({questionTitlePlaceholder:Ze,titleKey:st,choiceKey:nt,analysisKey:Ye,choiceTextKey:ct,answerKey:$e,choiceOptionsPath:Et,allowChangeMode:Pt=!0,form:Bt,showAnalysis:fn=!0})=>{const[qt,vn]=(0,le.useState)(),[tn,it]=(0,le.useState)(!1);return We.createElement("div",{className:Oe.Z.wrap},We.createElement("div",{className:Oe.Z.questionTitleEditorWrap},We.createElement(yt.default.Item,{label:"\u9898\u5E72",name:st,labelCol:{span:24},rules:[{required:!0}]},We.createElement(ot.h,{scrollId:Array.isArray(st)?st.join("_"):`${st}`,watch:!0,height:140,placeholder:Ze}))),We.createElement(yt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),We.createElement(yt.default.List,{name:nt,rules:[{validator(rt,dn){const ni=dn.some(Rt=>Rt[$e]===1),Kn=dn.findIndex(Rt=>{var En;return((En=Rt[ct])==null?void 0:En.length)<=0});return Kn!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${we[Kn]}\u9009\u9879\u7684\u5185\u5BB9`)):ni?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(rt,{add:dn,remove:ni})=>We.createElement("div",{id:Array.isArray(Et)?Et.join("_"):`${Et}`},rt.map((Kn,Rt)=>{var En=Kn,{key:Bn,name:ui}=En,It=ye(En,["key","name"]);const On=qt===Bn,ht=()=>{vn(Bn)},kn=Rt<7&&Rt===rt.length-1,Oi=()=>dn({[ct]:"",[$e]:0}),ze=()=>ni(ui);return We.createElement(yt.default.Item,pe(se({},It),{key:Bn,name:ui,className:Oe.Z.choiceListWrap,rules:[{validator(Me,Ee){return Ee!=null&&Ee.choice_text?Promise.resolve():Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${we[Rt]}\u9009\u9879\u7684\u5185\u5BB9`))}}]}),We.createElement(Ce,{choiceTextKey:ct,answerKey:$e,index:Rt,isEdit:On,setInputActive:ht,form:Bt,choiceOptionsPath:Et,allowChangeMode:Pt,showAddIcon:kn,addItem:Oi,deleteItem:ze}))}),rt.length<8&&We.createElement("div",{className:`${Oe.Z.addBtn} mb30`,onClick:()=>dn({[ct]:"",[$e]:0})},"\u6DFB\u52A0\u9009\u9879"))),fn&&We.createElement("div",{onClick:()=>it(!0)},We.createElement(yt.default.Item,{name:Ye,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},We.createElement(ot.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:tn}))))}},92046:function(Zn,ei,Le){"use strict";Le.d(ei,{u:function(){return Pt}});var le=Le(59301),Ue=Le(62957),pt=Le(77019),St=Le(5269),yt=Le(37568),Oe=Le(25399),at=Le(71411),Ct=Le(28284),ot=Le(47889),We=Le(71051),Tt=Le(31457),dt=Le(12893),kt=Le(61485),De=Le(8423),ne=Le(19105),te=Le(59301),de=Object.defineProperty,se=Object.defineProperties,pe=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,_e=(Bt,fn,qt)=>fn in Bt?de(Bt,fn,{enumerable:!0,configurable:!0,writable:!0,value:qt}):Bt[fn]=qt,Ze=(Bt,fn)=>{for(var qt in fn||(fn={}))we.call(fn,qt)&&_e(Bt,qt,fn[qt]);if(ye)for(var qt of ye(fn))Ce.call(fn,qt)&&_e(Bt,qt,fn[qt]);return Bt},st=(Bt,fn)=>se(Bt,pe(fn)),nt=(Bt,fn)=>{var qt={};for(var vn in Bt)we.call(Bt,vn)&&fn.indexOf(vn)<0&&(qt[vn]=Bt[vn]);if(Bt!=null&&ye)for(var vn of ye(Bt))fn.indexOf(vn)<0&&Ce.call(Bt,vn)&&(qt[vn]=Bt[vn]);return qt};const Ye=({value:Bt,onChange:fn})=>{const qt=tn=>{Ue.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:De.Z.modal,onOk:()=>{const it=[...Bt];it.splice(tn,1),fn(it)}})},vn=()=>{const tn=[...Bt];tn.push(""),fn(tn)};return te.createElement(pt.Z,{className:"ml20"},te.createElement(St.Z,{flex:1},Bt==null?void 0:Bt.map((tn,it)=>te.createElement(pt.Z,{key:`${tn}_${it}`,className:"mb20"},te.createElement(yt.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:tn,autoSize:{maxRows:3},maxLength:1e3,onBlur:rt=>{const dn=[...Bt],ni=rt.target.value.trim();dn[it]=ni,fn(dn)}}),te.createElement(Oe.Z,{title:"\u5220\u9664"},te.createElement(dt.Z,{className:De.Z.deleteIcon,style:{marginLeft:15,visibility:it>0?"visible":"hidden"},onClick:()=>qt(it)}))))),te.createElement(St.Z,null,te.createElement("div",{className:`${De.Z.addBtn}`,onClick:()=>{vn()}},"\u65B0\u589E\u7B54\u6848")))},ct=({value:Bt,onChange:fn})=>{const qt=tn=>{Ue.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:De.Z.modal,onOk:()=>{const it=[...Bt];it.splice(tn,1),fn(it)}})},vn=()=>{const tn=[...Bt];tn.push(""),fn(tn)};return te.createElement(pt.Z,{className:"ml20"},te.createElement(St.Z,{flex:1},Bt==null?void 0:Bt.map((tn,it)=>te.createElement(pt.Z,{key:`${tn}_${it}`,align:"middle",className:"mb20"},te.createElement(ne.Z,{value:tn,style:{flex:1},onChange:rt=>{const dn=[...Bt];dn[it]=rt,fn(dn)}}),te.createElement(Oe.Z,{title:"\u5220\u9664"},te.createElement(dt.Z,{className:De.Z.deleteIcon,style:{marginLeft:15,visibility:it>0?"visible":"hidden"},onClick:()=>qt(it)}))))),te.createElement(St.Z,null,te.createElement("div",{className:`${De.Z.addBtn}`,onClick:()=>{vn()}},"\u65B0\u589E\u7B54\u6848")))},$e=({value:Bt=!0,onChange:fn})=>te.createElement(at.Z,{checked:!Bt,onChange:qt=>{fn(!qt)}}),Et="\u2581",Pt=({questionTitlePlaceholder:Bt,form:fn,scoreByBlank:qt=!1,answerKey:vn})=>{const[tn,it]=(0,le.useState)(!1),rt=(It,On)=>{const ht=On.line;let kn=0;for(let ze=0;ze<ht;ze++)kn+=It.getLine(ze).split(Et).length-1;const Oi=It.getLine(ht).substring(0,On.ch);return kn+=Oi.split(Et).length-1,kn},dn=(It,On,ht,kn)=>{const Oi=It.getRange(On.from,On.to);let ze=0;if(On.text.forEach(Me=>{ze+=Me.split(Et).length-1}),On.origin!=="setValue"){if(Oi&&Oi.indexOf(Et)!==-1){const Me=Oi.split(Et).length-1,Ee=rt(It,On.from);if(console.log(`\u5220\u9664${Me}\u4E2A\uFF0C \u524D\u9762\u6709${Ee}\u4E2A\uFF0C\u65B0\u589E${ze}\u4E2A`),Me>1){const Te=Array.from({length:Me},(He,Ae)=>Ee+Ae);kn(Te)}else kn(Ee)}else if(ze>0){const Me=rt(It,On.from);console.log(`\u65B0\u589E${ze}\u4E2A\uFF0C\u4E4B\u524D\u6709${Me}\u4E2A`),ht(ze,Me)}}},ni=()=>{const It=fn.getFieldValue(vn);fn.setFieldsValue({[vn]:It.map((On,ht)=>st(Ze({},On),{position:ht+1}))})},Kn=(0,le.useRef)(),Rt=(It,On)=>{for(let ht=0;ht<It;ht++)Kn.current({position:null,answer_text:[""],model:1},On+ht);ni()},En=(0,le.useRef)(),Bn=It=>{En.current(It),ni()},ui=Ct.default.useWatch(vn,fn);return te.createElement("div",{className:De.Z.wrap},te.createElement("div",{className:De.Z.questionTitleEditorWrap},te.createElement(Ct.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},te.createElement(Tt.h,{scrollId:"name",watch:!0,height:140,placeholder:Bt,showNullButton:!0,onCMBeforeChange:(It,On)=>{dn(It,On,Rt,Bn)}}))),te.createElement(Ct.default.List,{name:vn,rules:[{validator(It,On){if(!(On!=null&&On.length))return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const ht of On){const{answer_text:kn}=ht||{};if(kn!=null&&kn.some(Oi=>(Oi==null?void 0:Oi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(It,{add:On,remove:ht},{errors:kn})=>(Kn.current=On,En.current=ht,te.createElement(te.Fragment,null,te.createElement(Ct.default.Item,{label:te.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(It!=null&&It.length)&&te.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),It.map((Oi,ze)=>{var Me=Oi,{key:Ee,name:Te}=Me,He=nt(Me,["key","name"]),Ae,et;return te.createElement("div",{style:{marginBottom:10},key:Ee},te.createElement(pt.Z,{className:"mb20",align:"middle",wrap:!1},te.createElement(St.Z,{style:{marginRight:10},flex:"0 0 auto",className:`${De.Z.blankIndex}`},"\u586B\u7A7A\u9879",ze+1),te.createElement(Ct.default.Item,st(Ze({},He),{name:[Te,"model"],noStyle:!0}),te.createElement(ot.ZP.Group,{onChange:()=>{const on=fn.getFieldValue(vn);fn.setFieldsValue({[vn]:on.map((Kt,pn)=>st(Ze({},Kt),{answer_text:Te===pn?[""]:Kt.answer_text}))})}},te.createElement(ot.ZP,{value:1},"\u6587\u672C\u6A21\u5F0F ",te.createElement(Oe.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u5728\u6587\u672C\u6846\u4E2D\u586B\u5199\u6587\u672C\u7B54\u6848"},te.createElement(kt.Z,null))),te.createElement(ot.ZP,{value:2},"\u6570\u5B66\u516C\u5F0F\u6A21\u5F0F ",te.createElement(Oe.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u7F16\u5199\u6570\u5B66\u516C\u5F0F\u4F5C\u4E3A\u7B54\u6848"},te.createElement(kt.Z,null)))))),te.createElement(pt.Z,{style:{marginLeft:20},align:"middle",wrap:!1},te.createElement(St.Z,{flex:1},te.createElement(pt.Z,{align:"top",justify:"space-between",wrap:!1},te.createElement(St.Z,{flex:1},te.createElement(Ct.default.Item,st(Ze({},He),{name:[Te,"answer_text"],noStyle:!0}),((et=(Ae=fn.getFieldValue(vn))==null?void 0:Ae[Te])==null?void 0:et.model)===1?te.createElement(Ye,null):te.createElement(ct,null))),qt&&te.createElement(St.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},te.createElement(Ct.default.Item,st(Ze({},He),{name:[Te,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:De.Z.blankInputNumberWrapper}),te.createElement(We.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),te.createElement(Ct.default.Item,st(Ze({},He),{name:[Te,"position"],noStyle:!0}),te.createElement(yt.default,{type:"hidden"})))))})))),te.createElement(pt.Z,{align:"middle"},te.createElement(Ct.default.Item,{name:"downcase",valuePropName:"checked"},te.createElement(at.Z,null)),te.createElement(St.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),te.createElement(pt.Z,{align:"middle"},te.createElement(Ct.default.Item,{name:"no_space",valuePropName:"checked"},te.createElement(at.Z,null)),te.createElement(St.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(ui==null?void 0:ui.length)>1&&te.createElement(pt.Z,{align:"middle",className:(ui==null?void 0:ui.length)>1?"mb30":`${De.Z.hide}`},te.createElement(Ct.default.Item,{name:"is_ordered"},te.createElement($e,null)),te.createElement(St.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),te.createElement("div",{onClick:()=>it(!0)},te.createElement(Ct.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},te.createElement(Tt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:tn}))))}},14289:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(59301),Ue=Le(77019),pt=Le(5269),St=Le(28284),yt=Le(8423),Oe=Le(31457),at=Le(59301),Ct=Object.defineProperty,ot=Object.defineProperties,We=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,dt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,De=(we,Ce,_e)=>Ce in we?Ct(we,Ce,{enumerable:!0,configurable:!0,writable:!0,value:_e}):we[Ce]=_e,ne=(we,Ce)=>{for(var _e in Ce||(Ce={}))dt.call(Ce,_e)&&De(we,_e,Ce[_e]);if(Tt)for(var _e of Tt(Ce))kt.call(Ce,_e)&&De(we,_e,Ce[_e]);return we},te=(we,Ce)=>ot(we,We(Ce)),de=(we,Ce)=>{var _e={};for(var Ze in we)dt.call(we,Ze)&&Ce.indexOf(Ze)<0&&(_e[Ze]=we[Ze]);if(we!=null&&Tt)for(var Ze of Tt(we))Ce.indexOf(Ze)<0&&kt.call(we,Ze)&&(_e[Ze]=we[Ze]);return _e};const se={\u6B63\u786E:"T",\u9519\u8BEF:"F"},pe=({value:we,onChange:Ce,form:_e})=>{const Ze=(we==null?void 0:we.is_answer)===1,st=we==null?void 0:we.choice_text,nt=()=>{const Ye=_e.getFieldsValue().choices.map(ct=>({choice_text:ct.choice_text,is_answer:0}));_e.setFieldsValue({choices:Ye}),Ce(te(ne({},we),{is_answer:1}))};return at.createElement(Ue.Z,{className:yt.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"}},at.createElement(pt.Z,{onClick:nt,className:`${yt.Z.choiceIndex} ${yt.Z.judgementIndex} ${Ze?yt.Z.activeAnswer:""}`},se[st]),at.createElement(pt.Z,{flex:1,className:`${yt.Z.editorWrap} ml15`},at.createElement("div",{className:`${yt.Z.inputBorder} ${yt.Z.placeholder} ${Ze?yt.Z.activeJudgementAnswer:""}`},st)),at.createElement(pt.Z,{flex:"0 0 auto",className:"ml15"},at.createElement("div",{onClick:nt,className:`${yt.Z.setAnswerBtn} ${Ze?yt.Z.activeAnswer:""}`},Ze?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},ye=({questionTitlePlaceholder:we,choiceKey:Ce,form:_e})=>{const[Ze,st]=(0,le.useState)(!1);return at.createElement("div",{className:yt.Z.wrap},at.createElement("div",{className:yt.Z.questionTitleEditorWrap},at.createElement(St.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},at.createElement(Oe.h,{scrollId:"name",watch:!0,height:140,placeholder:we}))),at.createElement(St.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},at.createElement(St.default.List,{name:"choices",rules:[{validator(nt,Ye){return Ye.some($e=>($e==null?void 0:$e.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},nt=>at.createElement("div",{id:"choices"},nt.map(Ye=>{var ct=Ye,{key:$e,name:Et}=ct,Pt=de(ct,["key","name"]);return at.createElement(St.default.Item,te(ne({},Pt),{key:$e,name:Et,noStyle:!0}),at.createElement(pe,{form:_e}))})))),at.createElement("div",{onClick:()=>st(!0)},at.createElement(St.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},at.createElement(Oe.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ze}))))}},31457:function(Zn,ei,Le){"use strict";Le.d(ei,{h:function(){return ne},x:function(){return te}});var le=Le(39793),Ue=Le(8423),pt=Le(76902),St=Le(59301),yt=Object.defineProperty,Oe=Object.defineProperties,at=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Tt=(de,se,pe)=>se in de?yt(de,se,{enumerable:!0,configurable:!0,writable:!0,value:pe}):de[se]=pe,dt=(de,se)=>{for(var pe in se||(se={}))ot.call(se,pe)&&Tt(de,pe,se[pe]);if(Ct)for(var pe of Ct(se))We.call(se,pe)&&Tt(de,pe,se[pe]);return de},kt=(de,se)=>Oe(de,at(se)),De=(de,se)=>{var pe={};for(var ye in de)ot.call(de,ye)&&se.indexOf(ye)<0&&(pe[ye]=de[ye]);if(de!=null&&Ct)for(var ye of Ct(de))se.indexOf(ye)<0&&We.call(de,ye)&&(pe[ye]=de[ye]);return pe};const ne=de=>{var se=de,{value:pe,onChange:ye,scrollId:we}=se,Ce=De(se,["value","onChange","scrollId"]);return St.createElement("div",{id:we||""},St.createElement(le.Z,kt(dt({},Ce),{defaultValue:pe,onChange:(_e,Ze)=>{Ze!=null&&Ze.length?ye(_e,Ze):ye(_e)}})))},te=({value:de,onChange:se,placeholder:pe,height:ye=140,isEdit:we,miniToolbar:Ce,watch:_e=!0})=>we?St.createElement(le.Z,{watch:_e,isFocus:!0,height:ye||void 0,placeholder:pe,defaultValue:de,onChange:se,miniToolbar:Ce}):St.createElement("div",{style:{cursor:"pointer"}},de?St.createElement(pt.Z,{className:Ue.Z.inputBorder,value:de}):St.createElement("div",{className:`${Ue.Z.inputBorder} ${Ue.Z.placeholder} inputBorderError`},pe))},44272:function(Zn,ei,Le){"use strict";Le.d(ei,{W:function(){return ct}});var le=Le(59301),Ue=Le(6767),pt=Le(96599),St=Le(28284),yt=Le(71411),Oe=Le(77019),at=Le(5269),Ct=Le(25399),ot=Le(37568),We=Le(71051),Tt=Le(8423),dt=Le(31457),kt=Le(39793),De=Le(61485),ne=Object.defineProperty,te=Object.defineProperties,de=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,we=($e,Et,Pt)=>Et in $e?ne($e,Et,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):$e[Et]=Pt,Ce=($e,Et)=>{for(var Pt in Et||(Et={}))pe.call(Et,Pt)&&we($e,Pt,Et[Pt]);if(se)for(var Pt of se(Et))ye.call(Et,Pt)&&we($e,Pt,Et[Pt]);return $e},_e=($e,Et)=>te($e,de(Et)),Ze=($e,Et)=>{var Pt={};for(var Bt in $e)pe.call($e,Bt)&&Et.indexOf(Bt)<0&&(Pt[Bt]=$e[Bt]);if($e!=null&&se)for(var Bt of se($e))Et.indexOf(Bt)<0&&ye.call($e,Bt)&&(Pt[Bt]=$e[Bt]);return Pt};const st=$e=>{var Et=$e,{value:Pt,onChange:Bt}=Et,fn=Ze(Et,["value","onChange"]);const qt=vn=>{Bt([vn])};return le.createElement(kt.Z,_e(Ce({},fn),{defaultValue:Pt==null?void 0:Pt[0],onChange:qt}))},nt=$e=>{if(!$e)return!1;if(/^s*$/.test($e)||$e.trim()===""){Ue.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Et=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return $e==="|"?(Ue.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ye=({value:$e=[],onClose:Et})=>le.createElement(pt.default,{closable:!0,onClose:Et,className:Tt.Z.keywordTag},le.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},$e.join(" \u6216 "))),ct=({questionTitlePlaceholder:$e,form:Et,showKeywords:Pt,isMustKeyWords:Bt=Pt})=>{const[fn,qt]=(0,le.useState)(!1),[vn,tn]=(0,le.useState)(""),it=St.default.useWatch("use_keywords",Et),rt=St.default.useWatch("question_score",Et);return le.createElement("div",{className:Tt.Z.wrap},le.createElement("div",{className:Tt.Z.questionTitleEditorWrap},le.createElement(St.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},le.createElement(dt.h,{scrollId:"name",watch:!0,height:140,placeholder:$e}))),le.createElement(St.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:"answer_texts",labelCol:{span:24}},le.createElement(st,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Pt&&!Bt&&le.createElement(St.default.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked"},le.createElement(yt.Z,{defaultChecked:!0})),Pt&&Bt&&le.createElement(Oe.Z,{align:"middle",className:"mb30"},le.createElement(St.default.Item,{name:"use_keywords",valuePropName:"checked"},le.createElement(yt.Z,null)),le.createElement(at.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),le.createElement(at.Z,null,le.createElement(Ct.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},le.createElement(De.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(it||!Bt)&&le.createElement(St.default.List,{name:"keywords",rules:[{validator(dn,ni){return Bt?ni!=null&&ni.length?(ni==null?void 0:ni.reduce((Rt,En)=>Rt+En.score,0))>parseFloat(rt)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(dn,{add:ni,remove:Kn})=>le.createElement(le.Fragment,null,le.createElement("div",{className:`${Tt.Z.title} mb10`},Bt?"\u5173\u952E\u8BCD":le.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),le.createElement(Oe.Z,{align:"middle",className:"font14 mb30"},le.createElement(at.Z,{flex:1},le.createElement(ot.default,{value:vn,onChange:Rt=>{tn(Rt.target.value)},maxLength:50,allowClear:!0,onPressEnter:Rt=>{var En,Bn,ui,It;const On=`${(En=Rt.target)==null?void 0:En.value}`,ht=(ui=(Bn=On==null?void 0:On.split("|"))==null?void 0:Bn.filter(ze=>!!ze))==null?void 0:ui.map(ze=>ze==null?void 0:ze.trim()),kn=Et.getFieldValue("keywords"),Oi=((It=kn==null?void 0:kn.map(ze=>ze==null?void 0:ze.keyword))==null?void 0:It.flat())||[];for(const ze of ht)if(Oi.includes(ze)){Ue.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}nt(On)&&(ni({keyword:ht,score:1}),tn(""))},className:Tt.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),le.createElement(at.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),dn.map(Rt=>{var En=Rt,{key:Bn,name:ui}=En,It=Ze(En,["key","name"]);return le.createElement(Oe.Z,{key:Bn,className:"mb20",style:{marginRight:148}},le.createElement(at.Z,{flex:1},le.createElement(Oe.Z,{align:"middle",justify:"space-between"},le.createElement(St.default.Item,_e(Ce({},It),{name:[ui,"keyword"]}),le.createElement(Ye,{onClose:()=>Kn(ui)})),Bt&&le.createElement(St.default.Item,_e(Ce({},It),{name:[ui,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Tt.Z.blankInputNumberWrapper}),le.createElement(We.Z,{className:Tt.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),le.createElement("div",{onClick:()=>qt(!0)},le.createElement(St.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},le.createElement(dt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:fn}))))}},77762:function(Zn,ei,Le){"use strict";Le.d(ei,{tc:function(){return Mr.t},uh:function(){return le.u},rL:function(){return Di},u8:function(){return pt.u},ZZ:function(){return Ue.Z},Wk:function(){return St.W}});var le=Le(81727),Ue=Le(14289),pt=Le(92046),St=Le(44272),yt=Le(59301),Oe=Le(8848),at=Le(28284),Ct=Le(77019),ot=Le(5269),We=Le(71051),Tt=Le(25399),dt=Le(75727),kt=Le(8423),De=Le(12893),ne=Le(31457),te=Le(62957),de=Le(37568),se=Le(71411),pe=Le(59301),ye=Object.defineProperty,we=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,nt=(Gn,Rn,Jn)=>Rn in Gn?ye(Gn,Rn,{enumerable:!0,configurable:!0,writable:!0,value:Jn}):Gn[Rn]=Jn,Ye=(Gn,Rn)=>{for(var Jn in Rn||(Rn={}))Ze.call(Rn,Jn)&&nt(Gn,Jn,Rn[Jn]);if(_e)for(var Jn of _e(Rn))st.call(Rn,Jn)&&nt(Gn,Jn,Rn[Jn]);return Gn},ct=(Gn,Rn)=>we(Gn,Ce(Rn)),$e=(Gn,Rn)=>{var Jn={};for(var Ni in Gn)Ze.call(Gn,Ni)&&Rn.indexOf(Ni)<0&&(Jn[Ni]=Gn[Ni]);if(Gn!=null&&_e)for(var Ni of _e(Gn))Rn.indexOf(Ni)<0&&st.call(Gn,Ni)&&(Jn[Ni]=Gn[Ni]);return Jn};const Et=({value:Gn,onChange:Rn})=>{const Jn=ji=>{te.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:kt.Z.modal,onOk:()=>{const Gi=[...Gn];Gi.splice(ji,1),Rn(Gi)}})},Ni=()=>{const ji=[...Gn];ji.push(""),Rn(ji)};return pe.createElement(Ct.Z,{className:"ml20"},pe.createElement(ot.Z,{flex:1},Gn==null?void 0:Gn.map((ji,Gi)=>pe.createElement(Ct.Z,{key:`${ji}_${Gi}`,align:"middle",className:"mb20"},pe.createElement(de.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:ji,autoSize:{maxRows:3},maxLength:1e3,onBlur:Fr=>{const be=[...Gn],gn=Fr.target.value.trim();be[Gi]=gn,Rn(be)}}),pe.createElement(Tt.Z,{title:"\u5220\u9664"},pe.createElement(De.Z,{className:kt.Z.deleteIcon,style:{marginLeft:15,visibility:Gi>0?"visible":"hidden"},onClick:()=>Jn(Gi)}))))),pe.createElement(ot.Z,null,pe.createElement("div",{className:`${kt.Z.addBtn}`,onClick:()=>{Ni()}},"\u65B0\u589E\u7B54\u6848")))},Pt=({value:Gn=!0,onChange:Rn})=>pe.createElement(se.Z,{checked:!Gn,onChange:Jn=>{Rn(!Jn)}}),Bt="\u2581",fn=({questionTitlePlaceholder:Gn,form:Rn,name:Jn,scoreByBlank:Ni=!1,answerKey:ji,titleKey:Gi="name",analysisKey:Fr="analysis",isOrdered:be="is_ordered"})=>{var gn,li;const[Hn,oi]=(0,yt.useState)(!1),ki=(mi,fi)=>{const wn=fi.line;let Yn=0;for(let vr=0;vr<wn;vr++)Yn+=mi.getLine(vr).split(Bt).length-1;const Qi=mi.getLine(wn).substring(0,fi.ch);return Yn+=Qi.split(Bt).length-1,Yn},Ji=(mi,fi,wn,Yn)=>{const Qi=mi.getRange(fi.from,fi.to);let vr=0;if(fi.text.forEach(Dr=>{vr+=Dr.split(Bt).length-1}),fi.origin!=="setValue"){if(Qi&&Qi.indexOf(Bt)!==-1){const Dr=Qi.split(Bt).length-1,Ke=ki(mi,fi.from);if(console.log(`\u5220\u9664${Dr}\u4E2A\uFF0C \u524D\u9762\u6709${Ke}\u4E2A\uFF0C\u65B0\u589E${vr}\u4E2A`),Dr>1){const Lt=Array.from({length:Dr},(_n,ci)=>Ke+ci);Yn(Lt)}else Yn(Ke)}else if(vr>0){const Dr=ki(mi,fi.from);console.log(`\u65B0\u589E${vr}\u4E2A\uFF0C\u4E4B\u524D\u6709${Dr}\u4E2A`),wn(vr,Dr)}}},$i=()=>{const mi=Rn.getFieldValue(["sub_item_banks",...ji]);Rn.setFieldValue(["sub_item_banks",...ji],mi==null?void 0:mi.map((fi,wn)=>ct(Ye({},fi),{position:wn+1})))},ir=(0,yt.useRef)(),Mt=(mi,fi)=>{for(let wn=0;wn<mi;wn++)ir.current({position:null,answer_text:[""]},fi+wn);$i()},_t=(0,yt.useRef)(),At=mi=>{_t.current(mi),$i()},xi=(li=(gn=Rn.getFieldValue("sub_item_banks"))==null?void 0:gn[ji==null?void 0:ji[0]])==null?void 0:li[ji==null?void 0:ji[1]];return(0,yt.useEffect)(()=>{console.log("========",Rn.getFieldsValue())},[Rn]),pe.createElement("div",{className:kt.Z.wrap},pe.createElement("div",{className:kt.Z.questionTitleEditorWrap},pe.createElement(at.default.Item,{label:"\u9898\u5E72",name:Gi,labelCol:{span:24},rules:[{required:!0}]},pe.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn,showNullButton:!0,onCMBeforeChange:(mi,fi)=>{Ji(mi,fi,Mt,At)}}))),pe.createElement(at.default.List,{name:ji,rules:[{validator(mi,fi){if((fi==null?void 0:fi.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const wn of fi){const{answer_text:Yn}=wn||{};if(Yn!=null&&Yn.some(Qi=>(Qi==null?void 0:Qi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(mi,{add:fi,remove:wn},{errors:Yn})=>(ir.current=fi,_t.current=wn,pe.createElement(pe.Fragment,null,pe.createElement(at.default.Item,{label:pe.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(mi!=null&&mi.length)&&pe.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),mi.map((Qi,vr)=>{var Dr=Qi,{key:Ke,name:Lt}=Dr,_n=$e(Dr,["key","name"]);return pe.createElement(Ct.Z,{align:"top",key:Ke},pe.createElement(ot.Z,{className:`${kt.Z.blankIndex} pt5`},"\u586B\u7A7A\u9879",vr+1),pe.createElement(ot.Z,{flex:1},pe.createElement(Ct.Z,{align:"top",justify:"space-between"},pe.createElement(ot.Z,{flex:1},pe.createElement(at.default.Item,ct(Ye({},_n),{name:[Lt,"answer_text"],noStyle:!0}),pe.createElement(Et,null))),Ni&&pe.createElement(ot.Z,{flex:"224px"},pe.createElement(at.default.Item,ct(Ye({},_n),{name:[Lt,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:kt.Z.blankInputNumberWrapper}),pe.createElement(We.Z,{className:kt.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),pe.createElement(at.default.Item,ct(Ye({},_n),{name:[Lt,"position"],noStyle:!0}),pe.createElement(de.default,{type:"hidden"}))))})))),pe.createElement(Ct.Z,{align:"middle"},pe.createElement(at.default.Item,{name:[Jn,"downcase"],valuePropName:"checked"},pe.createElement(se.Z,null)),pe.createElement(ot.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),pe.createElement(Ct.Z,{align:"middle"},pe.createElement(at.default.Item,{name:[Jn,"no_space"],valuePropName:"checked"},pe.createElement(se.Z,null)),pe.createElement(ot.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(xi==null?void 0:xi.length)>1&&pe.createElement(Ct.Z,{align:"middle",className:(xi==null?void 0:xi.length)>1?"mb30":`${kt.Z.hide}`},pe.createElement(at.default.Item,{name:be},pe.createElement(Pt,null)),pe.createElement(ot.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),pe.createElement("div",{className:"mt30",onClick:()=>oi(!0)},pe.createElement(at.default.Item,{name:Fr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pe.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Hn}))))};var qt=Le(59301),vn=Object.defineProperty,tn=Object.defineProperties,it=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,ni=Object.prototype.propertyIsEnumerable,Kn=(Gn,Rn,Jn)=>Rn in Gn?vn(Gn,Rn,{enumerable:!0,configurable:!0,writable:!0,value:Jn}):Gn[Rn]=Jn,Rt=(Gn,Rn)=>{for(var Jn in Rn||(Rn={}))dn.call(Rn,Jn)&&Kn(Gn,Jn,Rn[Jn]);if(rt)for(var Jn of rt(Rn))ni.call(Rn,Jn)&&Kn(Gn,Jn,Rn[Jn]);return Gn},En=(Gn,Rn)=>tn(Gn,it(Rn)),Bn=(Gn,Rn)=>{var Jn={};for(var Ni in Gn)dn.call(Gn,Ni)&&Rn.indexOf(Ni)<0&&(Jn[Ni]=Gn[Ni]);if(Gn!=null&&rt)for(var Ni of rt(Gn))Rn.indexOf(Ni)<0&&ni.call(Gn,Ni)&&(Jn[Ni]=Gn[Ni]);return Jn};const ui={\u6B63\u786E:"T",\u9519\u8BEF:"F"},It=({value:Gn,onChange:Rn,form:Jn,choiceKey:Ni})=>{const ji=(Gn==null?void 0:Gn.is_answer)===1,Gi=Gn==null?void 0:Gn.choice_text,Fr=()=>{var be;const gn=(be=Jn==null?void 0:Jn.getFieldValue(["sub_item_banks",...Ni]))==null?void 0:be.map(li=>({choice_text:li.choice_text,is_answer:0}));Jn==null||Jn.setFieldValue(["sub_item_banks",...Ni],gn),Rn(En(Rt({},Gn),{is_answer:1}))};return qt.createElement(Ct.Z,{className:kt.Z.choiceWrap,align:"middle",wrap:!1},qt.createElement(ot.Z,{onClick:Fr,className:`${kt.Z.choiceIndex} ${kt.Z.judgementIndex} ${ji?kt.Z.activeAnswer:""}`},ui[Gi]),qt.createElement(ot.Z,{flex:1,className:`${kt.Z.editorWrap} ml15`},qt.createElement("div",{className:`${kt.Z.inputBorder} ${kt.Z.placeholder} ${ji?kt.Z.activeJudgementAnswer:""}`},Gi)),qt.createElement(ot.Z,{flex:"0 0 auto",className:"ml15"},qt.createElement("div",{onClick:Fr,className:`${kt.Z.setAnswerBtn} ${ji?kt.Z.activeAnswer:""}`},ji?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},On=({questionTitlePlaceholder:Gn,choiceKey:Rn="choices",form:Jn,titleKey:Ni="name",analysisKey:ji="analysis"})=>{const[Gi,Fr]=(0,yt.useState)(!1);return qt.createElement("div",{className:kt.Z.wrap},qt.createElement("div",{className:kt.Z.questionTitleEditorWrap},qt.createElement(at.default.Item,{label:"\u9898\u5E72",name:Ni,labelCol:{span:24},rules:[{required:!0}]},qt.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn}))),qt.createElement(at.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},qt.createElement(at.default.List,{name:Rn,rules:[{validator(be,gn){return gn.some(Hn=>(Hn==null?void 0:Hn.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},be=>qt.createElement("div",{id:"choices",style:{display:"flex",flexDirection:"column",gap:"20px"}},be.map(gn=>{var li=gn,{key:Hn,name:oi}=li,ki=Bn(li,["key","name"]);return qt.createElement(at.default.Item,En(Rt({},ki),{key:Hn,name:oi,noStyle:!0}),qt.createElement(It,{form:Jn,choiceKey:Rn}))})))),qt.createElement("div",{className:"mt30",onClick:()=>Fr(!0)},qt.createElement(at.default.Item,{name:ji,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},qt.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Gi}))))};var ht=Le(6767),kn=Le(96599),Oi=Le(39793),ze=Le(61485),Me=Object.defineProperty,Ee=Object.defineProperties,Te=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,on=(Gn,Rn,Jn)=>Rn in Gn?Me(Gn,Rn,{enumerable:!0,configurable:!0,writable:!0,value:Jn}):Gn[Rn]=Jn,Kt=(Gn,Rn)=>{for(var Jn in Rn||(Rn={}))Ae.call(Rn,Jn)&&on(Gn,Jn,Rn[Jn]);if(He)for(var Jn of He(Rn))et.call(Rn,Jn)&&on(Gn,Jn,Rn[Jn]);return Gn},pn=(Gn,Rn)=>Ee(Gn,Te(Rn)),Nt=(Gn,Rn)=>{var Jn={};for(var Ni in Gn)Ae.call(Gn,Ni)&&Rn.indexOf(Ni)<0&&(Jn[Ni]=Gn[Ni]);if(Gn!=null&&He)for(var Ni of He(Gn))Rn.indexOf(Ni)<0&&et.call(Gn,Ni)&&(Jn[Ni]=Gn[Ni]);return Jn};const Dt=Gn=>{var Rn=Gn,{value:Jn,onChange:Ni}=Rn,ji=Nt(Rn,["value","onChange"]);const Gi=Fr=>{Ni([Fr])};return yt.createElement(Oi.Z,pn(Kt({},ji),{defaultValue:Jn==null?void 0:Jn[0],onChange:Gi}))},Ot=Gn=>{if(!Gn)return!1;let Rn=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return Gn==="|"?(ht.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},un=({value:Gn=[],onClose:Rn})=>yt.createElement(kn.default,{closable:!0,onClose:Rn,className:kt.Z.keywordTag},yt.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},Gn.join(" \u6216 "))),Sn=({questionTitlePlaceholder:Gn,form:Rn,showKeywords:Jn,isMustKeyWords:Ni=Jn,titleKey:ji="name",analysisKey:Gi="analysis",answerTexts:Fr="answer_texts",keywords:be="keywords",useKeywords:gn="use_keywords",indexs:li})=>{const[Hn,oi]=(0,yt.useState)(!1),[ki,Ji]=(0,yt.useState)(""),[$i,ir]=(0,yt.useState)(!1),Mt=at.default.useWatch("question_score",Rn);return yt.createElement("div",{className:kt.Z.wrap},yt.createElement("div",{className:kt.Z.questionTitleEditorWrap},yt.createElement(at.default.Item,{label:"\u9898\u5E72",name:ji,labelCol:{span:24},rules:[{required:!0}]},yt.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn}))),yt.createElement(at.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Fr,labelCol:{span:24}},yt.createElement(Dt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Jn&&!Ni&&yt.createElement(at.default.Item,{hidden:!0,name:gn,valuePropName:"checked"},yt.createElement(se.Z,{defaultChecked:!0})),Jn&&Ni&&yt.createElement(Ct.Z,{align:"middle",className:"mb30"},yt.createElement(at.default.Item,{name:gn,valuePropName:"checked"},yt.createElement(se.Z,{onChange:()=>{var _t,At,xi,mi,fi,wn;console.log(Rn.getFieldsValue()),ir((xi=(At=(_t=Rn.getFieldsValue())==null?void 0:_t.sub_item_banks)==null?void 0:At[li])==null?void 0:xi.use_keywords),console.log((wn=(fi=(mi=Rn.getFieldsValue())==null?void 0:mi.sub_item_banks)==null?void 0:fi[li])==null?void 0:wn.use_keywords),console.log($i)}})),yt.createElement(ot.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),yt.createElement(ot.Z,null,yt.createElement(Tt.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},yt.createElement(ze.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),($i||!Ni)&&yt.createElement(at.default.List,{name:be,rules:[{validator(_t,At){return Ni?At!=null&&At.length?(At==null?void 0:At.reduce((mi,fi)=>mi+fi.score,0))>parseFloat(Mt)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(_t,{add:At,remove:xi})=>yt.createElement(yt.Fragment,null,yt.createElement("div",{className:`${kt.Z.title} mb10`},Ni?"\u5173\u952E\u8BCD":yt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),yt.createElement(Ct.Z,{align:"middle",className:"font14 mb30"},yt.createElement(ot.Z,{flex:1},yt.createElement(de.default,{value:ki,onChange:mi=>{Ji(mi.target.value)},maxLength:50,allowClear:!0,onPressEnter:mi=>{var fi,wn,Yn,Qi;const vr=`${(fi=mi.target)==null?void 0:fi.value}`,Dr=(Yn=(wn=vr==null?void 0:vr.split("|"))==null?void 0:wn.filter(_n=>!!_n))==null?void 0:Yn.map(_n=>_n==null?void 0:_n.trim()),Ke=Rn.getFieldValue(["sub_item_banks",...be]),Lt=((Qi=Ke==null?void 0:Ke.map(_n=>_n==null?void 0:_n.keyword))==null?void 0:Qi.flat())||[];for(const _n of Dr)if(Lt.includes(_n)){ht.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Ot(vr)&&(At({keyword:Dr,score:1}),Ji(""))},className:kt.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),yt.createElement(ot.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),_t.map(mi=>{var fi=mi,{key:wn,name:Yn}=fi,Qi=Nt(fi,["key","name"]);return yt.createElement(Ct.Z,{key:wn,className:"mb20",style:{marginRight:148}},yt.createElement(ot.Z,{flex:1},yt.createElement(Ct.Z,{align:"middle",justify:"space-between"},yt.createElement(at.default.Item,pn(Kt({},Qi),{name:[Yn,"keyword"]}),yt.createElement(un,{onClose:()=>xi(Yn)})),Ni&&yt.createElement(at.default.Item,pn(Kt({},Qi),{name:[Yn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:kt.Z.blankInputNumberWrapper}),yt.createElement(We.Z,{className:kt.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),yt.createElement("div",{onClick:()=>oi(!0)},yt.createElement(at.default.Item,{name:Gi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},yt.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Hn}))))};var An=Le(59301),Dn=Object.defineProperty,Ai=Object.defineProperties,en=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertySymbols,ln=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable,cn=(Gn,Rn,Jn)=>Rn in Gn?Dn(Gn,Rn,{enumerable:!0,configurable:!0,writable:!0,value:Jn}):Gn[Rn]=Jn,Yt=(Gn,Rn)=>{for(var Jn in Rn||(Rn={}))ln.call(Rn,Jn)&&cn(Gn,Jn,Rn[Jn]);if(Qt)for(var Jn of Qt(Rn))di.call(Rn,Jn)&&cn(Gn,Jn,Rn[Jn]);return Gn},ii=(Gn,Rn)=>Ai(Gn,en(Rn)),Vi=(Gn,Rn)=>{var Jn={};for(var Ni in Gn)ln.call(Gn,Ni)&&Rn.indexOf(Ni)<0&&(Jn[Ni]=Gn[Ni]);if(Gn!=null&&Qt)for(var Ni of Qt(Gn))Rn.indexOf(Ni)<0&&di.call(Gn,Ni)&&(Jn[Ni]=Gn[Ni]);return Jn};const{Panel:bi}=Oe.default,Di=({questionTitlePlaceholder:Gn,choiceKey:Rn,form:Jn,withScore:Ni})=>{const[ji,Gi]=(0,yt.useState)([]),Fr=be=>{Gi(be)};return An.createElement("div",{className:kt.Z.wrap},An.createElement("div",{className:kt.Z.questionTitleEditorWrap},An.createElement(at.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},An.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn}))),An.createElement(at.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),An.createElement(at.default.List,{name:"sub_item_banks",rules:[{validator(be,gn){return gn?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(be,{add:gn,remove:li,move:Hn})=>{const oi=Jn.getFieldValue("sub_item_banks");return An.createElement(An.Fragment,null,An.createElement(Oe.default,{className:be.length>0?kt.Z.collapseWrapper:"",bordered:!1,activeKey:ji,onChange:Fr,expandIcon:({isActive:ki})=>An.createElement("i",{className:`iconfont icon-weizhankai ${ki?kt.Z.open:kt.Z.close}`,style:{fontSize:14,transition:"all .2s"}})},be.map((ki,Ji)=>{var $i=ki,{key:ir,name:Mt}=$i,_t=Vi($i,["key","name"]),At,xi,mi,fi,wn,Yn,Qi,vr,Dr,Ke;return An.createElement(bi,{className:kt.Z.panel,forceRender:!0,header:An.createElement("div",{className:kt.Z.panelHeader},"\u7B2C",Ji+1,"\u5C0F\u9898",An.createElement("span",null,"\uFF08",((At=oi==null?void 0:oi[Mt])==null?void 0:At.item_type)=="SINGLE"?"\u5355\u9009\u9898":((xi=oi==null?void 0:oi[Mt])==null?void 0:xi.item_type)=="MULTIPLE"?"\u591A\u9009\u9898":((mi=oi==null?void 0:oi[Mt])==null?void 0:mi.item_type)=="COMPLETION"?"\u586B\u7A7A\u9898":((fi=oi==null?void 0:oi[Mt])==null?void 0:fi.item_type)=="JUDGMENT"?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:Mt,extra:An.createElement(Ct.Z,{align:"middle",onClick:Lt=>Lt.stopPropagation()},Ni&&An.createElement(ot.Z,null,An.createElement(at.default.Item,ii(Yt({},_t),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[Mt,"question_score"],className:kt.Z.blankInputNumberWrapper}),An.createElement(We.Z,{className:kt.Z.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}}))),An.createElement(ot.Z,null,An.createElement(Ct.Z,{align:"middle",className:"pl40",justify:"end"},Ji!==0&&An.createElement("div",{onClick:()=>{var Lt;Hn(Ji,Ji-1);const _n=(Lt=Jn.getFieldValue("sub_item_banks"))==null?void 0:Lt.map((ci,$t)=>(be.map((xn,Xt)=>{$t===Xt&&(ci.q_position=Number(xn.name)+1)}),ci));Jn.setFieldValue("sub_item_banks",_n)}},An.createElement(Tt.Z,{title:"\u4E0A\u79FB"},An.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),Ji<be.length-1&&An.createElement("div",{onClick:()=>{var Lt;Hn(Ji,Ji+1);const _n=(Lt=Jn.getFieldValue("sub_item_banks"))==null?void 0:Lt.map((ci,$t)=>(be.map((xn,Xt)=>{$t===Xt&&(ci.q_position=Number(xn.name)+1)}),ci));Jn.setFieldValue("sub_item_banks",_n)},className:Ji===0?"":"ml15"},An.createElement(Tt.Z,{title:"\u4E0B\u79FB"},An.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"}))))),An.createElement(ot.Z,null,An.createElement(Tt.Z,{title:"\u5220\u9664"},An.createElement(De.Z,{className:`${kt.Z.deleteIcon} ml15`,onClick:()=>li(Mt)}))))},An.createElement(at.default.Item,ii(Yt({},_t),{name:Mt}),(((wn=oi==null?void 0:oi[Mt])==null?void 0:wn.item_type)=="SINGLE"||((Yn=oi==null?void 0:oi[Mt])==null?void 0:Yn.item_type)=="MULTIPLE")&&An.createElement(le.u,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Qi=oi==null?void 0:oi[Mt])==null?void 0:Qi.item_type)=="MULTIPLE",form:Jn,choiceKey:[Mt,"choices"],titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],choiceOptionsPath:["sub_item_banks",Mt,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((vr=oi==null?void 0:oi[Mt])==null?void 0:vr.item_type)=="COMPLETION"&&An.createElement(fn,{form:Jn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,name:Mt,titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],isOrdered:[Mt,"is_ordered"],answerKey:[Mt,"standard_answers"]}),((Dr=oi==null?void 0:oi[Mt])==null?void 0:Dr.item_type)=="JUDGMENT"&&An.createElement(On,{form:Jn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],choiceKey:[Mt,"choices"]}),((Ke=oi==null?void 0:oi[Mt])==null?void 0:Ke.item_type)=="SUBJECTIVE"&&An.createElement(Sn,{showKeywords:!0,isMustKeyWords:!1,form:Jn,titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],answerTexts:[Mt,"answer_texts"],useKeywords:[Mt,"use_keywords"],keywords:[Mt,"keywords"],indexs:Mt,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})),be.length<20&&An.createElement(dt.Z,{menu:{items:[{label:An.createElement("div",{onClick:()=>{gn({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"SINGLE"}),Gi([be==null?void 0:be.length,...ji])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:An.createElement("div",{onClick:()=>{gn({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"MULTIPLE"}),Gi([be==null?void 0:be.length,...ji])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:An.createElement("div",{onClick:()=>{gn({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),Gi([be==null?void 0:be.length,...ji])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:An.createElement("div",{onClick:()=>{gn({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),Gi([be==null?void 0:be.length,...ji])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:An.createElement("div",{onClick:()=>{gn({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),Gi([be==null?void 0:be.length,...ji])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(ki=>ki.show).map(ki=>({label:ki.label,key:ki.key}))}},An.createElement("div",{className:`${kt.Z.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var Mr=Le(68571)},76902:function(Zn,ei,Le){"use strict";Le.d(ei,{z:function(){return st},Z:function(){return nt}});var le=Le(59301),Ue=Le(8944),pt=Le(81428),St=Le(64018),yt=Le(79710),Oe=Le(346),at=Le(51257),Ct=Le(15342),ot=Le(1012),We=Le(45677),Tt=Le(59301),kt=({html:Ye})=>{const ct=(0,le.useRef)(null),$e=(0,le.useRef)(null),Et=`.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,le.useEffect)(()=>{const Pt=ct.current.attachShadow({mode:"open"});$e.current=document.createElement("div"),$e.current.className="markdown-body",$e.current.innerHTML=Ye,Pt.appendChild($e.current);const Bt=document.createElement("style");return Bt.textContent=Et,Pt.appendChild(Bt),()=>{Pt.innerHTML=""}},[]),(0,le.useEffect)(()=>{$e.current&&($e.current.innerHTML=Ye)},[Ye]),Tt.createElement("div",{ref:ct})};function De(Ye){const ct=["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"],$e=new RegExp(`\\b(${ct.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Ye.replace($e,"").trim()}var ne=Object.defineProperty,te=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,pe=(Ye,ct,$e)=>ct in Ye?ne(Ye,ct,{enumerable:!0,configurable:!0,writable:!0,value:$e}):Ye[ct]=$e,ye=(Ye,ct)=>{for(var $e in ct||(ct={}))de.call(ct,$e)&&pe(Ye,$e,ct[$e]);if(te)for(var $e of te(ct))se.call(ct,$e)&&pe(Ye,$e,ct[$e]);return Ye};const we="@\u2581\u2581@",Ce="@\u2581@",_e=/<pre[^>]*>/g;function Ze(Ye){let ct=document.createElement("div");return ct.innerHTML=Ye,ct.childNodes.length===0?"":ct.childNodes[0].nodeValue}const st=(Ye,ct)=>{Ye=Ye||"";const $e=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Et=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Pt=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Bt=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ct?Ye.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace($e,(fn,qt,vn,tn,it,rt,dn)=>{const ni=qt||tn||rt,Kn=vn||it||dn||"?";return Oe.Z.API_SERVER+"/api/attachments/"+ni+Kn+"&t="+(0,at.Jn)(ni,Date.now())+(fn.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Ye=Ye.replace(Bt,(fn,qt,vn,tn,it,rt,dn)=>{const ni=qt||tn||rt,Kn=vn||it||dn||"?";return Oe.Z.API_SERVER+"/attachments/download/"+ni+Kn+"&t="+(0,at.Jn)(ni,Date.now())+(fn.indexOf(")")>-1?")":"&")}).replace($e,(fn,qt,vn,tn,it,rt,dn)=>{const ni=qt||tn||rt,Kn=vn||it||dn||"?";return Oe.Z.API_SERVER+"/api/attachments/"+ni+Kn+"&t="+(0,at.Jn)(ni,Date.now())+(fn.indexOf(")")>-1?")":"&")}).replace(Et,(fn,qt,vn,tn,it)=>{const rt=qt||tn,dn=vn||it||"";return'"'+Oe.Z.API_SERVER+"/api/attachments/"+rt+dn+rt+dn+"&t="+(0,at.Jn)(rt,Date.now())}).replace(Pt,(fn,qt,vn,tn,it)=>{const rt=qt||tn,dn=vn||it||"";return"("+Oe.Z.API_SERVER+"/files/uploads/"+rt+dn+rt+dn+"&t="+(0,at.Jn)(rt,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,`
|
|
`),Ye)};var nt=({value:Ye="",className:ct,showTextOnly:$e,showLines:Et,style:Pt={},stylesPrev:Bt={},highlightKeywords:fn,showProgramFill:qt,isProgramFill:vn,disabledFill:tn=!1,programFillValue:it,onFillChange:rt=Kn=>{},onFillBlur:dn=()=>{},onFillFocus:ni=()=>{}})=>{let Kn=De(String(Ye||""));const[Rt,En]=(0,le.useState)(""),[Bn,ui]=(0,le.useState)("office"),[It,On]=(0,le.useState)([]),ht=(0,le.useRef)("a"+(0,ot.Z)()),kn={},Oi=Dt=>/<style[\s\S]*?>/i.test(Dt||""),ze=(Dt,Ot,un)=>{const Sn=document.createElement(Dt===Ce?"input":"textarea");Sn.style.width="100%",Sn.style.height=Dt===Ce?"40px":"151px",Sn.rows=5,Sn.spellcheck=!1,Sn.name="edu-program-fill",Sn.placeholder="\u8BF7\u8F93\u5165",Sn.dataset.id=Ot;const An=Object.keys(kn).length;return kn[An]=Sn,`<span class="edu-program-fill-wrap ${Dt===Ce?"":"show"}" style="width:${Dt===Ce?"400px":"100%"}" title=${un||""}><span>${Sn.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Me(Dt){return Dt=Dt.replace(/!\[.*?\]\(.*?\)/g,""),Dt=Dt.replace(/\[.*?\]\(.*?\)/g,""),Dt=Dt.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Dt=Dt.replace(/<embed.*?>/g,""),Dt=Dt.replace(/<img.*?>/g,""),Dt=Dt.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Dt=Dt.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Dt=Dt.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Dt=Dt.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Dt}const Ee=Dt=>!$e&&Oi(Kn)?Dt:Dt.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Ot,un){let Sn=un.replace(/(\n|\r)/g,"").split("}"),An=[];return Sn.map(Dn=>{Dn!=""&&An.push(`.${ht.current} ${Dn}`)}),`<style>${An.join("}")}</style>`}),Te=(0,le.useMemo)(()=>{try{const Sn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,An=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Dn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Ai=/\(\/attachments\/download\//g;Kn=Kn.replace(Ai,"("+Oe.Z.API_SERVER+"/attachments/download/").replace(Sn,"("+Oe.Z.API_SERVER+"/api/attachments/").replace(An,'"'+Oe.Z.API_SERVER+"/api/attachments/").replace(Dn,'"'+Oe.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(Sn){}if(qt){let Sn=-1;return Kn=Kn.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(An,Dn,Ai){var en;return++Sn,ze(An,Sn,(en=it==null?void 0:it[Sn])==null?void 0:en.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${Ee(Kn||"")}</pre>`}let Dt=Ee(Kn);Dt=(0,pt.ZP)(Dt);const Ot=(0,pt.ez)();Kn.match(/\[TOC\]/)&&(Dt=Dt.replace("<p>[TOC]</p>",(0,pt.Qv)()),(0,pt.Iy)()),Dt=Dt.replace(/(__special_katext_id_\d+__)/g,(Sn,An)=>{const{type:Dn,expression:Ai}=Ot[An];return(0,Ct.renderToString)(Ze(Ai)||"",{displayMode:Dn==="block",throwOnError:!1,output:"html"})}),Dt=Dt.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,pt.AL)();const un=document.createElement("div");if(un.innerHTML=Dt,$e)return un.innerText;if(fn){const Sn=fn.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return on(un,Sn),un.innerHTML}return setTimeout(()=>Nt(),500),un.innerHTML},[Kn,fn]);(0,le.useEffect)(()=>{Kt.current&&Kt.current.querySelectorAll(["input","textarea"]).forEach(Ot=>{Ot.oninput=He,Ot.onblur=Ae,Ot.onfocus=et})},[It]),(0,le.useEffect)(()=>{var Dt,Ot,un,Sn,An;if(it!=null&&it.length)try{const Dn=Kt.current.querySelectorAll(".edu-program-fill-score"),Ai=Kt.current.querySelectorAll('[name="edu-program-fill"]');for(const[en,Qt]of Ai.entries())Qt.value=((Dt=it==null?void 0:it[en])==null?void 0:Dt.value)||"",((Ot=it==null?void 0:it[en])==null?void 0:Ot.type)==="warning"?Qt.className="program-fill-warning":((un=it==null?void 0:it[en])==null?void 0:un.type)==="success"?Qt.className="program-fill-success":Qt.className="";for(const[en,Qt]of Dn.entries())Qt.innerHTML=(Sn=it==null?void 0:it[en])!=null&&Sn.score?`${(An=it==null?void 0:it[en])==null?void 0:An.score}\u5206`:"";On(it)}catch(Dn){console.log(Dn,"error")}},[it]);const He=Dt=>{It[Dt.target.dataset.id]=It[Dt.target.dataset.id]||{},It[Dt.target.dataset.id].value=Dt.target.value,On([...It]),rt(It,Dt.target.dataset.id)},Ae=Dt=>{It[Dt.target.dataset.id]=It[Dt.target.dataset.id]||{},It[Dt.target.dataset.id].value=Dt.target.value,On([...It]),dn(It,Dt.target.dataset.id)},et=Dt=>{It[Dt.target.dataset.id]=It[Dt.target.dataset.id]||{},It[Dt.target.dataset.id].value=Dt.target.value,On([...It]),ni(It,Dt.target.dataset.id)};function on(Dt,Ot){return Dt.childNodes.forEach(un=>{var Sn;if(un.childNodes.length>0)on(un,Ot);else if(un.nodeName!=="IMG")if(un.innerHTML)un.innerHTML=(Sn=un.innerHTML)==null?void 0:Sn.replace(new RegExp(Ot,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const An=document.createElement("span");An.innerHTML=un.textContent.replace(new RegExp(Ot,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),un.replaceWith(An)}})}const Kt=(0,le.useRef)();pt.jb.WebkitLineClamp=Et,Et&&(Pt=ye(ye({},Pt),pt.jb));function pn(Dt){let Ot=Dt.target;if(Ot.tagName.toUpperCase()==="A"){let un=Ot.getAttribute("href");if(un.indexOf("office")>-1)Dt.preventDefault(),En(un),ui("office");else if(un.indexOf("application/pdf")>-1)Dt.preventDefault(),En(un),ui("pdf");else if(un.indexOf("text/html")>-1)Dt.preventDefault(),En(un),ui("html");else if(un.startsWith("#")){Dt.preventDefault();let Sn=document.getElementById(un.replace("#",""));Sn&&Sn.scrollIntoView(!0)}}}const Nt=()=>{var Dt;const Ot=(Dt=Kt.current)==null?void 0:Dt.querySelectorAll("video");Ot==null||Ot.forEach(un=>{if(un.oncontextmenu=()=>!1,un.src.indexOf(".m3u8")>-1&&!un.canPlayType("application/vnd.apple.mpegurl")){if(yt.ZP.isSupported()){var Sn=new yt.ZP;Sn.loadSource(un.src),Sn.attachMedia(un)}}})};return(0,le.useEffect)(()=>{if(Kt.current&&Te&&Te.match(_e)&&window.PR.prettyPrint(),Kt.current)return Kt.current.addEventListener("click",pn),()=>{var Dt;(Dt=Kt.current)==null||Dt.removeEventListener("click",pn),(0,pt.AL)(),(0,pt.Iy)()}},[Te,Kt.current,pn]),(0,le.useEffect)(()=>{var Dt;const Ot=un=>{un.preventDefault(),un.clipboardData.setData("text",window.getSelection().toString())};return(Dt=Kt.current)==null||Dt.addEventListener("copy",Ot),()=>{var un;(un=Kt.current)==null||un.removeEventListener("copy",Ot)}},[Kt.current]),le.createElement(le.Fragment,null,$e&&le.createElement("div",{ref:Kt},Te),!$e&&!Oi(Te)&&le.createElement("div",{ref:Kt,style:ye({},Pt),className:`${ct||""} ${tn?"disabled-fill":""} markdown-body ${ht.current}`,dangerouslySetInnerHTML:{__html:Te}}),!$e&&Oi(Te)&&le.createElement(kt,{html:Te}),le.createElement(We.Z,{close:!0,data:Rt,type:Rt!=null&&Rt.length?Bn:"",style:ye({},Bt),onClose:()=>En("")}))}},60572:function(Zn,ei,Le){"use strict";Le.d(ei,{C:function(){return fn}});var le=Le(59301),Ue={recalculation:"recalculation____i9AE",tips:"tips___GoMu8",filter:"filter___Vx7VO",input:"input___OEMMv",operating:"operating___TS9iA",operatingItem:"operatingItem___AT84q"},pt=Le(92310),St=Le.n(pt),yt=Le(62673),Oe=Le(77019),at=Le(6767),Ct=Le(25399),ot=Le(99571),We=Le(62957),Tt=Le(54172),dt=Le(71051),kt=Le(28284),De=Le(29787),ne=Le(51257),te=Le(38986),de=Le(48790),se=Le(54650),pe=Le(9148),ye=Object.defineProperty,we=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,nt=(qt,vn,tn)=>vn in qt?ye(qt,vn,{enumerable:!0,configurable:!0,writable:!0,value:tn}):qt[vn]=tn,Ye=(qt,vn)=>{for(var tn in vn||(vn={}))Ze.call(vn,tn)&&nt(qt,tn,vn[tn]);if(_e)for(var tn of _e(vn))st.call(vn,tn)&&nt(qt,tn,vn[tn]);return qt},ct=(qt,vn)=>we(qt,Ce(vn)),$e=(qt,vn,tn)=>new Promise((it,rt)=>{var dn=Rt=>{try{Kn(tn.next(Rt))}catch(En){rt(En)}},ni=Rt=>{try{Kn(tn.throw(Rt))}catch(En){rt(En)}},Kn=Rt=>Rt.done?it(Rt.value):Promise.resolve(Rt.value).then(dn,ni);Kn((tn=tn.apply(qt,vn)).next())});const Et=yt.default.Group,Pt=({className:qt,title:vn,items:tn=[],value:it,onChange:rt})=>{const dn=(tn==null?void 0:tn.length)===(it==null?void 0:it.length),ni=(it==null?void 0:it.length)>0&&(it==null?void 0:it.length)<(tn==null?void 0:tn.length),Kn=Rt=>{const En=tn.map(Bn=>Bn.id);rt(Rt.target.checked?En:[])};return le.createElement(Oe.Z,{align:"middle",className:qt},!!vn&&le.createElement("div",{className:"mr20",style:{color:"#5F6368"}},vn),le.createElement(yt.default,{indeterminate:ni,onChange:Kn,checked:dn},"\u5168\u90E8"),le.createElement(Et,{value:it,onChange:rt},tn.map(Rt=>le.createElement(yt.default,{className:"ml30 c-black",key:Rt.id,value:Rt.id},Rt.name,le.createElement("span",null,`(${Rt.count})`)))))};var fn=({className:qt,style:vn,dataSource:tn})=>{var it,rt,dn,ni,Kn,Rt,En;const[Bn,ui]=(0,le.useState)({}),[It,On]=(0,le.useState)(!0),[ht,kn]=(0,le.useState)(!1),[Oi,ze]=(0,le.useState)(!1),[Me,Ee]=(0,le.useState)(null),[Te,He]=(0,le.useState)(0),[Ae,et]=(0,le.useState)({}),[on,Kt]=(0,le.useState)(!0),[pn,Nt]=(0,le.useState)(0),[Dt,Ot]=(0,le.useState)(0),[un,Sn]=(0,le.useState)(!1),An=(0,le.useRef)(null),[Dn,Ai]=(0,le.useState)(!1),[en,Qt]=(0,le.useState)(!0),[ln,di]=(0,le.useState)([]),cn={page:1,per_page:5,keyword:"",review:[],question_status:[],success_status:[],sort_by:null,direction:null},[Yt,ii]=(0,le.useState)(Ye({},cn));(0,le.useEffect)(()=>{tn!=null&&tn.question_id&&ui(tn)},[tn==null?void 0:tn.question_id]),(0,le.useEffect)(()=>{var gn;if(((gn=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:gn.status)==="running"){const li=setInterval(()=>{Di()},3e3);return()=>clearInterval(li)}},[(it=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:it.status]),(0,le.useEffect)(()=>{var gn;Oi&&(Oi===1&&(Yt.question_status=Mr.map(li=>li.value),Yt.review=Gn.map(li=>li.value)),Oi===2&&(Yt.exercise_question_resubmit_id=(gn=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:gn.id,Me===1&&(Yt.success_status=[1]),Me===2&&(Yt.success_status=[0])),ii(Ye({},Yt)),Vi(Yt),Ot(Bn!=null&&Bn.is_mirror?3:10),Nt(Bn!=null&&Bn.is_mirror?1:5))},[Oi]),(0,le.useEffect)(()=>{Dn&&bi()},[Dn]);const Vi=gn=>$e(void 0,null,function*(){On(!0);const li=yield(0,te.ZP)(`/api/exercise_questions/${Bn==null?void 0:Bn.question_id}/resubmit_student_list.json`,{method:"get",params:gn});(li==null?void 0:li.status)==0&&(et(li||[]),He(li==null?void 0:li.count)),On(!1)}),bi=()=>$e(void 0,null,function*(){Qt(!0);const gn=yield(0,te.ZP)(`/api/exercise_questions/${Bn==null?void 0:Bn.question_id}/resubmit_history.json`,{method:"get"});(gn==null?void 0:gn.status)==0&&di((gn==null?void 0:gn.data)||[]),Qt(!1)}),Di=()=>$e(void 0,null,function*(){const gn=yield(0,te.ZP)(`/api/exercise_questions/${Bn==null?void 0:Bn.question_id}/resubmit_status.json`,{method:"get"});(gn==null?void 0:gn.status)==0&&ui(ct(Ye({},Bn),{show_resubmit_history:!0,exercise_question_resubmit:(gn==null?void 0:gn.data)||{}}))}),Mr=[{label:"\u672A\u8BC4\u6D4B",value:2,color:"#9096A3"},{label:"\u672A\u901A\u5173",value:0,color:"#E30000"},{label:"\u5DF2\u901A\u5173",value:1,color:"#00B187"}],Gn=[{label:"\u672A\u8BC4\u9605",value:0,color:"#9096A3"},{label:"\u8BC4\u9605\u4E2D",value:2,color:"#FF9D18"},{label:"\u5DF2\u8BC4\u9605",value:1,color:"#3061D0"}],Rn=[{label:"\u6210\u529F",value:1,color:"#00B187"},{label:"\u5931\u8D25",value:0,color:"#E30000"}],Jn=[{title:"\u5E8F\u53F7",dataIndex:"key",render:(gn,li,Hn)=>le.createElement("span",{className:"c-black"},Hn+1+(Yt.page-1)*Yt.per_page)},{title:"\u59D3\u540D",dataIndex:"user_name",render:gn=>le.createElement("span",{className:"c-black"},gn)},{title:"\u5B66\u53F7",dataIndex:"student_id",sorter:!0,render:gn=>le.createElement("span",{className:"c-grey-666"},gn||"--")},{title:"\u5206\u73ED",dataIndex:"group_name",render:gn=>le.createElement("span",{className:"c-black"},gn)},{title:"\u9898\u76EE\u72B6\u6001",dataIndex:"question_status",render:gn=>{const{label:li,color:Hn}=Mr.find(oi=>oi.value===gn)||{};return le.createElement("span",{style:{color:Hn}},li)}},{title:"\u9898\u76EE\u5F97\u5206",dataIndex:"question_score",sorter:!0,render:gn=>le.createElement("span",{className:"c-black"},gn)},{title:"\u6700\u7EC8\u6210\u7EE9",dataIndex:"score",sorter:!0,render:gn=>le.createElement("span",{className:"c-black"},gn)},{title:"\u8BC4\u9605\u72B6\u6001",dataIndex:"review",render:gn=>{const{label:li,color:Hn}=Gn.find(oi=>oi.value===gn)||{};return le.createElement("span",{style:{color:Hn}},li)}},Oi===2&&{title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",dataIndex:"success_status",render:gn=>{const{label:li,color:Hn}=Rn.find(oi=>oi.value===gn)||{};return le.createElement("span",{style:{color:Hn}},li)}}].filter(Boolean),Ni=(gn,li,Hn)=>{Yt.page=gn==null?void 0:gn.current,Yt.per_page=gn==null?void 0:gn.pageSize,Hn!=null&&Hn.order?(Yt.sort_by=Hn==null?void 0:Hn.field,Yt.direction=(Hn==null?void 0:Hn.order)==="ascend"?"asc":"desc"):(Yt.sort_by=null,Yt.direction=null),ii(Ye({},Yt)),Vi(Yt)},ji=()=>{if(!pn){at.ZP.warning("\u8BF7\u8F93\u5165\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570");return}Sn(!0)},Gi=()=>$e(void 0,null,function*(){var gn,li;if((gn=An.current)!=null&&gn.onVerify())return;kn(!0);const Hn=yield(0,te.ZP)(`/api/exercise_questions/${Bn==null?void 0:Bn.question_id}/resubmit.json`,{method:"post",body:{keyword:Yt.keyword,question_status:Yt.question_status,review:Yt.review_status,success_status:Yt.success_status,use_max_score:on,permits:pn,exercise_question_resubmit_id:Oi===1?null:(li=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:li.id}});(Hn==null?void 0:Hn.status)==0&&(yield Di(),at.ZP.success("\u64CD\u4F5C\u6210\u529F"),Sn(!1),ze(!1)),kn(!1)}),Fr=(gn,li)=>{Yt.page=1,Yt[li]=gn,ii(Ye({},Yt)),Vi(Yt)},be=["","\u5F53\u524D\u9898\u76EE\u7684\u5B9E\u9A8C\u8D44\u6E90\u4E3A\u4E13\u6709\u4E91\uFF0C\u4E0D\u652F\u6301\u91CD\u65B0\u8BC4\u6D4B~","\u8BE5\u529F\u80FD\u4EC5\u8BFE\u5802\u7BA1\u7406\u5458\u548C\u8003\u8BD5\u7684\u521B\u5EFA\u8005\u53EF\u4EE5\u64CD\u4F5C~"];return le.createElement(le.Fragment,null,le.createElement("div",{className:St()(Ue.recalculation,qt),style:vn},le.createElement(Ct.Z,{title:be[(Bn==null?void 0:Bn.disable_resubmit_reason)||0]},le.createElement(ot.ZP,{disabled:(Bn==null?void 0:Bn.disable_resubmit)||((rt=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:rt.status)==="running",onClick:()=>ze(1),icon:le.createElement("i",{className:"iconfont icon-zhongxinpingce font14"}),type:"primary",ghost:!0},"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206")),(Bn==null?void 0:Bn.show_resubmit_history)&&le.createElement(le.Fragment,null,((dn=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:dn.status)==="running"?le.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",le.createElement("span",{className:"c-light-primary ml3"},(ni=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:ni.rate)):le.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",le.createElement("span",{onClick:()=>{ze(2),Ee(1)},className:"current",style:{color:"#3061D0",textDecoration:"underline",margin:"0 3px"}},(Kn=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:Kn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",le.createElement("span",{onClick:()=>{ze(2),Ee(2)},className:"current",style:{color:"#E30000",textDecoration:"underline",margin:"0 3px"}},(Rt=Bn==null?void 0:Bn.exercise_question_resubmit)==null?void 0:Rt.fail_count),"\u4EBA"),le.createElement(Ct.Z,{title:"\u64CD\u4F5C\u8BB0\u5F55"},le.createElement("i",{onClick:()=>Ai(!0),className:"iconfont icon-chakanshenqingjilu c-light-primary current font14"})))),le.createElement(We.default,{centered:!0,open:!!Oi,title:`\u91CD\u65B0\u8BC4\u6D4B${Oi===1?"\u7B97\u5206":"\u7ED3\u679C"}`,width:870,okText:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",onCancel:()=>ze(!1),onOk:ji,afterClose:()=>{Kt(!0),Ee(null),ii(Ye({},cn))}},le.createElement("div",{className:Ue.filter},Oi===1&&le.createElement(le.Fragment,null,le.createElement("div",{className:Ue.tips},le.createElement("div",{className:"mb5",style:{color:"#FF9D18"}},le.createElement("i",{className:"iconfont icon-tishi9 mr10 font14"}),"\u6E29\u99A8\u63D0\u793A"),le.createElement("div",null,"1.\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206\u6D41\u7A0B\uFF1A \u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6\u5B66\u751F\u5728\u8003\u8BD5\u9875\u9762\u4FDD\u5B58\u7684\u6700\u65B0\u4EE3\u7801\uFF0C\u5E76\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\uFF0C\u4ECE\u800C\u7CBE\u51C6\u8BA1\u7B97\u51FA\u5B66\u751F\u7684\u6700\u7EC8\u5F97\u5206\uFF1B"),le.createElement("div",{style:{margin:"2px 0"}},"2.\u91CD\u65B0\u8BC4\u6D4B\u6761\u4EF6\uFF1A \u8003\u8BD5\u7ED3\u675F\u540E\uFF0C\u4EC5\u5BF9\u5DF2\u63D0\u4EA4\u8BD5\u5377\u4E14\u5DF2\u4F5C\u7B54\u8BE5\u9898\u76EE\u7684\u5B66\u751F\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\u4E0E\u7B97\u5206\uFF1B"),le.createElement("div",null,"3.\u91CD\u65B0\u8BC4\u6D4B\u65F6\uFF0C\u8BF7\u786E\u4FDD\u5B9E\u9A8C\u73AF\u5883\u80FD\u6B63\u5E38\u542F\u52A8\u5E76\u53EF\u8FD0\u884C\u8BC4\u6D4B\u3002")),le.createElement(Pt,{className:"mt10",title:"\u9898\u76EE\u72B6\u6001",items:(Ae==null?void 0:Ae.question_status)||[],value:Yt.question_status,onChange:gn=>Fr(gn,"question_status")}),le.createElement(Pt,{className:"mt10",title:"\u8BC4\u9605\u72B6\u6001",items:(Ae==null?void 0:Ae.review_status)||[],value:Yt.review,onChange:gn=>Fr(gn,"review")})),Oi===2&&le.createElement(le.Fragment,null,le.createElement(Pt,{className:"mt10",title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",items:(Ae==null?void 0:Ae.success_status)||[],value:Yt.success_status,onChange:gn=>Fr(gn,"success_status")})),le.createElement(pe.t7,{className:Ue.input,style:{bottom:Oi===1?10:-5},value:Yt.keyword,onChange:gn=>Fr(gn,"keyword"),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22"})),le.createElement(Tt.default,{className:"mt20",columns:Jn,scroll:((En=Ae==null?void 0:Ae.data)==null?void 0:En.length)>7?{y:300}:{},dataSource:(Ae==null?void 0:Ae.data)||[],loading:It,onChange:Ni,pagination:{total:Te,pageSize:Yt.per_page,current:Yt.page,hideOnSinglePage:!Te,showSizeChanger:!0,pageSizeOptions:["5","10","20","50","100"],showQuickJumper:!0,size:"default",showTotal:ne.rU}}),le.createElement(Oe.Z,{justify:"space-between",align:"middle",className:"mt10"},le.createElement(yt.default,{className:"c-black",checked:on,onChange:gn=>Kt(gn.target.checked)},"\u91CD\u65B0\u8BC4\u6D4B\u540E\u7684\u5206\u6570\u5927\u4E8E\u539F\u6765\u7684\u5206\u6570\u624D\u66F4\u65B0\u6210\u7EE9"),(0,de.Ny)()&&le.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570",le.createElement(dt.Z,{className:"ml10 mr10",value:pn,max:Dt,min:1,precision:0,onChange:gn=>Nt(gn)}),"\u4EBA",le.createElement(Ct.Z,{overlayStyle:{maxWidth:450},title:"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A20\u4EBA\uFF08\u81EA\u5B9A\u4E49\u955C\u50CF\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A3\u4EBA\uFF09\u3002"},le.createElement("i",{style:{color:"#9096A3"},className:"iconfont icon-tishi5 font13 ml10"}))))),le.createElement(We.default,{centered:!0,title:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",open:un,width:494,zIndex:1001,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:ht,destroyOnClose:!0,onOk:Gi,onCancel:()=>Sn(!1)},le.createElement(kt.default.Item,{className:"mb0",colon:!1,label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},le.createElement(se.Z,{ref:gn=>An.current=gn}))),le.createElement(We.default,{centered:!0,title:"\u64CD\u4F5C\u8BB0\u5F55",open:Dn,width:710,onCancel:()=>Ai(!1),footer:null},le.createElement(De.Z,{spinning:en},le.createElement("div",{className:Ue.operating},ln.map((gn,li)=>le.createElement("div",{key:li,className:Ue.operatingItem},le.createElement("div",{style:{flex:"0 0 180px"},className:"c-grey-666"},gn==null?void 0:gn.created_at),le.createElement("div",{className:"c-black"},gn==null?void 0:gn.user_name,"\u64CD\u4F5C\u4E86\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206"),(gn==null?void 0:gn.status)==="running"?le.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",le.createElement("span",{className:"c-light-primary ml3"},gn==null?void 0:gn.rate)):le.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",le.createElement("span",{style:{color:"#3061D0",margin:"0 3px"}},gn==null?void 0:gn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",le.createElement("span",{style:{color:"#E30000",margin:"0 3px"}},gn==null?void 0:gn.fail_count),"\u4EBA")))),le.createElement("div",{style:{height:20}}))))}},3039:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ct}});var le=Le(59301),Ue={flex_box_center:"flex_box_center___rQJfc",flex_space_between:"flex_space_between___MDW24",flex_box_vertical_center:"flex_box_vertical_center___RZbAv",flex_box_center_end:"flex_box_center_end___ILhJA",flex_box_column:"flex_box_column___Fmij7",orangeColor:"orangeColor___U5vU6",redColor:"redColor___qYa6X",statustitle:"statustitle___pTBLm",statusbody:"statusbody___qUPQx",flex:"flex___VtL45"},pt=Le(62957),St="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAAAXNSR0IArs4c6QAAAUFJREFUOE+V0ktKw1AUxvH/rVqIxT4wkgwEUSmK4APRBfiYCKU7cOZEBOkadAMZiwhuwJETBQciFRTtwJkPBLW2BRGrRanU9kpN2sSYiGaWc/PjuznnCN2Qh8AkPo+AzXxKLLiPhW7ICtDqB4GzQkqM/huGFZgZcDCBBDaaicsTMKbZH2xfwdY5/ICAEGSasC0AwRYblj+gKkENwfy4WS9V4LHsgsk49EZteJKHdBa6w7AybdZzr3D64ILxGKjtNrx9gfsSRBSYtf6xZh1/u+qQClrIhtdFuHmGvhisJcz65RPsZl2Jc/3QE7FhpgDHuT80x2+O9cR1K/GiCDt3rkQ/+Ns43gDFD0YVmHIuQGOOmiGTARhxwkGd1cZ7Vwd0OppWr3911StpcV++Iwn67q/kyBMuHchErcqwFxT1XZXsfQJqo2zI6kdI4QAAAABJRU5ErkJggg==",yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAW1JREFUOE+dkj1IQmEUht9z/blp4VQEjS39eW+oSCFCpFCI4BiKFGWWQUSrCjVVg+lQNJZQDZGNTm1B4NTibS3n2lo0wuqEN8i/a0HfeN7v+d73nO+QJEcKAJzQPAwCnSpKNtoqkyRHqgDrtUFAb6Rnedx43KgT6O5P0GQijFiNLe/Sy3/B8g+YTIRRrb5jP32JYNADr8eOldU0RJEqVlm8r1kyuA/AIEB10OWy4vBgA4ryCIdjCJlMDmfn1zAY6EmyGY/UrAwrgGATWKsn4mGEQl4Uiw+YX9hT73aZiEcl8eMbZAGA0AT6/ZPY3Ykiny/A55tA7uoGqdQFBD2VbDbDugoSTTEj3gTGYgG8Vt7UeG63hNkZJ7a2s+gw1XqPnf5REKhkt4kxNakO08ycbOtRC/7FcakCwNTJ0WwmDI+1LUCZZDkSYGa5Eewf0G0KAnprNYtFQHdPbZhNS1cmLafF5bUTJsyBSVMHPm+/ADTrfrtCH68WAAAAAElFTkSuQmCC",Oe=(ot,We,Tt)=>new Promise((dt,kt)=>{var De=de=>{try{te(Tt.next(de))}catch(se){kt(se)}},ne=de=>{try{te(Tt.throw(de))}catch(se){kt(se)}},te=de=>de.done?dt(de.value):Promise.resolve(de.value).then(De,ne);te((Tt=Tt.apply(ot,We)).next())}),Ct=({type:ot,resdata:We,onok:Tt,oktext:dt,okloading:kt})=>{const[De,ne]=(0,le.useState)(!1),{can_copy_list:te,can_copy_num:de,challenge_type:se,course_data_list:pe,no_copy_list:ye,no_copy_num:we,no_use_list:Ce,no_use_num:_e,repeat_shixun_num:Ze,student_count:st,total_num:nt,use_num:Ye}=We;let ct=de>0||ot==="exercise";(0,le.useEffect)(()=>{(We==null?void 0:We.student_count)>0&&ne(!0)},[We]),console.log("---11",kt),(0,le.useEffect)(()=>{kt||ne(!1)},[kt]);const $e=()=>{if(ot==="exercise"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ue.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u4F5C\u7B54\u5DF2\u6311\u6218\u8FC7\u7684\u5B9E\u8BAD\u9898\u3002"));if(ot==="exercise"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ue.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="shixun"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="shixun"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="subject"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ue.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="subject"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709 ",le.createElement("span",{className:Ue.orangeColor},st)," \u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u6311\u6218\u8FC7\u5176\u4E2D\u7684 ",le.createElement("span",{className:Ue.orangeColor},Ye)," \u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="exercisepush")return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BD5\u5377\u4E2D\u7684",le.createElement("span",{className:Ue.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE \uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u5728\u5F53\u524D\u8003\u8BD5\u4E2D\u8FDB\u884C\u4F5C\u7B54\u3002"));if(ot==="shixunpush"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ue.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="shixunpush"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ue.orangeColor},st),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7",le.createElement("span",{className:Ue.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",le.createElement("span",{className:Ue.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"))},Et=()=>{if(ot==="exercise"||ot==="subject"||ot==="exercisepush"||ot==="shixunpush")return le.createElement("div",{style:{marginTop:20}},we>0&&le.createElement("div",null,le.createElement("span",{className:Ue.flex},le.createElement("img",{src:yt,style:{width:14}}),le.createElement("span",{className:Ue.statustitle},"\u4E0D\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),le.createElement("div",{className:Ue.statusbody},ot==="exercise"&&le.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ue.redColor},"\u4EE5\u4E0B\u8BD5\u9898\u5C06\u4E0D\u4F1A\u88AB\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\u3002"),"\u60A8\u4E5F\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),(ot==="subject"||ot==="exercisepush")&&le.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ct&&le.createElement("span",{className:Ue.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),ot==="shixunpush"&&le.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ct&&le.createElement("span",{className:Ue.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u5EFA\u8BAE\u60A8\u91CD\u65B0\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE\u518D\u53D1\u5E03\u4F5C\u4E1A\uFF0C\u4E5F\u53EF\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),le.createElement("div",null,ye==null?void 0:ye.map((Pt,Bt)=>le.createElement("a",{href:`/shixuns/${Pt.identifier}/challenges`,target:"_blank"},"\u300A",Pt==null?void 0:Pt.name,"\u300B",Bt+1!==we&&"\u3001"))))),de>0&&le.createElement("div",{style:{marginTop:20}},le.createElement("span",{className:Ue.flex},le.createElement("img",{src:St,style:{width:14}}),le.createElement("span",{className:Ue.statustitle},"\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),le.createElement("div",{className:Ue.statusbody},ot==="exercise"&&le.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u8BD5\u5377\u4E2D\u7684\u539F\u8BD5\u9898\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),(ot==="subject"||ot==="exercisepush")&&le.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),ot==="shixunpush"&&le.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u5F53\u524D\u4F5C\u4E1A\u4E2D\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),le.createElement("div",null,te==null?void 0:te.map((Pt,Bt)=>le.createElement("a",{href:`/shixuns/${Pt.identifier}/challenges`,target:"_blank"},"\u300A",Pt==null?void 0:Pt.name,"\u300B",Bt+1!==de&&"\u3001"))))));if(ot==="shixun")return le.createElement("div",{style:{marginTop:20}},de>0?"\u8BE5\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002":"\u8BE5\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236\uFF0C\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002")};return le.createElement(pt.default,{open:De,onCancel:()=>{ne(!1)},cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",width:700,centered:!0,cancelButtonProps:{style:{display:!ct&&"none"}},zIndex:1003,confirmLoading:kt,okText:ct?dt:"\u6211\u77E5\u9053\u4E86",onOk:()=>Oe(void 0,null,function*(){ct?yield Tt([...te,...Ce]):ne(!1)})},le.createElement("div",{style:{maxHeight:600,overflow:"auto"}},$e(),Et()))}},90283:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Oe}});var le=Le(59301),Ue={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},pt=Le(92310),St=Le.n(pt),Oe=({className:at,style:Ct,state:ot,onClick:We})=>{var Tt,dt;return le.createElement("div",{onClick:We,className:St()(ot?(Tt=Ue)==null?void 0:Tt.redBtn:(dt=Ue)==null?void 0:dt.btn,at),style:Ct},ot?le.createElement(le.Fragment,null,le.createElement("i",{className:"iconfont icon-biaoji1"}),le.createElement("span",null,"\u53D6\u6D88\u6807\u8BB0\u9519\u9898")):le.createElement(le.Fragment,null,le.createElement("i",{className:"iconfont icon-biaojigaiti"}),le.createElement("span",null,"\u6807\u8BB0\u9519\u9898")))}},69720:function(Zn,ei,Le){"use strict";Le.d(ei,{h:function(){return we}});var le=Le(59301),Ue=Le(82326),pt=Le(28284),St=Le(99571),yt=Le(89780),Oe=Le.n(yt),at=Le(8336),Ct=Le(12469),ot=Object.defineProperty,We=Object.defineProperties,Tt=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,ne=(Ce,_e,Ze)=>_e in Ce?ot(Ce,_e,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ce[_e]=Ze,te=(Ce,_e)=>{for(var Ze in _e||(_e={}))kt.call(_e,Ze)&&ne(Ce,Ze,_e[Ze]);if(dt)for(var Ze of dt(_e))De.call(_e,Ze)&&ne(Ce,Ze,_e[Ze]);return Ce},de=(Ce,_e)=>We(Ce,Tt(_e));const se=Ue.default.Option,pe={labelCol:{span:4},wrapperCol:{span:20}},ye={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"]};ei.Z=({callback:Ce,onCancel:_e})=>{const[Ze,st]=(0,le.useState)("python");function nt(ct){st(ye[ct][1])}function Ye(ct){Ce(ct)}return le.createElement(pt.default,de(te({},pe),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ye,style:{width:500}}),le.createElement(pt.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},le.createElement(Ue.default,{getPopupContainer:ct=>ct.parentNode,onChange:nt},Object.keys(ye).map(ct=>le.createElement(se,{key:ct,value:ct},ye[ct][0])))),le.createElement(pt.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},le.createElement(we,{mode:Ze})),le.createElement("div",{className:"flex-container flex-end"},le.createElement(St.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),le.createElement(St.ZP,{type:"ghost",onClick:_e},"\u53D6\u6D88")))};function we({value:Ce,onChange:_e,mode:Ze,options:st={}}){const nt=(0,le.useRef)(),[Ye,ct]=(0,le.useState)();return(0,le.useEffect)(()=>{if(Ye){let $e=function(Et){const Pt=Et.getValue();_e&&_e(Pt)};return Ye.on("change",$e),()=>{Ye.off("change",$e)}}},[Ye,_e]),(0,le.useEffect)(()=>{Ye&&Ye.setOption("mode",Ze)},[Ye,Ze]),(0,le.useEffect)(()=>{Ye&&(Ce!==Ye.getValue()||Ce==="")&&setTimeout(()=>{Ye.setValue(Ce||"")},300)},[Ye,Ce]),(0,le.useEffect)(()=>{if(nt.current&&!Ye){const $e=Oe().fromTextArea(nt.current,te({mode:Ze,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},st));ct($e)}},[nt.current,Ye]),le.createElement("div",{className:"my-codemirror-container"},le.createElement("textarea",{ref:nt}))}},39793:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ir}});var le=Le(59301),Ue=Le(89780),pt=Le.n(Ue),St=Le(76374),yt=Le(8336),Oe=Le(6313),at=Le(25717),Ct=Le(99498),ot=Le(25419),We=Le(67549),Tt=Le(76902),dt=({value:Mt="",className:_t,showTextOnly:At,showLines:xi,style:mi={}})=>{const fi=(0,le.useMemo)(()=>"",[Mt]);return le.createElement(le.Fragment,null,le.createElement("div",{dangerouslySetInnerHTML:{__html:fi}}))},kt=Le(59301),De=Object.defineProperty,ne=Object.defineProperties,te=Object.getOwnPropertyDescriptors,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,ye=(Mt,_t,At)=>_t in Mt?De(Mt,_t,{enumerable:!0,configurable:!0,writable:!0,value:At}):Mt[_t]=At,we=(Mt,_t)=>{for(var At in _t||(_t={}))se.call(_t,At)&&ye(Mt,At,_t[At]);if(de)for(var At of de(_t))pe.call(_t,At)&&ye(Mt,At,_t[At]);return Mt},Ce=(Mt,_t)=>ne(Mt,te(_t));let _e=[{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\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",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 Ze({onActionCallback:Mt,title:_t,icon:At,actionName:xi,className:mi="",children:fi}){function wn(){Mt(xi)}return kt.createElement("a",{title:_t,className:mi,onClick:wn},kt.createElement("i",{className:`${At}`}),fi)}var st=({watch:Mt,showNullButton:_t,showNullProgramButton:At,onActionCallback:xi,fullScreen:mi,insertTemp:fi,hidetoolBar:wn,extraUse:Yn})=>{const Qi=[..._e,{title:`${Mt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Mt?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return kt.createElement("ul",{className:"markdown-toolbar-container"},!wn&&Qi.map((vr,Dr)=>kt.createElement("li",{key:Dr},vr.actionName?kt.createElement(Ze,Ce(we({},vr),{onActionCallback:xi})):kt.createElement("span",{className:"v-line"}))),_t?kt.createElement("li",null,kt.createElement(Ze,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:xi},kt.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,At?kt.createElement(kt.Fragment,null,kt.createElement("li",null,kt.createElement(Ze,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:xi},kt.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),kt.createElement("li",null,kt.createElement(Ze,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:xi},kt.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,fi&&kt.createElement("li",null,kt.createElement(Ze,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${fi}`,onActionCallback:xi},kt.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Yn&&kt.createElement("li",null,Yn),kt.createElement("li",{className:"btn-full-screen"},kt.createElement(Ze,{icon:`${mi?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:mi?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:xi})))},nt=Le(91558),Ye=Le(28284),ct=Le(37568),$e=Le(99571),Et=Object.defineProperty,Pt=Object.defineProperties,Bt=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,tn=(Mt,_t,At)=>_t in Mt?Et(Mt,_t,{enumerable:!0,configurable:!0,writable:!0,value:At}):Mt[_t]=At,it=(Mt,_t)=>{for(var At in _t||(_t={}))qt.call(_t,At)&&tn(Mt,At,_t[At]);if(fn)for(var At of fn(_t))vn.call(_t,At)&&tn(Mt,At,_t[At]);return Mt},rt=(Mt,_t)=>Pt(Mt,Bt(_t));const dn={labelCol:{span:4},wrapperCol:{span:20}};var ni=({callback:Mt,onCancel:_t})=>{function At(xi){Mt(xi)}return le.createElement(Ye.default,rt(it({},dn),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:At,style:{width:500}}),le.createElement(Ye.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},le.createElement(ct.default,null)),le.createElement(Ye.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},le.createElement(ct.default,null)),le.createElement("div",{className:"flex-container flex-end"},le.createElement($e.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),le.createElement($e.ZP,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},Kn=Le(69720),Rt=Le(17077),En=Le(62957),Bn=Le(77019),ui=Le(9507),It=Le(59301),On=({callback:Mt,onCancel:_t})=>{const At=document.createElement("canvas"),xi=At.getContext("2d");At.width=1e3,At.height=800,xi.fillStyle="#ffffff",xi.fillRect(0,0,At.width,At.height);const mi=At.toDataURL("image/png");return It.createElement(En.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},It.createElement(Bn.Z,{style:{height:"100vh"}},It.createElement(ui.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:mi,visible:!0,title:String(Date.now())},onOk:fi=>{Mt({src:fi.url})},onClose:_t})))},ht=Le(12378);function kn(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(kn,go.CommandHandler),kn.prototype.canAlignSelection=function(){var Mt=this.diagram;return!(Mt===null||Mt.isReadOnly||Mt.isModelReadOnly||Mt.selection.count<2)},kn.prototype.alignLeft=function(){var Mt=this.diagram;Mt.startTransaction("aligning left");var _t=1/0;Mt.selection.each(function(At){At instanceof go.Link||(_t=Math.min(At.position.x,_t))}),Mt.selection.each(function(At){At instanceof go.Link||At.move(new go.Point(_t,At.position.y))}),Mt.commitTransaction("aligning left")},kn.prototype.alignRight=function(){var Mt=this.diagram;Mt.startTransaction("aligning right");var _t=-1/0;Mt.selection.each(function(At){if(!(At instanceof go.Link)){var xi=At.actualBounds.x+At.actualBounds.width;_t=Math.max(xi,_t)}}),Mt.selection.each(function(At){At instanceof go.Link||At.move(new go.Point(_t-At.actualBounds.width,At.position.y))}),Mt.commitTransaction("aligning right")},kn.prototype.alignTop=function(){var Mt=this.diagram;Mt.startTransaction("alignTop");var _t=1/0;Mt.selection.each(function(At){At instanceof go.Link||(_t=Math.min(At.position.y,_t))}),Mt.selection.each(function(At){At instanceof go.Link||At.move(new go.Point(At.position.x,_t))}),Mt.commitTransaction("alignTop")},kn.prototype.alignBottom=function(){var Mt=this.diagram;Mt.startTransaction("aligning bottom");var _t=-1/0;Mt.selection.each(function(At){if(!(At instanceof go.Link)){var xi=At.actualBounds.y+At.actualBounds.height;_t=Math.max(xi,_t)}}),Mt.selection.each(function(At){At instanceof go.Link||At.move(new go.Point(At.actualBounds.x,_t-At.actualBounds.height))}),Mt.commitTransaction("aligning bottom")},kn.prototype.alignCenterX=function(){var Mt=this.diagram,_t=Mt.selection.first();if(_t){Mt.startTransaction("aligning Center X");var At=_t.actualBounds.x+_t.actualBounds.width/2;Mt.selection.each(function(xi){xi instanceof go.Link||xi.move(new go.Point(At-xi.actualBounds.width/2,xi.actualBounds.y))}),Mt.commitTransaction("aligning Center X")}},kn.prototype.alignCenterY=function(){var Mt=this.diagram,_t=Mt.selection.first();if(_t){Mt.startTransaction("aligning Center Y");var At=_t.actualBounds.y+_t.actualBounds.height/2;Mt.selection.each(function(xi){xi instanceof go.Link||xi.move(new go.Point(xi.actualBounds.x,At-xi.actualBounds.height/2))}),Mt.commitTransaction("aligning Center Y")}},kn.prototype.alignColumn=function(Mt){var _t=this.diagram;_t.startTransaction("align Column"),Mt===void 0&&(Mt=0),Mt=parseFloat(Mt);var At=new Array;_t.selection.each(function(Yn){Yn instanceof go.Link||At.push(Yn)});for(var xi=0;xi<At.length-1;xi++){var mi=At[xi],fi=mi.actualBounds.y+mi.actualBounds.height+Mt,wn=At[xi+1];wn.move(new go.Point(mi.actualBounds.x,fi))}_t.commitTransaction("align Column")},kn.prototype.alignRow=function(Mt){Mt===void 0&&(Mt=0),Mt=parseFloat(Mt);var _t=this.diagram;_t.startTransaction("align Row");var At=new Array;_t.selection.each(function(Yn){Yn instanceof go.Link||At.push(Yn)});for(var xi=0;xi<At.length-1;xi++){var mi=At[xi],fi=mi.actualBounds.x+mi.actualBounds.width+Mt,wn=At[xi+1];wn.move(new go.Point(fi,mi.actualBounds.y))}_t.commitTransaction("align Row")},kn.prototype.canRotate=function(Mt){var _t=this.diagram;return!(_t===null||_t.isReadOnly||_t.isModelReadOnly||_t.selection.count<1)},kn.prototype.rotate=function(Mt){Mt===void 0&&(Mt=90);var _t=this.diagram;_t.startTransaction("rotate "+Mt.toString());var _t=this.diagram;_t.selection.each(function(At){At instanceof go.Link||At instanceof go.Group||(At.angle+=Mt)}),_t.commitTransaction("rotate "+Mt.toString())},kn.prototype.pullToFront=function(){var Mt=this.diagram;Mt.startTransaction("pullToFront");var _t=new go.Map;Mt.selection.each(function(At){_t.set(At.layer,0)}),_t.iteratorKeys.each(function(At){var xi=0;At.parts.each(function(mi){if(!mi.isSelected){var fi=mi.zOrder;isNaN(fi)?mi.zOrder=0:xi=Math.max(xi,fi)}}),_t.set(At,xi)}),Mt.selection.each(function(At){kn._assignZOrder(At,_t.get(At.layer)+1)}),Mt.commitTransaction("pullToFront")},kn.prototype.pushToBack=function(){var Mt=this.diagram;Mt.startTransaction("pushToBack");var _t=new go.Map;Mt.selection.each(function(At){_t.set(At.layer,0)}),_t.iteratorKeys.each(function(At){var xi=0;At.parts.each(function(mi){if(!mi.isSelected){var fi=mi.zOrder;isNaN(fi)?mi.zOrder=0:xi=Math.min(xi,fi)}}),_t.set(At,xi)}),Mt.selection.each(function(At){kn._assignZOrder(At,_t.get(At.layer)-1-kn._findGroupDepth(At))}),Mt.commitTransaction("pushToBack")},kn._assignZOrder=function(Mt,_t,At){At===void 0&&(At=Mt),Mt.layer===At.layer&&(Mt.zOrder=_t),Mt instanceof go.Group&&Mt.memberParts.each(function(xi){kn._assignZOrder(xi,_t+1,At)})},kn._findGroupDepth=function(Mt){if(Mt instanceof go.Group){var _t=0;return Mt.memberParts.each(function(At){_t=Math.max(_t,kn._findGroupDepth(At))}),_t+1}else return 0},kn.prototype.doKeyDown=function(){var Mt=this.diagram;if(Mt!==null){var _t=Mt.lastInput;if(_t.key==="Up"||_t.key==="Down"||_t.key==="Left"||_t.key==="Right"){var At=this.arrowKeyBehavior;if(At==="none")return;if(At==="select"){this._arrowKeySelect();return}else if(At==="move"){this._arrowKeyMove();return}else if(At==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},kn.prototype._getAllParts=function(){var Mt=new Array;return this.diagram.nodes.each(function(_t){Mt.push(_t)}),this.diagram.parts.each(function(_t){Mt.push(_t)}),Mt},kn.prototype._arrowKeyMove=function(){var Mt=this.diagram,_t=Mt.lastInput,At=0,xi=0;if(_t.control||_t.meta)At=1,xi=1;else if(Mt.grid!==null){var mi=Mt.grid.gridCellSize;xi=mi.width,At=mi.height}Mt.startTransaction("arrowKeyMove"),Mt.selection.each(function(fi){_t.key==="Up"?fi.move(new go.Point(fi.actualBounds.x,fi.actualBounds.y-At)):_t.key==="Down"?fi.move(new go.Point(fi.actualBounds.x,fi.actualBounds.y+At)):_t.key==="Left"?fi.move(new go.Point(fi.actualBounds.x-xi,fi.actualBounds.y)):_t.key==="Right"&&fi.move(new go.Point(fi.actualBounds.x+xi,fi.actualBounds.y))}),Mt.commitTransaction("arrowKeyMove")},kn.prototype._arrowKeySelect=function(){var Mt=this.diagram,_t=Mt.lastInput,At=null;_t.key==="Up"?At=this._findNearestPartTowards(270):_t.key==="Down"?At=this._findNearestPartTowards(90):_t.key==="Left"?At=this._findNearestPartTowards(180):_t.key==="Right"&&(At=this._findNearestPartTowards(0)),At!==null&&(_t.shift?At.isSelected=!0:_t.control||_t.meta?At.isSelected=!At.isSelected:Mt.select(At))},kn.prototype._findNearestPartTowards=function(Mt){var _t=this.diagram.selection.first();if(_t===null)return null;for(var At=_t.actualBounds.center,xi=this._getAllParts(),mi=1/0,fi=_t,wn=0;wn<xi.length;wn++){var Yn=xi[wn];if(Yn!==_t&&Yn.canSelect()){var Qi=Yn.actualBounds.center,vr=At.directionPoint(Qi),Dr=this._angleCloseness(vr,Mt);if(Dr<=45){var Ke=At.distanceSquaredPoint(Qi);Ke*=1+Math.sin(Dr*Math.PI/180),Ke<mi&&(mi=Ke,fi=Yn)}}}return fi},kn.prototype._angleCloseness=function(Mt,_t){return Math.min(Math.abs(_t-Mt),Math.min(Math.abs(_t+360-Mt),Math.abs(_t-360-Mt)))},kn.prototype._arrowKeyTree=function(){var Mt=this.diagram,_t=Mt.selection.first();if(_t instanceof go.Node){var At=Mt.lastInput;if(At.key==="Right"){if(!_t.isTreeLeaf)if(!_t.isTreeExpanded)Mt.commandHandler.canExpandTree(_t)&&Mt.commandHandler.expandTree(_t);else{var xi=this._sortTreeChildrenByY(_t).first();xi!==null&&Mt.select(xi)}}else if(At.key==="Left")if(!_t.isTreeLeaf&&_t.isTreeExpanded)Mt.commandHandler.canCollapseTree(_t)&&Mt.commandHandler.collapseTree(_t);else{var mi=_t.findTreeParentNode();mi!==null&&Mt.select(mi)}else if(At.key==="Up"){var mi=_t.findTreeParentNode();if(mi!==null){var fi=this._sortTreeChildrenByY(mi),wn=fi.indexOf(_t);if(wn>0){for(var Yn=fi.elt(wn-1);Yn!==null&&Yn.isTreeExpanded&&!Yn.isTreeLeaf;){var Qi=this._sortTreeChildrenByY(Yn);Yn=Qi.last()}Yn!==null&&Mt.select(Yn)}else Mt.select(mi)}}else if(At.key==="Down")if(_t.isTreeExpanded&&!_t.isTreeLeaf){var xi=this._sortTreeChildrenByY(_t).first();xi!==null&&Mt.select(xi)}else for(;_t!==null;){var mi=_t.findTreeParentNode();if(mi===null)break;var fi=this._sortTreeChildrenByY(mi),wn=fi.indexOf(_t);if(wn<fi.length-1){Mt.select(fi.elt(wn+1));break}else _t=mi}var vr=Mt.selection.first();vr!==null&&Mt.scrollToRect(vr.actualBounds)}},kn.prototype._sortTreeChildrenByY=function(Mt){var _t=new go.List().addAll(Mt.findTreeChildrenNodes());return _t.sort(function(At,xi){var mi=At.location,fi=xi.location;return mi.y<fi.y?-1:mi.y>fi.y?1:mi.x<fi.x?-1:mi.x>fi.x?1:0}),_t},kn.prototype.copyToClipboard=function(Mt){go.CommandHandler.prototype.copyToClipboard.call(this,Mt),this._lastPasteOffset.set(this.pasteOffset)},kn.prototype.pasteFromClipboard=function(){var Mt=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(Mt,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),Mt},Object.defineProperty(kn.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(Mt){if(Mt!=="move"&&Mt!=="select"&&Mt!=="scroll"&&Mt!=="tree"&&Mt!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+Mt);this._arrowKeyBehavior=Mt}}),Object.defineProperty(kn.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(Mt){if(!(Mt instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+Mt);this._pasteOffset.set(Mt)}});var Oi=kn,ze=Le(63720),Me=Le(5269),Ee=Le(38986),Te={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},He=Le(48790),Ae=Le(59301),et=(Mt,_t,At)=>new Promise((xi,mi)=>{var fi=Qi=>{try{Yn(At.next(Qi))}catch(vr){mi(vr)}},wn=Qi=>{try{Yn(At.throw(Qi))}catch(vr){mi(vr)}},Yn=Qi=>Qi.done?xi(Qi.value):Promise.resolve(Qi.value).then(fi,wn);Yn((At=At.apply(Mt,_t)).next())});function on({onCancel:Mt,callback:_t}){let At=(0,le.useRef)(),xi=(0,le.useRef)(),mi=(0,le.useRef)(),fi=(0,le.useRef)(!1);const wn=(0,le.useRef)(!1),[Yn,Qi]=(0,le.useState)(0);function vr(){const Ke=ht.bx.make,Lt={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"};At.current=new ht.S0(xi.current,{padding:20,grid:Ke(ht.s_,"Grid",Ke(ht.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Ke(ht.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:Xn=>{var rr=Xn.diagram.commandHandler.addTopLevelParts(Xn.diagram.selection,!0);rr||Xn.diagram.currentTool.doCancel()},commandHandler:Ke(Oi),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:Xn=>{var rr=Xn.subject;rr.location=rr.location.copy().snapToGridPoint(Xn.diagram.grid.gridOrigin,Xn.diagram.grid.gridCellSize),setTimeout(()=>{Xn.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:Xn=>{var rr=Xn.subject;setTimeout(()=>{Xn.diagram.commandHandler.editTextBlock()})},LinkRelinked:Xn=>{var rr=Xn.parameter.part;rr.invalidateConnectedLinks();var er=Xn.subject;Xn.diagram.toolManager.linkingTool.isForwards?er.toNode.invalidateConnectedLinks():er.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),At.current.nodeTemplate=Ke(ht.NB,"Auto",{locationSpot:ht.z6.Center,locationObjectName:"SHAPE",desiredSize:new ht.$u(120,60),minSize:new ht.$u(40,40),resizable:!0,resizeCellSize:new ht.$u(10,10),rotatable:!0},new ht.KX("location","loc",ht.E9.parse).makeTwoWay(ht.E9.stringify),new ht.KX("desiredSize","size",ht.$u.parse).makeTwoWay(ht.$u.stringify),Ke(ht.bn,{name:"SHAPE",fill:Lt.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:ht.z6.AllSides,toSpot:ht.z6.AllSides},new ht.KX("figure"),new ht.KX("fill"),new ht.KX("stroke","borderColor"),new ht.KX("strokeWidth","thickness"),new ht.KX("strokeDashArray","dash")),Ke(ht.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),Ke(ht.al,{margin:1,textAlign:"center",overflow:ht.al.OverflowEllipsis,editable:!0},new ht.KX("text").makeTwoWay(),new ht.KX("stroke","color"))),At.current.nodeTemplate.toolTip=Ke("ToolTip",Ke(ht.s_,"Vertical",{maxSize:new ht.$u(200,NaN)},Ke(ht.al,{font:"bold 10pt sans-serif",textAlign:"center"},new ht.KX("text")),Ke(ht.al,{font:"10pt sans-serif",textAlign:"center"},new ht.KX("text","details"))));function _n(Xn,rr){var er=(Pr,Wr)=>{Pr.handled=!0,Pr.diagram.model.commit(so=>{var vo=Wr.part.adornedPart,po=new ht.E9().setRectSpot(vo.actualBounds,Xn);po.subtract(vo.location),po.scale(2,2),po.x+=Math.sign(po.x)*130,po.y+=Math.sign(po.y)*130,po.add(vo.location),po.snapToGridPoint(Pr.diagram.grid.gridOrigin,Pr.diagram.grid.gridCellSize);var yo=so.copyNodeData(vo.data);so.setGroupKeyForNodeData(yo,so.getGroupKeyForNodeData(vo.data)),so.addNodeData(yo);var Nn={from:vo.key,to:so.getKeyForNodeData(yo)};so.addLinkData(Nn);var ia=Pr.diagram.findNodeForData(yo);ia.location=po,Pr.diagram.select(ia),setTimeout(()=>{Pr.diagram.commandHandler.editTextBlock()},20)})};return Ke(ht.bn,{figure:rr,alignment:Xn,alignmentFocus:Xn.opposite(),width:Xn.equals(ht.z6.Top)||Xn.equals(ht.z6.Bottom)?25:18,height:Xn.equals(ht.z6.Top)||Xn.equals(ht.z6.Bottom)?18:25,fill:"orange",stroke:Lt.white,strokeWidth:4,mouseEnter:(Pr,Wr)=>Wr.fill="dodgerblue",mouseLeave:(Pr,Wr)=>Wr.fill="orange",isActionable:!0,click:er,contextClick:er})}function ci(Xn){return Ke(ht.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:(rr,er)=>er.fill="dodgerblue",mouseLeave:(rr,er)=>er.fill="orange",click:(rr,er)=>{rr.diagram.commandHandler.showContextMenu(er.part.adornedPart)}},Xn||{})}At.current.nodeTemplate.selectionAdornmentTemplate=Ke(ht.uz,"Spot",Ke(ht.Vm,{padding:10}),_n(ht.z6.Top,"TriangleUp"),_n(ht.z6.Left,"TriangleLeft"),_n(ht.z6.Right,"TriangleRight"),_n(ht.z6.Bottom,"TriangleDown"),ci({alignment:new ht.z6(.75,0)}));function $t(Xn,rr){return(er,Pr)=>{er.handled=!0,er.diagram.model.commit(Wr=>{Wr.set(Pr.part.adornedPart.data,Xn,rr)})}}function xn(Xn,rr){return rr||(rr="color"),Ke(ht.bn,{width:16,height:16,stroke:"lightgray",fill:Xn,margin:1,background:"transparent",mouseEnter:(er,Pr)=>Pr.stroke="dodgerblue",mouseLeave:(er,Pr)=>Pr.stroke="lightgray",click:$t(rr,Xn),contextClick:$t(rr,Xn)})}function Xt(){return[Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",xn(Lt.white,"fill"),xn(Lt.beige,"fill"),xn(Lt.extralightblue,"fill"),xn(Lt.extralightred,"fill"))),Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",xn(Lt.lightgray,"fill"),xn(Lt.lightgreen,"fill"),xn(Lt.lightblue,"fill"),xn(Lt.lightred,"fill")))]}function ri(){return[Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",xn(Lt.black),xn(Lt.green),xn(Lt.blue),xn(Lt.red))),Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",xn(Lt.white),xn(Lt.magenta),xn(Lt.purple),xn(Lt.orange)))]}function Hi(Xn,rr){return rr||(rr="thickness"),Ke(ht.bn,"LineH",{width:16,height:16,strokeWidth:Xn,margin:1,background:"transparent",mouseEnter:(er,Pr)=>Pr.background="dodgerblue",mouseLeave:(er,Pr)=>Pr.background="transparent",click:$t(rr,Xn),contextClick:$t(rr,Xn)})}function gi(Xn,rr){return rr||(rr="dash"),Ke(ht.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:Xn,margin:1,background:"transparent",mouseEnter:(er,Pr)=>Pr.background="dodgerblue",mouseLeave:(er,Pr)=>Pr.background="transparent",click:$t(rr,Xn),contextClick:$t(rr,Xn)})}function Ii(){return[Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",Hi(1),Hi(2),Hi(3),Hi(4))),Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",gi(null),gi([2,4]),gi([4,4])))]}function Fi(Xn,rr){return rr||(rr="figure"),Ke(ht.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:Xn,margin:1,background:"transparent",mouseEnter:(er,Pr)=>Pr.fill="dodgerblue",mouseLeave:(er,Pr)=>Pr.fill="lightgray",click:$t(rr,Xn),contextClick:$t(rr,Xn)})}At.current.nodeTemplate.contextMenu=Ke("ContextMenu",Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",Fi("Rectangle"),Fi("RoundedRectangle"),Fi("Ellipse"),Fi("Diamond"))),Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",Fi("Parallelogram2"),Fi("ManualOperation"),Fi("Procedure"),Fi("Cylinder1"))),Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",Fi("Terminator"),Fi("CreateRequest"),Fi("Document"),Fi("TriangleDown"))),Xt(),ri(),Ii()),At.current.groupTemplate=Ke(ht.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:ht.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(Xn,rr)=>{var er=rr.addMembers(rr.diagram.selection,!0);er||rr.diagram.currentTool.doCancel()},avoidable:!1},new ht.KX("location","loc",ht.E9.parse).makeTwoWay(ht.E9.stringify),Ke(ht.s_,"Auto",{name:"BODY"},Ke(ht.bn,{parameter1:10,fill:Lt.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:ht.z6.AllSides,toSpot:ht.z6.AllSides},new ht.KX("fill"),new ht.KX("stroke","color"),new ht.KX("strokeWidth","thickness"),new ht.KX("strokeDashArray","dash")),Ke(ht.Vm,{background:"transparent",margin:20})),Ke(ht.al,{alignment:ht.z6.Top,alignmentFocus:ht.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new ht.KX("text"),new ht.KX("stroke","color"))),At.current.groupTemplate.selectionAdornmentTemplate=Ke(ht.uz,"Spot",Ke(ht.s_,"Auto",Ke(ht.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),Ke(ht.Vm,{margin:1.5})),ci({alignment:ht.z6.TopRight,alignmentFocus:ht.z6.BottomRight})),At.current.groupTemplate.contextMenu=Ke("ContextMenu",Xt(),ri(),Ii()),At.current.linkTemplate=Ke(ht.rU,{layerName:"Foreground",routing:ht.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new ht.KX("fromSpot","fromSpot",ht.z6.parse),new ht.KX("toSpot","toSpot",ht.z6.parse),new ht.KX("fromShortLength","dir",Xn=>Xn>=1?10:0),new ht.KX("toShortLength","dir",Xn=>Xn>=1?10:0),new ht.KX("points").makeTwoWay(),Ke(ht.bn,{strokeWidth:2},new ht.KX("stroke","color"),new ht.KX("strokeWidth","thickness"),new ht.KX("strokeDashArray","dash")),Ke(ht.bn,{segmentIndex:0,segmentOffset:new ht.E9(15,0),segmentOrientation:ht.rU.OrientAlong,alignmentFocus:ht.z6.Right,figure:"circle",width:10,strokeWidth:0},new ht.KX("fill","color"),new ht.KX("visible","dir",Xn=>Xn===1)),Ke(ht.bn,{segmentIndex:-1,segmentOffset:new ht.E9(-10,6),segmentOrientation:ht.rU.OrientPlus90,alignmentFocus:ht.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new ht.KX("fill","color"),new ht.KX("visible","dir",Xn=>Xn>=1),new ht.KX("width","thickness",Xn=>7+3*Xn),new ht.KX("height","thickness",Xn=>7+3*Xn),new ht.KX("segmentOffset","thickness",Xn=>new ht.E9(-15,4+1.5*Xn))),Ke(ht.bn,{segmentIndex:0,segmentOffset:new ht.E9(15,-6),segmentOrientation:ht.rU.OrientMinus90,alignmentFocus:ht.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new ht.KX("fill","color"),new ht.KX("visible","dir",Xn=>Xn===2),new ht.KX("width","thickness",Xn=>7+3*Xn),new ht.KX("height","thickness",Xn=>7+3*Xn),new ht.KX("segmentOffset","thickness",Xn=>new ht.E9(-15,4+1.5*Xn))),Ke(ht.al,{alignmentFocus:new ht.z6(0,1,-4,0),editable:!0},new ht.KX("text").makeTwoWay(),new ht.KX("stroke","color"))),At.current.linkTemplate.selectionAdornmentTemplate=Ke(ht.uz,Ke(ht.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:Cr(2)},new ht.KX("pathPattern","thickness",Cr)),ci({alignmentFocus:new ht.z6(0,0,-6,-4)}));function Cr(Xn){return Ke(ht.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(Xn+4).toString()+" H3"})}function xr(Xn){var rr="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return Xn===0?rr="M0 0 M16 16 M0 8 L16 8":Xn===2&&(rr="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),Ke(ht.bn,{geometryString:rr,margin:2,background:"transparent",mouseEnter:(er,Pr)=>Pr.background="dodgerblue",mouseLeave:(er,Pr)=>Pr.background="transparent",click:$t("dir",Xn),contextClick:$t("dir",Xn)})}function Sr(Xn){var rr=(er,Pr)=>{er.handled=!0,er.diagram.model.commit(Wr=>{var so=Pr.part.adornedPart;Wr.set(so.data,Xn?"toSpot":"fromSpot",ht.z6.stringify(ht.z6.AllSides)),(Xn?so.toNode:so.fromNode).invalidateConnectedLinks()})};return Ke(ht.bn,{width:12,height:12,fill:"transparent",mouseEnter:(er,Pr)=>Pr.background="dodgerblue",mouseLeave:(er,Pr)=>Pr.background="transparent",click:rr,contextClick:rr})}function hn(Xn,rr){var er=0,Pr=ht.z6.RightSide;Xn.equals(ht.z6.Top)?(er=270,Pr=ht.z6.TopSide):Xn.equals(ht.z6.Left)?(er=180,Pr=ht.z6.LeftSide):Xn.equals(ht.z6.Bottom)&&(er=90,Pr=ht.z6.BottomSide),rr||(er-=180);var Wr=(so,vo)=>{so.handled=!0,so.diagram.model.commit(po=>{var yo=vo.part.adornedPart;po.set(yo.data,rr?"toSpot":"fromSpot",ht.z6.stringify(Pr)),(rr?yo.toNode:yo.fromNode).invalidateConnectedLinks()})};return Ke(ht.bn,{alignment:Xn,alignmentFocus:Xn.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:er,background:"transparent",mouseEnter:(so,vo)=>vo.background="dodgerblue",mouseLeave:(so,vo)=>vo.background="transparent",click:Wr,contextClick:Wr})}At.current.linkTemplate.contextMenu=Ke("ContextMenu",ri(),Ii(),Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",xr(0),xr(1),xr(2))),Ke("ContextMenuButton",Ke(ht.s_,"Horizontal",Ke(ht.s_,"Spot",Sr(!1),hn(ht.z6.Top,!1),hn(ht.z6.Left,!1),hn(ht.z6.Right,!1),hn(ht.z6.Bottom,!1)),Ke(ht.s_,"Spot",{margin:new ht.Zt(0,0,0,2)},Sr(!0),hn(ht.z6.Top,!0),hn(ht.z6.Left,!0),hn(ht.z6.Right,!0),hn(ht.z6.Bottom,!0)))));const ro=`{ "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 Gr=["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 So(Xn){return console.log("shapeName:",Xn),Gr.indexOf(Xn)>=0}var yn=new ht.YI(mi.current,{maxSelectionCount:1,linkTemplate:Ke(ht.rU,{locationSpot:ht.z6.Center,selectionAdornmentTemplate:Ke(ht.uz,"Link",{locationSpot:ht.z6.Center},Ke(ht.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),Ke(ht.bn,{toArrow:"Standard",stroke:null}))},{routing:ht.rU.AvoidsNodes,curve:ht.rU.JumpOver,corner:5,toShortLength:4},new ht.KX("points"),Ke(ht.bn,{isPanelMain:!0,strokeWidth:2}),Ke(ht.bn,{toArrow:"Standard",stroke:null})),model:new ht.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...ht.bn.getFigureGenerators().toArray().map(Xn=>({text:"\u672A\u547D\u540D",size:"100 100",figure:Xn.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return At.current.addDiagramListener("TextEdited",function(Xn){var rr;const er=Xn.subject.part;var Pr=(rr=document.activeElement)==null?void 0:rr.value;typeof Pr=="string"&&Pr.trim()===""&&At.current.model.commit(function(Wr){Wr.set(er.data,"text","\u672A\u547D\u540D"),At.current.commandHandler.stopCommand()},"increment")}),yn.nodeTemplate=Ke(ht.NB,"Auto",{locationSpot:ht.z6.Center},new ht.KX("location","location",ht.E9.parse).makeTwoWay(ht.E9.stringify),Ke(ht.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 ht.KX("stroke").makeTwoWay(),new ht.KX("fill").makeTwoWay(),new ht.KX("figure")),Ke(ht.al,{margin:new ht.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new ht.$u(16,16),maxSize:new ht.$u(10,NaN),textAlign:"center",editable:!0},new ht.KX("key").makeTwoWay())),setTimeout(()=>{At.current.grid=Ke(ht.s_,"Grid",Ke(ht.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Ke(ht.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),At.current.grid.visible=!0,At.current.grid.gridCellStroke="darkgray",At.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=At.current,At.current}const Dr=()=>et(this,null,function*(){var Ke,Lt=At.current.makeImage();const _n=yield(0,Ee.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:Lt.src,file_data:JSON.stringify({login:(Ke=(0,He.eY)())==null?void 0:Ke.login,data:JSON.parse(At.current.model.toJson())})}});_t({src:_n.url})});return(0,le.useEffect)(()=>(setTimeout(()=>{vr()},500),Qi(Yn+1),()=>{At.current=null}),[]),Ae.createElement("div",{ref:wn,className:"body-overflow-initial"},Ae.createElement(En.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!Yn,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Ae.createElement(Bn.Z,null,Ae.createElement(Me.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Ae.createElement(Me.Z,{onClick:()=>{var Ke,Lt,_n=At.current.selection.first();if(fi.current=!fi.current,document.activeElement&&_n){let ci=(Lt=(Ke=document.activeElement)==null?void 0:Ke.value)==null?void 0:Lt.trim();typeof ci=="string"&&At.current.model.commit(function($t){$t.set(_n.data,"text",ci||"\u672A\u547D\u540D"),At.current.commandHandler.stopCommand()},"increment")}Qi(Yn+1)}},Ae.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:Mt},Ae.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:fi.current?"none":"block"},className:Te.flowChartWrp},Ae.createElement("div",{style:{display:"flex",height:"100%"}},Ae.createElement("div",{style:{width:"300px",height:"100%"}},Ae.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),Ae.createElement("div",{style:{height:"calc(100% - 50px)"},className:Te.myPaletteDiv,ref:mi})),Ae.createElement("div",{style:{flex:1,position:"relative"}},Ae.createElement("div",{ref:xi,style:{height:"80vh"}}))),Ae.createElement("div",{className:"tr"},Ae.createElement($e.ZP,{size:"large",onClick:Dr,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var Kt=on,pn=Le(47889),Nt=Le(71051);const Dt=pn.ZP.Group,Ot={margin:"0 8px"};var un=({callback:Mt,onCancel:_t})=>{function At(xi){Mt(xi)}return le.createElement(Ye.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:At},le.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},le.createElement("span",{style:Ot},"\u5355\u5143\u683C\u6570\uFF1A"),le.createElement("span",{style:Ot},"\u884C\u6570"),le.createElement(Ye.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},le.createElement(Nt.Z,null)),le.createElement("span",{style:Ot},"\u5217\u6570"),le.createElement(Ye.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},le.createElement(Nt.Z,null))),le.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},le.createElement("span",{style:Ot},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),le.createElement(Ye.default.Item,{name:"align"},le.createElement(Dt,null,le.createElement(pn.ZP,{value:"default"},le.createElement("i",{className:"fa fa-align-justify"})),le.createElement(pn.ZP,{value:"left"},le.createElement("i",{className:"fa fa-align-left"})),le.createElement(pn.ZP,{value:"center"},le.createElement("i",{className:"fa fa-align-center"})),le.createElement(pn.ZP,{value:"right"},le.createElement("i",{className:"fa fa-align-right"}))))),le.createElement("div",{className:"flex-container flex-end"},le.createElement($e.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),le.createElement($e.ZP,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},Sn=Le(71411),An=Le(43001),Dn=Le.n(An),en=(0,le.forwardRef)(({use3d:Mt,width:_t,height:At,callback:xi,showSaveButton:mi},fi)=>{const wn=(0,le.useRef)(),Yn=(0,le.useRef)(),[Qi,vr]=(0,le.useState)(!1),Dr=(0,le.useRef)({id:wn,appName:"graphing",width:_t||1e3,height:At||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,le.useEffect)(()=>{Yn.current=new(Dn())(Dr.current,!0),window.onload=function(){Yn.current.inject("applet_container")}},[]);const Ke=()=>{var Lt=window.ggbApplet.getPNGBase64(1,!0,72);return xi&&xi(Lt),Lt};return(0,le.useEffect)(()=>{Dr.current.appName=Qi?"3D":"graphing",Yn.current.inject("applet_container")},[Qi]),(0,le.useEffect)(()=>{vr(Mt)},[Mt]),(0,le.useImperativeHandle)(fi,()=>({getImgData:Ke})),le.createElement(le.Fragment,null,le.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:wn}),le.createElement(Bn.Z,{align:"middle"},le.createElement(Me.Z,{flex:1},le.createElement(Sn.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Qi,onChange:Lt=>vr(Lt)})),le.createElement(Me.Z,null,le.createElement($e.ZP,{size:"large",onClick:Ke,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Qt=Le(76562),ln=Le(6767);const di="link",cn="upload-image",Yt="add-flowchart",ii="draw-image",Vi="add-flowchart",bi="code-block",Di="add-table",Mr="------------",Gn={default:Mr,left:`:${Mr}`,center:`:${Mr}:`,right:`${Mr}:`};var Rn=Le(37808);function Jn(){}let Ni=0;const ji=1e4,Gi="\u2581",Fr="@\u2581\u2581@",be="@\u2581@",gn=`
|
|
**\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`,li=["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 Hn(Mt){return/^\d+$/.test(Mt)?`${Mt}px`:Mt}const ki=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Ji={[ki+"-B"]:"bold",[ki+"-I"]:"italic"},$i={[di]:"\u6DFB\u52A0\u94FE\u63A5",[bi]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[cn]:"\u6DFB\u52A0\u56FE\u7247",[ii]:"\u6DFB\u52A0\u753B\u56FE",[Yt]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Di]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var ir=({defaultValue:Mt="",onChange:_t,width:At="100%",height:xi=400,miniToolbar:mi=!1,isFocus:fi=!1,watch:wn,insertTemp:Yn,mode:Qi="markdown",id:vr="markdown-editor-id",showResizeBar:Dr=!1,noStorage:Ke=!1,showNullButton:Lt=!1,showNullProgramButton:_n=!1,hidetoolBar:ci=!1,fullScreen:$t=!1,onBlur:xn,onCMBeforeChange:Xt,onFullScreen:ri,className:Hi="",disablePaste:gi=!1,disabled:Ii=!1,disabledFill:Fi=!1,placeholder:Cr="",values:xr="",extraUse:Sr})=>{const[hn,ro]=(0,le.useState)(null),[Gr,So]=(0,le.useState)(Mt),[yn,Xn]=(0,le.useState)(wn),[rr,er]=(0,le.useState)($t),[Pr,Wr]=(0,le.useState)(""),[so,vo]=(0,le.useState)(0),[po,yo]=(0,le.useState)(xi),[Nn,ia]=(0,le.useState)(!1),[Tn,Ar]=(0,le.useState)(0),[Bo,br]=(0,le.useState)(0),na=(0,le.useRef)(),Do=(0,le.useRef)(),ho=(0,le.useRef)(),Jo=(0,le.useRef)();(0,le.useEffect)(()=>{const Ki=window.scrollY||window.pageYOffset;So(xr),hn==null||hn.setValue(xr),window.scrollTo(0,Ki)},[xr]),(0,le.useEffect)(()=>{ri==null||ri(rr)},[rr]),(0,le.useEffect)(()=>{if(na.current){let Ki=function(Pn,hr){var or;if(gi){hr.preventDefault();return}const xo=hr.clipboardData;if(xo){const Yr=xo.types.toString(),qo=xo.items;if(Yr==="Files"||xo.types.indexOf("Files")>-1){if(hr.preventDefault(),Qi=="stex")return;try{let Ko=qo[1];((or=qo[0])==null?void 0:or.kind)==="file"&&(Ko=qo[0]);const Qo=Ko.getAsFile(),ra=Qo.name.split(".").pop();(0,Rt.I)(Qo,Uo=>{var wa,Wt,Ho;Uo.id?((wa=Qo==null?void 0:Qo.type)==null?void 0:wa.indexOf("image"))>-1?Bi.replaceSelection(`<img width="100%" src="/api/attachments/${Uo.id}?type=${Uo.content_type})" alt="" />`):((Wt=Qo==null?void 0:Qo.type)==null?void 0:Wt.indexOf("video"))>-1?Bi.replaceSelection(`<video width="100%" controls src="/api/attachments/${Uo.id}"></video>`):((Ho=Qo==null?void 0:Qo.type)==null?void 0:Ho.indexOf("pdf"))>-1?Bi.replaceSelection(`<a href="/api/attachments/${Uo.id}?type=${Qo.type}&disposition=inline" target="_blank">${Qo.name}</a>`):li.includes(ra)?Bi.replaceSelection(`<a href="/api/attachments/${Uo.id}?type=office&disposition=inline" target="_blank">${Qo.name}</a>`):Bi.replaceSelection(`[${Qo.name}](/api/attachments/${Uo.id}?type=${Uo.content_type})`):(Uo==null?void 0:Uo.status)===401&&(document.location.href="/user/login")})}catch(Ko){ln.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Bi=pt().fromTextArea(na.current,{mode:Qi,lineNumbers:!mi,lineWrapping:!0,value:Mt,autoCloseTags:!0,autoCloseBrackets:!0});return Bi.on("keyup",function(Pn,hr){hr.keyCode===8&&(Pn.getValue()==""?Bi.setOption("placeholder",Cr):Bi.setOption("placeholder",null))}),Bi.on("keydown",function(Pn,hr){if(hr.keyCode===8){var or=jn(Pn);or&&hr.preventDefault()}}),fi&&Bi.focus(),Bi.on("paste",Ki),Ii&&Bi.on("beforeChange",function(Pn,hr){(hr.origin==="paste"||hr.origin==="+input")&&hr.cancel()}),ro(Bi),()=>{Bi.off("paste",Ki)}}},[]);const Vt=(0,le.useCallback)(()=>{if(Do.current)try{}catch(Ki){console.log(Ki,"---- to set md editor body height")}},[po,Do,rr]);(0,le.useEffect)(()=>{function Ki(){let Bi=new St.Z(Pn=>{for(let hr of Pn)(hr.target.offsetHeight>0||hr.target.offsetWidth>0)&&(Vt(),hn.setSize("100%","100%"),hn.refresh())});return Bi.observe(na.current.parentElement),Bi}if(hn){const Bi=Ki();return()=>{var Pn,hr;(Pn=na.current)!=null&&Pn.parentElement&&Bi.unobserve((hr=na.current)==null?void 0:hr.parentElement)}}},[hn,Vt]),(0,le.useEffect)(()=>{if(hn){let Ki=[];for(const[Bi,Pn]of Object.entries(Ji)){let hr={[Bi]:()=>{Gt(Pn)}};Ki.push(hr),hn.addKeyMap(hr)}return()=>{for(let Bi of Ki)hn.removeKeyMap(Bi)}}},[hn]),(0,le.useEffect)(()=>{$t!==rr&&er($t)},[$t]),(0,Rn.Z)(()=>{if(!Ke&&so>0){let Ki=new Date().getTime(),Bi=window.sessionStorage.getItem(vr);Ki>=so+ji&&(!Bi||Bi!==Gr)&&(window.sessionStorage.setItem(vr,Gr),ia(!0))}},ji),(0,le.useEffect)(()=>{Xn(wn)},[hn,wn]),(0,le.useEffect)(()=>{hn&&fi&&hn.focus()},[hn,fi]),(0,le.useEffect)(()=>{if(yn&&hn){let Ki=function(Pn){let hr=Pn.target;if(Jo.current){let or=hr.scrollTop/hr.scrollHeight;Jo.current.scrollTop=Jo.current.scrollHeight*or}};const Bi=hn.getScrollerElement();return Bi.addEventListener("scroll",Ki),()=>{Bi.removeEventListener("scroll",Ki)}}},[hn,yn]),(0,le.useEffect)(()=>{if(hn&&Xt){let Ki=function(Bi,Pn){Xt(Bi,Pn)};return hn.on("beforeChange",Ki),()=>{hn.off("beforeChange",Ki)}}},[hn,Xt]),(0,le.useEffect)(()=>{if(hn&&xn){let Ki=function(){xn(hn.getValue())};return hn.on("blur",Ki),()=>{hn.off("blur",Ki)}}},[hn,xn]);function jn(Ki,Bi){var Pn=Ki.getDoc(),hr=Pn.getCursor(),or=Pn.getLine(hr.line),xo=or.charAt(hr.ch-1),Yr=or.lastIndexOf("@\u2581@",hr.ch),qo=or.lastIndexOf("@\u2581\u2581@",hr.ch),Ko=Yr>qo?Yr:qo,Qo=Yr>qo?3:4;if(Fr.indexOf(xo)===-1)return null;if(console.log("change1:",Bi,Ki,or,hr,Ko,Yr,qo,xo),Ko>=0&&hr.ch-Ko<5){var ra=Ko+Qo;return Pn.replaceRange("",{line:hr.line,ch:Ko},{line:hr.line,ch:ra}),{line:hr.line,ch:ra}}return null}(0,le.useEffect)(()=>{if(hn){let Ki=function(Bi,Pn){const hr=Bi.getValue();So(hr),vo(new Date().getTime()),Bi.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),_t&&(_n?_t(hr,si(hr)):_t(hr))};return hn.on("change",Ki),()=>{hn.off("change",Ki)}}},[hn,_t]),(0,le.useEffect)(()=>{if(hn)if(Mt==null)hn.setValue(""),So("");else{const Ki=window.scrollY||window.pageYOffset;Mt!==hn.getValue()&&(hn.setValue(Mt),So(Mt),hn.setCursor(Ii?1:hn.lineCount(),0),window.scrollTo(0,Ki))}},[hn,Mt]);const Gt=(0,le.useCallback)(Ki=>{const Bi=hn.getCursor(),Pn=hn.getSelection();let hr=Pn.split(`
|
|
`);switch(Ki){case"bold":return hn.replaceSelection("**"+Pn+"**"),Pn===""&&hn.setCursor(Bi.line,Bi.ch+2),hn.focus();case"italic":return hn.replaceSelection("*"+Pn+"*"),Pn===""&&hn.setCursor(Bi.line,Bi.ch+1),hn.focus();case"code":return hn.replaceSelection("`"+Pn+"`"),Pn===""&&hn.setCursor(Bi.line,Bi.ch+1),hn.focus();case"inline-latex":return Wr("inline-latex"),hn.focus();case"latex":return hn.replaceSelection("```latex\n"+Pn+"\n```"),hn.setCursor(Bi.line+1,Pn.length+1),hn.focus();case"line-break":return hn.replaceSelection(`<br/>
|
|
`),hn.focus();case"list-ul":return Pn===""?hn.replaceSelection("- "+Pn):hn.replaceSelection(hr.map(or=>or===""?"":`- ${or}`).join(`
|
|
`)),hn.focus();case"list-ol":return Pn===""?hn.replaceSelection("1. "+Pn):hn.replaceSelection(hr.map((or,xo)=>or===""?"":`${xo+1}. ${or}`).join(`
|
|
`)),hn.focus();case"add-null-ch":return Pn===""&&hn.setCursor(Bi.line,Bi.ch),hn.replaceSelection(Gi),hn.focus();case"add-signal":return Pn===""&&hn.setCursor(Bi.line,Bi.ch),hn.replaceSelection(be),hn.focus();case"add-multiple":return Pn===""&&hn.setCursor(Bi.line,Bi.ch),hn.replaceSelection(Fr),hn.focus();case"inster-template-1":return Pn===""&&hn.setCursor(Bi.line,Bi.ch),hn.replaceSelection(gn),hn.focus();case"eraser":return hn.setValue(""),hn.focus();case"trigger-watch":return Xn(!yn),hn.focus();case"trigger-full-screen":return er(!rr),hn.focus();case di:Wr(di);return;case bi:Wr(bi);return;case cn:Wr(cn);return;case ii:Wr(ii);return;case"maths-latex":Wr("maths-latex");return;case Yt:Wr(Yt);return;case Di:Wr(Di);return;default:throw new Error}},[hn,yn,rr]),Ie=(0,le.useCallback)((Ki,Bi)=>{var Pn,hr,or,xo,Yr,qo;switch(Wr(""),Pr){case di:const{title:wa,link:Wt}=Ki;return hn.replaceSelection(`[${wa}](${Wt})`),hn.focus();case bi:const{language:Ho,content:wr}=Ki;return hn.replaceSelection(["```"+Ho,wr,"```"].join(`
|
|
`)),hn.focus();case"maths-latex":for(var Ko=atob(Ki),Qo=new Uint8Array(Ko.length),ra=0;ra<Ko.length;ra++)Qo[ra]=Ko.charCodeAt(ra);var Uo=new Blob([Qo],{type:"image/png"});(0,Rt.I)(Uo,es=>{es.id?hn.replaceSelection(``):(es==null?void 0:es.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":hn.replaceSelection("`$$"+Ki+"$$`");break;case cn:case ii:case Vi:const{src:no,alt:bo}=Ki,oo=Bi,fa=(or=(hr=(Pn=oo==null?void 0:oo.name)==null?void 0:Pn.split("."))==null?void 0:hr.pop)==null?void 0:or.call(hr);return((xo=oo==null?void 0:oo.type)==null?void 0:xo.indexOf("image"))>-1||!(oo!=null&&oo.type)?oo!=null&&oo.align||oo!=null&&oo.width?hn.replaceSelection(`<p style="text-align:${oo.align||"initial"}"><img width="${oo.width?oo.width+"%":"initial"}" src="${no}" alt="${bo||""}" /></p>`):hn.replaceSelection(`<img width="100%" src="${no}" alt="${bo||""}" />`):((Yr=oo==null?void 0:oo.type)==null?void 0:Yr.indexOf("video"))>-1?hn.replaceSelection(`<video width="100%" controls src="${no}"></video>`):((qo=oo==null?void 0:oo.type)==null?void 0:qo.indexOf("pdf"))>-1?hn.replaceSelection(`<a href="${no}?type=${oo.type}&disposition=inline" target="_blank">${oo.name}</a>`):li.includes(fa)?hn.replaceSelection(`<a href="${no}?type=office&disposition=inline" target="_blank">${oo.name}</a>`):hn.replaceSelection(`[${oo.name}](${no})`),hn.focus();case Di:const{row:ga,col:Mo,align:Fo}=Ki;let vs=`
|
|
`;for(let es=0;es<ga;es++){let ps=[],ms=[];for(let Kr=0;Kr<Mo;Kr++)es===1&&ms.push(Gn[Fo]),ps.push(" ");es===1&&(vs+=`| ${ms.join(" | ")} |
|
|
`),vs+=`| ${ps.join(Mo===1?"":" | ")} |
|
|
`}return hn.replaceSelection(vs+`
|
|
`),hn.focus();default:throw new Error}},[hn,Pr]),ai=(0,le.useMemo)(()=>{switch(Pr){case di:return le.createElement(ni,{callback:Ie,onCancel:hi});case bi:return le.createElement(Kn.Z,{callback:Ie,onCancel:hi});case cn:return le.createElement(Rt.Z,{callback:Ie,onCancel:hi});case Yt:return le.createElement(Kt,{callback:Ie,onCancel:hi});case Di:return le.createElement(un,{callback:Ie,onCancel:hi});case"maths-latex":return le.createElement(en,{showSaveButton:!0,callback:Ie});case"inline-latex":return le.createElement(Qt.Z,{showSaveButton:!0,callback:Ie});default:return null}},[Pr]);function hi(){Wr("")}(0,le.useEffect)(()=>{if(ho.current){let Ki=function(Yr){or=!0,xo=Yr.pageY},Bi=function(){or=!1},Pn=function(Yr){if(or){let qo=Yr.pageY-xo;qo<0&&(qo=0),qo>300&&(qo=300);let Ko=xi+qo+"px";yo(Ko)}},hr=ho.current,or=!1,xo=0;return hr.addEventListener("mousedown",Ki),document.addEventListener("mousemove",Pn),document.addEventListener("mouseup",Bi),()=>{hr.removeEventListener("mousedown",Ki),document.removeEventListener("mousemove",Pn),document.removeEventListener("mouseup",Bi)}}},[hn,ho]),(0,le.useEffect)(()=>{yo(xi)},[xi]);const _i=Hn(At),Yi=Hn(po),Ti={width:_i,height:Yi},In=(0,le.useMemo)(()=>{if(so){let Ki=new Date(so),Bi=Ki.getHours(),Pn=Ki.getMinutes(),hr=Ki.getSeconds();return Bi=Bi<10?"0"+Bi:Bi,Pn=Pn<10?"0"+Pn:Pn,hr=hr<10?"0"+hr:hr,`${Bi}:${Pn}:${hr}`}return 0},[so]),si=Ki=>{const Bi=[];if(_n){let Pn=-1;Ki=Ki.replace(/(@▁▁@|@▁@)/g,function(hr,or,xo){Bi.push({multiLine:hr!==be})})}return Bi};function yi(){window.sessionStorage.removeItem(vr),ia(!1),vo(0)}function $n(){ia(!1),vo(0),hn.setValue(window.sessionStorage.getItem(vr))}(0,le.useEffect)(()=>{$i[Pr]&&Pr!==ii&&Pr!==Yt&&setTimeout(()=>{const Ki=document.getElementsByClassName("markdown-popup-form")[0],Bi=window.innerWidth/2-Ki.offsetWidth/2,Pn=window.innerHeight/2-Ki.offsetHeight/2;Ar(Bi),br(Pn)},0)},[Pr]);const pi=Ki=>{Ki.preventDefault();const Bi=Ki.clientX-Tn,Pn=Ki.clientY-Bo;document.body.onmousemove=hr=>{let or=hr.clientX-Bi,xo=hr.clientY-Pn;const Yr=document.getElementsByClassName("markdown-popup-form")[0],qo=window.innerWidth-Yr.offsetWidth,Ko=window.innerHeight-Yr.offsetHeight;or=Math.max(0,Math.min(or,qo)),xo=Math.max(0,Math.min(xo,Ko)),ur(hr.clientX,hr.clientY,Bi,Pn)&&(Ar(or),br(xo))},document.body.onmouseup=function(){document.body.onmousemove=null}},ur=(Ki,Bi,Pn,hr)=>{const or=document.body.clientHeight,xo=document.body.clientWidth;return Ki<20&&Pn>Ki||Ki>xo-20&&Pn<Ki||Bi<20&&hr>Bi||Bi>or-20&&hr<Bi?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return le.createElement(le.Fragment,null,le.createElement("div",{className:"markdown-editor-wrapper",ref:Do},le.createElement("div",{className:`markdown-editor-container ${Hi} ${yn?"on-preview":""} ${mi?"mini":""} ${rr?"full-screen":""}`,style:Ti},le.createElement(st,{insertTemp:Yn,watch:yn,fullScreen:rr,showNullButton:Lt,showNullProgramButton:_n,onActionCallback:Gt,hidetoolBar:ci,extraUse:Sr}),le.createElement("div",{className:"markdown-editor-body"},le.createElement("div",{className:"codemirror-container"},le.createElement("textarea",{ref:na,placeholder:Cr})),yn?le.createElement("div",{ref:Jo,className:"preview-container"},Qi==="stex"&&le.createElement(dt,{value:Gr}),Qi!=="stex"&&le.createElement(Tt.Z,{disabledFill:Fi,showProgramFill:_n,value:Gr})):null))),Dr?le.createElement("a",{ref:ho,className:"editor-resize"}):null,Pr===ii&&le.createElement(On,{callback:Ie,onCancel:hi}),Pr===Yt&&le.createElement(Kt,{callback:Ie,onCancel:hi}),le.createElement(nt.Z,null,$i[Pr]&&Pr!==ii&&Pr!==Yt?le.createElement(En.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Tn,top:Bo},title:le.createElement("div",{style:{cursor:"move"},onMouseDown:pi},$i[Pr]),open:!0,onCancel:hi,footer:null,destroyOnClose:!0,width:Pr===Yt?"1200px":null,height:Pr===Yt?"80vh":null,className:"markdown-popup-form"},ai):null))}},17077:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return _e},I:function(){return st}});var le=Le(28284),Ue=Le(6767),pt=Le(37568),St=Le(77736),yt=Le(71051),Oe=Le(47889),at=Le(99571),Ct=Le(46699),ot=Le(59301),We=Le(59301),Tt=Object.defineProperty,dt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(nt,Ye,ct)=>Ye in nt?Tt(nt,Ye,{enumerable:!0,configurable:!0,writable:!0,value:ct}):nt[Ye]=ct,se=(nt,Ye)=>{for(var ct in Ye||(Ye={}))ne.call(Ye,ct)&&de(nt,ct,Ye[ct]);if(De)for(var ct of De(Ye))te.call(Ye,ct)&&de(nt,ct,Ye[ct]);return nt},pe=(nt,Ye)=>dt(nt,kt(Ye));const{useForm:ye}=le.default,we={width:280,marginRight:10},Ce={labelCol:{span:5},wrapperCol:{span:19}};var _e=({callback:nt,onCancel:Ye})=>{const[ct]=ye();let $e=(0,ot.useRef)();function Et(fn){$e.current.width=ct.getFieldValue("width"),$e.current.align=ct.getFieldValue("align"),nt(fn,$e.current)}function Pt(fn,qt){if(fn.status===-1){Ue.ZP.error(fn.message);return}ct.setFieldsValue({src:`/api/attachments/${fn.id}`,type:qt.type})}function Bt(fn){let qt=fn.target.files[0];$e.current=qt,st(qt,Pt)}return We.createElement(le.default,pe(se({form:ct},Ce),{className:"upload-image-panel",onFinish:Et,style:{width:470,overflow:"hidden"}}),We.createElement(le.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},We.createElement("div",{className:"flex-container"},We.createElement(le.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},We.createElement(pt.default,{style:we})),We.createElement(Ze,{onFileChange:Bt}))),We.createElement(le.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},We.createElement(pt.default,{style:{width:264}})),We.createElement(le.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},We.createElement(St.Z,null,We.createElement(le.default.Item,{name:"width",style:{margin:0}},We.createElement(yt.Z,{style:{width:264}})),We.createElement("span",{className:"ml8"},"%"))),We.createElement(le.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(le.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},We.createElement(at.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),We.createElement(at.ZP,{type:"default",onClick:Ye},"\u53D6\u6D88"))))};function Ze({onFileChange:nt}){return We.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",We.createElement("input",{type:"file",onChange:nt}))}function st(nt,Ye){if(!nt)throw new String("\u6CA1\u6709\u6587\u4EF6");let ct=new FormData;ct.append("editormd-image-file",nt),ct.append("file_param_name","editormd-image-file"),ct.append("byxhr","true");var $e=new window.XMLHttpRequest;$e.withCredentials=!0,$e.addEventListener("load",function(Et){Ye(JSON.parse(Et.target.responseText),nt)},!1),$e.addEventListener("error",function(Et){console.error(Et)},!1),$e.open("POST",`${Ct.KI}/api/attachments.json`),$e.send(ct)}},91558:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return pt}});var le=Le(59301),Ue=Le(4676);class pt extends le.Component{constructor(yt){super(yt);const Oe=window.document;this.node=Oe.createElement("div"),Oe.body.appendChild(this.node)}render(){const{children:yt}=this.props;return(0,Ue.createPortal)(yt,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},75975:function(Zn,ei,Le){"use strict";Le.d(ei,{SV:function(){return on},ZP:function(){return et}});var le=Le(59301),Ue=Le(76374);const pt={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"]},St={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"]},yt={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(`
|
|
`)}]},at={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 Ct=Le(53184),ot=Le.n(Ct),We=Object.defineProperty,Tt=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,te=(Kt,pn,Nt)=>pn in Kt?We(Kt,pn,{enumerable:!0,configurable:!0,writable:!0,value:Nt}):Kt[pn]=Nt,de=(Kt,pn)=>{for(var Nt in pn||(pn={}))De.call(pn,Nt)&&te(Kt,Nt,pn[Nt]);if(kt)for(var Nt of kt(pn))ne.call(pn,Nt)&&te(Kt,Nt,pn[Nt]);return Kt},se=(Kt,pn)=>Tt(Kt,dt(pn)),pe=(Kt,pn,Nt)=>new Promise((Dt,Ot)=>{var un=Dn=>{try{An(Nt.next(Dn))}catch(Ai){Ot(Ai)}},Sn=Dn=>{try{An(Nt.throw(Dn))}catch(Ai){Ot(Ai)}},An=Dn=>Dn.done?Dt(Dn.value):Promise.resolve(Dn.value).then(un,Sn);An((Nt=Nt.apply(Kt,pn)).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"]}},we=(Kt,pn)=>pn.map(Nt=>({label:Nt,kind:Kt.languages.CompletionItemKind.Keyword,insertText:Nt})),Ce=Kt=>Object.keys(ye.tables).map(pn=>({label:pn,kind:Kt.languages.CompletionItemKind.Variable,insertText:pn})),_e=(Kt,pn)=>{const Nt=ye.tables[Kt];return Nt?Nt.map(Dt=>({label:Dt,kind:pn.languages.CompletionItemKind.Field,insertText:Dt})):[]};function Ze(Kt,pn,Nt,Dt,Ot){let un=pn.getWordUntilPosition(Nt),Sn={startLineNumber:Nt.lineNumber,endLineNumber:Nt.lineNumber,startColumn:un.startColumn,endColumn:un.endColumn},An=Dt.map(Dn=>({label:Dn,kind:Kt.languages.CompletionItemKind.Keyword,insertText:Dn,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Sn}));return Ot.map(Dn=>{An.push(se(de({},Dn),{range:Sn}))}),An}var st=Kt=>{ye.languages.map(Ot=>(Kt.languages.registerDocumentFormattingEditProvider(Ot,{provideDocumentFormattingEdits(un,Sn,An){return pe(this,null,function*(){const Dn=ot()(un.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:un.getFullModelRange(),text:Dn}]})}}),Ot));const pn=yt.quickKey.map(Ot=>({label:Ot.label,kind:Kt.languages.CompletionItemKind.Method,insertText:Ot.content,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Nt=Oe.quickKey.map(Ot=>({label:Ot.label,kind:Kt.languages.CompletionItemKind.Method,insertText:Ot.content,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Dt=St.quickKey.map(Ot=>({label:Ot.label,kind:Kt.languages.CompletionItemKind.Method,insertText:Ot.content,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet}));Kt.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ot,un){var Sn=Ot.getWordUntilPosition(un),An={startLineNumber:un.lineNumber,endLineNumber:un.lineNumber,startColumn:Sn.startColumn,endColumn:Sn.endColumn},Dn=Ot.getLineContent(un.lineNumber).substring(Sn.startColumn-2,Sn.endColumn);return{suggestions:[...yt.keywords.map(Ai=>({label:Ai,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai,insertText:Ai,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...yt.quickKey.map(Ai=>({label:Ai.label,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai.content,insertText:Dn.startsWith("#")?Ai.content.replace(/#/,""):Ai.content,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Kt.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ot,un){var Sn=Ot.getWordUntilPosition(un),An={startLineNumber:un.lineNumber,endLineNumber:un.lineNumber,startColumn:Sn.startColumn,endColumn:Sn.endColumn};return{suggestions:[...pt.keywords.map(Dn=>({label:Dn,kind:Kt.languages.CompletionItemKind.Function,documentation:Dn,insertText:Dn,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Kt.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ot,un){var Sn=Ot.getWordUntilPosition(un),An={startLineNumber:un.lineNumber,endLineNumber:un.lineNumber,startColumn:Sn.startColumn,endColumn:Sn.endColumn},Dn=Ot.getLineContent(un.lineNumber).substring(Sn.startColumn-2,Sn.endColumn);return{suggestions:[...St.keywords.map(Ai=>({label:Ai,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai,insertText:Ai,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...St.quickKey.map(Ai=>({label:Ai.label,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai.content,insertText:Dn.startsWith("#")?Ai.content.replace(/#/,""):Ai.content,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Kt.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Ot,un){var Sn=Ot.getWordUntilPosition(un),An={startLineNumber:un.lineNumber,endLineNumber:un.lineNumber,startColumn:Sn.startColumn,endColumn:Sn.endColumn},Dn=Ot.getLineContent(un.lineNumber).substring(Sn.startColumn-2,Sn.endColumn);return{suggestions:[...at.keywords.map(Ai=>({label:Ai,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai,insertText:Ai,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...at.quickKey.map(Ai=>({label:Ai.label,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai.content,insertText:Dn.startsWith("#")?Ai.content.replace(/#/,""):Ai.content,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Kt.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ot,un){var Sn=Ot.getWordUntilPosition(un),An={startLineNumber:un.lineNumber,endLineNumber:un.lineNumber,startColumn:Sn.startColumn,endColumn:Sn.endColumn},Dn=Ot.getLineContent(un.lineNumber).substring(Sn.startColumn-2,Sn.endColumn);return{suggestions:[...Oe.keywords.map(Ai=>({label:Ai,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai,insertText:Ai,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...Oe.quickKey.map(Ai=>({label:Ai.label,kind:Kt.languages.CompletionItemKind.Function,documentation:Ai.content,insertText:Dn.startsWith("#")?Ai.content.replace(/#/,""):Ai.content,insertTextRules:Kt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}})};const nt="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Ye=Object.defineProperty,ct=(Kt,pn,Nt)=>pn in Kt?Ye(Kt,pn,{enumerable:!0,configurable:!0,writable:!0,value:Nt}):Kt[pn]=Nt,$e=(Kt,pn,Nt)=>ct(Kt,typeof pn!="symbol"?pn+"":pn,Nt);const Et=class mS{constructor(pn,Nt,Dt){this.placeholder=pn,this.editor=Nt,this.monaco=Dt,Nt.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return mS.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)}};$e(Et,"ID","editor.widget.placeholderHint");var Bt=Et,fn=Le(96236),qt=Le(6767),vn=Le(25399),tn=Le(89392),it=Le(49535),rt=Le(56102),dn=Object.defineProperty,ni=Object.defineProperties,Kn=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,Bn=Object.prototype.propertyIsEnumerable,ui=(Kt,pn,Nt)=>pn in Kt?dn(Kt,pn,{enumerable:!0,configurable:!0,writable:!0,value:Nt}):Kt[pn]=Nt,It=(Kt,pn)=>{for(var Nt in pn||(pn={}))En.call(pn,Nt)&&ui(Kt,Nt,pn[Nt]);if(Rt)for(var Nt of Rt(pn))Bn.call(pn,Nt)&&ui(Kt,Nt,pn[Nt]);return Kt},On=(Kt,pn)=>ni(Kt,Kn(pn)),ht=(Kt,pn)=>{var Nt={};for(var Dt in Kt)En.call(Kt,Dt)&&pn.indexOf(Dt)<0&&(Nt[Dt]=Kt[Dt]);if(Kt!=null&&Rt)for(var Dt of Rt(Kt))pn.indexOf(Dt)<0&&Bn.call(Kt,Dt)&&(Nt[Dt]=Kt[Dt]);return Nt},kn=(Kt,pn,Nt)=>new Promise((Dt,Ot)=>{var un=Dn=>{try{An(Nt.next(Dn))}catch(Ai){Ot(Ai)}},Sn=Dn=>{try{An(Nt.throw(Dn))}catch(Ai){Ot(Ai)}},An=Dn=>Dn.done?Dt(Dn.value):Promise.resolve(Dn.value).then(un,Sn);An((Nt=Nt.apply(Kt,pn)).next())});function Oi(Kt){return/^\d+$/.test(Kt)?`${Kt}px`:Kt}function ze(){}let Me=!1;const Ee={"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 Te(Kt=[]){let pn=Kt;if(Array.isArray(Kt)){for(let Nt=0;Nt<Kt.length;Nt++){let Dt=Ee[Kt[Nt]];if(Dt)return Dt}return pn[0]}return Ee[pn]||pn}let He=null;const Ae=()=>kn(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Kt){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Kt)}});var et=Kt=>{var pn=Kt,{width:Nt="100%",height:Dt="100%",value:Ot,language:un="javascript",style:Sn={},options:An={},overrideServices:Dn={},theme:Ai="vs-dark",onEditBlur:en,isCopy:Qt=!1,onSave:ln,autoHeight:di=!1,forbidCopy:cn=!1,onChange:Yt=ze,editorDidMount:ii=ze,onFocus:Vi=ze,onBreakPoint:bi=ze,breakPointValue:Di=[],filename:Mr="educoder.txt",errorLine:Gn,errorContent:Rn="",highlightLine:Jn,openBreakPoint:Ni=!1,placeholder:ji="",showMiniMap:Gi=!0}=pn,Fr=ht(pn,["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 be=(0,le.useRef)(),gn=(0,le.useRef)({}),li=(0,le.useRef)(),Hn=(0,le.useRef)(),oi=(0,le.useRef)([]),ki=(0,le.useRef)(!1),Ji=(0,le.useRef)(),$i=(0,le.useRef)(),ir=(0,le.useRef)(!1),[Mt,_t]=(0,le.useState)(!1);function At(){let Xt;return be.current&&(Xt=new Ue.Z(ri=>{for(let Hi of ri)(Hi.target.offsetHeight>0||Hi.target.offsetWidth>0)&&gn.current.instance.layout()}),Xt.observe(be.current)),Xt}function xi(){qt.ZP.warning({content:decodeURIComponent(nt),key:"monaco-editor-tip"})}const mi=()=>{let Xt=gn.current.instance;if(Ot!=null&&Xt&&Mt){const ri=Xt.getModel();ri&&Ot!==ri.getValue()&&(Me=!0,ri.setValue(Ot),Xt.layout(),Me=!1)}};(0,le.useEffect)(()=>{const Xt=it.Z.subscribe("formatDocument",ri=>{var Hi;let gi=gn.current.instance;(Hi=gi==null?void 0:gi.getAction)==null||Hi.call(gi,"editor.action.formatDocument").run()});return window.updateMonacoValue=ri=>{Yt(ri)},Xt},[]),(0,le.useEffect)(()=>{var Xt;let ri=gn.current.instance;Hn.current&&clearTimeout(Hn.current),Hn.current=setTimeout(()=>{mi()},500),Ot&&(Ot!=null&&Ot.length)&&((Xt=ri==null?void 0:ri.updateOptions)==null||Xt.call(ri,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Ot.split(/\r\n|\r|\n/g).length))+3,5)}))},[Ot,Mt,gn.current]),(0,le.useEffect)(()=>{if(Gn&&gn.current&&gn.current.instance){let ri=gn.current.instance;ri.changeViewZones(function(Hi){var gi=document.createElement("div");gi.style.padding="10px 20px",gi.style.width="calc(100% - 20px)",gi.className="my-error-line-wrp",gi.innerHTML=Rn,Hi.addZone({afterLineNumber:Gn||11,heightInLines:3,domNode:gi})});var Xt={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}};ri.addOverlayWidget(Xt),ri.revealPositionInCenter({lineNumber:20,column:1})}},[Gn,gn.current,Mt]);const fi=(Xt="",ri)=>{if(!Xt||Xt.trim()==="")return!0;const gi=gn.current.instance.getModel().getLineTokens(ri);let Ii=!1;for(let Fi=0;Fi<2;Fi++)gi.getStandardTokenType(Fi)===1&&(Ii=!0);return Ii};(0,le.useEffect)(()=>{var Xt;const ri=(Xt=gn.current)==null?void 0:Xt.instance;if(ri&&Mt&&cn){const Hi=ri.onDidBlurEditorWidget(()=>{ir.current=!1}),gi=ri.onDidFocusEditorText(()=>{ir.current=!0});return()=>{Hi.dispose(),gi.dispose()}}},[gn.current,Mt,cn]),(0,le.useEffect)(()=>{var Xt;if((Xt=gn.current)!=null&&Xt.instance&&Mt&&Ni){let ri=gn.current.instance,Hi=ri.getModel();if(!Hi)return;(()=>{var Xn;let rr=[],er=[];const Pr=Hi.getAllDecorations();for(let so of Pr)so.options.className==="highlighted-line"&&(rr.push((Xn=so==null?void 0:so.range)==null?void 0:Xn.startLineNumber),er.push(so==null?void 0:so.id));if(Jn===rr[0])return;Hi.deltaDecorations(er,[]);const Wr=Hi.getLineCount();Jn&&Jn<=Wr&&(ri.deltaDecorations([],[{range:new He.Range(Jn,1,Jn,Hi.getLineMaxColumn(Jn)),options:{isWholeLine:!0,className:"highlighted-line"}}]),ri.revealLineInCenter(Jn))})();const Ii=(Xn=!1)=>{var rr;let er=[],Pr=[];const Wr=Hi.getAllDecorations();for(let so of Wr)so.options.linesDecorationsClassName==="breakpoints-select"&&(er.push((rr=so==null?void 0:so.range)==null?void 0:rr.startLineNumber),Pr.push(so==null?void 0:so.id));if(Xn)return{lines:er,ids:Pr};bi(er)},Fi=Xn=>kn(void 0,null,function*(){let rr={range:new He.Range(Xn,1,Xn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Hi.deltaDecorations([],[rr]),Ii()}),Cr=Xn=>kn(void 0,null,function*(){let rr=[];const er=ri.getLineDecorations(Xn);for(let Pr of er)Pr.options.linesDecorationsClassName==="breakpoints-select"&&rr.push(Pr.id);yield Hi.deltaDecorations(rr,[]),Ii()}),xr=Xn=>{let rr=ri.getLineDecorations(Xn);for(let er of rr)if(er.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,tn.isEqual)(Di,Ii(!0).lines)){Hi.deltaDecorations(Ii(!0).ids,[]);const Xn=Di.map(rr=>({range:new He.Range(rr,1,rr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Hi.deltaDecorations([],Xn)}const Sr=ri.onDidChangeModelContent(Xn=>{let rr=ri.getPosition();if(rr){let er=rr.lineNumber;clearTimeout($i.current),$i.current=setTimeout(()=>{fi(Hi.getLineContent(er),er)?Cr(er):xr(er)?(Cr(er),Fi(er)):Ii()},100)}}),hn=ri.onMouseDown(Xn=>{var rr,er,Pr;if(Xn.target.detail&&((Pr=(er=(rr=Xn.target)==null?void 0:rr.element)==null?void 0:er.className)!=null&&Pr.includes("line-numbers"))){let Wr=Xn.target.position.lineNumber;if(fi(Hi.getLineContent(Wr),Wr))return;xr(Wr)?Cr(Wr):Fi(Wr)}}),ro=Xn=>{let rr={range:new He.Range(Xn,1,Xn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};oi.current=ri.deltaDecorations(oi.current,[rr])},Gr=()=>{oi.current=ri.deltaDecorations(oi.current,[])},So=ri.onMouseMove(Xn=>{var rr,er,Pr;if(Gr(),Xn.target.detail&&((Pr=(er=(rr=Xn.target)==null?void 0:rr.element)==null?void 0:er.className)!=null&&Pr.includes("line-numbers"))){let Wr=Xn.target.position.lineNumber;if(fi(Hi.getLineContent(Wr),Wr))return;ro(Wr)}}),yn=ri.onMouseLeave(()=>{Gr()});return()=>{Sr.dispose(),hn.dispose(),So.dispose(),yn.dispose()}}},[gn.current,Mt,Di,Jn,Ni,un]),(0,le.useEffect)(()=>{var Xt;(Xt=gn.current)!=null&&Xt.instance&&Ni&&gn.current.instance.setPosition({lineNumber:0,column:0})},[Jn]);function wn(){let Xt=gn.current.instance;if(Xt){const ri=Xt.getSelection(),Hi=gn.current.pastePos||{},gi=new He.Range(Hi.startLineNumber||ri.endLineNumber,Hi.startColumn||ri.endColumn,Hi.endLineNumber||ri.endLineNumber,Hi.endColumn||ri.endColumn);setTimeout(()=>{Xt.executeEdits("",[{range:gi,text:""}])},300)}}function Yn(Xt){(window.navigator.platform.match("Mac")?Xt.metaKey:Xt.ctrlKey)&&Xt.keyCode==83&&(Xt.preventDefault(),ln())}const Qi=()=>{if(di&&gn.current.instance){const Xt=gn.current.instance.getContentHeight();$t(Xt<Dt?Dt:Xt)}else $t(Dt)};function vr(Xt){var ri=document.createEvent("MouseEvents");ri.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Xt.dispatchEvent(ri)}const Dr=Xt=>{if(!ir.current)return;const{keyCode:ri,ctrlKey:Hi,metaKey:gi,target:Ii,type:Fi}=Xt;return(Fi==="paste"||(ri===67||ri===86)&&(gi||Hi))&&Ii.nodeName==="TEXTAREA"&&(xi(),Xt.preventDefault()),!1};function Ke(Xt,ri){var Hi=window.URL||window.webkitURL||window,gi=new Blob([ri]),Ii=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ii.href=Hi.createObjectURL(gi),Ii.download=Xt,vr(Ii)}(0,le.useEffect)(()=>{Qi()},[Qi]),(0,le.useEffect)(()=>{be.current&&!Mt&&Promise.all([Le.e(8909),Le.e(6656)]).then(Le.bind(Le,71448)).then(Xt=>{try{He=Xt,gn.current.instance=He.editor.create(be.current,{value:Ot,language:Te(un),theme:Ai,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Gi||!1}},Dn);const ri=gn.current.instance;let Ii=[...fn.BH._menuItems].find(Sr=>Sr[0]._debugName=="EditorContext")[1],Fi=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Cr=(Sr,hn)=>{var ro,Gr;let So=Sr._first;do hn.includes((Gr=(ro=So.element)==null?void 0:ro.command)==null?void 0:Gr.id)&&Sr._remove(So);while(So=So.next)};if(ii(ri,He),setTimeout(()=>{Qi(),gn.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Ke(Mr||"educoder.txt",ri.getValue())}})},500),gn.current.subscription=ri.onDidChangeModelContent(Sr=>{ki.current?clearTimeout(Ji.current):(Qi(),Yt(ri.getValue(),Sr)),Ji.current=setTimeout(()=>{ki.current=!1},500)}),window.Monaco||st(He,Te(un)),cn&&(Cr(Ii,Fi),be.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Dr),window.removeEventListener("paste",Dr),window.addEventListener("keydown",Dr),window.addEventListener("paste",Dr)),window.Monaco=He,en&&ri.onDidBlurEditorWidget(()=>{en(ri.getValue())}),Vi&&ri.onDidFocusEditorText(()=>{cn&&Ae(),Vi(ri.getValue())}),cn){Ae();try{ri.onDidPaste(Sr=>{const hn=ri.getSelection(),ro=gn.current.pastePos||{},Gr=new He.Range(ro.startLineNumber||hn.endLineNumber,ro.startColumn||hn.endColumn,ro.endLineNumber||hn.endLineNumber,ro.endColumn||hn.endColumn);ri.executeEdits("",[{range:Sr.range,text:""}])})}catch(Sr){}}let xr=At();return ji&&typeof ji=="string"&&new Bt(ji,ri,He),_t(!0),()=>{const Sr=gn.current.instance;Sr.dispose();const hn=Sr.getModel();hn&&hn.dispose(),gn.current.subscription&&gn.current.subscription.dispose(),xr.unobserve(be.current)}}catch(ri){}})},[]),(0,le.useEffect)(()=>{if(gn.current.instance&&Mt)return document.addEventListener("keydown",Yn,!1),()=>{document.removeEventListener("keydown",Yn)}},[ln,Mt]),(0,le.useEffect)(()=>{let Xt=gn.current.instance;if(Xt&&Mt){let ri=Te(un);He.editor.setModelLanguage(Xt.getModel(),ri)}},[un,Mt]),(0,le.useEffect)(()=>{gn.current.instance&&Mt&&He.editor.setTheme(Ai)},[Ai,Mt]),(0,le.useEffect)(()=>{let Xt=gn.current.instance;li.current=An,Xt&&Mt&&(Xt.updateOptions(It({},An)),setTimeout(()=>{Xt.getModel().updateOptions(It({},An))},200))},[JSON.stringify(An),Mt]),(0,le.useEffect)(()=>{let Xt=gn.current.instance;Xt&&Mt&&Xt.layout()},[Nt,Dt,Mt]);const[Lt,_n]=(0,le.useState)(Oi(Nt)),[ci,$t]=(0,le.useState)(Oi(Dt)),xn=On(It({},Sn),{width:Lt,height:ci,position:"relative"});return le.createElement("div",{className:"my-monaco-editor",ref:be,style:xn},Qt&&le.createElement(rt.CopyToClipboard,{text:Ot,onCopy:()=>qt.ZP.success("\u590D\u5236\u6210\u529F")},le.createElement(vn.Z,{title:"\u590D\u5236\u4EE3\u7801"},le.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},le.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function on({width:Kt="100%",height:pn="100%",original:Nt,modified:Dt,language:Ot,options:un={}}){const Sn=(0,le.useRef)(),[An,Dn]=(0,le.useState)(null);function Ai(di){let cn;return Sn.current&&(cn=new Ue.Z(Yt=>{for(let ii of Yt)(ii.target.offsetHeight>0||ii.target.offsetWidth>0)&&di.layout()}),cn.observe(Sn.current)),cn}(0,le.useEffect)(()=>(Sn.current&&Promise.all([Le.e(8909),Le.e(9404)]).then(Le.bind(Le,2550)).then(di=>{He=di;const cn=He.editor.createDiffEditor(Sn.current,On(It({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},un),{wordWrap:!0}));Dn(cn);let Yt=Ai(cn);return()=>{cn.dispose();const ii=cn.getModel();ii&&ii.dispose(),Yt.unobserve(Sn.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,le.useEffect)(()=>{An&&An.setModel({original:He.editor.createModel(Nt,Ot),modified:He.editor.createModel(Dt,Ot)})},[Nt,Dt,Ot,An]);const en=Oi(Kt),Qt=Oi(pn),ln={width:en,height:Qt};return le.createElement("div",{className:"my-diff-editor",ref:Sn,style:ln})}},10661:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Tt}});var le={flex_box_center:"flex_box_center___AQ53o",flex_space_between:"flex_space_between___i2aIa",flex_box_vertical_center:"flex_box_vertical_center___sPEKB",flex_box_center_end:"flex_box_center_end___GhSSH",flex_box_column:"flex_box_column___R9_Hb",list:"list___jb2Ay",wrap:"wrap___VsQDr",lockWrap:"lockWrap___g1k1T",li:"li___IxCLC",cover:"cover___Mu8wr",img:"img___IpFLA",movebq:"movebq___mF7wt",bq:"bq___Bil0T",sign:"sign___DXJ4d",name:"name___l7FoJ",e:"e___pXQUG",unit:"unit___wCIFR",tags:"tags___w_Mil",tag1:"tag1___dxm7r",tag2:"tag2___llZkf"},Ue=Le(29787),pt=Le(25399),St=Le(92310),yt=Le.n(St),Oe=Le(51257),at=Le(28426),Ct=Le(48790),ot=Le(59301),Tt=({className:dt,dataSource:kt=[],col:De=4,right:ne,bottom:te=23,precision:de=0,wrapWidth:se=1200,trackEventItems:pe,loading:ye,onRemove:we=()=>{},isCurrent:Ce=!0,showAlias:_e=!1})=>{const Ze=Math.floor((se-(De-1)*ne)/De),st=[{name:"\u63A8\u8350\u81EA\u5B66",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101\u8BA1\u5212",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"\u56FD\u5BB6\u4E00\u6D41",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"\u7701\u7EA7\u4E00\u6D41",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"\u7CBE\u54C1\u8BFE\u7A0B",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"\u519B\u961F\u4E00\u6D41",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"\u65B0\u578B\u6559\u6750",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return ot.createElement(Ue.Z,{spinning:ye},ot.createElement("div",{className:yt()(le.list,dt)},!!(kt!=null&&kt.length)&&(kt==null?void 0:kt.map((nt,Ye)=>{var ct;const{name:$e,id:Et,identifier:Pt,featured:Bt,school_name:fn,image_url:qt,excellent:vn,is_plan:tn}=nt;return ot.createElement("div",{key:Et,className:le.wrap,style:{width:Ze,marginRight:(1+Ye)%De===0?0:ne+de,marginBottom:te}},ot.createElement("a",{className:le.li,onClick:it=>{it.preventDefault(),it.stopPropagation(),pe&&(0,Oe.L9)([pe]),(0,Oe.xg)(`/paths/${Pt}`)}},ot.createElement("div",{className:le.img},ot.createElement("img",{className:le.cover,src:`${qt}`}),Ce&&(0,Ct.bg)()&&(nt==null?void 0:nt.studying)&&ot.createElement("div",{className:`${le.movebq} user-path-items`,onClick:it=>{it.stopPropagation(),we(nt)}},ot.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),ot.createElement("span",{className:"c-red"},"\u79FB\u9664")),(ct=nt==null?void 0:nt.subject_tags)==null?void 0:ct.map((it,rt)=>{var dn,ni;if(rt===0){const Rt=(dn=st.find(En=>En.name==it))==null?void 0:dn.swimg;return ot.createElement("img",{className:le.sign,src:Rt,style:{left:"-4px"}})}const Kn=(ni=st.find(Rt=>Rt.name==it))==null?void 0:ni.ptimg;return ot.createElement("img",{className:le.sign,src:Kn,style:{left:`${48+52*(rt-1)+2*rt}px`}})}),ot.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(nt==null?void 0:nt.excellent)&&ot.createElement("div",{className:le.bq},"\u5F00\u653E\u8BFE\u7A0B"))),ot.createElement("div",{className:le.name},ot.createElement(pt.Z,{title:_e&&(nt!=null&&nt.excellent_alias_name)?ot.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${$e}`,ot.createElement("br",null),ot.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${nt==null?void 0:nt.excellent_alias_name}`)):$e},ot.createElement("span",{className:le.e},_e&&(nt==null?void 0:nt.excellent_alias_name)||$e))),ot.createElement(pt.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${fn}`},ot.createElement("div",{className:le.unit},ot.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),fn)),ot.createElement("div",{className:le.tags},ot.createElement("div",null,ot.createElement(pt.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},ot.createElement("span",null,ot.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),ot.createElement("span",null,nt.stages_count))),ot.createElement(pt.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},ot.createElement("span",null,ot.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),ot.createElement("span",null,nt.members_count)))))))})),!kt.length&&ot.createElement(at.Z,null)))}},9148:function(Zn,ei,Le){"use strict";Le.d(ei,{jL:function(){return yt},w9:function(){return dn},QD:function(){return en},cQ:function(){return qt.Z},op:function(){return Ot},O5:function(){return li},_b:function(){return ii},t7:function(){return se},Gi:function(){return ui},YG:function(){return En},qp:function(){return Tt},vr:function(){return di},qE:function(){return An},Je:function(){return we},wb:function(){return fn},cq:function(){return ze},tp:function(){return De}});var le=Le(59301),Ue={flex_box_center:"flex_box_center___NeSU8",flex_space_between:"flex_space_between___ImTGl",flex_box_vertical_center:"flex_box_vertical_center___BtRd9",flex_box_center_end:"flex_box_center_end___qcLe3",flex_box_column:"flex_box_column___Ze_3q",banner:"banner___PoUBO",content:"content___XoDjy",btns:"btns___Pb35j"},pt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAA0CAYAAAAkEw66AAAAAXNSR0IArs4c6QAAGNVJREFUeF7VmwmwHVWdxr9zuvvu9+3ZXsxCiNkIQZOwEzMgyADjggsWgzPqOAJaMiCjYiGKqDBQAo4iWGAxA+ooMm7gBhSyhBBRIIBSAQlrHuTt7913t97PmfpOd4cXlLAFGO6rW9237719+/z6+6/nPIHX+XHttddaex38nlW2lLO1svq1wJ4aeFMM9CqFnNKoaYVapDAOicfjGEMKqKk2nrx59Lbt5xx6aPR6DEG8Hj/K3xwY0YtjSx2vYnlspLEsX0BRKUBrINtyX+PZp0r3fR+IIgzFSo9EsahFUfSHWIj7Pa919zvf2vlo+rFXdWivObjHJvR8S6vTJORHckV0+4GBAF4InwQlBCAIkEMXgCLA9Mn9WCef4ft8HWkgVIDn6ckwUA/HQfCzoFX71TsP6n/41aL3moHTWotnJnGysPEFx8ZcAtMqGTjh2NmVTL+iDB6BZurjsRSe2SogjhNwMZIngbZbqgXom8N26/KjV3femB7ebRxfE3DbRnW/k8c3LQvv5yCjOFVVqhgCyNnJmAhoxyOFasz1OeCM2lLTJryI4BQQUn1RAhI24Lc1dBjc2K6Nnv2edfP+sLvIvergxqb0vpHA1fk8lre9xBZpZsYKU9sMYiDvAHKaqU4HuANcZrIpcILiezRdo7z0aUw3BoJYI4gELAeI/bjZmBq9+PGNd5x/+unHua8U4KsKbriujxUSV9gW+rwg9WPTfpHgpEgUQgAFJwU6LSDwjSxA8F2jslSBBJaZKwVGJRv1pSAJLyQ8qlwLOA4Q1us31Z58+OTj3rX/E68E3qsGbmhK/6Nt40oIFMJwZ5URFh/cZoGgHQKODeSsaUEiA5iSy6IqYRnfmPq66YojPILbYbqpGXuhRhRrFPMSUaP+6OTAtuPff8ze97xceK8KuJGG/oBl4XsaKMTTsiwDKVXZjm1qsgRBU84TXi5VXqo24/syP5ce2xEg0gBDeAZWFijo79JnpLQxXSo7iICiIyD8qUfdxuQRRx24x5MvB95uBzfW1G+XFn4GoMMojQNOYWUK45b+jG9mW+PvFNAKEkqVYgI583VZcOB7WRrCqGwiaQovU1lAlaXKM/BMQNIGbN0FLGh0lySCVv0OP3aPOnKf2a2XCm+3ghuc1AvzOdwmLSwIwkQlBoxMtgZYCkvwQLafBYo0l2v6gBcCxRxQyifwM9PckRCniXIGbjo8wiI4bgnRRFul0XAZMABbaggVoytvo12vff7Qt/Rc8LqBm5jQndrBr3MFHOwyemaJbGaaAKzMp00zV2O+6VVnSTCPcYCNdrItEGAOcKxpVUQKLjPZ6VHVgEuf3Kf/rLk0Y4ViTpiAEUYKJaEgVDg2OTq1+j3r5w68FHi7TXFDU/El1Yr8VLudDM4IjUpLVWW2Mg0GgubybATNfN/0C5+eqjQ9oO0ngAmR0ZF5X2bKjLRZBUFgNE03AKhcPqk62wJsm+qjvyM4Aa0idFN1zcmvHraq90uvObihqej4YsH6nzCEyHwRB0WFZeZJ05xupsZSp6sty+2mXX2a/5rP0fT8MAHRZpmWph48J38zi6xUF1Vqft9KAg2BES6PmyChGGFTBVJ1kb/dq7XeeuTBs0deLLxXrLhHn2nP6+4s3Gk7Yl6Q5mpZMMjAGWjT0o+dgkR6BVnUzJSW2PpzhpHVqIygdPiEET3rzwiHP2QCSlrjUm1epE0el+R1/E6SmjDa2nGEat5Bu9089bC9O7/1moDT0GJkMv5eR6f1oVY7MRfjp2SiNgOO5pkFBpnkadmD/qflRrAtiUrBhJFdPnauJhI6SU6noXSyb2BmUZUqzYKEqSSSZ6SUSU34WagYVUsg9N27R7DtkONWrmRcf8HHK1Lc4EjrqHJn6ZdxBIsXkXU2MqVZqU/ja5ZU/MyWR5/Bps1/wfD2p+G7TUy1QziWRHfZgVXsREd3H1YtnoW+vl709nSjv7f0V4MwPnRaRUGlxSm8rG7N0pAMlim/CE4Jk+tRbTxmAoYK4Qit/Mhb9/a9eze9ILW/YQwv5jvmM/fcs720YMnMDeWStabtJrmVUVaqtsy3sRqgAm+96yH85qbb4DZqWNjfi57uHlRKJViWjSCM0Wr5aDRaqDebqDeaqLkRLFugp7OIQudMrFn+JvT3z8Ee8+dgVldxp+tkpUB42ZZgqLrEnyUq89MkODkunjVVoREFMao5G367een6lZ2fejEQXrbiBgbbn+qZUbyETcWs2KZ/Ynsoi6aMgEPjLVz6Xz/B1OjT2P8tyzB7Zm/i6IMQYRghDGk2ielkLaKIPiiM4PshGk0XzWYDU40a6m6Ickmi3N2Lt+y1B5a+eQ+sXLIQM7rLxi1QiR47I2l3xPizFFyitsQnmqhq8juNks1go2BrDRG4WwMv3veItT1TLwTvZYH7w0NP9y7sn3NPqSgXMiCYRuNz1MbE9eEnRnDhpVdh1fxu7L1iCYIwghcECKMYUfaMY4Rh8jogxJgQNQjP+CECpUK4H8bwPR8tgmzW0Ao8lEsW+vrn4sA1S7Fs2VKsXDIP1UrO3BymMD7PEwvj6wJjnjTTJFAEsUJOJj4y8iMUWIfE8bp1Kzs2virgtg23PtHTV7os9JI0wASFNPWg4vI54LGBMZz/je/i71YvQv/sWXA9D2EYIooiAzCOYoRxDM/z4Xo+PC+Az2MR31NpkU4fpKGUQKRkoiSCjCSiSCAKVPLddgON9hQsK0TXjA7su3YVDjt0Hdbu82ZzbQYgVZb6OJOW0GQjZW54XtACInTkHXjt5kXr9+r4zG4Hd/bZZ8uTTz1rY7liHxiHiR9h+sFAQHNxJMulCGed/x2jtHlv6ofruogILaZpEl6MIAiML2u1XQRhaIDxeKZGqoEAObgoTkBGkUp7bvRRfC0QRpZRkYqk6SjHcYDQryNXVNj/oLX4yIc/iMULZyVVSFr0GxVmlQWDg0xSFG5j372rV1fXr1wpdhldX7Kpbn2mtbqrs7jRkqLIC6VDzgIBwZUKwGXfuwFjA49g331WoO26CSwDh/BieK6HyakaPM9LTZbv0WQJL0r2o9ioMkhN2gDka0JkDhYpExW1FtCQEMKGlg6gbWhTxjPFaKBvZgUfP/njOHz9WrRS5QXG9AkvzeXoHxXrVw0n9puxEm8+dGVlaFeqe8ngBifiT1Y65aUha7+0+M7Sj0IeeOixYXznO1fiHQfvY1REs4wiBoIAcRQZkBOTk/B9P1GSCRBBoraQn/dTmDxOiATGLV+nioxjA49wINjAY4YtIaQFwX1hQYtkn/AtW+Okfzsdf/+OA9H2Uj+XdoiZltBebaGh2a9DrONYvfdtK8q/2L3gaurXxaI4WqUJJH2ETTPltVsaX73wvzG7IjGrrwce4RhoieKCMMDY+LiBZ2AwGJjAQKg0Sx6jCrWBmQAlTJo3vx+ZvIvOXLBEEAJCMPFNQrkBBwnNfcuGMFAFlIqRyxdw+he/gv1WL0PDTftzSicd41jBYaURa/SUHLTrjc+vX9mxy47JS1LcpoGB4qKOuZvzebFMpyUPT0BoTD023P0wfvWL67DfPsvhut4O80z8Woip+hQma41UWVQRDMwEXIQ43Se4OApSYEAYeAijwADSmp1RghPGt3Kb5MMJxEx9VJ2QNu8mYNlQUYj+hUtx9nnnolIpw83KrrSSMOCURmfOQejWr37bis6P7DbFba/ptZal77SlyPFy6WC5ZedBKYWLLrkKs6oOCvl8AoR+zWwjeL6L4dFRuJ5CEGpTsEeBQBD4iFWMWEWIwjpU6Ca+kNswNll+zCgECSkcKM02CQtS/nK0oxPDFDzRIYFSfYRIcFRfzgDktRz7z5/E8Scci7ar0g4xc0aePen0VaSAiLxHutVTe6/cRfn1khQ3OBEdU6xYv4oZbzjJopJISrX96aFtuOaH12D5ogXw/QABVZQFhCDC5NQ4xienEIQCbijh+RKTvXPhVYrIPTGAXLOOOJ4AwhAxzTKomTTEdHy1l/guc5voWTmXSPWFSVAwf7FRH83YuD5jxgQooS3HqE9Bomf2fJx9wcXo7KjAp3swLSZApjPeJUvDioLBkttYvHZtf/v5VPeSwD09Fp9Z7pDnEhzvD1MEqo2d2ut+swEPbr4fM3p7jIqYbhjlBKHxdcMjQ0ZtXmjDbSsMLFqJx048AWDWv/kvWPjNy2DXB5hXAHEIpZqwZNVct1INSFkyoJRyE1g6hjaFnp2IDyrxezqFaMClHQdjsjljsrzuk8/4Cg46ZF9zPQYc05k0qpYswFH+uCW9VYcsm7F994CbiL5fKlkf4lyC1nSswnRlWcBfftVP0RgZRqGQR2jKKd/4JZrpxOQExicmEIQWvDCHhu9gyz99FN76VQCt0AZmnnUxSg/cAUuGEKoJaBdSZjVpBCk7EnDahxRlKHCfjbccNPMis29mWSGMH6TqNKQxWStJVayccQvrjv4ATj7lRLTcpL1k2kym0GUJJlASvuvo6JADV3RtfsngbtXa3gsoBA3k3Rakb8GtiuiaUtk+xveUqRjoU9gmKuYFLr/yGkwMjSBH5xrQ4dNPBaYiGBwehOu24QUCXuhgSnTjsTPOQDxvRjqjrNB31tdRfvwB5O0cEI9BaA9SVhCpGqA56+NAa/oIC5AER2XlmfdDhT60FLBoxlYAof0UnjLukAo1arPyxhev2vcAnHbWOSaJNmWe6elRCAm4TukrS0XvOGivrt+9aHDba8GaQt56r4A8XADztYIVKgimXH6M7iDUebackzJLIm8LlIsSP/jRz/HU1ieQcywDLnHwAWq1BsbGR5M6lYrzJEZmLsHw5z8LlOm0AWwfQ885X0Ol/oypHRFPwpZF2FYXwngEgoBEHpEaNwpTyJsqROsCgupMtFeshLt8Oap/ug8d998CKQgvgICfRFppm/QEBAdg1oIlOOMrF6BcLsAPlCnHIjPvClQcgW4nhFThPxy8ovPXLwjugaGh8uxyzwXlvPOxsoPC9PUaZpYoLZobHtAMtAEhoVDKSXSUHdy+YSN+d9MGFKm4NK0gwKHhUTSaNZPL+ZEFzwXGVrwNk6edlkDjHMLmrei78DzkLR8W18qoEUiRgxR5xKoJ2+ox4EJVh5B9UDqPel8vWgccAW/Naug5Myk84OkJzDn3FOTbIwacFASXJMSC/XOZhxISHTP6ceZ5F6GzuxNekEb5IKlIOvISvU7AhPiog5ZVbtgluE0DurigHPx4RnfunXQXbNJm8wEZQAYCphDs99c9YMqDKbALtjJNyNGRQVx++dWwtDA5GHMyz/ewfXAYntdE4AfwjFkINHsXY+JzXwPmdptGXunKH6D79uuRzxVhqwBKDSFnzTTRNIrHIQXz+RAxTVF1obFqPcY/ehLQVU2CLG+AApwNGzHjR99GTk0Bqg0pvCQ9sRxIY6o5aGmjWOnCmed/A70zZ8INmCpxbGwoAF0Fgd5cEBVkfNj+Szvu2CW4rUPumTN6C+faCijwxqTTeNmXssV+bM1w9oiqm2wToELgt1AtSHQULVxzzU/w5/u2mKUMcRCg3W7hmeFhBF4rKaPY6WDGJDrQnrcUrdX7wRkcQuXe22HHU7CFgDT+zE/AKR9au7CsPkSqAWWiaieG3nkCvPe9G+DSGQrqwUdRuHUjylvvQS4ahaObELoBAVqFSCsJzto4Jkg4OQdn/sd/ord/Plw/MtAIj5Y1oywxq+DXrThae8CKzq3PC+6ux4dndRZ67uut2nM68sn6jWxtx/QvZebKiWKCq7WAmtm2IZSPGR0FjI9uxxVXfB+tqTokYgNu++AQVOSZ1EErunSWRBXTyYASkLIAbdGnMBhI6Lhu5COlA61Ck39JUTHRVAtO73ej0TMbEyeeBj1vjlGauP8RVL7/A+SDQdiowVF1SN02UVaa2fAkl2NU5TNnC5z+5QswY/5iuG4EN1KmhtWxwNwuBws7w+G85S1ftaBr8nnB3f1Y8/hqtfzDzhzQU0qm0v4WOLam6ecIjl2GWhuYaFF5IcamJtFZtNDX4WDzvZvxv9dej9BzoaIIo+Oj0FEAzSxfhyYSa50W5iAU20RNafIuwmol/k0yGPAGJJ0OZSJqHkqWEcU22vPegua/nAR0dxvVWZv+iI6fXomcrsNRDWhNU9UmAWZoVVYOgsFBOCjlLXzqjC+ia+6eaHsRmp5GMScxu8NCf4eF7qKIRBQ8mnfkz4PQ/83SuX/d2BSbHmne3Fktv72vDHQUEsWxGnjuIwPH3hf93FQbGKnTXDUeGhiCFDFmVHPoKlu49dYN+O1vb4alYozXpqBjggvNBHDyYIHDhJVQ+IiSYolFuXHqBQhGT+VCWiUTGaOYQIuIhYWQ34tLcBeugH/ch4DuXmBkEJXvXoB8ewwWXGiT77GWSBoA9G9cKBcLB92dFZx02umI8r0m9Vszv4QVsx10FYUZu7GuNHeuN1XkB9FN7Xbwmb0XVh/KuIhNWwOvs2Tn+6rCZAecITezU9PWc5i0Ml0JZKbfwsTHDU0Bky6wYcs20w7qrThGeaW8xJ0bN+HW2+5Eo9k0lQT9jWkEMVHl2dnhoNp4VLBc4uI4JrKRAcgEO7HDXFLQE64oGNz0k0pUkvUhCxZDrz4A4tEHkXvwLtgihNSJa0gEQNfAXp0NZTnGVSxeuADHHHcCpJXD+9f0YcUc2zRgn6sXnr9O3yeBlqeGJyfDE1cvKlxvkuvfP6512QF6y8kCFwYHllHZsgSezAwh7ZhyPIRHH/fMJDDWAn72x8dQb7XRVbZNoKgWLBRyAvfe/wBuuf0u1CYnIWVaQ9K5pRMrdNw8v5khM2rjZ2iYVGJWfxJunJbwBGjm0kx6ohj/zQpryyS82lKQpopgI0AnLodmaop9C4rVAwTWH3wgluy9Fh/cbxbWLSqa6idbJfpcS3PNupNkQnuioVrDk976I1eV7xW3b2lvL5eKczoLQKWQrIqk6rIeWwYuWw1kymwFTLaAgQlgsK5xxa1bUGu66ChYqOSpXMss4Ms5EtsGnsatGzahMTaWhutsLWsaug2s7F5nix7S/CKZ/08L+7RlZMqpDJ4hk62JShWbLj805Ve2II9zlCbJQqW7C/sftA4HrZiPUw/vRweD7S7A0a/XXW1SsLYSeGpIbxiZeOpIccufG8dVOys/5r2o5JNVQaw9WUrxhDRbk46k62/5moobbySKu397gK/9ZgsKFlDNSZQJzhHI2xKOJVDISTRbbfzpwS0YePxxxL73rJzNwNJZ62yG2dzydNlOUqVnK4PTdpKRWLqfLe/JPpO9nuZnTFRNyFj5Apbtswr5rpn4wpELcPiyqhHKrhTHsTJ4TLnCWNdgA3Dr/lHiuo2j1XJf7x2VvNiHTbZyBs9OA8U02zcTMjKJrsNTwEgT+NE9ow9864Ytt/dVZVDNW6LsSBT5XUsgZ7P7L5BzbDPX+qeHH8HAlr+YZQeJjSWpwk4P2pdhk05mcHfHa3YyzXKa9GD6mez9hOiOhHjHwjzzOzZ65s3B/D2XolSt7nnh+5a9a0mfZcZLkTz3MrJronVxoQ+ziPEWsL3GXDZ60NjIr/6sjynk8EsHEPRxDBK8E1ztw+k+njhHFTqJCTMl4Qm21eDd/KR7+NePLt35fPnO/8fj592ljz5sPn49rwBUC4mF0bqmp2HZMguKhOC4kpPpF8fNgLEjkPzyz/qzjo3zcwKSyqOfy2avePKuNHgwUjEB3j4FbB1R973/3zfsh9ten/+nerk35RM36MPfswdu2qMDoqOY9BO59jhb6zJdbVneyhSMixPpnphR7BSBr3tAf9i2cH45j9k0Dy58Zreitwr0dSRK5J0YbwJDLfo39eWTDrTOebkDeL2+13e5nnPZfrh/UTdmVvOJb6fq6OsIzziK9H8lCI6RldtMcX46ZbDT9V//oJ6fAz4iBI7VMfYp5SBmEFw1uTNcezFcB56YQPv329qHfPXo8n2vF4BX8rsXbdS/WD0L72ZThfA4NrqiLIdlMGSfjtBYn1Nx9HH1wDQ7Nj9v6/zGB3S5HWCvUlFfvWiGWMYFQpQzzXSoAfxlWD1w0X1y33tPEkyy33CPk6/TBx8yF7f05pDjuIrOzuaaVUoExxKT43a5akFCtVys3+Wcwweu1dbHV+LxN3VhPsEx8jANGfOAh4eiL5x0iHPeG47YtAv+9I3xp9f0yIvLDAw6ySIY/ExSnpkqVcels/x/syLgtXHpx9bhlF2CO/tanVuzHHfPqmJVOf0nNdr5SFP7D02Eb/3iEfkdtdsbFeCXbtYfXlDGueU85iKZsjXZklnpyZdpGmgWFcS4pGsQnzvuOBG/4CzXFX/Qp+zZi28pPzkZHeNIS337X2+Qp+IckWajb1RsyXWffqOeN8tRH+rKyWOhsSBnYyYziiCAa0k8EQKb2kF01acPc3akXS8IbsW1Onf6AnVib16ewqWz21vq9qu2yNPeqL7thW7xZ65391jcV1jE/1qKFcaeCfDwOYeK9D83nv32/wHzrWgvjJ8Q7AAAAABJRU5ErkJggg==",yt=({dataSource:Hn=[],img:oi,imgWidth:ki=346,title:Ji,sunTitle:$i,bannerExtraContent:ir})=>le.createElement("div",{className:Ue.banner},le.createElement("div",{className:Ue.content},le.createElement("aside",null,le.createElement("p",null,le.createElement("b",null,Ji),le.createElement("span",null,$i)),Hn.length>0&&le.createElement("div",{className:Ue.btns},Hn.map((Mt,_t)=>le.createElement("div",{key:_t,onClick:Mt.click},Mt.name,Mt.sign?le.createElement("img",{src:pt,width:39}):null))),ir),oi&&le.createElement("img",{style:{marginTop:33,marginRight:38},src:oi,width:ki}))),Oe={flex_box_center:"flex_box_center___hG6RI",flex_space_between:"flex_space_between___ss3Fh",flex_box_vertical_center:"flex_box_vertical_center___K80p9",flex_box_center_end:"flex_box_center_end___qmXX3",flex_box_column:"flex_box_column___GFV8F",row:"row___aXJjm",title:"title___HUKL0",tagsWrap:"tagsWrap___XB2W3",action:"action___VdHb1",bar:"bar___t1kKC",tag:"tag___V7Eft",name:"name___Hk1Ip",num:"num___xQpcH",active:"active___XryTX",tagsBorderWrap:"tagsBorderWrap___OMxjs"},at=Le(92310),Ct=Le.n(at),ot=Le(89392),Tt=({dataSource:Hn=[],value:oi,onChange:ki,onTitleChange:Ji,className:$i,title:ir,titleWidth:Mt=41,style:_t={},fontColor:At="#6A7283",showCount:xi})=>{const[mi,fi]=(0,le.useState)(0),[wn,Yn]=(0,le.useState)(!1),Qi=(0,le.useRef)(null),vr=(0,le.useRef)(null);return(0,le.useEffect)(()=>{var Dr;Hn.length!==0&&(((Dr=Qi==null?void 0:Qi.current)==null?void 0:Dr.clientHeight)>97?fi(1):fi(0)),Hn.length===0&&fi(0),Yn(!1)},[Hn]),le.createElement("div",{className:Ct()(Oe.row,$i),style:_t},le.createElement("div",{onClick:(0,ot.throttle)(()=>Ji==null?void 0:Ji(),2e3),style:{width:Mt,marginTop:wn?12:4},className:`${Oe.title} ${Ji?"current":""}`},ir),le.createElement("div",{className:wn?`${Oe.tagsWrap} ${Oe.tagsBorderWrap}`:Oe.tagsWrap},le.createElement("div",{className:Oe.bar,ref:vr,style:mi>0?{height:mi===1?97:"auto",overflow:mi===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},le.createElement("div",{className:Oe.tag,ref:Qi},Hn==null?void 0:Hn.map(Dr=>le.createElement("span",{onClick:()=>ki(Dr.id),key:Dr.id,style:{color:At},className:oi===Dr.id?Oe.active:""},le.createElement("span",{title:Dr.name,className:Oe.name},Dr.name),!!xi&&le.createElement("span",{className:Oe.num},Dr.count))))),!!mi&&le.createElement(le.Fragment,null,mi===1?le.createElement("div",{onClick:()=>{var Dr;fi(2),((Dr=Qi==null?void 0:Qi.current)==null?void 0:Dr.clientHeight)>245?Yn(!0):Yn(!1)},className:Oe.action},"\u5C55\u5F00",le.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):le.createElement("div",{onClick:()=>{vr.current.scrollTop=0,fi(1),Yn(!1)},className:Oe.action},"\u6536\u8D77",le.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},dt={flex_box_center:"flex_box_center___aK2n3",flex_space_between:"flex_space_between___HX0Oh",flex_box_vertical_center:"flex_box_vertical_center___LJOJr",flex_box_center_end:"flex_box_center_end___SCakF",flex_box_column:"flex_box_column___AYv4m",tabs:"tabs___GTqPV",active:"active___F26E8"},De=({dataSource:Hn=[],value:oi,onChange:ki,className:Ji,style:$i={}})=>le.createElement("div",{style:$i,className:Ct()(dt.tabs,Ji)},Hn.map(ir=>le.createElement("span",{onClick:()=>ki(ir.id),className:oi===ir.id?dt.active:"",key:ir.id},ir.name))),ne={flex_box_center:"flex_box_center___yX6Oa",flex_space_between:"flex_space_between___t7oqF",flex_box_vertical_center:"flex_box_vertical_center___dEIHy",flex_box_center_end:"flex_box_center_end___taQDF",flex_box_column:"flex_box_column___xY_Lr",input:"input___PW2zI",dropdown:"dropdown___vSy8B",menu:"menu___NiyBu",text:"text___Grueu",b1:"b1___ZKryM",b2:"b2___aKyGa"},te=Le(37568),se=({dataSource:Hn=[],value:oi="",onChange:ki,onInputChange:Ji=()=>{},className:$i,style:ir={},placeholder:Mt,allowClear:_t=!1})=>{var At;const[xi,mi]=(0,le.useState)(""),[fi,wn]=(0,le.useState)("");(0,le.useEffect)(()=>{var vr;let Dr=oi;(vr=JSON.stringify(oi))!=null&&vr.includes("{")&&(mi(oi.id),Dr=oi.value||"");try{wn(decodeURIComponent(Dr||""))}catch(Ke){wn(decodeURIComponent(Dr||""))}},[oi]);const Yn=()=>{ki(encodeURIComponent(fi),xi||null)},Qi=vr=>{vr!==xi&&(mi(vr),ki(encodeURIComponent(fi),vr))};return le.createElement("div",{className:Ct()(ne.input,$i),style:ir},!!Hn.length&&le.createElement("div",{className:ne.dropdown},le.createElement("div",{className:ne.text},(At=Hn.find(vr=>vr.id===xi))==null?void 0:At.name,le.createElement("i",{className:"iconfont icon-zhankai4"}),le.createElement("b",{className:ne.b1}),le.createElement("b",{className:ne.b2})),le.createElement("div",{className:ne.menu},Hn.map((vr,Dr)=>le.createElement("div",{key:Dr,onClick:()=>Qi(vr.id)},vr.name)))),le.createElement(te.default,{onPressEnter:Yn,value:fi,onChange:vr=>{wn(vr.target.value),Ji(encodeURIComponent(vr.target.value),xi||null)},bordered:!1,placeholder:Mt}),le.createElement("i",{onClick:Yn,className:"iconfont icon-sousuo9 font14 pl10 current"}))},pe={flex_box_center:"flex_box_center___tol8o",flex_space_between:"flex_space_between___Z235C",flex_box_vertical_center:"flex_box_vertical_center___Wq1sZ",flex_box_center_end:"flex_box_center_end___LLxom",flex_box_column:"flex_box_column___DbMSN",quickPager:"quickPager___GM30J",disabled:"disabled___Ozc8I"},we=({value:Hn,onChange:oi,className:ki,total:Ji,pageSize:$i,style:ir={}})=>{const Mt=Hn<2,_t=Hn>=Math.ceil(Ji/$i);return Ji<=$i?le.createElement(le.Fragment,null):le.createElement("div",{className:Ct()(pe.quickPager,ki),style:ir},le.createElement("div",{onClick:()=>{Mt||oi(Hn-1,"prev")},className:Mt?pe.disabled:""},"\u4E0A\u4E00\u9875"),le.createElement("div",{onClick:()=>{_t||oi(Hn+1,"next")},className:_t?pe.disabled:""},"\u4E0B\u4E00\u9875"))},Ce={flex_box_center:"flex_box_center___FO7TP",flex_space_between:"flex_space_between___LotYx",flex_box_vertical_center:"flex_box_vertical_center___bWdaw",flex_box_center_end:"flex_box_center_end___mVJ1o",flex_box_column:"flex_box_column___M83Mm",list:"list___oOsiS",wrap:"wrap___G6T7F",lockWrap:"lockWrap___Rl79E",li:"li___oZZ7l",cover:"cover___b2bYW",img:"img___IQX7w",sign:"sign___HkT6C",name:"name___SsJx8",e:"e___TMqq0",tags:"tags___bcjyo",rate:"rate___YACg7"},_e=Le(29787),Ze=Le(25399),st=Le(58018),nt=Le(346),Ye=Le(51257),ct=Le(96908),$e=Le(57177),Et=Le(81378),Pt=Le(28426),fn=({className:Hn,dataSource:oi=[],col:ki=4,right:Ji,bottom:$i=23,precision:ir=0,wrapWidth:Mt=1200,trackEventItems:_t,loading:At})=>{const xi=Math.floor((Mt-(ki-1)*Ji)/ki);return le.createElement(_e.Z,{spinning:At},le.createElement("div",{className:Ct()(Ce.list,Hn)},!!oi.length&&oi.map((mi,fi)=>{const{name:wn,id:Yn,identifier:Qi,power:vr,cover_image_id:Dr,pic:Ke}=mi;return le.createElement("div",{className:Ce.wrap,key:Yn,style:{width:xi,marginRight:(1+fi)%ki===0?0:Ji+ir,marginBottom:$i}},le.createElement("a",{target:"_blank",href:`/shixuns/${Qi}/challenges`,className:Ce.li,onClick:Lt=>{Lt.preventDefault(),_t&&(0,Ye.L9)([_t]),vr&&(0,Ye.xg)(`/shixuns/${Qi}/challenges`)}},le.createElement("div",{className:Ce.img},le.createElement("img",{className:Ce.cover,src:`${Ke}`}),mi.is_jupyter&&le.createElement("img",{className:Ce.sign,src:ct}),mi.is_jupyter_lab&&le.createElement("img",{className:Ce.sign,src:$e}),mi.is_unity_3d&&le.createElement("img",{className:Ce.sign,src:Et})),le.createElement("div",{className:Ce.name},le.createElement(Ze.Z,{title:wn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},le.createElement("span",{className:Ce.e},wn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),le.createElement("div",{className:Ce.tags},le.createElement(Ze.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},le.createElement("span",null,le.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),le.createElement("span",null,mi.challenges_count))),!!mi.myshixuns_count&&le.createElement(Ze.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},le.createElement("span",null,le.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),le.createElement("span",null,mi.myshixuns_count))),le.createElement(Ze.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},le.createElement("span",null,le.createElement("span",null,mi.level))),le.createElement("div",{className:Ce.rate},le.createElement(st.Z,{allowHalf:!0,disabled:!0,defaultValue:mi.score_info}),le.createElement("span",null,"\xA0",mi.score_info?`${mi.score_info}\u5206`:"5\u5206")))),!vr&&le.createElement("div",{className:Ce.lockWrap},le.createElement("img",{src:`${nt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),le.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!oi.length&&le.createElement(Pt.Z,null)))},qt=Le(10661),vn={flex_box_center:"flex_box_center___eMcr7",flex_space_between:"flex_space_between___HcNca",flex_box_vertical_center:"flex_box_vertical_center___ZnvVN",flex_box_center_end:"flex_box_center_end___fdgDf",flex_box_column:"flex_box_column___SEKvd",list:"list___L1hmU",wrap:"wrap___pKgcW",lockWrap:"lockWrap___SMhkK",top:"top___udHSB",sign:"sign___uwRpq",name:"name___Fpf90",img:"img___AMLhL",text:"text___KiTb7",btns:"btns___i6IuZ",bottom:"bottom____k2sh"},tn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXWmQXFd1/s59r3t6nX00o93GluV9AQNxiAkIB0OMISFsFQqSAhOohFR+JKmEQPILClJZfpEfIUAChFQSHIJxnGDiDYwsb8KRLUuWZcmSxqN9pJF6nV7eSZ373u1509Mzvd2eGVt6VV2z9Ht3+9459+yX8Bq4mDmWK2GLqla3MvFWZt4KpjVMSBNzGoQ0M6WJkJbpMiNDxBkwMkyUIUYGxCeJaB8x7fMcZ18yiv1EVHy1Lw+9GicwO8tXlSrlbSB6O4HfANAmZlY250JEHsBHGLQTzA9H3chDfX2012Yfy9HWqwJgZh7NF6vvY/a2gWkbgyeWY3Hq+yDQcRA/RKQeSsSce4jo9EqMo50+Vy3AzNxXKFTv9MAfB/AuZo60M7Fe30tEZQA/UqBvx+POvUQ02+s+O2l/1QGcy5Xe6Cn1SXj8YYAHO5nU8j9DM1D0b8rzvpFMRp9a/v4X73HVAJwplN9GHj7P4NtW0wK1OxYCPcAKX0rHI4+0+2wv7l9xgHPFyrs9j78A5l/sxQRXrE2ix5SiLyZj7v+s2BgArBjA+XzpzR7oq8x880ouQK/7JqKnFfiziUT0iV731aj9ZQeYmYez+fJXiOguZl72/ldkkYmYmb+eSkT+lIjOLOcYlm2BBcx8sfoJz+O/BHhkOSe5evqiaaXoTxIx55tExMsxrmUBOJ/njVVUvgvmW5djUqu+D6JHHbgfTSRostdj7TnAuWLlDq/K37pwqXYxCGlaOfRbyZh7Xy9B7hnAzOzmCpUvA/jDC2WvbReogE3/TTLufo6IKu0+38r9PQE4n+f1VVS+B+ZbWhnEBX8P0Q4H7gcTCZqyvRbWARZHQLlavp8ZG20P9rXcHhEmI07kdtsODasA5/OlX6gy/dfF/bbTV5GmHeL3JBLRxzttof45awCLRYo9vpuZE7YGdyG2Q0R5UvQBWxYwKwBn8pWPEPg7IlhdiKDYnrMIXAz6WDrh/mu3bXcNcEC5P7wIbrdQzH9eQCZF7+2WkrsCWPZcD/TgRbZsF1zTmrBrBX5HN3tyxwD7YTOVRy8KVL0Bd65Vmo667q2dStcdASx6rofyjouqUK/B9dsXFUohcksnenLbAMtemy1UfnrRiLE84NZ6IdqRirtvbdfi1TbA2Xz5r5j5j5Z5ehe705RMf51KRP64ncVoC2BxHLDH9/batlz2gJPnFc7PArNVgvjViABH6Zhm/ZErQoxkH7AmxYhHlsX71s7aWr9XbNek6M52HBQtA6xdflx5pldCVaEMHDuvcK5A8AjI5oB8EShXgEoZKFeBSgVQCohEgKjr/4z3AUP9gCIg7jLWpBn9fa9lsMXa5d7UqquxJYCFYrOFyk964c8V4F44oVCsEs5lgfNZIJcHPMFIk27wU0sbof/V0UcyBgz2AyMDQDQCbBzwXrtAEz2airu/3ErQQEsA5wqVT3qe93WbPKfqAS+eUsiWCWdmgJPTQLVaB2gjw6oB3U9B0azbsGz5XV6KsWFg01pAzGqXjniIua89ilZK3ZWMu99ohklTgP0YqsqLNlnz+SJh7ymF8xkf2JKEkFu+BOx1Y8CGNcBAH2P9gGe5h5VujqZTCfeKZjFeTQHO5EpfA/ApW9N5ZYYweU5h6jhwPlfHcpux5Ha/BxCLAldfBqSijMtHX2sg4x/SyejvLIXNkgAHoa07bEnNe48rnCkQDr8CFBokehh2q1ntIizYsOVG3y/g6AH7dl3gykuAvj4gAkahSihUCCVP9nryJfNgj1dguIrQ5wKJCCMZZaSjjOGEh6jV9LbuSUb2YAW+ZamQ3CUBzubLT9mKW95zTOFkhnDoqC8NL8clL0oqSYgnCSoCVIM92580axAjji+BuyqQ4RgQOq8wUKrK/0jv83Ilo8BQzMO6VBUDseWYQfM+JO46lYi8cbE7FwVYZxxUvf9u3kXzOyZnCIfPKuw/FAhSgcxTz3GbyFQLpOh6Ics877qE9AAQiZEGSyJUI6JGOT5VxlxocEWvdgTcAGQBUtQwWRTDTQTkYhXIlQnZElD2fMBjDmMizdjYX0VkhSlbOepXF/M6LQpwJl/ebiOd5FyR8PxxhQNHgGKP8+9EL04PKU2tAr5LjIQLJB0DJmswDbACpuP41KuBFYDlEwBsKFdz72ClZqvA2SJpI4yALc+PJ6rYPCDSevOXvSd3EG1PJyK/1KjthgBLIhg8frjbwYgq9MRhB5PHgXOZha01k5nq9d4FalEgowk4/UMKTp/fR59iJBX0nqkBo8ASpsGVPdYHVD7yuwY8uLcGcrAyNZCljbopZErAqQKhWPGB3pD2cEl/RUyK3S5d+88renujhLeGI8nmyv9rI8vv+aMKh6cJk8eC8Tbjye1Oi4BEkpDo91lxVDFSjghS/lVjuQZgMXc6DDdgxRrYEAWbl0GDHwC6FMBmuLkycKJAKFUJMQe4YriCwdjy6t6S1ZhKRn6l0TY37386Pxd4st21rr9fWNnTkw72HeyNnit7Z/+YAsn+CUbaBWJ68wzADbFZQ8GaJSuex6INy9ZCVmDvNkBLW2Y/DrPpxdbmTBGYLhCYCBvSVWzury4rNSvgTfX5yQsoOJMr/T2AJXWrVsDfeUThldOEoydbubu9e9wIYWBUFtJnxwPOHPuct28KyHWs1yHWVCsgCgULwAZkDXBA3ealaAdgmYWoXlNZ0vtzfx9wzUhZ97NM19fSyeinw33NA1jKJmTzlePdZtaL40Cod8+BQGq2OLtIFBgcVVrlSTiMtDPXeHgy+ndDgYFkrPfZEBUb9cgA7H8X7M/B3m0o17QXNLvkjGRsx/OkJW+R2q8erWjW3fuLZlIJdyJcTmIewPl85QNV9r7X7UD2nVTYd4wweXTplpoZNuqf7osB6WEFD4xBw5IbdFG/b8rfMlENoKZQn01rISvYg42qNPcSzLFneRH0FWL/razR6QLh7KxvNLl2tLwsUrZD6oOJhHu3Gd88gLP5skRH3tnK4Je6Z/tBBwenGkvOnbYtHqL+Nb5DeFgMFK2wPSNBB9gYdu2zaNZg14QsvZfPl6r1ixH+NFCfms3nfBk4lSdEXcK1Y2X0tTLuZo0u8T0R3ZtKRN67AGApVZQrVI52W81GDANPHnGw64XA5RcaTODsWbSswGJCthguhsYJHjNGWwXXEJ0BSChYfjdsGKzB05Qb/M/swWGVSb8MwbMycNNGeG9uhse5EnC6qLShRUAWga5Xl1T/ScbddabEU42CbbkEX55W2DtFONAg87WZltToBZAFHV4rbBkYiDASLSzOPLYUAtgA6APFvkFD2HQAvBikjSQt1C036BdAKDt4EbSEbQwjIQNIM8BEXz5fJu3Zunqkt7basCuxthbZfOm7zPjNZgNt9v3OSYWXpgjHpxf655sB3Kjt0XEhLyDpMvrrBZVGqmadXlDbPo3QFLJUacOJYuhce+NXDu4z0nRY0hbDiTgu6oWxZmsi30sXIniJk0NUKDGK9Ooiwr+kEtGPhsQGCZEpH7NRQc7sv9PnlgzA0HNrZslKpgnxftKq0FCHZkAjYEl/AkxNWBKngo4aYWxdR7h8Qr5f3AJVKDF2H/FNnZHASSHgmz26FbCkv6kcoQrCVaMVpHsUiCAV+VLJyNoawEHtxz2tDLLZPT894OClI37oTTeXcoHRCaUdBbLvLrH2S3YzT481+CrA84CKJ2oc49feRHA1T176+vlBT8eGxSJ+PJgxc7ZjmRQ9+WiOEHMJ142WemYIibqRqyVYXs8qkyv9HoCvNptgK98/+rKD3S8CxVIrdy9+z8ioguoDBiOMePO1X9hQ6JkwFcuNQkns+UaJSpnx4V8iOC28QY+/6KFSBeIxaJVHuxoDo0k7sz1bIpwrETalq5hI9oxVfzadjP6dD3C+/B9gfn87g1zs3u2HHDz9/CIGjmY8OWhUjBlD4wpR8lWijq6wcyD4XW/ZQTBfqeJHbM5WGB9/W2sA/2yvp6k+0Qckoj6rNlaxdsYoe/8reV/6u3GsBKcdFtBqR0T/kU5EPqABzuZLLzPjklafXeq+n73s4JkXgFIXFDw2IdIMMBbh1vTdRgOqM0roNQwiN8TLpcEtC6dhfPK25gCLivbALtZUm4wDcQFYjCQdbh/ioDg1q3TwwIaUfSomwqFUInqpVOiK5QqVnK16yz854OCFg/LSLBSi6nFopBaJnXlkgtBHjCEb9WVDDgPDmiVao6zBBUR4+sztPsAvHmU89KwvOMn+KuDJfhuLsLZ7y/8kPFc+ArDEZndCwWYdROAShnLjmjKUZSqWetfJuJuk7Cxfx5XyszaoV9rQQtYkMD3TWYsjYwQ3ThgV6u1k7w11G1aRTJy1sEfJnBAOU5DPLOOzd/gA//wA49+3+/ZoAU8C9hIxRqoPSCeAlAG3zwc+2uEebIaYKQPTswqbByoYj9t3L5IbuZ5s2Z/NoB9/WWH/FOHY6QZ6cIM45nAQnbQxsVHpSIzRaGcvSPgpAViANTZvEazEEWDYswB8+QTjnTdKGA7hbJbx7YeBM1mgT8CNCqjsAxuHTpOR/Ve+kxfA2LE7JT6zF8vLcs2wfeOH2KUpVyh/3vP4i90vp9/CnuMKe15pbMlqxqJF700PkdYPJSKjkyvs9dEB8SEjhuy9IgUbAeuWrcC1m+aziVKF8cOngJdPCKA8n3KjQFxYdjRwMYZiuToZqzxzukjIVwnXj5T1S2PzUoq+QNl86dvM+JithjNFwtOTCk8+17zFeqF6fK2CijLWRHyvTzeX5gwBBUs7QrkSzSl6rLDW224A1gws3snOA4xnXvapt541a0NHKOynm3FKQN+JosLGlIeJpKR22LuI8B3K5sr3M/id9pr19+Fn9/sJZK3mFkn/Gy5ROjpj1IJwpfdcAVhin4U1e6ISARMDwLbrhAqbv0FHzzCeeInR5wCpuL/v9sneKy9gyG/czdrJMEVlSrmErcN2UzwI9GPK5MuP2U7mfmZS4YVX/Bjo8LWUGizS85p1hGSdE7+txTP6bqAOCRVrlajqS83XbwbecJnOs2252fwsQ6hZ2pFMRtl/ayG3gamy5cYWufFkUYLwCTeNWbZsEe2gbK70LAPXdTvI8PPTeYKA/OTu4L9GQFzCXzgwAKSGFIYc7spnKtgZdUgAFvelsOZrNwE3X946sOH5VD3Gjn2sbdkxAdmCgBVuX9yJ58oKVw1XkLSY50zAc7IHWzNyhAf96AEH+yehpelWrjVjhGiSMBZlcR51fIUBFoFKqFcMGrddD1w63hnAMpgn93uQUCRRmbQU3aWKFJ5gvgKcLilc2l/FSMye0UOMHZTJlU/bzBw0Az+dIzx3TGHHLn8PbHZt2KSgHMZ4N+qRsVYFrFnSUWXfFYPGO28ELptYCHClyrjnCeCJF32Hxi1XAnfcLFLy/Hu37w0ADqxYhoprHqpmE1zie9HLjxUUxpNVLWzZu2iasvnyLDN3s6yLjuexgw4OHAUOmbjoJUa++RKlY5bFc9TxFQZY2HPZ/+RngXe/Hrh87UKAv79DTJDzA99Fwn7PG+ff+8huD/kS0C/6cNwXtsRUaSNiUnawyRxhKAZcNmBPHyaiUk8Bzs4SnplSePw5P5uwfgsOC12XvE7BdRgjXfDnmr3ZWKvEHBkAfMfrgS3rFgL8Z//M+gUQsIxrUSTmP//Q/Hsf2OXp+/qTvtokurCoSyaeuuOXMnjwlRwhFSVcMWRPktYA94pFmwnvO6EgyWdPPOdLtDUvf92KXHKZ7z3qxLEvL4oSyVli8uTEQckOrPgClrxYuSLjzpsJV6xfCPBf/AvrPVrAMi+gWKw+5/thatf9z3g4XwAGk0DaOBsCn7D2NNZnQrSJ+NG8H30pgpa9S7Po3ghZ4UE+dUjh+DnCzr3zSy6E77lsi9KpJ+0ArM2QoRIe2lsURGr4rkDfW5QtAu97E+HKBgDf97RIyHMAS5ti4br9pvkA3/e0h5k8MBAALGZM0Yd1THUQ01XLoOhAljteJN3ONRbjtbSQ1Qs1qf4NFIqS/fjISWDfoSDZuq6myqVbFGLi/zXSQJ3tPaxpSfvakCFxVAFXEEuV1nsFYDFJGndghZErAO+/hXDVhsZC1oPPAruP+C/LdZuBt1+3UMj6wROM0xnGQMKn4Hk26SDHycRxmQS2dijxaIEQUaQzIWxdWk2ylSbabFCirkim4akZ4NmXfBDCe/DlW5SOvdJOBpNxv0ijJiPfUKuxVA0lgY0jvgAkL4BsCcb+fOm4sNcOSCsYw6GTrL1P2gccfKTfmTxr27b8XwcAhCxcbdhTMCUsOgJcPWSRRRM9JqbKHzH49mYA2fheFuSpIw7OFYCn9wRhPQHKW7YqXdhsIsicr0VfBB2HKdgYMgyI8vKsHwLeek17Viobc2Jm7J1iZIq+AaRmp24zlMcXsoArLAJMoPutOxtaWbTnjymcLRB27YcOr5Vr6xWkY5Q3JedaMKCaMknyjfEQyXeyzwqFFivAnW/ojkJbGfdi92SLjJ0HWbsXta06FAjQChXLnCbzhOE+xusG7TkctLPBtruw1YU6lSHsP62QLQC7DwJrxhWqirFloI5FByjXtuTQPlsTpMrAb79t+anXzFWo+Me7WEd6yN4sTgmTEtMKwBL8d7ygsDZZxXqLhg7tLrTt8G8VYHPfoWmF4znC0TMKmSrwun5PmwH9sjfBj9CebGpVihnSWKlyReBTv9KhA7ndAS9y/z1PeugPoj5MOE+rEZe5ih/ZIUaOIYuJ49rhbztkp5P1kr10+wEXB2cIG/s9DPbNVa+rUYnZi4N4ZpGShTVLPctMAfjM7Z0BfOgE4+cHgfN5YP0ocOtVrbkS6+f5b9s9DKUCCTtg1SbdpdmazJT8tJZrR+xmIOqQHdtBd80ms9j3UtTkP3dHMBpnbOpnQ8C1MoXmOSMxi+QqUq2w+Ewe+My72gf4wV2Me570JV/tpPB8gH7/DmDNYHsS93d/4gNcs3QFOnIrtmrRgUWWuGmNPQm6FnQnC7ccxo5WgL/72QgqHuPGCV4ArBG05Kdmz2UgN+sDfDYL/O672wN4aprxt/fMpaEIECacdt0w8Ad3tgfwPz3kYbQfWk/WwQFBWG0zgEWNFwl6oA/YMmgT4CBsVhY+ky/fDebfaAWEXt7zyAEHR2YUbpjwEHfnDCI1cg4iNLQLMGDPYj48m2kfYKHeR3b7QpGoNgZg8TzJnv4XH5bvWgf5Hx/0MNLvmzLDADdzRuSrUqlH6XoeaxIWPUnhwHebqSvdvABTM8CDByLYMMDYPNA4jNQYLjQQs5J240dBtsuif/A4Y9+UgMFatRGAhTMUSqT39N/eBmwYaR3gbz7oYTQNDKR8Z4REf7TibZJojlmPcMOo9bzhudQVm8ln3QAsz37vWVez5zdvDAEc+tUALM53EbBmAoA//c72WPR9TzFePsma2kR/FR1cABbqPZ8nfPhWYP1wewCPpIHBNgAWs6qwZynWstWigUPWcV7ymd6HLaWPdgvwzikHe04oXD/uYbjBIXnzKLgInAsAvqtNNen+ZxiTp1mrNkJtYkcWwU24grT5628mrG0DYM2iDcChPXgpFi2hOjNlhcstq0cL0kcDQctKAni3AIv/9vu7I7rK683rF7LpBQAXgDMZ4BPvaI+CJc/o2FnW3iHRW8UTJHu7ULAIbe+5mTAx1DoFf+thD8MCcEjIMtV7Gq2JCXqX6gLXj5XbCgRstsYNE8BtlXBo1nkr3+84pPDSGQc3rfMwUkfFJq9XVCRh0YaCP/QWQryFUFjTv0RonJzxU1I0BSs/+kMoeCbruwvHW1SVJL/p7sdYAyxStE5Oa6ImCfWeLYlwVcF4wm7aSsMSDraKsLQCYLN7ciXgnr0RXQfrzZt4XtEWDXCdFC37sGQoXLe5dYr72R4PJ87DZ9GBkGUo+FweeMd1tGRgfHgOzx1mPH+E9f4rAGtX4hIAy94r3iOXCNePlawmni1ahMVn03bKKDUDsJXv/++4g+eOKlw55mHT4NwT2oMU6MEiaIkeLFQsku8Nl0jUhqScNAf68X0eTmXmwm8MixbOIJXof/kawmj/0u3kZhn7p4Bdh31hTbPn4IURgBfLPJR0lUyZsGWwiuG4RdXIP1upcRklWcKVtkuHgfc8xg/3RFGsspaoE0G2gzZ0BA59baoUVSnvmxoF5GyBtIVL9nJxRsglViqxb+uEMskUjPvClXwkPEe8P1pNEs9UYB0TKpb2MtKelA4O0l5M6SVxKMjeLWqWBOJJW8LujbNBUk8bxWsVKuJYIKTlqAGL0Rtm7ZYshGarlGErFNrKPScyhAdecrXA9cYNfhlgk60gYMii66C6or93SuSGRD4KSKUKaVYuFK9LFjoCJOv9Viq362zBIM9Xx2OJqTJg/aYt+SltSx+Vqm9OlMu0pdNLg7YkXlpKOwi7X6x+R1lYc9Yv43PDSFn7j+1eTUoZSme2ipHaGviuowq7TzgYTTJuWucLI8Yebfbi2QBUne8rlBscpCXgGoAFZDE8SByVpj5x64XSQOV7aVf2YT8x3P+ISVTUJ+nLpLqatvTBXAElS1smrSVc+9Ksg6mwU2afNY9YZs26H6X+Ph13PxNe+wWbjK1ywrYAFl/rAy9FcSoHbB5kbBllDZpJKtPpoKGUUJGEBSShNh35EQiopui3T30+0Pr0tKDAmc4hDgQ4kw1hgJW/dX9BrrGpVGteGOEAus0glMcUSgvXddHFSSukzZGXWXTqh9e5pXLCWtiyVBDcFsiywD960UVmlnDNuIe16YCKg2o5RjfWe7MAEQBsYrfmFSM1Vd5DZYRN8W8twAVCnGlT/5T4MX34g++gNtXwxN+rSz0EFfG0V6pW8HRu9lKUVFyCUuXuqhH75Rq0nNFqQXDNpi2V9LcFsLQjqtOPX3Qhhca3jjHWpX1nhA7eC1ixYd36b3koFCigIx39lai5B8Phrvr2IGHcsHbNBYLgwHDYkC6FGDows1Yhvu5QD2nTgCv7vtTFsl2Lo7bG7ZT01yBbOpTDJsiZWeDhgxEtSIlDQth1GBQTqFeLugx1HsSm+1uVsOPQWQ4B7r7TKngpwjU9arFhcxWF5yrBm1LFQQeGLcvzx/KEfIV0wtq1wz0sDE70WDoReUujtV5U0bN5rI5NkCUT75EDEQjYw3HGNeNz0nWAT8jP2KDnYMZm4o1ipswLop9eysgUqsUVbsdUs9NV36OMa0Z7w5bN7Do6VkfvxRYPxrIJsuzJ2w9HcCLrn4N07bicUGazh87bkvpXx3JySAhhPCkCVaV3bNk3bHR2MJZM0fbRdp0vW+Mnxeu055QDqTa1cRDYNMAd17TsdmyyX5+UksEl2eMJW4aqGLPpwG/EjLo92k7vxZYPp+x2Ieufl1NOdr7i4lxRLEuMSwcYo6mFZxzZ7te0J3vtzKwvTMk5iAMxxpXDlR4YMRrOoLvDKX3J0v7xsrYXW3Rl8T7tOen4xUIjrIWwsYSd/N1G4xXVSYA9UyRUPKkeC1w+WMVo74qL1g3D0vGy0upqciUu9XJIwN6+0w4OTit9rI2rWLsb1yQZ6b7OSxKbPkVHlvMLZ2ZJq23i55LDpzcNVrE26fV0r62ft7UDogMq7tkR77apWdqrMuPwjMLhGQdydqI2TijW8dZyVKzYjyWoT2zBi1URFtYrOrcOrq+I98ePwxbmLwYNOdlsfdrDaHx5D7/S62X7iHdf4OKNVa4804t6Hr0A2bQpOvPRjIOTOYWzRd/VOFel3a9ma8yYNcNJrQSir0zJ/RHJXY5D25BFOhYz5cpcNO2Qe1MiQQ1OxVg4ouaO09AzuWLlDvb4XlsHRi/3AklJ4POzCjkpyD0rjgmlvUQV5uBsYXHC+6BHHKF01npsqo+RtFCcrdv5yoHQpOjOZMy9r9W22gJYGs3my3/FzH/UagcX77O3AkT016lE5I/babFtgJnZzRYqP7VdHa+dQV+Q9xLtSMXdtxJRW+kPbQMc7MfrPZR3MGPjBbnYyzxpIkwqRG5JJGiq3a47Alg68YPlK4++2oSudhdo5e+n6ajr3ionqHQylo4B9im59Ase6EFmbhCi3slwLj4TXgEiyivwOxKJ6OOdrkxXAEun4nVij+VQS+sRRp1O6rXwnOy1pOi9yZj7P93Mp2uApfNMvvIRAn/nIsjdQDH3rIDLoI+lE+6/dtuiFYBDlHz3RXbdHSTClknRB7qlXDMKawCbPbnK9F8XBa9OQRYrFb+nmz23vmerABvpulwt339RhWoPZFGFIk7k9k6l5cV6sw6w0ZOrqHzvojGkRZCJdjhwP9iJntush54ALJ2KwJUrVL4M4A9frbbrZovX7fdiWwbwN8m4+7l2LVSt9t0zgM0AxEHhVflbF/flBbvjtHLot9pxHLQK6jxdupOH2n1GuxpR+S6Yb2332dfk/USPOnA/2qrLr5s16DkFm8EJm84Xq5/wPP7LC5eaaVop+pNEzPlmwJ67wa6lZ5cN4BDQw9l8+StEdNeFsjcLmMz89VQi8qdEdKYlZCzdtOwAm3EHIblfZeabLc1lVTYjccsK/NlEIvrESgxwxQAOCWHv9jz+Aph/cSUWoGd9Ej2mFH3RlkWq03GuOMBm4JLwRh4+z+DbOp3ManhOsvxY4UvpeOSR1TGe1TCK0BiC/OS7APoQwKHqHKtsoPOGQzMA/7sCvp5MRp9aTSNdNRRcvyhSTqJQqN7pgT8O4F3MvArC3uZGKdVsAPxIgb4djzv3EtHsagLWjGXVAhxeLCnxlC9W38fsbQPTNgZPrMRiSgU5ED9EpB5KxJx7iKjFkxlXYrR+n68KgOuXJ6ituQ1E2wj8eoA2McuxWPYuqbcM8BEG7QTzw1E38pBtR4C90S7e0qsS4AbsPJYrYYuqVrcy8VZm3gqmcSakiTkFQpqZ0kRIy7PMyBBxBowME2WJkQHxCSLaR0z7PMfZl4xiPxFdXaKvAAAADElEQVQVlwOEXvbx/3Bccpan8cseAAAAAElFTkSuQmCC",it=Le(59301),dn=({className:Hn,dataSource:oi=[],col:ki=4,right:Ji,bottom:$i=23,precision:ir=0,wrapWidth:Mt=1200,trackEventItems:_t,loading:At,handleVery:xi=()=>!0})=>{const mi=Math.floor((Mt-(ki-1)*Ji)/ki);return it.createElement(_e.Z,{spinning:At},it.createElement("div",{className:Ct()(vn.list,Hn)},!!oi.length&&oi.map((fi,wn)=>{const{subject_identifier:Yn,id:Qi,identifier:vr,power:Dr}=fi,Ke=fi.is_public!=0&&fi.is_public;return it.createElement("div",{className:vn.wrap,key:Qi,style:{width:mi,marginRight:(1+wn)%ki===0?0:Ji+ir,marginBottom:$i}},it.createElement("a",{className:vn.li,onClick:Lt=>{Lt.preventDefault(),xi(fi==null?void 0:fi.first_category_url)&&(_t&&(0,Ye.L9)([_t]),(0,Ye.xg)(fi.first_category_url))}},it.createElement("div",{className:vn.top},it.createElement(Ze.Z,{title:fi.name},it.createElement("div",{className:vn.name},fi.name)),it.createElement("img",{className:vn.img,src:nt.Z.IMG_SERVER+"/images/"+fi.avatar_url}),it.createElement("div",{className:vn.text,title:fi.creator},fi.creator),Yn&&it.createElement("div",{className:vn.btns},it.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),it.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),Ke&&it.createElement("div",{className:vn.sign},"\u516C\u5F00")),it.createElement("div",{className:vn.bottom},fi.visits>0&&it.createElement(Ze.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},it.createElement("span",null,it.createElement("i",{className:"iconfont icon-liulanyan"}),it.createElement("span",null,fi.visits))),fi.course_members_count>0&&it.createElement(Ze.Z,{title:"\u6210\u5458",placement:"bottom"},it.createElement("span",null,it.createElement("i",{className:"iconfont icon-chengyuan"}),fi.course_members_count)),fi.tasks_count>0&&it.createElement(Ze.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},it.createElement("span",null,it.createElement("i",{className:"iconfont icon-zuoye"}),fi.tasks_count)),fi.is_end?it.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):it.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!fi.is_accessible&&it.createElement("div",{className:vn.lockWrap},it.createElement("img",{src:`${nt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),it.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!oi.length&&it.createElement(Pt.Z,null)))},ni={flex_box_center:"flex_box_center___d27mZ",flex_space_between:"flex_space_between___qfRU9",flex_box_vertical_center:"flex_box_vertical_center___fCRld",flex_box_center_end:"flex_box_center_end___ORMV8",flex_box_column:"flex_box_column___PNKtZ",tabs:"tabs___alpa7",tabsWrap:"tabsWrap___aCQjw",tab:"tab___MKLr4",active:"active___nl_4v"},Kn=Le(25690),En=({dataSource:Hn=[],value:oi,onChange:ki,className:Ji,style:$i={},tabBarExtraContent:ir})=>le.createElement("div",{className:Ct()(ni.tabs,Ji),style:$i},le.createElement("div",{className:ni.tabsWrap},Hn.map((Mt,_t)=>!(Mt!=null&&Mt.hide)&&le.createElement("aside",{className:ni.tab,onClick:()=>{ki(Mt.id),Mt.link&&Kn.history.push(Mt.link)},key:_t},le.createElement("div",{className:oi===Mt.id?ni.active:""},Mt.name),(Mt==null?void 0:Mt.resetCount)==null&&(Mt==null?void 0:Mt.total)!==void 0&&le.createElement("span",null,"\uFF08",Mt==null?void 0:Mt.total,"\uFF09"),(Mt==null?void 0:Mt.resetCount)!==void 0&&(Mt==null?void 0:Mt.total)!==void 0&&le.createElement(Ze.Z,{title:(Mt==null?void 0:Mt.tip)!=null?Mt==null?void 0:Mt.tip:""},le.createElement("span",{style:{color:"#9096A3"}},"\uFF08",le.createElement("span",{style:{color:"#000"}},Mt==null?void 0:Mt.resetCount),"/",le.createElement("span",null,Mt==null?void 0:Mt.total),"\uFF09"))))),le.createElement("div",{className:ni.tabBar},ir)),ui=({className:Hn,style:oi={},children:ki})=>le.createElement("div",{className:Ct()(Hn),style:oi},ki),It={flex_box_center:"flex_box_center___e6HxQ",flex_space_between:"flex_space_between___RnXYe",flex_box_vertical_center:"flex_box_vertical_center___lVxPk",flex_box_center_end:"flex_box_center_end___bu8yv",flex_box_column:"flex_box_column___JczGj",orderWrap:"orderWrap___ZfyGX",orderIconWrap:"orderIconWrap___XTB_O",orderAsc:"orderAsc___KWHmA",orderDesc:"orderDesc___rHdbB",active:"active___a7eSP",cursorPointer:"cursorPointer___gs9kL",orderTextWrap:"orderTextWrap___teAKn"},On=Le(75727),ht=Le(93041);const kn=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var ze=({sortValue:Hn,dropValue:oi,className:ki,onSort:Ji,onDrop:$i,dataSource:ir=kn})=>{var Mt;return le.createElement("div",{className:Ct()(It.orderWrap,ki)},le.createElement(On.Z,{dropdownRender:()=>le.createElement(ht.default,null,ir.map((_t,At)=>le.createElement(ht.default.Item,{key:At,onClick:()=>$i(_t.id)},_t.name)))},le.createElement("span",{className:It.orderTextWrap},(Mt=ir.find(_t=>oi===_t.id))==null?void 0:Mt.name)),le.createElement("span",{className:It.orderIconWrap},le.createElement("span",{className:It.orderAsc},le.createElement("i",{className:Hn==="asc"?`iconfont icon-sanjiaoxing-up font12 ${It.cursorPointer} ${It.active}`:`iconfont icon-sanjiaoxing-up font12 ${It.cursorPointer}`,onClick:()=>Ji(Hn==="asc"?"desc":"asc")})),le.createElement("span",{className:It.orderDesc},le.createElement("i",{className:Hn==="desc"?`iconfont icon-sanjiaoxing-down font12 ${It.cursorPointer} ${It.active}`:`iconfont icon-sanjiaoxing-down font12 ${It.cursorPointer}`,onClick:()=>Ji(Hn==="asc"?"desc":"asc")}))))},Me={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},Ee=Le(99571),Te=Object.defineProperty,He=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,on=(Hn,oi,ki)=>oi in Hn?Te(Hn,oi,{enumerable:!0,configurable:!0,writable:!0,value:ki}):Hn[oi]=ki,Kt=(Hn,oi)=>{for(var ki in oi||(oi={}))Ae.call(oi,ki)&&on(Hn,ki,oi[ki]);if(He)for(var ki of He(oi))et.call(oi,ki)&&on(Hn,ki,oi[ki]);return Hn},pn=(Hn,oi)=>{var ki={};for(var Ji in Hn)Ae.call(Hn,Ji)&&oi.indexOf(Ji)<0&&(ki[Ji]=Hn[Ji]);if(Hn!=null&&He)for(var Ji of He(Hn))oi.indexOf(Ji)<0&&et.call(Hn,Ji)&&(ki[Ji]=Hn[Ji]);return ki},Nt=(Hn,oi,ki)=>new Promise((Ji,$i)=>{var ir=At=>{try{_t(ki.next(At))}catch(xi){$i(xi)}},Mt=At=>{try{_t(ki.throw(At))}catch(xi){$i(xi)}},_t=At=>At.done?Ji(At.value):Promise.resolve(At.value).then(ir,Mt);_t((ki=ki.apply(Hn,oi)).next())}),Ot=Hn=>{var oi=Hn,{className:ki,style:Ji,children:$i,loading:ir=!1,openLoading:Mt,onClick:_t=()=>{},size:At="middle",shape:xi="round"}=oi,mi=pn(oi,["className","style","children","loading","openLoading","onClick","size","shape"]);const[fi,wn]=(0,le.useState)(!1);return le.createElement(Ee.ZP,Kt({onClick:(0,ot.throttle)(Yn=>Nt(void 0,null,function*(){Mt&&wn(!0);try{yield _t(Yn)}catch(Qi){console.log("error",Qi)}Mt&&wn(!1)}),2e3,{leading:!0,trailing:!1}),className:Ct()(Me.btn,Me[`${At}-${xi}`],ki),style:Ji,size:At,shape:xi,loading:fi||ir},mi),$i)},un={flex_box_center:"flex_box_center___TB7bQ",flex_space_between:"flex_space_between___oBlTb",flex_box_vertical_center:"flex_box_vertical_center___b5XbB",flex_box_center_end:"flex_box_center_end___CNhe7",flex_box_column:"flex_box_column___yHXKW",head:"head___ghH72",node:"node___mjPEy"},An=({className:Hn,style:oi,children:ki=null,onClick:Ji,title:$i})=>le.createElement("div",{className:Ct()(un.head,Hn),style:oi},le.createElement("span",{className:"primary-hover",onClick:Ji},le.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),le.createElement("b",{title:$i},$i),le.createElement("div",{className:un.node},ki)),Dn={flex_box_center:"flex_box_center___AlHuF",flex_space_between:"flex_space_between___vN2LW",flex_box_vertical_center:"flex_box_vertical_center___Ac7D2",flex_box_center_end:"flex_box_center_end___y38I7",flex_box_column:"flex_box_column___iQE6P",btns:"btns___sNgTb",confirm:"confirm___Ozirl",cancel:"cancel___aiq1I"},en=({confirmShow:Hn=!0,confirmTitle:oi,confirmClick:ki,cancelShow:Ji=!0,cancelTitle:$i,cancelClick:ir,className:Mt,style:_t,confirmLoading:At=!1})=>le.createElement("div",{className:Ct()(Dn.btns,Mt),style:_t},Hn&&le.createElement(Ee.ZP,{loading:At,onClick:ki,type:"primary",className:Dn.confirm},oi),Ji&&le.createElement(Ee.ZP,{onClick:ir,className:Dn.cancel},$i)),Qt={flex_box_center:"flex_box_center___jkpdr",flex_space_between:"flex_space_between___OtsL8",flex_box_vertical_center:"flex_box_vertical_center___rbcb_",flex_box_center_end:"flex_box_center_end___zBR21",flex_box_column:"flex_box_column___nS_eP",fixedBottom:"fixedBottom___oJl7m",wrap:"wrap___A3Oq1",center:"center____VL1y"},di=({className:Hn,style:oi={},LeftContent:ki,children:Ji,RightContent:$i})=>le.createElement("div",{className:Ct()(Qt.fixedBottom,Hn),style:oi},le.createElement("div",{className:Qt.wrap},le.createElement("div",{className:Qt.left},ki),le.createElement("div",{className:Qt.center},Ji),le.createElement("div",{className:Qt.right},$i))),cn={flex_box_center:"flex_box_center___tY8Yn",flex_space_between:"flex_space_between___vHdYA",flex_box_vertical_center:"flex_box_vertical_center___pa61F",flex_box_center_end:"flex_box_center_end___HyDXt",flex_box_column:"flex_box_column___UjZek",crumbs:"crumbs___V41Oe",hover:"hover___bEIVd"},ii=({className:Hn,style:oi={},dataSource:ki=[]})=>le.createElement("div",{className:Ct()(cn.crumbs,Hn),style:oi},ki.map((Ji,$i)=>$i<ki.length-1?le.createElement(le.Fragment,{key:$i},Ji.path||Ji.onClick?le.createElement("span",{className:cn.hover,onClick:Ji!=null&&Ji.onClick?Ji.onClick:()=>Kn.history.push(Ji.path)},Ji.name):le.createElement("span",null,Ji.name),le.createElement("span",null,"\xA0",">","\xA0")):le.createElement("span",{key:$i,style:{color:"#5F6368"}},Ji.name))),Vi=Le(11938),bi=Object.defineProperty,Di=Object.defineProperties,Mr=Object.getOwnPropertyDescriptors,Gn=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable,Ni=(Hn,oi,ki)=>oi in Hn?bi(Hn,oi,{enumerable:!0,configurable:!0,writable:!0,value:ki}):Hn[oi]=ki,ji=(Hn,oi)=>{for(var ki in oi||(oi={}))Rn.call(oi,ki)&&Ni(Hn,ki,oi[ki]);if(Gn)for(var ki of Gn(oi))Jn.call(oi,ki)&&Ni(Hn,ki,oi[ki]);return Hn},Gi=(Hn,oi)=>Di(Hn,Mr(oi)),Fr=(Hn,oi)=>{var ki={};for(var Ji in Hn)Rn.call(Hn,Ji)&&oi.indexOf(Ji)<0&&(ki[Ji]=Hn[Ji]);if(Hn!=null&&Gn)for(var Ji of Gn(Hn))oi.indexOf(Ji)<0&&Jn.call(Hn,Ji)&&(ki[Ji]=Hn[Ji]);return ki};const{Countdown:be}=Vi.default;var li=Hn=>{var oi=Hn,{onChange:ki}=oi,Ji=Fr(oi,["onChange"]);const[$i,ir]=(0,le.useState)(null);(0,le.useEffect)(()=>{typeof $i=="number"&&$i>=0&&ki($i)},[$i]);const Mt=_t=>{const At=Math.floor(_t/1e3);ir(At)};return le.createElement(be,Gi(ji({},Ji),{onChange:Mt}))}},37808:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ue}});var le=Le(59301);function Ue(pt,St){const yt=(0,le.useRef)();(0,le.useEffect)(()=>{yt.current=pt}),(0,le.useEffect)(()=>{function Oe(){yt.current()}if(St!==null){let at=setInterval(Oe,St);return()=>clearInterval(at)}},[St])}},37345:function(Zn,ei,Le){"use strict";Le.d(ei,{h:function(){return le}});var le=(Ue=>(Ue[Ue.NOMATCH=-1]="NOMATCH",Ue[Ue.OK=0]="OK",Ue[Ue.TIMEOUT=2]="TIMEOUT",Ue[Ue.PODFAILURE=3]="PODFAILURE",Ue[Ue.COMPILEFAILURE=4]="COMPILEFAILURE",Ue[Ue.EXECUTEFAILURE=5]="EXECUTEFAILURE",Ue[Ue.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",Ue))(le||{})},81072:function(Zn,ei,Le){"use strict";Le.d(ei,{H7:function(){return ne},MK:function(){return De},MU:function(){return We},X6:function(){return dt},bM:function(){return ot},fi:function(){return te},fu:function(){return Ct},n4:function(){return de},rX:function(){return kt},vl:function(){return se},zO:function(){return Tt}});var le=Le(38986),Ue=Object.defineProperty,pt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,Oe=(pe,ye,we)=>ye in pe?Ue(pe,ye,{enumerable:!0,configurable:!0,writable:!0,value:we}):pe[ye]=we,at=(pe,ye)=>{for(var we in ye||(ye={}))St.call(ye,we)&&Oe(pe,we,ye[we]);if(pt)for(var we of pt(ye))yt.call(ye,we)&&Oe(pe,we,ye[we]);return pe};function Ct(pe,ye){return(0,le.U2)(`myproblems/${pe}.json`,at({hidePopLogin:!0},ye||{}))}function ot(pe,ye){return(0,le.v_)(`myproblems/${pe}/code_submit.json`,ye)}function We(pe,ye){return(0,le.v_)(`myproblems/${pe}/code_debug.json`,ye)}function Tt(pe,ye){return ye.language&&(ye.language=encodeURIComponent(ye.language)),(0,le.U2)(`myproblems/${pe}/submit_records.json`,ye)}function dt(pe){return(0,le.U2)("myproblems/record_detail.json",{id:pe})}function kt(pe,ye){return(0,le.U2)(`myproblems/${pe}/result.json`,{mode:ye})}function De(pe,ye){return(0,le.v_)(`myproblems/${pe}/add_notes.json`,ye)}function ne(pe,ye){return(0,le.v_)(`myproblems/${pe}/restore_initial_code.json`,ye)}function te(pe){return(0,le.v_)(`myproblems/${pe}/sync_code.json`)}function de(pe,ye){return(0,le.v_)(`myproblems/${pe}/update_code.json`,ye)}function se(pe,ye){return(0,le.v_)(`discusses/${pe}/plus.json`,ye)}},43554:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Wa}});var le=Le(59301),Ue={flex_box_center:"flex_box_center___bZaL5",flex_space_between:"flex_space_between___oaJSq",flex_box_vertical_center:"flex_box_vertical_center____hsuP",flex_box_center_end:"flex_box_center_end___ZYbPQ",flex_box_column:"flex_box_column___nE_62",wrap:"wrap___ulhwR",left:"left___kyWln",title:"title___jsO1D",total:"total___GEhiU",list:"list___u9dBZ",name:"name___Wxggs",b:"b___Y15YO",r:"r___mKQoe",l:"l___uelFD",tag:"tag___Mpkbg",right:"right___mQ3dU",examName:"examName___Na1r8",t:"t___IgCWK",num:"num___CXI8j",topWarp:"topWarp___Kicpu",head:"head___jx3W8",so:"so___qYW7F",btn:"btn___EMJDz",content:"content___sHGsV",titleWrap:"titleWrap___I__GR",single:"single___K5iv9",analysis:"analysis___NoAuR",text:"text___xESW2",modalColumn:"modalColumn___I_tK_",modalRow:"modalRow___lyw_U",sup:"sup___HSz3Z",popover:"popover___kE8aI",btn_warp:"btn_warp___fOE2S"},pt=Le(28284),St=Le(25399),yt=Le(99571),Oe=Le(62957),at=Le(71051),Ct=Le(6767),ot=Le(37568),We=Le(37285),Tt=Le(62673),dt=Le(37639),kt=Le(77019),De=Le(5269),ne=Le(13747),te=Object.defineProperty,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,ye=(gt,Ht,Re)=>Ht in gt?te(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,we=(gt,Ht)=>{for(var Re in Ht||(Ht={}))se.call(Ht,Re)&&ye(gt,Re,Ht[Re]);if(de)for(var Re of de(Ht))pe.call(Ht,Re)&&ye(gt,Re,Ht[Re]);return gt};const Ce=gt=>React.createElement("svg",we({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},gt),React.createElement("title",null,"\u7F16\u7EC4 6"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E4E6FD",width:34,height:34,rx:10}),React.createElement("g",{fillRule:"nonzero"},React.createElement("path",{d:"M13.808 11.448a.558.558 0 0 1 0 .788l-1.564 1.565a.558.558 0 1 1-.789-.79l1.564-1.563a.558.558 0 0 1 .79 0Zm9.882 2.462a.558.558 0 0 1-.789 0l-1.564-1.563a.558.558 0 1 1 .789-.789l1.564 1.564a.556.556 0 0 1 0 .788Z",fill:"#6678EB"}),React.createElement("path",{d:"M21.753 21.707a5.937 5.937 0 1 0-8.58.015l-.937.936a.558.558 0 1 0 .789.788l.995-.994a5.91 5.91 0 0 0 3.436 1.095c1.287 0 2.48-.41 3.452-1.106l.992.992a.558.558 0 1 0 .789-.789l-.936-.937Z",fill:"#6678EB"}),React.createElement("path",{d:"m20.858 18.95-3.024-1.745v-2.054a.558.558 0 1 0-1.117 0v2.351c0 .064.011.126.031.184a.551.551 0 0 0 .258.33l3.293 1.9a.557.557 0 0 0 .559-.966Z",fill:"#FFF"}))));var _e="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==",Ze=Le(76902),st=Le(25690),nt=Le(51257),Ye=Le(38986),ct=Object.defineProperty,$e=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,Bt=(gt,Ht,Re)=>Ht in gt?ct(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,fn=(gt,Ht)=>{for(var Re in Ht||(Ht={}))Et.call(Ht,Re)&&Bt(gt,Re,Ht[Re]);if($e)for(var Re of $e(Ht))Pt.call(Ht,Re)&&Bt(gt,Re,Ht[Re]);return gt};const qt=gt=>React.createElement("svg",fn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},gt),React.createElement("title",null,"\u7F16\u7EC4 12"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{width:34,height:34,rx:10,fill:"#EAF3F4"}),React.createElement("path",{d:"M25.905 15.37a.775.775 0 0 0-.626-.529l-4.814-.7-2.152-4.362a.776.776 0 0 0-1.392 0l-2.153 4.363-4.814.699a.775.775 0 0 0-.43 1.323l3.484 3.396-.823 4.794a.777.777 0 0 0 1.126.818l4.306-2.264 4.305 2.264a.778.778 0 0 0 .817-.059.777.777 0 0 0 .31-.759l-.823-4.794 3.483-3.396a.777.777 0 0 0 .196-.795Z",fill:"#21C0A6",fillRule:"nonzero"})));var vn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=",tn=Object.defineProperty,it=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,ni=(gt,Ht,Re)=>Ht in gt?tn(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,Kn=(gt,Ht)=>{for(var Re in Ht||(Ht={}))rt.call(Ht,Re)&&ni(gt,Re,Ht[Re]);if(it)for(var Re of it(Ht))dn.call(Ht,Re)&&ni(gt,Re,Ht[Re]);return gt};const Rt=gt=>React.createElement("svg",Kn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},gt),React.createElement("title",null,"\u9898\u76EE"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E7F3FF",width:34,height:34,rx:10}),React.createElement("g",{fill:"#4C6FFF",fillRule:"nonzero"},React.createElement("path",{d:"m23.719 13.325-4.098-3.94c-.097-.13-.225-.162-.355-.162-.129 0-.258.064-.387.161l-7.55 7.753c-.065.065-.098.162-.13.227l-1.032 5.427c-.033.194.032.323.16.484.13.13.227.162.389.162h.096l4.776-1.099c.097-.032.194-.064.258-.161l7.841-8.108c.194-.162.194-.517.033-.744h-.001Zm-8.1 8.044a.534.534 0 0 1-.386.162.56.56 0 0 1-.388-.162l-3-2.81c-.226-.194-.226-.517-.033-.743.194-.227.517-.227.743-.033l3 2.811c.259.226.291.55.065.776ZM17 22.92h6.844v1.055H17z"}))));var En="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==",Bn=Le(12327),ui=Le(39793),It=Le(61011),On=Le(30371),ht={wrap:"wrap___OIoOI",modal:"modal___Z3hfU",titleWrap:"titleWrap___aK3oG",required:"required___NHoO7",title:"title___uxb1R",colorGray:"colorGray___O8YPg",choiceWrap:"choiceWrap___t51sb",answer:"answer___vsBnh",activeAnswer:"activeAnswer___AJN4p",deleteIcon:"deleteIcon___WvOJZ",addIcon:"addIcon___UyeIs",editorWrap:"editorWrap___uqcFU",htmlWrap:"htmlWrap___GcBNL",radio:"radio___e8qQ5",color333:"color333___PLzVK",color999:"color999___v3EY0",fold:"fold___OfvPe",head:"head___EejYX",collapseWrapper:"collapseWrapper___sQyVD",panelHeader:"panelHeader___Ivicf",open:"open___aEOQE",close:"close___z4P5H",inputBorder:"inputBorder___ix67O",keywordTag:"keywordTag___iGx08",scoreByBlankRadio:"scoreByBlankRadio___Kwu7q"},kn=Le(59301),Oi=Object.defineProperty,ze=Object.defineProperties,Me=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Ae=(gt,Ht,Re)=>Ht in gt?Oi(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,et=(gt,Ht)=>{for(var Re in Ht||(Ht={}))Te.call(Ht,Re)&&Ae(gt,Re,Ht[Re]);if(Ee)for(var Re of Ee(Ht))He.call(Ht,Re)&&Ae(gt,Re,Ht[Re]);return gt},on=(gt,Ht)=>ze(gt,Me(Ht)),Kt=(gt,Ht)=>{var Re={};for(var lt in gt)Te.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&Ee)for(var lt of Ee(gt))Ht.indexOf(lt)<0&&He.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const pn=null,Nt=(gt,Ht)=>{var Re=gt,{globalSetting:lt,loading:fr,dispatch:sr,isEdit:pr,editData:Ui}=Re,Un=Kt(Re,["globalSetting","loading","dispatch","isEdit","editData"]);const[Lr,kr]=(0,le.useState)(""),[Zr,Er]=(0,le.useState)(""),[Eo,Wi]=(0,le.useState)([]),[Si,Pi]=(0,le.useState)(""),[Jr,Ur]=(0,le.useState)(),[Nr,Lo]=(0,le.useState)(!1),[yr,Qr]=(0,le.useState)({}),[tr,Ir]=(0,le.useState)([]);(0,le.useEffect)(()=>{!Ui||!pr||(kr(Ui==null?void 0:Ui.name),Er(Ui==null?void 0:Ui.analysis),Ur(Ui==null?void 0:Ui.is_ordered),Qr(Ui),Lo(!0))},[Ui]),(0,le.useEffect)(()=>{if(!Nr)return;const ka=Ui==null?void 0:Ui.standard_answer.map(ts=>ts==null?void 0:ts.answer_text);Wi(ka);const wo=Ui==null?void 0:Ui.standard_answer.map(ts=>ts==null?void 0:ts.score);Ir(wo),Lo(!1)},[Nr]),(0,le.useImperativeHandle)(Ht,()=>({onSave:uo,Clear:Zo}));const uo=()=>{let ka=[],wo=!1;return Lr?(Eo.forEach((ts,Ha)=>{ka.push({position:Ha+1,answer_text:[],score:tr[Ha]}),ts==null||ts.forEach((rs,Ol)=>{ka[Ha].answer_text.push(rs),(!rs||!(0,nt.eR)(rs,1e4))&&(Pi(`${Ha}-${Ol}`),Ct.ZP.info(rs?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),wo=!0)})}),wo?!1:(ka==null?void 0:ka.length)>20?(Ct.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:Lr,analysis:Zr,standard_answers:ka,is_ordered:Jr,downcase:yr==null?void 0:yr.downcase,no_space:yr==null?void 0:yr.no_space,use_blank_score:yr==null?void 0:yr.use_blank_score}):(Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Zo=()=>{kr(""),Er(""),Wi([]),Ur(!1)},ha=(ka,wo,ts)=>{const Ha=Eo.slice();if(wo&&Ha.splice(ka,wo),ts)for(let rs=0;rs<ts;rs++)Ha.splice(ka+rs,0,[""]);Wi(Ha)},La=(ka,wo,ts)=>{Pi("");let Ha=Eo.slice();Ha[ka][wo]=ts,Wi(Ha)},zr=ka=>{let wo=Eo.slice();wo[ka]=[...wo[ka],""],Wi(wo)},bs=(ka,wo)=>{let ts=Eo.slice();if(!ts[ka][wo]){ts[ka]=ts[ka].filter((Ha,rs)=>rs!==wo),Wi(ts);return}Oe.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:ht.modal,onOk:()=>{ts[ka]=ts[ka].filter((Ha,rs)=>rs!==wo),Wi(ts)}})},eo=ka=>{Oe.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:ht.modal,onOk:()=>{let wo=Eo.slice();wo=Eo.filter((ts,Ha)=>ka!==Ha),Wi(wo)}})};return kn.createElement("section",{className:ht.wrap},kn.createElement("p",{className:ht.titleWrap},kn.createElement("span",{className:ht.required},"*"),kn.createElement("span",{className:ht.title},"\u9898\u5E72\uFF1A")),kn.createElement("div",null,kn.createElement(It.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Lr,onChange:ka=>kr(ka),showNullButton:!0,onPlaceholderChange:ha})),kn.createElement("div",{className:"mt20"},Eo.map((ka,wo)=>kn.createElement("div",{style:{display:"flex"}},kn.createElement("div",{style:{flex:1}},kn.createElement(On.Z,{key:wo,answers:ka,index:wo,flex:1,is_md:!0,activeOptionErrorIndex:Si,onAnswerChange:La,addChildAnswer:zr,deleteChildAnswer:bs,deleteChildAnswermain:eo})),yr.use_blank_score&&kn.createElement("div",{style:{display:"flex",alignItems:"center",width:"165px"}},kn.createElement("span",{style:{color:"red",margin:"auto 5px auto 10px"}},"*"),"\u5206\u503C\uFF1A",kn.createElement(at.Z,{style:{width:"100px"},size:"large",defaultValue:tr[wo],onBlur:ts=>{tr[wo]=ts.target.value,Ir([...tr])}}))))),kn.createElement("div",null,kn.createElement(Tt.default,{className:`${ht.color333} font14 mt20`,checked:yr.use_blank_score,onChange:ka=>Qr(on(et({},yr),{use_blank_score:ka.target.checked}))},"\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206"),kn.createElement("span",{style:{color:"#999999",fontSize:"12px"}},"\uFF08\u9009\u4E2D\uFF0C\u5219\u9700\u8981\u8BBE\u7F6E\u6BCF\u7A7A\u5206\u503C\uFF0C\u5B66\u751F\u7B54\u6848\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206\uFF09")),kn.createElement("div",null,kn.createElement(Tt.default,{className:`${ht.color333} font14 mt20`,checked:yr.downcase,onChange:ka=>Qr(on(et({},yr),{downcase:ka.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),kn.createElement("div",null,kn.createElement(Tt.default,{className:`${ht.color333} font14 mt20`,checked:yr.no_space,onChange:ka=>Qr(on(et({},yr),{no_space:ka.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),kn.createElement("div",{className:"mt20"},(Eo==null?void 0:Eo.length)>1&&kn.createElement("span",null,kn.createElement(Tt.default,{checked:Jr,onChange:ka=>Ur(ka.target.checked),className:`${ht.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),kn.createElement("span",{className:`${ht.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"))),kn.createElement("p",{className:ht.titleWrap},kn.createElement("span",{className:ht.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),kn.createElement(ui.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Zr,onChange:ka=>Er(ka)}))};var Dt=(0,st.connect)(({loading:gt,globalSetting:Ht})=>({globalSetting:Ht,loading:gt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Nt)),Ot=Le(47889),un=Object.getOwnPropertySymbols,Sn=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,Dn=(gt,Ht)=>{var Re={};for(var lt in gt)Sn.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&un)for(var lt of un(gt))Ht.indexOf(lt)<0&&An.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const Ai=null,en=(gt,Ht)=>{var Re=gt,{globalSetting:lt,loading:fr,editData:sr,dispatch:pr,onRef:Ui=()=>{},isEdit:Un}=Re,Lr=Dn(Re,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[kr,Zr]=(0,le.useState)(),[Er,Eo]=(0,le.useState)(""),[Wi,Si]=(0,le.useState)("");(0,le.useEffect)(()=>{if(!sr||!Un)return;Eo(sr==null?void 0:sr.name),Si(sr==null?void 0:sr.analysis);const Ur=sr==null?void 0:sr.choices.find(Nr=>Nr.is_answer);Zr(Ur.choice_text==="\u6B63\u786E"?"0":"1")},[sr]),(0,le.useImperativeHandle)(Ht,()=>({onSave:Pi,Clear:Jr}));const Pi=()=>Er?kr?{name:Er,choices:[{choice_text:"\u6B63\u786E",is_answer:kr==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:kr==="1"?1:0}],analysis:Wi}:(Ct.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1):(Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1),Jr=()=>{Eo(""),Si(""),Zr("")};return le.createElement("section",{className:ht.wrap},le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u9898\u5E72\uFF1A")),le.createElement(ui.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Er,onChange:Ur=>Eo(Ur)}),le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u7B54\u6848\u9009\u9879\uFF1A",le.createElement("span",{className:ht.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),le.createElement(Ot.ZP.Group,{buttonStyle:"solid",value:kr,onChange:Ur=>Zr(Ur.target.value)},le.createElement(Ot.ZP.Button,{value:"0",className:`${ht.radio} mr40`},"\u6B63\u786E"),le.createElement(Ot.ZP.Button,{value:"1",className:ht.radio},"\u9519\u8BEF")),le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),le.createElement(ui.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Wi,onChange:Ur=>Si(Ur)}))};var Qt=(0,st.connect)(({loading:gt,globalSetting:Ht})=>({globalSetting:Ht,loading:gt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(en)),ln=Object.getOwnPropertySymbols,di=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable,Yt=(gt,Ht)=>{var Re={};for(var lt in gt)di.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&ln)for(var lt of ln(gt))Ht.indexOf(lt)<0&&cn.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const ii=null,Vi=(gt,Ht)=>{var Re=gt,{globalSetting:lt,loading:fr,editData:sr,dispatch:pr,onRef:Ui=()=>{},isEdit:Un}=Re,Lr=Yt(Re,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[kr,Zr]=(0,le.useState)([]);(0,le.useEffect)(()=>{var Si;if(!sr||!Un)return;const Pi=(Si=sr==null?void 0:sr.shixun)==null?void 0:Si.challenges.map(Jr=>({id:Jr==null?void 0:Jr.id,score:Jr.score}));Zr(Pi)},[sr]),(0,le.useImperativeHandle)(Ht,()=>({onSave:Er,Clear:Eo}));const Er=()=>({challenges:[...kr]}),Eo=()=>{Zr([])};console.log("editData--",sr);const Wi=Si=>{var Pi,Jr;return le.createElement("div",null,(Jr=(Pi=Si==null?void 0:Si.shixun)==null?void 0:Pi.challenges)==null?void 0:Jr.map((Ur,Nr)=>{var Lo;return le.createElement("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"}},le.createElement("div",null,le.createElement("span",{className:"mr5"},"\u7B2C",Nr+1,"\u5173"),le.createElement(St.Z,{key:Nr,title:Ur==null?void 0:Ur.challenge_name},le.createElement("span",null,(0,nt.Pq)(Ur==null?void 0:Ur.challenge_name,44)))),le.createElement("p",{style:{marginBottom:0}},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u5206\u503C\uFF1A"),le.createElement(at.Z,{precision:1,min:1,max:100,className:ht.baseFormItem,style:{width:176},value:(Lo=kr.find(yr=>yr.id===Ur.id))==null?void 0:Lo.score,onChange:yr=>{kr.find(Qr=>Qr.id===Ur.id).score=yr,Zr([...kr])}})))}),le.createElement("div",{style:{clear:"both"}}))};return le.createElement("section",{className:ht.wrap},le.createElement(Ze.Z,{style:{paddingRight:10},className:ht.titleHtml,value:`${sr==null?void 0:sr.position}\u3001${sr==null?void 0:sr.name}`}),le.createElement("p",{style:{marginBottom:"10px",marginTop:"25px"}},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u5173\u5361")),Wi(sr))};var bi=(0,st.connect)(({loading:gt,globalSetting:Ht})=>({globalSetting:Ht,loading:gt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Vi)),Di=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,Gn=Object.prototype.propertyIsEnumerable,Rn=(gt,Ht)=>{var Re={};for(var lt in gt)Mr.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&Di)for(var lt of Di(gt))Ht.indexOf(lt)<0&&Gn.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const Jn=["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"],Ni=(gt,Ht)=>{var Re=gt,{editData:lt,globalSetting:fr,loading:sr,dispatch:pr,onRef:Ui=()=>{},isEdit:Un}=Re,Lr=Rn(Re,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[kr,Zr]=(0,le.useState)([]),[Er,Eo]=(0,le.useState)(),[Wi,Si]=(0,le.useState)([]),[Pi,Jr]=(0,le.useState)(""),[Ur,Nr]=(0,le.useState)("");(0,le.useEffect)(()=>{Zr(["","","",""])},[]),(0,le.useEffect)(()=>{if(!lt||!Un)return;Jr(lt==null?void 0:lt.name),Nr(lt==null?void 0:lt.analysis),Zr(lt==null?void 0:lt.choices.map(tr=>tr.choice_text));const Qr=[];lt==null||lt.choices.map((tr,Ir)=>{tr.is_answer&&Qr.push(Ir)}),Si(Qr)},[lt]),(0,le.useImperativeHandle)(Ht,()=>({onSave:Lo,Clear:yr}));const Lo=()=>{if(!Pi)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Qr=kr.findIndex(Ir=>!Ir);if(Qr>-1)return Ct.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Jn[Qr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Wi.length)return Ct.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(Wi.length<2)return Ct.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;const tr=kr.map((Ir,uo)=>({choice_text:Ir,is_answer:Wi.includes(uo)?1:0}));return{name:Pi,choices:tr,analysis:Ur}},yr=()=>{Zr(["","","",""]),Jr(""),Nr(""),Si("")};return le.createElement("section",{className:ht.wrap},le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u9898\u5E72\uFF1A")),le.createElement(ui.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Pi,onChange:Qr=>Jr(Qr)}),le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u7B54\u6848\u9009\u9879\uFF1A",le.createElement("span",{className:ht.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),kr.map((Qr,tr)=>le.createElement("div",{className:ht.choiceWrap,key:tr},le.createElement(St.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},le.createElement("div",{className:`${ht.answer} ${Wi.includes(tr)?ht.activeAnswer:""}`,onClick:()=>{Wi.includes(tr)?Si(Wi.filter(Ir=>Ir!==tr)):Si([...Wi,tr])}},Jn[tr])),le.createElement("div",{className:ht.editorWrap},Er===tr?le.createElement(ui.Z,{id:`single-question-option-${tr}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Qr,onChange:Ir=>{kr[tr]=Ir,Zr(kr)}}):le.createElement("div",{className:ht.htmlWrap,onClick:()=>Eo(tr)},le.createElement(Ze.Z,{value:Qr}))),tr>1&&le.createElement(St.Z,{title:"\u5220\u9664"},le.createElement("i",{className:`${ht.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Zr(kr.filter((Ir,uo)=>uo!==tr)),Wi.includes(tr)?Si(Wi.filter(Ir=>Ir!==tr)):Si([...Wi,tr])}})),tr<7&&tr===kr.length-1&&le.createElement(St.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},le.createElement("i",{className:`${ht.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Zr([...kr,""])})))),le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),le.createElement(ui.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ur,onChange:Qr=>Nr(Qr)}))};var ji=(0,st.connect)(({loading:gt,globalSetting:Ht})=>({globalSetting:Ht,loading:gt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Ni)),Gi=Object.getOwnPropertySymbols,Fr=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,gn=(gt,Ht)=>{var Re={};for(var lt in gt)Fr.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&Gi)for(var lt of Gi(gt))Ht.indexOf(lt)<0&&be.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const li=["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"],Hn=(gt,Ht)=>{var Re=gt,{editData:lt,globalSetting:fr,loading:sr,dispatch:pr,onRef:Ui=()=>{},isEdit:Un}=Re,Lr=gn(Re,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[kr,Zr]=(0,le.useState)([]),[Er,Eo]=(0,le.useState)(),[Wi,Si]=(0,le.useState)(),[Pi,Jr]=(0,le.useState)(""),[Ur,Nr]=(0,le.useState)("");(0,le.useEffect)(()=>{Zr(["","","",""])},[]),(0,le.useEffect)(()=>{if(!lt||!Un)return;const Qr=[],tr=[];lt==null||lt.choices.forEach((Ir,uo)=>{Qr.push(Ir.choice_text),Ir.is_answer&&tr.push(uo)}),Jr(lt==null?void 0:lt.name),Nr(lt==null?void 0:lt.analysis),Zr(Qr),Si(tr)},[lt]),(0,le.useImperativeHandle)(Ht,()=>({onSave:Lo,Clear:yr}));const Lo=()=>{if(!Pi)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Qr=kr.findIndex(Ir=>!Ir);if(Qr>-1)return Ct.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${li[Qr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Array.isArray(Wi))return Ct.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;const tr=kr.map((Ir,uo)=>({choice_text:Ir,is_answer:Wi.includes(uo)?1:0}));return{name:Pi,choices:tr,analysis:Ur}},yr=()=>{Zr(["","","",""]),Jr(""),Nr(""),Si("")};return le.createElement("section",{className:ht.wrap},le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u9898\u5E72\uFF1A")),le.createElement(ui.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Pi,onChange:Qr=>Jr(Qr)}),le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.required},"*"),le.createElement("span",{className:ht.title},"\u7B54\u6848\u9009\u9879\uFF1A",le.createElement("span",{className:ht.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),kr.map((Qr,tr)=>le.createElement("div",{className:ht.choiceWrap,key:tr},le.createElement(St.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},le.createElement("div",{className:`${ht.answer} ${Wi!=null&&Wi.includes(tr)?ht.activeAnswer:""}`,onClick:()=>Si([tr])},li[tr])),le.createElement("div",{className:ht.editorWrap},Er===tr?le.createElement(ui.Z,{id:`single-question-option-${tr}`,watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Qr,onChange:Ir=>{kr[tr]=Ir,Zr(kr)}}):le.createElement("div",{className:ht.htmlWrap,onClick:()=>Eo(tr)},le.createElement(Ze.Z,{value:Qr}))),tr>1&&le.createElement(St.Z,{title:"\u5220\u9664"},le.createElement("i",{className:`${ht.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Zr(kr.filter((Ir,uo)=>uo!==tr)),tr===Wi&&Si(null)}})),tr<7&&tr===kr.length-1&&le.createElement(St.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},le.createElement("i",{className:`${ht.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Zr([...kr,""])})))),le.createElement("p",{className:ht.titleWrap},le.createElement("span",{className:ht.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),le.createElement(ui.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ur,onChange:Qr=>Nr(Qr)}))};var oi=(0,st.connect)(({loading:gt,globalSetting:Ht})=>({globalSetting:Ht,loading:gt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Hn)),ki=Le(96599),Ji=Le(71411),$i=Le(61485),ir=Le(59301),Mt=Object.defineProperty,_t=Object.defineProperties,At=Object.getOwnPropertyDescriptors,xi=Object.getOwnPropertySymbols,mi=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,wn=(gt,Ht,Re)=>Ht in gt?Mt(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,Yn=(gt,Ht)=>{for(var Re in Ht||(Ht={}))mi.call(Ht,Re)&&wn(gt,Re,Ht[Re]);if(xi)for(var Re of xi(Ht))fi.call(Ht,Re)&&wn(gt,Re,Ht[Re]);return gt},Qi=(gt,Ht)=>_t(gt,At(Ht)),vr=(gt,Ht)=>{var Re={};for(var lt in gt)mi.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&xi)for(var lt of xi(gt))Ht.indexOf(lt)<0&&fi.call(gt,lt)&&(Re[lt]=gt[lt]);return Re},Dr=(gt,Ht,Re)=>new Promise((lt,fr)=>{var sr=Un=>{try{Ui(Re.next(Un))}catch(Lr){fr(Lr)}},pr=Un=>{try{Ui(Re.throw(Un))}catch(Lr){fr(Lr)}},Ui=Un=>Un.done?lt(Un.value):Promise.resolve(Un.value).then(sr,pr);Ui((Re=Re.apply(gt,Ht)).next())});const Ke=gt=>{if(!gt)return!1;if(/^s*$/.test(gt)||gt.trim()===""){Ct.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Ht=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return gt==="|"?(Ct.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Lt=({value:gt=[],onClose:Ht})=>ir.createElement(ki.default,{closable:!0,onClose:Ht,className:ht.keywordTag},ir.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},gt.join(" \u6216 "))),_n=(gt,Ht)=>{var Re=gt,{editData:lt,globalSetting:fr,loading:sr,dispatch:pr,onRef:Ui=()=>{},isEdit:Un}=Re,Lr=vr(Re,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[kr,Zr]=(0,le.useState)(""),[Er,Eo]=(0,le.useState)(""),[Wi,Si]=(0,le.useState)(""),[Pi,Jr]=(0,le.useState)(""),[Ur]=pt.default.useForm(),Nr=pt.default.useWatch("use_keywords",Ur);(0,le.useEffect)(()=>{var tr;!lt||!Un||(Zr(lt==null?void 0:lt.name),Eo(lt==null?void 0:lt.analysis),Si((tr=lt==null?void 0:lt.answer_texts)==null?void 0:tr[0]),Ur.setFieldsValue(Yn({},lt)))},[lt]),(0,le.useImperativeHandle)(Ht,()=>({onSave:Lo,Clear:yr}));const Lo=()=>Dr(void 0,null,function*(){if(!kr)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Ur.validateFields()}catch(Ir){Ct.ZP.error(Ir.errorFields[0].errors[0]);return}const tr=Ur.getFieldsValue();return console.log(tr,"values"),Yn({name:kr,answer_texts:[Wi],analysis:Er},tr)}),yr=()=>{Zr(""),Eo(""),Si(""),Ur.resetFields()},Qr=lt==null?void 0:lt.score;return ir.createElement("section",{className:ht.wrap},ir.createElement("p",{className:ht.titleWrap},ir.createElement("span",{className:ht.required},"*"),ir.createElement("span",{className:ht.title},"\u9898\u5E72\uFF1A")),ir.createElement(ui.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:kr,onChange:tr=>Zr(tr)}),ir.createElement("p",{className:ht.titleWrap},ir.createElement("span",{className:ht.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),ir.createElement(ui.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Wi,onChange:tr=>Si(tr)}),ir.createElement("p",{className:ht.titleWrap},ir.createElement("span",{className:ht.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ir.createElement(ui.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Er,onChange:tr=>Eo(tr)}),ir.createElement(pt.default,{form:Ur,size:"large",onFinishFailed:tr=>Dr(void 0,null,function*(){var Ir,uo;Ct.ZP.error(tr.errorFields[0].errors[0]),Ur.scrollToField((uo=(Ir=tr==null?void 0:tr.errorFields)==null?void 0:Ir[0])==null?void 0:uo.name,{behavior:"smooth",block:"center"})})},ir.createElement(kt.Z,{align:"middle",className:"mb30 mt20"},ir.createElement(pt.default.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked"},ir.createElement(Ji.Z,null)),ir.createElement(De.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),ir.createElement(De.Z,null,ir.createElement(St.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},ir.createElement($i.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),Nr&&ir.createElement(pt.default.List,{name:"keywords",rules:[{validator(tr,Ir){return Ir!=null&&Ir.length?(Ir==null?void 0:Ir.reduce((Zo,ha)=>Zo+ha.score,0))>parseFloat(Qr)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD"))}}]},(tr,{add:Ir,remove:uo})=>ir.createElement(ir.Fragment,null,ir.createElement("div",{className:"mb10"},"\u5173\u952E\u8BCD"),ir.createElement(kt.Z,{align:"middle",className:"font14 mb30"},ir.createElement(De.Z,{flex:1},ir.createElement(ot.default,{value:Pi,onChange:Zo=>{Jr(Zo.target.value)},maxLength:50,allowClear:!0,onPressEnter:Zo=>{var ha,La,zr,bs;const eo=`${(ha=Zo.target)==null?void 0:ha.value}`,ka=(zr=(La=eo==null?void 0:eo.split("|"))==null?void 0:La.filter(Ha=>!!Ha))==null?void 0:zr.map(Ha=>Ha==null?void 0:Ha.trim()),wo=Ur.getFieldValue("keywords"),ts=((bs=wo==null?void 0:wo.map(Ha=>Ha==null?void 0:Ha.keyword))==null?void 0:bs.flat())||[];for(const Ha of ka)if(ts.includes(Ha)){Ct.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Ke(eo)&&(Ir({keyword:ka,score:1}),Jr(""))},className:ht.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),ir.createElement(De.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),tr.map(Zo=>{var ha=Zo,{key:La,name:zr}=ha,bs=vr(ha,["key","name"]);return ir.createElement(kt.Z,{key:La,style:{marginRight:148}},ir.createElement(De.Z,{flex:1},ir.createElement(kt.Z,{align:"middle",justify:"space-between"},ir.createElement(pt.default.Item,Qi(Yn({},bs),{name:[zr,"keyword"]}),ir.createElement(Lt,{onClose:()=>uo(zr)})),ir.createElement(pt.default.Item,Qi(Yn({},bs),{name:[zr,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),ir.createElement(at.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))})))))};var ci=(0,st.connect)(({loading:gt,globalSetting:Ht})=>({globalSetting:Ht,loading:gt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(_n)),$t=Le(8848),xn={wrap:"wrap___Cc0gS",deleteIcon:"deleteIcon___ebwMv",keywordTag:"keywordTag___lUfL5",questionTitleEditorWrap:"questionTitleEditorWrap___u9UgK",choiceWrap:"choiceWrap___VHsr3",choiceIndex:"choiceIndex___rsj9r",judgementIndex:"judgementIndex___fMm6E",setAnswerBtn:"setAnswerBtn___krVC9",activeAnswer:"activeAnswer___WiYo2",activeJudgementAnswer:"activeJudgementAnswer___M6iww",actionWrapper:"actionWrapper___oKI8_",addIcon:"addIcon___eMbGP",inputBorder:"inputBorder___ob_6x",placeholder:"placeholder___Vkwr4",blankWrapper:"blankWrapper____MZQ5",blankInput:"blankInput___ephwY",blankInputNumberWrapper:"blankInputNumberWrapper___C1UJS",addBtn:"addBtn___qRBpJ",blankIndex:"blankIndex___QsKgf",baseInputWrapper:"baseInputWrapper___juqCB",collapseWrapper:"collapseWrapper___kAXJ0",panelHeader:"panelHeader___hLTSe",open:"open___wWDjf",close:"close___XPTJ0",hide:"hide___VytUy"},Xt=Le(32134),ri=Le(12893),Hi=Object.defineProperty,gi=Object.defineProperties,Ii=Object.getOwnPropertyDescriptors,Fi=Object.getOwnPropertySymbols,Cr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,Sr=(gt,Ht,Re)=>Ht in gt?Hi(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,hn=(gt,Ht)=>{for(var Re in Ht||(Ht={}))Cr.call(Ht,Re)&&Sr(gt,Re,Ht[Re]);if(Fi)for(var Re of Fi(Ht))xr.call(Ht,Re)&&Sr(gt,Re,Ht[Re]);return gt},ro=(gt,Ht)=>gi(gt,Ii(Ht)),Gr=(gt,Ht)=>{var Re={};for(var lt in gt)Cr.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&Fi)for(var lt of Fi(gt))Ht.indexOf(lt)<0&&xr.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const So=gt=>{var Ht=gt,{value:Re,onChange:lt,scrollId:fr}=Ht,sr=Gr(Ht,["value","onChange","scrollId"]);return le.createElement("div",{id:fr||""},le.createElement(ui.Z,ro(hn({},sr),{defaultValue:Re,onChange:(pr,Ui)=>{Ui!=null&&Ui.length?lt(pr,Ui):lt(pr)}})))},yn=({value:gt,onChange:Ht,placeholder:Re,height:lt=140,isEdit:fr})=>fr?le.createElement(ui.Z,{watch:!0,isFocus:!0,height:lt,placeholder:Re,defaultValue:gt,onChange:Ht}):le.createElement("div",{style:{cursor:"pointer"}},gt?le.createElement(Ze.Z,{className:xn.inputBorder,value:gt}):le.createElement("div",{className:`${xn.inputBorder} ${xn.placeholder}`},Re));var Xn=Le(59301),rr=Object.defineProperty,er=Object.defineProperties,Pr=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,vo=Object.prototype.propertyIsEnumerable,po=(gt,Ht,Re)=>Ht in gt?rr(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,yo=(gt,Ht)=>{for(var Re in Ht||(Ht={}))so.call(Ht,Re)&&po(gt,Re,Ht[Re]);if(Wr)for(var Re of Wr(Ht))vo.call(Ht,Re)&&po(gt,Re,Ht[Re]);return gt},Nn=(gt,Ht)=>er(gt,Pr(Ht)),ia=(gt,Ht)=>{var Re={};for(var lt in gt)so.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&Wr)for(var lt of Wr(gt))Ht.indexOf(lt)<0&&vo.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const Tn=["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"],Ar=({value:gt,onChange:Ht,choiceTextKey:Re,answerKey:lt,index:fr,isEdit:sr,setInputActive:pr,form:Ui,choiceOptionsPath:Un,allowChangeMode:Lr,showAddIcon:kr,addItem:Zr,deleteItem:Er})=>{const Eo=(gt==null?void 0:gt[lt])===!0,Wi=()=>{const Pi=Ui.getFieldValue(Un);Ui.setFieldValue(Un,Pi.map(Jr=>Nn(yo({},Jr),{[lt]:!1})))},Si=()=>{Eo?Ht(Nn(yo({},gt),{[lt]:!1})):(Lr||Wi(),Ht(Nn(yo({},gt),{[lt]:!0})))};return Xn.createElement(kt.Z,{className:xn.choiceWrap,align:"middle",wrap:!1},Xn.createElement(De.Z,{onClick:Si,className:`${xn.choiceIndex} ${Eo?xn.activeAnswer:""}`},Tn[fr]),Xn.createElement(De.Z,{flex:1,className:`${xn.editorWrap} ml15`,onClick:pr},Xn.createElement(yn,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:sr,value:gt==null?void 0:gt[Re],onChange:Pi=>{Ht(Nn(yo({},gt),{[Re]:Pi}))}})),Xn.createElement(De.Z,{flex:"0 0 auto",className:"ml15"},Xn.createElement("div",{onClick:Si,className:`${xn.setAnswerBtn} ${Eo?xn.activeAnswer:""}`},Eo?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),Xn.createElement(De.Z,{className:xn.actionWrapper},Xn.createElement(St.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},Xn.createElement(Xt.Z,{className:xn.addIcon,onClick:Zr,style:{visibility:kr?"visible":"hidden"}})),Xn.createElement(St.Z,{title:"\u5220\u9664"},Xn.createElement(ri.Z,{className:xn.deleteIcon,onClick:Er,style:{visibility:fr>1?"visible":"hidden"}}))))},Bo=({questionTitlePlaceholder:gt,titleKey:Ht,choiceKey:Re,analysisKey:lt,choiceTextKey:fr,answerKey:sr,choiceOptionsPath:pr,allowChangeMode:Ui=!0,form:Un,showAnalysis:Lr=!0})=>{const[kr,Zr]=(0,le.useState)(),[Er,Eo]=(0,le.useState)(!1);return Xn.createElement("div",{className:xn.wrap},Xn.createElement("div",{className:xn.questionTitleEditorWrap},Xn.createElement(pt.default.Item,{label:"\u9898\u5E72",name:Ht,labelCol:{span:24},rules:[{required:!0}]},Xn.createElement(So,{scrollId:Array.isArray(Ht)?Ht.join("_"):`${Ht}`,watch:!0,height:140,placeholder:gt}))),Xn.createElement(pt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Xn.createElement(pt.default.List,{name:Re,rules:[{validator(Wi,Si){const Pi=Si.some(Ur=>Ur[sr]),Jr=Si.findIndex(Ur=>{var Nr;return((Nr=Ur[fr])==null?void 0:Nr.length)<=0});return Jr!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${Tn[Jr]}\u9009\u9879\u7684\u5185\u5BB9`)):Pi?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Wi,{add:Si,remove:Pi})=>Xn.createElement("div",{id:Array.isArray(pr)?pr.join("_"):`${pr}`},Wi.map((Jr,Ur)=>{var Nr=Jr,{key:Lo,name:yr}=Nr,Qr=ia(Nr,["key","name"]);const tr=kr===Lo,Ir=()=>{Zr(Lo)},uo=Ur<7&&Ur===Wi.length-1,Zo=()=>Si({[fr]:"",[sr]:0}),ha=()=>Pi(yr);return Xn.createElement(pt.default.Item,Nn(yo({},Qr),{key:Lo,name:yr,noStyle:!0}),Xn.createElement(Ar,{choiceTextKey:fr,answerKey:sr,index:Ur,isEdit:tr,setInputActive:Ir,form:Un,choiceOptionsPath:pr,allowChangeMode:Ui,showAddIcon:uo,addItem:Zo,deleteItem:ha}))}),Wi.length<8&&Xn.createElement("div",{className:`${xn.addBtn} mb30`,onClick:()=>Si({[fr]:"",[sr]:0})},"\u6DFB\u52A0\u9009\u9879"))),Lr&&Xn.createElement("div",{onClick:()=>Eo(!0)},Xn.createElement(pt.default.Item,{name:lt,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Xn.createElement(yn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Er}))))};var br=Le(59301),na=Object.defineProperty,Do=Object.defineProperties,ho=Object.getOwnPropertyDescriptors,Jo=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable,Gt=(gt,Ht,Re)=>Ht in gt?na(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,Ie=(gt,Ht)=>{for(var Re in Ht||(Ht={}))Vt.call(Ht,Re)&&Gt(gt,Re,Ht[Re]);if(Jo)for(var Re of Jo(Ht))jn.call(Ht,Re)&&Gt(gt,Re,Ht[Re]);return gt},ai=(gt,Ht)=>Do(gt,ho(Ht)),hi=(gt,Ht)=>{var Re={};for(var lt in gt)Vt.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&Jo)for(var lt of Jo(gt))Ht.indexOf(lt)<0&&jn.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const _i=({value:gt,onChange:Ht})=>{const Re=fr=>{Oe.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:xn.modal,onOk:()=>{const sr=[...gt];sr.splice(fr,1),Ht(sr)}})},lt=()=>{const fr=[...gt];fr.push(""),Ht(fr)};return br.createElement(kt.Z,{align:"middle",className:"ml20",gutter:[40,20]},gt==null?void 0:gt.map((fr,sr)=>br.createElement(De.Z,{key:`${fr}_${sr}`,className:xn.blankWrapper},br.createElement(ot.default,{className:xn.blankInput,defaultValue:fr,maxLength:1e3,onBlur:pr=>{const Ui=[...gt],Un=pr.target.value.trim();Ui[sr]=Un,Ht(Ui)}}),br.createElement(St.Z,{title:"\u5220\u9664"},br.createElement(ri.Z,{className:xn.deleteIcon,style:{marginLeft:15,visibility:sr>0?"visible":"hidden"},onClick:()=>Re(sr)})))),br.createElement(De.Z,null,br.createElement("div",{className:`${xn.addBtn}`,onClick:()=>{lt()}},"\u65B0\u589E\u7B54\u6848")))},Yi=({value:gt=!0,onChange:Ht})=>br.createElement(Ji.Z,{checked:!gt,onChange:Re=>{Ht(!Re)}}),Ti="\u2581",In=({questionTitlePlaceholder:gt,form:Ht,name:Re,scoreByBlank:lt="use_blank_score",answerKey:fr,titleKey:sr="name",analysisKey:pr="analysis",isOrdered:Ui="is_ordered"})=>{var Un,Lr;const[kr,Zr]=(0,le.useState)(!1),Er=(Lo,yr)=>{const Qr=yr.line;let tr=0;for(let uo=0;uo<Qr;uo++)tr+=Lo.getLine(uo).split(Ti).length-1;const Ir=Lo.getLine(Qr).substring(0,yr.ch);return tr+=Ir.split(Ti).length-1,tr},Eo=(Lo,yr,Qr,tr)=>{const Ir=Lo.getRange(yr.from,yr.to);let uo=0;if(yr.text.forEach(Zo=>{uo+=Zo.split(Ti).length-1}),yr.origin!=="setValue"){if(Ir&&Ir.indexOf(Ti)!==-1){const Zo=Ir.split(Ti).length-1,ha=Er(Lo,yr.from);if(console.log(`\u5220\u9664${Zo}\u4E2A\uFF0C \u524D\u9762\u6709${ha}\u4E2A\uFF0C\u65B0\u589E${uo}\u4E2A`),Zo>1){const La=Array.from({length:Zo},(zr,bs)=>ha+bs);tr(La)}else tr(ha)}else if(uo>0){const Zo=Er(Lo,yr.from);console.log(`\u65B0\u589E${uo}\u4E2A\uFF0C\u4E4B\u524D\u6709${Zo}\u4E2A`),Qr(uo,Zo)}}},Wi=()=>{const Lo=Ht.getFieldValue(["sub_item_banks",...fr]);Ht.setFieldValue(["sub_item_banks",...fr],Lo==null?void 0:Lo.map((yr,Qr)=>ai(Ie({},yr),{position:Qr+1})))},Si=(0,le.useRef)(),Pi=(Lo,yr)=>{for(let Qr=0;Qr<Lo;Qr++)Si.current({position:null,answer_text:[""]},yr+Qr);Wi()},Jr=(0,le.useRef)(),Ur=Lo=>{Jr.current(Lo),Wi()},Nr=(Lr=(Un=Ht.getFieldValue("sub_item_banks"))==null?void 0:Un[fr==null?void 0:fr[0]])==null?void 0:Lr[fr==null?void 0:fr[1]];return br.createElement("div",{className:xn.wrap},br.createElement("div",{className:xn.questionTitleEditorWrap},br.createElement(pt.default.Item,{label:"\u9898\u5E72",name:sr,labelCol:{span:24},rules:[{required:!0}]},br.createElement(So,{scrollId:"name",watch:!0,height:140,placeholder:gt,showNullButton:!0,onCMBeforeChange:(Lo,yr)=>{Eo(Lo,yr,Pi,Ur)}}))),br.createElement(pt.default.List,{name:fr,rules:[{validator(Lo,yr){if((yr==null?void 0:yr.length)===0)return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const Qr of yr){const{answer_text:tr}=Qr||{};if(tr!=null&&tr.some(Ir=>(Ir==null?void 0:Ir.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Lo,{add:yr,remove:Qr},{errors:tr})=>(Si.current=yr,Jr.current=Qr,br.createElement(br.Fragment,null,br.createElement(pt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Lo.map((Ir,uo)=>{var Zo=Ir,{key:ha,name:La}=Zo,zr=hi(Zo,["key","name"]);return br.createElement(kt.Z,{className:"mb20",key:ha,align:"middle",wrap:!1},br.createElement(De.Z,{flex:"0 0 auto",className:`${xn.blankIndex}`},"\u586B\u7A7A\u9879",uo+1),br.createElement(De.Z,{flex:1},br.createElement(kt.Z,{align:"top",justify:"space-between",wrap:!1},br.createElement(De.Z,null,br.createElement(pt.default.Item,ai(Ie({},zr),{name:[La,"answer_text"],noStyle:!0}),br.createElement(_i,null))),(Ht==null?void 0:Ht.getFieldValue(["sub_item_banks",...lt]))&&br.createElement(De.Z,{flex:"224px"},br.createElement(pt.default.Item,ai(Ie({},zr),{name:[La,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:xn.blankInputNumberWrapper}),br.createElement(at.Z,{className:xn.blankInput,min:.1,max:100,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),br.createElement(pt.default.Item,ai(Ie({},zr),{name:[La,"position"],noStyle:!0}),br.createElement(ot.default,{type:"hidden"}))))})))),br.createElement(kt.Z,{align:"middle"},br.createElement(pt.default.Item,{name:[Re,"downcase"],valuePropName:"checked"},br.createElement(Ji.Z,null)),br.createElement(De.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),br.createElement(kt.Z,{align:"middle"},br.createElement(pt.default.Item,{name:[Re,"no_space"],valuePropName:"checked"},br.createElement(Ji.Z,null)),br.createElement(De.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Nr==null?void 0:Nr.length)>1&&br.createElement(kt.Z,{align:"middle",className:(Nr==null?void 0:Nr.length)>1?"mb30":`${xn.hide}`},br.createElement(pt.default.Item,{name:Ui},br.createElement(Yi,null)),br.createElement(De.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),br.createElement("div",{onClick:()=>Zr(!0)},br.createElement(pt.default.Item,{name:pr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},br.createElement(yn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:kr}))))};var si=Object.defineProperty,yi=Object.defineProperties,$n=Object.getOwnPropertyDescriptors,pi=Object.getOwnPropertySymbols,ur=Object.prototype.hasOwnProperty,Ki=Object.prototype.propertyIsEnumerable,Bi=(gt,Ht,Re)=>Ht in gt?si(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,Pn=(gt,Ht)=>{for(var Re in Ht||(Ht={}))ur.call(Ht,Re)&&Bi(gt,Re,Ht[Re]);if(pi)for(var Re of pi(Ht))Ki.call(Ht,Re)&&Bi(gt,Re,Ht[Re]);return gt},hr=(gt,Ht)=>yi(gt,$n(Ht)),or=(gt,Ht)=>{var Re={};for(var lt in gt)ur.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&pi)for(var lt of pi(gt))Ht.indexOf(lt)<0&&Ki.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const xo={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Yr=({value:gt,onChange:Ht,form:Re,choiceKey:lt})=>{const fr=(gt==null?void 0:gt.is_answer)===!0,sr=gt==null?void 0:gt.choice_text,pr=()=>{var Ui;const Un=(Ui=Re==null?void 0:Re.getFieldValue(["sub_item_banks",...lt]))==null?void 0:Ui.map(Lr=>({choice_text:Lr==null?void 0:Lr.choice_text,is_answer:!1}));Re==null||Re.setFieldValue(["sub_item_banks",...lt],Un),Ht(hr(Pn({},gt),{is_answer:!0}))};return le.createElement(kt.Z,{className:xn.choiceWrap,align:"middle",wrap:!1},le.createElement(De.Z,{onClick:pr,className:`${xn.choiceIndex} ${xn.judgementIndex} ${fr?xn.activeAnswer:""}`},xo[sr]),le.createElement(De.Z,{flex:1,className:`${xn.editorWrap} ml15`},le.createElement("div",{className:`${xn.inputBorder} ${xn.placeholder} ${fr?xn.activeJudgementAnswer:""}`},sr)),le.createElement(De.Z,{flex:"0 0 auto",className:"ml15"},le.createElement("div",{onClick:pr,className:`${xn.setAnswerBtn} ${fr?xn.activeAnswer:""}`},fr?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},qo=({questionTitlePlaceholder:gt,choiceKey:Ht="choices",form:Re,titleKey:lt="name",analysisKey:fr="analysis"})=>{const[sr,pr]=(0,le.useState)(!1);return le.createElement("div",{className:xn.wrap},le.createElement("div",{className:xn.questionTitleEditorWrap},le.createElement(pt.default.Item,{label:"\u9898\u5E72",name:lt,labelCol:{span:24},rules:[{required:!0}]},le.createElement(So,{scrollId:"name",watch:!0,height:140,placeholder:gt}))),le.createElement(pt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},le.createElement(pt.default.List,{name:Ht,rules:[{validator(Ui,Un){return Un.some(kr=>(kr==null?void 0:kr.is_answer)===!0)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Ui=>le.createElement("div",{id:"choices"},Ui.map(Un=>{var Lr=Un,{key:kr,name:Zr}=Lr,Er=or(Lr,["key","name"]);return le.createElement(pt.default.Item,hr(Pn({},Er),{key:kr,name:Zr,noStyle:!0}),le.createElement(Yr,{form:Re,choiceKey:Ht}))})))),le.createElement("div",{onClick:()=>pr(!0)},le.createElement(pt.default.Item,{name:fr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},le.createElement(yn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:sr}))))};var Ko=Object.defineProperty,Qo=Object.defineProperties,ra=Object.getOwnPropertyDescriptors,Uo=Object.getOwnPropertySymbols,wa=Object.prototype.hasOwnProperty,Wt=Object.prototype.propertyIsEnumerable,Ho=(gt,Ht,Re)=>Ht in gt?Ko(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,wr=(gt,Ht)=>{for(var Re in Ht||(Ht={}))wa.call(Ht,Re)&&Ho(gt,Re,Ht[Re]);if(Uo)for(var Re of Uo(Ht))Wt.call(Ht,Re)&&Ho(gt,Re,Ht[Re]);return gt},no=(gt,Ht)=>Qo(gt,ra(Ht)),bo=(gt,Ht)=>{var Re={};for(var lt in gt)wa.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&Uo)for(var lt of Uo(gt))Ht.indexOf(lt)<0&&Wt.call(gt,lt)&&(Re[lt]=gt[lt]);return Re};const oo=gt=>{var Ht=gt,{value:Re,onChange:lt}=Ht,fr=bo(Ht,["value","onChange"]);const sr=pr=>{lt([pr])};return le.createElement(ui.Z,no(wr({},fr),{defaultValue:Re==null?void 0:Re[0],onChange:sr}))},fa=gt=>{if(!gt)return!1;let Ht=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return gt==="|"?(Ct.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},ga=({value:gt=[],onClose:Ht})=>le.createElement(ki.default,{closable:!0,onClose:Ht,className:xn.keywordTag},gt==null?void 0:gt.join(" \u6216 ")),Mo=({questionTitlePlaceholder:gt,form:Ht,showKeywords:Re,isMustKeyWords:lt=Re,titleKey:fr="name",analysisKey:sr="analysis",answerTexts:pr="answer_texts",keywords:Ui="keywords",useKeywords:Un="use_keywords",indexs:Lr})=>{const[kr,Zr]=(0,le.useState)(!1),[Er,Eo]=(0,le.useState)(""),Wi=pt.default.useWatch("sub_item_banks",Ht),{use_keywords:Si,score:Pi}=(Wi==null?void 0:Wi[Lr])||{};return console.log(Si,Pi,"itemValues"),le.createElement("div",{className:xn.wrap},le.createElement("div",{className:xn.questionTitleEditorWrap},le.createElement(pt.default.Item,{label:"\u9898\u5E72",name:fr,labelCol:{span:24},rules:[{required:!0}]},le.createElement(So,{scrollId:"name",watch:!0,height:140,placeholder:gt}))),le.createElement(pt.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:pr,labelCol:{span:24}},le.createElement(oo,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Re&&!lt&&le.createElement(pt.default.Item,{hidden:!0,name:Un,valuePropName:"checked"},le.createElement(Ji.Z,{defaultChecked:!0})),Re&<&&le.createElement(kt.Z,{align:"middle",className:"mb30"},le.createElement(pt.default.Item,{name:Un,valuePropName:"checked"},le.createElement(Ji.Z,null)),le.createElement(De.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),le.createElement(De.Z,null,le.createElement(St.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},le.createElement($i.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(Si||!lt)&&le.createElement(pt.default.List,{name:Ui,rules:[{validator(Jr,Ur){return lt?Ur!=null&&Ur.length?(Ur==null?void 0:Ur.reduce((Lo,yr)=>Lo+yr.score,0))>parseFloat(Pi)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Jr,{add:Ur,remove:Nr})=>le.createElement(le.Fragment,null,le.createElement("div",{className:`${xn.title} mb10`},lt?"\u5173\u952E\u8BCD":le.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),le.createElement(kt.Z,{align:"middle",className:"font14 mb30"},le.createElement(De.Z,{flex:1},le.createElement(ot.default,{value:Er,onChange:Lo=>{Eo(Lo.target.value)},maxLength:50,allowClear:!0,onPressEnter:Lo=>{var yr,Qr,tr,Ir;const uo=`${(yr=Lo.target)==null?void 0:yr.value}`,Zo=(tr=(Qr=uo==null?void 0:uo.split("|"))==null?void 0:Qr.filter(zr=>!!zr))==null?void 0:tr.map(zr=>zr==null?void 0:zr.trim()),ha=Ht.getFieldValue(["sub_item_banks",...Ui]),La=((Ir=ha==null?void 0:ha.map(zr=>zr==null?void 0:zr.keyword))==null?void 0:Ir.flat())||[];for(const zr of Zo)if(La.includes(zr)){Ct.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}fa(uo)&&(Ur({keyword:Zo,score:1}),Eo(""))},className:xn.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),le.createElement(De.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Jr.map(Lo=>{var yr=Lo,{key:Qr,name:tr}=yr,Ir=bo(yr,["key","name"]);return le.createElement(kt.Z,{key:Qr,className:"mb20",style:{marginRight:148}},le.createElement(De.Z,{flex:1},le.createElement(kt.Z,{align:"middle",justify:"space-between"},le.createElement(pt.default.Item,no(wr({},Ir),{name:[tr,"keyword"]}),le.createElement(ga,{onClose:()=>Nr(tr)})),lt&&le.createElement(pt.default.Item,no(wr({},Ir),{name:[tr,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:xn.blankInputNumberWrapper}),le.createElement(at.Z,{className:xn.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),le.createElement("div",{onClick:()=>Zr(!0)},le.createElement(pt.default.Item,{name:sr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},le.createElement(yn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:kr}))))};var Fo=Le(59301),vs=Object.defineProperty,es=Object.defineProperties,ps=Object.getOwnPropertyDescriptors,ms=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,Ka=Object.prototype.propertyIsEnumerable,Ba=(gt,Ht,Re)=>Ht in gt?vs(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,ss=(gt,Ht)=>{for(var Re in Ht||(Ht={}))Kr.call(Ht,Re)&&Ba(gt,Re,Ht[Re]);if(ms)for(var Re of ms(Ht))Ka.call(Ht,Re)&&Ba(gt,Re,Ht[Re]);return gt},Ya=(gt,Ht)=>es(gt,ps(Ht)),ls=(gt,Ht)=>{var Re={};for(var lt in gt)Kr.call(gt,lt)&&Ht.indexOf(lt)<0&&(Re[lt]=gt[lt]);if(gt!=null&&ms)for(var lt of ms(gt))Ht.indexOf(lt)<0&&Ka.call(gt,lt)&&(Re[lt]=gt[lt]);return Re},Zi=(gt,Ht,Re)=>new Promise((lt,fr)=>{var sr=Un=>{try{Ui(Re.next(Un))}catch(Lr){fr(Lr)}},pr=Un=>{try{Ui(Re.throw(Un))}catch(Lr){fr(Lr)}},Ui=Un=>Un.done?lt(Un.value):Promise.resolve(Un.value).then(sr,pr);Ui((Re=Re.apply(gt,Ht)).next())});const{Panel:Xr}=$t.default,Po=null,Yo=(gt,Ht)=>{var Re=gt,{globalSetting:lt,loading:fr,dispatch:sr,editData:pr,onRef:Ui=()=>{},isEdit:Un}=Re,Lr=ls(Re,["globalSetting","loading","dispatch","editData","onRef","isEdit"]);const[kr,Zr]=(0,le.useState)(""),[Er,Eo]=(0,le.useState)([]),[Wi]=pt.default.useForm();(0,le.useEffect)(()=>{!pr||!Un||(Zr(pr==null?void 0:pr.name),Eo(pr==null?void 0:pr.sub_item_banks),Wi.setFieldsValue(ss({},pr)))},[pr]),(0,le.useEffect)(()=>{Eo(Wi.getFieldValue("sub_item_banks"))},[pt.default.useWatch("sub_item_banks",Wi)]),(0,le.useImperativeHandle)(Ht,()=>({onSave:Si,Clear:Pi}));const Si=()=>Zi(void 0,null,function*(){if(!kr)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Wi.validateFields()}catch(Qr){return console.log(Qr,"errInfo"),Ct.ZP.error(Qr.errorFields[0].errors[0]),!1}const yr=Er.map(Qr=>ss({id:Qr.id>1?Qr.id:null},Qr));return{name:kr,sub_item_banks:yr}}),Pi=()=>{Zr(""),Eo([])},Jr={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},Ur=({value:yr})=>Fo.createElement("div",{style:{textAlign:"center",color:"#DF3065",margin:"0 5px"}},yr),[Nr,Lo]=(0,le.useState)();return Fo.createElement("section",{className:ht.wrap},Fo.createElement("p",{className:ht.titleWrap},Fo.createElement("span",{className:ht.required},"*"),Fo.createElement("span",{className:ht.title},"\u9898\u5E72\uFF1A")),Fo.createElement(ui.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:kr,onChange:yr=>Zr(yr)}),Fo.createElement(pt.default,{form:Wi,autoComplete:"off"},Fo.createElement(pt.default.List,{name:"sub_item_banks",rules:[{validator(yr,Qr){return Qr?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(yr,{add:Qr,remove:tr})=>{const Ir=Wi.getFieldValue("sub_item_banks");return Fo.createElement(Fo.Fragment,null,Fo.createElement($t.default,{className:yr.length>0?ht.collapseWrapper:"",bordered:!1,expandIcon:({isActive:uo})=>Fo.createElement("i",{className:`iconfont icon-weizhankai ${uo?ht.open:ht.close}`,style:{fontSize:14,transition:"all .2s"}})},yr.map((uo,Zo)=>{var ha=uo,{key:La,name:zr}=ha,bs=ls(ha,["key","name"]),eo,ka,wo,ts,Ha,rs,Ol,su,Rl,lu,Da,al;return Fo.createElement(Xr,{className:ht.panel,forceRender:!0,header:Fo.createElement("div",{className:ht.panelHeader},"\u7B2C",Zo+1,"\u5C0F\u9898",Fo.createElement("span",null,"\uFF08",Jr[(eo=Ir==null?void 0:Ir[zr])==null?void 0:eo.item_type],"\uFF09")),extra:Fo.createElement(kt.Z,{align:"middle",onClick:jl=>jl.stopPropagation(),style:{display:"flex",alignItems:"center"}},((ka=Ir==null?void 0:Ir[zr])==null?void 0:ka.item_type)=="completion"&&Fo.createElement(pt.default.Item,Ya(ss({},bs),{name:[zr,"score"],className:ht.blankInputNumberWrapper,style:{marginBottom:0}}),((wo=Ir==null?void 0:Ir[zr])==null?void 0:wo.item_type)=="completion"&&Fo.createElement("div",{style:{display:"flex",alignItems:"center",color:"#191919"}},"\u5171",Fo.createElement(Ur,{value:(ts=Ir==null?void 0:Ir[zr])==null?void 0:ts.score}),"\u5206")),((Ha=Ir==null?void 0:Ir[zr])==null?void 0:Ha.item_type)=="completion"&&Fo.createElement(Fo.Fragment,null,Fo.createElement(Ot.ZP.Group,{defaultValue:(rs=Ir==null?void 0:Ir[zr])==null?void 0:rs.use_blank_score,className:ht.scoreByBlankRadio,style:{marginRight:10},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:jl=>{var nl;console.log(Wi.getFieldsValue()),Wi==null||Wi.setFieldValue(["sub_item_banks",zr,"use_blank_score"],(nl=jl==null?void 0:jl.target)==null?void 0:nl.value),Lo(new Date)}}),Fo.createElement(St.Z,{overlayInnerStyle:{width:460},title:Fo.createElement("div",null,"\u6309\u7A7A\u7ED9\u5206\uFF1A\u9700\u8981\u5206\u522B\u8BBE\u7F6E\u6BCF\u4E2A\u586B\u7A7A\u9879\u7684\u5206\u503C\uFF0C\u586B\u7A7A\u9879\u7B54\u5BF9\u4E4B\u540E\u5219\u83B7\u5F97\u5BF9\u5E94\u7684\u5206\u503C\u3002",Fo.createElement("br",null),"\u6309\u9898\u7ED9\u5206\uFF1A\u7B54\u5BF9\u5168\u90E8\u586B\u7A7A\u9879\u4E4B\u540E\u624D\u80FD\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002")},Fo.createElement("i",{className:"icon-tishixiaowenhao font18 c-3061d0"})))),key:La},Fo.createElement(pt.default.Item,Ya(ss({},bs),{name:zr}),(((Ol=Ir==null?void 0:Ir[zr])==null?void 0:Ol.item_type)=="single"||((su=Ir==null?void 0:Ir[zr])==null?void 0:su.item_type)=="multiple")&&Fo.createElement(Bo,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Rl=Ir==null?void 0:Ir[zr])==null?void 0:Rl.item_type)!="single",form:Wi,choiceKey:[zr,"choices"],titleKey:[zr,"name"],analysisKey:[zr,"analysis"],choiceOptionsPath:["sub_item_banks",zr,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((lu=Ir==null?void 0:Ir[zr])==null?void 0:lu.item_type)=="completion"&&Fo.createElement(In,{form:Wi,name:zr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:[zr,"use_blank_score"],titleKey:[zr,"name"],analysisKey:[zr,"analysis"],isOrdered:[zr,"is_ordered"],answerKey:[zr,"standard_answer"],key:Nr}),((Da=Ir==null?void 0:Ir[zr])==null?void 0:Da.item_type)=="judgement"&&Fo.createElement(qo,{form:Wi,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[zr,"name"],analysisKey:[zr,"analysis"],choiceKey:[zr,"choices"]}),((al=Ir==null?void 0:Ir[zr])==null?void 0:al.item_type)=="subjective"&&Fo.createElement(Mo,{showKeywords:!0,form:Wi,titleKey:[zr,"name"],analysisKey:[zr,"analysis"],answerTexts:[zr,"answer_texts"],useKeywords:[zr,"use_keywords"],keywords:[zr,"keywords"],indexs:zr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})))})))};var ea=(0,st.connect)(({loading:gt,globalSetting:Ht})=>({globalSetting:Ht,loading:gt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Yo)),Ea=Le(84842),Hr=Le(17149),Ns=Le(82326),is=Le(54172),Ut={flex_box_center:"flex_box_center___xDdtW",flex_space_between:"flex_space_between___J4mFI",flex_box_vertical_center:"flex_box_vertical_center___hDYn6",flex_box_center_end:"flex_box_center_end___H7l1j",flex_box_column:"flex_box_column___TPd2T",questionInfo:"questionInfo___ABq66",label:"label___VQOr7",content:"content____HZ6z",leftPart:"leftPart___YB0y5",rightPart:"rightPart___UVMmS",dragItem:"dragItem___Hbx8k",blackText:"blackText___U4u33",greyText:"greyText___rWIL_",iconWrapper:"iconWrapper___I0kek",contentArea:"contentArea___hGC13",dragging:"dragging___z7VVY",hidden:"hidden___nWAxb",dragIcon:"dragIcon___j91TC",deleteIcon:"deleteIcon___cmCqc",disabled:"disabled___ZlKMj",challengeNameWrapper:"challengeNameWrapper___SpiRb",challengeName:"challengeName___lmQe2",shixunPreviewFooter:"shixunPreviewFooter___u0CzD",shixunInfoWrapper:"shixunInfoWrapper___HzLHD",shixunInfo:"shixunInfo___qaQlF",btnToDetail:"btnToDetail___scXqr",fixedBottom:"fixedBottom___wTBAR",cancelBtn:"cancelBtn___Km4Gi",confirmBtn:"confirmBtn___WrECz",previewBtn:"previewBtn____oGPS",setScoreModalTable:"setScoreModalTable___CjDlp",title:"title___cQWdZ",tipcontent:"tipcontent___A8tZ5",name:"name___CvfT9",tip:"tip___EvoCF",info:"info___y_ayi",img:"img___X9CNn"},Zt=Le(9148),bn=Le(58433),zi=Le(82264),Ei=Le(45937),Mi=Le(28426),wi=Le(94361),ti=({open:gt,onCancel:Ht,onOk:Re})=>{const lt=(0,bn.g)(),[fr,sr,pr,Ui]=(0,Ei.U)(zi.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[Un,Lr]=(0,le.useState)(!1);(0,le.useEffect)(()=>{gt&&pr({page:1,limit:10,type:0},!0).then(Wi=>{(Wi==null?void 0:Wi.shixuns_count)===0&&Lr(!0)})},[gt]);const[kr,Zr]=(0,le.useState)([]),[Er,Eo]=(0,le.useState)([]);return le.createElement(Oe.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:gt,width:948,centered:!0,closable:!0,onCancel:Ht,onOk:()=>Re(Er),destroyOnClose:!0},le.createElement(kt.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},le.createElement(De.Z,null,le.createElement(Hr.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:lt,onChange:Wi=>{pr({page:1,discipline_id:Wi==null?void 0:Wi[0],sub_discipline_id:Wi==null?void 0:Wi[1]})}}),le.createElement(Ns.default,{className:"ml20",style:{width:118},size:"large",placeholder:"\u96BE\u5EA6",allowClear:!0,options:[{label:"\u521D\u7EA7",value:1},{label:"\u4E2D\u7EA7",value:2},{label:"\u4E2D\u9AD8\u7EA7",value:3},{label:"\u9AD8\u7EA7",value:4}],onChange:Wi=>pr({page:1,diff:Wi})}),le.createElement(Ns.default,{className:"ml20",placeholder:"\u5168\u90E8\u72B6\u6001",style:{width:118},size:"large",allowClear:!0,options:[{label:"\u672A\u53D1\u5E03",value:"unpublish"},{label:"\u9759\u9ED8\u53D1\u5E03",value:"silent_publish"},{label:"\u516C\u5F00\u53D1\u5E03",value:"public_publish"}],onChange:Wi=>pr({page:1,shixun_publish_status:Wi})})),le.createElement(Zt.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:Wi=>{pr({keyword:Wi,page:1})}})),Un?le.createElement("div",null,le.createElement(Mi.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,nt.xg)("/shixuns")})):le.createElement(is.default,{loading:sr,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(Wi,Si)=>le.createElement("div",{style:{display:"flex",alignItems:"center"}},le.createElement("div",{className:Si!=null&&Si.high_resources_consume?Ut.title:"",title:Wi||"--"},le.createElement(Ze.Z,{key:1,showLines:1,showTextOnly:!0,value:Wi||"--"})),(Si==null?void 0:Si.high_resources_consume)&&le.createElement(wi.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(Wi,Si,Pi)=>le.createElement("span",null,Wi||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:le.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",le.createElement(St.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},le.createElement($i.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(Wi,Si,Pi)=>le.createElement("span",null,Wi||"- -")},{title:"\u64CD\u4F5C",render(Wi,Si){const{title:Pi,challenge_names:Jr,author_name:Ur,identifier:Nr,author_school_name:Lo,study_count:yr}=Si||{};return le.createElement("div",null,le.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{Oe.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:le.createElement("div",null,le.createElement(Ze.Z,{value:Pi,style:{marginBottom:18}}),le.createElement("div",{className:Ut.challengeNameWrapper},Jr.map((Qr,tr)=>le.createElement("div",{className:Ut.challengeName,key:tr},"\u7B2C",(0,nt.EM)(tr+1),"\u9898\xA0",Qr))),le.createElement(kt.Z,{className:Ut.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},le.createElement(De.Z,{className:Ut.shixunInfoWrapper},le.createElement("span",null,"\u521B\u5EFA\u8005"),le.createElement("span",{className:Ut.shixunInfo},Ur.split("\u3001")[0]),le.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),le.createElement("span",{className:Ut.shixunInfo},Lo),le.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),le.createElement("span",{className:Ut.shixunInfo},yr)),le.createElement(yt.ZP,{type:"primary",className:Ut.btnToDetail,onClick:()=>(0,nt.xg)(`/shixuns/${Nr}/challenges?exercise=true`)},le.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(Si==null?void 0:Si.shixun_tag_num)===1&&le.createElement("a",{target:"_blank",href:`/shixuns/${Si==null?void 0:Si.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:Ui==null?void 0:Ui.items,rowSelection:{type:"radio",selectedRowKeys:kr,preserveSelectedRowKeys:!0,getCheckboxProps:Wi=>({disabled:Wi.shixun_tag_num===1}),onChange(Wi,Si){var Pi,Jr,Ur;console.log(Wi),Zr(Wi);const Nr=[];for(const yr of Er)Wi.includes(yr.id)&&Nr.push(yr);const Lo=Nr.map(yr=>yr.id);for(const yr of Si)yr&&Wi.includes(yr.id)&&!Lo.includes(yr.id)&&Nr.push({id:yr.id,difficulty:yr.level,identifier:yr.identifier,name:yr.name,real_name:(Pi=yr==null?void 0:yr.author_name)==null?void 0:Pi.split("\u3001")[0],school_name:yr.author_school_name,challenge_names:yr.challenge_names,challenges:(Jr=yr.challenge_names)==null?void 0:Jr.map((Qr,tr)=>({subject:Qr,id:tr,score:5})),score:((Ur=yr.challenge_names)==null?void 0:Ur.length)*5,study_count:yr.study_count,challenges_count:yr.challenges_count});Eo(Nr)}},pagination:{current:fr.page,pageSize:fr.limit,total:Ui==null?void 0:Ui.items_count,showTotal:Wi=>le.createElement("span",null,"\u5171\xA0",le.createElement("span",{style:{color:"#165DFF"}},Wi),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(Wi,Si){pr({page:Wi,limit:Si})},size:"default"},scroll:{y:400}}))},dr=Le(3039),Tr=Le(75736),Vo=(gt,Ht,Re)=>new Promise((lt,fr)=>{var sr=Un=>{try{Ui(Re.next(Un))}catch(Lr){fr(Lr)}},pr=Un=>{try{Ui(Re.throw(Un))}catch(Lr){fr(Lr)}},Ui=Un=>Un.done?lt(Un.value):Promise.resolve(Un.value).then(sr,pr);Ui((Re=Re.apply(gt,Ht)).next())}),Ca=({visible:gt,getdata:Ht,onCancel:Re,onRandomExchange:lt,selectFromProblemSet:fr,questionParams:sr})=>{const[pr,Ui]=(0,le.useState)(!1),[Un,Lr]=(0,le.useState)(!1),[kr,Zr]=(0,le.useState)({}),Er=(0,st.useParams)(),[Eo,Wi]=(0,le.useState)(),Si=(Pi,Jr)=>Vo(void 0,null,function*(){Lr(!0);const Ur=yield(0,Ye.ZP)(`/api/exercises/${Er.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:sr.id,item_bank_id:Pi,shixuns_info:[{id:Pi,is_copy:Jr!=1,is_use:Jr!=1}]}});Lr(!1),Ur!=null&&Ur.status||(Ct.ZP.info("\u6362\u9898\u6210\u529F"),Re(),Ht())});return le.createElement(Oe.default,{title:"\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",open:gt,onCancel:Re,centered:!0,maskClosable:!0,footer:null},le.createElement(kt.Z,{justify:"center",className:"pb20"},le.createElement(Ea.Z,{onClick:lt},"\u968F\u673A\u66F4\u6362"),(sr==null?void 0:sr.type)!=="PRACTICAL"&&le.createElement(yt.ZP,{style:{marginLeft:24},onClick:fr},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),(sr==null?void 0:sr.type)==="PRACTICAL"&&le.createElement(yt.ZP,{style:{marginLeft:24},onClick:()=>{Ui(!0)}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")),le.createElement(ti,{open:pr,onCancel:()=>Ui(!1),onOk:Pi=>Vo(void 0,null,function*(){if(console.log("----selectedRows",Pi,Er),(Pi==null?void 0:Pi.length)<=0){Ct.ZP.info("\u8BF7\u9009\u62E9\u5B9E\u8BAD");return}let Jr=Pi==null?void 0:Pi.map(Nr=>Nr==null?void 0:Nr.id),Ur=yield(0,Tr.Tr)({id:[...Jr],course_id:Er.coursesId,type:"shixun"});(Ur==null?void 0:Ur.student_count)===0?Si(Jr==null?void 0:Jr[0],1):(Wi(Jr),Zr(Ur)),Ui(!1)})}),le.createElement(dr.Z,{resdata:kr,type:"shixun",okloading:Un,oktext:(kr==null?void 0:kr.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:Pi=>Vo(void 0,null,function*(){Si(Eo==null?void 0:Eo[0],2)})}))},Sa=Le(77762),mo=Le(24334),_r=Le(90283),ar=Le(60572),oa=Le(32162),la=Le(48790),Ma=Object.defineProperty,za=Object.defineProperties,Ro=Object.getOwnPropertyDescriptors,ua=Object.getOwnPropertySymbols,ko=Object.prototype.hasOwnProperty,jr=Object.prototype.propertyIsEnumerable,Fa=(gt,Ht,Re)=>Ht in gt?Ma(gt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Re}):gt[Ht]=Re,sa=(gt,Ht)=>{for(var Re in Ht||(Ht={}))ko.call(Ht,Re)&&Fa(gt,Re,Ht[Re]);if(ua)for(var Re of ua(Ht))jr.call(Ht,Re)&&Fa(gt,Re,Ht[Re]);return gt},Xo=(gt,Ht)=>za(gt,Ro(Ht)),Io=(gt,Ht,Re)=>new Promise((lt,fr)=>{var sr=Un=>{try{Ui(Re.next(Un))}catch(Lr){fr(Lr)}},pr=Un=>{try{Ui(Re.throw(Un))}catch(Lr){fr(Lr)}},Ui=Un=>Un.done?lt(Un.value):Promise.resolve(Un.value).then(sr,pr);Ui((Re=Re.apply(gt,Ht)).next())}),Wa=({data:gt,submit:Ht,goBack:Re,loading:lt,onTypeScore:fr,editPreview:sr=!1,onSkipExamination:pr,selectValue:Ui,onExchange:Un,getdata:Lr,handleMarkWrongQuestion:kr})=>{var Zr,Er,Eo,Wi,Si,Pi,Jr,Ur,Nr,Lo,yr;const Qr=(0,le.useRef)(),[tr,Ir]=(0,le.useState)(null),[uo,Zo]=(0,le.useState)(!1),[ha,La]=(0,le.useState)(!1),zr=(0,le.useRef)(),[bs]=pt.default.useForm(),eo=(0,st.useParams)(),[ka,wo]=(0,le.useState)(!1),[ts,Ha]=(0,le.useState)(!1),[rs,Ol]=(0,le.useState)([]);(0,le.useEffect)(()=>{Zo(!0)},[]),(0,le.useEffect)(()=>{sr||(0,nt.Dk)("\u8BD5\u5377\u9884\u89C8")},[sr]),(0,le.useEffect)(()=>{var Wn;((Wn=gt==null?void 0:gt.questionList)==null?void 0:Wn.length)>0&&(gt==null||gt.questionList.forEach(gr=>{var _o;gr.type==="PRACTICAL"&&((_o=gr==null?void 0:gr.questions)==null||_o.forEach((io,nr)=>{var Aa;rs[nr]=!((Aa=io==null?void 0:io.shixun)!=null&&Aa.ignore_prompt),Ol([...rs])}))}))},[gt]);const su=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],Rl={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",PROGRAM:"\u7F16\u7A0B\u9898",BPROGRAM:"\u7A0B\u5E8F\u586B\u7A7A\u9898",COMBINATION:"\u7EC4\u5408\u9898"},lu={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},Da=Wn=>{var gr;const _o=[];return le.createElement(le.Fragment,null,le.createElement("aside",{className:Ue.single},(gr=Wn==null?void 0:Wn.choices)==null?void 0:gr.map((io,nr)=>(io.is_answer&&_o.push(oa.k4[nr]),le.createElement("ul",{key:nr},le.createElement("li",null,oa.k4[nr],"\u3001"),le.createElement("li",null,le.createElement(Ze.Z,{value:io.choice_text})))))),le.createElement("div",{className:Ue.analysis},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",_o.join(""),le.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",su[Wn.difficulty])),le.createElement("aside",null,le.createElement("span",{className:Ue.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Wn.analysis?Wn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Wn==null?void 0:Wn.discipline_name)||"--"}/${Wn==null?void 0:Wn.sub_discipline_name}`),le.createElement(St.Z,{title:Wn==null?void 0:Wn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Wn==null?void 0:Wn.tag_discipline_name)))))},al=(Wn,gr)=>{var _o;const io=(_o=Wn==null?void 0:Wn.standard_answer)==null?void 0:_o.map((nr,Aa)=>{var ma;return le.createElement("div",{key:Aa},`\u7B54\u6848\uFF08\u586B\u7A7A${nr==null?void 0:nr.position}\uFF09\uFF1A${(ma=nr==null?void 0:nr.answer_text)==null?void 0:ma.join("\u3001")}`)});return le.createElement(le.Fragment,null,le.createElement("div",{className:Ue.analysis},le.createElement("div",{style:{display:"flex"}},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),le.createElement("div",null,io)),le.createElement("aside",null,le.createElement("span",{className:Ue.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Wn.analysis?Wn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),gr?`${(gr==null?void 0:gr.discipline_name)||"--"}/${gr==null?void 0:gr.sub_discipline_name}`:`${(Wn==null?void 0:Wn.discipline_name)||"--"}/${Wn==null?void 0:Wn.sub_discipline_name}`),le.createElement(St.Z,{title:gr?gr==null?void 0:gr.tag_discipline_name:Wn==null?void 0:Wn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),gr?gr==null?void 0:gr.tag_discipline_name:Wn==null?void 0:Wn.tag_discipline_name)))))},jl=Wn=>{var gr;const _o=(gr=Wn==null?void 0:Wn.standard_answer)==null?void 0:gr.map((io,nr)=>le.createElement("div",{key:nr},`\u7B54\u6848\uFF08\u586B\u7A7A${(io==null?void 0:io.position)||(io==null?void 0:io.exercise_choice_id)}\uFF09\uFF1A${io==null?void 0:io.answer_text}`));return le.createElement(le.Fragment,null,le.createElement("div",{className:Ue.analysis},le.createElement("div",{style:{display:"flex"}},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),le.createElement("div",null,_o)),le.createElement("aside",null,le.createElement("span",{className:Ue.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Wn.analysis?Wn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Wn==null?void 0:Wn.discipline_name)||"--"}/${Wn==null?void 0:Wn.sub_discipline_name}`),le.createElement(St.Z,{title:Wn==null?void 0:Wn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Wn==null?void 0:Wn.tag_discipline_name)))))},nl=(Wn,gr)=>{var _o;return le.createElement("div",{className:Ue.analysis},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",(_o=Wn==null?void 0:Wn.answer_texts)==null?void 0:_o[0]),le.createElement("aside",null,le.createElement("span",{className:Ue.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Wn.analysis?Wn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),gr?`${(gr==null?void 0:gr.discipline_name)||"--"}/${gr==null?void 0:gr.sub_discipline_name}`:`${(Wn==null?void 0:Wn.discipline_name)||"--"}/${Wn==null?void 0:Wn.sub_discipline_name}`),le.createElement(St.Z,{title:gr?gr==null?void 0:gr.tag_discipline_name:Wn==null?void 0:Wn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),gr?gr==null?void 0:gr.tag_discipline_name:Wn==null?void 0:Wn.tag_discipline_name))))},oh=Wn=>{var gr,_o;return le.createElement("div",{className:Ue.analysis},le.createElement("aside",null,le.createElement("span",{className:Ue.text},"\u9884\u671F\u8F93\u51FA:"),le.createElement(Ze.Z,{value:(gr=Wn==null?void 0:Wn.program_attr)==null?void 0:gr.description})),le.createElement("div",{style:{marginTop:20}},"\u6B63\u786E\u7B54\u6848\uFF1A",((_o=Wn==null?void 0:Wn.program_attr)==null?void 0:_o.answer_text)||"--"),le.createElement("aside",null,le.createElement("span",{className:Ue.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Wn.analysis?Wn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Wn==null?void 0:Wn.discipline_name)||"--"}/${Wn==null?void 0:Wn.sub_discipline_name}`),le.createElement(St.Z,{title:Wn==null?void 0:Wn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Wn==null?void 0:Wn.tag_discipline_name))))},dl=(Wn,gr)=>{var _o;return le.createElement("div",null,(_o=Wn==null?void 0:Wn.sub_item_banks)==null?void 0:_o.map((io,nr)=>{var Aa,ma;const Ua=[];return le.createElement(le.Fragment,null,le.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"}},gr+1+"."+(nr+1),"\uFF08",Rl[io.item_type]||lu[io.item_type],"\uFF09",io.name),(io.item_type=="SINGLE"||io.item_type=="MULTIPLE"||io.item_type=="JUDGMENT"||io.item_type=="single"||io.item_type=="multiple"||io.item_type=="judgement")&&le.createElement(le.Fragment,null,le.createElement("aside",{className:Ue.single},(Aa=io==null?void 0:io.choices)==null?void 0:Aa.map((Pa,Ks)=>(Pa.is_answer&&Ua.push(oa.k4[Ks]),le.createElement("ul",{key:Ks},le.createElement("li",null,oa.k4[Ks],"\u3001"),le.createElement("li",null,le.createElement(Ze.Z,{value:Pa.choice_text})))))),le.createElement("div",{className:Ue.analysis},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Ua.join(""),le.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",su[io.difficulty])),le.createElement("aside",null,le.createElement("span",{className:Ue.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:io.analysis?io.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Wn==null?void 0:Wn.discipline_name)||"--"}/${Wn==null?void 0:Wn.sub_discipline_name}`),le.createElement(St.Z,{title:Wn==null?void 0:Wn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Wn==null?void 0:Wn.tag_discipline_name))))),(io.item_type=="COMPLETION"||io.item_type=="completion")&&al(io,Wn),(io.item_type=="SUBJECTIVE"||io.item_type=="subjective")&&nl(io,Wn),((ma=gt==null?void 0:gt.exam)==null?void 0:ma.exercise_status)===3&&le.createElement("div",{className:"flex gap-20px mt20"},le.createElement(_r.Z,{state:io==null?void 0:io.is_wrong,onClick:()=>{kr==null||kr({value:Xo(sa({},io),{question_id:io==null?void 0:io.id,question_score:io==null?void 0:io.score})})}}),io.item_type=="single"&&le.createElement(yt.ZP,{style:{color:"#3061D0"},onClick:()=>{of({value:io})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848")))}))},pa=Wn=>{var gr,_o,io;return le.createElement("div",{style:{marginTop:"12px"}},(_o=(gr=Wn==null?void 0:Wn.shixun)==null?void 0:gr.challenges)==null?void 0:_o.map((nr,Aa)=>le.createElement("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},le.createElement("div",null,le.createElement("span",{className:"mr5"},"\u7B2C",Aa+1,"\u5173"),le.createElement(St.Z,{key:Aa,title:nr==null?void 0:nr.challenge_name},le.createElement("span",null,(0,nt.Pq)(nr==null?void 0:nr.challenge_name,44)))),sr&&le.createElement("div",null,"\u5206\u503C\uFF1A",nr.score,"\u5206"))),le.createElement(st.Link,{style:{float:"right"},target:"_blank",to:`/shixuns/${(io=Wn==null?void 0:Wn.shixun)==null?void 0:io.identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),le.createElement("div",{style:{clear:"both"}}))},Oa=Wn=>{let gr=Wn.questions_score/Wn.questions_count;Oe.default.confirm({icon:null,centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:le.createElement("div",{className:Ue.modalColumn},le.createElement("div",{className:Ue.modalRow,style:{justifyContent:"flex-start"}},le.createElement("sup",{className:Ue.sup},"*"),le.createElement("span",null,Wn==null?void 0:Wn.name,"\uFF1A"),le.createElement(at.Z,{min:0,precision:1,defaultValue:gr,onChange:_o=>{gr=_o}}),le.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Io(void 0,null,function*(){var _o;if(!gr)return Ct.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Promise.reject();const io={type:Wn==null?void 0:Wn.type,score:gr,scoreTotal:Number((_o=gr*Wn.questions_count)==null?void 0:_o.toFixed(1))};fr(io)})})},hs=()=>{let Wn="";Oe.default.confirm({icon:null,centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:le.createElement("div",{className:Ue.modalColumn},le.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20"},le.createElement("img",{style:{marginRight:5},src:Bn.Z}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),le.createElement("div",{className:Ue.modalRow,style:{marginTop:20}},le.createElement("sup",{className:Ue.sup},"*"),le.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),le.createElement(ot.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:Wn,onChange:gr=>{Wn=gr.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Io(void 0,null,function*(){var gr;if(!Wn)return Ct.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const _o=[],io=[],nr=[],Aa=[];(gr=gt==null?void 0:gt.questionList)==null||gr.forEach(Ua=>{var Pa;(Pa=Ua.questions)==null||Pa.forEach(Ks=>{let Ra=Ua.questions_score/Ua.questions_count;Ra=Ra&&Ra.toFixed(1),Ua.type==="COMBINATION"&&nr.push({id:Ks.id,sub_item_bank_ids:Ks.sub_item_banks.map(ql=>ql.id)}),Ua.type==="PRACTICAL"?Aa.push(Ks.id):(_o.push(Ks.id),io.push(Ra))})}),console.log("-----",nr),yield Ht({item_bank_ids:_o,item_bank_scores:io,name:Wn,combination_item_banks:nr,shixun_ids:Aa})})})},Os=(Wn,gr,_o,io)=>{var nr;const Aa=`${location.pathname}${location.search}`,ma=(nr=io.questions)==null?void 0:nr.map(Ua=>Ua==null?void 0:Ua.id);if(Aa.includes("exercise"))zr.current={id:Wn,ids:ma,type:gr,index:_o},La(!0);else{let Ua=Oe.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!0,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Io(void 0,null,function*(){Ua.update({cancelButtonProps:{disabled:!0}}),yield Un({single_question_id:Wn,seleted_item_bank_ids:ma},{type:gr,index:_o}),Ua.update({cancelButtonProps:{disabled:!1}}),Ct.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898")})})}},Rs=Wn=>{var gr;const _o=(gr=Wn.questions)==null?void 0:gr.map(Aa=>Aa==null?void 0:Aa.id),io=Wn.name;let nr=Oe.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:`\u786E\u8BA4\u66F4\u6362${io}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`,cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Io(void 0,null,function*(){nr.update({cancelButtonProps:{disabled:!0}}),yield Un({seleted_item_bank_ids:_o},{type:Wn.type}),nr.update({cancelButtonProps:{disabled:!1}}),Ct.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${io}\u8BD5\u9898`)})})},Nu=()=>{let Wn=Oe.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Io(void 0,null,function*(){Wn.update({cancelButtonProps:{disabled:!0}}),yield Un(),Wn.update({cancelButtonProps:{disabled:!1}}),Ct.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898")})})},Bl=Wn=>{console.log(Wn,"key"),pr(Wn-1)},Du=(Wn,gr)=>{var _o,io;if(gr==="SINGLE")return le.createElement(le.Fragment,null,le.createElement(oi,{ref:Qr,editData:Wn,isEdit:!0}),le.createElement(We.Z,null));if(gr==="MULTIPLE")return le.createElement(le.Fragment,null,le.createElement(ji,{ref:Qr,editData:Wn,isEdit:!0}),le.createElement(We.Z,null));if(gr==="JUDGMENT")return le.createElement(le.Fragment,null,le.createElement(Qt,{ref:Qr,editData:Wn,isEdit:!0}),le.createElement(We.Z,null));if(gr==="COMPLETION")return le.createElement(le.Fragment,null,le.createElement(Dt,{ref:Qr,editData:Wn,isEdit:!0}),le.createElement(We.Z,null));if(gr==="SUBJECTIVE")return le.createElement(le.Fragment,null,le.createElement(ci,{ref:Qr,editData:Wn,isEdit:!0}),le.createElement(We.Z,null));if(gr==="COMBINATION")return le.createElement(le.Fragment,null,le.createElement(ea,{ref:Qr,editData:Wn,isEdit:!0}),le.createElement(We.Z,null));if(gr==="BPROGRAM")return le.createElement(le.Fragment,null,le.createElement(pt.default,{form:bs,style:{marginTop:20},onFinishFailed:nr=>{var Aa,ma;nr.errorFields[0].name.includes("standard_answers")?Ct.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):Ct.ZP.error(nr.errorFields[0].errors[0]),bs.scrollToField((ma=(Aa=nr==null?void 0:nr.errorFields)==null?void 0:Aa[0])==null?void 0:ma.name,{behavior:"smooth",block:"center"})},onFinish:nr=>Io(void 0,null,function*(){var Aa;let ma=Xo(sa({question_score:Wn.score},nr),{question_type:8,hack:Xo(sa({},nr.hack),{difficult:Wn.program_attr.difficult}),hack_codes:Xo(sa({},nr.hack_codes),{code:mo.Base64.encode((Aa=nr.hack_codes)==null?void 0:Aa.code)})});ka&&(ma.is_cover=1);const Ua=yield(0,Ye.ZP)(`/api/exercise_questions/${Wn.id}.json`,{method:"put",body:ma});(Ua==null?void 0:Ua.status)===0&&(Ct.ZP.success("\u7F16\u8F91\u6210\u529F"),Bl(Ui+1)),Ir(null)})},le.createElement(Sa.tc,{form:bs,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,hackidentifier:(_o=Wn==null?void 0:Wn.program_attr)==null?void 0:_o.identifier,answerKey:"standard_answers"}),le.createElement(We.Z,null)));if(gr==="PROGRAM"&&st.history.push(`/problems/${(io=Wn==null?void 0:Wn.program_attr)==null?void 0:io.identifier}/edit?type=exercises&express_id=${eo.categoryId}&question_id=${Wn==null?void 0:Wn.id}&score=${Wn==null?void 0:Wn.score}&callback_url=${location.pathname}&select=${Ui}&exercise=true`),gr==="PRACTICAL")return le.createElement(le.Fragment,null,le.createElement(bi,{ref:Qr,editData:Wn,isEdit:!0}),le.createElement(We.Z,null))},zl=(Wn,gr)=>Io(void 0,null,function*(){var _o,io,nr,Aa,ma,Ua;const Pa=yield(_o=Qr.current)==null?void 0:_o.onSave();if(!Pa)return;const Ks=Oo=>{const Zl=Oo.map(Ds=>Ds.choice_text.trim().replace(/^\s+|\s+$/g,""));return new Set(Zl).size!==Zl.length},Ra={question_score:gr.score,analysis:Pa.analysis};if(Wn==="SINGLE"||Wn==="MULTIPLE"||Wn==="JUDGMENT"){if(Wn!=="JUDGMENT"&&Ks(Pa==null?void 0:Pa.choices)){Ct.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}const Oo=[],Zl=[];Ra.question_type=Wn==="JUDGMENT"?2:1,Ra.question_title=Pa==null?void 0:Pa.name,(io=Pa==null?void 0:Pa.choices)==null||io.forEach((sl,Ds)=>{Oo.push(sl.choice_text),sl!=null&&sl.is_answer&&Zl.push(Ds+1)}),Ra.question_choices=Oo,Ra.standard_answers=Zl}if(Wn==="COMPLETION"){let Oo=(nr=Pa==null?void 0:Pa.standard_answers)==null?void 0:nr.map((Ds,Su)=>(Ds==null?void 0:Ds.score)<=0?Su+1:null).filter(Ds=>Ds!==null);if((Oo==null?void 0:Oo.length)>0)return Ct.ZP.warning(`\u7B2C${Oo.join("\u3001")}\u9879\u7684\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A`),!1;let Zl=(Aa=Pa==null?void 0:Pa.standard_answers)==null?void 0:Aa.reduce((Ds,Su)=>Ds+(Number(Su==null?void 0:Su.score)||0),0);if(parseFloat(Zl.toFixed(2))!=(Ra==null?void 0:Ra.question_score))return Ct.ZP.warning("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01"),!1;Ra.is_ordered=Pa.is_ordered,Ra.question_title=Pa==null?void 0:Pa.name,Ra.use_blank_score=Pa==null?void 0:Pa.use_blank_score,Ra.question_type=3;const sl=[];(ma=Pa==null?void 0:Pa.standard_answers)==null||ma.forEach((Ds,Su)=>{sl.push({choice_id:Ds.position,answer_text:Ds.answer_text,score:Ds.score})}),Ra.standard_answers=sl,Ra.downcase=Pa==null?void 0:Pa.downcase,Ra.no_space=Pa==null?void 0:Pa.no_space}if(Wn==="SUBJECTIVE"&&(console.log("editorData"),console.log(Pa),Ra.question_title=Pa==null?void 0:Pa.name,Ra.question_type=4,Ra.answer_texts=Pa==null?void 0:Pa.answer_texts,Ra.use_keywords=Pa==null?void 0:Pa.use_keywords,Ra.keywords=Pa==null?void 0:Pa.keywords),Wn==="COMBINATION"){Ra.question_title=Pa==null?void 0:Pa.name,Ra.question_type=7;try{Ra.sub_questions=(Ua=Pa==null?void 0:Pa.sub_item_banks)==null?void 0:Ua.map((Oo,Zl)=>{var sl,Ds,Su;if((Oo==null?void 0:Oo.item_type)=="single"||(Oo==null?void 0:Oo.item_type)=="multiple"){if(Ks(Oo==null?void 0:Oo.choices))throw new Error(`\u7B2C${Zl+1}\u5C0F\u9898\u9009\u9879\u5185\u5BB9\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58`);const Cs=[],Ts=[];return(sl=Oo==null?void 0:Oo.choices)==null||sl.forEach((Ml,Js)=>{Cs.push(Ml.choice_text),Ml!=null&&Ml.is_answer&&Ts.push(Js+1)}),{id:Oo.id,question_id:Oo.id,question_title:Oo.name,difficulty:Oo.difficulty,question_type:(Oo==null?void 0:Oo.item_type)=="single"?0:(Oo==null?void 0:Oo.item_type)=="multiple"?1:2,question_choices:Cs,standard_answers:Ts,analysis:Oo.analysis,question_score:Oo==null?void 0:Oo.score}}else if((Oo==null?void 0:Oo.item_type)=="completion"){let Cs=(Ds=Oo==null?void 0:Oo.standard_answer)==null?void 0:Ds.reduce((Ml,Js)=>Ml+(Number(Js==null?void 0:Js.score)||0),0);if(parseFloat(Cs.toFixed(2))!=(Oo==null?void 0:Oo.score))throw new Error("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01");const Ts=[];return(Su=Oo==null?void 0:Oo.standard_answer)==null||Su.forEach((Ml,Js)=>{Ts.push({choice_id:Ml.position,answer_text:Ml.answer_text,score:Ml.score})}),{id:Oo.id,question_id:Oo.id,is_ordered:Oo.is_ordered,question_title:Oo.name,difficulty:Oo.difficulty,question_type:3,standard_answers:Ts,use_blank_score:Oo.use_blank_score,analysis:Oo.analysis,downcase:Oo==null?void 0:Oo.downcase,no_space:Oo==null?void 0:Oo.no_space,question_score:Oo==null?void 0:Oo.score}}else if((Oo==null?void 0:Oo.item_type)=="subjective")return{id:Oo.id,question_id:Oo.id,question_title:Oo.name,question_type:4,difficulty:Oo.difficulty,answer_texts:Oo==null?void 0:Oo.answer_texts,analysis:Oo.analysis,question_score:Oo==null?void 0:Oo.score,use_keywords:Oo.use_keywords,keywords:Oo==null?void 0:Oo.keywords}})}catch(Oo){Ct.ZP.warning(Oo.message);return}delete Ra.analysis}let ql=!1;(gr==null?void 0:gr.is_my)===1&&(ql=yield new Promise((Zl,sl)=>{Oe.default.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:()=>{Zl(!0)},onCancel:()=>{Zl(!1)}})})),ql&&(Ra.is_cover=1);const Xa=Wn!=="PRACTICAL"?yield(0,Ye.ZP)(`/api/exercise_questions/${gr.id}.json`,{method:"put",body:Ra}):yield(0,Ye.ZP)(`/api/exercise_questions/${gr.id}/update_shixun_score.json`,{method:"post",body:sa({},Pa)});(Xa==null?void 0:Xa.status)===0&&(Ct.ZP.success("\u7F16\u8F91\u6210\u529F"),Bl(Ui+1),Ir(null))}),uu=()=>Io(void 0,null,function*(){(0,st.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u66F4\u65B0\u8BD5\u5377\uFF0C\u8BF7\u7A0D\u540E..."}}),(yield(0,Ye.ZP)(`/api/exercises/${eo.categoryId}/sync_random_question.json`,{method:"post"})).status===0&&(yield pr(Ui),Ct.ZP.success("\u66F4\u65B0\u6210\u529F")),(0,st.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}})}),of=({value:Wn}={})=>{var gr;const _o=[];let io=[];const nr=(gr=Wn==null?void 0:Wn.choices)==null?void 0:gr.map((ma,Ua)=>{var Pa;const Ks=Ua+1;return ma!=null&&ma.is_answer&&(_o.push(Ks),io.push(Ks)),{value:Ks,label:le.createElement(Ze.Z,{className:"c-black font14",value:`${(Pa=oa.k4)==null?void 0:Pa[Ua]}. ${ma==null?void 0:ma.choice_text}`}),disabled:ma==null?void 0:ma.origin_standard_answer}}),Aa=Oe.default.confirm({centered:!0,icon:null,title:"\u589E\u8BBE\u6B63\u786E\u7B54\u6848",width:800,content:le.createElement(le.Fragment,null,"\u5F53\u524D\u8BD5\u9898\u7684\u6B63\u786E\u7B54\u6848\u4E3A ",_o==null?void 0:_o.map(ma=>{var Ua;return(Ua=oa.k4)==null?void 0:Ua[ma-1]}),"\uFF0C\u8BF7\u9009\u62E9\u9700\u8981\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u7684\u9009\u9879\u3002",le.createElement("br",null),"\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u9009\u4E2D\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u4EFB\u4E00\u9009\u9879\u7684\u5B66\u751F\u4E5F\u4F1A\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\uFF0C\u4F46\u4E0D\u4F1A\u4FEE\u6539\u5F53\u524D\u8BD5\u9898\u7684\u9898\u578B\u3002\u53D6\u6D88\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u4E5F\u4F1A\u91CD\u65B0\u8BA1\u7B97\u5BF9\u5E94\u5B66\u751F\u7684\u5F97\u5206\u3002",le.createElement("br",null),le.createElement(Tt.default.Group,{className:"flex-col mt20",options:nr,defaultValue:io,onChange:ma=>{io=ma}})),onOk:()=>Io(void 0,null,function*(){const ma=yield(0,Ye.ZP)(`/api/exercises/${eo.categoryId}/questions/${Wn==null?void 0:Wn.id}/add_standard_answers.json`,{method:"put",body:{standard_answer:io}});(ma==null?void 0:ma.status)===0&&(Ct.ZP.success("\u4FEE\u6539\u6210\u529F"),Bl(Ui+1))})})},af=(Zr=gt==null?void 0:gt.questionList)==null?void 0:Zr.reduce((Wn,gr)=>Wn+Number(gr.questions_score),0),mc=sr&&((Er=gt==null?void 0:gt.exam)==null?void 0:Er.exercise_status)!==1,sf=(Wn,gr)=>Io(void 0,null,function*(){Ha(!0);const _o=yield(0,Ye.ZP)(`/api/courses/${eo==null?void 0:eo.coursesId}/sync_shixuns.json`,{method:"post",body:{exercise_ids:[eo==null?void 0:eo.categoryId],exercise_question_id:Wn.id}});(_o==null?void 0:_o.status)===0&&(Ct.ZP.info("\u5B9E\u8BAD\u540C\u6B65\u4E2D\uFF0C\u8BF7\u7A0D\u540E"),rs[gr]=!1,Ol([...rs])),Ha(!1)}),Es=(Wn,gr)=>Io(void 0,null,function*(){let _o=yield(0,Ye.ZP)(`/api/courses/${eo==null?void 0:eo.coursesId}/ignore_prompt.json`,{method:"post",body:{container_type:"Exercise",container_id:eo==null?void 0:eo.categoryId,exercise_question_id:Wn==null?void 0:Wn.id}});(_o==null?void 0:_o.status)===0&&(rs[gr]=!1,Ol([...rs]))});return le.createElement("section",{className:Ue.wrap},le.createElement("div",{id:"id_left_preview",className:Ue.left,onMouseEnter:Wn=>{const gr=document.getElementById("id_left_preview");gr.style.overflowY="auto"},onMouseLeave:Wn=>{const gr=document.getElementById("id_left_preview");gr.style.overflowY="hidden"}},le.createElement("div",{className:Ue.title},le.createElement("div",{className:"body-overflow-initial"},le.createElement("b",null),le.createElement("span",null,"\u7B54\u9898\u5361"))),le.createElement("div",{className:Ue.total},le.createElement("div",null,le.createElement("img",{src:vn}),le.createElement("span",null,"\u9898\u6570(\u9053)"),le.createElement("aside",null,gt==null?void 0:gt.all_questions_count)),le.createElement("div",{className:"mr30 ml30"},le.createElement("img",{src:En}),le.createElement("span",null,"\u603B\u5206(\u5206)"),le.createElement("aside",null,af&&af.toFixed(1))),le.createElement("div",null,le.createElement("img",{src:_e}),le.createElement("span",null,"\u65F6\u957F(\u5206)"),le.createElement("aside",null,((Eo=gt==null?void 0:gt.exam)==null?void 0:Eo.time)===-1||((Wi=gt==null?void 0:gt.exam)==null?void 0:Wi.time)===null?"\u4E0D\u9650":(Si=gt==null?void 0:gt.exam)==null?void 0:Si.time))),(Pi=gt==null?void 0:gt.questionList)==null?void 0:Pi.map((Wn,gr)=>{var _o;return le.createElement("div",{className:Ue.list,key:gr},le.createElement("div",{className:Ue.name},le.createElement("b",null),le.createElement("span",null,Wn.name)),le.createElement("aside",null,le.createElement("div",null,"\u5171",le.createElement("span",{className:Ue.b},Wn.questions_count),"\u9898 ",le.createElement("span",{className:Ue.l},"|"),"\u5171",le.createElement("span",{className:Ue.r},Wn.questions_score),"\u5206"),le.createElement("div",{className:Ue.answerSheet},(_o=Wn==null?void 0:Wn.questions)==null?void 0:_o.map((io,nr)=>le.createElement("div",{onClick:()=>{const Aa=`Anchor_${io==null?void 0:io.id}`;let ma=document.getElementById(Aa);ma&&setTimeout(()=>ma.scrollIntoView({block:"center",behavior:"smooth"}))},key:io==null?void 0:io.id,className:Ue.tag},nr+1)))))})),le.createElement("div",{className:Ue.right},le.createElement("div",{className:Ue.examName,id:"examName"},le.createElement("div",{className:Ue.name},le.createElement(St.Z,{title:(Jr=gt==null?void 0:gt.exam)==null?void 0:Jr.name,getPopupContainer:Wn=>Wn.parentNode},le.createElement("span",{className:Ue.t},(Ur=gt==null?void 0:gt.exam)==null?void 0:Ur.name))),sr&&((Nr=gt==null?void 0:gt.exam)==null?void 0:Nr.exercise_status)===1&&le.createElement(Zt.op,{openLoading:!0,shape:"default",onClick:()=>{Oe.default.confirm({title:"\u63D0\u793A",content:"\u786E\u8BA4\u6839\u636E\u6700\u65B0\u7684\u968F\u673A\u7EC4\u5377\u62BD\u9898\u89C4\u5219\u91CD\u65B0\u751F\u6210\u8BD5\u5377\u5417\uFF1F",onOk:()=>{uu()}})},type:"primary"},"\u66F4\u65B0\u8BD5\u5377"),!sr&&le.createElement(yt.ZP,{onClick:Nu,type:"primary"},"\u968F\u673A\u66F4\u6362")),le.createElement("div",{className:Ue.topWarp},(Lo=gt==null?void 0:gt.questionList)==null?void 0:Lo.map((Wn,gr)=>{var _o,io;return le.createElement(le.Fragment,{key:gr},le.createElement("div",{className:Ue.head,style:gr===0?{border:0,marginTop:-16}:{}},le.createElement("div",{className:Ue.name},le.createElement("b",null),le.createElement("span",null,Wn.name)),le.createElement("div",{className:Ue.so},"\u5171",le.createElement("span",{className:Ue.b},Wn.questions_count," "),"\u9898 ",Wn.type==="COMBINATION"&&`\uFF08\u5305\u542B${(_o=Wn==null?void 0:Wn.questions)==null?void 0:_o.map(nr=>{var Aa;return(Aa=nr==null?void 0:nr.sub_item_banks)==null?void 0:Aa.length}).reduce((nr,Aa)=>nr+Aa)}\u5C0F\u9898\uFF09`,le.createElement("span",{className:Ue.l},"|"),"\u5171",le.createElement("span",{className:Ue.r},Wn.questions_score),"\u5206"),!sr&&le.createElement("div",{className:Ue.btn},le.createElement(yt.ZP,{onClick:()=>{Oa(Wn)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),le.createElement(yt.ZP,{onClick:()=>Rs(Wn),type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),(io=Wn==null?void 0:Wn.questions)==null?void 0:io.map((nr,Aa)=>{var ma,Ua,Pa,Ks,Ra;return tr===(nr==null?void 0:nr.id)?le.createElement("div",{id:`Anchor_${nr==null?void 0:nr.id}`,className:Ue.content,style:{padding:0,marginTop:24},key:nr==null?void 0:nr.id},le.createElement("div",{style:{float:"right",marginTop:`${(Wn==null?void 0:Wn.type)==="PRACTICAL"?"-2px":"-6px"}`}},le.createElement(yt.ZP,{onClick:()=>Ir(null),className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),le.createElement(yt.ZP,{onClick:()=>{zl(Wn==null?void 0:Wn.type,nr)},type:"primary"},"\u4FDD\u5B58")),Du(nr,Wn.type)):le.createElement("div",{id:`Anchor_${nr==null?void 0:nr.id}`,className:Ue.content,key:nr==null?void 0:nr.id},le.createElement("div",{className:Ue.titleWrap},(nr==null?void 0:nr.item_type)==="bprogram"?le.createElement(Ze.Z,{style:{paddingRight:10},value:Aa+1+"\u3001"+((ma=nr==null?void 0:nr.program_attr)==null?void 0:ma.description)}):le.createElement(Ze.Z,{style:{paddingRight:10},className:Ue.titleHtml,value:Aa+1+`\u3001${(nr==null?void 0:nr.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":""}`+(nr==null?void 0:nr.name)}),(0,la.G5)()&&((Ua=nr==null?void 0:nr.shixun)==null?void 0:Ua.shixun_change)&&le.createElement(dt.Z,{trigger:"click",open:rs[Aa],onOpenChange:ql=>{rs[Aa]=!0,Ol([...rs])},placement:"bottomLeft",autoAdjustOverflow:!1,title:null,content:le.createElement("div",{style:{width:"310px",color:"#000"}},le.createElement("div",null,"\u5B9E\u8BAD\u7BA1\u7406\u5458\u5BF9\u8BD5\u5377\u4E2D\u4F7F\u7528\u7684\u5B9E\u8DF5\u9879\u76EE\u8FDB\u884C\u4E86\u4FEE\u6539\uFF0C\u8BF7\u68C0\u67E5\u540E\uFF0C\u786E\u8BA4\u662F\u5426\u9700\u8981\u540C\u6B65\u5230\u8BD5\u5377\u4E2D"),le.createElement("div",{className:Ue.btn_warp},le.createElement(yt.ZP,{size:"small",onClick:()=>Es(nr,Aa)},"\u5FFD\u7565"),le.createElement(yt.ZP,{loading:ts,className:"ml20",size:"small",type:"primary",onClick:()=>sf(nr,Aa)},"\u786E\u8BA4\u540C\u6B65"),le.createElement(yt.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>(0,nt.xg)(`/shixuns/${nr==null?void 0:nr.forked_shixun_identifier}/challenges?exercise=true`)},"\u524D\u5F80\u67E5\u770B")))},le.createElement("i",{className:"iconfont icon-tongzhi1 pl10 current",style:{fontSize:"16px",color:"#F7B500"},onClick:ql=>ql.stopPropagation()})),sr&&le.createElement(yt.ZP,{onClick:()=>{var ql,Xa,Oo;if(tr){Ct.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}bs.setFieldsValue({standard_answers:nr==null?void 0:nr.standard_answer,hack:sa(sa({},nr),nr==null?void 0:nr.program_attr),hack_codes:Xo(sa({},nr==null?void 0:nr.program_attr),{code:mo.Base64.decode(((ql=nr==null?void 0:nr.program_attr)==null?void 0:ql.code)||"")}),hack_sets:sa({},(Xa=nr==null?void 0:nr.hack_sets)==null?void 0:Xa[0])}),(nr==null?void 0:nr.item_type)=="program"?st.history.push(`/problems/newedit/${(Oo=nr==null?void 0:nr.program_attr)==null?void 0:Oo.identifier}?type=exercises&express_id=${eo.categoryId}&question_id=${nr==null?void 0:nr.id}&score=${nr==null?void 0:nr.score}&exercise=true&callback_url=/classrooms/${eo.coursesId}/exercise/${eo.categoryId}/detail?random=true`):Ir(nr==null?void 0:nr.id)},type:"primary",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),!mc&&le.createElement(yt.ZP,{disabled:mc,className:"ml20",onClick:()=>Os(nr==null?void 0:nr.id,Wn.type,Aa,Wn),type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(nr==null?void 0:nr.item_type)==="bprogram"&&le.createElement(Ze.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:Ue.titleHtml,value:mo.Base64.decode(((Pa=nr==null?void 0:nr.program_attr)==null?void 0:Pa.code)||"")}),(Wn.type==="SINGLE"||Wn.type==="JUDGMENT"||Wn.type==="MULTIPLE")&&Da(nr),Wn.type==="COMPLETION"&&al(nr),Wn.type==="SUBJECTIVE"&&nl(nr),Wn.type==="PROGRAM"&&oh(nr),Wn.type==="BPROGRAM"&&jl(nr),Wn.type==="COMBINATION"&&dl(nr,Aa),Wn.type==="PRACTICAL"&&pa(nr),le.createElement(kt.Z,{className:"mt20",wrap:!1,align:"middle",gutter:20},((Ks=gt==null?void 0:gt.exam)==null?void 0:Ks.exercise_status)===3&&!["PROGRAM","BPROGRAM","PRACTICAL","COMBINATION"].includes(Wn.type)&&le.createElement(De.Z,null,le.createElement(_r.Z,{state:nr==null?void 0:nr.is_wrong,onClick:()=>{kr==null||kr({value:Xo(sa({},nr),{question_id:nr==null?void 0:nr.id,question_score:nr==null?void 0:nr.score})})}})),["PROGRAM","BPROGRAM","PRACTICAL"].includes(Wn.type)&&(nr==null?void 0:nr.show_resubmit)&&le.createElement(De.Z,null,le.createElement(ar.C,{dataSource:Xo(sa({},nr),{question_id:nr==null?void 0:nr.id})})),((Ra=gt==null?void 0:gt.exam)==null?void 0:Ra.exercise_status)===3&&["SINGLE"].includes(Wn.type)&&le.createElement(De.Z,null,le.createElement(yt.ZP,{style:{color:"#3061D0"},onClick:()=>{of({value:nr})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848"))))}))}))),sr?le.createElement(Zt.vr,null,le.createElement(ne.Z,{showTotal:nt.rU,total:(yr=gt==null?void 0:gt.exam)==null?void 0:yr.total_num,pageSize:1,current:Ui+1,showSizeChanger:!1,onChange:Bl,showQuickJumper:!1,hideOnSinglePage:!1})):le.createElement(Zt.vr,{LeftContent:le.createElement(Zt.op,{onClick:Re,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u8FD4\u56DE"),RightContent:le.createElement(kt.Z,{align:"middle"},le.createElement(dt.Z,{color:"#55575D",overlayClassName:Ue.popover,open:uo,getPopupContainer:Wn=>Wn==null?void 0:Wn.parentNode,content:"\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377"},le.createElement(Zt.op,{onMouseEnter:()=>Zo(!0),onMouseLeave:()=>Zo(!1),onClick:()=>hs(),shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u4FDD\u5B58")),le.createElement(Zt.op,{shape:"default",type:"primary",onClick:()=>Ht(),style:{height:38,marginLeft:20}},"\u63D0\u4EA4"))}),le.createElement(Ca,{visible:ha,questionParams:zr.current,getdata:Lr,onRandomExchange:()=>Io(void 0,null,function*(){const Wn=zr.current;yield Un({single_question_id:Wn.id,seleted_item_bank_ids:Wn.ids},{type:Wn.type,index:Wn.index}),La(!1)}),selectFromProblemSet:()=>{const Wn=zr.current,gr=`${location.pathname}${location.search}`;gr.includes("exercise")&&st.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${Wn.id}&qtype=${Wn.type}&exerciseid=${eo.categoryId}&from=${gr}`)},onCancel:()=>{La(!1)}}))}},12624:function(Zn,ei,Le){"use strict";Le.r(ei),Le.d(ei,{default:function(){return is}});var le=Le(59301),Ue={wrapper:"wrapper___KtBVT",breadCrumbWrapper:"breadCrumbWrapper___k9tSB",baseInfo:"baseInfo____j5EY",radioBtnWrapper:"radioBtnWrapper___k9OCh",baseLineHeight:"baseLineHeight___O_QXK",radiogroup:"radiogroup___e2fW6",easy:"easy___WcUAp",medium:"medium___U_o3j",hard:"hard___dAXLS",formWrap:"formWrap___wt5tC",baseFormItem:"baseFormItem___zV64d",cascaderPopup:"cascaderPopup___qm63f",fixedBottom:"fixedBottom___liDZ4",cancelBtn:"cancelBtn___ZV9Mi",confirmBtn:"confirmBtn___DwH6m",previewBtn:"previewBtn___aLYCy",concat:"concat___ZuLMo"},pt=Le(6767),St=Le(28284),yt=Le(91882),Oe=Le(25690),at=Le(81868),Ct=Le(29787),ot=Le(37568),We=Le(17149),Tt=Le(47889),dt=Le(77019),kt=Le(71051),De=Le(99571),ne=Le(38986),te=Object.defineProperty,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,ye=(Ut,Zt,bn)=>Zt in Ut?te(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,we=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))se.call(Zt,bn)&&ye(Ut,bn,Zt[bn]);if(de)for(var bn of de(Zt))pe.call(Zt,bn)&&ye(Ut,bn,Zt[bn]);return Ut},Ce=(Ut,Zt,bn)=>new Promise((zi,Ei)=>{var Mi=ti=>{try{Fn(bn.next(ti))}catch(dr){Ei(dr)}},wi=ti=>{try{Fn(bn.throw(ti))}catch(dr){Ei(dr)}},Fn=ti=>ti.done?zi(ti.value):Promise.resolve(ti.value).then(Mi,wi);Fn((bn=bn.apply(Ut,Zt)).next())});function _e(Ut){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Ut}/edit_random_exam_new.json`,{method:"get"})})}function Ze(Ut,Zt){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Ut}/update_random_exam.json`,{method:"post",body:Zt})})}function st(Ut){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/create_random_exam.json",{method:"post",body:Ut})})}function nt(Ut){return Ce(this,null,function*(){return(0,ne.ZP)("/api/disciplines.json",{method:"get",params:Ut})})}function Ye(Ut){return Ce(this,null,function*(){return(0,ne.ZP)("/api/item_banks/item_difficulty_count.json",{method:"get",params:Ut})})}function ct(Ut,Zt){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Ut}/set_item_type_score.json`,{method:"post",body:Zt})})}function $e(Ut,Zt){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${Ut}/set_item_type_score.json`,{method:"post",body:Zt})})}function Et(Ut,Zt){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Ut}/delete_item_type.json`,{method:"post",body:Zt})})}function Pt(Ut,Zt){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${Ut}/delete_item_type.json`,{method:"post",body:Zt})})}function Bt(Ut){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/preview_random_questions.json",{method:"post",body:Ut})})}function fn(Ut){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:Ut})})}function qt(Ut){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/save_question_list.json",{method:"post",body:Ut})})}function vn(Ut){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${Ut.categoryId}/edit.json`,{method:"get",params:we({},Ut)})})}var tn=(Ut=>(Ut.OnlyFileFolder="1",Ut.OnlyKnowledge="2",Ut.OnlyDifficulty="3",Ut.FileFolderAndDiff="4",Ut.FileFolderAndKnowledge="5",Ut.KnowledgeAndDiff="6",Ut.All="7",Ut.Shixun="8",Ut))(tn||{}),it=Le(89392),rt=Object.defineProperty,dn=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,Kn=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Bn=(Ut,Zt,bn)=>Zt in Ut?rt(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,ui=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))Rt.call(Zt,bn)&&Bn(Ut,bn,Zt[bn]);if(Kn)for(var bn of Kn(Zt))En.call(Zt,bn)&&Bn(Ut,bn,Zt[bn]);return Ut},It=(Ut,Zt)=>dn(Ut,ni(Zt)),On=(Ut=>(Ut[Ut.FileFolder=1]="FileFolder",Ut[Ut.Difficulty=2]="Difficulty",Ut[Ut.Knowledge=3]="Knowledge",Ut))(On||{});const ht=(0,le.createContext)(null),kn={[tn.OnlyFileFolder]:[1],[tn.OnlyKnowledge]:[3],[tn.OnlyDifficulty]:[2],[tn.FileFolderAndDiff]:[1,2],[tn.FileFolderAndKnowledge]:[1,3],[tn.KnowledgeAndDiff]:[3,2],[tn.All]:[3,2,1]},Oi=(Ut,Zt)=>{if(Ut.length!==Zt.length)return!1;for(const bn of Zt)if(!Ut.includes(bn))return!1;return!0},ze=Ut=>{for(const[Zt,bn]of Object.entries(kn))if(Oi(Ut,bn))return Zt},Me={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",COMPLETION:"\u586B\u7A7A\u9898",JUDGMENT:"\u5224\u65AD\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",BPROGRAM:"\u7A0B\u5E8F\u586B\u7A7A\u9898",COMBINATION:"\u7EC4\u5408\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898"},Ee={1:{label:"\u7B80\u5355",color:"#46B70E"},2:{label:"\u9002\u4E2D",color:"#165DFF"},3:{label:"\u56F0\u96BE",color:"#EE6F1A"}},Te=Ut=>Ut&&parseFloat(Ut.toFixed(1)),He=(Ut,Zt)=>{var bn,zi,Ei;switch(Zt.type){case"init":return Zt.payload;case"updateBaseInfo":return It(ui({},Ut),{examination_bank:Zt.payload});case"deleteQuestionType":{const{item_types:Mi}=Ut,wi=Mi.filter(Fn=>Fn.item_type!==Zt.payload);return Ut.examination_bank.question_count=Te(wi.reduce((Fn,ti)=>Fn+ti.item_bank_count,0)),Ut.examination_bank.total_score=Te(wi.reduce((Fn,ti)=>Fn+ti.total_score,0)),It(ui({},Ut),{item_types:wi})}case"setQuestionType":{const{item_types:Mi=[]}=Ut,wi=Mi.map(ti=>ti.item_type),Fn=Mi.filter(ti=>Zt.payload.includes(ti.item_type));for(const ti of Zt.payload)wi.includes(ti)||(ti==="PRACTICAL"?Fn.push({item_type:ti,contents:[],item_banks:[],item_bank_count:0,item_bank_num:0,item_type_text:Me[ti],random_rule_type:tn.Shixun,score:0,total_score:0}):Fn.push({item_type:ti,contents:[],item_bank_count:0,item_type_text:Me[ti],score:0,total_score:0}));return It(ui({},Ut),{item_types:Fn})}case"updateItemTypes":return It(ui({},Ut),{item_types:Zt.payload});case"deleteRule":{const Mi=(0,it.cloneDeep)(Ut),wi=Mi.item_types.find(ti=>ti.item_type===Zt.payload.itemType),Fn=wi.contents.find(ti=>ti.id===Zt.payload.id&&ti.is_share==Zt.payload.is_share);return wi.contents=wi.contents.filter(ti=>ti!==Fn),((bn=wi.contents)==null?void 0:bn.length)===0&&(wi.random_rule_type=[]),wi.item_bank_count-=Fn==null?void 0:Fn.quanlity,Mi.examination_bank.question_count-=Fn==null?void 0:Fn.quanlity,wi.total_score-=(Fn==null?void 0:Fn.quanlity)*wi.score,Mi.examination_bank.total_score-=(Fn==null?void 0:Fn.quanlity)*wi.score,wi.total_score=Te(wi.total_score),Mi.examination_bank.total_score=Te(Mi.examination_bank.total_score),Mi.contents=wi.contents,Mi}case"changeQuestionNum":{const Mi=(0,it.cloneDeep)(Ut),wi=Mi.item_types.find(Vo=>Vo.item_type===Zt.payload.itemType),Fn=(zi=wi==null?void 0:wi.contents)==null?void 0:zi.find(Vo=>Vo.id===Zt.payload.id);if(Zt.payload.itemType==="PRACTICAL")return Zt.payload.num&&(Mi.examination_bank.question_count=Mi.examination_bank.question_count-wi.item_bank_count+Zt.payload.num,Mi.examination_bank.total_score=Te(Mi.examination_bank.total_score-wi.total_score+Zt.payload.num*wi.score)),Zt.payload.score&&(Mi.examination_bank.total_score=Te(Mi.examination_bank.total_score-wi.total_score+Zt.payload.num*wi.score)),wi.item_bank_count=Zt.payload.num,wi.total_score=Te(wi.item_bank_count*wi.score),Mi;Mi.examination_bank.question_count=Mi.examination_bank.question_count-(Fn==null?void 0:Fn.quanlity)+Zt.payload.num;const ti=wi.contents.find(Vo=>Vo.id===Zt.payload.id&&Vo.teacher_group_id===Zt.payload.teacher_group_id);ti.quanlity=Zt.payload.num;let dr=0,Tr=0;for(const Vo of wi.contents)dr+=Vo==null?void 0:Vo.quanlity,Tr+=(Vo==null?void 0:Vo.quanlity)*wi.score;return Mi.examination_bank.total_score=Te(Mi.examination_bank.total_score-wi.total_score+Tr),wi.item_bank_count=dr,wi.total_score=Te(Tr),Mi}case"changeQuestionScore":{const Mi=(0,it.cloneDeep)(Ut),wi=Mi.item_types.find(Fn=>Fn.item_type===Zt.payload.itemType);return wi.score=Zt.payload.score,wi.total_score=Te(wi.item_bank_count*wi.score),Mi.examination_bank.total_score=Te(Mi.item_types.reduce((Fn,ti)=>Fn+ti.total_score,0)),Mi}case"editRule":{const Mi=(0,it.cloneDeep)(Ut),wi=Mi.item_types.find(Fn=>Fn.item_type===Zt.payload.itemType);return wi.contents=Zt.payload.tableData.map(Fn=>It(ui({},Fn),{item_type:Zt.payload.itemType,random_rule_type:Zt.payload.randomRuleType})),wi.random_rule_type=Zt.payload.randomRuleType,wi.item_bank_count=wi.contents.reduce((Fn,ti)=>Fn+(ti==null?void 0:ti.quanlity),0),wi.score=wi.score||1,wi.total_score=Te(wi.item_bank_count*wi.score),Mi.examination_bank.question_count=Mi.item_types.reduce((Fn,ti)=>Fn+ti.item_bank_count,0),Mi.examination_bank.total_score=Te(Mi.item_types.reduce((Fn,ti)=>Fn+ti.total_score,0)),Mi}case"addShixun":{const Mi=(0,it.cloneDeep)(Ut),wi=Mi.item_types.find(Fn=>Fn.item_type==="PRACTICAL");return wi.item_banks=Zt.payload.shixunList,Mi.examination_bank.question_count=Mi.examination_bank.question_count+1,wi.item_bank_num=wi.item_banks.length,wi.item_bank_count=wi.item_bank_count||1,wi.score=wi.score||1,wi.total_score=wi.total_score||wi.score*wi.item_bank_count,Mi.examination_bank.total_score=(Ei=Mi==null?void 0:Mi.item_types)==null?void 0:Ei.map(Fn=>Fn.total_score).reduce((Fn,ti)=>Fn+ti),Mi}case"deleteShixunQuestion":{const Mi=(0,it.cloneDeep)(Ut),wi=Mi.item_types.find(Fn=>Fn.item_type==="PRACTICAL");return wi.item_banks=wi.item_banks.filter(Fn=>Fn.id!==Zt.payload.shixunId),wi.item_bank_num-=1,wi.item_bank_count>wi.item_bank_num&&(wi.item_bank_count-=1,wi.total_score-=wi.score,wi.total_score=Te(wi.total_score)),Mi}}};var Ae=Le(52154),et=Object.defineProperty,on=Object.defineProperties,Kt=Object.getOwnPropertyDescriptors,pn=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Ot=(Ut,Zt,bn)=>Zt in Ut?et(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,un=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))Nt.call(Zt,bn)&&Ot(Ut,bn,Zt[bn]);if(pn)for(var bn of pn(Zt))Dt.call(Zt,bn)&&Ot(Ut,bn,Zt[bn]);return Ut},Sn=(Ut,Zt)=>on(Ut,Kt(Zt)),An=(Ut,Zt,bn)=>new Promise((zi,Ei)=>{var Mi=ti=>{try{Fn(bn.next(ti))}catch(dr){Ei(dr)}},wi=ti=>{try{Fn(bn.throw(ti))}catch(dr){Ei(dr)}},Fn=ti=>ti.done?zi(ti.value):Promise.resolve(ti.value).then(Mi,wi);Fn((bn=bn.apply(Ut,Zt)).next())}),Ai=({courseOptions:Ut,setCurrentKey:Zt,loading:bn,form:zi})=>{const{data:Ei,disabled:Mi,dispatch:wi}=(0,le.useContext)(ht),Fn=(0,Oe.useParams)(),ti=(0,le.useRef)(!0),[dr,Tr]=(0,le.useState)(!1),Vo=(0,le.useMemo)(()=>{var To,Ca,Sa,mo,_r;if(!Ut.length||!Ei)return;const ar=(To=Ei==null?void 0:Ei.examination_bank)==null?void 0:To.sub_discipline_id,oa=((Ca=Ei==null?void 0:Ei.examination_bank)==null?void 0:Ca.time)===-1?void 0:ti.current?Fn.id?(Sa=Ei==null?void 0:Ei.examination_bank)==null?void 0:Sa.time:((mo=Ei==null?void 0:Ei.examination_bank)==null?void 0:mo.time)||60:(_r=Ei==null?void 0:Ei.examination_bank)==null?void 0:_r.time;ti.current=!1;let la=[];for(const Ma of Ut)for(const za of Ma.children)za.value===ar&&(la=[Ma.value,za.value]);return Sn(un({},Ei.examination_bank),{time:oa,course:la})},[Ei,Ut]);return(0,le.useEffect)(()=>{zi.setFieldsValue(un({},Vo))},[Vo]),le.createElement(Ct.Z,{spinning:bn,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},le.createElement("div",{className:Ue.formWrap},le.createElement(St.default,{form:zi,autoComplete:"off",colon:!1,labelCol:{span:4},wrapperCol:{span:20},initialValues:Vo||{difficulty:2,time:60},onValuesChange:(To,Ca)=>{const{course:Sa=[]}=Ca,mo=Sn(un({},Ca),{sub_discipline_id:Sa[1]||0});wi({type:"updateBaseInfo",payload:mo})}},le.createElement(St.default.Item,{name:"name",label:"\u8BD5\u5377\u540D\u79F0",className:Ue.baseLineHeight,rules:[{required:!0,validator:(To,Ca)=>{var Sa;return((Sa=Ca==null?void 0:Ca.replaceAll(" ",""))==null?void 0:Sa.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0")}}]},le.createElement(ot.default,{maxLength:60,className:Ue.baseFormItem,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",showCount:!0})),le.createElement(St.default.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B",name:"course",className:Ue.baseLineHeight},le.createElement(We.Z,{className:Ue.baseFormItem,disabled:Mi,size:"large",allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:Ut,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14}})),le.createElement("div",{className:Ue.concat},"\u6CA1\u6709\u5408\u9002\u7684\u65B9\u5411&\u8BFE\u7A0B\uFF1F",le.createElement("span",{onClick:()=>Tr(!0)},"\u8054\u7CFB\u6559\u7814\u52A9\u7406")),le.createElement(St.default.Item,{label:"\u96BE\u5EA6",name:"difficulty",className:Ue.radioBtnWrapper,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},le.createElement(Tt.ZP.Group,{disabled:Mi,className:Ue.radiogroup},le.createElement(Tt.ZP.Button,{className:Ue.easy,value:1},"\u7B80\u5355"),le.createElement(Tt.ZP.Button,{className:Ue.medium,value:2},"\u9002\u4E2D"),le.createElement(Tt.ZP.Button,{className:Ue.hard,value:3},"\u56F0\u96BE"))),le.createElement(St.default.Item,{label:"\u7B54\u9898\u65F6\u957F",className:Ue.baseLineHeight},le.createElement(dt.Z,{align:"middle"},le.createElement(St.default.Item,{name:"time",noStyle:!0},le.createElement(kt.Z,{className:Ue.baseFormItem,min:1,disabled:Mi,size:"large",max:9999,style:{width:220},placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"})),le.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"46px",fontSize:14}},"\u5206\u949F"))),le.createElement(St.default.Item,{label:"\u8BD5\u5377\u987B\u77E5",name:"exam_notes"},le.createElement(ot.default.TextArea,{rows:6,disabled:Mi,maxLength:65535,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u987B\u77E5"})))),le.createElement("div",{className:Ue.fixedBottom},le.createElement(De.ZP,{className:`${Ue.cancelBtn} mr5`,onClick:()=>{Fn.id||window.location.href.indexOf("randompaper")>-1?Oe.history.push("/paperlibrary"):Oe.history.push(`/classrooms/${Fn.coursesId}/exercise`)}},"\u53D6\u6D88"),le.createElement(De.ZP,{className:`${Ue.confirmBtn} ml15`,type:"primary",size:"large",onClick:()=>An(void 0,null,function*(){if(yield zi.validateFields(),!Fn.id&&!Fn.coursesId){const To=yield st(Ei);To.status===0&&(Oe.history.replace(`/randompaper/edit/${To==null?void 0:To.examination_bank_id}?type=settings`),Zt("settings"))}else Zt("settings")})},"\u4E0B\u4E00\u6B65")),le.createElement(Ae.Z,{open:dr,onCancel:()=>{Tr(!1)}}))},en=Le(62957),Qt=Le(5269),ln={flex_box_center:"flex_box_center___NXYwj",flex_space_between:"flex_space_between___Oy2UZ",flex_box_vertical_center:"flex_box_vertical_center___ybBar",flex_box_center_end:"flex_box_center_end___yyQPf",flex_box_column:"flex_box_column____kuXY",questionInfo:"questionInfo___U9mnu",label:"label___PP7Ng",content:"content___PUXFl",leftPart:"leftPart___uoQeo",rightPart:"rightPart___mCG7H",dragItem:"dragItem___djmPG",blackText:"blackText___KqEaU",greyText:"greyText___VamKm",iconWrapper:"iconWrapper___o1C0y",contentArea:"contentArea___Fj7D0",dragging:"dragging___mX3Il",hidden:"hidden___KWDLK",dragIcon:"dragIcon___yPuB3",deleteIcon:"deleteIcon___go29y",disabled:"disabled___uSK9k",challengeNameWrapper:"challengeNameWrapper___DFjRy",challengeName:"challengeName___m7v0x",shixunPreviewFooter:"shixunPreviewFooter___iaciG",shixunInfoWrapper:"shixunInfoWrapper___aSihg",shixunInfo:"shixunInfo___WYBm1",btnToDetail:"btnToDetail___WVmtj",fixedBottom:"fixedBottom___oeMSX",cancelBtn:"cancelBtn___ac73V",confirmBtn:"confirmBtn___sYh2O",previewBtn:"previewBtn___c2uQz",setScoreModalTable:"setScoreModalTable___kPddX",title:"title___lP1E2",tipcontent:"tipcontent___tV6uE",name:"name___YLyPW",tip:"tip___FYIzt",info:"info___rSdr9",img:"img___ft7eS"},di=Le(28426),cn=Le(9148),Yt=Le(62673);const ii=[{label:"\u5355\u9009\u9898",value:"SINGLE"},{label:"\u591A\u9009\u9898",value:"MULTIPLE"},{label:"\u586B\u7A7A\u9898",value:"COMPLETION"},{label:"\u5224\u65AD\u9898",value:"JUDGMENT"},{label:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{label:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{label:"\u7EC4\u5408\u9898",value:"COMBINATION"},{label:"\u5B9E\u8BAD\u9898",value:"PRACTICAL"},{label:"\u7A0B\u5E8F\u586B\u7A7A\u9898",value:"BPROGRAM"}];var bi=({open:Ut,onCancel:Zt,onOk:bn})=>{const{data:zi,dispatch:Ei}=(0,le.useContext)(ht);(0,le.useEffect)(()=>{if(Ut){const{item_types:Fn}=zi||{};wi(Fn==null?void 0:Fn.map(ti=>ti.item_type))}},[Ut,zi]);const[Mi,wi]=(0,le.useState)([]);return le.createElement(en.default,{title:le.createElement("div",null,"\u9898\u578B\u8BBE\u7F6E",le.createElement("span",{className:"c-grey-333",style:{fontSize:14,fontWeight:400}},"\uFF08\u901A\u8FC7\u52FE\u9009\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u6DFB\u52A0/\u5220\u9664\uFF09")),closable:!0,centered:!0,open:Ut,onCancel:Zt,onOk:()=>bn(Mi)},le.createElement(Yt.default.Group,{value:Mi,onChange:Fn=>wi(Fn)},le.createElement(dt.Z,{gutter:[0,20]},ii.map(Fn=>le.createElement(Qt.Z,{key:Fn.value,span:6},le.createElement(Yt.default,{value:Fn.value},Fn.label))))))},Di=Le(54172),Mr=Object.defineProperty,Gn=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable,Ni=(Ut,Zt,bn)=>Zt in Ut?Mr(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,ji=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))Rn.call(Zt,bn)&&Ni(Ut,bn,Zt[bn]);if(Gn)for(var bn of Gn(Zt))Jn.call(Zt,bn)&&Ni(Ut,bn,Zt[bn]);return Ut},Fr=({open:Ut,onCancel:Zt,onOk:bn})=>{const{data:zi}=(0,le.useContext)(ht),[Ei,Mi]=(0,le.useState)();console.log("--xxx-",Ei),(0,le.useEffect)(()=>{Ut&&Mi((0,it.cloneDeep)(zi))},[Ut,zi]);const wi=(0,le.useMemo)(()=>{var Fn;let ti;return ti=(Fn=Ei==null?void 0:Ei.item_types)==null?void 0:Fn.map(dr=>dr.total_score).reduce((dr,Tr)=>parseFloat(dr)+parseFloat(Tr)),ti==null?void 0:ti.toFixed(1)},[Ei]);return Ut?le.createElement(en.default,{title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C",open:Ut,width:640,centered:!0,closable:!0,onCancel:Zt,onOk:()=>{bn(Ei)}},le.createElement("div",{className:"c-black mb20"},"\u603B\u5206",le.createElement("span",{className:"ml10 c-light-primary"},wi)),le.createElement(Di.default,{columns:[{title:"\u9898\u578B\u540D\u79F0",dataIndex:"item_type_text",width:130},{title:"\u5C0F\u9898\u603B\u6570",dataIndex:"item_bank_count",width:130},{title:"\u9898\u578B\u603B\u5206",dataIndex:"total_score",width:130},{title:"\u64CD\u4F5C",render(Fn,ti){const{score:dr,item_type:Tr}=ti;return le.createElement("div",{style:{color:"#9096A3"}},"\u6BCF",((ti==null?void 0:ti.item_type)==="PRACTICAL","\u9898"),le.createElement(kt.Z,{precision:1,size:"large",className:"ml10 mr10",min:.1,disabled:(ti==null?void 0:ti.item_bank_count)===0,max:100,onChange:Vo=>{const To=Ei,Ca=To.item_types.find(mo=>mo.item_type===Tr);Ca.score=Number(Vo);const Sa=Vo*Ca.item_bank_count;Ca.total_score=Sa&&Number(Sa.toFixed(1)),To.examination_bank.total_score=To.item_types.reduce((mo,_r)=>Number(mo)+Number(_r.total_score),0),Mi(ji({},To))}}),"\u5206")}}],className:ln.setScoreModalTable,dataSource:Ei==null?void 0:Ei.item_types,rowKey:"item_type",pagination:!1})):null},be=Le(20554),gn=Le(82326),li=Le(18287),Hn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAtFJREFUWEftWL9rU1EYPffFpCCKEEEJVUQHB10qAUHFHwguDg4ORRDq4uDg4CBIJ6GD0D/B3UEFJ5cugjbQChIqokWKClVrFDGIg2B8yZX3Xl/z/O5LzvfyKhTJXV7g/jrfOfc797sx1toCNnAzQ4A51RkymJNA/CcMvpoYhf0xDWtPwqICWEKM+QSYGgojt3Hw3mweFjmD9YlR+N8WAJSdjYwBrAWCb1oL+jzvMbzSFKoPBgLKAc6dugPbuRDtHzAXgGEMxmjjsXEAYr4MMOw2DcA8wcjWG6g+XOEAZ8c+wNpKtCXZMI+WMn6DJrbsOMQBPtrr9ySM4ZX9LEApkOfd5QBntvvhuhqFswKOz2/wDQWSZ9o0FADLfji5fBTYPwmUduYVMmV+IrLWF2DpFtCcizDTu3hmFeCBKaC4LR2cJpvjMZrwfn8HFm8qATan/bWslWckq6SuTyWcIfi5allrkmsY/DoZSZzanCwQo0REAwTIJf583e9txNIWic9p5E2OCQilZ7BxzY/8L60RSqRkcgnHqKXERgFw5eq/80EagIbB91cSPigilMabNWmYD6okXr7cZdABIAE7Gv6dpfIuZxJDI/G7S32ymJx6CoDP50ny5mIXIJPQ2Y8kEVVEw+DSeCKLWbkldlQA6JZwaZe9BuDr8xkAZjU6Pp5LvHiu9xmkWej6Wt8KXOK1VuGDL89272IaMLv6yAID3cUvzvS5SZyQyZOAZZl7hrnEz0/rjZoxzAhOyUEOcOFEH6MWhDGCWAApPs8B1o/p68GsANgbRVVRPzu8fvVg5gA0xcLTsV/wCtF/iKz6cABkfBfL+Z12m0tc2/cWXnFPODf3zZCxmOj4yxzg/O4qWv48LDwHIHOZrO/i5HoGHRQ3HeEAg0m1ShWtn/dh27tgUAilTqOUMcyqm7AfbZjCR5Q2j+N4o64DOMDhXq8pQ4B5mdzwDP4B5kHmZrL/eyAAAAAASUVORK5CYII=",oi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA4RJREFUWEftWEtrE1EYPXfSh5VWSlMfNSi4sokLK30pWtuKIChVVBBBWpfiRhcKghii7tp/4FrBBxREXbhQ0Bj7gqokahe+kNZWqa21tLGtk7kymY5J79yZL5NUKNLZZHHnzj33fOec+90wzrkHS/hhywBzrM4ygzkSiP+EwTdtPvDJdnDeCI4KgBPEsGGAPYOn8Bq23A7nwiLNYH+bD+rYSwBlloUYAzgH9F/Zo48pyhMoBVdR3ZkVUBpgV9MNcO24sb7OnA6GYtBEa75rbkCYL24wOcxGAPYUhSUXUH3/Cw0wXDUIziuMJYkFc6mluH+GcRSv2UYDfLxJtSWMwiuOUxsUC6Qot2iAD71q8ruZVNgtYFO/+m+yQKKm2UgGAMvU5GTvbqDyClC4LmUMuw+LTFiYdNDC7FdgIASMG57KHGDNdSB/tVyKltIJAESmRHziBmZHgf5WlwBrb6bihFrQmkdpCSDRiiyu+ozgyJzBujtpy1Jiy9XOAPqOuQRY35mKP8qdFvELBFJu1qH1HnUL8K59iV0DFtwqc3PPIQnAH+3noGmXAK1k4YnhxoaS8joqQgFYOaBUAlBSedbTIgCcuLwBc78+SW3qWnJUzkjG8/yAZ3Nqd937BYDfghvB4x+NQJ5vAMycozRvOVOF+Rk1FaVAkQEquX73PkmJh89EwXngn5+5dhsuPgwopYYZu/ZKAA6dDkLTQhaAlhKLDAsvuJWE+X5RDbCi1jBjpEkCcPCsH4mpmKXEVIksbZiAkDxz5zWZVwaUnjS6pkiDTcx8aI2CscCCRtStJqmjzKmtLD8FeLxAZKcNwPcnguCJ0II1SAYERJSJnUxX0gysagbC2+0YbPNDnY79rZrk6LR+n0DkRsP5a4GK80C4xuEkeXswCvCAfaOawV3E1K2+DGUaUeO+i4AlB9NpeX0gCGihpA6zeahcpBB7W4Bo0IHBgSN+zP2MGVuX1ZiihHKJOC5IpMAHfH7gAFAfetUYBUcgGwIXZc73d0BixqEffNGQ5mYi1yjCSFdLKhIfA6ZHHQBGm/2YmYpJ2bAEN4nAmVRZjKmzwOQQcWnq3focnNdTBwV9n88yhuKj95xb/i5/HdSpRwBbmfpXIRPTCIS5ycF0U3o8O+g7SWR9FebiHeCJXQArkNdKYIiqODXO2G9A6cCeiRANcFEsmf1HlgFmz50xc8kz+AfHHTJwrKNsNwAAAABJRU5ErkJggg==",ki="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAABWlJREFUWEftV1tsVEUY/ubspUu3W9mWGlttwXqJVRNBbqIFDbyA8mCCkAYtpEaIGBODhBCECiG+UE1EnzTempYqtSAE45saBMX40JC0IRojpd1GKM1uW7bd7V7OOWPmnD3bPTNndxYbE2I6L2dzdubMN9/3/ZchlFIXbuNB5gDOUp05BmdJIP4fDPZcxt2xaRzVgadBUQ3QDDEE5m/2zBkE1whwoYTg461LcX42LEoZZOCiMXoJoBUCHEIASgH2dBqUgijKORfBkW3/EqgUYNsPieMAmtj+Fhb2NIfFXvaFnUhCQBlI6wD8dGcBrisEP5V7fft2NuJvKcC9p6PDoLSa7cwTJgKejZj8WjLm93iWSAG2tI+qEsdlvywl6BZPqBByQgpw44fDKskEAQUF+82e5rBrxCvGz7fWZr+XkZ/ZwFTIbgkKel0K8LkPhlW2uLbSh9UNQfh9btGLIrIZ7E7WyDkaf8xYQsX538cwHE4YgKUAnz0WMgC+/EwNSn1uR5MVEcxZ/xbjUgbyi3PXDNNLAW44FjIk3rOxNpvtCseuCEFCMGcUc/2734YMFaQA178fUhlDB56vy+4s27AYlgrOocA7Z0IG60UDPLypLm8BEQBncnc2X3ITijng4ZMhM8vK+kHGIIuyI5sXZgsGn//ECmOvgMJ8rgA5/f92T8hM8rkAX/psZI+u4yClesAWhhLNhPTBpSMhfeSkF7eLoP5OHzY8FoSizGzU+vWQmXosgLvPTNTGJpNXi8lvPF4hPwoZW0YZsKw+gMWLSrMV1ASYE8V7e27WTUwnB7IzsrFVjOXzdDVWOpfgY+YO+j3YvKrCWMEkP9g9ZHjeJvErnaN9oHhYgCSrYQ5F2echKPcpSGkUE9PU3vXkMeWWJxcg6HcZAA+cGDIosgHc0THaqun0EN8ViFFqdij5SlTT8jKsa5gHJdPF/DaQwCcXotkCme+8y+/zY1m937D/W19yHmSs7eoeb0gm0v1Wi2QBEGpuAcm8buCjF6tmWqyMHPu/iWAkahQlseZm0lKw1I2mRlPm/V2D9iCxZG1pH+2j4GR2KB1lJaaE8TSTUDf88kiNB2sfKsWCMgWlXgVVARfG4xp+/iuBU72xmca7gGW2NlYaMu/vYgxyaYaBbGkPt+pUP5Trw1xGa4Nu7FhdjkULPBlDUwxGVLgVgsFIGj/+MY0rYdXwzzwvQTzFOiDHi4Fj9K14wI+V9/uxr3PQuZLs6hxviKnpfttVI+fERzdVoPoOsWmYiGt4ozsCncnFA+JeFGp0KwJuNK+pwL6OPBKzYzV/npHZoZN/74UK3OUAMJ7S8VpXBJoRsPYgEhBLskLzmkq0nR7OX+q2t4fNaHYYtUEXdq4O4N6MxGzKnzfSiExpqJnvRm8oiYtXkhiJasZqj8vMMCqzaebAsvbsiQf9OHXxRv5+kEXzZFzvt+5qgiQEmO8jhseSGjAW0w0wJW7g8Tovnqovgb+EGO+XLvTCRYBITEd3bxy/DqREQrnmojLgRt/VMaN7z9ssNLeP94GPZotR2d2CECy5x40315XZNIgldbz61U15aSLASHgSqqblB9hyfKpV07WMzHaXi3lS3NPrAnav9ePRGjOgVI3i5KUEvrucEm6HfFix2h6dnMbNqen8AHd1pxpiyWS/mS0lYSncj2cWVJURBHwEI1Ed8VQ+8sSoSasqro9OFL40beuM/UIpXSnczvjbF387484jK+VODDL/3QiPny3YsG7vGFsRT+rfE5BSC6QjB7IWWfY/91FrrwRRV0k76i2fhhcnk2obqN4IQrxOAGWevEV8UIiS1iltO/t69SEpQHnI/bcz5gDOlt/bnsF/AOXAMnuF/cdAAAAAAElFTkSuQmCC",Ji="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAABpxJREFUWAntWE2IHFUQrtfzk5nNbrKbRGPcRSU/oIEkmERjMAQhCBIjKBpFEBER9OZNL4IevOhFbyGHRA9BhKBeouJFIkTNwaxGg16ikN1k0WR3M5ndnf/ptr56r7p7+s1mkYCHkILpev1e1VdfVb3X0zNEt+Qmr4Dpl9+xs9FYq0XvR0SPUETriC9WYI6x72YML0T0By99Gxj68KWd5k/ndEPKiwRy7RadZSKrDEdDVGiRxfnZ9YjJM1MTUScydIwn371Roh7BD042P2Hg5xHRxRON+6R6WlE7m1wzGRjT4ZnTjNOFjQkYIbQ68UlGURhSYIIpTu7k6N7CkWeN6XoE3zoxP8WMuK22kemG6ngxel4CWQeubpw1AmQrkFpnyx9HVg/uy8MuLbPV5uJ7DuloUDhlA8hWSAxS8SSEZy6zi152V2pX3/YJzjVlH8EtYkTDUaAhOobuJ0vZL7XuJWzoKY9gtd6JY5eKAQ0PFOL7/2NQqbWp0eKNCjFmk0fQVsvQ2Opl9Pj2NZQPeGdnWpu5jbtu68zA2uV4QsIll+sAdPigfPXzNF2cafKBCo1HUFF2bRiikQEmx/If9042H49vdm9qTKsDenD9EE1O263mbaaDhy7FeWf3jBe5F5mXe5+b+gyFhiy17rWKK+NVcGQ5ppRjpheZW680/oQQSy5LAiSmGHGpPYKyB/WUZnurvFUDJD32eodFJQXjrGAN4nQ2Hq/4BGHsgtrHChKxAH38BT6+wED8LUCOt/CejSW6czhPF2badPqvJoUO2/o4ew0Y+yaE+xBkVwkEniBrd5KScEsOnwNo1TCjY5fQ6/uG6b51RXWlLWMNOvxdNaZD/J2GEKLF340dP+xZe0xjCPBxQTmIjqHtx67DRIiKDTuDUMb+3jsKPeQQYufdJRrjaiqezR/xgKGYVgM/5ItHEJZog22FHSuCEOZ1DQAbjPvZryz1gWYeQ2XMW0ahBOEYrPFhuFhjDDuvxWBtATi4GCUat7Ls5j0DVwW8tYyOeNBUa4Z0/nLbJQ8QJGu1XlMvd2LnoaQN4NQryBxi9YbbCrRpbYGa7Yh+mWzS7EKXxlbl6ZWHV9DalTn6+twC7V5f4q/LHE3Pd+nIqSrV2VYF1dfvd8xl97yts1o7/eLRf7B1RbSWCaSd5zdmem3vCtrFwVVanYjOTDTpgXuW0e9TLfr4hzmaWQhlew4WDc01JbwUfTF8zGtM4GLcp4JYSiRLDisHtg70kMNcMW+kWsfPzNOJX2uYEkELQQ6CVwCQcK8C8ThNGHYaE9ojCAPZu6xxOBEAGqLjvZvKdqLPFb7qn11WcjEhDNheW6b40BAsewR1EQYIJKApB8ytkJMIC1/WDuX8STfjYJIK4fWfA+BngIiOEdSJ9ywAAQAJmBvrhM5NzCbvjAqk+mKlI4kJDjuoRuI6hsYHotreKTNoe8I9grZmzkDqx4YwFgerPxtfYGAXwSLLFXMHdwzS09uXU6nAGFwe+ZpEmVJjzOm8aqwLpNM69vqx9ck337G8AML8BTsQQKHNL7CX50KavNqljbfnaYDfuiHnptr03jfX6O9qSAe2DNCjm8s034hocrbLEIa2jRVp22iRupxXpY7kBK1HG7wcY4a1EHerMqmXFz6aZW9bHWTBCbmHaTLGHATrq5YbarSJai2usbMt86+EJ7aW6bHNJZq61qU5JrplNPnp8OlPNfryHL8xS1/QFRsPsBg5eMH3WyzRYcJ5S0ZWy5grqho/cjG+WjdU51+/adsG3x8fb9AbX1TlEZMmx8D0zP1ld9A4TioeyTcvYoOWxfcJCrEcB0T3Edhqm5clvtg4TRLjGX4c/jblH6h8ztCawRwFjI1tBI0PyKoW4nzvPWZ03zE7tgGhRMf1tx2xPHt6wlNI2a0b/g/k/BV9hgiUXOq8HS5ei43iPSQJ8r6xiVocv4JBwJ79K5WtEOx0Tny0XdD8QfXPT0f0+dmWvKWAHfbqoe8b1MafGpKN0xiLn2r2z+X0GS6JyeW5o5VmPhfIW2b2y5xduDh44CABFqhUBa9nP1xGWw1dqoRUcy8M6JD6CF7mVLbDqOW1uF5vjpeK+YfEYQkCWYYZc4HQyxU+6Veqeme1Jpuc4t4CNFqdcY9g1yzbX2/WL+QCM9QLhzstl90/S1fUdg2FgWQT6EVLbNHpThjNhaa8Hz6e7DgcFVbPTxwNcrk9JgqH9bBkCWYDZPh7uNmWanuhVfhIVaIwOjUzeNfLZ141XPdbcpNX4F/ikyqlsA/6bwAAAABJRU5ErkJggg==",$i={ruleCheckBox:"ruleCheckBox___Onj2f",folderAreaWrapper:"folderAreaWrapper___ut2mr",folderAreaHeader:"folderAreaHeader___fOIDA",folderWrapper:"folderWrapper___IpJ50",folderIcon:"folderIcon___zBoRM",shareFolderIcon:"shareFolderIcon____5s3p",treeNodeItem:"treeNodeItem___quqla",treeNodeDifficulty:"treeNodeDifficulty___en0gk"},ir=Le(46722),Mt=Object.defineProperty,_t=Object.defineProperties,At=Object.getOwnPropertyDescriptors,xi=Object.getOwnPropertySymbols,mi=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,wn=(Ut,Zt,bn)=>Zt in Ut?Mt(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,Yn=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))mi.call(Zt,bn)&&wn(Ut,bn,Zt[bn]);if(xi)for(var bn of xi(Zt))fi.call(Zt,bn)&&wn(Ut,bn,Zt[bn]);return Ut},Qi=(Ut,Zt)=>_t(Ut,At(Zt)),vr=(Ut,Zt,bn)=>new Promise((zi,Ei)=>{var Mi=ti=>{try{Fn(bn.next(ti))}catch(dr){Ei(dr)}},wi=ti=>{try{Fn(bn.throw(ti))}catch(dr){Ei(dr)}},Fn=ti=>ti.done?zi(ti.value):Promise.resolve(ti.value).then(Mi,wi);Fn((bn=bn.apply(Ut,Zt)).next())});const Dr=(Ut,Zt,bn)=>Ut.map(zi=>zi.key===Zt?Yn(Yn({},zi),bn):zi.children?Qi(Yn({},zi),{children:Dr(zi.children,Zt,bn)}):zi),Ke={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3},Lt=(Ut,Zt,bn)=>Ut.map(zi=>{var Ei;const Mi=zi==null?void 0:zi.tag_disciplines.map(Fn=>{const ti=Fn==null?void 0:Fn.difficulty_count.map(dr=>({label:dr==null?void 0:dr.name,value:Ke[dr.name]}));return{title:ze(Zt)===tn.All&&ti.length>0?le.createElement(dt.Z,{justify:"space-between"},le.createElement(Qt.Z,null,`${Fn.name}\uFF08${Fn.child_count}\uFF09`),le.createElement(Qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}_${Fn.id}`,"diffValue"]},le.createElement(Yt.default.Group,{style:{columnGap:12},options:ti})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}_${Fn.id}`,"diffNum"],initialValue:Fn==null?void 0:Fn.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}_${Fn.id}`,"extra"],initialValue:Qi(Yn({},zi),{type:bn})},le.createElement("input",{type:"hidden"})))):`${Fn.name}\uFF08${Fn.child_count}\uFF09`,key:`${zi.id}_${Fn.id}`,name:Fn.name,parentName:zi.name,item_banks_count:Fn.child_count,icon:null,isLeaf:!0,checkable:ze(Zt)===tn.FileFolderAndKnowledge,disableCheckbox:Fn.child_count===0}}),wi=zi==null?void 0:zi.difficulty_count.map(Fn=>({label:Fn==null?void 0:Fn.name,value:Ke[Fn.name]}));return{title:ze(Zt)===tn.FileFolderAndDiff&&wi.length>0?le.createElement(dt.Z,{justify:"space-between"},le.createElement(Qt.Z,null,`${zi.name}\uFF08${zi.item_banks_count}\uFF09`),le.createElement(Qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}`,"diffValue"]},le.createElement(Yt.default.Group,{style:{columnGap:12},options:wi})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}`,"diffNum"],initialValue:zi==null?void 0:zi.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}`,"extra"],initialValue:Qi(Yn({},zi),{type:bn})},le.createElement("input",{type:"hidden"})))):`${zi.name}\uFF08${zi.item_banks_count}\uFF09`,key:`${zi.id}`,name:zi.name,item_banks_count:zi.item_banks_count,icon:Fn=>Fn.expanded?bn==="0"?le.createElement("img",{src:oi,className:$i.folderIcon}):le.createElement("img",{src:ki,className:$i.shareFolderIcon}):bn==="0"?le.createElement("img",{src:Hn,className:$i.folderIcon}):le.createElement("img",{src:Ji,className:$i.shareFolderIcon}),isLeaf:!zi.have_child&&!((Ei=zi.tag_disciplines)!=null&&Ei.length),checkable:ze(Zt)===tn.OnlyFileFolder,disableCheckbox:zi.item_banks_count===0,children:zi.children.length?ze(Zt)===tn.All||ze(Zt)===tn.FileFolderAndKnowledge?[...Lt(zi.children,Zt,bn),...Mi]:Lt(zi.children,Zt,bn):[]}}),_n=(Ut,Zt,bn)=>Ut.map(zi=>{var Ei;const Mi=zi==null?void 0:zi.tag_disciplines.map(Fn=>{console.log("tagItem:",Fn);const ti=Fn==null?void 0:Fn.difficulty_count.map(dr=>({label:dr==null?void 0:dr.name,value:Ke[dr.name]}));return{title:ze(Zt)===tn.All&&ti.length>0?le.createElement(dt.Z,{justify:"space-between"},le.createElement(Qt.Z,null,`${Fn.name}\uFF08${Fn.child_count}\uFF09`),le.createElement(Qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}_${Fn.id}`,"diffValue"]},le.createElement(Yt.default.Group,{style:{columnGap:12},options:ti})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}_${Fn.id}`,"diffNum"],initialValue:Fn==null?void 0:Fn.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}_${Fn.id}`,"extra"],initialValue:Qi(Yn({},zi),{type:bn})},le.createElement("input",{type:"hidden"})))):`${Fn.name}\uFF08${Fn.child_count}\uFF09`,key:`${zi.id}_${Fn.id}`,name:Fn.name,parentName:zi.name,item_banks_count:Fn.child_count,icon:null,isLeaf:!0,checkable:ze(Zt)===tn.FileFolderAndKnowledge,disableCheckbox:Fn.child_count===0}}),wi=zi==null?void 0:zi.difficulty_count.map(Fn=>({label:Fn==null?void 0:Fn.name,value:Ke[Fn.name]}));return{title:ze(Zt)===tn.FileFolderAndDiff&&wi.length>0?le.createElement(dt.Z,{justify:"space-between"},le.createElement(Qt.Z,null,`${zi.name}\uFF08${zi.item_banks_count}\uFF09`),le.createElement(Qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}`,"diffValue"]},le.createElement(Yt.default.Group,{style:{columnGap:12},options:wi})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}`,"diffNum"],initialValue:zi==null?void 0:zi.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(St.default.Item,{noStyle:!0,name:[`${zi.id}`,"extra"],initialValue:Qi(Yn({},zi),{type:bn})},le.createElement("input",{type:"hidden"})))):`${zi.name}\uFF08${zi.item_banks_count}\uFF09`,key:`${zi.id}`,name:zi.name,item_banks_count:zi.item_banks_count,icon:Fn=>Fn.expanded?bn==="0"?le.createElement("img",{src:oi,className:$i.folderIcon}):le.createElement("img",{src:ki,className:$i.shareFolderIcon}):bn==="0"?le.createElement("img",{src:Hn,className:$i.folderIcon}):le.createElement("img",{src:Ji,className:$i.shareFolderIcon}),isLeaf:!zi.have_child&&!((Ei=zi.tag_disciplines)!=null&&Ei.length),checkable:ze(Zt)===tn.OnlyFileFolder,disableCheckbox:zi.item_banks_count===0,children:[..._n(zi.children,Zt,bn),...Mi]}});var $t=({ruleValue:Ut,defaultData:Zt,setSelectData:bn,currentItemType:zi,selectData:Ei})=>{const[Mi,wi]=(0,le.useState)("1"),[Fn,ti]=(0,le.useState)(!0),[dr]=St.default.useForm(),[Tr,Vo]=(0,le.useState)([]),[To,Ca]=(0,le.useState)("all"),Sa=(lt,fr,sr)=>{const{checkedNodes:pr}=fr;console.log("type:",sr,pr,Ei),sr==="0"?(_r(lt),ze(Ut)===tn.OnlyFileFolder?(bn(Ui=>Qi(Yn({},Ui),{my:pr.map(Un=>({id:Un.key,group_id:Un.key,group_name:Un.name,item_bank_num:Un.item_banks_count,folderType:"0",quanlity:1}))})),Re(pr.reduce((Ui,Un)=>Ui+Un.item_banks_count,0))):(console.log(pr),bn(Ui=>Qi(Yn({},Ui),{my:pr.map(Un=>{const[Lr,kr]=Un.key.split("_");return{id:Un.key,tag_discipline_name:Un.name,group_id:Lr,tag_discipline_id:kr,folderType:"0",group_name:Un.parentName,item_bank_num:Un.item_banks_count,quanlity:1}})})),Re(pr.reduce((Ui,Un)=>Ui+Un.item_banks_count,0)))):(oa(lt),ze(Ut)===tn.OnlyFileFolder?bn(Ui=>(console.log("pre:",Ui),Qi(Yn({},Ui),{public:pr.map(Un=>({id:Un.key==="0"?"00":Un.key,teacher_group_name:Un.name,teacher_group_id:Un.key,folderType:"3",item_bank_num:Un.item_banks_count,quanlity:1}))}))):bn(Ui=>Qi(Yn({},Ui),{public:pr.map(Un=>{const[Lr,kr]=Un.key.split("_");return{id:Un.key==="0"?"00":Un.key,tag_discipline_name:Un.name,teacher_group_id:Lr,tag_discipline_id:kr,folderType:"3",teacher_group_name:Un.parentName,item_bank_num:Un.item_banks_count,quanlity:1}})})),Re(pr.reduce((Ui,Un)=>Ui+Un.item_banks_count,0)))},[mo,_r]=(0,le.useState)([]),[ar,oa]=(0,le.useState)([]),[la,Ma]=(0,le.useState)([]),[za,Ro]=(0,le.useState)([]),[ua,ko]=(0,le.useState)([]),[jr,Fa]=(0,le.useState)([]),[sa,Xo]=(0,le.useState)(!1),[Io,ca]=(0,le.useState)(!1);function Wa(){return vr(this,null,function*(){let lt=yield(0,ne.ZP)("/api/teach_group_shares.json",{method:"get"});lt&&Vo(lt==null?void 0:lt.groups)})}(0,le.useEffect)(()=>{Wa()},[]);const gt=lt=>vr(void 0,null,function*(){var fr,sr,pr,Ui,Un,Lr,kr,Zr,Er,Eo,Wi,Si;lt.type==="0"?Xo(!0):ca(!0);const Pi=yield(0,ir.ex)(lt);lt.type==="0"?Xo(!1):ca(!1),lt.type==="0"?ko(Pi):Fa(Pi);const Jr=(fr=Pi.navigation[0])==null?void 0:fr.difficulty_count.map(Nr=>({label:Nr==null?void 0:Nr.name,value:Ke[Nr.name]})),Ur=(sr=Pi.navigation[0])==null?void 0:sr.tag_disciplines.map(Nr=>{const Lo=Nr==null?void 0:Nr.difficulty_count.map(yr=>({label:yr==null?void 0:yr.name,value:Ke[yr.name]}));return{title:ze(Ut)===tn.All&&Lo.length>0?le.createElement(dt.Z,{justify:"space-between",style:{color:"#232B40"}},le.createElement(Qt.Z,null,`${Nr.name}\uFF08${Nr.child_count}\uFF09`),le.createElement(Qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(St.default.Item,{noStyle:!0,name:[`0_${Nr.id}`,"diffValue"]},le.createElement(Yt.default.Group,{style:{columnGap:12},options:Lo})),le.createElement(St.default.Item,{noStyle:!0,name:[`0_${Nr.id}`,"diffNum"],initialValue:Nr==null?void 0:Nr.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(St.default.Item,{noStyle:!0,name:[`0_${Nr.id}`,"extra"],initialValue:{tag_discipline_name:Nr.name,name:"\u6839\u76EE\u5F55",type:lt.type}},le.createElement("input",{type:"hidden"})))):le.createElement("span",{style:{color:"#232B40"}},Nr.name,"\uFF08",Nr.child_count,"\uFF09"),key:`0_${Nr.id}`,name:Nr.name,parentName:"\u6839\u76EE\u5F55",item_banks_count:Nr.child_count,icon:null,isLeaf:!0,checkable:ze(Ut)===tn.FileFolderAndKnowledge,disableCheckbox:Nr.child_count===0}});if(lt.type==="0"){const Nr=Lt(Pi.data,Ut,"0"),Lo=_n(Pi.data,Ut,"0");console.log("normalChildren2:",Lo),Ma([{title:ze(Ut)===tn.FileFolderAndDiff?le.createElement(dt.Z,{justify:"space-between",style:{color:"#232B40"}},le.createElement(Qt.Z,null,`\u6839\u76EE\u5F55\uFF08${(pr=Pi.navigation[0])==null?void 0:pr.child_count}\uFF09`),le.createElement(Qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(St.default.Item,{noStyle:!0,name:["0","diffValue"],initialValue:[]},le.createElement(Yt.default.Group,{style:{columnGap:12},options:Jr})),le.createElement(St.default.Item,{noStyle:!0,name:["0","diffNum"],initialValue:(Ui=Pi.navigation[0])==null?void 0:Ui.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(St.default.Item,{noStyle:!0,name:["0","extra"],initialValue:{type:"0",group_id:"0",name:"\u6839\u76EE\u5F55"}},le.createElement("input",{type:"hidden"})))):le.createElement("span",{style:{color:"#232B40"}},`\u6839\u76EE\u5F55\uFF08${(Un=Pi.navigation[0])==null?void 0:Un.child_count}\uFF09`),key:"0",name:"\u6839\u76EE\u5F55",item_banks_count:(Lr=Pi.navigation[0])==null?void 0:Lr.child_count,disabled:!(((kr=Pi.navigation[0])==null?void 0:kr.child_count)>0),checkable:ze(Ut)===tn.OnlyFileFolder,icon:yr=>yr.expanded?le.createElement("img",{src:oi,className:$i.folderIcon}):le.createElement("img",{src:Hn,className:$i.folderIcon}),isLeaf:!1,children:ze(Ut)===tn.OnlyFileFolder||ze(Ut)===tn.FileFolderAndDiff?Nr:[...Lo,...Ur]}])}else{const Nr=Lt(Pi.data,Ut,"3");Ro([{title:ze(Ut)===tn.FileFolderAndDiff?le.createElement(dt.Z,{justify:"space-between"},le.createElement(Qt.Z,null,`\u6839\u76EE\u5F55\uFF08${(Zr=Pi.navigation[0])==null?void 0:Zr.child_count}\uFF09`),le.createElement(Qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(St.default.Item,{noStyle:!0,name:["0","diffValue"]},le.createElement(Yt.default.Group,{style:{columnGap:12},options:Jr})),le.createElement(St.default.Item,{noStyle:!0,name:["0","diffNum"],initialValue:(Er=Pi.navigation[0])==null?void 0:Er.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(St.default.Item,{noStyle:!0,name:["0","extra"],initialValue:{type:"3",group_id:"0",name:"\u6839\u76EE\u5F55"}},le.createElement("input",{type:"hidden"})))):le.createElement("span",{style:{color:"#232B40"}},`\u6839\u76EE\u5F55\uFF08${(Eo=Pi.navigation[0])==null?void 0:Eo.child_count}\uFF09`),key:"0",name:"\u6839\u76EE\u5F55",item_banks_count:(Wi=Pi.navigation[0])==null?void 0:Wi.child_count,checkable:ze(Ut)===tn.OnlyFileFolder,icon:Lo=>Lo.expanded?le.createElement("img",{src:ki,className:$i.shareFolderIcon}):le.createElement("img",{src:Ji,className:$i.shareFolderIcon}),isLeaf:!1,disabled:!(((Si=Pi.navigation[0])==null?void 0:Si.child_count)>0),children:ze(Ut)===tn.OnlyFileFolder||ze(Ut)===tn.FileFolderAndDiff?Nr:[...Nr,...Ur]}])}});(0,le.useEffect)(()=>{Mi==="1"?gt({type:"0",group_id:0,item_type:zi,show_children:!0}):Mi==="2"&>({type:"3",except_mine:!0,item_type:zi,show_children:!0,teach_group_id:To==="all"?"":To})},[Ut,Mi,To]),(0,le.useEffect)(()=>{var lt,fr,sr,pr,Ui,Un,Lr,kr,Zr,Er,Eo,Wi;console.log("selectData-active:",Ei,Zt,Mi),Mi==="1"?(_r((lt=Ei==null?void 0:Ei.my)==null?void 0:lt.map(Si=>Si.id)),Re(((sr=(fr=Ei==null?void 0:Ei.my)==null?void 0:fr.reduce)==null?void 0:sr.call(fr,(Si,Pi)=>Si+Pi.item_bank_num,0))||0)):Mi==="2"&&(oa((pr=Ei==null?void 0:Ei.public)==null?void 0:pr.map(Si=>Si.id)),Re(((Un=(Ui=Ei==null?void 0:Ei.public)==null?void 0:Ui.reduce)==null?void 0:Un.call(Ui,(Si,Pi)=>Si+Pi.item_bank_num,0))||0)),ze(Ut)===tn.All&&(Mi==="1"?(_r((Lr=Ei==null?void 0:Ei.my)==null?void 0:Lr.map(Si=>Si.id)),Re((Ei==null?void 0:Ei.filter(Si=>!Si.is_share).reduce((Si,Pi)=>Si+Pi.item_bank_num,0))||0),(kr=Ei==null?void 0:Ei.filter(Si=>!Si.is_share))==null||kr.forEach(Si=>{const Pi=dr.getFieldValue([`${Si.group_id||0}_${Si.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",Pi),Pi!=null&&Pi.includes[Si.difficulty]||dr.setFieldValue([`${Si.group_id||0}_${Si.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Pi,Si.difficulty])))})):Mi==="2"&&(oa((Zr=Ei==null?void 0:Ei.public)==null?void 0:Zr.map(Si=>Si.id)),Re((Ei==null?void 0:Ei.filter(Si=>!!Si.is_share).reduce((Si,Pi)=>Si+Pi.item_bank_num,0))||0),(Er=Ei==null?void 0:Ei.filter(Si=>!!Si.is_share))==null||Er.forEach(Si=>{const Pi=dr.getFieldValue([`${Si.teacher_group_id||0}_${Si.tag_discipline_id}`,"diffValue"])||[];Pi!=null&&Pi.includes[Si.difficulty]||dr.setFieldValue([`${Si.teacher_group_id||0}_${Si.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Pi,Si.difficulty])))}))),ze(Ut)===tn.FileFolderAndDiff&&(dr.resetFields(),setTimeout(()=>{bn(Ei)},300),Mi==="1"?(Re((Ei==null?void 0:Ei.filter(Si=>!Si.is_share).reduce((Si,Pi)=>Si+Pi.item_bank_num,0))||0),(Eo=Ei==null?void 0:Ei.filter(Si=>!Si.is_share))==null||Eo.forEach(Si=>{const Pi=dr.getFieldValue([`${Si.group_id}`,"diffValue"])||[];console.log("prev:",Pi),Pi!=null&&Pi.includes[Si.difficulty]||dr.setFieldValue([`${Si.group_id}`,"diffValue"],Array.from(new Set([...Pi,Si.difficulty])))})):(Re((Ei==null?void 0:Ei.filter(Si=>!!Si.is_share).reduce((Si,Pi)=>Si+Pi.item_bank_num,0))||0),(Wi=Ei==null?void 0:Ei.filter(Si=>!!Si.is_share))==null||Wi.forEach(Si=>{const Pi=dr.getFieldValue([`${Si.teacher_group_id}`,"diffValue"])||[];Pi!=null&&Pi.includes[Si.difficulty]||dr.setFieldValue([`${Si.teacher_group_id}`,"diffValue"],Array.from(new Set([...Pi,Si.difficulty])))})))},[Mi]),console.log("1111111111:",mo,ar),(0,le.useEffect)(()=>{setTimeout(()=>{var lt,fr,sr,pr,Ui;switch(ze(Ut)){case tn.OnlyFileFolder:{const Un=[],Lr=[];for(const kr of Ei.my||[])Un.push(kr);for(const kr of Ei.public||[])Lr.push(kr);_r(Un.map(kr=>`${kr.group_id}`)),oa(Lr.map(kr=>`${kr.teacher_group_id}`)),Re(Mi==="1"?Un.reduce((kr,Zr)=>kr+Zr.item_bank_num,0):Lr.reduce((kr,Zr)=>kr+Zr.item_bank_num,0));break}case tn.FileFolderAndKnowledge:{const Un=[],Lr=[];for(const kr of(Ei==null?void 0:Ei.my)||[])Un.push(kr);for(const kr of(Ei==null?void 0:Ei.public)||[])Lr.push(kr);Re((lt=Mi==="1"?Un:Lr)==null?void 0:lt.reduce((kr,Zr)=>kr+Zr.item_bank_num,0)),_r(Un.map(kr=>`${kr.group_id}_${kr.tag_discipline_id}`)),oa(Lr.map(kr=>`${kr.teacher_group_id}_${kr.tag_discipline_id}`));break}case tn.All:{Mi==="1"?(Re((Ei==null?void 0:Ei.filter(Un=>!Un.is_share).reduce((Un,Lr)=>Un+Lr.item_bank_num,0))||0),(fr=Ei==null?void 0:Ei.filter(Un=>!Un.is_share))==null||fr.forEach(Un=>{const Lr=dr.getFieldValue([`${Un.group_id||0}_${Un.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",Lr,Un.difficulty,Un),Lr!=null&&Lr.includes[Un.difficulty]||dr.setFieldValue([`${Un.group_id||0}_${Un.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Lr,Un.difficulty])))})):(Re((Ei==null?void 0:Ei.filter(Un=>!!Un.is_share).reduce((Un,Lr)=>Un+Lr.item_bank_num,0))||0),(sr=Ei==null?void 0:Ei.filter(Un=>!!Un.is_share))==null||sr.forEach(Un=>{const Lr=dr.getFieldValue([`${Un.group_id||0}_${Un.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",Lr,Un.difficulty,Un),Lr!=null&&Lr.includes[Un.difficulty]||dr.setFieldValue([`${Un.group_id||0}_${Un.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Lr,Un.difficulty])))}));break}case tn.FileFolderAndDiff:{Mi==="1"?(Re((Ei==null?void 0:Ei.filter(Un=>!Un.is_share).reduce((Un,Lr)=>Un+Lr.item_bank_num,0))||0),(pr=Ei==null?void 0:Ei.filter(Un=>!Un.is_share))==null||pr.forEach(Un=>{const Lr=dr.getFieldValue([`${Un.group_id}`,"diffValue"])||[];console.log("prev:",Lr,Un.difficulty),Lr!=null&&Lr.includes[Un.difficulty]||dr.setFieldValue([`${Un.group_id}`,"diffValue"],Array.from(new Set([...Lr,Un.difficulty])))})):(Re((Ei==null?void 0:Ei.filter(Un=>!!Un.is_share).reduce((Un,Lr)=>Un+Lr.item_bank_num,0))||0),(Ui=Ei==null?void 0:Ei.filter(Un=>!!Un.is_share))==null||Ui.forEach(Un=>{const Lr=dr.getFieldValue([`${Un.group_id}`,"diffValue"])||[];Lr!=null&&Lr.includes[Un.difficulty]||dr.setFieldValue([`${Un.group_id}`,"diffValue"],Array.from(new Set([...Lr,Un.difficulty])))}));break}}},800)},[Zt,Ut,la,za]);const[Ht,Re]=(0,le.useState)(0);return le.createElement(St.default,{form:dr,onValuesChange:(lt,fr)=>vr(void 0,null,function*(){var sr,pr,Ui,Un;console.log("onValuesChange:",fr,lt);let Lr=0;if(ze(Ut)===tn.FileFolderAndDiff){const kr=yield dr.getFieldValue(),Zr=[],Er=[];for(const Wi of Object.keys(kr))if((pr=(sr=kr[Wi])==null?void 0:sr.diffValue)!=null&&pr.length&&Wi!=="null"&&Wi!==null){const Si=kr[Wi];Zr.push(Yn({id:Wi},Si))}const Eo={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"};Zr.map(Wi=>{var Si,Pi,Jr,Ur,Nr;Wi.id==0&&(Wi.diffNum=Mi==="1"?(Pi=(Si=ua==null?void 0:ua.navigation)==null?void 0:Si[0])==null?void 0:Pi.difficulty_count:(Ur=(Jr=jr==null?void 0:jr.navigation)==null?void 0:Jr[0])==null?void 0:Ur.difficulty_count),(Nr=Wi==null?void 0:Wi.diffValue)==null||Nr.map(Lo=>{var yr,Qr,tr,Ir,uo;const Zo={group_name:((yr=Wi.extra)==null?void 0:yr.name)||"",teacher_group_name:"",id:`${Wi.id}_${Lo}`,group_id:Wi.id,difficulty:Lo,item_bank_num:(Ir=(tr=(Qr=Wi.diffNum)==null?void 0:Qr.filter(ha=>ha.name===Eo[Lo]))==null?void 0:tr[0])==null?void 0:Ir.value};Mi==="2"&&(Zo.is_share=!0,Zo.teacher_group_id=Wi.id,Zo.teacher_group_name=(uo=Wi.extra)==null?void 0:uo.name),Er.push(Zo)})}),Lr=Er.reduce((Wi,Si)=>Wi+Si.item_bank_num,0),bn([...Er,...Ei==null?void 0:Ei.filter(Wi=>Mi==="1"?Wi.is_share:!Wi.is_share)])}else if(ze(Ut)===tn.All){const kr=[];for(const Zr of Object.keys(fr)){const{diffNum:Er=[],diffValue:Eo=[],extra:Wi={}}=fr[Zr];console.log("---",Wi);const[Si,Pi]=Zr.split("_");let Jr=(Un=(Ui=Wi.tag_disciplines)==null?void 0:Ui.filter(Ur=>parseInt(Ur.id)===parseInt(Pi)))==null?void 0:Un[0];Eo.forEach(Ur=>{var Nr;const Lo={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},yr=(Nr=Er==null?void 0:Er.find(tr=>tr.name===Lo[Ur]))==null?void 0:Nr.value,Qr={group_name:"",teacher_group_name:"",tag_discipline_name:(Jr==null?void 0:Jr.name)||Wi.tag_discipline_name,id:`${Zr}_${Ur}`,group_id:Si,is_share:!!(Jr!=null&&Jr.is_share||(Wi==null?void 0:Wi.type)==="3"),tag_discipline_id:Pi,difficulty:Ur,item_bank_num:yr};Lr+=yr,Wi.type==="0"?Qr.group_name=Wi.name:Qr.teacher_group_name=Wi.name,Mi==="2"&&(Qr.is_share=!0,Qr.teacher_group_id=Wi.id||0,Qr.teacher_group_name=Wi.name),yr>0&&kr.push(Qr)})}bn([...kr,...Ei==null?void 0:Ei.filter(Zr=>Mi==="1"?Zr.is_share:!Zr.is_share)])}Re(Lr)})},le.createElement(be.default,{destroyInactiveTabPane:!0,activeKey:Mi,onChange:lt=>wi(lt),style:{minHeight:260},tabBarExtraContent:{right:Mi==="2"&&(Tr==null?void 0:Tr.length)>0&&le.createElement(gn.default,{onChange:lt=>{Ca(lt)},value:To,style:{width:120}},le.createElement(gn.default.Option,{key:"all",value:"all"},"\u5168\u90E8"),Tr==null?void 0:Tr.map(lt=>le.createElement(gn.default.Option,{key:lt==null?void 0:lt.group_id,value:lt==null?void 0:lt.group_id},lt==null?void 0:lt.name)))},items:[{key:"1",label:"\u6211\u521B\u5EFA\u7684",children:(la==null?void 0:la.length)===0?le.createElement(Ct.Z,{spinning:sa},le.createElement(di.Z,{ButtonTwo:le.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")})):le.createElement("div",{className:$i.folderAreaWrapper},le.createElement(dt.Z,{justify:"space-between",align:"middle",className:$i.folderAreaHeader},le.createElement("span",null,"\u6587\u4EF6\u5939"),le.createElement("span",{className:"mr20"},"\u5DF2\u9009",le.createElement("span",{style:{color:"#3061D0"}}," ",Ht," "),"\u9898")),le.createElement(Ct.Z,{spinning:sa},le.createElement("div",{style:{minHeight:200}},la.length>0&&le.createElement(li.default,{checkable:!0,className:$i.folderWrapper,rootStyle:{paddingLeft:15,paddingRight:0,paddingTop:10},selectable:!1,onCheck:(lt,fr)=>Sa(lt,fr,"0"),checkedKeys:mo,checkStrictly:!0,treeData:la,showIcon:!0,blockNode:!0,defaultExpandAll:!0}))))},{key:"2",label:"\u56E2\u961F\u5171\u4EAB",children:(za==null?void 0:za.length)===0?le.createElement(Ct.Z,{spinning:Io},le.createElement(di.Z,{ButtonTwo:le.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")})):le.createElement("div",{className:$i.folderAreaWrapper},le.createElement(dt.Z,{justify:"space-between",align:"middle",className:$i.folderAreaHeader},le.createElement("span",null,"\u6587\u4EF6\u5939"),le.createElement("span",{className:"mr20"},"\u5DF2\u9009",le.createElement("span",{style:{color:"#3061D0"}}," ",Ht||0," "),"\u9898")),le.createElement(Ct.Z,{spinning:Io},le.createElement("div",{style:{minHeight:200}},(za==null?void 0:za.length)>0&&le.createElement(li.default,{checkable:!0,className:$i.folderWrapper,selectable:!1,rootStyle:{paddingLeft:15,paddingRight:0,paddingTop:10},onCheck:(lt,fr)=>Sa(lt,fr,"3"),checkedKeys:ar,checkStrictly:!0,treeData:za,showIcon:!0,blockNode:!0,defaultExpandAll:!0}))))}]}))},xn=Le(55305),Xt=Le(45937),ri=Object.defineProperty,Hi=Object.defineProperties,gi=Object.getOwnPropertyDescriptors,Ii=Object.getOwnPropertySymbols,Fi=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable,xr=(Ut,Zt,bn)=>Zt in Ut?ri(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,Sr=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))Fi.call(Zt,bn)&&xr(Ut,bn,Zt[bn]);if(Ii)for(var bn of Ii(Zt))Cr.call(Zt,bn)&&xr(Ut,bn,Zt[bn]);return Ut},hn=(Ut,Zt)=>Hi(Ut,gi(Zt)),ro=(Ut,Zt,bn)=>new Promise((zi,Ei)=>{var Mi=ti=>{try{Fn(bn.next(ti))}catch(dr){Ei(dr)}},wi=ti=>{try{Fn(bn.throw(ti))}catch(dr){Ei(dr)}},Fn=ti=>ti.done?zi(ti.value):Promise.resolve(ti.value).then(Mi,wi);Fn((bn=bn.apply(Ut,Zt)).next())});const Gr={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3};var yn=({ruleValue:Ut,setSelectData:Zt,currentItemType:bn,defaultData:zi,isFirst:Ei})=>{const[Mi,wi]=(0,le.useState)([]),[Fn,ti,dr,Tr]=(0,Xt.U)(nt,{source:"question",page:1,per_page:10,group_id:0,keyword:"",group_type:0,clazz:"ItemBanksGroup",sub_discipline_id:void 0,item_type:bn,show_children:!0});(0,le.useEffect)(()=>{ro(void 0,null,function*(){const ar=yield dr({},!0);wi((0,xn.L)(ar.disciplines))})},[]),console.log(zi),(0,le.useEffect)(()=>{if(Ei)switch(ze(Ut)){case tn.OnlyKnowledge:{mo(zi.map(ar=>ar.tag_discipline_id));break}case tn.KnowledgeAndDiff:{const ar=new Map;zi.forEach(oa=>{oa&&(ar.has(oa.tag_discipline_id)?ar.set(oa.tag_discipline_id,[...ar.get(oa.tag_discipline_id),oa.difficulty]):ar.set(oa.tag_discipline_id,[oa.difficulty]))});for(const[oa,la]of ar.entries())Vo.setFieldValue([oa,"diff"],la);break}}},[zi,Ut,Ei]);const[Vo]=St.default.useForm(),To=(0,le.useMemo)(()=>{const ar=[];let oa="",la="";const Ma={};for(const za of(Tr==null?void 0:Tr.disciplines)||[]){oa=za.name;for(const Ro of za.sub_disciplines){la=Ro.name;for(const ua of Ro.tag_disciplines){const ko={sub_discipline_name:`${oa}&${la}`,sub_discipline_id:Ro.id,tag_discipline_name:ua.name,id:ua.id,item_bank_num:ua.total_count,difficulty_count:ua.difficulty_count,tag_discipline_id:ua.id};ar.push(ko)}}}return ar},[Tr,zi]),Ca=[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",show:!0,render:(ar,oa)=>{const{item_bank_num:la}=oa;return le.createElement("div",null,ar,`(${la})`)}},{title:"\u65B9\u5411&\u8BFE\u7A0B",dataIndex:"sub_discipline_name",ellipsis:!0,show:!0},{title:"\u96BE\u5EA6",width:"35%",show:Ut.includes(On.Difficulty),render:(ar,oa)=>{const{id:la,difficulty_count:Ma,total_count:za,sub_discipline_name:Ro,tag_discipline_name:ua}=oa;return le.createElement(le.Fragment,null,le.createElement(St.default.Item,{name:[la,"diff"],noStyle:!0},le.createElement(Yt.default.Group,{style:{columnGap:12},options:Ma.map(ko=>({label:ko.name,value:Gr[ko.name]}))})),le.createElement(St.default.Item,{name:[la,"extra"],initialValue:{difficulty_count:Ma,total_count:za,sub_discipline_name:Ro,tag_discipline_name:ua},noStyle:!0},le.createElement("input",{type:"hidden"})))}}].filter(ar=>ar.show),[Sa,mo]=(0,le.useState)([]),_r=(0,le.useRef)(new Map);return le.createElement("div",{style:{marginTop:12}},le.createElement(dt.Z,{className:"mb20",align:"middle",gutter:20},le.createElement(Qt.Z,null,le.createElement(We.Z,{placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",size:"large",style:{width:240},options:Mi,onChange:ar=>{dr({sub_discipline_id:ar==null?void 0:ar[1]})}})),le.createElement(Qt.Z,null,le.createElement(cn.t7,{style:{width:300},placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\u8FDB\u884C\u641C\u7D22",value:Fn.keyword,onChange:ar=>dr({keyword:ar})}))),le.createElement(St.default,{form:Vo,onValuesChange:(ar,oa)=>{var la;console.log(oa),_r.current.clear();for(const Ma of Object.keys(oa)){const za={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Ro=oa[Ma],{difficulty_count:ua,total_count:ko}=Ro.extra||{};(la=Ro==null?void 0:Ro.diff)==null||la.forEach(jr=>{var Fa;const sa=(Fa=ua==null?void 0:ua.find(Io=>Io.name===za[jr]))==null?void 0:Fa.value,Xo=hn(Sr({},Ro.extra),{id:`${Ma}_${jr}`,difficulty:jr,item_bank_num:sa,tag_discipline_id:Ma});sa>0&&_r.current.set(`${Ma}_${jr}`,Xo)})}Zt([..._r.current.values()])}},(To==null?void 0:To.length)===0?le.createElement(di.Z,{ButtonTwo:le.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")}):le.createElement(Di.default,{rowSelection:ze(Ut)===tn.OnlyKnowledge?{preserveSelectedRowKeys:!0,type:"checkbox",onChange(ar,oa){console.log("table-selectedRowKeys:",ar,oa),mo(ar),Zt(oa)},getCheckboxProps:ar=>({disabled:ar.item_bank_num===0}),selectedRowKeys:Sa}:void 0,columns:Ca,dataSource:To,loading:ti,scroll:{y:480},rowKey:"id",pagination:!1})))},Xn=Object.defineProperty,rr=Object.defineProperties,er=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,so=Object.prototype.propertyIsEnumerable,vo=(Ut,Zt,bn)=>Zt in Ut?Xn(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,po=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))Wr.call(Zt,bn)&&vo(Ut,bn,Zt[bn]);if(Pr)for(var bn of Pr(Zt))so.call(Zt,bn)&&vo(Ut,bn,Zt[bn]);return Ut},yo=(Ut,Zt)=>rr(Ut,er(Zt)),Nn=(Ut,Zt,bn)=>new Promise((zi,Ei)=>{var Mi=ti=>{try{Fn(bn.next(ti))}catch(dr){Ei(dr)}},wi=ti=>{try{Fn(bn.throw(ti))}catch(dr){Ei(dr)}},Fn=ti=>ti.done?zi(ti.value):Promise.resolve(ti.value).then(Mi,wi);Fn((bn=bn.apply(Ut,Zt)).next())});const ia={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3};var Ar=({open:Ut,onCancel:Zt,setVisibleModalType:bn,currentItemType:zi})=>{var Ei;const{data:Mi,dispatch:wi}=(0,le.useContext)(ht),[Fn,ti]=(0,le.useState)([]),[dr,Tr]=(0,le.useState)(),Vo=(Ei=Mi==null?void 0:Mi.item_types)==null?void 0:Ei.find(la=>la.item_type===zi);(0,le.useEffect)(()=>{var la,Ma,za;if(Ut){const Ro=(la=Mi==null?void 0:Mi.item_types)==null?void 0:la.find(ua=>ua.item_type===zi);if((Ro==null?void 0:Ro.random_rule_type)!==tn.Shixun){const ua=kn[Ro==null?void 0:Ro.random_rule_type]||[];ti(ua);const ko=(za=(Ma=Mi==null?void 0:Mi.item_types)==null?void 0:Ma.find(jr=>jr.item_type===zi))==null?void 0:za.contents;switch(console.log("----xxx",ze(ua)),ze(ua)){case tn.OnlyDifficulty:{mo(ko.map(jr=>jr.difficulty));break}case tn.OnlyFileFolder:{mo({my:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)>=0)}),Tr({my:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)>=0)});break}case tn.FileFolderAndKnowledge:{mo({my:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)>=0)}),Tr({my:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:ko==null?void 0:ko.filter(jr=>parseInt(jr.teacher_group_id)>=0)});break}case tn.FileFolderAndDiff:{mo(ko),Tr(ko);break}case tn.All:{mo(ko),Tr(ko);break}default:mo(ko)}}}},[Ut]);const[To,Ca]=(0,le.useState)([]);(0,le.useEffect)(()=>{Ut&&Ye({item_type:zi}).then(la=>{la.status===0&&Ca(la.data)})},[Ut]),(0,le.useEffect)(()=>{console.log("selectData",dr)},[dr]);const[Sa,mo]=(0,le.useState)(),[_r,ar]=(0,le.useState)(!0);console.log("isFirst:",_r);const oa=la=>{ti(la),Tr([]),mo([]),ar(!1)};return le.createElement(en.default,{title:"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219",width:948,closable:!0,centered:!0,open:Ut,onCancel:Zt,destroyOnClose:!0,onOk:()=>Nn(void 0,null,function*(){var la,Ma,za,Ro,ua,ko,jr;if(dr===void 0){bn("");return}if(Object.prototype.toString.call(dr)==="[object Object]"&&!((la=dr.my)!=null&&la.length)&&!((Ma=dr.public)!=null&&Ma.length)){pt.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if(!Object.keys(dr).length&&!(dr!=null&&dr.length)){pt.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}const Fa=ze(Fn);switch(Fa){case tn.OnlyFileFolder:{wi({type:"editRule",payload:{itemType:zi,tableData:[...dr.my||[],...dr.public||[]],randomRuleType:Fa}});break}case tn.OnlyDifficulty:{const sa=(Ro=(za=Mi==null?void 0:Mi.item_types)==null?void 0:za.find(Io=>Io.item_type===zi))==null?void 0:Ro.contents;let Xo=[{},{value:(ua=To.find(Io=>Io.name==="\u7B80\u5355"))==null?void 0:ua.value},{value:(ko=To.find(Io=>Io.name==="\u9002\u4E2D"))==null?void 0:ko.value},{value:(jr=To.find(Io=>Io.name==="\u56F0\u96BE"))==null?void 0:jr.value}];wi({type:"editRule",payload:{itemType:zi,tableData:dr.map((Io,ca)=>{var Wa,gt,Ht,Re;return{difficulty:Io,id:ca,quanlity:((gt=(Wa=sa==null?void 0:sa.filter(lt=>lt.id===ca))==null?void 0:Wa[0])==null?void 0:gt.quanlity)||1,item_bank_num:(To==null?void 0:To.length)===1?(Ht=To[0])==null?void 0:Ht.value:(Re=Xo==null?void 0:Xo[Io])==null?void 0:Re.value}}),randomRuleType:Fa}});break}case tn.OnlyKnowledge:{wi({type:"editRule",payload:{itemType:zi,tableData:dr.map(sa=>yo(po({},sa),{quanlity:sa.quanlity||1})),randomRuleType:Fa}});break}case tn.KnowledgeAndDiff:{wi({type:"editRule",payload:{itemType:zi,tableData:dr.map(sa=>yo(po({},sa),{quanlity:sa.quanlity||1})),randomRuleType:Fa}});break}case tn.FileFolderAndDiff:{wi({type:"editRule",payload:{itemType:zi,tableData:dr.map(sa=>yo(po({},sa),{quanlity:sa.quanlity||1})),randomRuleType:Fa}});break}case tn.FileFolderAndKnowledge:{wi({type:"editRule",payload:{itemType:zi,tableData:[...dr.my||[],...dr.public||[]],randomRuleType:Fa}});break}case tn.All:{wi({type:"editRule",payload:{itemType:zi,tableData:dr.map(sa=>yo(po({},sa),{quanlity:sa.quanlity||1})),randomRuleType:Fa}});break}}bn("")})},le.createElement(Yt.default.Group,{className:`${$i.ruleCheckBox}`,style:{marginBottom:8},value:Fn,onChange:la=>{var Ma;Fn!=null&&Fn.length&&((Ma=Vo==null?void 0:Vo.contents)==null?void 0:Ma.length)>0?en.default.confirm({title:"\u63D0\u793A",content:"\u5207\u6362\u89C4\u5219\u540E\uFF0C\u4E4B\u524D\u7684\u62BD\u9898\u914D\u7F6E\u5C06\u88AB\u6E05\u7A7A\uFF01",okText:"\u7ACB\u5373\u5207\u6362",cancelText:"\u6682\u4E0D\u5207\u6362",onOk:()=>oa(la)}):oa(la)},options:[{label:"\u6307\u5B9A\u6587\u4EF6\u5939\u62BD\u9898",value:On.FileFolder},{label:"\u6307\u5B9A\u96BE\u5EA6\u62BD\u9898",value:On.Difficulty},{label:"\u6307\u5B9A\u77E5\u8BC6\u70B9\u62BD\u9898",value:On.Knowledge}]}),Fn.includes(On.FileFolder)?le.createElement($t,{defaultData:Sa,selectData:dr,ruleValue:Fn,setSelectData:Tr,currentItemType:zi}):Fn.includes(On.Knowledge)?le.createElement(yn,{defaultData:Sa,isFirst:_r,ruleValue:Fn,setSelectData:Tr,currentItemType:zi}):Fn.includes(On.Difficulty)?le.createElement("div",{style:{marginTop:12}},le.createElement("span",{className:"mr20",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(Yt.default.Group,{style:{columnGap:12},options:To.map(la=>({label:la.name,value:ia[la.name]})),value:dr||Sa,onChange:la=>Tr(la)})):null)},br=({open:Ut,onCancel:Zt,setVisibleModalType:bn,currentItemType:zi})=>Ut?le.createElement(Ar,{open:Ut,onCancel:Zt,setVisibleModalType:bn,currentItemType:zi}):null,na=Le(25399),Do=Le(58433),ho=Le(82264),Jo=Le(76902),Vt=Le(51257),jn=Le(61485),Gt=Le(94361),ai=({open:Ut,onCancel:Zt,onOk:bn})=>{const{data:zi}=(0,le.useContext)(ht),Ei=(0,Do.g)(),[Mi,wi,Fn,ti]=(0,Xt.U)(ho.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[dr,Tr]=(0,le.useState)(!1);(0,le.useEffect)(()=>{if(Ut){Fn({page:1,limit:10,type:0},!0).then(_r=>{(_r==null?void 0:_r.shixuns_count)===0&&Tr(!0)});const mo=zi.item_types.find(_r=>_r.item_type==="PRACTICAL");To(mo.item_banks.map(_r=>_r.id)),Sa(mo.item_banks)}},[Ut,zi]);const[Vo,To]=(0,le.useState)([]),[Ca,Sa]=(0,le.useState)([]);return le.createElement(en.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:Ut,width:948,centered:!0,closable:!0,onCancel:Zt,onOk:()=>bn(Ca),destroyOnClose:!0},le.createElement(dt.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},le.createElement(Qt.Z,null,le.createElement(We.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:Ei,onChange:mo=>{Fn({page:1,discipline_id:mo==null?void 0:mo[0],sub_discipline_id:mo==null?void 0:mo[1]})}}),le.createElement(gn.default,{className:"ml20",style:{width:118},size:"large",placeholder:"\u96BE\u5EA6",allowClear:!0,options:[{label:"\u521D\u7EA7",value:1},{label:"\u4E2D\u7EA7",value:2},{label:"\u4E2D\u9AD8\u7EA7",value:3},{label:"\u9AD8\u7EA7",value:4}],onChange:mo=>Fn({page:1,diff:mo})}),le.createElement(gn.default,{className:"ml20",placeholder:"\u5168\u90E8\u72B6\u6001",style:{width:118},size:"large",allowClear:!0,options:[{label:"\u672A\u53D1\u5E03",value:"unpublish"},{label:"\u9759\u9ED8\u53D1\u5E03",value:"silent_publish"},{label:"\u516C\u5F00\u53D1\u5E03",value:"public_publish"}],onChange:mo=>Fn({page:1,shixun_publish_status:mo})})),le.createElement(cn.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:mo=>{Fn({keyword:mo,page:1})}})),dr?le.createElement("div",null,le.createElement(di.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,Vt.xg)("/shixuns")})):le.createElement(Di.default,{loading:wi,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(mo,_r)=>le.createElement("div",{style:{display:"flex",alignItems:"center"}},le.createElement("div",{className:_r!=null&&_r.high_resources_consume?ln.title:"",title:mo||"--"},le.createElement(Jo.Z,{key:1,showLines:1,showTextOnly:!0,value:mo||"--"})),(_r==null?void 0:_r.high_resources_consume)&&le.createElement(Gt.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(mo,_r,ar)=>le.createElement("span",null,mo||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:le.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",le.createElement(na.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},le.createElement(jn.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(mo,_r,ar)=>le.createElement("span",null,mo||"- -")},{title:"\u64CD\u4F5C",render(mo,_r){const{title:ar,challenge_names:oa,author_name:la,identifier:Ma,author_school_name:za,study_count:Ro}=_r||{};return le.createElement("div",null,le.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{en.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:le.createElement("div",null,le.createElement(Jo.Z,{value:ar,style:{marginBottom:18}}),le.createElement("div",{className:ln.challengeNameWrapper},oa.map((ua,ko)=>le.createElement("div",{className:ln.challengeName,key:ko},"\u7B2C",(0,Vt.EM)(ko+1),"\u9898\xA0",ua))),le.createElement(dt.Z,{className:ln.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},le.createElement(Qt.Z,{className:ln.shixunInfoWrapper},le.createElement("span",null,"\u521B\u5EFA\u8005"),le.createElement("span",{className:ln.shixunInfo},la.split("\u3001")[0]),le.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),le.createElement("span",{className:ln.shixunInfo},za),le.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),le.createElement("span",{className:ln.shixunInfo},Ro)),le.createElement(De.ZP,{type:"primary",className:ln.btnToDetail,onClick:()=>(0,Vt.xg)(`/shixuns/${Ma}/challenges?exercise=true`)},le.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(_r==null?void 0:_r.shixun_tag_num)===1&&le.createElement("a",{target:"_blank",href:`/shixuns/${_r==null?void 0:_r.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:ti==null?void 0:ti.items,rowSelection:{selectedRowKeys:Vo,preserveSelectedRowKeys:!0,getCheckboxProps:mo=>({disabled:mo.shixun_tag_num===1}),onChange(mo,_r){var ar,oa,la;console.log(mo),To(mo);const Ma=[];for(const Ro of Ca)mo.includes(Ro.id)&&Ma.push(Ro);const za=Ma.map(Ro=>Ro.id);for(const Ro of _r)Ro&&mo.includes(Ro.id)&&!za.includes(Ro.id)&&Ma.push({id:Ro.id,difficulty:Ro.level,identifier:Ro.identifier,name:Ro.name,real_name:(ar=Ro==null?void 0:Ro.author_name)==null?void 0:ar.split("\u3001")[0],school_name:Ro.author_school_name,challenge_names:Ro.challenge_names,challenges:(oa=Ro.challenge_names)==null?void 0:oa.map((ua,ko)=>({subject:ua,id:ko,score:5})),score:((la=Ro.challenge_names)==null?void 0:la.length)*5,study_count:Ro.study_count,challenges_count:Ro.challenges_count});Sa(Ma)}},pagination:{current:Mi.page,pageSize:Mi.limit,total:ti==null?void 0:ti.items_count,showTotal:mo=>le.createElement("span",null,"\u5171\xA0",le.createElement("span",{style:{color:"#165DFF"}},mo),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(mo,_r){Fn({page:mo,limit:_r})},size:"default"},scroll:{y:400}}))},hi=Le(71426),_i=Le(59301),Yi=Object.defineProperty,Ti=Object.defineProperties,In=Object.getOwnPropertyDescriptors,si=Object.getOwnPropertySymbols,yi=Object.prototype.hasOwnProperty,$n=Object.prototype.propertyIsEnumerable,pi=(Ut,Zt,bn)=>Zt in Ut?Yi(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,ur=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))yi.call(Zt,bn)&&pi(Ut,bn,Zt[bn]);if(si)for(var bn of si(Zt))$n.call(Zt,bn)&&pi(Ut,bn,Zt[bn]);return Ut},Ki=(Ut,Zt)=>Ti(Ut,In(Zt)),Pn=({onDelete:Ut,list:Zt,onSelect:bn})=>{const[zi,Ei]=(0,le.useState)(!1),{dispatch:Mi,disabled:wi}=(0,le.useContext)(ht),Fn=(To,Ca,Sa)=>{const mo=Array.from(To),[_r]=mo.splice(Ca,1);return mo.splice(Sa,0,_r),mo},[ti,dr]=(0,le.useState)(null),[Tr,Vo]=(0,le.useState)(!1);return _i.createElement(hi.Z5,{onDragStart:()=>{Vo(!0)},onDragEnd:To=>{if(Vo(!1),!To.destination)return;const Ca=Fn(Zt,To.source.index,To.destination.index);Mi({type:"updateItemTypes",payload:Ca})}},_i.createElement(hi.bK,{droppableId:"droppable"},(To,Ca)=>_i.createElement("div",Ki(ur({},To.droppableProps),{ref:To.innerRef}),_i.createElement(Ct.Z,{spinning:zi},Zt.map((Sa,mo)=>_i.createElement(hi._l,{key:mo,draggableId:mo.toString(),index:mo,isDragDisabled:ti!==Sa.item_type},(_r,ar)=>_i.createElement(dt.Z,Ki(ur(ur({align:"middle",wrap:!1,ref:_r.innerRef},_r.draggableProps),_r.dragHandleProps),{className:`${ln.dragItem} ${Tr?ln.dragging:""}`}),_i.createElement(Qt.Z,{className:ln.contentArea,onClick:()=>{bn(Sa.item_type),(0,Vt.k3)()}},_i.createElement("span",{className:ln.blackText},(0,Vt.EM)(mo+1),"\u3001\u3010",Sa.item_type_text,"\u3011"),_i.createElement(na.Z,{title:`\uFF08${Sa.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(Sa.total_score).toFixed(1)}\u5206\uFF09`},_i.createElement("span",{className:ln.greyText},`\uFF08${Sa.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(Sa.total_score).toFixed(1)}\u5206\uFF09`))),!wi&&_i.createElement(_i.Fragment,null,_i.createElement(na.Z,{title:"\u957F\u6309\u53EF\u8FDB\u884C\u62D6\u62FD\u6392\u5E8F",open:ti===Sa.item_type&&!Tr},_i.createElement("div",{style:{cursor:"grab"},className:`${ln.iconWrapper} ${Tr?ln.hidden:""}`,onMouseEnter:()=>{dr(Sa.item_type)},onMouseLeave:()=>dr(null)},_i.createElement("i",{className:`iconfont icon-tuodong1 ${ln.dragIcon}`}))),_i.createElement(na.Z,{title:"\u5220\u9664"},_i.createElement("div",{className:`${ln.iconWrapper} ${Tr?ln.hidden:""}`,style:{cursor:"pointer"},onClick:()=>Ut(Sa.item_type)},_i.createElement("i",{className:`iconfont icon-shanchu12 ${ln.deleteIcon}`})))))))),To.placeholder)))},hr=Le(71114),or={flex_box_center:"flex_box_center___ppkzA",flex_space_between:"flex_space_between___Z1syx",flex_box_vertical_center:"flex_box_vertical_center___twJ9S",flex_box_center_end:"flex_box_center_end___uI0uW",flex_box_column:"flex_box_column___JRp7D",timelineWrapper:"timelineWrapper___LP9aM",title:"title___KUHj_",desc:"desc___ubc8E",titles:"titles___njkjf",questionDetailWrapper:"questionDetailWrapper___p4SFM",questionTitle:"questionTitle___JC9X6",questionScoreInfo:"questionScoreInfo___NgOJI",deleteIcon:"deleteIcon___oMVTN",deleteBtn:"deleteBtn___JUPEl",normalText:"normalText___FW9Y_",folderIcon:"folderIcon___gvacQ",challengeNameWrapper:"challengeNameWrapper___fG7Vv",challengeName:"challengeName___Ia1Xs",shixunPreviewFooter:"shixunPreviewFooter___rKsnN",shixunInfoWrapper:"shixunInfoWrapper___FEnDb",shixunInfo:"shixunInfo___TbrA2",btnToDetail:"btnToDetail___dqLQP",q_title:"q_title___qnv4p"},xo=Le(73631),Yr=Le(31328);const qo=(Ut,Zt,bn,zi)=>{const Ei={[tn.OnlyDifficulty]:[{title:"\u96BE\u5EA6",key:"difficulty",render(Mi,wi){const{difficulty:Fn}=wi;return le.createElement("span",{style:{color:Ee[Fn].color}},Ee[Fn].label)}}],[tn.OnlyKnowledge]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u65B9\u5411&\u8BFE\u7A0B",dataIndex:"sub_discipline_name",width:180,ellipsis:{showTitle:!0},render(Mi,wi){return`${Mi}`}}],[tn.OnlyFileFolder]:[{title:"\u6587\u4EF6\u5939",render(Mi,wi,Fn){const{group_name:ti,teacher_group_name:dr}=wi,Tr=ti||dr,Vo=dr?Yr:xo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:Vo,className:or.folderIcon})," ",le.createElement(na.Z,{title:Tr},le.createElement("span",{className:or.titles},Tr)))}},{title:"\u7C7B\u578B",render(Mi,wi){const{teacher_group_name:Fn}=wi;return le.createElement("span",null,Fn?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}}],[tn.KnowledgeAndDiff]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:{showTitle:!0}},{title:"\u65B9\u5411&\u8BFE\u7A0B",width:180,dataIndex:"sub_discipline_name",ellipsis:{showTitle:!0}},{title:"\u96BE\u5EA6",key:"difficulty",render(Mi,wi){const{difficulty:Fn}=wi;return le.createElement("span",{style:{color:Ee[Fn].color}},Ee[Fn].label)}}],[tn.FileFolderAndKnowledge]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u6587\u4EF6\u5939",render(Mi,wi){const{group_name:Fn,teacher_group_name:ti}=wi,dr=Fn||ti,Tr=ti?Yr:xo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:Tr,className:or.folderIcon})," ",le.createElement(na.Z,{title:dr},le.createElement("span",{className:or.titles},dr)))}},{title:"\u7C7B\u578B",render(Mi,wi){const{teacher_group_name:Fn}=wi;return le.createElement("span",null,Fn?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}}],[tn.FileFolderAndDiff]:[{title:"\u6587\u4EF6\u5939",render(Mi,wi){const{group_name:Fn,teacher_group_name:ti}=wi,dr=Fn||ti,Tr=ti?Yr:xo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:Tr,className:or.folderIcon})," ",le.createElement(na.Z,{title:dr},le.createElement("span",{className:or.titles},dr)))}},{title:"\u7C7B\u578B",render(Mi,wi){const{teacher_group_name:Fn}=wi;return le.createElement("span",null,Fn?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}},{title:"\u96BE\u5EA6",key:"difficulty",render(Mi,wi){const{difficulty:Fn}=wi;return le.createElement("span",{style:{color:Ee[Fn].color}},Ee[Fn].label)}}],[tn.All]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u6587\u4EF6\u5939",render(Mi,wi){const{group_name:Fn,teacher_group_name:ti,teacher_group_id:dr}=wi,Tr=Fn||ti,Vo=dr||dr===0?Yr:xo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:Vo,className:or.folderIcon})," ",le.createElement(na.Z,{title:Tr},le.createElement("span",{className:or.titles},Tr)))}},{title:"\u7C7B\u578B",render(Mi,wi){const{teacher_group_id:Fn}=wi;return le.createElement("span",null,Fn||Fn===0?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}},{title:"\u96BE\u5EA6",key:"difficulty",render(Mi,wi){const{difficulty:Fn}=wi;return le.createElement("span",{style:{color:Ee[Fn].color}},Ee[Fn].label)}}],[tn.Shixun]:[]};for(const Mi of Object.values(Ei))Mi.push({title:"\u62BD\u9898\u6570\u91CF",key:"quanlity",render(wi,Fn){const{item_bank_num:ti,quanlity:dr,id:Tr,teacher_group_id:Vo}=Fn||{};return le.createElement(dt.Z,{align:"middle"},le.createElement(kt.Z,{disabled:zi,min:1,max:ti,size:"large",precision:0,value:dr,onChange:To=>{Zt({type:"changeQuestionNum",payload:{itemType:bn,id:Tr,num:To,teacher_group_id:Vo}})}}),le.createElement("span",{className:"ml10 font14",style:{color:"#333333"}},"/",ti))}},{title:"\u64CD\u4F5C",key:"action",align:"right",render(wi,Fn){const{id:ti,is_share:dr}=Fn;return zi?le.createElement("span",{className:"cursorNotAllowed c-grey-999"},"\u5220\u9664"):le.createElement("span",{className:or.deleteBtn,onClick:()=>{Zt({type:"deleteRule",payload:{itemType:bn,id:ti,is_share:dr}})}},"\u5220\u9664")}});return Ei[Ut]},Ko=({setVisibleModalType:Ut})=>{var Zt,bn,zi,Ei;const{data:Mi,dispatch:wi,disabled:Fn}=(0,le.useContext)(ht),ti=(Zt=Mi==null?void 0:Mi.item_types)==null?void 0:Zt.find(dr=>dr.item_type==="PRACTICAL");return le.createElement(hr.Z,{className:or.timelineWrapper,items:[{children:le.createElement("div",{style:{transform:"translateY(-4px)"}},le.createElement(dt.Z,{className:"mb20",align:"middle",justify:"space-between"},le.createElement(Qt.Z,null,le.createElement("span",{className:or.title},"\u9898\u5E93\u9009\u9898"),le.createElement("span",{className:or.desc},"\uFF08\u9700\u8981\u5148\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9\u5B9E\u8BAD\u9898\uFF0C\u518D\u8BBE\u7F6E\u4ECE\u5DF2\u9009\u5B9E\u8BAD\u9898\u4E2D\u968F\u673A\u62BD\u9898\u7684\u6570\u91CF\uFF09")),!Fn&&le.createElement(cn.op,{style:{width:102},onClick:()=>Ut("selectShixun")},"\u4ECE\u9898\u5E93\u9009\u62E9")),((bn=ti==null?void 0:ti.item_banks)==null?void 0:bn.length)===0?le.createElement(di.Z,{customText:"\u6682\u65E0\u5F85\u62BD\u8BD5\u9898\uFF0C\u8BF7\u5148\u4ECE\u9898\u5E93\u8FDB\u884C\u9009\u62E9\uFF5E"}):le.createElement(Di.default,{rowKey:"id",className:"mb10",columns:[{title:"\u5E8F\u53F7",width:60,render(dr,Tr,Vo){return le.createElement("span",null,Vo+1)}},{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"40%",ellipsis:{showTitle:!0},render:(dr,Tr)=>le.createElement("div",{style:{display:"flex",alignItems:"center"}},le.createElement("div",{className:Tr!=null&&Tr.high_resources_consume?or.q_title:"",title:dr||"--"},le.createElement(Jo.Z,{key:1,showLines:1,showTextOnly:!0,value:dr})),(Tr==null?void 0:Tr.high_resources_consume)&&le.createElement(Gt.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(dr,Tr,Vo)=>le.createElement("span",null,dr||"- -")},{title:"\u96BE\u5EA6",dataIndex:"difficulty"},{title:"\u64CD\u4F5C",align:"right",width:180,render(dr,Tr,Vo){const{id:To,identifier:Ca,name:Sa,challenge_names:mo=[],real_name:_r,school_name:ar,study_count:oa,challenges:la=[]}=Tr||{};return le.createElement("div",null,le.createElement("span",{style:{color:"#165DFF",cursor:"pointer",marginLeft:20},onClick:()=>{en.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:le.createElement("div",null,le.createElement(Jo.Z,{value:Sa,style:{marginBottom:18}}),le.createElement("div",{className:or.challengeNameWrapper},la==null?void 0:la.map((Ma,za)=>le.createElement("div",{className:or.challengeName,key:za},"\u7B2C",(0,Vt.EM)(za+1),"\u9898\xA0",Ma==null?void 0:Ma.subject))),le.createElement(dt.Z,{className:or.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},le.createElement(Qt.Z,{className:or.shixunInfoWrapper},le.createElement("span",null,"\u521B\u5EFA\u8005"),le.createElement("span",{className:or.shixunInfo},_r),le.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),le.createElement("span",{className:or.shixunInfo},ar),le.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),le.createElement("span",{className:or.shixunInfo},oa)),le.createElement(De.ZP,{type:"primary",className:or.btnToDetail,onClick:()=>(0,Vt.xg)(`/shixuns/${Ca}/challenges?exercise=true`)},le.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),!Fn&&le.createElement("span",{onClick:()=>{wi({type:"deleteShixunQuestion",payload:{shixunId:To}})},className:`ml20 ${or.deleteBtn}`},"\u5220\u9664"))}}],dataSource:(ti==null?void 0:ti.item_banks)||[],pagination:!1}))},{children:le.createElement(dt.Z,{style:{transform:(zi=ti==null?void 0:ti.item_banks)!=null&&zi.length?"translateY(-8px)":"none"},align:"middle",justify:"space-between"},le.createElement("span",{className:or.title},"\u5DF2\u9009\u5B9E\u8BAD\u9898\u4E2D\u968F\u673A\u62BD\u9898"),!!((Ei=ti==null?void 0:ti.item_banks)!=null&&Ei.length)&&le.createElement(Qt.Z,null,le.createElement(dt.Z,{align:"middle"},le.createElement("span",{className:or.normalText},"\u62BD\u9898\u6570\u91CF"),le.createElement(kt.Z,{min:0,disabled:Fn,max:ti==null?void 0:ti.item_bank_num,size:"large",className:"ml10 mr10",value:(ti==null?void 0:ti.item_bank_count)||1,onChange:dr=>wi({type:"changeQuestionNum",payload:{num:dr||1,itemType:"PRACTICAL"}})}),le.createElement("span",{className:`${or.normalText} mr30`},"/",ti==null?void 0:ti.item_bank_num),le.createElement("span",{className:or.normalText},"\u6BCF\u9898\u5206\u503C"),le.createElement(kt.Z,{disabled:Fn,min:0,max:100,size:"large",precision:1,className:"ml10 mr10",value:ti==null?void 0:ti.score,onChange:dr=>wi({type:"changeQuestionScore",payload:{score:dr,itemType:"PRACTICAL"}})}),le.createElement("span",{className:or.normalText},"\u5206"))))}]})};var ra=({setVisibleModalType:Ut,currentItemType:Zt,onDelete:bn})=>{var zi,Ei;const Mi=(0,Oe.useParams)(),{data:wi,dispatch:Fn,disabled:ti}=(0,le.useContext)(ht),dr=((zi=wi==null?void 0:wi.item_types)==null?void 0:zi.findIndex(Vo=>Vo.item_type===Zt))+1,Tr=(Ei=wi==null?void 0:wi.item_types)==null?void 0:Ei.find(Vo=>Vo.item_type===Zt);return le.createElement("div",{className:or.questionDetailWrapper},le.createElement(dt.Z,{justify:"space-between",align:"middle",className:"mb30"},le.createElement(Qt.Z,null,le.createElement("span",{className:or.questionTitle},`${(0,Vt.EM)(dr)}\u3001${Tr==null?void 0:Tr.item_type_text}`),le.createElement("span",{className:or.questionScoreInfo},"\uFF08",le.createElement("span",{style:{color:"#3061D0"}},Tr==null?void 0:Tr.item_bank_count),"\u5C0F\u9898 ",le.createElement("span",null,"\uFF0C\u5171",le.createElement("span",{style:{color:"#3061D0"}},Tr==null?void 0:Tr.total_score),"\u5206"),"\uFF09")),!ti&&le.createElement("i",{className:`iconfont icon-shanchutimu ${or.deleteIcon}`,onClick:()=>bn(Zt)})),Zt==="PRACTICAL"?le.createElement(Ko,{setVisibleModalType:Ut}):le.createElement(le.Fragment,null,(Tr==null?void 0:Tr.contents.length)===0?le.createElement(di.Z,{styles:{margin:"70px auto 100px auto"},customText:le.createElement("span",null,"\u6682\u65E0\u62BD\u9898\u89C4\u5219\uFF0C\u652F\u6301",le.createElement("span",{style:{color:"#EA9741"}},"\u6307\u5B9A\u6587\u4EF6\u5939\u3001\u96BE\u5EA6\u3001\u77E5\u8BC6\u70B9"),"\u8FDB\u884C\u62BD\u9898\uFF5E"),ButtonTwo:(Mi==null?void 0:Mi.id)&&le.createElement(dt.Z,{justify:"center",className:"mt30"},le.createElement(cn.op,{style:{width:136,marginTop:-10},onClick:()=>Ut("rule")},"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219"))}):le.createElement(le.Fragment,null,le.createElement(dt.Z,{justify:"space-between",align:"middle",className:"mb20"},le.createElement(Qt.Z,null,le.createElement(dt.Z,{align:"middle"},le.createElement("span",{className:`${or.normalText}`},"\u6BCF\u9898\u5206\u503C"),le.createElement(kt.Z,{disabled:ti,size:"large",className:"ml10 mr10",min:.1,max:100,value:Tr==null?void 0:Tr.score,precision:1,onChange:Vo=>Fn({type:"changeQuestionScore",payload:{score:Vo,itemType:Zt}})}),le.createElement("span",{className:or.normalText},"\u5206"))),(Mi==null?void 0:Mi.id)&&le.createElement(cn.op,{onClick:()=>Ut("rule")},"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219")),le.createElement(Di.default,{columns:qo(Tr==null?void 0:Tr.random_rule_type,Fn,Zt,ti),dataSource:Tr==null?void 0:Tr.contents,pagination:!1,rowKey:"id"}))))},Uo=Le(84842),wa=Le(81722),Wt=Le(48790),Ho=Le(32637),wr=Le(59301),no=Object.defineProperty,bo=Object.defineProperties,oo=Object.getOwnPropertyDescriptors,fa=Object.getOwnPropertySymbols,ga=Object.prototype.hasOwnProperty,Mo=Object.prototype.propertyIsEnumerable,Fo=(Ut,Zt,bn)=>Zt in Ut?no(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,vs=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))ga.call(Zt,bn)&&Fo(Ut,bn,Zt[bn]);if(fa)for(var bn of fa(Zt))Mo.call(Zt,bn)&&Fo(Ut,bn,Zt[bn]);return Ut},es=(Ut,Zt)=>bo(Ut,oo(Zt)),ps=(Ut,Zt,bn)=>new Promise((zi,Ei)=>{var Mi=ti=>{try{Fn(bn.next(ti))}catch(dr){Ei(dr)}},wi=ti=>{try{Fn(bn.throw(ti))}catch(dr){Ei(dr)}},Fn=ti=>ti.done?zi(ti.value):Promise.resolve(ti.value).then(Mi,wi);Fn((bn=bn.apply(Ut,Zt)).next())}),Kr=({})=>{var Ut,Zt,bn,zi,Ei,Mi,wi,Fn,ti,dr,Tr,Vo,To,Ca,Sa;const[mo]=(0,Oe.useSearchParams)(),_r=(0,Oe.useParams)(),{data:ar,dispatch:oa,setPreview:la,getData:Ma,handlePreview:za,disabled:Ro}=(0,le.useContext)(ht),[ua,ko]=(0,le.useState)(""),[jr,Fa]=(0,le.useState)((Zt=(Ut=ar==null?void 0:ar.item_types)==null?void 0:Ut[0])==null?void 0:Zt.item_type),[sa,Xo]=(0,le.useState)(!0),[Io,ca]=(0,le.useState)(!1),Wa=(lt,fr)=>ps(void 0,null,function*(){var sr,pr,Ui,Un,Lr,kr;const Zr=ar.item_types.map(Pi=>Pi.item_type_text),Er=(sr=ar==null?void 0:ar.item_types)==null?void 0:sr.filter(Pi=>{var Jr,Ur;return((Jr=Pi.contents)==null?void 0:Jr.length)>0||((Ur=Pi==null?void 0:Pi.item_banks)==null?void 0:Ur.length)>0});if(ar.sort_by_item_type=Zr,!((pr=ar.item_types)!=null&&pr.length)){pt.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if((Er==null?void 0:Er.length)===0){pt.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}let Eo=()=>ps(void 0,null,function*(){const Pi=(0,it.cloneDeep)(ar),{item_types:Jr}=Pi||{};Pi.item_types=Jr.filter(Nr=>Nr.item_type===jr),(yield Ze(_r.id||_r.categoryId,Pi)).status===0&&(Fa(fr),pt.ZP.success("\u4FDD\u5B58\u6210\u529F"),lt||Oe.history.push("/paperlibrary"))}),Wi=(Un=(Ui=ar==null?void 0:ar.item_types)==null?void 0:Ui.filter(Pi=>Pi.item_type_text==="\u5B9E\u8BAD\u9898")[0])==null?void 0:Un.item_banks,Si=0;Wi==null||Wi.map(Pi=>{Pi.high_resources_consume&&(Si=Si+1)}),console.log(Si),Si>0?en.default.info({centered:!0,icon:null,width:600,okText:"\u6211\u77E5\u9053\u4E86",title:"\u63D0\u793A",content:wr.createElement("div",null,wr.createElement("div",{className:ln.tipcontent},wr.createElement("div",null,wr.createElement("div",{className:ln.name},"\u60A8\u597D\uFF01",(Lr=(0,Wt.eY)())==null?void 0:Lr.username,"\uFF08",(kr=(0,Wt.eY)())==null?void 0:kr.login,"\uFF09\uFF1A"),wr.createElement("div",{className:ln.tip},"\u5F53\u524D\u8BD5\u5377\u5305\u542B\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002",wr.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002\u53D1\u5E03\u8003\u8BD5\u524D\uFF0C\u8BF7\u5148\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u83B7\u53D6\u6388\u6743\u7801\u3002"),wr.createElement("div",{className:ln.info},wr.createElement("i",{className:"iconfont icon-xunifangzhenti1 mr10 font26"}),wr.createElement("span",{className:"mr10",style:{color:"#6A7283"}},"\u9AD8\u6D88\u8017\u5B9E\u9A8C"),wr.createElement("span",{style:{color:"#232B40"}},`${Si}\u4E2A`))),wr.createElement("div",null,wr.createElement("div",{className:ln.img},wr.createElement("img",{src:Ho,width:"124px",height:"124px"})),wr.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")))),onOk:()=>{Eo()}}):Eo()}),gt=(lt,fr,sr,pr=!1)=>ps(void 0,null,function*(){console.log(ar);const Ui=es(vs(vs({},ar.exercise),_r),{exerciseId:_r.categoryId,sort_by_item_type:ar.sort_by_item_type,difficulty:ar.examination_bank.difficulty,exam_notes:ar.examination_bank.exam_notes,exercise_name:ar.examination_bank.name,time:ar.examination_bank.time,changed_item_type:jr,item_types:ar.item_types,sub_discipline_id:ar.examination_bank.sub_discipline_id});(!lt||fr===1)&&(Ui.is_reset=1);const Un=yield(0,wa.wy)(Ui);return Un.status===0&&(pr||pt.ZP.success("\u4FEE\u6539\u6210\u529F "),Fa(sr),lt||Oe.history.push(`/classrooms/${_r.coursesId}/exercise/${_r.categoryId}/detail?random=true`)),Un}),Ht=lt=>{en.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,closable:!0,content:wr.createElement("div",null,"\u786E\u8BA4\u5220\u9664\u8BE5\u9898\u578B\uFF1F"),onOk:()=>ps(void 0,null,function*(){var fr,sr,pr,Ui;if(_r.id){if((yield Et(_r.id,{item_type:[lt]})).status!==0)return}else{const Un=yield Pt(_r.categoryId,{item_type:[lt]});if(Ma(),Un.status!==0)return}if(oa({type:"deleteQuestionType",payload:lt}),lt===jr){const Un=He(ar,{type:"deleteQuestionType",payload:lt});Fa(Un.item_types.length?Un.item_types[0].item_type:(sr=(fr=ar==null?void 0:ar.item_types)==null?void 0:fr[0])==null?void 0:sr.item_type)}else Fa((Ui=(pr=ar==null?void 0:ar.item_types)==null?void 0:pr[0])==null?void 0:Ui.item_type)})})};(0,le.useEffect)(()=>{var lt;(lt=ar==null?void 0:ar.examination_bank)!=null&<.name&&Xo(!1),(0,Vt.Dk)("\u968F\u673A\u7EC4\u5377")},[(bn=ar==null?void 0:ar.examination_bank)==null?void 0:bn.name]);const Re=()=>ps(void 0,null,function*(){var lt;let fr=yield gt(!0,1,jr,!0);if((fr==null?void 0:fr.status)===0){const sr=yield(0,ne.ZP)(`/api/exercises/${_r==null?void 0:_r.categoryId}/simulate_start_answer.json`,{method:"get",params:{coursesId:_r==null?void 0:_r.coursesId,categoryId:_r==null?void 0:_r.categoryId}});(sr==null?void 0:sr.status)!=-1&&window.open(`/classrooms/${_r.coursesId}/exercise/${_r.categoryId}/${(lt=(0,Wt.eY)())==null?void 0:lt.login}/initate_answer`)}});return wr.createElement("div",{className:ln.questionInfo},wr.createElement("div",{className:"tc mb20"},wr.createElement(at.VP,{defaultValue:(zi=ar==null?void 0:ar.examination_bank)==null?void 0:zi.name,onFinish:lt=>ps(void 0,null,function*(){return oa({type:"updateBaseInfo",payload:es(vs({},ar.examination_bank),{name:lt})}),_r!=null&&_r.id?(0,wa.se)({name:lt,exerciseId:(_r==null?void 0:_r.categoryId)||(_r==null?void 0:_r.id)}):(0,wa.wy)({exercise_name:lt,exerciseId:(_r==null?void 0:_r.categoryId)||(_r==null?void 0:_r.id)}),!0})})),wr.createElement(dt.Z,{justify:"center",className:"mb20"},wr.createElement(Qt.Z,{className:"mr30"},wr.createElement("span",{className:ln.label},"\u7B54\u9898\u65F6\u957F"),wr.createElement("span",null,((Ei=ar==null?void 0:ar.examination_bank)==null?void 0:Ei.time)===-1?"\u4E0D\u9650":((Mi=ar==null?void 0:ar.examination_bank)==null?void 0:Mi.time)||"\u4E0D\u9650")),wr.createElement(Qt.Z,{className:"mr30"},wr.createElement("span",{className:ln.label},"\u96BE\u5EA6"),wr.createElement("span",null,(Fn=Ee[`${(wi=ar==null?void 0:ar.examination_bank)==null?void 0:wi.difficulty}`])==null?void 0:Fn.label)),wr.createElement(Qt.Z,{className:"mr30"},wr.createElement("span",{className:ln.label},"\u8BD5\u9898\u603B\u6570"),wr.createElement("span",null,((ti=ar==null?void 0:ar.examination_bank)==null?void 0:ti.question_count)||0)),wr.createElement(Qt.Z,null,wr.createElement("span",{className:ln.label},"\u603B\u5206"),wr.createElement("span",null,((Tr=(dr=ar==null?void 0:ar.examination_bank)==null?void 0:dr.total_score)==null?void 0:Tr.toFixed(1))||0))),wr.createElement("div",{className:ln.content,style:{border:((Vo=ar==null?void 0:ar.item_types)==null?void 0:Vo.length)<=0&&"none"}},((To=ar==null?void 0:ar.item_types)==null?void 0:To.length)>0?wr.createElement(dt.Z,{wrap:!1},wr.createElement(Qt.Z,{flex:"260px",className:ln.leftPart},!Ro&&wr.createElement(dt.Z,{className:"mb20"},wr.createElement(cn.op,{style:{margin:"0 15px",borderRadius:2},onClick:()=>ko("setScore")},"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C"),(_r==null?void 0:_r.id)&&wr.createElement(cn.op,{shape:"default",onClick:()=>ko("questionType")},"\u6DFB\u52A0\u9898\u578B")),wr.createElement(Pn,{list:ar.item_types,onSelect:lt=>ps(void 0,null,function*(){if(lt===jr)return;Xo(!0);const fr=ar.item_types.find(sr=>sr.item_type===jr);if(jr!=="PRACTICAL"&&fr.contents.length>0&&(_r!=null&&_r.id)){const sr=(0,it.cloneDeep)(ar),{item_types:pr}=sr||{};sr.item_types=pr.filter(Ui=>Ui.item_type===jr);try{(yield Ze(_r.id||_r.categoryId,sr)).status===0&&Fa(lt)}catch(Ui){}}else _r.categoryId?gt(!0,2,lt):Wa(!0,lt);Xo(!1)}),onDelete:Ht})),wr.createElement(Qt.Z,{flex:1,className:ln.rightPart},wr.createElement(Ct.Z,{spinning:sa},wr.createElement(ra,{setVisibleModalType:ko,currentItemType:jr,onDelete:Ht})))):wr.createElement(di.Z,{customText:"\u8BF7\u5148\u8BBE\u7F6E\u8BD5\u5377\u9898\u578B",styles:{margin:"70px auto"},ButtonTwo:wr.createElement(dt.Z,{justify:"center",className:"mt20"},(_r==null?void 0:_r.id)&&wr.createElement(cn.op,{style:{width:88},onClick:()=>ko("questionType")},"\u6DFB\u52A0\u9898\u578B"))})),!!(_r!=null&&_r.id)&&wr.createElement("div",{className:ln.fixedBottom},wr.createElement(Uo.Z,{className:`${ln.previewBtn} mr20`,onClick:()=>ps(void 0,null,function*(){var lt,fr;const sr=(lt=ar==null?void 0:ar.item_types)==null?void 0:lt.filter(pr=>{var Ui,Un;return((Ui=pr.contents)==null?void 0:Ui.length)>0||((Un=pr==null?void 0:pr.item_banks)==null?void 0:Un.length)>0});if(!((fr=ar.item_types)!=null&&fr.length)){pt.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if((sr==null?void 0:sr.length)===0){pt.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}yield Wa(!0,jr),za()})},"\u8BD5\u5377\u9884\u89C8"),wr.createElement(Uo.Z,{type:"primary",className:ln.confirmBtn,onClick:()=>Wa()},wr.createElement("i",{className:"iconfont icon-baocun1 mr5"}),"\u4FDD\u5B58\u8BD5\u5377")),!!(_r!=null&&_r.categoryId)&&wr.createElement("div",{className:ln.fixedBottom,style:{justifyContent:((Ca=ar==null?void 0:ar.exercise)==null?void 0:Ca.exercise_status)!==1?"end":"center"}},wr.createElement(Uo.Z,{className:`${ln.previewBtn} mr20`,onClick:()=>ps(void 0,null,function*(){var lt,fr;document.body.scrollIntoView(),Oe.history.push(`/classrooms/${_r.coursesId}/exercise/${(lt=ar==null?void 0:ar.exercise)==null?void 0:lt.id}/detail?random=${(fr=ar==null?void 0:ar.exercise)==null?void 0:fr.is_random}`)})},"\u8FD4\u56DE"),((Sa=ar==null?void 0:ar.exercise)==null?void 0:Sa.exercise_status)===1&&wr.createElement(Uo.Z,{className:`${ln.previewBtn} mr20`,onClick:Re},"\u6A21\u62DF\u8003\u8BD5"),(ar==null?void 0:ar.exercise.exercise_status)===1&&wr.createElement(Uo.Z,{type:"primary",className:ln.confirmBtn,onClick:()=>gt()},"\u63D0\u4EA4")),wr.createElement(bi,{open:ua==="questionType",onCancel:()=>ko(""),onOk:lt=>ps(void 0,null,function*(){var fr,sr;const pr=[],Ui=He(ar,{type:"setQuestionType",payload:lt}),Un=((fr=Ui==null?void 0:Ui.item_types)==null?void 0:fr.map(Lr=>Lr.item_type))||[];for(const Lr of((sr=ar==null?void 0:ar.item_types)==null?void 0:sr.map(kr=>kr.item_type))||[])Un.includes(Lr)||pr.push(Lr);_r.id&&pr.length>0&&(yield Et(_r.id,{item_type:pr})).status!==0||(oa({type:"setQuestionType",payload:lt}),Fa(jr||Ui.item_types[0].item_type),ko(""))})}),wr.createElement(Fr,{open:ua==="setScore",onCancel:()=>{ko("")},onOk:lt=>ps(void 0,null,function*(){console.log("---newData",lt);const fr=lt.item_types.map(sr=>({item_type:sr.item_type,score:sr.score}));_r.id?(yield ct(_r.id,{score_settings:fr})).status===0&&oa({type:"init",payload:lt}):(yield $e(_r.categoryId,{score_settings:fr})).status===0&&oa({type:"init",payload:lt}),ko("")})}),wr.createElement(br,{open:ua==="rule",onCancel:()=>ko(""),currentItemType:jr,setVisibleModalType:ko}),mo.get("type")==="settings"&&wr.createElement(ai,{open:ua==="selectShixun",onCancel:()=>ko(""),onOk:lt=>{if(console.log(lt),(lt==null?void 0:lt.length)<=0){pt.ZP.info("\u5B9E\u8BAD\u6570\u4E0D\u80FD\u4E3A0");return}oa({type:"addShixun",payload:{shixunList:[...lt]}}),ko("")}}))},Ka=Le(43554),Ba=Le(59301),ss=Object.defineProperty,Ya=Object.defineProperties,ls=Object.getOwnPropertyDescriptors,Zi=Object.getOwnPropertySymbols,Xr=Object.prototype.hasOwnProperty,Po=Object.prototype.propertyIsEnumerable,Yo=(Ut,Zt,bn)=>Zt in Ut?ss(Ut,Zt,{enumerable:!0,configurable:!0,writable:!0,value:bn}):Ut[Zt]=bn,ea=(Ut,Zt)=>{for(var bn in Zt||(Zt={}))Xr.call(Zt,bn)&&Yo(Ut,bn,Zt[bn]);if(Zi)for(var bn of Zi(Zt))Po.call(Zt,bn)&&Yo(Ut,bn,Zt[bn]);return Ut},Ea=(Ut,Zt)=>Ya(Ut,ls(Zt)),Hr=(Ut,Zt,bn)=>new Promise((zi,Ei)=>{var Mi=ti=>{try{Fn(bn.next(ti))}catch(dr){Ei(dr)}},wi=ti=>{try{Fn(bn.throw(ti))}catch(dr){Ei(dr)}},Fn=ti=>ti.done?zi(ti.value):Promise.resolve(ti.value).then(Mi,wi);Fn((bn=bn.apply(Ut,Zt)).next())}),is=()=>{var Ut,Zt,bn,zi;const[Ei,Mi]=(0,le.useState)("baseInfo"),wi=(0,Oe.useDispatch)();(0,le.useEffect)(()=>{wi({type:"globalSetting/footerToggle",payload:!1})},[]);const Fn=(0,Oe.useParams)(),ti=!!(Fn.id||Fn.categoryId),[dr]=(0,Oe.useSearchParams)();(0,le.useEffect)(()=>{dr.get("type")==="settings"&&Mi("settings")},[]);const[Tr,Vo]=(0,le.useReducer)(He,null),[To,Ca]=(0,le.useState)(!1),Sa=()=>Hr(void 0,null,function*(){Ca(!0);let jr;Fn.categoryId?jr=yield vn(Fn):jr=yield _e(Fn.id),Ca(!1),jr.status===0&&Vo({type:"init",payload:jr})});(0,le.useEffect)(()=>{ti?Sa():Vo({type:"init",payload:{examination_bank:{difficulty:2}}})},[Fn]);const[mo,_r]=(0,le.useState)(""),ar=(jr,Fa)=>Hr(void 0,null,function*(){var sa,Xo,Io,ca;const Wa=(sa=Tr==null?void 0:Tr.item_types)==null?void 0:sa.filter(Re=>{var lt;return((lt=Re==null?void 0:Re.item_type)==null?void 0:lt.toUpperCase())===(Fa==null?void 0:Fa.type)}),gt={sort_by_item_type:Tr.sort_by_item_type,difficulty:Tr.examination_bank.difficulty,exam_notes:Tr.examination_bank.exam_notes,name:Tr.examination_bank.name,time:Tr.examination_bank.time,item_types:Tr.item_types};if(jr!==void 0&&!(jr!=null&&jr.single_question_id)){gt.seleted_item_bank_ids=jr==null?void 0:jr.seleted_item_bank_ids,gt.item_types=Wa;const Re=yield fn(gt);if((Re==null?void 0:Re.status)===0){let lt=(0,it.cloneDeep)(Ro.data);lt.questionList=(Xo=lt==null?void 0:lt.questionList)==null?void 0:Xo.map(fr=>{var sr;return fr.type===Fa.type?Ea(ea({},fr),{questions:((sr=Re==null?void 0:Re.questions)==null?void 0:sr.questions)||[]}):fr}),ua({show:!0,data:lt})}return}if(jr!==void 0&&(jr!=null&&jr.single_question_id)){gt.seleted_item_bank_ids=jr==null?void 0:jr.seleted_item_bank_ids,gt.single_question_id=jr==null?void 0:jr.single_question_id,gt.item_types=Wa;const Re=yield fn(gt);if((Re==null?void 0:Re.status)===0){let lt=(0,it.cloneDeep)(Ro.data);lt.questionList=(Io=lt==null?void 0:lt.questionList)==null?void 0:Io.map(fr=>{var sr,pr;if(fr.type===Fa.type){const Ui=(0,it.cloneDeep)(fr==null?void 0:fr.questions);return Ui.splice(Fa.index,1,(pr=(sr=Re==null?void 0:Re.questions)==null?void 0:sr.questions)==null?void 0:pr[0]),console.log(fr==null?void 0:fr.questions,Ui,Fa.index,"new_questions"),Ea(ea({},fr),{questions:Ui})}return fr}),ua({show:!0,data:lt})}return}const Ht=yield Bt(gt);if((Ht==null?void 0:Ht.status)===0){const Re=(0,Vt.ad)(Ht);let lt=[];(ca=Tr==null?void 0:Tr.item_types)==null||ca.forEach(fr=>{var sr;const pr=(sr=Re==null?void 0:Re.questionList)==null?void 0:sr.find(Ui=>fr.item_type===Ui.type);lt.push(pr)}),console.log(Tr,"sortList"),lt=(0,it.compact)(lt),Re.questionList=lt,ua({show:!0,data:Re}),_r(new Date)}}),oa=jr=>{var Fa;let sa=(0,it.cloneDeep)(Ro.data);sa.questionList=(Fa=sa==null?void 0:sa.questionList)==null?void 0:Fa.map(Xo=>Xo.type===jr.type?Ea(ea({},Xo),{questions_score:jr.scoreTotal}):Xo),Vo({type:"changeQuestionScore",payload:{score:jr.score,itemType:jr.type}}),ua({show:!0,data:sa})},la=jr=>Hr(void 0,null,function*(){const Fa={sort_by_item_type:Tr.sort_by_item_type,difficulty:Tr.examination_bank.difficulty,exam_notes:Tr.examination_bank.exam_notes,name:Tr.examination_bank.name,time:Tr.examination_bank.time,item_types:Tr.item_types,sub_discipline_id:Tr.examination_bank.sub_discipline_id};if(jr){(yield qt(ea(ea({},Fa),jr))).status===0&&pt.ZP.success("\u4FDD\u5B58\u6210\u529F");return}(yield Ze(Fn.id,Fa)).status===0&&(pt.ZP.success("\u63D0\u4EA4\u6210\u529F"),Oe.history.push("/paperlibrary?defaultActiveKey=0"))}),Ma=(0,Do.g)(),[za]=St.default.useForm(),[Ro,ua]=(0,le.useState)({show:!1,data:{}}),ko=!!((Ut=Tr==null?void 0:Tr.exercise)!=null&&Ut.exercise_status)&&((Zt=Tr==null?void 0:Tr.exercise)==null?void 0:Zt.exercise_status)!==1;return Ba.createElement(ht.Provider,{value:{data:Tr,disabled:ko,dispatch:Vo,setPreview:ua,getData:Sa,handlePreview:ar}},Ro.show?Ba.createElement(Ka.Z,{key:mo,data:Ro.data,onExchange:ar,onTypeScore:oa,submit:la,goBack:()=>ua({show:!1,data:{}})}):Ba.createElement("div",{className:Ue.wrapper},Ba.createElement("div",{className:"edu-container"},Ba.createElement(yt.Z,{className:Ue.breadCrumbWrapper,separator:">",items:Fn!=null&&Fn.categoryId?[{title:Ba.createElement(Oe.Link,{to:`/classrooms/${Fn.coursesId}/exercise`},(zi=(bn=(0,Wt.eY)())==null?void 0:bn.course)==null?void 0:zi.course_name)},{title:Ba.createElement(Oe.Link,{to:`/classrooms/${Fn.coursesId}/exercise`},"\u8BD5\u5377\u5217\u8868")},{title:"\u7F16\u8F91\u8BD5\u5377"}]:[{title:Ba.createElement(Oe.Link,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")},{title:"\u968F\u673A\u7EC4\u5377"}]}),Ba.createElement(at.d4,{activeKey:Ei,tabs:[{key:"baseInfo",label:"\u8BD5\u5377\u57FA\u7840\u4FE1\u606F"},{key:"settings",label:"\u7EC4\u5377\u914D\u7F6E"}],onChange:jr=>Hr(void 0,null,function*(){if(jr==="settings"&&(yield za.validateFields(),!ti)){const Fa=yield st(Tr);Fa.status===0&&Oe.history.replace(`/randompaper/edit/${Fa==null?void 0:Fa.examination_bank_id}?type=settings`)}Mi(jr)})}),Ei==="baseInfo"&&Ba.createElement(Ai,{courseOptions:Ma,setCurrentKey:Mi,loading:To,form:za}),Ba.createElement("div",{style:{display:Ei==="settings"?"block":"none"}},Tr&&Ba.createElement(Kr,null)))))}},52154:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return We}});var le=Le(62957),Ue={ul:"ul___TdfYY"},pt=Le(32637),St=Le(59301),yt=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,Ct=(Tt,dt)=>{var kt={};for(var De in Tt)Oe.call(Tt,De)&&dt.indexOf(De)<0&&(kt[De]=Tt[De]);if(Tt!=null&&yt)for(var De of yt(Tt))dt.indexOf(De)<0&&at.call(Tt,De)&&(kt[De]=Tt[De]);return kt},We=Tt=>{var dt=Tt,{open:kt,onCancel:De}=dt,ne=Ct(dt,["open","onCancel"]);return St.createElement(le.default,{centered:!0,open:kt,title:St.createElement("div",{style:{fontWeight:"bold"}},"\u8054\u7CFB\u6559\u7814\u52A9\u7406"),width:"696px",onCancel:De,footer:null},St.createElement("div",null,St.createElement("div",{className:"tc"},St.createElement("img",{className:"mt10",src:pt,width:"182px",height:"181px",style:{borderRadius:"2px",border:"1px solid #D8E3E9"}})),St.createElement("div",{style:{color:"#191919",fontWeight:"bold"},className:"tc font16 mt10"},"\u514D\u8D39\u6559\u7814\u52A9\u7406"),St.createElement("div",{style:{color:"#191919",fontWeight:"bold"},className:"tc font16"},"\u5FAE\u4FE1\u626B\u4E00\u626B\u6DFB\u52A0"),St.createElement("div",{style:{color:"#333"},className:"pt30 font14"},St.createElement("ul",{className:Ue.ul},St.createElement("li",null,"1\u3001\u89E3\u7B54\u8001\u5E08\u7591\u60D1\u3001\u5E2E\u52A9\u8001\u5E08\u66F4\u5FEB\u719F\u6089\u548C\u4F7F\u7528\u5E73\u53F0\u6559\u5B66\u3002"),St.createElement("li",null,"2\u3001\u534F\u52A9\u8001\u5E08\u521B\u5EFA\u8BFE\u5802\u3001\u8BFE\u7A0B\u8BBE\u8BA1\u3001\u505A\u597D\u6559\u5B66\u5DE5\u4F5C\u3002"),St.createElement("li",null,"3\u3001\u6839\u636E\u8001\u5E08\u6559\u5B66\u65B9\u5411\uFF0C\u5206\u4EAB\u5934\u6B4C\u5E73\u53F0C9\u9662\u6821\u3001985\u9AD8\u6821\u3001211\u9AD8\u6821\u3001\u53CC\u4E00\u6D41\u9AD8\u6821\u8001\u5E08\u7ECF\u5178\u5B9E\u8DF5\u6559\u5B66\u6848\u4F8B\u3002")))))}},58433:function(Zn,ei,Le){"use strict";Le.d(ei,{g:function(){return yt}});var le=Le(59301),Ue=Le(93629),pt=Le(55305),St=(Oe,at,Ct)=>new Promise((ot,We)=>{var Tt=De=>{try{kt(Ct.next(De))}catch(ne){We(ne)}},dt=De=>{try{kt(Ct.throw(De))}catch(ne){We(ne)}},kt=De=>De.done?ot(De.value):Promise.resolve(De.value).then(Tt,dt);kt((Ct=Ct.apply(Oe,at)).next())});const yt=()=>{const[Oe,at]=(0,le.useState)([]);return(0,le.useEffect)(()=>{St(void 0,null,function*(){const ot=yield(0,Ue.d1)({source:"question"});ot!=null&&ot.disciplines&&at((0,pt.L)(ot==null?void 0:ot.disciplines))})},[]),Oe}},45937:function(Zn,ei,Le){"use strict";Le.d(ei,{U:function(){return ot}});var le=Le(59301),Ue=Object.defineProperty,pt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,Oe=(We,Tt,dt)=>Tt in We?Ue(We,Tt,{enumerable:!0,configurable:!0,writable:!0,value:dt}):We[Tt]=dt,at=(We,Tt)=>{for(var dt in Tt||(Tt={}))St.call(Tt,dt)&&Oe(We,dt,Tt[dt]);if(pt)for(var dt of pt(Tt))yt.call(Tt,dt)&&Oe(We,dt,Tt[dt]);return We},Ct=(We,Tt,dt)=>new Promise((kt,De)=>{var ne=se=>{try{de(dt.next(se))}catch(pe){De(pe)}},te=se=>{try{de(dt.throw(se))}catch(pe){De(pe)}},de=se=>se.done?kt(se.value):Promise.resolve(se.value).then(ne,te);de((dt=dt.apply(We,Tt)).next())});function ot(We,Tt){const[dt,kt]=(0,le.useState)(Tt),[De,ne]=(0,le.useState)(!1),[te,de]=(0,le.useState)();return[dt,De,(pe,ye=!1)=>Ct(this,null,function*(){const we=ye?Tt:at(at({},dt),pe);ne(!0),kt(we);const Ce=yield We(we);return ne(!1),de(Ce),Ce}),te,de]}},81428:function(Zn,ei,Le){"use strict";Le.d(ei,{AL:function(){return we},Iy:function(){return Tt},Qv:function(){return De},ez:function(){return ye},jb:function(){return dt}});var le=Le(32834),Ue=Le.n(le),pt=Le(11690),St=Le.n(pt);let yt=1;function Oe(nt,Ye){const ct=nt.match(/^(\s+)(?:```)/);if(ct===null)return Ye;const $e=ct[1];return Ye.split(`
|
|
`).map(Et=>{const Pt=Et.match(/^\s+/);if(Pt===null)return Et;const[Bt]=Pt;return Bt.length>=$e.length?Et.slice($e.length):Et}).join(`
|
|
`)}let at=[],Ct=["<ul>"];const ot=new(Ue()).Renderer,We=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Tt(){at.length=0,Ct=["<ul>"]}const dt={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function kt(nt,Ye,ct,$e){if(Ye>=nt.length||nt[Ye].level<=ct)return Ye;var Et=nt[Ye];$e.push("<li><a href='#"+yt+Et.anchor+"'>"+Et.text+"</a>"),Ye++;var Pt=[];return Ye=kt(nt,Ye,Et.level,Pt),Pt.length>0&&($e.push("<ul>"),Pt.forEach(function(Bt){$e.push(Bt)}),$e.push("</ul>")),$e.push("</li>"),Ye=kt(nt,Ye,ct,$e),Ye}function De(){return kt(at,0,0,Ct),Ct.push("</ul>"),Ct.join("")}const ne={heading(nt){const Ye=We.exec(nt);if(yt+=1,Ye)return{type:"heading",raw:Ye[0],depth:Ye[1].length,text:Ye[2]}},fences(nt){const Ye=this.rules.block.fences.exec(nt);if(Ye){const ct=Ye[0];let $e=Oe(ct,Ye[3]||"");const Et=Ye[2]?Ye[2].trim():Ye[2];if(["latex","katex","math"].indexOf(Et)>=0){const Pt=se(),Bt=$e;$e=Pt,pe[Pt]={type:"block",expression:Bt}}return{type:"code",raw:ct,lang:Et,text:$e}}}},te=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let de=0;const se=()=>`__special_katext_id_${de++}__`;let pe={};function ye(){return pe}function we(){de=0,pe={}}function Ce(nt){return nt=nt.replace(te,(Ye,ct)=>{const $e=se();return pe[$e]={type:"inline",expression:ct},$e}),nt}const _e=ot.listitem;ot.listitem=function(nt){return _e(Ce(nt))};const Ze=ot.paragraph;ot.paragraph=function(nt){return Ze(Ce(nt))};const st=ot.tablecell;ot.tablecell=function(nt,Ye){return st(Ce(nt),Ye)},ot.code=function(nt,Ye,ct){const $e=(Ye||"").match(/\S*/)[0];return $e?["latex","katex","math"].indexOf($e)>=0?`<p class='editormd-tex'>${nt}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ye}">${ct?nt:(0,pt.escape)(nt,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(ct?nt:(0,pt.escape)(nt,!0))+"</code></pre>"},ot.heading=function(nt,Ye,ct){let $e=this.options.headerPrefix+ct.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return at.push({anchor:$e,level:Ye,text:nt}),"<h"+Ye+' id="'+yt+$e+'">'+nt+"</h"+Ye+">"},Ue().setOptions({silent:!0,gfm:!0,pedantic:!1}),Ue().use({tokenizer:ne,renderer:ot}),ei.ZP=Ue()},71114:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ye}});var le=Le(59301),Ue=Le(92310),pt=Le.n(Ue),St=Le(48755),yt=Le(83397),Oe=Le(93083),at=Le(63356),Ct=Le(16931),ot=Le(51636);const We=ct=>{const{componentCls:$e,calc:Et}=ct;return{[$e]:Object.assign(Object.assign({},(0,at.Wf)(ct)),{margin:0,padding:0,listStyle:"none",[`${$e}-item`]:{position:"relative",margin:0,paddingBottom:ct.itemPaddingBottom,fontSize:ct.fontSize,listStyle:"none","&-tail":{position:"absolute",insetBlockStart:ct.itemHeadSize,insetInlineStart:Et(Et(ct.itemHeadSize).sub(ct.tailWidth)).div(2).equal(),height:`calc(100% - ${(0,Oe.unit)(ct.itemHeadSize)})`,borderInlineStart:`${(0,Oe.unit)(ct.tailWidth)} ${ct.lineType} ${ct.tailColor}`},"&-pending":{[`${$e}-item-head`]:{fontSize:ct.fontSizeSM,backgroundColor:"transparent"},[`${$e}-item-tail`]:{display:"none"}},"&-head":{position:"absolute",width:ct.itemHeadSize,height:ct.itemHeadSize,backgroundColor:ct.dotBg,border:`${(0,Oe.unit)(ct.dotBorderWidth)} ${ct.lineType} transparent`,borderRadius:"50%","&-blue":{color:ct.colorPrimary,borderColor:ct.colorPrimary},"&-red":{color:ct.colorError,borderColor:ct.colorError},"&-green":{color:ct.colorSuccess,borderColor:ct.colorSuccess},"&-gray":{color:ct.colorTextDisabled,borderColor:ct.colorTextDisabled}},"&-head-custom":{position:"absolute",insetBlockStart:Et(ct.itemHeadSize).div(2).equal(),insetInlineStart:Et(ct.itemHeadSize).div(2).equal(),width:"auto",height:"auto",marginBlockStart:0,paddingBlock:ct.customHeadPaddingVertical,lineHeight:1,textAlign:"center",border:0,borderRadius:0,transform:"translate(-50%, -50%)"},"&-content":{position:"relative",insetBlockStart:Et(Et(ct.fontSize).mul(ct.lineHeight).sub(ct.fontSize)).mul(-1).add(ct.lineWidth).equal(),marginInlineStart:Et(ct.margin).add(ct.itemHeadSize).equal(),marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:"break-word"},"&-last":{[`> ${$e}-item-tail`]:{display:"none"},[`> ${$e}-item-content`]:{minHeight:Et(ct.controlHeightLG).mul(1.2).equal()}}},[`&${$e}-alternate,
|
|
&${$e}-right,
|
|
&${$e}-label`]:{[`${$e}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:"50%"},"&-head":{marginInlineStart:Et(ct.marginXXS).mul(-1).equal(),"&-custom":{marginInlineStart:Et(ct.tailWidth).div(2).equal()}},"&-left":{[`${$e}-item-content`]:{insetInlineStart:`calc(50% - ${(0,Oe.unit)(ct.marginXXS)})`,width:`calc(50% - ${(0,Oe.unit)(ct.marginSM)})`,textAlign:"start"}},"&-right":{[`${$e}-item-content`]:{width:`calc(50% - ${(0,Oe.unit)(ct.marginSM)})`,margin:0,textAlign:"end"}}}},[`&${$e}-right`]:{[`${$e}-item-right`]:{[`${$e}-item-tail,
|
|
${$e}-item-head,
|
|
${$e}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(0,Oe.unit)(Et(Et(ct.itemHeadSize).add(ct.tailWidth)).div(2).equal())})`},[`${$e}-item-content`]:{width:`calc(100% - ${(0,Oe.unit)(Et(ct.itemHeadSize).add(ct.marginXS).equal())})`}}},[`&${$e}-pending
|
|
${$e}-item-last
|
|
${$e}-item-tail`]:{display:"block",height:`calc(100% - ${(0,Oe.unit)(ct.margin)})`,borderInlineStart:`${(0,Oe.unit)(ct.tailWidth)} dotted ${ct.tailColor}`},[`&${$e}-reverse
|
|
${$e}-item-last
|
|
${$e}-item-tail`]:{display:"none"},[`&${$e}-reverse ${$e}-item-pending`]:{[`${$e}-item-tail`]:{insetBlockStart:ct.margin,display:"block",height:`calc(100% - ${(0,Oe.unit)(ct.margin)})`,borderInlineStart:`${(0,Oe.unit)(ct.tailWidth)} dotted ${ct.tailColor}`},[`${$e}-item-content`]:{minHeight:Et(ct.controlHeightLG).mul(1.2).equal()}},[`&${$e}-label`]:{[`${$e}-item-label`]:{position:"absolute",insetBlockStart:Et(Et(ct.fontSize).mul(ct.lineHeight).sub(ct.fontSize)).mul(-1).add(ct.tailWidth).equal(),width:`calc(50% - ${(0,Oe.unit)(ct.marginSM)})`,textAlign:"end"},[`${$e}-item-right`]:{[`${$e}-item-label`]:{insetInlineStart:`calc(50% + ${(0,Oe.unit)(ct.marginSM)})`,width:`calc(50% - ${(0,Oe.unit)(ct.marginSM)})`,textAlign:"start"}}},"&-rtl":{direction:"rtl",[`${$e}-item-head-custom`]:{transform:"translate(50%, -50%)"}}})}},Tt=ct=>({tailColor:ct.colorSplit,tailWidth:ct.lineWidthBold,dotBorderWidth:ct.wireframe?ct.lineWidthBold:ct.lineWidth*3,dotBg:ct.colorBgContainer,itemPaddingBottom:ct.padding*1.25});var dt=(0,Ct.I$)("Timeline",ct=>{const $e=(0,ot.mergeToken)(ct,{itemHeadSize:10,customHeadPaddingVertical:ct.paddingXXS,paddingInlineEnd:2});return[We($e)]},Tt),kt=function(ct,$e){var Et={};for(var Pt in ct)Object.prototype.hasOwnProperty.call(ct,Pt)&&$e.indexOf(Pt)<0&&(Et[Pt]=ct[Pt]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Bt=0,Pt=Object.getOwnPropertySymbols(ct);Bt<Pt.length;Bt++)$e.indexOf(Pt[Bt])<0&&Object.prototype.propertyIsEnumerable.call(ct,Pt[Bt])&&(Et[Pt[Bt]]=ct[Pt[Bt]]);return Et},ne=ct=>{var{prefixCls:$e,className:Et,color:Pt="blue",dot:Bt,pending:fn=!1,position:qt,label:vn,children:tn}=ct,it=kt(ct,["prefixCls","className","color","dot","pending","position","label","children"]);const{getPrefixCls:rt}=le.useContext(St.E_),dn=rt("timeline",$e),ni=pt()(`${dn}-item`,{[`${dn}-item-pending`]:fn},Et),Kn=/blue|red|green|gray/.test(Pt||"")?void 0:Pt,Rt=pt()(`${dn}-item-head`,{[`${dn}-item-head-custom`]:!!Bt,[`${dn}-item-head-${Pt}`]:!Kn});return le.createElement("li",Object.assign({},it,{className:ni}),vn&&le.createElement("div",{className:`${dn}-item-label`},vn),le.createElement("div",{className:`${dn}-item-tail`}),le.createElement("div",{className:Rt,style:{borderColor:Kn,color:Kn}},Bt),le.createElement("div",{className:`${dn}-item-content`},tn))},te=Le(62730),de=Le(58617),se=function(ct,$e){var Et={};for(var Pt in ct)Object.prototype.hasOwnProperty.call(ct,Pt)&&$e.indexOf(Pt)<0&&(Et[Pt]=ct[Pt]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Bt=0,Pt=Object.getOwnPropertySymbols(ct);Bt<Pt.length;Bt++)$e.indexOf(Pt[Bt])<0&&Object.prototype.propertyIsEnumerable.call(ct,Pt[Bt])&&(Et[Pt[Bt]]=ct[Pt[Bt]]);return Et},ye=ct=>{var{prefixCls:$e,className:Et,pending:Pt=!1,children:Bt,items:fn,rootClassName:qt,reverse:vn=!1,direction:tn,hashId:it,pendingDot:rt,mode:dn=""}=ct,ni=se(ct,["prefixCls","className","pending","children","items","rootClassName","reverse","direction","hashId","pendingDot","mode"]);const Kn=(kn,Oi)=>dn==="alternate"?kn==="right"?`${$e}-item-right`:kn==="left"?`${$e}-item-left`:Oi%2===0?`${$e}-item-left`:`${$e}-item-right`:dn==="left"?`${$e}-item-left`:dn==="right"?`${$e}-item-right`:kn==="right"?`${$e}-item-right`:"",Rt=(0,te.Z)(fn||[]),En=typeof Pt=="boolean"?null:Pt;Pt&&Rt.push({pending:!!Pt,dot:rt||le.createElement(de.Z,null),children:En}),vn&&Rt.reverse();const Bn=Rt.length,ui=`${$e}-item-last`,It=Rt.filter(kn=>!!kn).map((kn,Oi)=>{var ze;const Me=Oi===Bn-2?ui:"",Ee=Oi===Bn-1?ui:"",{className:Te}=kn,He=se(kn,["className"]);return le.createElement(ne,Object.assign({},He,{className:pt()([Te,!vn&&Pt?Me:Ee,Kn((ze=kn==null?void 0:kn.position)!==null&&ze!==void 0?ze:"",Oi)]),key:(kn==null?void 0:kn.key)||Oi}))}),On=Rt.some(kn=>!!(kn!=null&&kn.label)),ht=pt()($e,{[`${$e}-pending`]:!!Pt,[`${$e}-reverse`]:!!vn,[`${$e}-${dn}`]:!!dn&&!On,[`${$e}-label`]:On,[`${$e}-rtl`]:tn==="rtl"},Et,qt,it);return le.createElement("ul",Object.assign({},ni,{className:ht}),It)},we=Le(11592);function Ce(ct,$e){return ct&&Array.isArray(ct)?ct:(0,we.Z)($e).map(Et=>{var Pt,Bt;return Object.assign({children:(Bt=(Pt=Et==null?void 0:Et.props)===null||Pt===void 0?void 0:Pt.children)!==null&&Bt!==void 0?Bt:""},Et.props)})}var _e=Ce,Ze=function(ct,$e){var Et={};for(var Pt in ct)Object.prototype.hasOwnProperty.call(ct,Pt)&&$e.indexOf(Pt)<0&&(Et[Pt]=ct[Pt]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Bt=0,Pt=Object.getOwnPropertySymbols(ct);Bt<Pt.length;Bt++)$e.indexOf(Pt[Bt])<0&&Object.prototype.propertyIsEnumerable.call(ct,Pt[Bt])&&(Et[Pt[Bt]]=ct[Pt[Bt]]);return Et};const st=ct=>{const{getPrefixCls:$e,direction:Et,timeline:Pt}=le.useContext(St.E_),{prefixCls:Bt,children:fn,items:qt,className:vn,style:tn}=ct,it=Ze(ct,["prefixCls","children","items","className","style"]),rt=$e("timeline",Bt),dn=(0,yt.Z)(rt),[ni,Kn,Rt]=dt(rt,dn),En=_e(qt,fn);return ni(le.createElement(ye,Object.assign({},it,{className:pt()(Pt==null?void 0:Pt.className,vn,Rt,dn),style:Object.assign(Object.assign({},Pt==null?void 0:Pt.style),tn),prefixCls:rt,direction:Et,items:En,hashId:Kn})))};st.Item=ne;var nt=st,Ye=nt},99498:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){le.defineOption("placeholder","",function(Ct,ot,We){var Tt=We&&We!=le.Init;if(ot&&!Tt)Ct.on("blur",yt),Ct.on("change",Oe),Ct.on("swapDoc",Oe),le.on(Ct.getInputField(),"compositionupdate",Ct.state.placeholderCompose=function(){St(Ct)}),Oe(Ct);else if(!ot&&Tt){Ct.off("blur",yt),Ct.off("change",Oe),Ct.off("swapDoc",Oe),le.off(Ct.getInputField(),"compositionupdate",Ct.state.placeholderCompose),Ue(Ct);var dt=Ct.getWrapperElement();dt.className=dt.className.replace(" CodeMirror-empty","")}ot&&!Ct.hasFocus()&&yt(Ct)});function Ue(Ct){Ct.state.placeholder&&(Ct.state.placeholder.parentNode.removeChild(Ct.state.placeholder),Ct.state.placeholder=null)}function pt(Ct){Ue(Ct);var ot=Ct.state.placeholder=document.createElement("pre");ot.style.cssText="height: 0; overflow: visible",ot.style.direction=Ct.getOption("direction"),ot.className="CodeMirror-placeholder CodeMirror-line-like";var We=Ct.getOption("placeholder");typeof We=="string"&&(We=document.createTextNode(We)),ot.appendChild(We),Ct.display.lineSpace.insertBefore(ot,Ct.display.lineSpace.firstChild)}function St(Ct){setTimeout(function(){var ot=!1,We=Ct.getInputField();We.nodeName=="TEXTAREA"?ot=!We.value:Ct.lineCount()==1&&(ot=!/[^\u200b]/.test(We.querySelector(".CodeMirror-line").textContent)),ot?pt(Ct):Ue(Ct)},20)}function yt(Ct){at(Ct)&&pt(Ct)}function Oe(Ct){var ot=Ct.getWrapperElement(),We=at(Ct);ot.className=ot.className.replace(" CodeMirror-empty","")+(We?" CodeMirror-empty":""),We?pt(Ct):Ue(Ct)}function at(Ct){return Ct.lineCount()===1&&Ct.getLine(0)===""}})},25717:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){var Ue={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},pt=le.Pos;le.defineOption("autoCloseBrackets",!1,function(ne,te,de){de&&de!=le.Init&&(ne.removeKeyMap(yt),ne.state.closeBrackets=null),te&&(Oe(St(te,"pairs")),ne.state.closeBrackets=te,ne.addKeyMap(yt))});function St(ne,te){return te=="pairs"&&typeof ne=="string"?ne:typeof ne=="object"&&ne[te]!=null?ne[te]:Ue[te]}var yt={Backspace:ot,Enter:We};function Oe(ne){for(var te=0;te<ne.length;te++){var de=ne.charAt(te),se="'"+de+"'";yt[se]||(yt[se]=at(de))}}Oe(Ue.pairs+"`");function at(ne){return function(te){return dt(te,ne)}}function Ct(ne){var te=ne.state.closeBrackets;if(!te||te.override)return te;var de=ne.getModeAt(ne.getCursor());return de.closeBrackets||te}function ot(ne){var te=Ct(ne);if(!te||ne.getOption("disableInput"))return le.Pass;for(var de=St(te,"pairs"),se=ne.listSelections(),pe=0;pe<se.length;pe++){if(!se[pe].empty())return le.Pass;var ye=kt(ne,se[pe].head);if(!ye||de.indexOf(ye)%2!=0)return le.Pass}for(var pe=se.length-1;pe>=0;pe--){var we=se[pe].head;ne.replaceRange("",pt(we.line,we.ch-1),pt(we.line,we.ch+1),"+delete")}}function We(ne){var te=Ct(ne),de=te&&St(te,"explode");if(!de||ne.getOption("disableInput"))return le.Pass;for(var se=ne.listSelections(),pe=0;pe<se.length;pe++){if(!se[pe].empty())return le.Pass;var ye=kt(ne,se[pe].head);if(!ye||de.indexOf(ye)%2!=0)return le.Pass}ne.operation(function(){var we=ne.lineSeparator()||`
|
|
`;ne.replaceSelection(we+we,null),ne.execCommand("goCharLeft"),se=ne.listSelections();for(var Ce=0;Ce<se.length;Ce++){var _e=se[Ce].head.line;ne.indentLine(_e,null,!0),ne.indentLine(_e+1,null,!0)}})}function Tt(ne){var te=le.cmpPos(ne.anchor,ne.head)>0;return{anchor:new pt(ne.anchor.line,ne.anchor.ch+(te?-1:1)),head:new pt(ne.head.line,ne.head.ch+(te?1:-1))}}function dt(ne,te){var de=Ct(ne);if(!de||ne.getOption("disableInput"))return le.Pass;var se=St(de,"pairs"),pe=se.indexOf(te);if(pe==-1)return le.Pass;for(var ye=St(de,"closeBefore"),we=St(de,"triples"),Ce=se.charAt(pe+1)==te,_e=ne.listSelections(),Ze=pe%2==0,st,nt=0;nt<_e.length;nt++){var Ye=_e[nt],ct=Ye.head,$e,Et=ne.getRange(ct,pt(ct.line,ct.ch+1));if(Ze&&!Ye.empty())$e="surround";else if((Ce||!Ze)&&Et==te)Ce&&De(ne,ct)?$e="both":we.indexOf(te)>=0&&ne.getRange(ct,pt(ct.line,ct.ch+3))==te+te+te?$e="skipThree":$e="skip";else if(Ce&&ct.ch>1&&we.indexOf(te)>=0&&ne.getRange(pt(ct.line,ct.ch-2),ct)==te+te){if(ct.ch>2&&/\bstring/.test(ne.getTokenTypeAt(pt(ct.line,ct.ch-2))))return le.Pass;$e="addFour"}else if(Ce){var Pt=ct.ch==0?" ":ne.getRange(pt(ct.line,ct.ch-1),ct);if(!le.isWordChar(Et)&&Pt!=te&&!le.isWordChar(Pt))$e="both";else return le.Pass}else if(Ze&&(Et.length===0||/\s/.test(Et)||ye.indexOf(Et)>-1))$e="both";else return le.Pass;if(!st)st=$e;else if(st!=$e)return le.Pass}var Bt=pe%2?se.charAt(pe-1):te,fn=pe%2?te:se.charAt(pe+1);ne.operation(function(){if(st=="skip")ne.execCommand("goCharRight");else if(st=="skipThree")for(var qt=0;qt<3;qt++)ne.execCommand("goCharRight");else if(st=="surround"){for(var vn=ne.getSelections(),qt=0;qt<vn.length;qt++)vn[qt]=Bt+vn[qt]+fn;ne.replaceSelections(vn,"around"),vn=ne.listSelections().slice();for(var qt=0;qt<vn.length;qt++)vn[qt]=Tt(vn[qt]);ne.setSelections(vn)}else st=="both"?(ne.replaceSelection(Bt+fn,null),ne.triggerElectric(Bt+fn),ne.execCommand("goCharLeft")):st=="addFour"&&(ne.replaceSelection(Bt+Bt+Bt+Bt,"before"),ne.execCommand("goCharRight"))})}function kt(ne,te){var de=ne.getRange(pt(te.line,te.ch-1),pt(te.line,te.ch+1));return de.length==2?de:null}function De(ne,te){var de=ne.getTokenAt(pt(te.line,te.ch+1));return/\bstring/.test(de.type)&&de.start==te.ch&&(te.ch==0||!/\bstring/.test(ne.getTokenTypeAt(te)))}})},6313:function(Zn,ei,Le){(function(le){le(Le(89780),Le(32855))})(function(le){le.defineOption("autoCloseTags",!1,function(ot,We,Tt){if(Tt!=le.Init&&Tt&&ot.removeKeyMap("autoCloseTags"),!!We){var dt={name:"autoCloseTags"};(typeof We!="object"||We.whenClosing!==!1)&&(dt["'/'"]=function(kt){return Oe(kt)}),(typeof We!="object"||We.whenOpening!==!1)&&(dt["'>'"]=function(kt){return St(kt)}),ot.addKeyMap(dt)}});var Ue=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],pt=["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 St(ot){if(ot.getOption("disableInput"))return le.Pass;for(var We=ot.listSelections(),Tt=[],dt=ot.getOption("autoCloseTags"),kt=0;kt<We.length;kt++){if(!We[kt].empty())return le.Pass;var De=We[kt].head,ne=ot.getTokenAt(De),te=le.innerMode(ot.getMode(),ne.state),de=te.state,se=te.mode.xmlCurrentTag&&te.mode.xmlCurrentTag(de),pe=se&&se.name;if(!pe)return le.Pass;var ye=te.mode.configuration=="html",we=typeof dt=="object"&&dt.dontCloseTags||ye&&Ue,Ce=typeof dt=="object"&&dt.indentTags||ye&&pt;ne.end>De.ch&&(pe=pe.slice(0,pe.length-ne.end+De.ch));var _e=pe.toLowerCase();if(!pe||ne.type=="string"&&(ne.end!=De.ch||!/[\"\']/.test(ne.string.charAt(ne.string.length-1))||ne.string.length==1)||ne.type=="tag"&&se.close||ne.string.indexOf("/")==De.ch-ne.start-1||we&&at(we,_e)>-1||Ct(ot,te.mode.xmlCurrentContext&&te.mode.xmlCurrentContext(de)||[],pe,De,!0))return le.Pass;var Ze=typeof dt=="object"&&dt.emptyTags;if(Ze&&at(Ze,pe)>-1){Tt[kt]={text:"/>",newPos:le.Pos(De.line,De.ch+2)};continue}var st=Ce&&at(Ce,_e)>-1;Tt[kt]={indent:st,text:">"+(st?`
|
|
|
|
`:"")+"</"+pe+">",newPos:st?le.Pos(De.line+1,0):le.Pos(De.line,De.ch+1)}}for(var nt=typeof dt=="object"&&dt.dontIndentOnAutoClose,kt=We.length-1;kt>=0;kt--){var Ye=Tt[kt];ot.replaceRange(Ye.text,We[kt].head,We[kt].anchor,"+insert");var ct=ot.listSelections().slice(0);ct[kt]={head:Ye.newPos,anchor:Ye.newPos},ot.setSelections(ct),!nt&&Ye.indent&&(ot.indentLine(Ye.newPos.line,null,!0),ot.indentLine(Ye.newPos.line+1,null,!0))}}function yt(ot,We){for(var Tt=ot.listSelections(),dt=[],kt=We?"/":"</",De=ot.getOption("autoCloseTags"),ne=typeof De=="object"&&De.dontIndentOnSlash,te=0;te<Tt.length;te++){if(!Tt[te].empty())return le.Pass;var de=Tt[te].head,se=ot.getTokenAt(de),pe=le.innerMode(ot.getMode(),se.state),ye=pe.state;if(We&&(se.type=="string"||se.string.charAt(0)!="<"||se.start!=de.ch-1))return le.Pass;var we,Ce=pe.mode.name!="xml"&&ot.getMode().name=="htmlmixed";if(Ce&&pe.mode.name=="javascript")we=kt+"script";else if(Ce&&pe.mode.name=="css")we=kt+"style";else{var _e=pe.mode.xmlCurrentContext&&pe.mode.xmlCurrentContext(ye);if(!_e||_e.length&&Ct(ot,_e,_e[_e.length-1],de))return le.Pass;we=kt+_e[_e.length-1]}ot.getLine(de.line).charAt(se.end)!=">"&&(we+=">"),dt[te]=we}if(ot.replaceSelections(dt),Tt=ot.listSelections(),!ne)for(var te=0;te<Tt.length;te++)(te==Tt.length-1||Tt[te].head.line<Tt[te+1].head.line)&&ot.indentLine(Tt[te].head.line)}function Oe(ot){return ot.getOption("disableInput")?le.Pass:yt(ot,!0)}le.commands.closeTag=function(ot){return yt(ot)};function at(ot,We){if(ot.indexOf)return ot.indexOf(We);for(var Tt=0,dt=ot.length;Tt<dt;++Tt)if(ot[Tt]==We)return Tt;return-1}function Ct(ot,We,Tt,dt,kt){if(!le.scanForClosingTag)return!1;var De=Math.min(ot.lastLine()+1,dt.line+500),ne=le.scanForClosingTag(ot,dt,null,De);if(!ne||ne.tag!=Tt)return!1;for(var te=kt?1:0,de=We.length-1;de>=0&&We[de]==Tt;de--)++te;dt=ne.to;for(var de=1;de<te;de++){var se=le.scanForClosingTag(ot,dt,null,De);if(!se||se.tag!=Tt)return!1;dt=se.to}return!0}})},32855:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"use strict";var Ue=le.Pos;function pt(de,se){return de.line-se.line||de.ch-se.ch}var St="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",yt=St+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Oe=new RegExp("<(/?)(["+St+"]["+yt+"]*)","g");function at(de,se,pe,ye){this.line=se,this.ch=pe,this.cm=de,this.text=de.getLine(se),this.min=ye?Math.max(ye.from,de.firstLine()):de.firstLine(),this.max=ye?Math.min(ye.to-1,de.lastLine()):de.lastLine()}function Ct(de,se){var pe=de.cm.getTokenTypeAt(Ue(de.line,se));return pe&&/\btag\b/.test(pe)}function ot(de){if(!(de.line>=de.max))return de.ch=0,de.text=de.cm.getLine(++de.line),!0}function We(de){if(!(de.line<=de.min))return de.text=de.cm.getLine(--de.line),de.ch=de.text.length,!0}function Tt(de){for(;;){var se=de.text.indexOf(">",de.ch);if(se==-1){if(ot(de))continue;return}if(!Ct(de,se+1)){de.ch=se+1;continue}var pe=de.text.lastIndexOf("/",se),ye=pe>-1&&!/\S/.test(de.text.slice(pe+1,se));return de.ch=se+1,ye?"selfClose":"regular"}}function dt(de){for(;;){var se=de.ch?de.text.lastIndexOf("<",de.ch-1):-1;if(se==-1){if(We(de))continue;return}if(!Ct(de,se+1)){de.ch=se;continue}Oe.lastIndex=se,de.ch=se;var pe=Oe.exec(de.text);if(pe&&pe.index==se)return pe}}function kt(de){for(;;){Oe.lastIndex=de.ch;var se=Oe.exec(de.text);if(!se){if(ot(de))continue;return}if(!Ct(de,se.index+1)){de.ch=se.index+1;continue}return de.ch=se.index+se[0].length,se}}function De(de){for(;;){var se=de.ch?de.text.lastIndexOf(">",de.ch-1):-1;if(se==-1){if(We(de))continue;return}if(!Ct(de,se+1)){de.ch=se;continue}var pe=de.text.lastIndexOf("/",se),ye=pe>-1&&!/\S/.test(de.text.slice(pe+1,se));return de.ch=se+1,ye?"selfClose":"regular"}}function ne(de,se){for(var pe=[];;){var ye=kt(de),we,Ce=de.line,_e=de.ch-(ye?ye[0].length:0);if(!ye||!(we=Tt(de)))return;if(we!="selfClose")if(ye[1]){for(var Ze=pe.length-1;Ze>=0;--Ze)if(pe[Ze]==ye[2]){pe.length=Ze;break}if(Ze<0&&(!se||se==ye[2]))return{tag:ye[2],from:Ue(Ce,_e),to:Ue(de.line,de.ch)}}else pe.push(ye[2])}}function te(de,se){for(var pe=[];;){var ye=De(de);if(!ye)return;if(ye=="selfClose"){dt(de);continue}var we=de.line,Ce=de.ch,_e=dt(de);if(!_e)return;if(_e[1])pe.push(_e[2]);else{for(var Ze=pe.length-1;Ze>=0;--Ze)if(pe[Ze]==_e[2]){pe.length=Ze;break}if(Ze<0&&(!se||se==_e[2]))return{tag:_e[2],from:Ue(de.line,de.ch),to:Ue(we,Ce)}}}}le.registerHelper("fold","xml",function(de,se){for(var pe=new at(de,se.line,0);;){var ye=kt(pe);if(!ye||pe.line!=se.line)return;var we=Tt(pe);if(!we)return;if(!ye[1]&&we!="selfClose"){var Ce=Ue(pe.line,pe.ch),_e=ne(pe,ye[2]);return _e&&pt(_e.from,Ce)>0?{from:Ce,to:_e.from}:null}}}),le.findMatchingTag=function(de,se,pe){var ye=new at(de,se.line,se.ch,pe);if(!(ye.text.indexOf(">")==-1&&ye.text.indexOf("<")==-1)){var we=Tt(ye),Ce=we&&Ue(ye.line,ye.ch),_e=we&&dt(ye);if(!(!we||!_e||pt(ye,se)>0)){var Ze={from:Ue(ye.line,ye.ch),to:Ce,tag:_e[2]};return we=="selfClose"?{open:Ze,close:null,at:"open"}:_e[1]?{open:te(ye,_e[2]),close:Ze,at:"close"}:(ye=new at(de,Ce.line,Ce.ch,pe),{open:Ze,close:ne(ye,_e[2]),at:"open"})}}},le.findEnclosingTag=function(de,se,pe,ye){for(var we=new at(de,se.line,se.ch,pe);;){var Ce=te(we,ye);if(!Ce)break;var _e=new at(de,se.line,se.ch,pe),Ze=ne(_e,Ce.tag);if(Ze)return{open:Ce,close:Ze}}},le.scanForClosingTag=function(de,se,pe,ye){var we=new at(de,se.line,se.ch,ye?{from:0,to:ye}:null);return ne(we,pe)}})},89780:function(Zn){(function(ei,Le){Zn.exports=Le()})(this,function(){"use strict";var ei=navigator.userAgent,Le=navigator.platform,le=/gecko\/\d/i.test(ei),Ue=/MSIE \d/.test(ei),pt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ei),St=/Edge\/(\d+)/.exec(ei),yt=Ue||pt||St,Oe=yt&&(Ue?document.documentMode||6:+(St||pt)[1]),at=!St&&/WebKit\//.test(ei),Ct=at&&/Qt\/\d+\.\d+/.test(ei),ot=!St&&/Chrome\//.test(ei),We=/Opera\//.test(ei),Tt=/Apple Computer/.test(navigator.vendor),dt=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ei),kt=/PhantomJS/.test(ei),De=!St&&/AppleWebKit/.test(ei)&&/Mobile\/\w+/.test(ei),ne=/Android/.test(ei),te=De||ne||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ei),de=De||/Mac/.test(Le),se=/\bCrOS\b/.test(ei),pe=/win/i.test(Le),ye=We&&ei.match(/Version\/(\d*\.\d*)/);ye&&(ye=Number(ye[1])),ye&&ye>=15&&(We=!1,at=!0);var we=de&&(Ct||We&&(ye==null||ye<12.11)),Ce=le||yt&&Oe>=9;function _e(ie){return new RegExp("(^|\\s)"+ie+"(?:$|\\s)\\s*")}var Ze=function(ie,ae){var fe=ie.className,ce=_e(ae).exec(fe);if(ce){var me=fe.slice(ce.index+ce[0].length);ie.className=fe.slice(0,ce.index)+(me?ce[1]+me:"")}};function st(ie){for(var ae=ie.childNodes.length;ae>0;--ae)ie.removeChild(ie.firstChild);return ie}function nt(ie,ae){return st(ie).appendChild(ae)}function Ye(ie,ae,fe,ce){var me=document.createElement(ie);if(fe&&(me.className=fe),ce&&(me.style.cssText=ce),typeof ae=="string")me.appendChild(document.createTextNode(ae));else if(ae)for(var ke=0;ke<ae.length;++ke)me.appendChild(ae[ke]);return me}function ct(ie,ae,fe,ce){var me=Ye(ie,ae,fe,ce);return me.setAttribute("role","presentation"),me}var $e;document.createRange?$e=function(ie,ae,fe,ce){var me=document.createRange();return me.setEnd(ce||ie,fe),me.setStart(ie,ae),me}:$e=function(ie,ae,fe){var ce=document.body.createTextRange();try{ce.moveToElementText(ie.parentNode)}catch(me){return ce}return ce.collapse(!0),ce.moveEnd("character",fe),ce.moveStart("character",ae),ce};function Et(ie,ae){if(ae.nodeType==3&&(ae=ae.parentNode),ie.contains)return ie.contains(ae);do if(ae.nodeType==11&&(ae=ae.host),ae==ie)return!0;while(ae=ae.parentNode)}function Pt(){var ie;try{ie=document.activeElement}catch(ae){ie=document.body||null}for(;ie&&ie.shadowRoot&&ie.shadowRoot.activeElement;)ie=ie.shadowRoot.activeElement;return ie}function Bt(ie,ae){var fe=ie.className;_e(ae).test(fe)||(ie.className+=(fe?" ":"")+ae)}function fn(ie,ae){for(var fe=ie.split(" "),ce=0;ce<fe.length;ce++)fe[ce]&&!_e(fe[ce]).test(ae)&&(ae+=" "+fe[ce]);return ae}var qt=function(ie){ie.select()};De?qt=function(ie){ie.selectionStart=0,ie.selectionEnd=ie.value.length}:yt&&(qt=function(ie){try{ie.select()}catch(ae){}});function vn(ie){var ae=Array.prototype.slice.call(arguments,1);return function(){return ie.apply(null,ae)}}function tn(ie,ae,fe){ae||(ae={});for(var ce in ie)ie.hasOwnProperty(ce)&&(fe!==!1||!ae.hasOwnProperty(ce))&&(ae[ce]=ie[ce]);return ae}function it(ie,ae,fe,ce,me){ae==null&&(ae=ie.search(/[^\s\u00a0]/),ae==-1&&(ae=ie.length));for(var ke=ce||0,Ge=me||0;;){var Qe=ie.indexOf(" ",ke);if(Qe<0||Qe>=ae)return Ge+(ae-ke);Ge+=Qe-ke,Ge+=fe-Ge%fe,ke=Qe+1}}var rt=function(){this.id=null,this.f=null,this.time=0,this.handler=vn(this.onTimeout,this)};rt.prototype.onTimeout=function(ie){ie.id=0,ie.time<=+new Date?ie.f():setTimeout(ie.handler,ie.time-+new Date)},rt.prototype.set=function(ie,ae){this.f=ae;var fe=+new Date+ie;(!this.id||fe<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,ie),this.time=fe)};function dn(ie,ae){for(var fe=0;fe<ie.length;++fe)if(ie[fe]==ae)return fe;return-1}var ni=50,Kn={toString:function(){return"CodeMirror.Pass"}},Rt={scroll:!1},En={origin:"*mouse"},Bn={origin:"+move"};function ui(ie,ae,fe){for(var ce=0,me=0;;){var ke=ie.indexOf(" ",ce);ke==-1&&(ke=ie.length);var Ge=ke-ce;if(ke==ie.length||me+Ge>=ae)return ce+Math.min(Ge,ae-me);if(me+=ke-ce,me+=fe-me%fe,ce=ke+1,me>=ae)return ce}}var It=[""];function On(ie){for(;It.length<=ie;)It.push(ht(It)+" ");return It[ie]}function ht(ie){return ie[ie.length-1]}function kn(ie,ae){for(var fe=[],ce=0;ce<ie.length;ce++)fe[ce]=ae(ie[ce],ce);return fe}function Oi(ie,ae,fe){for(var ce=0,me=fe(ae);ce<ie.length&&fe(ie[ce])<=me;)ce++;ie.splice(ce,0,ae)}function ze(){}function Me(ie,ae){var fe;return Object.create?fe=Object.create(ie):(ze.prototype=ie,fe=new ze),ae&&tn(ae,fe),fe}var Ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Te(ie){return/\w/.test(ie)||ie>"\x80"&&(ie.toUpperCase()!=ie.toLowerCase()||Ee.test(ie))}function He(ie,ae){return ae?ae.source.indexOf("\\w")>-1&&Te(ie)?!0:ae.test(ie):Te(ie)}function Ae(ie){for(var ae in ie)if(ie.hasOwnProperty(ae)&&ie[ae])return!1;return!0}var et=/[\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 on(ie){return ie.charCodeAt(0)>=768&&et.test(ie)}function Kt(ie,ae,fe){for(;(fe<0?ae>0:ae<ie.length)&&on(ie.charAt(ae));)ae+=fe;return ae}function pn(ie,ae,fe){for(var ce=ae>fe?-1:1;;){if(ae==fe)return ae;var me=(ae+fe)/2,ke=ce<0?Math.ceil(me):Math.floor(me);if(ke==ae)return ie(ke)?ae:fe;ie(ke)?fe=ke:ae=ke+ce}}function Nt(ie,ae,fe,ce){if(!ie)return ce(ae,fe,"ltr",0);for(var me=!1,ke=0;ke<ie.length;++ke){var Ge=ie[ke];(Ge.from<fe&&Ge.to>ae||ae==fe&&Ge.to==ae)&&(ce(Math.max(Ge.from,ae),Math.min(Ge.to,fe),Ge.level==1?"rtl":"ltr",ke),me=!0)}me||ce(ae,fe,"ltr")}var Dt=null;function Ot(ie,ae,fe){var ce;Dt=null;for(var me=0;me<ie.length;++me){var ke=ie[me];if(ke.from<ae&&ke.to>ae)return me;ke.to==ae&&(ke.from!=ke.to&&fe=="before"?ce=me:Dt=me),ke.from==ae&&(ke.from!=ke.to&&fe!="before"?ce=me:Dt=me)}return ce!=null?ce:Dt}var un=function(){var ie="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ae="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function fe(xt){return xt<=247?ie.charAt(xt):1424<=xt&&xt<=1524?"R":1536<=xt&&xt<=1785?ae.charAt(xt-1536):1774<=xt&&xt<=2220?"r":8192<=xt&&xt<=8203?"w":xt==8204?"b":"L"}var ce=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,me=/[stwN]/,ke=/[LRr]/,Ge=/[Lb1n]/,Qe=/[1n]/;function Xe(xt,an,Ft){this.level=xt,this.from=an,this.to=Ft}return function(xt,an){var Ft=an=="ltr"?"L":"R";if(xt.length==0||an=="ltr"&&!ce.test(xt))return!1;for(var zn=xt.length,Mn=[],qi=0;qi<zn;++qi)Mn.push(fe(xt.charCodeAt(qi)));for(var cr=0,Br=Ft;cr<zn;++cr){var $r=Mn[cr];$r=="m"?Mn[cr]=Br:Br=$r}for(var No=0,co=Ft;No<zn;++No){var zo=Mn[No];zo=="1"&&co=="r"?Mn[No]="n":ke.test(zo)&&(co=zo,zo=="r"&&(Mn[No]="R"))}for(var va=1,fo=Mn[0];va<zn-1;++va){var ja=Mn[va];ja=="+"&&fo=="1"&&Mn[va+1]=="1"?Mn[va]="1":ja==","&&fo==Mn[va+1]&&(fo=="1"||fo=="n")&&(Mn[va]=fo),fo=ja}for(var ys=0;ys<zn;++ys){var ol=Mn[ys];if(ol==",")Mn[ys]="N";else if(ol=="%"){var Ls=void 0;for(Ls=ys+1;Ls<zn&&Mn[Ls]=="%";++Ls);for(var Hl=ys&&Mn[ys-1]=="!"||Ls<zn&&Mn[Ls]=="1"?"1":"N",xl=ys;xl<Ls;++xl)Mn[xl]=Hl;ys=Ls-1}}for(var $s=0,Vl=Ft;$s<zn;++$s){var fl=Mn[$s];Vl=="L"&&fl=="1"?Mn[$s]="L":ke.test(fl)&&(Vl=fl)}for(var qs=0;qs<zn;++qs)if(me.test(Mn[qs])){var Qa=void 0;for(Qa=qs+1;Qa<zn&&me.test(Mn[Qa]);++Qa);for(var Bs=(qs?Mn[qs-1]:Ft)=="L",ul=(Qa<zn?Mn[Qa]:Ft)=="L",gl=Bs==ul?Bs?"L":"R":Ft,Ru=qs;Ru<Qa;++Ru)Mn[Ru]=gl;qs=Qa-1}for(var Ms=[],gu,ve=0;ve<zn;)if(Ge.test(Mn[ve])){var Se=ve;for(++ve;ve<zn&&Ge.test(Mn[ve]);++ve);Ms.push(new Xe(0,Se,ve))}else{var Be=ve,je=Ms.length,tt=an=="rtl"?1:0;for(++ve;ve<zn&&Mn[ve]!="L";++ve);for(var qe=Be;qe<ve;)if(Qe.test(Mn[qe])){Be<qe&&(Ms.splice(je,0,new Xe(1,Be,qe)),je+=tt);var mt=qe;for(++qe;qe<ve&&Qe.test(Mn[qe]);++qe);Ms.splice(je,0,new Xe(2,mt,qe)),je+=tt,Be=qe}else++qe;Be<ve&&Ms.splice(je,0,new Xe(1,Be,ve))}return an=="ltr"&&(Ms[0].level==1&&(gu=xt.match(/^\s+/))&&(Ms[0].from=gu[0].length,Ms.unshift(new Xe(0,0,gu[0].length))),ht(Ms).level==1&&(gu=xt.match(/\s+$/))&&(ht(Ms).to-=gu[0].length,Ms.push(new Xe(0,zn-gu[0].length,zn)))),an=="rtl"?Ms.reverse():Ms}}();function Sn(ie,ae){var fe=ie.order;return fe==null&&(fe=ie.order=un(ie.text,ae)),fe}var An=[],Dn=function(ie,ae,fe){if(ie.addEventListener)ie.addEventListener(ae,fe,!1);else if(ie.attachEvent)ie.attachEvent("on"+ae,fe);else{var ce=ie._handlers||(ie._handlers={});ce[ae]=(ce[ae]||An).concat(fe)}};function Ai(ie,ae){return ie._handlers&&ie._handlers[ae]||An}function en(ie,ae,fe){if(ie.removeEventListener)ie.removeEventListener(ae,fe,!1);else if(ie.detachEvent)ie.detachEvent("on"+ae,fe);else{var ce=ie._handlers,me=ce&&ce[ae];if(me){var ke=dn(me,fe);ke>-1&&(ce[ae]=me.slice(0,ke).concat(me.slice(ke+1)))}}}function Qt(ie,ae){var fe=Ai(ie,ae);if(fe.length)for(var ce=Array.prototype.slice.call(arguments,2),me=0;me<fe.length;++me)fe[me].apply(null,ce)}function ln(ie,ae,fe){return typeof ae=="string"&&(ae={type:ae,preventDefault:function(){this.defaultPrevented=!0}}),Qt(ie,fe||ae.type,ie,ae),bi(ae)||ae.codemirrorIgnore}function di(ie){var ae=ie._handlers&&ie._handlers.cursorActivity;if(ae)for(var fe=ie.curOp.cursorActivityHandlers||(ie.curOp.cursorActivityHandlers=[]),ce=0;ce<ae.length;++ce)dn(fe,ae[ce])==-1&&fe.push(ae[ce])}function cn(ie,ae){return Ai(ie,ae).length>0}function Yt(ie){ie.prototype.on=function(ae,fe){Dn(this,ae,fe)},ie.prototype.off=function(ae,fe){en(this,ae,fe)}}function ii(ie){ie.preventDefault?ie.preventDefault():ie.returnValue=!1}function Vi(ie){ie.stopPropagation?ie.stopPropagation():ie.cancelBubble=!0}function bi(ie){return ie.defaultPrevented!=null?ie.defaultPrevented:ie.returnValue==!1}function Di(ie){ii(ie),Vi(ie)}function Mr(ie){return ie.target||ie.srcElement}function Gn(ie){var ae=ie.which;return ae==null&&(ie.button&1?ae=1:ie.button&2?ae=3:ie.button&4&&(ae=2)),de&&ie.ctrlKey&&ae==1&&(ae=3),ae}var Rn=function(){if(yt&&Oe<9)return!1;var ie=Ye("div");return"draggable"in ie||"dragDrop"in ie}(),Jn;function Ni(ie){if(Jn==null){var ae=Ye("span","\u200B");nt(ie,Ye("span",[ae,document.createTextNode("x")])),ie.firstChild.offsetHeight!=0&&(Jn=ae.offsetWidth<=1&&ae.offsetHeight>2&&!(yt&&Oe<8))}var fe=Jn?Ye("span","\u200B"):Ye("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return fe.setAttribute("cm-text",""),fe}var ji;function Gi(ie){if(ji!=null)return ji;var ae=nt(ie,document.createTextNode("A\u062EA")),fe=$e(ae,0,1).getBoundingClientRect(),ce=$e(ae,1,2).getBoundingClientRect();return st(ie),!fe||fe.left==fe.right?!1:ji=ce.right-fe.right<3}var Fr=`
|
|
|
|
b`.split(/\n/).length!=3?function(ie){for(var ae=0,fe=[],ce=ie.length;ae<=ce;){var me=ie.indexOf(`
|
|
`,ae);me==-1&&(me=ie.length);var ke=ie.slice(ae,ie.charAt(me-1)=="\r"?me-1:me),Ge=ke.indexOf("\r");Ge!=-1?(fe.push(ke.slice(0,Ge)),ae+=Ge+1):(fe.push(ke),ae=me+1)}return fe}:function(ie){return ie.split(/\r\n?|\n/)},be=window.getSelection?function(ie){try{return ie.selectionStart!=ie.selectionEnd}catch(ae){return!1}}:function(ie){var ae;try{ae=ie.ownerDocument.selection.createRange()}catch(fe){}return!ae||ae.parentElement()!=ie?!1:ae.compareEndPoints("StartToEnd",ae)!=0},gn=function(){var ie=Ye("div");return"oncopy"in ie?!0:(ie.setAttribute("oncopy","return;"),typeof ie.oncopy=="function")}(),li=null;function Hn(ie){if(li!=null)return li;var ae=nt(ie,Ye("span","x")),fe=ae.getBoundingClientRect(),ce=$e(ae,0,1).getBoundingClientRect();return li=Math.abs(fe.left-ce.left)>1}var oi={},ki={};function Ji(ie,ae){arguments.length>2&&(ae.dependencies=Array.prototype.slice.call(arguments,2)),oi[ie]=ae}function $i(ie,ae){ki[ie]=ae}function ir(ie){if(typeof ie=="string"&&ki.hasOwnProperty(ie))ie=ki[ie];else if(ie&&typeof ie.name=="string"&&ki.hasOwnProperty(ie.name)){var ae=ki[ie.name];typeof ae=="string"&&(ae={name:ae}),ie=Me(ae,ie),ie.name=ae.name}else{if(typeof ie=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(ie))return ir("application/xml");if(typeof ie=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(ie))return ir("application/json")}return typeof ie=="string"?{name:ie}:ie||{name:"null"}}function Mt(ie,ae){ae=ir(ae);var fe=oi[ae.name];if(!fe)return Mt(ie,"text/plain");var ce=fe(ie,ae);if(_t.hasOwnProperty(ae.name)){var me=_t[ae.name];for(var ke in me)me.hasOwnProperty(ke)&&(ce.hasOwnProperty(ke)&&(ce["_"+ke]=ce[ke]),ce[ke]=me[ke])}if(ce.name=ae.name,ae.helperType&&(ce.helperType=ae.helperType),ae.modeProps)for(var Ge in ae.modeProps)ce[Ge]=ae.modeProps[Ge];return ce}var _t={};function At(ie,ae){var fe=_t.hasOwnProperty(ie)?_t[ie]:_t[ie]={};tn(ae,fe)}function xi(ie,ae){if(ae===!0)return ae;if(ie.copyState)return ie.copyState(ae);var fe={};for(var ce in ae){var me=ae[ce];me instanceof Array&&(me=me.concat([])),fe[ce]=me}return fe}function mi(ie,ae){for(var fe;ie.innerMode&&(fe=ie.innerMode(ae),!(!fe||fe.mode==ie));)ae=fe.state,ie=fe.mode;return fe||{mode:ie,state:ae}}function fi(ie,ae,fe){return ie.startState?ie.startState(ae,fe):!0}var wn=function(ie,ae,fe){this.pos=this.start=0,this.string=ie,this.tabSize=ae||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=fe};wn.prototype.eol=function(){return this.pos>=this.string.length},wn.prototype.sol=function(){return this.pos==this.lineStart},wn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},wn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},wn.prototype.eat=function(ie){var ae=this.string.charAt(this.pos),fe;if(typeof ie=="string"?fe=ae==ie:fe=ae&&(ie.test?ie.test(ae):ie(ae)),fe)return++this.pos,ae},wn.prototype.eatWhile=function(ie){for(var ae=this.pos;this.eat(ie););return this.pos>ae},wn.prototype.eatSpace=function(){for(var ie=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>ie},wn.prototype.skipToEnd=function(){this.pos=this.string.length},wn.prototype.skipTo=function(ie){var ae=this.string.indexOf(ie,this.pos);if(ae>-1)return this.pos=ae,!0},wn.prototype.backUp=function(ie){this.pos-=ie},wn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=it(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?it(this.string,this.lineStart,this.tabSize):0)},wn.prototype.indentation=function(){return it(this.string,null,this.tabSize)-(this.lineStart?it(this.string,this.lineStart,this.tabSize):0)},wn.prototype.match=function(ie,ae,fe){if(typeof ie=="string"){var ce=function(Ge){return fe?Ge.toLowerCase():Ge},me=this.string.substr(this.pos,ie.length);if(ce(me)==ce(ie))return ae!==!1&&(this.pos+=ie.length),!0}else{var ke=this.string.slice(this.pos).match(ie);return ke&&ke.index>0?null:(ke&&ae!==!1&&(this.pos+=ke[0].length),ke)}},wn.prototype.current=function(){return this.string.slice(this.start,this.pos)},wn.prototype.hideFirstChars=function(ie,ae){this.lineStart+=ie;try{return ae()}finally{this.lineStart-=ie}},wn.prototype.lookAhead=function(ie){var ae=this.lineOracle;return ae&&ae.lookAhead(ie)},wn.prototype.baseToken=function(){var ie=this.lineOracle;return ie&&ie.baseToken(this.pos)};function Yn(ie,ae){if(ae-=ie.first,ae<0||ae>=ie.size)throw new Error("There is no line "+(ae+ie.first)+" in the document.");for(var fe=ie;!fe.lines;)for(var ce=0;;++ce){var me=fe.children[ce],ke=me.chunkSize();if(ae<ke){fe=me;break}ae-=ke}return fe.lines[ae]}function Qi(ie,ae,fe){var ce=[],me=ae.line;return ie.iter(ae.line,fe.line+1,function(ke){var Ge=ke.text;me==fe.line&&(Ge=Ge.slice(0,fe.ch)),me==ae.line&&(Ge=Ge.slice(ae.ch)),ce.push(Ge),++me}),ce}function vr(ie,ae,fe){var ce=[];return ie.iter(ae,fe,function(me){ce.push(me.text)}),ce}function Dr(ie,ae){var fe=ae-ie.height;if(fe)for(var ce=ie;ce;ce=ce.parent)ce.height+=fe}function Ke(ie){if(ie.parent==null)return null;for(var ae=ie.parent,fe=dn(ae.lines,ie),ce=ae.parent;ce;ae=ce,ce=ce.parent)for(var me=0;ce.children[me]!=ae;++me)fe+=ce.children[me].chunkSize();return fe+ae.first}function Lt(ie,ae){var fe=ie.first;e:do{for(var ce=0;ce<ie.children.length;++ce){var me=ie.children[ce],ke=me.height;if(ae<ke){ie=me;continue e}ae-=ke,fe+=me.chunkSize()}return fe}while(!ie.lines);for(var Ge=0;Ge<ie.lines.length;++Ge){var Qe=ie.lines[Ge],Xe=Qe.height;if(ae<Xe)break;ae-=Xe}return fe+Ge}function _n(ie,ae){return ae>=ie.first&&ae<ie.first+ie.size}function ci(ie,ae){return String(ie.lineNumberFormatter(ae+ie.firstLineNumber))}function $t(ie,ae,fe){if(fe===void 0&&(fe=null),!(this instanceof $t))return new $t(ie,ae,fe);this.line=ie,this.ch=ae,this.sticky=fe}function xn(ie,ae){return ie.line-ae.line||ie.ch-ae.ch}function Xt(ie,ae){return ie.sticky==ae.sticky&&xn(ie,ae)==0}function ri(ie){return $t(ie.line,ie.ch)}function Hi(ie,ae){return xn(ie,ae)<0?ae:ie}function gi(ie,ae){return xn(ie,ae)<0?ie:ae}function Ii(ie,ae){return Math.max(ie.first,Math.min(ae,ie.first+ie.size-1))}function Fi(ie,ae){if(ae.line<ie.first)return $t(ie.first,0);var fe=ie.first+ie.size-1;return ae.line>fe?$t(fe,Yn(ie,fe).text.length):Cr(ae,Yn(ie,ae.line).text.length)}function Cr(ie,ae){var fe=ie.ch;return fe==null||fe>ae?$t(ie.line,ae):fe<0?$t(ie.line,0):ie}function xr(ie,ae){for(var fe=[],ce=0;ce<ae.length;ce++)fe[ce]=Fi(ie,ae[ce]);return fe}var Sr=function(ie,ae){this.state=ie,this.lookAhead=ae},hn=function(ie,ae,fe,ce){this.state=ae,this.doc=ie,this.line=fe,this.maxLookAhead=ce||0,this.baseTokens=null,this.baseTokenPos=1};hn.prototype.lookAhead=function(ie){var ae=this.doc.getLine(this.line+ie);return ae!=null&&ie>this.maxLookAhead&&(this.maxLookAhead=ie),ae},hn.prototype.baseToken=function(ie){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=ie;)this.baseTokenPos+=2;var ae=this.baseTokens[this.baseTokenPos+1];return{type:ae&&ae.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-ie}},hn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},hn.fromSaved=function(ie,ae,fe){return ae instanceof Sr?new hn(ie,xi(ie.mode,ae.state),fe,ae.lookAhead):new hn(ie,xi(ie.mode,ae),fe)},hn.prototype.save=function(ie){var ae=ie!==!1?xi(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Sr(ae,this.maxLookAhead):ae};function ro(ie,ae,fe,ce){var me=[ie.state.modeGen],ke={};so(ie,ae.text,ie.doc.mode,fe,function(xt,an){return me.push(xt,an)},ke,ce);for(var Ge=fe.state,Qe=function(xt){fe.baseTokens=me;var an=ie.state.overlays[xt],Ft=1,zn=0;fe.state=!0,so(ie,ae.text,an.mode,fe,function(Mn,qi){for(var cr=Ft;zn<Mn;){var Br=me[Ft];Br>Mn&&me.splice(Ft,1,Mn,me[Ft+1],Br),Ft+=2,zn=Math.min(Mn,Br)}if(qi)if(an.opaque)me.splice(cr,Ft-cr,Mn,"overlay "+qi),Ft=cr+2;else for(;cr<Ft;cr+=2){var $r=me[cr+1];me[cr+1]=($r?$r+" ":"")+"overlay "+qi}},ke),fe.state=Ge,fe.baseTokens=null,fe.baseTokenPos=1},Xe=0;Xe<ie.state.overlays.length;++Xe)Qe(Xe);return{styles:me,classes:ke.bgClass||ke.textClass?ke:null}}function Gr(ie,ae,fe){if(!ae.styles||ae.styles[0]!=ie.state.modeGen){var ce=So(ie,Ke(ae)),me=ae.text.length>ie.options.maxHighlightLength&&xi(ie.doc.mode,ce.state),ke=ro(ie,ae,ce);me&&(ce.state=me),ae.stateAfter=ce.save(!me),ae.styles=ke.styles,ke.classes?ae.styleClasses=ke.classes:ae.styleClasses&&(ae.styleClasses=null),fe===ie.doc.highlightFrontier&&(ie.doc.modeFrontier=Math.max(ie.doc.modeFrontier,++ie.doc.highlightFrontier))}return ae.styles}function So(ie,ae,fe){var ce=ie.doc,me=ie.display;if(!ce.mode.startState)return new hn(ce,!0,ae);var ke=vo(ie,ae,fe),Ge=ke>ce.first&&Yn(ce,ke-1).stateAfter,Qe=Ge?hn.fromSaved(ce,Ge,ke):new hn(ce,fi(ce.mode),ke);return ce.iter(ke,ae,function(Xe){yn(ie,Xe.text,Qe);var xt=Qe.line;Xe.stateAfter=xt==ae-1||xt%5==0||xt>=me.viewFrom&&xt<me.viewTo?Qe.save():null,Qe.nextLine()}),fe&&(ce.modeFrontier=Qe.line),Qe}function yn(ie,ae,fe,ce){var me=ie.doc.mode,ke=new wn(ae,ie.options.tabSize,fe);for(ke.start=ke.pos=ce||0,ae==""&&Xn(me,fe.state);!ke.eol();)rr(me,ke,fe.state),ke.start=ke.pos}function Xn(ie,ae){if(ie.blankLine)return ie.blankLine(ae);if(ie.innerMode){var fe=mi(ie,ae);if(fe.mode.blankLine)return fe.mode.blankLine(fe.state)}}function rr(ie,ae,fe,ce){for(var me=0;me<10;me++){ce&&(ce[0]=mi(ie,fe).mode);var ke=ie.token(ae,fe);if(ae.pos>ae.start)return ke}throw new Error("Mode "+ie.name+" failed to advance stream.")}var er=function(ie,ae,fe){this.start=ie.start,this.end=ie.pos,this.string=ie.current(),this.type=ae||null,this.state=fe};function Pr(ie,ae,fe,ce){var me=ie.doc,ke=me.mode,Ge;ae=Fi(me,ae);var Qe=Yn(me,ae.line),Xe=So(ie,ae.line,fe),xt=new wn(Qe.text,ie.options.tabSize,Xe),an;for(ce&&(an=[]);(ce||xt.pos<ae.ch)&&!xt.eol();)xt.start=xt.pos,Ge=rr(ke,xt,Xe.state),ce&&an.push(new er(xt,Ge,xi(me.mode,Xe.state)));return ce?an:new er(xt,Ge,Xe.state)}function Wr(ie,ae){if(ie)for(;;){var fe=ie.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!fe)break;ie=ie.slice(0,fe.index)+ie.slice(fe.index+fe[0].length);var ce=fe[1]?"bgClass":"textClass";ae[ce]==null?ae[ce]=fe[2]:new RegExp("(?:^|\\s)"+fe[2]+"(?:$|\\s)").test(ae[ce])||(ae[ce]+=" "+fe[2])}return ie}function so(ie,ae,fe,ce,me,ke,Ge){var Qe=fe.flattenSpans;Qe==null&&(Qe=ie.options.flattenSpans);var Xe=0,xt=null,an=new wn(ae,ie.options.tabSize,ce),Ft,zn=ie.options.addModeClass&&[null];for(ae==""&&Wr(Xn(fe,ce.state),ke);!an.eol();){if(an.pos>ie.options.maxHighlightLength?(Qe=!1,Ge&&yn(ie,ae,ce,an.pos),an.pos=ae.length,Ft=null):Ft=Wr(rr(fe,an,ce.state,zn),ke),zn){var Mn=zn[0].name;Mn&&(Ft="m-"+(Ft?Mn+" "+Ft:Mn))}if(!Qe||xt!=Ft){for(;Xe<an.start;)Xe=Math.min(an.start,Xe+5e3),me(Xe,xt);xt=Ft}an.start=an.pos}for(;Xe<an.pos;){var qi=Math.min(an.pos,Xe+5e3);me(qi,xt),Xe=qi}}function vo(ie,ae,fe){for(var ce,me,ke=ie.doc,Ge=fe?-1:ae-(ie.doc.mode.innerMode?1e3:100),Qe=ae;Qe>Ge;--Qe){if(Qe<=ke.first)return ke.first;var Xe=Yn(ke,Qe-1),xt=Xe.stateAfter;if(xt&&(!fe||Qe+(xt instanceof Sr?xt.lookAhead:0)<=ke.modeFrontier))return Qe;var an=it(Xe.text,null,ie.options.tabSize);(me==null||ce>an)&&(me=Qe-1,ce=an)}return me}function po(ie,ae){if(ie.modeFrontier=Math.min(ie.modeFrontier,ae),!(ie.highlightFrontier<ae-10)){for(var fe=ie.first,ce=ae-1;ce>fe;ce--){var me=Yn(ie,ce).stateAfter;if(me&&(!(me instanceof Sr)||ce+me.lookAhead<ae)){fe=ce+1;break}}ie.highlightFrontier=Math.min(ie.highlightFrontier,fe)}}var yo=!1,Nn=!1;function ia(){yo=!0}function Tn(){Nn=!0}function Ar(ie,ae,fe){this.marker=ie,this.from=ae,this.to=fe}function Bo(ie,ae){if(ie)for(var fe=0;fe<ie.length;++fe){var ce=ie[fe];if(ce.marker==ae)return ce}}function br(ie,ae){for(var fe,ce=0;ce<ie.length;++ce)ie[ce]!=ae&&(fe||(fe=[])).push(ie[ce]);return fe}function na(ie,ae){ie.markedSpans=ie.markedSpans?ie.markedSpans.concat([ae]):[ae],ae.marker.attachLine(ie)}function Do(ie,ae,fe){var ce;if(ie)for(var me=0;me<ie.length;++me){var ke=ie[me],Ge=ke.marker,Qe=ke.from==null||(Ge.inclusiveLeft?ke.from<=ae:ke.from<ae);if(Qe||ke.from==ae&&Ge.type=="bookmark"&&(!fe||!ke.marker.insertLeft)){var Xe=ke.to==null||(Ge.inclusiveRight?ke.to>=ae:ke.to>ae);(ce||(ce=[])).push(new Ar(Ge,ke.from,Xe?null:ke.to))}}return ce}function ho(ie,ae,fe){var ce;if(ie)for(var me=0;me<ie.length;++me){var ke=ie[me],Ge=ke.marker,Qe=ke.to==null||(Ge.inclusiveRight?ke.to>=ae:ke.to>ae);if(Qe||ke.from==ae&&Ge.type=="bookmark"&&(!fe||ke.marker.insertLeft)){var Xe=ke.from==null||(Ge.inclusiveLeft?ke.from<=ae:ke.from<ae);(ce||(ce=[])).push(new Ar(Ge,Xe?null:ke.from-ae,ke.to==null?null:ke.to-ae))}}return ce}function Jo(ie,ae){if(ae.full)return null;var fe=_n(ie,ae.from.line)&&Yn(ie,ae.from.line).markedSpans,ce=_n(ie,ae.to.line)&&Yn(ie,ae.to.line).markedSpans;if(!fe&&!ce)return null;var me=ae.from.ch,ke=ae.to.ch,Ge=xn(ae.from,ae.to)==0,Qe=Do(fe,me,Ge),Xe=ho(ce,ke,Ge),xt=ae.text.length==1,an=ht(ae.text).length+(xt?me:0);if(Qe)for(var Ft=0;Ft<Qe.length;++Ft){var zn=Qe[Ft];if(zn.to==null){var Mn=Bo(Xe,zn.marker);Mn?xt&&(zn.to=Mn.to==null?null:Mn.to+an):zn.to=me}}if(Xe)for(var qi=0;qi<Xe.length;++qi){var cr=Xe[qi];if(cr.to!=null&&(cr.to+=an),cr.from==null){var Br=Bo(Qe,cr.marker);Br||(cr.from=an,xt&&(Qe||(Qe=[])).push(cr))}else cr.from+=an,xt&&(Qe||(Qe=[])).push(cr)}Qe&&(Qe=Vt(Qe)),Xe&&Xe!=Qe&&(Xe=Vt(Xe));var $r=[Qe];if(!xt){var No=ae.text.length-2,co;if(No>0&&Qe)for(var zo=0;zo<Qe.length;++zo)Qe[zo].to==null&&(co||(co=[])).push(new Ar(Qe[zo].marker,null,null));for(var va=0;va<No;++va)$r.push(co);$r.push(Xe)}return $r}function Vt(ie){for(var ae=0;ae<ie.length;++ae){var fe=ie[ae];fe.from!=null&&fe.from==fe.to&&fe.marker.clearWhenEmpty!==!1&&ie.splice(ae--,1)}return ie.length?ie:null}function jn(ie,ae,fe){var ce=null;if(ie.iter(ae.line,fe.line+1,function(Mn){if(Mn.markedSpans)for(var qi=0;qi<Mn.markedSpans.length;++qi){var cr=Mn.markedSpans[qi].marker;cr.readOnly&&(!ce||dn(ce,cr)==-1)&&(ce||(ce=[])).push(cr)}}),!ce)return null;for(var me=[{from:ae,to:fe}],ke=0;ke<ce.length;++ke)for(var Ge=ce[ke],Qe=Ge.find(0),Xe=0;Xe<me.length;++Xe){var xt=me[Xe];if(!(xn(xt.to,Qe.from)<0||xn(xt.from,Qe.to)>0)){var an=[Xe,1],Ft=xn(xt.from,Qe.from),zn=xn(xt.to,Qe.to);(Ft<0||!Ge.inclusiveLeft&&!Ft)&&an.push({from:xt.from,to:Qe.from}),(zn>0||!Ge.inclusiveRight&&!zn)&&an.push({from:Qe.to,to:xt.to}),me.splice.apply(me,an),Xe+=an.length-3}}return me}function Gt(ie){var ae=ie.markedSpans;if(ae){for(var fe=0;fe<ae.length;++fe)ae[fe].marker.detachLine(ie);ie.markedSpans=null}}function Ie(ie,ae){if(ae){for(var fe=0;fe<ae.length;++fe)ae[fe].marker.attachLine(ie);ie.markedSpans=ae}}function ai(ie){return ie.inclusiveLeft?-1:0}function hi(ie){return ie.inclusiveRight?1:0}function _i(ie,ae){var fe=ie.lines.length-ae.lines.length;if(fe!=0)return fe;var ce=ie.find(),me=ae.find(),ke=xn(ce.from,me.from)||ai(ie)-ai(ae);if(ke)return-ke;var Ge=xn(ce.to,me.to)||hi(ie)-hi(ae);return Ge||ae.id-ie.id}function Yi(ie,ae){var fe=Nn&&ie.markedSpans,ce;if(fe)for(var me=void 0,ke=0;ke<fe.length;++ke)me=fe[ke],me.marker.collapsed&&(ae?me.from:me.to)==null&&(!ce||_i(ce,me.marker)<0)&&(ce=me.marker);return ce}function Ti(ie){return Yi(ie,!0)}function In(ie){return Yi(ie,!1)}function si(ie,ae){var fe=Nn&&ie.markedSpans,ce;if(fe)for(var me=0;me<fe.length;++me){var ke=fe[me];ke.marker.collapsed&&(ke.from==null||ke.from<ae)&&(ke.to==null||ke.to>ae)&&(!ce||_i(ce,ke.marker)<0)&&(ce=ke.marker)}return ce}function yi(ie,ae,fe,ce,me){var ke=Yn(ie,ae),Ge=Nn&&ke.markedSpans;if(Ge)for(var Qe=0;Qe<Ge.length;++Qe){var Xe=Ge[Qe];if(Xe.marker.collapsed){var xt=Xe.marker.find(0),an=xn(xt.from,fe)||ai(Xe.marker)-ai(me),Ft=xn(xt.to,ce)||hi(Xe.marker)-hi(me);if(!(an>=0&&Ft<=0||an<=0&&Ft>=0)&&(an<=0&&(Xe.marker.inclusiveRight&&me.inclusiveLeft?xn(xt.to,fe)>=0:xn(xt.to,fe)>0)||an>=0&&(Xe.marker.inclusiveRight&&me.inclusiveLeft?xn(xt.from,ce)<=0:xn(xt.from,ce)<0)))return!0}}}function $n(ie){for(var ae;ae=Ti(ie);)ie=ae.find(-1,!0).line;return ie}function pi(ie){for(var ae;ae=In(ie);)ie=ae.find(1,!0).line;return ie}function ur(ie){for(var ae,fe;ae=In(ie);)ie=ae.find(1,!0).line,(fe||(fe=[])).push(ie);return fe}function Ki(ie,ae){var fe=Yn(ie,ae),ce=$n(fe);return fe==ce?ae:Ke(ce)}function Bi(ie,ae){if(ae>ie.lastLine())return ae;var fe=Yn(ie,ae),ce;if(!Pn(ie,fe))return ae;for(;ce=In(fe);)fe=ce.find(1,!0).line;return Ke(fe)+1}function Pn(ie,ae){var fe=Nn&&ae.markedSpans;if(fe){for(var ce=void 0,me=0;me<fe.length;++me)if(ce=fe[me],!!ce.marker.collapsed){if(ce.from==null)return!0;if(!ce.marker.widgetNode&&ce.from==0&&ce.marker.inclusiveLeft&&hr(ie,ae,ce))return!0}}}function hr(ie,ae,fe){if(fe.to==null){var ce=fe.marker.find(1,!0);return hr(ie,ce.line,Bo(ce.line.markedSpans,fe.marker))}if(fe.marker.inclusiveRight&&fe.to==ae.text.length)return!0;for(var me=void 0,ke=0;ke<ae.markedSpans.length;++ke)if(me=ae.markedSpans[ke],me.marker.collapsed&&!me.marker.widgetNode&&me.from==fe.to&&(me.to==null||me.to!=fe.from)&&(me.marker.inclusiveLeft||fe.marker.inclusiveRight)&&hr(ie,ae,me))return!0}function or(ie){ie=$n(ie);for(var ae=0,fe=ie.parent,ce=0;ce<fe.lines.length;++ce){var me=fe.lines[ce];if(me==ie)break;ae+=me.height}for(var ke=fe.parent;ke;fe=ke,ke=fe.parent)for(var Ge=0;Ge<ke.children.length;++Ge){var Qe=ke.children[Ge];if(Qe==fe)break;ae+=Qe.height}return ae}function xo(ie){if(ie.height==0)return 0;for(var ae=ie.text.length,fe,ce=ie;fe=Ti(ce);){var me=fe.find(0,!0);ce=me.from.line,ae+=me.from.ch-me.to.ch}for(ce=ie;fe=In(ce);){var ke=fe.find(0,!0);ae-=ce.text.length-ke.from.ch,ce=ke.to.line,ae+=ce.text.length-ke.to.ch}return ae}function Yr(ie){var ae=ie.display,fe=ie.doc;ae.maxLine=Yn(fe,fe.first),ae.maxLineLength=xo(ae.maxLine),ae.maxLineChanged=!0,fe.iter(function(ce){var me=xo(ce);me>ae.maxLineLength&&(ae.maxLineLength=me,ae.maxLine=ce)})}var qo=function(ie,ae,fe){this.text=ie,Ie(this,ae),this.height=fe?fe(this):1};qo.prototype.lineNo=function(){return Ke(this)},Yt(qo);function Ko(ie,ae,fe,ce){ie.text=ae,ie.stateAfter&&(ie.stateAfter=null),ie.styles&&(ie.styles=null),ie.order!=null&&(ie.order=null),Gt(ie),Ie(ie,fe);var me=ce?ce(ie):1;me!=ie.height&&Dr(ie,me)}function Qo(ie){ie.parent=null,Gt(ie)}var ra={},Uo={};function wa(ie,ae){if(!ie||/^\s*$/.test(ie))return null;var fe=ae.addModeClass?Uo:ra;return fe[ie]||(fe[ie]=ie.replace(/\S+/g,"cm-$&"))}function Wt(ie,ae){var fe=ct("span",null,null,at?"padding-right: .1px":null),ce={pre:ct("pre",[fe],"CodeMirror-line"),content:fe,col:0,pos:0,cm:ie,trailingSpace:!1,splitSpaces:ie.getOption("lineWrapping")};ae.measure={};for(var me=0;me<=(ae.rest?ae.rest.length:0);me++){var ke=me?ae.rest[me-1]:ae.line,Ge=void 0;ce.pos=0,ce.addToken=wr,Gi(ie.display.measure)&&(Ge=Sn(ke,ie.doc.direction))&&(ce.addToken=bo(ce.addToken,Ge)),ce.map=[];var Qe=ae!=ie.display.externalMeasured&&Ke(ke);fa(ke,ce,Gr(ie,ke,Qe)),ke.styleClasses&&(ke.styleClasses.bgClass&&(ce.bgClass=fn(ke.styleClasses.bgClass,ce.bgClass||"")),ke.styleClasses.textClass&&(ce.textClass=fn(ke.styleClasses.textClass,ce.textClass||""))),ce.map.length==0&&ce.map.push(0,0,ce.content.appendChild(Ni(ie.display.measure))),me==0?(ae.measure.map=ce.map,ae.measure.cache={}):((ae.measure.maps||(ae.measure.maps=[])).push(ce.map),(ae.measure.caches||(ae.measure.caches=[])).push({}))}if(at){var Xe=ce.content.lastChild;(/\bcm-tab\b/.test(Xe.className)||Xe.querySelector&&Xe.querySelector(".cm-tab"))&&(ce.content.className="cm-tab-wrap-hack")}return Qt(ie,"renderLine",ie,ae.line,ce.pre),ce.pre.className&&(ce.textClass=fn(ce.pre.className,ce.textClass||"")),ce}function Ho(ie){var ae=Ye("span","\u2022","cm-invalidchar");return ae.title="\\u"+ie.charCodeAt(0).toString(16),ae.setAttribute("aria-label",ae.title),ae}function wr(ie,ae,fe,ce,me,ke,Ge){if(ae){var Qe=ie.splitSpaces?no(ae,ie.trailingSpace):ae,Xe=ie.cm.state.specialChars,xt=!1,an;if(!Xe.test(ae))ie.col+=ae.length,an=document.createTextNode(Qe),ie.map.push(ie.pos,ie.pos+ae.length,an),yt&&Oe<9&&(xt=!0),ie.pos+=ae.length;else{an=document.createDocumentFragment();for(var Ft=0;;){Xe.lastIndex=Ft;var zn=Xe.exec(ae),Mn=zn?zn.index-Ft:ae.length-Ft;if(Mn){var qi=document.createTextNode(Qe.slice(Ft,Ft+Mn));yt&&Oe<9?an.appendChild(Ye("span",[qi])):an.appendChild(qi),ie.map.push(ie.pos,ie.pos+Mn,qi),ie.col+=Mn,ie.pos+=Mn}if(!zn)break;Ft+=Mn+1;var cr=void 0;if(zn[0]==" "){var Br=ie.cm.options.tabSize,$r=Br-ie.col%Br;cr=an.appendChild(Ye("span",On($r),"cm-tab")),cr.setAttribute("role","presentation"),cr.setAttribute("cm-text"," "),ie.col+=$r}else zn[0]=="\r"||zn[0]==`
|
|
`?(cr=an.appendChild(Ye("span",zn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),cr.setAttribute("cm-text",zn[0]),ie.col+=1):(cr=ie.cm.options.specialCharPlaceholder(zn[0]),cr.setAttribute("cm-text",zn[0]),yt&&Oe<9?an.appendChild(Ye("span",[cr])):an.appendChild(cr),ie.col+=1);ie.map.push(ie.pos,ie.pos+1,cr),ie.pos++}}if(ie.trailingSpace=Qe.charCodeAt(ae.length-1)==32,fe||ce||me||xt||ke||Ge){var No=fe||"";ce&&(No+=ce),me&&(No+=me);var co=Ye("span",[an],No,ke);if(Ge)for(var zo in Ge)Ge.hasOwnProperty(zo)&&zo!="style"&&zo!="class"&&co.setAttribute(zo,Ge[zo]);return ie.content.appendChild(co)}ie.content.appendChild(an)}}function no(ie,ae){if(ie.length>1&&!/ /.test(ie))return ie;for(var fe=ae,ce="",me=0;me<ie.length;me++){var ke=ie.charAt(me);ke==" "&&fe&&(me==ie.length-1||ie.charCodeAt(me+1)==32)&&(ke="\xA0"),ce+=ke,fe=ke==" "}return ce}function bo(ie,ae){return function(fe,ce,me,ke,Ge,Qe,Xe){me=me?me+" cm-force-border":"cm-force-border";for(var xt=fe.pos,an=xt+ce.length;;){for(var Ft=void 0,zn=0;zn<ae.length&&(Ft=ae[zn],!(Ft.to>xt&&Ft.from<=xt));zn++);if(Ft.to>=an)return ie(fe,ce,me,ke,Ge,Qe,Xe);ie(fe,ce.slice(0,Ft.to-xt),me,ke,null,Qe,Xe),ke=null,ce=ce.slice(Ft.to-xt),xt=Ft.to}}}function oo(ie,ae,fe,ce){var me=!ce&&fe.widgetNode;me&&ie.map.push(ie.pos,ie.pos+ae,me),!ce&&ie.cm.display.input.needsContentAttribute&&(me||(me=ie.content.appendChild(document.createElement("span"))),me.setAttribute("cm-marker",fe.id)),me&&(ie.cm.display.input.setUneditable(me),ie.content.appendChild(me)),ie.pos+=ae,ie.trailingSpace=!1}function fa(ie,ae,fe){var ce=ie.markedSpans,me=ie.text,ke=0;if(!ce){for(var Ge=1;Ge<fe.length;Ge+=2)ae.addToken(ae,me.slice(ke,ke=fe[Ge]),wa(fe[Ge+1],ae.cm.options));return}for(var Qe=me.length,Xe=0,xt=1,an="",Ft,zn,Mn=0,qi,cr,Br,$r,No;;){if(Mn==Xe){qi=cr=Br=zn="",No=null,$r=null,Mn=1/0;for(var co=[],zo=void 0,va=0;va<ce.length;++va){var fo=ce[va],ja=fo.marker;if(ja.type=="bookmark"&&fo.from==Xe&&ja.widgetNode)co.push(ja);else if(fo.from<=Xe&&(fo.to==null||fo.to>Xe||ja.collapsed&&fo.to==Xe&&fo.from==Xe)){if(fo.to!=null&&fo.to!=Xe&&Mn>fo.to&&(Mn=fo.to,cr=""),ja.className&&(qi+=" "+ja.className),ja.css&&(zn=(zn?zn+";":"")+ja.css),ja.startStyle&&fo.from==Xe&&(Br+=" "+ja.startStyle),ja.endStyle&&fo.to==Mn&&(zo||(zo=[])).push(ja.endStyle,fo.to),ja.title&&((No||(No={})).title=ja.title),ja.attributes)for(var ys in ja.attributes)(No||(No={}))[ys]=ja.attributes[ys];ja.collapsed&&(!$r||_i($r.marker,ja)<0)&&($r=fo)}else fo.from>Xe&&Mn>fo.from&&(Mn=fo.from)}if(zo)for(var ol=0;ol<zo.length;ol+=2)zo[ol+1]==Mn&&(cr+=" "+zo[ol]);if(!$r||$r.from==Xe)for(var Ls=0;Ls<co.length;++Ls)oo(ae,0,co[Ls]);if($r&&($r.from||0)==Xe){if(oo(ae,($r.to==null?Qe+1:$r.to)-Xe,$r.marker,$r.from==null),$r.to==null)return;$r.to==Xe&&($r=!1)}}if(Xe>=Qe)break;for(var Hl=Math.min(Qe,Mn);;){if(an){var xl=Xe+an.length;if(!$r){var $s=xl>Hl?an.slice(0,Hl-Xe):an;ae.addToken(ae,$s,Ft?Ft+qi:qi,Br,Xe+$s.length==Mn?cr:"",zn,No)}if(xl>=Hl){an=an.slice(Hl-Xe),Xe=Hl;break}Xe=xl,Br=""}an=me.slice(ke,ke=fe[xt++]),Ft=wa(fe[xt++],ae.cm.options)}}}function ga(ie,ae,fe){this.line=ae,this.rest=ur(ae),this.size=this.rest?Ke(ht(this.rest))-fe+1:1,this.node=this.text=null,this.hidden=Pn(ie,ae)}function Mo(ie,ae,fe){for(var ce=[],me,ke=ae;ke<fe;ke=me){var Ge=new ga(ie.doc,Yn(ie.doc,ke),ke);me=ke+Ge.size,ce.push(Ge)}return ce}var Fo=null;function vs(ie){Fo?Fo.ops.push(ie):ie.ownsGroup=Fo={ops:[ie],delayedCallbacks:[]}}function es(ie){var ae=ie.delayedCallbacks,fe=0;do{for(;fe<ae.length;fe++)ae[fe].call(null);for(var ce=0;ce<ie.ops.length;ce++){var me=ie.ops[ce];if(me.cursorActivityHandlers)for(;me.cursorActivityCalled<me.cursorActivityHandlers.length;)me.cursorActivityHandlers[me.cursorActivityCalled++].call(null,me.cm)}}while(fe<ae.length)}function ps(ie,ae){var fe=ie.ownsGroup;if(fe)try{es(fe)}finally{Fo=null,ae(fe)}}var ms=null;function Kr(ie,ae){var fe=Ai(ie,ae);if(fe.length){var ce=Array.prototype.slice.call(arguments,2),me;Fo?me=Fo.delayedCallbacks:ms?me=ms:(me=ms=[],setTimeout(Ka,0));for(var ke=function(Qe){me.push(function(){return fe[Qe].apply(null,ce)})},Ge=0;Ge<fe.length;++Ge)ke(Ge)}}function Ka(){var ie=ms;ms=null;for(var ae=0;ae<ie.length;++ae)ie[ae]()}function Ba(ie,ae,fe,ce){for(var me=0;me<ae.changes.length;me++){var ke=ae.changes[me];ke=="text"?Zi(ie,ae):ke=="gutter"?Po(ie,ae,fe,ce):ke=="class"?Xr(ie,ae):ke=="widget"&&Yo(ie,ae,ce)}ae.changes=null}function ss(ie){return ie.node==ie.text&&(ie.node=Ye("div",null,null,"position: relative"),ie.text.parentNode&&ie.text.parentNode.replaceChild(ie.node,ie.text),ie.node.appendChild(ie.text),yt&&Oe<8&&(ie.node.style.zIndex=2)),ie.node}function Ya(ie,ae){var fe=ae.bgClass?ae.bgClass+" "+(ae.line.bgClass||""):ae.line.bgClass;if(fe&&(fe+=" CodeMirror-linebackground"),ae.background)fe?ae.background.className=fe:(ae.background.parentNode.removeChild(ae.background),ae.background=null);else if(fe){var ce=ss(ae);ae.background=ce.insertBefore(Ye("div",null,fe),ce.firstChild),ie.display.input.setUneditable(ae.background)}}function ls(ie,ae){var fe=ie.display.externalMeasured;return fe&&fe.line==ae.line?(ie.display.externalMeasured=null,ae.measure=fe.measure,fe.built):Wt(ie,ae)}function Zi(ie,ae){var fe=ae.text.className,ce=ls(ie,ae);ae.text==ae.node&&(ae.node=ce.pre),ae.text.parentNode.replaceChild(ce.pre,ae.text),ae.text=ce.pre,ce.bgClass!=ae.bgClass||ce.textClass!=ae.textClass?(ae.bgClass=ce.bgClass,ae.textClass=ce.textClass,Xr(ie,ae)):fe&&(ae.text.className=fe)}function Xr(ie,ae){Ya(ie,ae),ae.line.wrapClass?ss(ae).className=ae.line.wrapClass:ae.node!=ae.text&&(ae.node.className="");var fe=ae.textClass?ae.textClass+" "+(ae.line.textClass||""):ae.line.textClass;ae.text.className=fe||""}function Po(ie,ae,fe,ce){if(ae.gutter&&(ae.node.removeChild(ae.gutter),ae.gutter=null),ae.gutterBackground&&(ae.node.removeChild(ae.gutterBackground),ae.gutterBackground=null),ae.line.gutterClass){var me=ss(ae);ae.gutterBackground=Ye("div",null,"CodeMirror-gutter-background "+ae.line.gutterClass,"left: "+(ie.options.fixedGutter?ce.fixedPos:-ce.gutterTotalWidth)+"px; width: "+ce.gutterTotalWidth+"px"),ie.display.input.setUneditable(ae.gutterBackground),me.insertBefore(ae.gutterBackground,ae.text)}var ke=ae.line.gutterMarkers;if(ie.options.lineNumbers||ke){var Ge=ss(ae),Qe=ae.gutter=Ye("div",null,"CodeMirror-gutter-wrapper","left: "+(ie.options.fixedGutter?ce.fixedPos:-ce.gutterTotalWidth)+"px");if(ie.display.input.setUneditable(Qe),Ge.insertBefore(Qe,ae.text),ae.line.gutterClass&&(Qe.className+=" "+ae.line.gutterClass),ie.options.lineNumbers&&(!ke||!ke["CodeMirror-linenumbers"])&&(ae.lineNumber=Qe.appendChild(Ye("div",ci(ie.options,fe),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+ce.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+ie.display.lineNumInnerWidth+"px"))),ke)for(var Xe=0;Xe<ie.display.gutterSpecs.length;++Xe){var xt=ie.display.gutterSpecs[Xe].className,an=ke.hasOwnProperty(xt)&&ke[xt];an&&Qe.appendChild(Ye("div",[an],"CodeMirror-gutter-elt","left: "+ce.gutterLeft[xt]+"px; width: "+ce.gutterWidth[xt]+"px"))}}}function Yo(ie,ae,fe){ae.alignable&&(ae.alignable=null);for(var ce=_e("CodeMirror-linewidget"),me=ae.node.firstChild,ke=void 0;me;me=ke)ke=me.nextSibling,ce.test(me.className)&&ae.node.removeChild(me);Ea(ie,ae,fe)}function ea(ie,ae,fe,ce){var me=ls(ie,ae);return ae.text=ae.node=me.pre,me.bgClass&&(ae.bgClass=me.bgClass),me.textClass&&(ae.textClass=me.textClass),Xr(ie,ae),Po(ie,ae,fe,ce),Ea(ie,ae,ce),ae.node}function Ea(ie,ae,fe){if(Hr(ie,ae.line,ae,fe,!0),ae.rest)for(var ce=0;ce<ae.rest.length;ce++)Hr(ie,ae.rest[ce],ae,fe,!1)}function Hr(ie,ae,fe,ce,me){if(ae.widgets)for(var ke=ss(fe),Ge=0,Qe=ae.widgets;Ge<Qe.length;++Ge){var Xe=Qe[Ge],xt=Ye("div",[Xe.node],"CodeMirror-linewidget"+(Xe.className?" "+Xe.className:""));Xe.handleMouseEvents||xt.setAttribute("cm-ignore-events","true"),Ns(Xe,xt,fe,ce),ie.display.input.setUneditable(xt),me&&Xe.above?ke.insertBefore(xt,fe.gutter||fe.text):ke.appendChild(xt),Kr(Xe,"redraw")}}function Ns(ie,ae,fe,ce){if(ie.noHScroll){(fe.alignable||(fe.alignable=[])).push(ae);var me=ce.wrapperWidth;ae.style.left=ce.fixedPos+"px",ie.coverGutter||(me-=ce.gutterTotalWidth,ae.style.paddingLeft=ce.gutterTotalWidth+"px"),ae.style.width=me+"px"}ie.coverGutter&&(ae.style.zIndex=5,ae.style.position="relative",ie.noHScroll||(ae.style.marginLeft=-ce.gutterTotalWidth+"px"))}function is(ie){if(ie.height!=null)return ie.height;var ae=ie.doc.cm;if(!ae)return 0;if(!Et(document.body,ie.node)){var fe="position: relative;";ie.coverGutter&&(fe+="margin-left: -"+ae.display.gutters.offsetWidth+"px;"),ie.noHScroll&&(fe+="width: "+ae.display.wrapper.clientWidth+"px;"),nt(ae.display.measure,Ye("div",[ie.node],null,fe))}return ie.height=ie.node.parentNode.offsetHeight}function Ut(ie,ae){for(var fe=Mr(ae);fe!=ie.wrapper;fe=fe.parentNode)if(!fe||fe.nodeType==1&&fe.getAttribute("cm-ignore-events")=="true"||fe.parentNode==ie.sizer&&fe!=ie.mover)return!0}function Zt(ie){return ie.lineSpace.offsetTop}function bn(ie){return ie.mover.offsetHeight-ie.lineSpace.offsetHeight}function zi(ie){if(ie.cachedPaddingH)return ie.cachedPaddingH;var ae=nt(ie.measure,Ye("pre","x","CodeMirror-line-like")),fe=window.getComputedStyle?window.getComputedStyle(ae):ae.currentStyle,ce={left:parseInt(fe.paddingLeft),right:parseInt(fe.paddingRight)};return!isNaN(ce.left)&&!isNaN(ce.right)&&(ie.cachedPaddingH=ce),ce}function Ei(ie){return ni-ie.display.nativeBarWidth}function Mi(ie){return ie.display.scroller.clientWidth-Ei(ie)-ie.display.barWidth}function wi(ie){return ie.display.scroller.clientHeight-Ei(ie)-ie.display.barHeight}function Fn(ie,ae,fe){var ce=ie.options.lineWrapping,me=ce&&Mi(ie);if(!ae.measure.heights||ce&&ae.measure.width!=me){var ke=ae.measure.heights=[];if(ce){ae.measure.width=me;for(var Ge=ae.text.firstChild.getClientRects(),Qe=0;Qe<Ge.length-1;Qe++){var Xe=Ge[Qe],xt=Ge[Qe+1];Math.abs(Xe.bottom-xt.bottom)>2&&ke.push((Xe.bottom+xt.top)/2-fe.top)}}ke.push(fe.bottom-fe.top)}}function ti(ie,ae,fe){if(ie.line==ae)return{map:ie.measure.map,cache:ie.measure.cache};for(var ce=0;ce<ie.rest.length;ce++)if(ie.rest[ce]==ae)return{map:ie.measure.maps[ce],cache:ie.measure.caches[ce]};for(var me=0;me<ie.rest.length;me++)if(Ke(ie.rest[me])>fe)return{map:ie.measure.maps[me],cache:ie.measure.caches[me],before:!0}}function dr(ie,ae){ae=$n(ae);var fe=Ke(ae),ce=ie.display.externalMeasured=new ga(ie.doc,ae,fe);ce.lineN=fe;var me=ce.built=Wt(ie,ce);return ce.text=me.pre,nt(ie.display.lineMeasure,me.pre),ce}function Tr(ie,ae,fe,ce){return Ca(ie,To(ie,ae),fe,ce)}function Vo(ie,ae){if(ae>=ie.display.viewFrom&&ae<ie.display.viewTo)return ie.display.view[Wi(ie,ae)];var fe=ie.display.externalMeasured;if(fe&&ae>=fe.lineN&&ae<fe.lineN+fe.size)return fe}function To(ie,ae){var fe=Ke(ae),ce=Vo(ie,fe);ce&&!ce.text?ce=null:ce&&ce.changes&&(Ba(ie,ce,fe,Lr(ie)),ie.curOp.forceUpdate=!0),ce||(ce=dr(ie,ae));var me=ti(ce,ae,fe);return{line:ae,view:ce,rect:null,map:me.map,cache:me.cache,before:me.before,hasHeights:!1}}function Ca(ie,ae,fe,ce,me){ae.before&&(fe=-1);var ke=fe+(ce||""),Ge;return ae.cache.hasOwnProperty(ke)?Ge=ae.cache[ke]:(ae.rect||(ae.rect=ae.view.text.getBoundingClientRect()),ae.hasHeights||(Fn(ie,ae.view,ae.rect),ae.hasHeights=!0),Ge=ar(ie,ae,fe,ce),Ge.bogus||(ae.cache[ke]=Ge)),{left:Ge.left,right:Ge.right,top:me?Ge.rtop:Ge.top,bottom:me?Ge.rbottom:Ge.bottom}}var Sa={left:0,right:0,top:0,bottom:0};function mo(ie,ae,fe){for(var ce,me,ke,Ge,Qe,Xe,xt=0;xt<ie.length;xt+=3)if(Qe=ie[xt],Xe=ie[xt+1],ae<Qe?(me=0,ke=1,Ge="left"):ae<Xe?(me=ae-Qe,ke=me+1):(xt==ie.length-3||ae==Xe&&ie[xt+3]>ae)&&(ke=Xe-Qe,me=ke-1,ae>=Xe&&(Ge="right")),me!=null){if(ce=ie[xt+2],Qe==Xe&&fe==(ce.insertLeft?"left":"right")&&(Ge=fe),fe=="left"&&me==0)for(;xt&&ie[xt-2]==ie[xt-3]&&ie[xt-1].insertLeft;)ce=ie[(xt-=3)+2],Ge="left";if(fe=="right"&&me==Xe-Qe)for(;xt<ie.length-3&&ie[xt+3]==ie[xt+4]&&!ie[xt+5].insertLeft;)ce=ie[(xt+=3)+2],Ge="right";break}return{node:ce,start:me,end:ke,collapse:Ge,coverStart:Qe,coverEnd:Xe}}function _r(ie,ae){var fe=Sa;if(ae=="left")for(var ce=0;ce<ie.length&&(fe=ie[ce]).left==fe.right;ce++);else for(var me=ie.length-1;me>=0&&(fe=ie[me]).left==fe.right;me--);return fe}function ar(ie,ae,fe,ce){var me=mo(ae.map,fe,ce),ke=me.node,Ge=me.start,Qe=me.end,Xe=me.collapse,xt;if(ke.nodeType==3){for(var an=0;an<4;an++){for(;Ge&&on(ae.line.text.charAt(me.coverStart+Ge));)--Ge;for(;me.coverStart+Qe<me.coverEnd&&on(ae.line.text.charAt(me.coverStart+Qe));)++Qe;if(yt&&Oe<9&&Ge==0&&Qe==me.coverEnd-me.coverStart?xt=ke.parentNode.getBoundingClientRect():xt=_r($e(ke,Ge,Qe).getClientRects(),ce),xt.left||xt.right||Ge==0)break;Qe=Ge,Ge=Ge-1,Xe="right"}yt&&Oe<11&&(xt=oa(ie.display.measure,xt))}else{Ge>0&&(Xe=ce="right");var Ft;ie.options.lineWrapping&&(Ft=ke.getClientRects()).length>1?xt=Ft[ce=="right"?Ft.length-1:0]:xt=ke.getBoundingClientRect()}if(yt&&Oe<9&&!Ge&&(!xt||!xt.left&&!xt.right)){var zn=ke.parentNode.getClientRects()[0];zn?xt={left:zn.left,right:zn.left+Un(ie.display),top:zn.top,bottom:zn.bottom}:xt=Sa}for(var Mn=xt.top-ae.rect.top,qi=xt.bottom-ae.rect.top,cr=(Mn+qi)/2,Br=ae.view.measure.heights,$r=0;$r<Br.length-1&&!(cr<Br[$r]);$r++);var No=$r?Br[$r-1]:0,co=Br[$r],zo={left:(Xe=="right"?xt.right:xt.left)-ae.rect.left,right:(Xe=="left"?xt.left:xt.right)-ae.rect.left,top:No,bottom:co};return!xt.left&&!xt.right&&(zo.bogus=!0),ie.options.singleCursorHeightPerLine||(zo.rtop=Mn,zo.rbottom=qi),zo}function oa(ie,ae){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Hn(ie))return ae;var fe=screen.logicalXDPI/screen.deviceXDPI,ce=screen.logicalYDPI/screen.deviceYDPI;return{left:ae.left*fe,right:ae.right*fe,top:ae.top*ce,bottom:ae.bottom*ce}}function la(ie){if(ie.measure&&(ie.measure.cache={},ie.measure.heights=null,ie.rest))for(var ae=0;ae<ie.rest.length;ae++)ie.measure.caches[ae]={}}function Ma(ie){ie.display.externalMeasure=null,st(ie.display.lineMeasure);for(var ae=0;ae<ie.display.view.length;ae++)la(ie.display.view[ae])}function za(ie){Ma(ie),ie.display.cachedCharWidth=ie.display.cachedTextHeight=ie.display.cachedPaddingH=null,ie.options.lineWrapping||(ie.display.maxLineChanged=!0),ie.display.lineNumChars=null}function Ro(){return ot&&ne?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ua(){return ot&&ne?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ko(ie){var ae=0;if(ie.widgets)for(var fe=0;fe<ie.widgets.length;++fe)ie.widgets[fe].above&&(ae+=is(ie.widgets[fe]));return ae}function jr(ie,ae,fe,ce,me){if(!me){var ke=ko(ae);fe.top+=ke,fe.bottom+=ke}if(ce=="line")return fe;ce||(ce="local");var Ge=or(ae);if(ce=="local"?Ge+=Zt(ie.display):Ge-=ie.display.viewOffset,ce=="page"||ce=="window"){var Qe=ie.display.lineSpace.getBoundingClientRect();Ge+=Qe.top+(ce=="window"?0:ua());var Xe=Qe.left+(ce=="window"?0:Ro());fe.left+=Xe,fe.right+=Xe}return fe.top+=Ge,fe.bottom+=Ge,fe}function Fa(ie,ae,fe){if(fe=="div")return ae;var ce=ae.left,me=ae.top;if(fe=="page")ce-=Ro(),me-=ua();else if(fe=="local"||!fe){var ke=ie.display.sizer.getBoundingClientRect();ce+=ke.left,me+=ke.top}var Ge=ie.display.lineSpace.getBoundingClientRect();return{left:ce-Ge.left,top:me-Ge.top}}function sa(ie,ae,fe,ce,me){return ce||(ce=Yn(ie.doc,ae.line)),jr(ie,ce,Tr(ie,ce,ae.ch,me),fe)}function Xo(ie,ae,fe,ce,me,ke){ce=ce||Yn(ie.doc,ae.line),me||(me=To(ie,ce));function Ge(qi,cr){var Br=Ca(ie,me,qi,cr?"right":"left",ke);return cr?Br.left=Br.right:Br.right=Br.left,jr(ie,ce,Br,fe)}var Qe=Sn(ce,ie.doc.direction),Xe=ae.ch,xt=ae.sticky;if(Xe>=ce.text.length?(Xe=ce.text.length,xt="before"):Xe<=0&&(Xe=0,xt="after"),!Qe)return Ge(xt=="before"?Xe-1:Xe,xt=="before");function an(qi,cr,Br){var $r=Qe[cr],No=$r.level==1;return Ge(Br?qi-1:qi,No!=Br)}var Ft=Ot(Qe,Xe,xt),zn=Dt,Mn=an(Xe,Ft,xt=="before");return zn!=null&&(Mn.other=an(Xe,zn,xt!="before")),Mn}function Io(ie,ae){var fe=0;ae=Fi(ie.doc,ae),ie.options.lineWrapping||(fe=Un(ie.display)*ae.ch);var ce=Yn(ie.doc,ae.line),me=or(ce)+Zt(ie.display);return{left:fe,right:fe,top:me,bottom:me+ce.height}}function ca(ie,ae,fe,ce,me){var ke=$t(ie,ae,fe);return ke.xRel=me,ce&&(ke.outside=ce),ke}function Wa(ie,ae,fe){var ce=ie.doc;if(fe+=ie.display.viewOffset,fe<0)return ca(ce.first,0,null,-1,-1);var me=Lt(ce,fe),ke=ce.first+ce.size-1;if(me>ke)return ca(ce.first+ce.size-1,Yn(ce,ke).text.length,null,1,1);ae<0&&(ae=0);for(var Ge=Yn(ce,me);;){var Qe=lt(ie,Ge,me,ae,fe),Xe=si(Ge,Qe.ch+(Qe.xRel>0||Qe.outside>0?1:0));if(!Xe)return Qe;var xt=Xe.find(1);if(xt.line==me)return xt;Ge=Yn(ce,me=xt.line)}}function gt(ie,ae,fe,ce){ce-=ko(ae);var me=ae.text.length,ke=pn(function(Ge){return Ca(ie,fe,Ge-1).bottom<=ce},me,0);return me=pn(function(Ge){return Ca(ie,fe,Ge).top>ce},ke,me),{begin:ke,end:me}}function Ht(ie,ae,fe,ce){fe||(fe=To(ie,ae));var me=jr(ie,ae,Ca(ie,fe,ce),"line").top;return gt(ie,ae,fe,me)}function Re(ie,ae,fe,ce){return ie.bottom<=fe?!1:ie.top>fe?!0:(ce?ie.left:ie.right)>ae}function lt(ie,ae,fe,ce,me){me-=or(ae);var ke=To(ie,ae),Ge=ko(ae),Qe=0,Xe=ae.text.length,xt=!0,an=Sn(ae,ie.doc.direction);if(an){var Ft=(ie.options.lineWrapping?sr:fr)(ie,ae,fe,ke,an,ce,me);xt=Ft.level!=1,Qe=xt?Ft.from:Ft.to-1,Xe=xt?Ft.to:Ft.from-1}var zn=null,Mn=null,qi=pn(function(va){var fo=Ca(ie,ke,va);return fo.top+=Ge,fo.bottom+=Ge,Re(fo,ce,me,!1)?(fo.top<=me&&fo.left<=ce&&(zn=va,Mn=fo),!0):!1},Qe,Xe),cr,Br,$r=!1;if(Mn){var No=ce-Mn.left<Mn.right-ce,co=No==xt;qi=zn+(co?0:1),Br=co?"after":"before",cr=No?Mn.left:Mn.right}else{!xt&&(qi==Xe||qi==Qe)&&qi++,Br=qi==0?"after":qi==ae.text.length?"before":Ca(ie,ke,qi-(xt?1:0)).bottom+Ge<=me==xt?"after":"before";var zo=Xo(ie,$t(fe,qi,Br),"line",ae,ke);cr=zo.left,$r=me<zo.top?-1:me>=zo.bottom?1:0}return qi=Kt(ae.text,qi,1),ca(fe,qi,Br,$r,ce-cr)}function fr(ie,ae,fe,ce,me,ke,Ge){var Qe=pn(function(Ft){var zn=me[Ft],Mn=zn.level!=1;return Re(Xo(ie,$t(fe,Mn?zn.to:zn.from,Mn?"before":"after"),"line",ae,ce),ke,Ge,!0)},0,me.length-1),Xe=me[Qe];if(Qe>0){var xt=Xe.level!=1,an=Xo(ie,$t(fe,xt?Xe.from:Xe.to,xt?"after":"before"),"line",ae,ce);Re(an,ke,Ge,!0)&&an.top>Ge&&(Xe=me[Qe-1])}return Xe}function sr(ie,ae,fe,ce,me,ke,Ge){var Qe=gt(ie,ae,ce,Ge),Xe=Qe.begin,xt=Qe.end;/\s/.test(ae.text.charAt(xt-1))&&xt--;for(var an=null,Ft=null,zn=0;zn<me.length;zn++){var Mn=me[zn];if(!(Mn.from>=xt||Mn.to<=Xe)){var qi=Mn.level!=1,cr=Ca(ie,ce,qi?Math.min(xt,Mn.to)-1:Math.max(Xe,Mn.from)).right,Br=cr<ke?ke-cr+1e9:cr-ke;(!an||Ft>Br)&&(an=Mn,Ft=Br)}}return an||(an=me[me.length-1]),an.from<Xe&&(an={from:Xe,to:an.to,level:an.level}),an.to>xt&&(an={from:an.from,to:xt,level:an.level}),an}var pr;function Ui(ie){if(ie.cachedTextHeight!=null)return ie.cachedTextHeight;if(pr==null){pr=Ye("pre",null,"CodeMirror-line-like");for(var ae=0;ae<49;++ae)pr.appendChild(document.createTextNode("x")),pr.appendChild(Ye("br"));pr.appendChild(document.createTextNode("x"))}nt(ie.measure,pr);var fe=pr.offsetHeight/50;return fe>3&&(ie.cachedTextHeight=fe),st(ie.measure),fe||1}function Un(ie){if(ie.cachedCharWidth!=null)return ie.cachedCharWidth;var ae=Ye("span","xxxxxxxxxx"),fe=Ye("pre",[ae],"CodeMirror-line-like");nt(ie.measure,fe);var ce=ae.getBoundingClientRect(),me=(ce.right-ce.left)/10;return me>2&&(ie.cachedCharWidth=me),me||10}function Lr(ie){for(var ae=ie.display,fe={},ce={},me=ae.gutters.clientLeft,ke=ae.gutters.firstChild,Ge=0;ke;ke=ke.nextSibling,++Ge){var Qe=ie.display.gutterSpecs[Ge].className;fe[Qe]=ke.offsetLeft+ke.clientLeft+me,ce[Qe]=ke.clientWidth}return{fixedPos:kr(ae),gutterTotalWidth:ae.gutters.offsetWidth,gutterLeft:fe,gutterWidth:ce,wrapperWidth:ae.wrapper.clientWidth}}function kr(ie){return ie.scroller.getBoundingClientRect().left-ie.sizer.getBoundingClientRect().left}function Zr(ie){var ae=Ui(ie.display),fe=ie.options.lineWrapping,ce=fe&&Math.max(5,ie.display.scroller.clientWidth/Un(ie.display)-3);return function(me){if(Pn(ie.doc,me))return 0;var ke=0;if(me.widgets)for(var Ge=0;Ge<me.widgets.length;Ge++)me.widgets[Ge].height&&(ke+=me.widgets[Ge].height);return fe?ke+(Math.ceil(me.text.length/ce)||1)*ae:ke+ae}}function Er(ie){var ae=ie.doc,fe=Zr(ie);ae.iter(function(ce){var me=fe(ce);me!=ce.height&&Dr(ce,me)})}function Eo(ie,ae,fe,ce){var me=ie.display;if(!fe&&Mr(ae).getAttribute("cm-not-content")=="true")return null;var ke,Ge,Qe=me.lineSpace.getBoundingClientRect();try{ke=ae.clientX-Qe.left,Ge=ae.clientY-Qe.top}catch(Ft){return null}var Xe=Wa(ie,ke,Ge),xt;if(ce&&Xe.xRel>0&&(xt=Yn(ie.doc,Xe.line).text).length==Xe.ch){var an=it(xt,xt.length,ie.options.tabSize)-xt.length;Xe=$t(Xe.line,Math.max(0,Math.round((ke-zi(ie.display).left)/Un(ie.display))-an))}return Xe}function Wi(ie,ae){if(ae>=ie.display.viewTo||(ae-=ie.display.viewFrom,ae<0))return null;for(var fe=ie.display.view,ce=0;ce<fe.length;ce++)if(ae-=fe[ce].size,ae<0)return ce}function Si(ie,ae,fe,ce){ae==null&&(ae=ie.doc.first),fe==null&&(fe=ie.doc.first+ie.doc.size),ce||(ce=0);var me=ie.display;if(ce&&fe<me.viewTo&&(me.updateLineNumbers==null||me.updateLineNumbers>ae)&&(me.updateLineNumbers=ae),ie.curOp.viewChanged=!0,ae>=me.viewTo)Nn&&Ki(ie.doc,ae)<me.viewTo&&Jr(ie);else if(fe<=me.viewFrom)Nn&&Bi(ie.doc,fe+ce)>me.viewFrom?Jr(ie):(me.viewFrom+=ce,me.viewTo+=ce);else if(ae<=me.viewFrom&&fe>=me.viewTo)Jr(ie);else if(ae<=me.viewFrom){var ke=Ur(ie,fe,fe+ce,1);ke?(me.view=me.view.slice(ke.index),me.viewFrom=ke.lineN,me.viewTo+=ce):Jr(ie)}else if(fe>=me.viewTo){var Ge=Ur(ie,ae,ae,-1);Ge?(me.view=me.view.slice(0,Ge.index),me.viewTo=Ge.lineN):Jr(ie)}else{var Qe=Ur(ie,ae,ae,-1),Xe=Ur(ie,fe,fe+ce,1);Qe&&Xe?(me.view=me.view.slice(0,Qe.index).concat(Mo(ie,Qe.lineN,Xe.lineN)).concat(me.view.slice(Xe.index)),me.viewTo+=ce):Jr(ie)}var xt=me.externalMeasured;xt&&(fe<xt.lineN?xt.lineN+=ce:ae<xt.lineN+xt.size&&(me.externalMeasured=null))}function Pi(ie,ae,fe){ie.curOp.viewChanged=!0;var ce=ie.display,me=ie.display.externalMeasured;if(me&&ae>=me.lineN&&ae<me.lineN+me.size&&(ce.externalMeasured=null),!(ae<ce.viewFrom||ae>=ce.viewTo)){var ke=ce.view[Wi(ie,ae)];if(ke.node!=null){var Ge=ke.changes||(ke.changes=[]);dn(Ge,fe)==-1&&Ge.push(fe)}}}function Jr(ie){ie.display.viewFrom=ie.display.viewTo=ie.doc.first,ie.display.view=[],ie.display.viewOffset=0}function Ur(ie,ae,fe,ce){var me=Wi(ie,ae),ke,Ge=ie.display.view;if(!Nn||fe==ie.doc.first+ie.doc.size)return{index:me,lineN:fe};for(var Qe=ie.display.viewFrom,Xe=0;Xe<me;Xe++)Qe+=Ge[Xe].size;if(Qe!=ae){if(ce>0){if(me==Ge.length-1)return null;ke=Qe+Ge[me].size-ae,me++}else ke=Qe-ae;ae+=ke,fe+=ke}for(;Ki(ie.doc,fe)!=fe;){if(me==(ce<0?0:Ge.length-1))return null;fe+=ce*Ge[me-(ce<0?1:0)].size,me+=ce}return{index:me,lineN:fe}}function Nr(ie,ae,fe){var ce=ie.display,me=ce.view;me.length==0||ae>=ce.viewTo||fe<=ce.viewFrom?(ce.view=Mo(ie,ae,fe),ce.viewFrom=ae):(ce.viewFrom>ae?ce.view=Mo(ie,ae,ce.viewFrom).concat(ce.view):ce.viewFrom<ae&&(ce.view=ce.view.slice(Wi(ie,ae))),ce.viewFrom=ae,ce.viewTo<fe?ce.view=ce.view.concat(Mo(ie,ce.viewTo,fe)):ce.viewTo>fe&&(ce.view=ce.view.slice(0,Wi(ie,fe)))),ce.viewTo=fe}function Lo(ie){for(var ae=ie.display.view,fe=0,ce=0;ce<ae.length;ce++){var me=ae[ce];!me.hidden&&(!me.node||me.changes)&&++fe}return fe}function yr(ie){ie.display.input.showSelection(ie.display.input.prepareSelection())}function Qr(ie,ae){ae===void 0&&(ae=!0);for(var fe=ie.doc,ce={},me=ce.cursors=document.createDocumentFragment(),ke=ce.selection=document.createDocumentFragment(),Ge=0;Ge<fe.sel.ranges.length;Ge++)if(!(!ae&&Ge==fe.sel.primIndex)){var Qe=fe.sel.ranges[Ge];if(!(Qe.from().line>=ie.display.viewTo||Qe.to().line<ie.display.viewFrom)){var Xe=Qe.empty();(Xe||ie.options.showCursorWhenSelecting)&&tr(ie,Qe.head,me),Xe||uo(ie,Qe,ke)}}return ce}function tr(ie,ae,fe){var ce=Xo(ie,ae,"div",null,null,!ie.options.singleCursorHeightPerLine),me=fe.appendChild(Ye("div","\xA0","CodeMirror-cursor"));if(me.style.left=ce.left+"px",me.style.top=ce.top+"px",me.style.height=Math.max(0,ce.bottom-ce.top)*ie.options.cursorHeight+"px",ce.other){var ke=fe.appendChild(Ye("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ke.style.display="",ke.style.left=ce.other.left+"px",ke.style.top=ce.other.top+"px",ke.style.height=(ce.other.bottom-ce.other.top)*.85+"px"}}function Ir(ie,ae){return ie.top-ae.top||ie.left-ae.left}function uo(ie,ae,fe){var ce=ie.display,me=ie.doc,ke=document.createDocumentFragment(),Ge=zi(ie.display),Qe=Ge.left,Xe=Math.max(ce.sizerWidth,Mi(ie)-ce.sizer.offsetLeft)-Ge.right,xt=me.direction=="ltr";function an(co,zo,va,fo){zo<0&&(zo=0),zo=Math.round(zo),fo=Math.round(fo),ke.appendChild(Ye("div",null,"CodeMirror-selected","position: absolute; left: "+co+`px;
|
|
top: `+zo+"px; width: "+(va==null?Xe-co:va)+`px;
|
|
height: `+(fo-zo)+"px"))}function Ft(co,zo,va){var fo=Yn(me,co),ja=fo.text.length,ys,ol;function Ls($s,Vl){return sa(ie,$t(co,$s),"div",fo,Vl)}function Hl($s,Vl,fl){var qs=Ht(ie,fo,null,$s),Qa=Vl=="ltr"==(fl=="after")?"left":"right",Bs=fl=="after"?qs.begin:qs.end-(/\s/.test(fo.text.charAt(qs.end-1))?2:1);return Ls(Bs,Qa)[Qa]}var xl=Sn(fo,me.direction);return Nt(xl,zo||0,va==null?ja:va,function($s,Vl,fl,qs){var Qa=fl=="ltr",Bs=Ls($s,Qa?"left":"right"),ul=Ls(Vl-1,Qa?"right":"left"),gl=zo==null&&$s==0,Ru=va==null&&Vl==ja,Ms=qs==0,gu=!xl||qs==xl.length-1;if(ul.top-Bs.top<=3){var ve=(xt?gl:Ru)&&Ms,Se=(xt?Ru:gl)&&gu,Be=ve?Qe:(Qa?Bs:ul).left,je=Se?Xe:(Qa?ul:Bs).right;an(Be,Bs.top,je-Be,Bs.bottom)}else{var tt,qe,mt,wt;Qa?(tt=xt&&gl&&Ms?Qe:Bs.left,qe=xt?Xe:Hl($s,fl,"before"),mt=xt?Qe:Hl(Vl,fl,"after"),wt=xt&&Ru&&gu?Xe:ul.right):(tt=xt?Hl($s,fl,"before"):Qe,qe=!xt&&gl&&Ms?Xe:Bs.right,mt=!xt&&Ru&&gu?Qe:ul.left,wt=xt?Hl(Vl,fl,"after"):Xe),an(tt,Bs.top,qe-tt,Bs.bottom),Bs.bottom<ul.top&&an(Qe,Bs.bottom,null,ul.top),an(mt,ul.top,wt-mt,ul.bottom)}(!ys||Ir(Bs,ys)<0)&&(ys=Bs),Ir(ul,ys)<0&&(ys=ul),(!ol||Ir(Bs,ol)<0)&&(ol=Bs),Ir(ul,ol)<0&&(ol=ul)}),{start:ys,end:ol}}var zn=ae.from(),Mn=ae.to();if(zn.line==Mn.line)Ft(zn.line,zn.ch,Mn.ch);else{var qi=Yn(me,zn.line),cr=Yn(me,Mn.line),Br=$n(qi)==$n(cr),$r=Ft(zn.line,zn.ch,Br?qi.text.length+1:null).end,No=Ft(Mn.line,Br?0:null,Mn.ch).start;Br&&($r.top<No.top-2?(an($r.right,$r.top,null,$r.bottom),an(Qe,No.top,No.left,No.bottom)):an($r.right,$r.top,No.left-$r.right,$r.bottom)),$r.bottom<No.top&&an(Qe,$r.bottom,null,No.top)}fe.appendChild(ke)}function Zo(ie){if(ie.state.focused){var ae=ie.display;clearInterval(ae.blinker);var fe=!0;ae.cursorDiv.style.visibility="",ie.options.cursorBlinkRate>0?ae.blinker=setInterval(function(){ie.hasFocus()||bs(ie),ae.cursorDiv.style.visibility=(fe=!fe)?"":"hidden"},ie.options.cursorBlinkRate):ie.options.cursorBlinkRate<0&&(ae.cursorDiv.style.visibility="hidden")}}function ha(ie){ie.state.focused||(ie.display.input.focus(),zr(ie))}function La(ie){ie.state.delayingBlurEvent=!0,setTimeout(function(){ie.state.delayingBlurEvent&&(ie.state.delayingBlurEvent=!1,bs(ie))},100)}function zr(ie,ae){ie.state.delayingBlurEvent&&(ie.state.delayingBlurEvent=!1),ie.options.readOnly!="nocursor"&&(ie.state.focused||(Qt(ie,"focus",ie,ae),ie.state.focused=!0,Bt(ie.display.wrapper,"CodeMirror-focused"),!ie.curOp&&ie.display.selForContextMenu!=ie.doc.sel&&(ie.display.input.reset(),at&&setTimeout(function(){return ie.display.input.reset(!0)},20)),ie.display.input.receivedFocus()),Zo(ie))}function bs(ie,ae){ie.state.delayingBlurEvent||(ie.state.focused&&(Qt(ie,"blur",ie,ae),ie.state.focused=!1,Ze(ie.display.wrapper,"CodeMirror-focused")),clearInterval(ie.display.blinker),setTimeout(function(){ie.state.focused||(ie.display.shift=!1)},150))}function eo(ie){for(var ae=ie.display,fe=ae.lineDiv.offsetTop,ce=0;ce<ae.view.length;ce++){var me=ae.view[ce],ke=ie.options.lineWrapping,Ge=void 0,Qe=0;if(!me.hidden){if(yt&&Oe<8){var Xe=me.node.offsetTop+me.node.offsetHeight;Ge=Xe-fe,fe=Xe}else{var xt=me.node.getBoundingClientRect();Ge=xt.bottom-xt.top,!ke&&me.text.firstChild&&(Qe=me.text.firstChild.getBoundingClientRect().right-xt.left-1)}var an=me.line.height-Ge;if((an>.005||an<-.005)&&(Dr(me.line,Ge),ka(me.line),me.rest))for(var Ft=0;Ft<me.rest.length;Ft++)ka(me.rest[Ft]);if(Qe>ie.display.sizerWidth){var zn=Math.ceil(Qe/Un(ie.display));zn>ie.display.maxLineLength&&(ie.display.maxLineLength=zn,ie.display.maxLine=me.line,ie.display.maxLineChanged=!0)}}}}function ka(ie){if(ie.widgets)for(var ae=0;ae<ie.widgets.length;++ae){var fe=ie.widgets[ae],ce=fe.node.parentNode;ce&&(fe.height=ce.offsetHeight)}}function wo(ie,ae,fe){var ce=fe&&fe.top!=null?Math.max(0,fe.top):ie.scroller.scrollTop;ce=Math.floor(ce-Zt(ie));var me=fe&&fe.bottom!=null?fe.bottom:ce+ie.wrapper.clientHeight,ke=Lt(ae,ce),Ge=Lt(ae,me);if(fe&&fe.ensure){var Qe=fe.ensure.from.line,Xe=fe.ensure.to.line;Qe<ke?(ke=Qe,Ge=Lt(ae,or(Yn(ae,Qe))+ie.wrapper.clientHeight)):Math.min(Xe,ae.lastLine())>=Ge&&(ke=Lt(ae,or(Yn(ae,Xe))-ie.wrapper.clientHeight),Ge=Xe)}return{from:ke,to:Math.max(Ge,ke+1)}}function ts(ie,ae){if(!ln(ie,"scrollCursorIntoView")){var fe=ie.display,ce=fe.sizer.getBoundingClientRect(),me=null;if(ae.top+ce.top<0?me=!0:ae.bottom+ce.top>(window.innerHeight||document.documentElement.clientHeight)&&(me=!1),me!=null&&!kt){var ke=Ye("div","\u200B",null,`position: absolute;
|
|
top: `+(ae.top-fe.viewOffset-Zt(ie.display))+`px;
|
|
height: `+(ae.bottom-ae.top+Ei(ie)+fe.barHeight)+`px;
|
|
left: `+ae.left+"px; width: "+Math.max(2,ae.right-ae.left)+"px;");ie.display.lineSpace.appendChild(ke),ke.scrollIntoView(me),ie.display.lineSpace.removeChild(ke)}}}function Ha(ie,ae,fe,ce){ce==null&&(ce=0);var me;!ie.options.lineWrapping&&ae==fe&&(ae=ae.ch?$t(ae.line,ae.sticky=="before"?ae.ch-1:ae.ch,"after"):ae,fe=ae.sticky=="before"?$t(ae.line,ae.ch+1,"before"):ae);for(var ke=0;ke<5;ke++){var Ge=!1,Qe=Xo(ie,ae),Xe=!fe||fe==ae?Qe:Xo(ie,fe);me={left:Math.min(Qe.left,Xe.left),top:Math.min(Qe.top,Xe.top)-ce,right:Math.max(Qe.left,Xe.left),bottom:Math.max(Qe.bottom,Xe.bottom)+ce};var xt=Ol(ie,me),an=ie.doc.scrollTop,Ft=ie.doc.scrollLeft;if(xt.scrollTop!=null&&(nl(ie,xt.scrollTop),Math.abs(ie.doc.scrollTop-an)>1&&(Ge=!0)),xt.scrollLeft!=null&&(dl(ie,xt.scrollLeft),Math.abs(ie.doc.scrollLeft-Ft)>1&&(Ge=!0)),!Ge)break}return me}function rs(ie,ae){var fe=Ol(ie,ae);fe.scrollTop!=null&&nl(ie,fe.scrollTop),fe.scrollLeft!=null&&dl(ie,fe.scrollLeft)}function Ol(ie,ae){var fe=ie.display,ce=Ui(ie.display);ae.top<0&&(ae.top=0);var me=ie.curOp&&ie.curOp.scrollTop!=null?ie.curOp.scrollTop:fe.scroller.scrollTop,ke=wi(ie),Ge={};ae.bottom-ae.top>ke&&(ae.bottom=ae.top+ke);var Qe=ie.doc.height+bn(fe),Xe=ae.top<ce,xt=ae.bottom>Qe-ce;if(ae.top<me)Ge.scrollTop=Xe?0:ae.top;else if(ae.bottom>me+ke){var an=Math.min(ae.top,(xt?Qe:ae.bottom)-ke);an!=me&&(Ge.scrollTop=an)}var Ft=ie.options.fixedGutter?0:fe.gutters.offsetWidth,zn=ie.curOp&&ie.curOp.scrollLeft!=null?ie.curOp.scrollLeft:fe.scroller.scrollLeft-Ft,Mn=Mi(ie)-fe.gutters.offsetWidth,qi=ae.right-ae.left>Mn;return qi&&(ae.right=ae.left+Mn),ae.left<10?Ge.scrollLeft=0:ae.left<zn?Ge.scrollLeft=Math.max(0,ae.left+Ft-(qi?0:10)):ae.right>Mn+zn-3&&(Ge.scrollLeft=ae.right+(qi?0:10)-Mn),Ge}function su(ie,ae){ae!=null&&(al(ie),ie.curOp.scrollTop=(ie.curOp.scrollTop==null?ie.doc.scrollTop:ie.curOp.scrollTop)+ae)}function Rl(ie){al(ie);var ae=ie.getCursor();ie.curOp.scrollToPos={from:ae,to:ae,margin:ie.options.cursorScrollMargin}}function lu(ie,ae,fe){(ae!=null||fe!=null)&&al(ie),ae!=null&&(ie.curOp.scrollLeft=ae),fe!=null&&(ie.curOp.scrollTop=fe)}function Da(ie,ae){al(ie),ie.curOp.scrollToPos=ae}function al(ie){var ae=ie.curOp.scrollToPos;if(ae){ie.curOp.scrollToPos=null;var fe=Io(ie,ae.from),ce=Io(ie,ae.to);jl(ie,fe,ce,ae.margin)}}function jl(ie,ae,fe,ce){var me=Ol(ie,{left:Math.min(ae.left,fe.left),top:Math.min(ae.top,fe.top)-ce,right:Math.max(ae.right,fe.right),bottom:Math.max(ae.bottom,fe.bottom)+ce});lu(ie,me.scrollLeft,me.scrollTop)}function nl(ie,ae){Math.abs(ie.doc.scrollTop-ae)<2||(le||Oo(ie,{top:ae}),oh(ie,ae,!0),le&&Oo(ie),Aa(ie,100))}function oh(ie,ae,fe){ae=Math.max(0,Math.min(ie.display.scroller.scrollHeight-ie.display.scroller.clientHeight,ae)),!(ie.display.scroller.scrollTop==ae&&!fe)&&(ie.doc.scrollTop=ae,ie.display.scrollbars.setScrollTop(ae),ie.display.scroller.scrollTop!=ae&&(ie.display.scroller.scrollTop=ae))}function dl(ie,ae,fe,ce){ae=Math.max(0,Math.min(ae,ie.display.scroller.scrollWidth-ie.display.scroller.clientWidth)),!((fe?ae==ie.doc.scrollLeft:Math.abs(ie.doc.scrollLeft-ae)<2)&&!ce)&&(ie.doc.scrollLeft=ae,Su(ie),ie.display.scroller.scrollLeft!=ae&&(ie.display.scroller.scrollLeft=ae),ie.display.scrollbars.setScrollLeft(ae))}function pa(ie){var ae=ie.display,fe=ae.gutters.offsetWidth,ce=Math.round(ie.doc.height+bn(ie.display));return{clientHeight:ae.scroller.clientHeight,viewHeight:ae.wrapper.clientHeight,scrollWidth:ae.scroller.scrollWidth,clientWidth:ae.scroller.clientWidth,viewWidth:ae.wrapper.clientWidth,barLeft:ie.options.fixedGutter?fe:0,docHeight:ce,scrollHeight:ce+Ei(ie)+ae.barHeight,nativeBarWidth:ae.nativeBarWidth,gutterWidth:fe}}var Oa=function(ie,ae,fe){this.cm=fe;var ce=this.vert=Ye("div",[Ye("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),me=this.horiz=Ye("div",[Ye("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");ce.tabIndex=me.tabIndex=-1,ie(ce),ie(me),Dn(ce,"scroll",function(){ce.clientHeight&&ae(ce.scrollTop,"vertical")}),Dn(me,"scroll",function(){me.clientWidth&&ae(me.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,yt&&Oe<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Oa.prototype.update=function(ie){var ae=ie.scrollWidth>ie.clientWidth+1,fe=ie.scrollHeight>ie.clientHeight+1,ce=ie.nativeBarWidth;if(fe){this.vert.style.display="block",this.vert.style.bottom=ae?ce+"px":"0";var me=ie.viewHeight-(ae?ce:0);this.vert.firstChild.style.height=Math.max(0,ie.scrollHeight-ie.clientHeight+me)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(ae){this.horiz.style.display="block",this.horiz.style.right=fe?ce+"px":"0",this.horiz.style.left=ie.barLeft+"px";var ke=ie.viewWidth-ie.barLeft-(fe?ce:0);this.horiz.firstChild.style.width=Math.max(0,ie.scrollWidth-ie.clientWidth+ke)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&ie.clientHeight>0&&(ce==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:fe?ce:0,bottom:ae?ce:0}},Oa.prototype.setScrollLeft=function(ie){this.horiz.scrollLeft!=ie&&(this.horiz.scrollLeft=ie),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Oa.prototype.setScrollTop=function(ie){this.vert.scrollTop!=ie&&(this.vert.scrollTop=ie),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Oa.prototype.zeroWidthHack=function(){var ie=de&&!dt?"12px":"18px";this.horiz.style.height=this.vert.style.width=ie,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new rt,this.disableVert=new rt},Oa.prototype.enableZeroWidthBar=function(ie,ae,fe){ie.style.pointerEvents="auto";function ce(){var me=ie.getBoundingClientRect(),ke=fe=="vert"?document.elementFromPoint(me.right-1,(me.top+me.bottom)/2):document.elementFromPoint((me.right+me.left)/2,me.bottom-1);ke!=ie?ie.style.pointerEvents="none":ae.set(1e3,ce)}ae.set(1e3,ce)},Oa.prototype.clear=function(){var ie=this.horiz.parentNode;ie.removeChild(this.horiz),ie.removeChild(this.vert)};var hs=function(){};hs.prototype.update=function(){return{bottom:0,right:0}},hs.prototype.setScrollLeft=function(){},hs.prototype.setScrollTop=function(){},hs.prototype.clear=function(){};function Os(ie,ae){ae||(ae=pa(ie));var fe=ie.display.barWidth,ce=ie.display.barHeight;Rs(ie,ae);for(var me=0;me<4&&fe!=ie.display.barWidth||ce!=ie.display.barHeight;me++)fe!=ie.display.barWidth&&ie.options.lineWrapping&&eo(ie),Rs(ie,pa(ie)),fe=ie.display.barWidth,ce=ie.display.barHeight}function Rs(ie,ae){var fe=ie.display,ce=fe.scrollbars.update(ae);fe.sizer.style.paddingRight=(fe.barWidth=ce.right)+"px",fe.sizer.style.paddingBottom=(fe.barHeight=ce.bottom)+"px",fe.heightForcer.style.borderBottom=ce.bottom+"px solid transparent",ce.right&&ce.bottom?(fe.scrollbarFiller.style.display="block",fe.scrollbarFiller.style.height=ce.bottom+"px",fe.scrollbarFiller.style.width=ce.right+"px"):fe.scrollbarFiller.style.display="",ce.bottom&&ie.options.coverGutterNextToScrollbar&&ie.options.fixedGutter?(fe.gutterFiller.style.display="block",fe.gutterFiller.style.height=ce.bottom+"px",fe.gutterFiller.style.width=ae.gutterWidth+"px"):fe.gutterFiller.style.display=""}var Nu={native:Oa,null:hs};function Bl(ie){ie.display.scrollbars&&(ie.display.scrollbars.clear(),ie.display.scrollbars.addClass&&Ze(ie.display.wrapper,ie.display.scrollbars.addClass)),ie.display.scrollbars=new Nu[ie.options.scrollbarStyle](function(ae){ie.display.wrapper.insertBefore(ae,ie.display.scrollbarFiller),Dn(ae,"mousedown",function(){ie.state.focused&&setTimeout(function(){return ie.display.input.focus()},0)}),ae.setAttribute("cm-not-content","true")},function(ae,fe){fe=="horizontal"?dl(ie,ae):nl(ie,ae)},ie),ie.display.scrollbars.addClass&&Bt(ie.display.wrapper,ie.display.scrollbars.addClass)}var Du=0;function zl(ie){ie.curOp={cm:ie,viewChanged:!1,startHeight:ie.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:++Du},vs(ie.curOp)}function uu(ie){var ae=ie.curOp;ae&&ps(ae,function(fe){for(var ce=0;ce<fe.ops.length;ce++)fe.ops[ce].cm.curOp=null;of(fe)})}function of(ie){for(var ae=ie.ops,fe=0;fe<ae.length;fe++)af(ae[fe]);for(var ce=0;ce<ae.length;ce++)mc(ae[ce]);for(var me=0;me<ae.length;me++)sf(ae[me]);for(var ke=0;ke<ae.length;ke++)Es(ae[ke]);for(var Ge=0;Ge<ae.length;Ge++)Wn(ae[Ge])}function af(ie){var ae=ie.cm,fe=ae.display;Pa(ae),ie.updateMaxLine&&Yr(ae),ie.mustUpdate=ie.viewChanged||ie.forceUpdate||ie.scrollTop!=null||ie.scrollToPos&&(ie.scrollToPos.from.line<fe.viewFrom||ie.scrollToPos.to.line>=fe.viewTo)||fe.maxLineChanged&&ae.options.lineWrapping,ie.update=ie.mustUpdate&&new Ua(ae,ie.mustUpdate&&{top:ie.scrollTop,ensure:ie.scrollToPos},ie.forceUpdate)}function mc(ie){ie.updatedDisplay=ie.mustUpdate&&ql(ie.cm,ie.update)}function sf(ie){var ae=ie.cm,fe=ae.display;ie.updatedDisplay&&eo(ae),ie.barMeasure=pa(ae),fe.maxLineChanged&&!ae.options.lineWrapping&&(ie.adjustWidthTo=Tr(ae,fe.maxLine,fe.maxLine.text.length).left+3,ae.display.sizerWidth=ie.adjustWidthTo,ie.barMeasure.scrollWidth=Math.max(fe.scroller.clientWidth,fe.sizer.offsetLeft+ie.adjustWidthTo+Ei(ae)+ae.display.barWidth),ie.maxScrollLeft=Math.max(0,fe.sizer.offsetLeft+ie.adjustWidthTo-Mi(ae))),(ie.updatedDisplay||ie.selectionChanged)&&(ie.preparedSelection=fe.input.prepareSelection())}function Es(ie){var ae=ie.cm;ie.adjustWidthTo!=null&&(ae.display.sizer.style.minWidth=ie.adjustWidthTo+"px",ie.maxScrollLeft<ae.doc.scrollLeft&&dl(ae,Math.min(ae.display.scroller.scrollLeft,ie.maxScrollLeft),!0),ae.display.maxLineChanged=!1);var fe=ie.focus&&ie.focus==Pt();ie.preparedSelection&&ae.display.input.showSelection(ie.preparedSelection,fe),(ie.updatedDisplay||ie.startHeight!=ae.doc.height)&&Os(ae,ie.barMeasure),ie.updatedDisplay&&Ds(ae,ie.barMeasure),ie.selectionChanged&&Zo(ae),ae.state.focused&&ie.updateInput&&ae.display.input.reset(ie.typing),fe&&ha(ie.cm)}function Wn(ie){var ae=ie.cm,fe=ae.display,ce=ae.doc;if(ie.updatedDisplay&&Xa(ae,ie.update),fe.wheelStartX!=null&&(ie.scrollTop!=null||ie.scrollLeft!=null||ie.scrollToPos)&&(fe.wheelStartX=fe.wheelStartY=null),ie.scrollTop!=null&&oh(ae,ie.scrollTop,ie.forceScroll),ie.scrollLeft!=null&&dl(ae,ie.scrollLeft,!0,!0),ie.scrollToPos){var me=Ha(ae,Fi(ce,ie.scrollToPos.from),Fi(ce,ie.scrollToPos.to),ie.scrollToPos.margin);ts(ae,me)}var ke=ie.maybeHiddenMarkers,Ge=ie.maybeUnhiddenMarkers;if(ke)for(var Qe=0;Qe<ke.length;++Qe)ke[Qe].lines.length||Qt(ke[Qe],"hide");if(Ge)for(var Xe=0;Xe<Ge.length;++Xe)Ge[Xe].lines.length&&Qt(Ge[Xe],"unhide");fe.wrapper.offsetHeight&&(ce.scrollTop=ae.display.scroller.scrollTop),ie.changeObjs&&Qt(ae,"changes",ae,ie.changeObjs),ie.update&&ie.update.finish()}function gr(ie,ae){if(ie.curOp)return ae();zl(ie);try{return ae()}finally{uu(ie)}}function _o(ie,ae){return function(){if(ie.curOp)return ae.apply(ie,arguments);zl(ie);try{return ae.apply(ie,arguments)}finally{uu(ie)}}}function io(ie){return function(){if(this.curOp)return ie.apply(this,arguments);zl(this);try{return ie.apply(this,arguments)}finally{uu(this)}}}function nr(ie){return function(){var ae=this.cm;if(!ae||ae.curOp)return ie.apply(this,arguments);zl(ae);try{return ie.apply(this,arguments)}finally{uu(ae)}}}function Aa(ie,ae){ie.doc.highlightFrontier<ie.display.viewTo&&ie.state.highlight.set(ae,vn(ma,ie))}function ma(ie){var ae=ie.doc;if(!(ae.highlightFrontier>=ie.display.viewTo)){var fe=+new Date+ie.options.workTime,ce=So(ie,ae.highlightFrontier),me=[];ae.iter(ce.line,Math.min(ae.first+ae.size,ie.display.viewTo+500),function(ke){if(ce.line>=ie.display.viewFrom){var Ge=ke.styles,Qe=ke.text.length>ie.options.maxHighlightLength?xi(ae.mode,ce.state):null,Xe=ro(ie,ke,ce,!0);Qe&&(ce.state=Qe),ke.styles=Xe.styles;var xt=ke.styleClasses,an=Xe.classes;an?ke.styleClasses=an:xt&&(ke.styleClasses=null);for(var Ft=!Ge||Ge.length!=ke.styles.length||xt!=an&&(!xt||!an||xt.bgClass!=an.bgClass||xt.textClass!=an.textClass),zn=0;!Ft&&zn<Ge.length;++zn)Ft=Ge[zn]!=ke.styles[zn];Ft&&me.push(ce.line),ke.stateAfter=ce.save(),ce.nextLine()}else ke.text.length<=ie.options.maxHighlightLength&&yn(ie,ke.text,ce),ke.stateAfter=ce.line%5==0?ce.save():null,ce.nextLine();if(+new Date>fe)return Aa(ie,ie.options.workDelay),!0}),ae.highlightFrontier=ce.line,ae.modeFrontier=Math.max(ae.modeFrontier,ce.line),me.length&&gr(ie,function(){for(var ke=0;ke<me.length;ke++)Pi(ie,me[ke],"text")})}}var Ua=function(ie,ae,fe){var ce=ie.display;this.viewport=ae,this.visible=wo(ce,ie.doc,ae),this.editorIsHidden=!ce.wrapper.offsetWidth,this.wrapperHeight=ce.wrapper.clientHeight,this.wrapperWidth=ce.wrapper.clientWidth,this.oldDisplayWidth=Mi(ie),this.force=fe,this.dims=Lr(ie),this.events=[]};Ua.prototype.signal=function(ie,ae){cn(ie,ae)&&this.events.push(arguments)},Ua.prototype.finish=function(){for(var ie=0;ie<this.events.length;ie++)Qt.apply(null,this.events[ie])};function Pa(ie){var ae=ie.display;!ae.scrollbarsClipped&&ae.scroller.offsetWidth&&(ae.nativeBarWidth=ae.scroller.offsetWidth-ae.scroller.clientWidth,ae.heightForcer.style.height=Ei(ie)+"px",ae.sizer.style.marginBottom=-ae.nativeBarWidth+"px",ae.sizer.style.borderRightWidth=Ei(ie)+"px",ae.scrollbarsClipped=!0)}function Ks(ie){if(ie.hasFocus())return null;var ae=Pt();if(!ae||!Et(ie.display.lineDiv,ae))return null;var fe={activeElt:ae};if(window.getSelection){var ce=window.getSelection();ce.anchorNode&&ce.extend&&Et(ie.display.lineDiv,ce.anchorNode)&&(fe.anchorNode=ce.anchorNode,fe.anchorOffset=ce.anchorOffset,fe.focusNode=ce.focusNode,fe.focusOffset=ce.focusOffset)}return fe}function Ra(ie){if(!(!ie||!ie.activeElt||ie.activeElt==Pt())&&(ie.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(ie.activeElt.nodeName)&&ie.anchorNode&&Et(document.body,ie.anchorNode)&&Et(document.body,ie.focusNode))){var ae=window.getSelection(),fe=document.createRange();fe.setEnd(ie.anchorNode,ie.anchorOffset),fe.collapse(!1),ae.removeAllRanges(),ae.addRange(fe),ae.extend(ie.focusNode,ie.focusOffset)}}function ql(ie,ae){var fe=ie.display,ce=ie.doc;if(ae.editorIsHidden)return Jr(ie),!1;if(!ae.force&&ae.visible.from>=fe.viewFrom&&ae.visible.to<=fe.viewTo&&(fe.updateLineNumbers==null||fe.updateLineNumbers>=fe.viewTo)&&fe.renderedView==fe.view&&Lo(ie)==0)return!1;Cs(ie)&&(Jr(ie),ae.dims=Lr(ie));var me=ce.first+ce.size,ke=Math.max(ae.visible.from-ie.options.viewportMargin,ce.first),Ge=Math.min(me,ae.visible.to+ie.options.viewportMargin);fe.viewFrom<ke&&ke-fe.viewFrom<20&&(ke=Math.max(ce.first,fe.viewFrom)),fe.viewTo>Ge&&fe.viewTo-Ge<20&&(Ge=Math.min(me,fe.viewTo)),Nn&&(ke=Ki(ie.doc,ke),Ge=Bi(ie.doc,Ge));var Qe=ke!=fe.viewFrom||Ge!=fe.viewTo||fe.lastWrapHeight!=ae.wrapperHeight||fe.lastWrapWidth!=ae.wrapperWidth;Nr(ie,ke,Ge),fe.viewOffset=or(Yn(ie.doc,fe.viewFrom)),ie.display.mover.style.top=fe.viewOffset+"px";var Xe=Lo(ie);if(!Qe&&Xe==0&&!ae.force&&fe.renderedView==fe.view&&(fe.updateLineNumbers==null||fe.updateLineNumbers>=fe.viewTo))return!1;var xt=Ks(ie);return Xe>4&&(fe.lineDiv.style.display="none"),Zl(ie,fe.updateLineNumbers,ae.dims),Xe>4&&(fe.lineDiv.style.display=""),fe.renderedView=fe.view,Ra(xt),st(fe.cursorDiv),st(fe.selectionDiv),fe.gutters.style.height=fe.sizer.style.minHeight=0,Qe&&(fe.lastWrapHeight=ae.wrapperHeight,fe.lastWrapWidth=ae.wrapperWidth,Aa(ie,400)),fe.updateLineNumbers=null,!0}function Xa(ie,ae){for(var fe=ae.viewport,ce=!0;;ce=!1){if(!ce||!ie.options.lineWrapping||ae.oldDisplayWidth==Mi(ie)){if(fe&&fe.top!=null&&(fe={top:Math.min(ie.doc.height+bn(ie.display)-wi(ie),fe.top)}),ae.visible=wo(ie.display,ie.doc,fe),ae.visible.from>=ie.display.viewFrom&&ae.visible.to<=ie.display.viewTo)break}else ce&&(ae.visible=wo(ie.display,ie.doc,fe));if(!ql(ie,ae))break;eo(ie);var me=pa(ie);yr(ie),Os(ie,me),Ds(ie,me),ae.force=!1}ae.signal(ie,"update",ie),(ie.display.viewFrom!=ie.display.reportedViewFrom||ie.display.viewTo!=ie.display.reportedViewTo)&&(ae.signal(ie,"viewportChange",ie,ie.display.viewFrom,ie.display.viewTo),ie.display.reportedViewFrom=ie.display.viewFrom,ie.display.reportedViewTo=ie.display.viewTo)}function Oo(ie,ae){var fe=new Ua(ie,ae);if(ql(ie,fe)){eo(ie),Xa(ie,fe);var ce=pa(ie);yr(ie),Os(ie,ce),Ds(ie,ce),fe.finish()}}function Zl(ie,ae,fe){var ce=ie.display,me=ie.options.lineNumbers,ke=ce.lineDiv,Ge=ke.firstChild;function Qe(qi){var cr=qi.nextSibling;return at&&de&&ie.display.currentWheelTarget==qi?qi.style.display="none":qi.parentNode.removeChild(qi),cr}for(var Xe=ce.view,xt=ce.viewFrom,an=0;an<Xe.length;an++){var Ft=Xe[an];if(!Ft.hidden)if(!Ft.node||Ft.node.parentNode!=ke){var zn=ea(ie,Ft,xt,fe);ke.insertBefore(zn,Ge)}else{for(;Ge!=Ft.node;)Ge=Qe(Ge);var Mn=me&&ae!=null&&ae<=xt&&Ft.lineNumber;Ft.changes&&(dn(Ft.changes,"gutter")>-1&&(Mn=!1),Ba(ie,Ft,xt,fe)),Mn&&(st(Ft.lineNumber),Ft.lineNumber.appendChild(document.createTextNode(ci(ie.options,xt)))),Ge=Ft.node.nextSibling}xt+=Ft.size}for(;Ge;)Ge=Qe(Ge)}function sl(ie){var ae=ie.gutters.offsetWidth;ie.sizer.style.marginLeft=ae+"px"}function Ds(ie,ae){ie.display.sizer.style.minHeight=ae.docHeight+"px",ie.display.heightForcer.style.top=ae.docHeight+"px",ie.display.gutters.style.height=ae.docHeight+ie.display.barHeight+Ei(ie)+"px"}function Su(ie){var ae=ie.display,fe=ae.view;if(!(!ae.alignWidgets&&(!ae.gutters.firstChild||!ie.options.fixedGutter))){for(var ce=kr(ae)-ae.scroller.scrollLeft+ie.doc.scrollLeft,me=ae.gutters.offsetWidth,ke=ce+"px",Ge=0;Ge<fe.length;Ge++)if(!fe[Ge].hidden){ie.options.fixedGutter&&(fe[Ge].gutter&&(fe[Ge].gutter.style.left=ke),fe[Ge].gutterBackground&&(fe[Ge].gutterBackground.style.left=ke));var Qe=fe[Ge].alignable;if(Qe)for(var Xe=0;Xe<Qe.length;Xe++)Qe[Xe].style.left=ke}ie.options.fixedGutter&&(ae.gutters.style.left=ce+me+"px")}}function Cs(ie){if(!ie.options.lineNumbers)return!1;var ae=ie.doc,fe=ci(ie.options,ae.first+ae.size-1),ce=ie.display;if(fe.length!=ce.lineNumChars){var me=ce.measure.appendChild(Ye("div",[Ye("div",fe)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ke=me.firstChild.offsetWidth,Ge=me.offsetWidth-ke;return ce.lineGutter.style.width="",ce.lineNumInnerWidth=Math.max(ke,ce.lineGutter.offsetWidth-Ge)+1,ce.lineNumWidth=ce.lineNumInnerWidth+Ge,ce.lineNumChars=ce.lineNumInnerWidth?fe.length:-1,ce.lineGutter.style.width=ce.lineNumWidth+"px",sl(ie.display),!0}return!1}function Ts(ie,ae){for(var fe=[],ce=!1,me=0;me<ie.length;me++){var ke=ie[me],Ge=null;if(typeof ke!="string"&&(Ge=ke.style,ke=ke.className),ke=="CodeMirror-linenumbers")if(ae)ce=!0;else continue;fe.push({className:ke,style:Ge})}return ae&&!ce&&fe.push({className:"CodeMirror-linenumbers",style:null}),fe}function Ml(ie){var ae=ie.gutters,fe=ie.gutterSpecs;st(ae),ie.lineGutter=null;for(var ce=0;ce<fe.length;++ce){var me=fe[ce],ke=me.className,Ge=me.style,Qe=ae.appendChild(Ye("div",null,"CodeMirror-gutter "+ke));Ge&&(Qe.style.cssText=Ge),ke=="CodeMirror-linenumbers"&&(ie.lineGutter=Qe,Qe.style.width=(ie.lineNumWidth||1)+"px")}ae.style.display=fe.length?"":"none",sl(ie)}function Js(ie){Ml(ie.display),Si(ie),Su(ie)}function _h(ie,ae,fe,ce){var me=this;this.input=fe,me.scrollbarFiller=Ye("div",null,"CodeMirror-scrollbar-filler"),me.scrollbarFiller.setAttribute("cm-not-content","true"),me.gutterFiller=Ye("div",null,"CodeMirror-gutter-filler"),me.gutterFiller.setAttribute("cm-not-content","true"),me.lineDiv=ct("div",null,"CodeMirror-code"),me.selectionDiv=Ye("div",null,null,"position: relative; z-index: 1"),me.cursorDiv=Ye("div",null,"CodeMirror-cursors"),me.measure=Ye("div",null,"CodeMirror-measure"),me.lineMeasure=Ye("div",null,"CodeMirror-measure"),me.lineSpace=ct("div",[me.measure,me.lineMeasure,me.selectionDiv,me.cursorDiv,me.lineDiv],null,"position: relative; outline: none");var ke=ct("div",[me.lineSpace],"CodeMirror-lines");me.mover=Ye("div",[ke],null,"position: relative"),me.sizer=Ye("div",[me.mover],"CodeMirror-sizer"),me.sizerWidth=null,me.heightForcer=Ye("div",null,null,"position: absolute; height: "+ni+"px; width: 1px;"),me.gutters=Ye("div",null,"CodeMirror-gutters"),me.lineGutter=null,me.scroller=Ye("div",[me.sizer,me.heightForcer,me.gutters],"CodeMirror-scroll"),me.scroller.setAttribute("tabIndex","-1"),me.wrapper=Ye("div",[me.scrollbarFiller,me.gutterFiller,me.scroller],"CodeMirror"),yt&&Oe<8&&(me.gutters.style.zIndex=-1,me.scroller.style.paddingRight=0),!at&&!(le&&te)&&(me.scroller.draggable=!0),ie&&(ie.appendChild?ie.appendChild(me.wrapper):ie(me.wrapper)),me.viewFrom=me.viewTo=ae.first,me.reportedViewFrom=me.reportedViewTo=ae.first,me.view=[],me.renderedView=null,me.externalMeasured=null,me.viewOffset=0,me.lastWrapHeight=me.lastWrapWidth=0,me.updateLineNumbers=null,me.nativeBarWidth=me.barHeight=me.barWidth=0,me.scrollbarsClipped=!1,me.lineNumWidth=me.lineNumInnerWidth=me.lineNumChars=null,me.alignWidgets=!1,me.cachedCharWidth=me.cachedTextHeight=me.cachedPaddingH=null,me.maxLine=null,me.maxLineLength=0,me.maxLineChanged=!1,me.wheelDX=me.wheelDY=me.wheelStartX=me.wheelStartY=null,me.shift=!1,me.selForContextMenu=null,me.activeTouch=null,me.gutterSpecs=Ts(ce.gutters,ce.lineNumbers),Ml(me),fe.init(me)}var Gl=0,js=null;yt?js=-.53:le?js=15:ot?js=-.7:Tt&&(js=-1/3);function Tu(ie){var ae=ie.wheelDeltaX,fe=ie.wheelDeltaY;return ae==null&&ie.detail&&ie.axis==ie.HORIZONTAL_AXIS&&(ae=ie.detail),fe==null&&ie.detail&&ie.axis==ie.VERTICAL_AXIS?fe=ie.detail:fe==null&&(fe=ie.wheelDelta),{x:ae,y:fe}}function hu(ie){var ae=Tu(ie);return ae.x*=js,ae.y*=js,ae}function ll(ie,ae){var fe=Tu(ae),ce=fe.x,me=fe.y,ke=ie.display,Ge=ke.scroller,Qe=Ge.scrollWidth>Ge.clientWidth,Xe=Ge.scrollHeight>Ge.clientHeight;if(ce&&Qe||me&&Xe){if(me&&de&&at){e:for(var xt=ae.target,an=ke.view;xt!=Ge;xt=xt.parentNode)for(var Ft=0;Ft<an.length;Ft++)if(an[Ft].node==xt){ie.display.currentWheelTarget=xt;break e}}if(ce&&!le&&!We&&js!=null){me&&Xe&&nl(ie,Math.max(0,Ge.scrollTop+me*js)),dl(ie,Math.max(0,Ge.scrollLeft+ce*js)),(!me||me&&Xe)&&ii(ae),ke.wheelStartX=null;return}if(me&&js!=null){var zn=me*js,Mn=ie.doc.scrollTop,qi=Mn+ke.wrapper.clientHeight;zn<0?Mn=Math.max(0,Mn+zn-50):qi=Math.min(ie.doc.height,qi+zn+50),Oo(ie,{top:Mn,bottom:qi})}Gl<20&&(ke.wheelStartX==null?(ke.wheelStartX=Ge.scrollLeft,ke.wheelStartY=Ge.scrollTop,ke.wheelDX=ce,ke.wheelDY=me,setTimeout(function(){if(ke.wheelStartX!=null){var cr=Ge.scrollLeft-ke.wheelStartX,Br=Ge.scrollTop-ke.wheelStartY,$r=Br&&ke.wheelDY&&Br/ke.wheelDY||cr&&ke.wheelDX&&cr/ke.wheelDX;ke.wheelStartX=ke.wheelStartY=null,$r&&(js=(js*Gl+$r)/(Gl+1),++Gl)}},200)):(ke.wheelDX+=ce,ke.wheelDY+=me))}}var du=function(ie,ae){this.ranges=ie,this.primIndex=ae};du.prototype.primary=function(){return this.ranges[this.primIndex]},du.prototype.equals=function(ie){if(ie==this)return!0;if(ie.primIndex!=this.primIndex||ie.ranges.length!=this.ranges.length)return!1;for(var ae=0;ae<this.ranges.length;ae++){var fe=this.ranges[ae],ce=ie.ranges[ae];if(!Xt(fe.anchor,ce.anchor)||!Xt(fe.head,ce.head))return!1}return!0},du.prototype.deepCopy=function(){for(var ie=[],ae=0;ae<this.ranges.length;ae++)ie[ae]=new us(ri(this.ranges[ae].anchor),ri(this.ranges[ae].head));return new du(ie,this.primIndex)},du.prototype.somethingSelected=function(){for(var ie=0;ie<this.ranges.length;ie++)if(!this.ranges[ie].empty())return!0;return!1},du.prototype.contains=function(ie,ae){ae||(ae=ie);for(var fe=0;fe<this.ranges.length;fe++){var ce=this.ranges[fe];if(xn(ae,ce.from())>=0&&xn(ie,ce.to())<=0)return fe}return-1};var us=function(ie,ae){this.anchor=ie,this.head=ae};us.prototype.from=function(){return gi(this.anchor,this.head)},us.prototype.to=function(){return Hi(this.anchor,this.head)},us.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function wu(ie,ae,fe){var ce=ie&&ie.options.selectionsMayTouch,me=ae[fe];ae.sort(function(zn,Mn){return xn(zn.from(),Mn.from())}),fe=dn(ae,me);for(var ke=1;ke<ae.length;ke++){var Ge=ae[ke],Qe=ae[ke-1],Xe=xn(Qe.to(),Ge.from());if(ce&&!Ge.empty()?Xe>0:Xe>=0){var xt=gi(Qe.from(),Ge.from()),an=Hi(Qe.to(),Ge.to()),Ft=Qe.empty()?Ge.from()==Ge.head:Qe.from()==Qe.head;ke<=fe&&--fe,ae.splice(--ke,2,new us(Ft?an:xt,Ft?xt:an))}}return new du(ae,fe)}function Fh(ie,ae){return new du([new us(ie,ae||ie)],0)}function Oh(ie){return ie.text?$t(ie.from.line+ie.text.length-1,ht(ie.text).length+(ie.text.length==1?ie.from.ch:0)):ie.to}function od(ie,ae){if(xn(ie,ae.from)<0)return ie;if(xn(ie,ae.to)<=0)return Oh(ae);var fe=ie.line+ae.text.length-(ae.to.line-ae.from.line)-1,ce=ie.ch;return ie.line==ae.to.line&&(ce+=Oh(ae).ch-ae.to.ch),$t(fe,ce)}function vc(ie,ae){for(var fe=[],ce=0;ce<ie.sel.ranges.length;ce++){var me=ie.sel.ranges[ce];fe.push(new us(od(me.anchor,ae),od(me.head,ae)))}return wu(ie.cm,fe,ie.sel.primIndex)}function Pu(ie,ae,fe){return ie.line==ae.line?$t(fe.line,ie.ch-ae.ch+fe.ch):$t(fe.line+(ie.line-ae.line),ie.ch)}function yc(ie,ae,fe){for(var ce=[],me=$t(ie.first,0),ke=me,Ge=0;Ge<ae.length;Ge++){var Qe=ae[Ge],Xe=Pu(Qe.from,me,ke),xt=Pu(Oh(Qe),me,ke);if(me=Qe.to,ke=xt,fe=="around"){var an=ie.sel.ranges[Ge],Ft=xn(an.head,an.anchor)<0;ce[Ge]=new us(Ft?xt:Xe,Ft?Xe:xt)}else ce[Ge]=new us(Xe,Xe)}return new du(ce,ie.sel.primIndex)}function Ta(ie){ie.doc.mode=Mt(ie.options,ie.doc.modeOption),ad(ie)}function ad(ie){ie.doc.iter(function(ae){ae.stateAfter&&(ae.stateAfter=null),ae.styles&&(ae.styles=null)}),ie.doc.modeFrontier=ie.doc.highlightFrontier=ie.doc.first,Aa(ie,100),ie.state.modeGen++,ie.curOp&&Si(ie)}function Uf(ie,ae){return ae.from.ch==0&&ae.to.ch==0&&ht(ae.text)==""&&(!ie.cm||ie.cm.options.wholeLineUpdateBefore)}function xc(ie,ae,fe,ce){function me(No){return fe?fe[No]:null}function ke(No,co,zo){Ko(No,co,zo,ce),Kr(No,"change",No,ae)}function Ge(No,co){for(var zo=[],va=No;va<co;++va)zo.push(new qo(xt[va],me(va),ce));return zo}var Qe=ae.from,Xe=ae.to,xt=ae.text,an=Yn(ie,Qe.line),Ft=Yn(ie,Xe.line),zn=ht(xt),Mn=me(xt.length-1),qi=Xe.line-Qe.line;if(ae.full)ie.insert(0,Ge(0,xt.length)),ie.remove(xt.length,ie.size-xt.length);else if(Uf(ie,ae)){var cr=Ge(0,xt.length-1);ke(Ft,Ft.text,Mn),qi&&ie.remove(Qe.line,qi),cr.length&&ie.insert(Qe.line,cr)}else if(an==Ft)if(xt.length==1)ke(an,an.text.slice(0,Qe.ch)+zn+an.text.slice(Xe.ch),Mn);else{var Br=Ge(1,xt.length-1);Br.push(new qo(zn+an.text.slice(Xe.ch),Mn,ce)),ke(an,an.text.slice(0,Qe.ch)+xt[0],me(0)),ie.insert(Qe.line+1,Br)}else if(xt.length==1)ke(an,an.text.slice(0,Qe.ch)+xt[0]+Ft.text.slice(Xe.ch),me(0)),ie.remove(Qe.line+1,qi);else{ke(an,an.text.slice(0,Qe.ch)+xt[0],me(0)),ke(Ft,zn+Ft.text.slice(Xe.ch),Mn);var $r=Ge(1,xt.length-1);qi>1&&ie.remove(Qe.line+1,qi-1),ie.insert(Qe.line+1,$r)}Kr(ie,"change",ie,ae)}function Iu(ie,ae,fe){function ce(me,ke,Ge){if(me.linked)for(var Qe=0;Qe<me.linked.length;++Qe){var Xe=me.linked[Qe];if(Xe.doc!=ke){var xt=Ge&&Xe.sharedHist;fe&&!xt||(ae(Xe.doc,xt),ce(Xe.doc,me,xt))}}}ce(ie,null,!0)}function lf(ie,ae){if(ae.cm)throw new Error("This document is already in use.");ie.doc=ae,ae.cm=ie,Er(ie),Ta(ie),Id(ie),ie.options.lineWrapping||Yr(ie),ie.options.mode=ae.modeOption,Si(ie)}function Id(ie){(ie.doc.direction=="rtl"?Bt:Ze)(ie.display.lineDiv,"CodeMirror-rtl")}function Wg(ie){gr(ie,function(){Id(ie),Si(ie)})}function _d(ie){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=ie||1}function uf(ie,ae){var fe={from:ri(ae.from),to:Oh(ae),text:Qi(ie,ae.from,ae.to)};return ah(ie,fe,ae.from.line,ae.to.line+1),Iu(ie,function(ce){return ah(ce,fe,ae.from.line,ae.to.line+1)},!0),fe}function sd(ie){for(;ie.length;){var ae=ht(ie);if(ae.ranges)ie.pop();else break}}function Sc(ie,ae){if(ae)return sd(ie.done),ht(ie.done);if(ie.done.length&&!ht(ie.done).ranges)return ht(ie.done);if(ie.done.length>1&&!ie.done[ie.done.length-2].ranges)return ie.done.pop(),ht(ie.done)}function ld(ie,ae,fe,ce){var me=ie.history;me.undone.length=0;var ke=+new Date,Ge,Qe;if((me.lastOp==ce||me.lastOrigin==ae.origin&&ae.origin&&(ae.origin.charAt(0)=="+"&&me.lastModTime>ke-(ie.cm?ie.cm.options.historyEventDelay:500)||ae.origin.charAt(0)=="*"))&&(Ge=Sc(me,me.lastOp==ce)))Qe=ht(Ge.changes),xn(ae.from,ae.to)==0&&xn(ae.from,Qe.to)==0?Qe.to=Oh(ae):Ge.changes.push(uf(ie,ae));else{var Xe=ht(me.done);for((!Xe||!Xe.ranges)&&Od(ie.sel,me.done),Ge={changes:[uf(ie,ae)],generation:me.generation},me.done.push(Ge);me.done.length>me.undoDepth;)me.done.shift(),me.done[0].ranges||me.done.shift()}me.done.push(fe),me.generation=++me.maxGeneration,me.lastModTime=me.lastSelTime=ke,me.lastOp=me.lastSelOp=ce,me.lastOrigin=me.lastSelOrigin=ae.origin,Qe||Qt(ie,"historyAdded")}function hf(ie,ae,fe,ce){var me=ae.charAt(0);return me=="*"||me=="+"&&fe.ranges.length==ce.ranges.length&&fe.somethingSelected()==ce.somethingSelected()&&new Date-ie.history.lastSelTime<=(ie.cm?ie.cm.options.historyEventDelay:500)}function ud(ie,ae,fe,ce){var me=ie.history,ke=ce&&ce.origin;fe==me.lastSelOp||ke&&me.lastSelOrigin==ke&&(me.lastModTime==me.lastSelTime&&me.lastOrigin==ke||hf(ie,ke,ht(me.done),ae))?me.done[me.done.length-1]=ae:Od(ae,me.done),me.lastSelTime=+new Date,me.lastSelOrigin=ke,me.lastSelOp=fe,ce&&ce.clearRedo!==!1&&sd(me.undone)}function Od(ie,ae){var fe=ht(ae);fe&&fe.ranges&&fe.equals(ie)||ae.push(ie)}function ah(ie,ae,fe,ce){var me=ae["spans_"+ie.id],ke=0;ie.iter(Math.max(ie.first,fe),Math.min(ie.first+ie.size,ce),function(Ge){Ge.markedSpans&&((me||(me=ae["spans_"+ie.id]={}))[ke]=Ge.markedSpans),++ke})}function kl(ie){if(!ie)return null;for(var ae,fe=0;fe<ie.length;++fe)ie[fe].marker.explicitlyCleared?ae||(ae=ie.slice(0,fe)):ae&&ae.push(ie[fe]);return ae?ae.length?ae:null:ie}function sh(ie,ae){var fe=ae["spans_"+ie.id];if(!fe)return null;for(var ce=[],me=0;me<ae.text.length;++me)ce.push(kl(fe[me]));return ce}function df(ie,ae){var fe=sh(ie,ae),ce=Jo(ie,ae);if(!fe)return ce;if(!ce)return fe;for(var me=0;me<fe.length;++me){var ke=fe[me],Ge=ce[me];if(ke&&Ge)e:for(var Qe=0;Qe<Ge.length;++Qe){for(var Xe=Ge[Qe],xt=0;xt<ke.length;++xt)if(ke[xt].marker==Xe.marker)continue e;ke.push(Xe)}else Ge&&(fe[me]=Ge)}return fe}function lh(ie,ae,fe){for(var ce=[],me=0;me<ie.length;++me){var ke=ie[me];if(ke.ranges){ce.push(fe?du.prototype.deepCopy.call(ke):ke);continue}var Ge=ke.changes,Qe=[];ce.push({changes:Qe});for(var Xe=0;Xe<Ge.length;++Xe){var xt=Ge[Xe],an=void 0;if(Qe.push({from:xt.from,to:xt.to,text:xt.text}),ae)for(var Ft in xt)(an=Ft.match(/^spans_(\d+)$/))&&dn(ae,Number(an[1]))>-1&&(ht(Qe)[Ft]=xt[Ft],delete xt[Ft])}}return ce}function cf(ie,ae,fe,ce){if(ce){var me=ie.anchor;if(fe){var ke=xn(ae,me)<0;ke!=xn(fe,me)<0?(me=ae,ae=fe):ke!=xn(ae,fe)<0&&(ae=fe)}return new us(me,ae)}else return new us(fe||ae,ae)}function ff(ie,ae,fe,ce,me){me==null&&(me=ie.cm&&(ie.cm.display.shift||ie.extend)),cl(ie,new du([cf(ie.sel.primary(),ae,fe,me)],0),ce)}function Hg(ie,ae,fe){for(var ce=[],me=ie.cm&&(ie.cm.display.shift||ie.extend),ke=0;ke<ie.sel.ranges.length;ke++)ce[ke]=cf(ie.sel.ranges[ke],ae[ke],null,me);var Ge=wu(ie.cm,ce,ie.sel.primIndex);cl(ie,Ge,fe)}function Eu(ie,ae,fe,ce){var me=ie.sel.ranges.slice(0);me[ae]=fe,cl(ie,wu(ie.cm,me,ie.sel.primIndex),ce)}function _u(ie,ae,fe,ce){cl(ie,Fh(ae,fe),ce)}function gf(ie,ae,fe){var ce={ranges:ae.ranges,update:function(me){this.ranges=[];for(var ke=0;ke<me.length;ke++)this.ranges[ke]=new us(Fi(ie,me[ke].anchor),Fi(ie,me[ke].head))},origin:fe&&fe.origin};return Qt(ie,"beforeSelectionChange",ie,ce),ie.cm&&Qt(ie.cm,"beforeSelectionChange",ie.cm,ce),ce.ranges!=ae.ranges?wu(ie.cm,ce.ranges,ce.ranges.length-1):ae}function pf(ie,ae,fe){var ce=ie.history.done,me=ht(ce);me&&me.ranges?(ce[ce.length-1]=ae,hd(ie,ae,fe)):cl(ie,ae,fe)}function cl(ie,ae,fe){hd(ie,ae,fe),ud(ie,ie.sel,ie.cm?ie.cm.curOp.id:NaN,fe)}function hd(ie,ae,fe){(cn(ie,"beforeSelectionChange")||ie.cm&&cn(ie.cm,"beforeSelectionChange"))&&(ae=gf(ie,ae,fe));var ce=fe&&fe.bias||(xn(ae.primary().head,ie.sel.primary().head)<0?-1:1);dd(ie,Pc(ie,ae,ce,!0)),!(fe&&fe.scroll===!1)&&ie.cm&&Rl(ie.cm)}function dd(ie,ae){ae.equals(ie.sel)||(ie.sel=ae,ie.cm&&(ie.cm.curOp.updateInput=1,ie.cm.curOp.selectionChanged=!0,di(ie.cm)),Kr(ie,"cursorActivity",ie))}function wc(ie){dd(ie,Pc(ie,ie.sel,null,!1))}function Pc(ie,ae,fe,ce){for(var me,ke=0;ke<ae.ranges.length;ke++){var Ge=ae.ranges[ke],Qe=ae.ranges.length==ie.sel.ranges.length&&ie.sel.ranges[ke],Xe=cd(ie,Ge.anchor,Qe&&Qe.anchor,fe,ce),xt=cd(ie,Ge.head,Qe&&Qe.head,fe,ce);(me||Xe!=Ge.anchor||xt!=Ge.head)&&(me||(me=ae.ranges.slice(0,ke)),me[ke]=new us(Xe,xt))}return me?wu(ie.cm,me,ae.primIndex):ae}function il(ie,ae,fe,ce,me){var ke=Yn(ie,ae.line);if(ke.markedSpans)for(var Ge=0;Ge<ke.markedSpans.length;++Ge){var Qe=ke.markedSpans[Ge],Xe=Qe.marker,xt="selectLeft"in Xe?!Xe.selectLeft:Xe.inclusiveLeft,an="selectRight"in Xe?!Xe.selectRight:Xe.inclusiveRight;if((Qe.from==null||(xt?Qe.from<=ae.ch:Qe.from<ae.ch))&&(Qe.to==null||(an?Qe.to>=ae.ch:Qe.to>ae.ch))){if(me&&(Qt(Xe,"beforeCursorEnter"),Xe.explicitlyCleared))if(ke.markedSpans){--Ge;continue}else break;if(!Xe.atomic)continue;if(fe){var Ft=Xe.find(ce<0?1:-1),zn=void 0;if((ce<0?an:xt)&&(Ft=mf(ie,Ft,-ce,Ft&&Ft.line==ae.line?ke:null)),Ft&&Ft.line==ae.line&&(zn=xn(Ft,fe))&&(ce<0?zn<0:zn>0))return il(ie,Ft,ae,ce,me)}var Mn=Xe.find(ce<0?-1:1);return(ce<0?xt:an)&&(Mn=mf(ie,Mn,ce,Mn.line==ae.line?ke:null)),Mn?il(ie,Mn,ae,ce,me):null}}return ae}function cd(ie,ae,fe,ce,me){var ke=ce||1,Ge=il(ie,ae,fe,ke,me)||!me&&il(ie,ae,fe,ke,!0)||il(ie,ae,fe,-ke,me)||!me&&il(ie,ae,fe,-ke,!0);return Ge||(ie.cantEdit=!0,$t(ie.first,0))}function mf(ie,ae,fe,ce){return fe<0&&ae.ch==0?ae.line>ie.first?Fi(ie,$t(ae.line-1)):null:fe>0&&ae.ch==(ce||Yn(ie,ae.line)).text.length?ae.line<ie.first+ie.size-1?$t(ae.line+1,0):null:new $t(ae.line,ae.ch+fe)}function Zs(ie){ie.setSelection($t(ie.firstLine(),0),$t(ie.lastLine()),Rt)}function Rd(ie,ae,fe){var ce={canceled:!1,from:ae.from,to:ae.to,text:ae.text,origin:ae.origin,cancel:function(){return ce.canceled=!0}};return fe&&(ce.update=function(me,ke,Ge,Qe){me&&(ce.from=Fi(ie,me)),ke&&(ce.to=Fi(ie,ke)),Ge&&(ce.text=Ge),Qe!==void 0&&(ce.origin=Qe)}),Qt(ie,"beforeChange",ie,ce),ie.cm&&Qt(ie.cm,"beforeChange",ie.cm,ce),ce.canceled?(ie.cm&&(ie.cm.curOp.updateInput=2),null):{from:ce.from,to:ce.to,text:ce.text,origin:ce.origin}}function Ou(ie,ae,fe){if(ie.cm){if(!ie.cm.curOp)return _o(ie.cm,Ou)(ie,ae,fe);if(ie.cm.state.suppressEdits)return}if(!((cn(ie,"beforeChange")||ie.cm&&cn(ie.cm,"beforeChange"))&&(ae=Rd(ie,ae,!0),!ae))){var ce=yo&&!fe&&jn(ie,ae.from,ae.to);if(ce)for(var me=ce.length-1;me>=0;--me)Rh(ie,{from:ce[me].from,to:ce[me].to,text:me?[""]:ae.text,origin:ae.origin});else Rh(ie,ae)}}function Rh(ie,ae){if(!(ae.text.length==1&&ae.text[0]==""&&xn(ae.from,ae.to)==0)){var fe=vc(ie,ae);ld(ie,ae,fe,ie.cm?ie.cm.curOp.id:NaN),jd(ie,ae,fe,Jo(ie,ae));var ce=[];Iu(ie,function(me,ke){!ke&&dn(ce,me.history)==-1&&(Xf(me.history,ae),ce.push(me.history)),jd(me,ae,null,Jo(me,ae))})}}function Ec(ie,ae,fe){var ce=ie.cm&&ie.cm.state.suppressEdits;if(!(ce&&!fe)){for(var me=ie.history,ke,Ge=ie.sel,Qe=ae=="undo"?me.done:me.undone,Xe=ae=="undo"?me.undone:me.done,xt=0;xt<Qe.length&&(ke=Qe[xt],!(fe?ke.ranges&&!ke.equals(ie.sel):!ke.ranges));xt++);if(xt!=Qe.length){for(me.lastOrigin=me.lastSelOrigin=null;;)if(ke=Qe.pop(),ke.ranges){if(Od(ke,Xe),fe&&!ke.equals(ie.sel)){cl(ie,ke,{clearRedo:!1});return}Ge=ke}else if(ce){Qe.push(ke);return}else break;var an=[];Od(Ge,Xe),Xe.push({changes:an,generation:me.generation}),me.generation=ke.generation||++me.maxGeneration;for(var Ft=cn(ie,"beforeChange")||ie.cm&&cn(ie.cm,"beforeChange"),zn=function(cr){var Br=ke.changes[cr];if(Br.origin=ae,Ft&&!Rd(ie,Br,!1))return Qe.length=0,{};an.push(uf(ie,Br));var $r=cr?vc(ie,Br):ht(Qe);jd(ie,Br,$r,df(ie,Br)),!cr&&ie.cm&&ie.cm.scrollIntoView({from:Br.from,to:Oh(Br)});var No=[];Iu(ie,function(co,zo){!zo&&dn(No,co.history)==-1&&(Xf(co.history,Br),No.push(co.history)),jd(co,Br,null,df(co,Br))})},Mn=ke.changes.length-1;Mn>=0;--Mn){var qi=zn(Mn);if(qi)return qi.v}}}}function Yf(ie,ae){if(ae!=0&&(ie.first+=ae,ie.sel=new du(kn(ie.sel.ranges,function(me){return new us($t(me.anchor.line+ae,me.anchor.ch),$t(me.head.line+ae,me.head.ch))}),ie.sel.primIndex),ie.cm)){Si(ie.cm,ie.first,ie.first-ae,ae);for(var fe=ie.cm.display,ce=fe.viewFrom;ce<fe.viewTo;ce++)Pi(ie.cm,ce,"gutter")}}function jd(ie,ae,fe,ce){if(ie.cm&&!ie.cm.curOp)return _o(ie.cm,jd)(ie,ae,fe,ce);if(ae.to.line<ie.first){Yf(ie,ae.text.length-1-(ae.to.line-ae.from.line));return}if(!(ae.from.line>ie.lastLine())){if(ae.from.line<ie.first){var me=ae.text.length-1-(ie.first-ae.from.line);Yf(ie,me),ae={from:$t(ie.first,0),to:$t(ae.to.line+me,ae.to.ch),text:[ht(ae.text)],origin:ae.origin}}var ke=ie.lastLine();ae.to.line>ke&&(ae={from:ae.from,to:$t(ke,Yn(ie,ke).text.length),text:[ae.text[0]],origin:ae.origin}),ae.removed=Qi(ie,ae.from,ae.to),fe||(fe=vc(ie,ae)),ie.cm?vf(ie.cm,ae,ce):xc(ie,ae,ce),hd(ie,fe,Rt),ie.cantEdit&&cd(ie,$t(ie.firstLine(),0))&&(ie.cantEdit=!1)}}function vf(ie,ae,fe){var ce=ie.doc,me=ie.display,ke=ae.from,Ge=ae.to,Qe=!1,Xe=ke.line;ie.options.lineWrapping||(Xe=Ke($n(Yn(ce,ke.line))),ce.iter(Xe,Ge.line+1,function(Mn){if(Mn==me.maxLine)return Qe=!0,!0})),ce.sel.contains(ae.from,ae.to)>-1&&di(ie),xc(ce,ae,fe,Zr(ie)),ie.options.lineWrapping||(ce.iter(Xe,ke.line+ae.text.length,function(Mn){var qi=xo(Mn);qi>me.maxLineLength&&(me.maxLine=Mn,me.maxLineLength=qi,me.maxLineChanged=!0,Qe=!1)}),Qe&&(ie.curOp.updateMaxLine=!0)),po(ce,ke.line),Aa(ie,400);var xt=ae.text.length-(Ge.line-ke.line)-1;ae.full?Si(ie):ke.line==Ge.line&&ae.text.length==1&&!Uf(ie.doc,ae)?Pi(ie,ke.line,"text"):Si(ie,ke.line,Ge.line+1,xt);var an=cn(ie,"changes"),Ft=cn(ie,"change");if(Ft||an){var zn={from:ke,to:Ge,text:ae.text,removed:ae.removed,origin:ae.origin};Ft&&Kr(ie,"change",ie,zn),an&&(ie.curOp.changeObjs||(ie.curOp.changeObjs=[])).push(zn)}ie.display.selForContextMenu=null}function Ku(ie,ae,fe,ce,me){var ke;ce||(ce=fe),xn(ce,fe)<0&&(ke=[ce,fe],fe=ke[0],ce=ke[1]),typeof ae=="string"&&(ae=ie.splitLines(ae)),Ou(ie,{from:fe,to:ce,text:ae,origin:me})}function Cu(ie,ae,fe,ce){fe<ie.line?ie.line+=ce:ae<ie.line&&(ie.line=ae,ie.ch=0)}function Vg(ie,ae,fe,ce){for(var me=0;me<ie.length;++me){var ke=ie[me],Ge=!0;if(ke.ranges){ke.copied||(ke=ie[me]=ke.deepCopy(),ke.copied=!0);for(var Qe=0;Qe<ke.ranges.length;Qe++)Cu(ke.ranges[Qe].anchor,ae,fe,ce),Cu(ke.ranges[Qe].head,ae,fe,ce);continue}for(var Xe=0;Xe<ke.changes.length;++Xe){var xt=ke.changes[Xe];if(fe<xt.from.line)xt.from=$t(xt.from.line+ce,xt.from.ch),xt.to=$t(xt.to.line+ce,xt.to.ch);else if(ae<=xt.to.line){Ge=!1;break}}Ge||(ie.splice(0,me+1),me=0)}}function Xf(ie,ae){var fe=ae.from.line,ce=ae.to.line,me=ae.text.length-(ce-fe)-1;Vg(ie.done,fe,ce,me),Vg(ie.undone,fe,ce,me)}function jh(ie,ae,fe,ce){var me=ae,ke=ae;return typeof ae=="number"?ke=Yn(ie,Ii(ie,ae)):me=Ke(ae),me==null?null:(ce(ke,me)&&ie.cm&&Pi(ie.cm,me,fe),ke)}function zd(ie){this.lines=ie,this.parent=null;for(var ae=0,fe=0;fe<ie.length;++fe)ie[fe].parent=this,ae+=ie[fe].height;this.height=ae}zd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(ie,ae){for(var fe=ie,ce=ie+ae;fe<ce;++fe){var me=this.lines[fe];this.height-=me.height,Qo(me),Kr(me,"delete")}this.lines.splice(ie,ae)},collapse:function(ie){ie.push.apply(ie,this.lines)},insertInner:function(ie,ae,fe){this.height+=fe,this.lines=this.lines.slice(0,ie).concat(ae).concat(this.lines.slice(ie));for(var ce=0;ce<ae.length;++ce)ae[ce].parent=this},iterN:function(ie,ae,fe){for(var ce=ie+ae;ie<ce;++ie)if(fe(this.lines[ie]))return!0}};function Fs(ie){this.children=ie;for(var ae=0,fe=0,ce=0;ce<ie.length;++ce){var me=ie[ce];ae+=me.chunkSize(),fe+=me.height,me.parent=this}this.size=ae,this.height=fe,this.parent=null}Fs.prototype={chunkSize:function(){return this.size},removeInner:function(ie,ae){this.size-=ae;for(var fe=0;fe<this.children.length;++fe){var ce=this.children[fe],me=ce.chunkSize();if(ie<me){var ke=Math.min(ae,me-ie),Ge=ce.height;if(ce.removeInner(ie,ke),this.height-=Ge-ce.height,me==ke&&(this.children.splice(fe--,1),ce.parent=null),(ae-=ke)==0)break;ie=0}else ie-=me}if(this.size-ae<25&&(this.children.length>1||!(this.children[0]instanceof zd))){var Qe=[];this.collapse(Qe),this.children=[new zd(Qe)],this.children[0].parent=this}},collapse:function(ie){for(var ae=0;ae<this.children.length;++ae)this.children[ae].collapse(ie)},insertInner:function(ie,ae,fe){this.size+=ae.length,this.height+=fe;for(var ce=0;ce<this.children.length;++ce){var me=this.children[ce],ke=me.chunkSize();if(ie<=ke){if(me.insertInner(ie,ae,fe),me.lines&&me.lines.length>50){for(var Ge=me.lines.length%25+25,Qe=Ge;Qe<me.lines.length;){var Xe=new zd(me.lines.slice(Qe,Qe+=25));me.height-=Xe.height,this.children.splice(++ce,0,Xe),Xe.parent=this}me.lines=me.lines.slice(0,Ge),this.maybeSpill()}break}ie-=ke}},maybeSpill:function(){if(!(this.children.length<=10)){var ie=this;do{var ae=ie.children.splice(ie.children.length-5,5),fe=new Fs(ae);if(ie.parent){ie.size-=fe.size,ie.height-=fe.height;var me=dn(ie.parent.children,ie);ie.parent.children.splice(me+1,0,fe)}else{var ce=new Fs(ie.children);ce.parent=ie,ie.children=[ce,fe],ie=ce}fe.parent=ie.parent}while(ie.children.length>10);ie.parent.maybeSpill()}},iterN:function(ie,ae,fe){for(var ce=0;ce<this.children.length;++ce){var me=this.children[ce],ke=me.chunkSize();if(ie<ke){var Ge=Math.min(ae,ke-ie);if(me.iterN(ie,Ge,fe))return!0;if((ae-=Ge)==0)break;ie=0}else ie-=ke}}};var Uu=function(ie,ae,fe){if(fe)for(var ce in fe)fe.hasOwnProperty(ce)&&(this[ce]=fe[ce]);this.doc=ie,this.node=ae};Uu.prototype.clear=function(){var ie=this.doc.cm,ae=this.line.widgets,fe=this.line,ce=Ke(fe);if(!(ce==null||!ae)){for(var me=0;me<ae.length;++me)ae[me]==this&&ae.splice(me--,1);ae.length||(fe.widgets=null);var ke=is(this);Dr(fe,Math.max(0,fe.height-ke)),ie&&(gr(ie,function(){Kg(ie,fe,-ke),Pi(ie,ce,"widget")}),Kr(ie,"lineWidgetCleared",ie,this,ce))}},Uu.prototype.changed=function(){var ie=this,ae=this.height,fe=this.doc.cm,ce=this.line;this.height=null;var me=is(this)-ae;me&&(Pn(this.doc,ce)||Dr(ce,ce.height+me),fe&&gr(fe,function(){fe.curOp.forceUpdate=!0,Kg(fe,ce,me),Kr(fe,"lineWidgetChanged",fe,ie,Ke(ce))}))},Yt(Uu);function Kg(ie,ae,fe){or(ae)<(ie.curOp&&ie.curOp.scrollTop||ie.doc.scrollTop)&&su(ie,fe)}function yf(ie,ae,fe,ce){var me=new Uu(ie,fe,ce),ke=ie.cm;return ke&&me.noHScroll&&(ke.display.alignWidgets=!0),jh(ie,ae,"widget",function(Ge){var Qe=Ge.widgets||(Ge.widgets=[]);if(me.insertAt==null?Qe.push(me):Qe.splice(Math.min(Qe.length-1,Math.max(0,me.insertAt)),0,me),me.line=Ge,ke&&!Pn(ie,Ge)){var Xe=or(Ge)<ie.scrollTop;Dr(Ge,Ge.height+is(me)),Xe&&su(ke,me.height),ke.curOp.forceUpdate=!0}return!0}),ke&&Kr(ke,"lineWidgetAdded",ke,me,typeof ae=="number"?ae:Ke(ae)),me}var Cc=0,jt=function(ie,ae){this.lines=[],this.type=ae,this.doc=ie,this.id=++Cc};jt.prototype.clear=function(){if(!this.explicitlyCleared){var ie=this.doc.cm,ae=ie&&!ie.curOp;if(ae&&zl(ie),cn(this,"clear")){var fe=this.find();fe&&Kr(this,"clear",fe.from,fe.to)}for(var ce=null,me=null,ke=0;ke<this.lines.length;++ke){var Ge=this.lines[ke],Qe=Bo(Ge.markedSpans,this);ie&&!this.collapsed?Pi(ie,Ke(Ge),"text"):ie&&(Qe.to!=null&&(me=Ke(Ge)),Qe.from!=null&&(ce=Ke(Ge))),Ge.markedSpans=br(Ge.markedSpans,Qe),Qe.from==null&&this.collapsed&&!Pn(this.doc,Ge)&&ie&&Dr(Ge,Ui(ie.display))}if(ie&&this.collapsed&&!ie.options.lineWrapping)for(var Xe=0;Xe<this.lines.length;++Xe){var xt=$n(this.lines[Xe]),an=xo(xt);an>ie.display.maxLineLength&&(ie.display.maxLine=xt,ie.display.maxLineLength=an,ie.display.maxLineChanged=!0)}ce!=null&&ie&&this.collapsed&&Si(ie,ce,me+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,ie&&wc(ie.doc)),ie&&Kr(ie,"markerCleared",ie,this,ce,me),ae&&uu(ie),this.parent&&this.parent.clear()}},jt.prototype.find=function(ie,ae){ie==null&&this.type=="bookmark"&&(ie=1);for(var fe,ce,me=0;me<this.lines.length;++me){var ke=this.lines[me],Ge=Bo(ke.markedSpans,this);if(Ge.from!=null&&(fe=$t(ae?ke:Ke(ke),Ge.from),ie==-1))return fe;if(Ge.to!=null&&(ce=$t(ae?ke:Ke(ke),Ge.to),ie==1))return ce}return fe&&{from:fe,to:ce}},jt.prototype.changed=function(){var ie=this,ae=this.find(-1,!0),fe=this,ce=this.doc.cm;!ae||!ce||gr(ce,function(){var me=ae.line,ke=Ke(ae.line),Ge=Vo(ce,ke);if(Ge&&(la(Ge),ce.curOp.selectionChanged=ce.curOp.forceUpdate=!0),ce.curOp.updateMaxLine=!0,!Pn(fe.doc,me)&&fe.height!=null){var Qe=fe.height;fe.height=null;var Xe=is(fe)-Qe;Xe&&Dr(me,me.height+Xe)}Kr(ce,"markerChanged",ce,ie)})},jt.prototype.attachLine=function(ie){if(!this.lines.length&&this.doc.cm){var ae=this.doc.cm.curOp;(!ae.maybeHiddenMarkers||dn(ae.maybeHiddenMarkers,this)==-1)&&(ae.maybeUnhiddenMarkers||(ae.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(ie)},jt.prototype.detachLine=function(ie){if(this.lines.splice(dn(this.lines,ie),1),!this.lines.length&&this.doc.cm){var ae=this.doc.cm.curOp;(ae.maybeHiddenMarkers||(ae.maybeHiddenMarkers=[])).push(this)}},Yt(jt);function fd(ie,ae,fe,ce,me){if(ce&&ce.shared)return Ug(ie,ae,fe,ce,me);if(ie.cm&&!ie.cm.curOp)return _o(ie.cm,fd)(ie,ae,fe,ce,me);var ke=new jt(ie,me),Ge=xn(ae,fe);if(ce&&tn(ce,ke,!1),Ge>0||Ge==0&&ke.clearWhenEmpty!==!1)return ke;if(ke.replacedWith&&(ke.collapsed=!0,ke.widgetNode=ct("span",[ke.replacedWith],"CodeMirror-widget"),ce.handleMouseEvents||ke.widgetNode.setAttribute("cm-ignore-events","true"),ce.insertLeft&&(ke.widgetNode.insertLeft=!0)),ke.collapsed){if(yi(ie,ae.line,ae,fe,ke)||ae.line!=fe.line&&yi(ie,fe.line,ae,fe,ke))throw new Error("Inserting collapsed marker partially overlapping an existing one");Tn()}ke.addToHistory&&ld(ie,{from:ae,to:fe,origin:"markText"},ie.sel,NaN);var Qe=ae.line,Xe=ie.cm,xt;if(ie.iter(Qe,fe.line+1,function(Ft){Xe&&ke.collapsed&&!Xe.options.lineWrapping&&$n(Ft)==Xe.display.maxLine&&(xt=!0),ke.collapsed&&Qe!=ae.line&&Dr(Ft,0),na(Ft,new Ar(ke,Qe==ae.line?ae.ch:null,Qe==fe.line?fe.ch:null)),++Qe}),ke.collapsed&&ie.iter(ae.line,fe.line+1,function(Ft){Pn(ie,Ft)&&Dr(Ft,0)}),ke.clearOnEnter&&Dn(ke,"beforeCursorEnter",function(){return ke.clear()}),ke.readOnly&&(ia(),(ie.history.done.length||ie.history.undone.length)&&ie.clearHistory()),ke.collapsed&&(ke.id=++Cc,ke.atomic=!0),Xe){if(xt&&(Xe.curOp.updateMaxLine=!0),ke.collapsed)Si(Xe,ae.line,fe.line+1);else if(ke.className||ke.startStyle||ke.endStyle||ke.css||ke.attributes||ke.title)for(var an=ae.line;an<=fe.line;an++)Pi(Xe,an,"text");ke.atomic&&wc(Xe.doc),Kr(Xe,"markerAdded",Xe,ke)}return ke}var Yu=function(ie,ae){this.markers=ie,this.primary=ae;for(var fe=0;fe<ie.length;++fe)ie[fe].parent=this};Yu.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var ie=0;ie<this.markers.length;++ie)this.markers[ie].clear();Kr(this,"clear")}},Yu.prototype.find=function(ie,ae){return this.primary.find(ie,ae)},Yt(Yu);function Ug(ie,ae,fe,ce,me){ce=tn(ce),ce.shared=!1;var ke=[fd(ie,ae,fe,ce,me)],Ge=ke[0],Qe=ce.widgetNode;return Iu(ie,function(Xe){Qe&&(ce.widgetNode=Qe.cloneNode(!0)),ke.push(fd(Xe,Fi(Xe,ae),Fi(Xe,fe),ce,me));for(var xt=0;xt<Xe.linked.length;++xt)if(Xe.linked[xt].isParent)return;Ge=ht(ke)}),new Yu(ke,Ge)}function Jf(ie){return ie.findMarks($t(ie.first,0),ie.clipPos($t(ie.lastLine())),function(ae){return ae.parent})}function zp(ie,ae){for(var fe=0;fe<ae.length;fe++){var ce=ae[fe],me=ce.find(),ke=ie.clipPos(me.from),Ge=ie.clipPos(me.to);if(xn(ke,Ge)){var Qe=fd(ie,ke,Ge,ce.primary,ce.primary.type);ce.markers.push(Qe),Qe.parent=ce}}}function Qf(ie){for(var ae=function(ce){var me=ie[ce],ke=[me.primary.doc];Iu(me.primary.doc,function(Xe){return ke.push(Xe)});for(var Ge=0;Ge<me.markers.length;Ge++){var Qe=me.markers[Ge];dn(ke,Qe.doc)==-1&&(Qe.parent=null,me.markers.splice(Ge--,1))}},fe=0;fe<ie.length;fe++)ae(fe)}var Om=0,Us=function(ie,ae,fe,ce,me){if(!(this instanceof Us))return new Us(ie,ae,fe,ce,me);fe==null&&(fe=0),Fs.call(this,[new zd([new qo("",null)])]),this.first=fe,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=fe;var ke=$t(fe,0);this.sel=Fh(ke),this.history=new _d(null),this.id=++Om,this.modeOption=ae,this.lineSep=ce,this.direction=me=="rtl"?"rtl":"ltr",this.extend=!1,typeof ie=="string"&&(ie=this.splitLines(ie)),xc(this,{from:ke,to:ke,text:ie}),cl(this,Fh(ke),Rt)};Us.prototype=Me(Fs.prototype,{constructor:Us,iter:function(ie,ae,fe){fe?this.iterN(ie-this.first,ae-ie,fe):this.iterN(this.first,this.first+this.size,ie)},insert:function(ie,ae){for(var fe=0,ce=0;ce<ae.length;++ce)fe+=ae[ce].height;this.insertInner(ie-this.first,ae,fe)},remove:function(ie,ae){this.removeInner(ie-this.first,ae)},getValue:function(ie){var ae=vr(this,this.first,this.first+this.size);return ie===!1?ae:ae.join(ie||this.lineSeparator())},setValue:nr(function(ie){var ae=$t(this.first,0),fe=this.first+this.size-1;Ou(this,{from:ae,to:$t(fe,Yn(this,fe).text.length),text:this.splitLines(ie),origin:"setValue",full:!0},!0),this.cm&&lu(this.cm,0,0),cl(this,Fh(ae),Rt)}),replaceRange:function(ie,ae,fe,ce){ae=Fi(this,ae),fe=fe?Fi(this,fe):ae,Ku(this,ie,ae,fe,ce)},getRange:function(ie,ae,fe){var ce=Qi(this,Fi(this,ie),Fi(this,ae));return fe===!1?ce:ce.join(fe||this.lineSeparator())},getLine:function(ie){var ae=this.getLineHandle(ie);return ae&&ae.text},getLineHandle:function(ie){if(_n(this,ie))return Yn(this,ie)},getLineNumber:function(ie){return Ke(ie)},getLineHandleVisualStart:function(ie){return typeof ie=="number"&&(ie=Yn(this,ie)),$n(ie)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(ie){return Fi(this,ie)},getCursor:function(ie){var ae=this.sel.primary(),fe;return ie==null||ie=="head"?fe=ae.head:ie=="anchor"?fe=ae.anchor:ie=="end"||ie=="to"||ie===!1?fe=ae.to():fe=ae.from(),fe},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:nr(function(ie,ae,fe){_u(this,Fi(this,typeof ie=="number"?$t(ie,ae||0):ie),null,fe)}),setSelection:nr(function(ie,ae,fe){_u(this,Fi(this,ie),Fi(this,ae||ie),fe)}),extendSelection:nr(function(ie,ae,fe){ff(this,Fi(this,ie),ae&&Fi(this,ae),fe)}),extendSelections:nr(function(ie,ae){Hg(this,xr(this,ie),ae)}),extendSelectionsBy:nr(function(ie,ae){var fe=kn(this.sel.ranges,ie);Hg(this,xr(this,fe),ae)}),setSelections:nr(function(ie,ae,fe){if(ie.length){for(var ce=[],me=0;me<ie.length;me++)ce[me]=new us(Fi(this,ie[me].anchor),Fi(this,ie[me].head));ae==null&&(ae=Math.min(ie.length-1,this.sel.primIndex)),cl(this,wu(this.cm,ce,ae),fe)}}),addSelection:nr(function(ie,ae,fe){var ce=this.sel.ranges.slice(0);ce.push(new us(Fi(this,ie),Fi(this,ae||ie))),cl(this,wu(this.cm,ce,ce.length-1),fe)}),getSelection:function(ie){for(var ae=this.sel.ranges,fe,ce=0;ce<ae.length;ce++){var me=Qi(this,ae[ce].from(),ae[ce].to());fe=fe?fe.concat(me):me}return ie===!1?fe:fe.join(ie||this.lineSeparator())},getSelections:function(ie){for(var ae=[],fe=this.sel.ranges,ce=0;ce<fe.length;ce++){var me=Qi(this,fe[ce].from(),fe[ce].to());ie!==!1&&(me=me.join(ie||this.lineSeparator())),ae[ce]=me}return ae},replaceSelection:function(ie,ae,fe){for(var ce=[],me=0;me<this.sel.ranges.length;me++)ce[me]=ie;this.replaceSelections(ce,ae,fe||"+input")},replaceSelections:nr(function(ie,ae,fe){for(var ce=[],me=this.sel,ke=0;ke<me.ranges.length;ke++){var Ge=me.ranges[ke];ce[ke]={from:Ge.from(),to:Ge.to(),text:this.splitLines(ie[ke]),origin:fe}}for(var Qe=ae&&ae!="end"&&yc(this,ce,ae),Xe=ce.length-1;Xe>=0;Xe--)Ou(this,ce[Xe]);Qe?pf(this,Qe):this.cm&&Rl(this.cm)}),undo:nr(function(){Ec(this,"undo")}),redo:nr(function(){Ec(this,"redo")}),undoSelection:nr(function(){Ec(this,"undo",!0)}),redoSelection:nr(function(){Ec(this,"redo",!0)}),setExtending:function(ie){this.extend=ie},getExtending:function(){return this.extend},historySize:function(){for(var ie=this.history,ae=0,fe=0,ce=0;ce<ie.done.length;ce++)ie.done[ce].ranges||++ae;for(var me=0;me<ie.undone.length;me++)ie.undone[me].ranges||++fe;return{undo:ae,redo:fe}},clearHistory:function(){var ie=this;this.history=new _d(this.history.maxGeneration),Iu(this,function(ae){return ae.history=ie.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(ie){return ie&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(ie){return this.history.generation==(ie||this.cleanGeneration)},getHistory:function(){return{done:lh(this.history.done),undone:lh(this.history.undone)}},setHistory:function(ie){var ae=this.history=new _d(this.history.maxGeneration);ae.done=lh(ie.done.slice(0),null,!0),ae.undone=lh(ie.undone.slice(0),null,!0)},setGutterMarker:nr(function(ie,ae,fe){return jh(this,ie,"gutter",function(ce){var me=ce.gutterMarkers||(ce.gutterMarkers={});return me[ae]=fe,!fe&&Ae(me)&&(ce.gutterMarkers=null),!0})}),clearGutter:nr(function(ie){var ae=this;this.iter(function(fe){fe.gutterMarkers&&fe.gutterMarkers[ie]&&jh(ae,fe,"gutter",function(){return fe.gutterMarkers[ie]=null,Ae(fe.gutterMarkers)&&(fe.gutterMarkers=null),!0})})}),lineInfo:function(ie){var ae;if(typeof ie=="number"){if(!_n(this,ie)||(ae=ie,ie=Yn(this,ie),!ie))return null}else if(ae=Ke(ie),ae==null)return null;return{line:ae,handle:ie,text:ie.text,gutterMarkers:ie.gutterMarkers,textClass:ie.textClass,bgClass:ie.bgClass,wrapClass:ie.wrapClass,widgets:ie.widgets}},addLineClass:nr(function(ie,ae,fe){return jh(this,ie,ae=="gutter"?"gutter":"class",function(ce){var me=ae=="text"?"textClass":ae=="background"?"bgClass":ae=="gutter"?"gutterClass":"wrapClass";if(!ce[me])ce[me]=fe;else{if(_e(fe).test(ce[me]))return!1;ce[me]+=" "+fe}return!0})}),removeLineClass:nr(function(ie,ae,fe){return jh(this,ie,ae=="gutter"?"gutter":"class",function(ce){var me=ae=="text"?"textClass":ae=="background"?"bgClass":ae=="gutter"?"gutterClass":"wrapClass",ke=ce[me];if(ke)if(fe==null)ce[me]=null;else{var Ge=ke.match(_e(fe));if(!Ge)return!1;var Qe=Ge.index+Ge[0].length;ce[me]=ke.slice(0,Ge.index)+(!Ge.index||Qe==ke.length?"":" ")+ke.slice(Qe)||null}else return!1;return!0})}),addLineWidget:nr(function(ie,ae,fe){return yf(this,ie,ae,fe)}),removeLineWidget:function(ie){ie.clear()},markText:function(ie,ae,fe){return fd(this,Fi(this,ie),Fi(this,ae),fe,fe&&fe.type||"range")},setBookmark:function(ie,ae){var fe={replacedWith:ae&&(ae.nodeType==null?ae.widget:ae),insertLeft:ae&&ae.insertLeft,clearWhenEmpty:!1,shared:ae&&ae.shared,handleMouseEvents:ae&&ae.handleMouseEvents};return ie=Fi(this,ie),fd(this,ie,ie,fe,"bookmark")},findMarksAt:function(ie){ie=Fi(this,ie);var ae=[],fe=Yn(this,ie.line).markedSpans;if(fe)for(var ce=0;ce<fe.length;++ce){var me=fe[ce];(me.from==null||me.from<=ie.ch)&&(me.to==null||me.to>=ie.ch)&&ae.push(me.marker.parent||me.marker)}return ae},findMarks:function(ie,ae,fe){ie=Fi(this,ie),ae=Fi(this,ae);var ce=[],me=ie.line;return this.iter(ie.line,ae.line+1,function(ke){var Ge=ke.markedSpans;if(Ge)for(var Qe=0;Qe<Ge.length;Qe++){var Xe=Ge[Qe];!(Xe.to!=null&&me==ie.line&&ie.ch>=Xe.to||Xe.from==null&&me!=ie.line||Xe.from!=null&&me==ae.line&&Xe.from>=ae.ch)&&(!fe||fe(Xe.marker))&&ce.push(Xe.marker.parent||Xe.marker)}++me}),ce},getAllMarks:function(){var ie=[];return this.iter(function(ae){var fe=ae.markedSpans;if(fe)for(var ce=0;ce<fe.length;++ce)fe[ce].from!=null&&ie.push(fe[ce].marker)}),ie},posFromIndex:function(ie){var ae,fe=this.first,ce=this.lineSeparator().length;return this.iter(function(me){var ke=me.text.length+ce;if(ke>ie)return ae=ie,!0;ie-=ke,++fe}),Fi(this,$t(fe,ae))},indexFromPos:function(ie){ie=Fi(this,ie);var ae=ie.ch;if(ie.line<this.first||ie.ch<0)return 0;var fe=this.lineSeparator().length;return this.iter(this.first,ie.line,function(ce){ae+=ce.text.length+fe}),ae},copy:function(ie){var ae=new Us(vr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return ae.scrollTop=this.scrollTop,ae.scrollLeft=this.scrollLeft,ae.sel=this.sel,ae.extend=!1,ie&&(ae.history.undoDepth=this.history.undoDepth,ae.setHistory(this.getHistory())),ae},linkedDoc:function(ie){ie||(ie={});var ae=this.first,fe=this.first+this.size;ie.from!=null&&ie.from>ae&&(ae=ie.from),ie.to!=null&&ie.to<fe&&(fe=ie.to);var ce=new Us(vr(this,ae,fe),ie.mode||this.modeOption,ae,this.lineSep,this.direction);return ie.sharedHist&&(ce.history=this.history),(this.linked||(this.linked=[])).push({doc:ce,sharedHist:ie.sharedHist}),ce.linked=[{doc:this,isParent:!0,sharedHist:ie.sharedHist}],zp(ce,Jf(this)),ce},unlinkDoc:function(ie){if(ie instanceof Ja&&(ie=ie.doc),this.linked)for(var ae=0;ae<this.linked.length;++ae){var fe=this.linked[ae];if(fe.doc==ie){this.linked.splice(ae,1),ie.unlinkDoc(this),Qf(Jf(this));break}}if(ie.history==this.history){var ce=[ie.id];Iu(ie,function(me){return ce.push(me.id)},!0),ie.history=new _d(null),ie.history.done=lh(this.history.done,ce),ie.history.undone=lh(this.history.undone,ce)}},iterLinkedDocs:function(ie){Iu(this,ie)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(ie){return this.lineSep?ie.split(this.lineSep):Fr(ie)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:nr(function(ie){ie!="rtl"&&(ie="ltr"),ie!=this.direction&&(this.direction=ie,this.iter(function(ae){return ae.order=null}),this.cm&&Wg(this.cm))})}),Us.prototype.eachLine=Us.prototype.iter;var bc=0;function Fc(ie){var ae=this;if(Jg(ae),!(ln(ae,ie)||Ut(ae.display,ie))){ii(ie),yt&&(bc=+new Date);var fe=Eo(ae,ie,!0),ce=ie.dataTransfer.files;if(!(!fe||ae.isReadOnly()))if(ce&&ce.length&&window.FileReader&&window.File)for(var me=ce.length,ke=Array(me),Ge=0,Qe=function(){++Ge==me&&_o(ae,function(){fe=Fi(ae.doc,fe);var Mn={from:fe,to:fe,text:ae.doc.splitLines(ke.filter(function(qi){return qi!=null}).join(ae.doc.lineSeparator())),origin:"paste"};Ou(ae.doc,Mn),pf(ae.doc,Fh(Fi(ae.doc,fe),Fi(ae.doc,Oh(Mn))))})()},Xe=function(Mn,qi){if(ae.options.allowDropFileTypes&&dn(ae.options.allowDropFileTypes,Mn.type)==-1){Qe();return}var cr=new FileReader;cr.onerror=function(){return Qe()},cr.onload=function(){var Br=cr.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Br)){Qe();return}ke[qi]=Br,Qe()},cr.readAsText(Mn)},xt=0;xt<ce.length;xt++)Xe(ce[xt],xt);else{if(ae.state.draggingText&&ae.doc.sel.contains(fe)>-1){ae.state.draggingText(ie),setTimeout(function(){return ae.display.input.focus()},20);return}try{var an=ie.dataTransfer.getData("Text");if(an){var Ft;if(ae.state.draggingText&&!ae.state.draggingText.copy&&(Ft=ae.listSelections()),hd(ae.doc,Fh(fe,fe)),Ft)for(var zn=0;zn<Ft.length;++zn)Ku(ae.doc,"",Ft[zn].anchor,Ft[zn].head,"drag");ae.replaceSelection(an,"around","paste"),ae.display.input.focus()}}catch(Mn){}}}}function Yg(ie,ae){if(yt&&(!ie.state.draggingText||+new Date-bc<100)){Di(ae);return}if(!(ln(ie,ae)||Ut(ie.display,ae))&&(ae.dataTransfer.setData("Text",ie.getSelection()),ae.dataTransfer.effectAllowed="copyMove",ae.dataTransfer.setDragImage&&!Tt)){var fe=Ye("img",null,null,"position: fixed; left: 0; top: 0;");fe.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",We&&(fe.width=fe.height=1,ie.display.wrapper.appendChild(fe),fe._top=fe.offsetTop),ae.dataTransfer.setDragImage(fe,0,0),We&&fe.parentNode.removeChild(fe)}}function Xg(ie,ae){var fe=Eo(ie,ae);if(fe){var ce=document.createDocumentFragment();tr(ie,fe,ce),ie.display.dragCursor||(ie.display.dragCursor=Ye("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),ie.display.lineSpace.insertBefore(ie.display.dragCursor,ie.display.cursorDiv)),nt(ie.display.dragCursor,ce)}}function Jg(ie){ie.display.dragCursor&&(ie.display.lineSpace.removeChild(ie.display.dragCursor),ie.display.dragCursor=null)}function xf(ie){if(document.getElementsByClassName){for(var ae=document.getElementsByClassName("CodeMirror"),fe=[],ce=0;ce<ae.length;ce++){var me=ae[ce].CodeMirror;me&&fe.push(me)}fe.length&&fe[0].operation(function(){for(var ke=0;ke<fe.length;ke++)ie(fe[ke])})}}var Sf=!1;function cu(){Sf||(Zd(),Sf=!0)}function Zd(){var ie;Dn(window,"resize",function(){ie==null&&(ie=setTimeout(function(){ie=null,xf($f)},100))}),Dn(window,"blur",function(){return xf(bs)})}function $f(ie){var ae=ie.display;ae.cachedCharWidth=ae.cachedTextHeight=ae.cachedPaddingH=null,ae.scrollbarsClipped=!1,ie.setSize()}for(var uh={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"},Lc=0;Lc<10;Lc++)uh[Lc+48]=uh[Lc+96]=String(Lc);for(var wf=65;wf<=90;wf++)uh[wf]=String.fromCharCode(wf);for(var Bc=1;Bc<=12;Bc++)uh[Bc+111]=uh[Bc+63235]="F"+Bc;var eu={};eu.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"},eu.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"},eu.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"},eu.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"]},eu.default=de?eu.macDefault:eu.pcDefault;function Gd(ie){var ae=ie.split(/-(?!$)/);ie=ae[ae.length-1];for(var fe,ce,me,ke,Ge=0;Ge<ae.length-1;Ge++){var Qe=ae[Ge];if(/^(cmd|meta|m)$/i.test(Qe))ke=!0;else if(/^a(lt)?$/i.test(Qe))fe=!0;else if(/^(c|ctrl|control)$/i.test(Qe))ce=!0;else if(/^s(hift)?$/i.test(Qe))me=!0;else throw new Error("Unrecognized modifier name: "+Qe)}return fe&&(ie="Alt-"+ie),ce&&(ie="Ctrl-"+ie),ke&&(ie="Cmd-"+ie),me&&(ie="Shift-"+ie),ie}function qf(ie){var ae={};for(var fe in ie)if(ie.hasOwnProperty(fe)){var ce=ie[fe];if(/^(name|fallthrough|(de|at)tach)$/.test(fe))continue;if(ce=="..."){delete ie[fe];continue}for(var me=kn(fe.split(" "),Gd),ke=0;ke<me.length;ke++){var Ge=void 0,Qe=void 0;ke==me.length-1?(Qe=me.join(" "),Ge=ce):(Qe=me.slice(0,ke+1).join(" "),Ge="...");var Xe=ae[Qe];if(!Xe)ae[Qe]=Ge;else if(Xe!=Ge)throw new Error("Inconsistent bindings for "+Qe)}delete ie[fe]}for(var xt in ae)ie[xt]=ae[xt];return ie}function fu(ie,ae,fe,ce){ae=gd(ae);var me=ae.call?ae.call(ie,ce):ae[ie];if(me===!1)return"nothing";if(me==="...")return"multi";if(me!=null&&fe(me))return"handled";if(ae.fallthrough){if(Object.prototype.toString.call(ae.fallthrough)!="[object Array]")return fu(ie,ae.fallthrough,fe,ce);for(var ke=0;ke<ae.fallthrough.length;ke++){var Ge=fu(ie,ae.fallthrough[ke],fe,ce);if(Ge)return Ge}}}function Lh(ie){var ae=typeof ie=="string"?ie:uh[ie.keyCode];return ae=="Ctrl"||ae=="Alt"||ae=="Shift"||ae=="Mod"}function Pf(ie,ae,fe){var ce=ie;return ae.altKey&&ce!="Alt"&&(ie="Alt-"+ie),(we?ae.metaKey:ae.ctrlKey)&&ce!="Ctrl"&&(ie="Ctrl-"+ie),(we?ae.ctrlKey:ae.metaKey)&&ce!="Mod"&&(ie="Cmd-"+ie),!fe&&ae.shiftKey&&ce!="Shift"&&(ie="Shift-"+ie),ie}function eg(ie,ae){if(We&&ie.keyCode==34&&ie.char)return!1;var fe=uh[ie.keyCode];return fe==null||ie.altGraphKey?!1:(ie.keyCode==3&&ie.code&&(fe=ie.code),Pf(fe,ie,ae))}function gd(ie){return typeof ie=="string"?eu[ie]:ie}function Wl(ie,ae){for(var fe=ie.doc.sel.ranges,ce=[],me=0;me<fe.length;me++){for(var ke=ae(fe[me]);ce.length&&xn(ke.from,ht(ce).to)<=0;){var Ge=ce.pop();if(xn(Ge.from,ke.from)<0){ke.from=Ge.from;break}}ce.push(ke)}gr(ie,function(){for(var Qe=ce.length-1;Qe>=0;Qe--)Ku(ie.doc,"",ce[Qe].from,ce[Qe].to,"+delete");Rl(ie)})}function tg(ie,ae,fe){var ce=Kt(ie.text,ae+fe,fe);return ce<0||ce>ie.text.length?null:ce}function Gs(ie,ae,fe){var ce=tg(ie,ae.ch,fe);return ce==null?null:new $t(ae.line,ce,fe<0?"after":"before")}function hh(ie,ae,fe,ce,me){if(ie){ae.doc.direction=="rtl"&&(me=-me);var ke=Sn(fe,ae.doc.direction);if(ke){var Ge=me<0?ht(ke):ke[0],Qe=me<0==(Ge.level==1),Xe=Qe?"after":"before",xt;if(Ge.level>0||ae.doc.direction=="rtl"){var an=To(ae,fe);xt=me<0?fe.text.length-1:0;var Ft=Ca(ae,an,xt).top;xt=pn(function(zn){return Ca(ae,an,zn).top==Ft},me<0==(Ge.level==1)?Ge.from:Ge.to-1,xt),Xe=="before"&&(xt=tg(fe,xt,1))}else xt=me<0?Ge.to:Ge.from;return new $t(ce,xt,Xe)}}return new $t(ce,me<0?fe.text.length:0,me<0?"before":"after")}function Ef(ie,ae,fe,ce){var me=Sn(ae,ie.doc.direction);if(!me)return Gs(ae,fe,ce);fe.ch>=ae.text.length?(fe.ch=ae.text.length,fe.sticky="before"):fe.ch<=0&&(fe.ch=0,fe.sticky="after");var ke=Ot(me,fe.ch,fe.sticky),Ge=me[ke];if(ie.doc.direction=="ltr"&&Ge.level%2==0&&(ce>0?Ge.to>fe.ch:Ge.from<fe.ch))return Gs(ae,fe,ce);var Qe=function($r,No){return tg(ae,$r instanceof $t?$r.ch:$r,No)},Xe,xt=function($r){return ie.options.lineWrapping?(Xe=Xe||To(ie,ae),Ht(ie,ae,Xe,$r)):{begin:0,end:ae.text.length}},an=xt(fe.sticky=="before"?Qe(fe,-1):fe.ch);if(ie.doc.direction=="rtl"||Ge.level==1){var Ft=Ge.level==1==ce<0,zn=Qe(fe,Ft?1:-1);if(zn!=null&&(Ft?zn<=Ge.to&&zn<=an.end:zn>=Ge.from&&zn>=an.begin)){var Mn=Ft?"before":"after";return new $t(fe.line,zn,Mn)}}var qi=function($r,No,co){for(var zo=function(ys,ol){return ol?new $t(fe.line,Qe(ys,1),"before"):new $t(fe.line,ys,"after")};$r>=0&&$r<me.length;$r+=No){var va=me[$r],fo=No>0==(va.level!=1),ja=fo?co.begin:Qe(co.end,-1);if(va.from<=ja&&ja<va.to||(ja=fo?va.from:Qe(va.to,-1),co.begin<=ja&&ja<co.end))return zo(ja,fo)}},cr=qi(ke+ce,ce,an);if(cr)return cr;var Br=ce>0?an.end:Qe(an.begin,-1);return Br!=null&&!(ce>0&&Br==ae.text.length)&&(cr=qi(ce>0?0:me.length-1,ce,xt(Br)),cr)?cr:null}var zh={selectAll:Zs,singleSelection:function(ie){return ie.setSelection(ie.getCursor("anchor"),ie.getCursor("head"),Rt)},killLine:function(ie){return Wl(ie,function(ae){if(ae.empty()){var fe=Yn(ie.doc,ae.head.line).text.length;return ae.head.ch==fe&&ae.head.line<ie.lastLine()?{from:ae.head,to:$t(ae.head.line+1,0)}:{from:ae.head,to:$t(ae.head.line,fe)}}else return{from:ae.from(),to:ae.to()}})},deleteLine:function(ie){return Wl(ie,function(ae){return{from:$t(ae.from().line,0),to:Fi(ie.doc,$t(ae.to().line+1,0))}})},delLineLeft:function(ie){return Wl(ie,function(ae){return{from:$t(ae.from().line,0),to:ae.from()}})},delWrappedLineLeft:function(ie){return Wl(ie,function(ae){var fe=ie.charCoords(ae.head,"div").top+5,ce=ie.coordsChar({left:0,top:fe},"div");return{from:ce,to:ae.from()}})},delWrappedLineRight:function(ie){return Wl(ie,function(ae){var fe=ie.charCoords(ae.head,"div").top+5,ce=ie.coordsChar({left:ie.display.lineDiv.offsetWidth+100,top:fe},"div");return{from:ae.from(),to:ce}})},undo:function(ie){return ie.undo()},redo:function(ie){return ie.redo()},undoSelection:function(ie){return ie.undoSelection()},redoSelection:function(ie){return ie.redoSelection()},goDocStart:function(ie){return ie.extendSelection($t(ie.firstLine(),0))},goDocEnd:function(ie){return ie.extendSelection($t(ie.lastLine()))},goLineStart:function(ie){return ie.extendSelectionsBy(function(ae){return Wd(ie,ae.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(ie){return ie.extendSelectionsBy(function(ae){return Mc(ie,ae.head)},{origin:"+move",bias:1})},goLineEnd:function(ie){return ie.extendSelectionsBy(function(ae){return Hd(ie,ae.head.line)},{origin:"+move",bias:-1})},goLineRight:function(ie){return ie.extendSelectionsBy(function(ae){var fe=ie.cursorCoords(ae.head,"div").top+5;return ie.coordsChar({left:ie.display.lineDiv.offsetWidth+100,top:fe},"div")},Bn)},goLineLeft:function(ie){return ie.extendSelectionsBy(function(ae){var fe=ie.cursorCoords(ae.head,"div").top+5;return ie.coordsChar({left:0,top:fe},"div")},Bn)},goLineLeftSmart:function(ie){return ie.extendSelectionsBy(function(ae){var fe=ie.cursorCoords(ae.head,"div").top+5,ce=ie.coordsChar({left:0,top:fe},"div");return ce.ch<ie.getLine(ce.line).search(/\S/)?Mc(ie,ae.head):ce},Bn)},goLineUp:function(ie){return ie.moveV(-1,"line")},goLineDown:function(ie){return ie.moveV(1,"line")},goPageUp:function(ie){return ie.moveV(-1,"page")},goPageDown:function(ie){return ie.moveV(1,"page")},goCharLeft:function(ie){return ie.moveH(-1,"char")},goCharRight:function(ie){return ie.moveH(1,"char")},goColumnLeft:function(ie){return ie.moveH(-1,"column")},goColumnRight:function(ie){return ie.moveH(1,"column")},goWordLeft:function(ie){return ie.moveH(-1,"word")},goGroupRight:function(ie){return ie.moveH(1,"group")},goGroupLeft:function(ie){return ie.moveH(-1,"group")},goWordRight:function(ie){return ie.moveH(1,"word")},delCharBefore:function(ie){return ie.deleteH(-1,"codepoint")},delCharAfter:function(ie){return ie.deleteH(1,"char")},delWordBefore:function(ie){return ie.deleteH(-1,"word")},delWordAfter:function(ie){return ie.deleteH(1,"word")},delGroupBefore:function(ie){return ie.deleteH(-1,"group")},delGroupAfter:function(ie){return ie.deleteH(1,"group")},indentAuto:function(ie){return ie.indentSelection("smart")},indentMore:function(ie){return ie.indentSelection("add")},indentLess:function(ie){return ie.indentSelection("subtract")},insertTab:function(ie){return ie.replaceSelection(" ")},insertSoftTab:function(ie){for(var ae=[],fe=ie.listSelections(),ce=ie.options.tabSize,me=0;me<fe.length;me++){var ke=fe[me].from(),Ge=it(ie.getLine(ke.line),ke.ch,ce);ae.push(On(ce-Ge%ce))}ie.replaceSelections(ae)},defaultTab:function(ie){ie.somethingSelected()?ie.indentSelection("add"):ie.execCommand("insertTab")},transposeChars:function(ie){return gr(ie,function(){for(var ae=ie.listSelections(),fe=[],ce=0;ce<ae.length;ce++)if(ae[ce].empty()){var me=ae[ce].head,ke=Yn(ie.doc,me.line).text;if(ke){if(me.ch==ke.length&&(me=new $t(me.line,me.ch-1)),me.ch>0)me=new $t(me.line,me.ch+1),ie.replaceRange(ke.charAt(me.ch-1)+ke.charAt(me.ch-2),$t(me.line,me.ch-2),me,"+transpose");else if(me.line>ie.doc.first){var Ge=Yn(ie.doc,me.line-1).text;Ge&&(me=new $t(me.line,1),ie.replaceRange(ke.charAt(0)+ie.doc.lineSeparator()+Ge.charAt(Ge.length-1),$t(me.line-1,Ge.length-1),me,"+transpose"))}}fe.push(new us(me,me))}ie.setSelections(fe)})},newlineAndIndent:function(ie){return gr(ie,function(){for(var ae=ie.listSelections(),fe=ae.length-1;fe>=0;fe--)ie.replaceRange(ie.doc.lineSeparator(),ae[fe].anchor,ae[fe].head,"+input");ae=ie.listSelections();for(var ce=0;ce<ae.length;ce++)ie.indentLine(ae[ce].from().line,null,!0);Rl(ie)})},openLine:function(ie){return ie.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(ie){return ie.toggleOverwrite()}};function Wd(ie,ae){var fe=Yn(ie.doc,ae),ce=$n(fe);return ce!=fe&&(ae=Ke(ce)),hh(!0,ie,ce,ae,1)}function Hd(ie,ae){var fe=Yn(ie.doc,ae),ce=pi(fe);return ce!=fe&&(ae=Ke(ce)),hh(!0,ie,fe,ae,-1)}function Mc(ie,ae){var fe=Wd(ie,ae.line),ce=Yn(ie.doc,fe.line),me=Sn(ce,ie.doc.direction);if(!me||me[0].level==0){var ke=Math.max(fe.ch,ce.text.search(/\S/)),Ge=ae.line==fe.line&&ae.ch<=ke&&ae.ch;return $t(fe.line,Ge?0:ke,fe.sticky)}return fe}function Vd(ie,ae,fe){if(typeof ae=="string"&&(ae=zh[ae],!ae))return!1;ie.display.input.ensurePolled();var ce=ie.display.shift,me=!1;try{ie.isReadOnly()&&(ie.state.suppressEdits=!0),fe&&(ie.display.shift=!1),me=ae(ie)!=Kn}finally{ie.display.shift=ce,ie.state.suppressEdits=!1}return me}function ng(ie,ae,fe){for(var ce=0;ce<ie.state.keyMaps.length;ce++){var me=fu(ae,ie.state.keyMaps[ce],fe,ie);if(me)return me}return ie.options.extraKeys&&fu(ae,ie.options.extraKeys,fe,ie)||fu(ae,ie.options.keyMap,fe,ie)}var dh=new rt;function pd(ie,ae,fe,ce){var me=ie.state.keySeq;if(me){if(Lh(ae))return"handled";if(/\'$/.test(ae)?ie.state.keySeq=null:dh.set(50,function(){ie.state.keySeq==me&&(ie.state.keySeq=null,ie.display.input.reset())}),Cf(ie,me+" "+ae,fe,ce))return!0}return Cf(ie,ae,fe,ce)}function Cf(ie,ae,fe,ce){var me=ng(ie,ae,ce);return me=="multi"&&(ie.state.keySeq=ae),me=="handled"&&Kr(ie,"keyHandled",ie,ae,fe),(me=="handled"||me=="multi")&&(ii(fe),Zo(ie)),!!me}function bf(ie,ae){var fe=eg(ae,!0);return fe?ae.shiftKey&&!ie.state.keySeq?pd(ie,"Shift-"+fe,ae,function(ce){return Vd(ie,ce,!0)})||pd(ie,fe,ae,function(ce){if(typeof ce=="string"?/^go[A-Z]/.test(ce):ce.motion)return Vd(ie,ce)}):pd(ie,fe,ae,function(ce){return Vd(ie,ce)}):!1}function Ff(ie,ae,fe){return pd(ie,"'"+fe+"'",ae,function(ce){return Vd(ie,ce,!0)})}var Zh=null;function ig(ie){var ae=this;if(!(ie.target&&ie.target!=ae.display.input.getField())&&(ae.curOp.focus=Pt(),!ln(ae,ie))){yt&&Oe<11&&ie.keyCode==27&&(ie.returnValue=!1);var fe=ie.keyCode;ae.display.shift=fe==16||ie.shiftKey;var ce=bf(ae,ie);We&&(Zh=ce?fe:null,!ce&&fe==88&&!gn&&(de?ie.metaKey:ie.ctrlKey)&&ae.replaceSelection("",null,"cut")),le&&!de&&!ce&&fe==46&&ie.shiftKey&&!ie.ctrlKey&&document.execCommand&&document.execCommand("cut"),fe==18&&!/\bCodeMirror-crosshair\b/.test(ae.display.lineDiv.className)&&rg(ae)}}function rg(ie){var ae=ie.display.lineDiv;Bt(ae,"CodeMirror-crosshair");function fe(ce){(ce.keyCode==18||!ce.altKey)&&(Ze(ae,"CodeMirror-crosshair"),en(document,"keyup",fe),en(document,"mouseover",fe))}Dn(document,"keyup",fe),Dn(document,"mouseover",fe)}function og(ie){ie.keyCode==16&&(this.doc.sel.shift=!1),ln(this,ie)}function Xu(ie){var ae=this;if(!(ie.target&&ie.target!=ae.display.input.getField())&&!(Ut(ae.display,ie)||ln(ae,ie)||ie.ctrlKey&&!ie.altKey||de&&ie.metaKey)){var fe=ie.keyCode,ce=ie.charCode;if(We&&fe==Zh){Zh=null,ii(ie);return}if(!(We&&(!ie.which||ie.which<10)&&bf(ae,ie))){var me=String.fromCharCode(ce==null?fe:ce);me!="\b"&&(Ff(ae,ie,me)||ae.display.input.onKeyPress(ie))}}}var ag=400,sg=function(ie,ae,fe){this.time=ie,this.pos=ae,this.button=fe};sg.prototype.compare=function(ie,ae,fe){return this.time+ag>ie&&xn(ae,this.pos)==0&&fe==this.button};var Kd,md;function lg(ie,ae){var fe=+new Date;return md&&md.compare(fe,ie,ae)?(Kd=md=null,"triple"):Kd&&Kd.compare(fe,ie,ae)?(md=new sg(fe,ie,ae),Kd=null,"double"):(Kd=new sg(fe,ie,ae),md=null,"single")}function Ju(ie){var ae=this,fe=ae.display;if(!(ln(ae,ie)||fe.activeTouch&&fe.input.supportsTouch())){if(fe.input.ensurePolled(),fe.shift=ie.shiftKey,Ut(fe,ie)){at||(fe.scroller.draggable=!1,setTimeout(function(){return fe.scroller.draggable=!0},100));return}if(!Lf(ae,ie)){var ce=Eo(ae,ie),me=Gn(ie),ke=ce?lg(ce,me):"single";window.focus(),me==1&&ae.state.selectingText&&ae.state.selectingText(ie),!(ce&&ug(ae,me,ce,ke,ie))&&(me==1?ce?hg(ae,ce,ke,ie):Mr(ie)==fe.scroller&&ii(ie):me==2?(ce&&ff(ae.doc,ce),setTimeout(function(){return fe.input.focus()},20)):me==3&&(Ce?ae.display.input.onContextMenu(ie):La(ae)))}}}function ug(ie,ae,fe,ce,me){var ke="Click";return ce=="double"?ke="Double"+ke:ce=="triple"&&(ke="Triple"+ke),ke=(ae==1?"Left":ae==2?"Middle":"Right")+ke,pd(ie,Pf(ke,me),me,function(Ge){if(typeof Ge=="string"&&(Ge=zh[Ge]),!Ge)return!1;var Qe=!1;try{ie.isReadOnly()&&(ie.state.suppressEdits=!0),Qe=Ge(ie,fe)!=Kn}finally{ie.state.suppressEdits=!1}return Qe})}function vd(ie,ae,fe){var ce=ie.getOption("configureMouse"),me=ce?ce(ie,ae,fe):{};if(me.unit==null){var ke=se?fe.shiftKey&&fe.metaKey:fe.altKey;me.unit=ke?"rectangle":ae=="single"?"char":ae=="double"?"word":"line"}return(me.extend==null||ie.doc.extend)&&(me.extend=ie.doc.extend||fe.shiftKey),me.addNew==null&&(me.addNew=de?fe.metaKey:fe.ctrlKey),me.moveOnDrag==null&&(me.moveOnDrag=!(de?fe.altKey:fe.ctrlKey)),me}function hg(ie,ae,fe,ce){yt?setTimeout(vn(ha,ie),0):ie.curOp.focus=Pt();var me=vd(ie,fe,ce),ke=ie.doc.sel,Ge;ie.options.dragDrop&&Rn&&!ie.isReadOnly()&&fe=="single"&&(Ge=ke.contains(ae))>-1&&(xn((Ge=ke.ranges[Ge]).from(),ae)<0||ae.xRel>0)&&(xn(Ge.to(),ae)>0||ae.xRel<0)?dg(ie,ce,ae,me):Zp(ie,ce,ae,me)}function dg(ie,ae,fe,ce){var me=ie.display,ke=!1,Ge=_o(ie,function(xt){at&&(me.scroller.draggable=!1),ie.state.draggingText=!1,en(me.wrapper.ownerDocument,"mouseup",Ge),en(me.wrapper.ownerDocument,"mousemove",Qe),en(me.scroller,"dragstart",Xe),en(me.scroller,"drop",Ge),ke||(ii(xt),ce.addNew||ff(ie.doc,fe,null,null,ce.extend),at&&!Tt||yt&&Oe==9?setTimeout(function(){me.wrapper.ownerDocument.body.focus({preventScroll:!0}),me.input.focus()},20):me.input.focus())}),Qe=function(xt){ke=ke||Math.abs(ae.clientX-xt.clientX)+Math.abs(ae.clientY-xt.clientY)>=10},Xe=function(){return ke=!0};at&&(me.scroller.draggable=!0),ie.state.draggingText=Ge,Ge.copy=!ce.moveOnDrag,me.scroller.dragDrop&&me.scroller.dragDrop(),Dn(me.wrapper.ownerDocument,"mouseup",Ge),Dn(me.wrapper.ownerDocument,"mousemove",Qe),Dn(me.scroller,"dragstart",Xe),Dn(me.scroller,"drop",Ge),La(ie),setTimeout(function(){return me.input.focus()},20)}function cg(ie,ae,fe){if(fe=="char")return new us(ae,ae);if(fe=="word")return ie.findWordAt(ae);if(fe=="line")return new us($t(ae.line,0),Fi(ie.doc,$t(ae.line+1,0)));var ce=fe(ie,ae);return new us(ce.from,ce.to)}function Zp(ie,ae,fe,ce){var me=ie.display,ke=ie.doc;ii(ae);var Ge,Qe,Xe=ke.sel,xt=Xe.ranges;if(ce.addNew&&!ce.extend?(Qe=ke.sel.contains(fe),Qe>-1?Ge=xt[Qe]:Ge=new us(fe,fe)):(Ge=ke.sel.primary(),Qe=ke.sel.primIndex),ce.unit=="rectangle")ce.addNew||(Ge=new us(fe,fe)),fe=Eo(ie,ae,!0,!0),Qe=-1;else{var an=cg(ie,fe,ce.unit);ce.extend?Ge=cf(Ge,an.anchor,an.head,ce.extend):Ge=an}ce.addNew?Qe==-1?(Qe=xt.length,cl(ke,wu(ie,xt.concat([Ge]),Qe),{scroll:!1,origin:"*mouse"})):xt.length>1&&xt[Qe].empty()&&ce.unit=="char"&&!ce.extend?(cl(ke,wu(ie,xt.slice(0,Qe).concat(xt.slice(Qe+1)),0),{scroll:!1,origin:"*mouse"}),Xe=ke.sel):Eu(ke,Qe,Ge,En):(Qe=0,cl(ke,new du([Ge],0),En),Xe=ke.sel);var Ft=fe;function zn(co){if(xn(Ft,co)!=0)if(Ft=co,ce.unit=="rectangle"){for(var zo=[],va=ie.options.tabSize,fo=it(Yn(ke,fe.line).text,fe.ch,va),ja=it(Yn(ke,co.line).text,co.ch,va),ys=Math.min(fo,ja),ol=Math.max(fo,ja),Ls=Math.min(fe.line,co.line),Hl=Math.min(ie.lastLine(),Math.max(fe.line,co.line));Ls<=Hl;Ls++){var xl=Yn(ke,Ls).text,$s=ui(xl,ys,va);ys==ol?zo.push(new us($t(Ls,$s),$t(Ls,$s))):xl.length>$s&&zo.push(new us($t(Ls,$s),$t(Ls,ui(xl,ol,va))))}zo.length||zo.push(new us(fe,fe)),cl(ke,wu(ie,Xe.ranges.slice(0,Qe).concat(zo),Qe),{origin:"*mouse",scroll:!1}),ie.scrollIntoView(co)}else{var Vl=Ge,fl=cg(ie,co,ce.unit),qs=Vl.anchor,Qa;xn(fl.anchor,qs)>0?(Qa=fl.head,qs=gi(Vl.from(),fl.anchor)):(Qa=fl.anchor,qs=Hi(Vl.to(),fl.head));var Bs=Xe.ranges.slice(0);Bs[Qe]=Qg(ie,new us(Fi(ke,qs),Qa)),cl(ke,wu(ie,Bs,Qe),En)}}var Mn=me.wrapper.getBoundingClientRect(),qi=0;function cr(co){var zo=++qi,va=Eo(ie,co,!0,ce.unit=="rectangle");if(va)if(xn(va,Ft)!=0){ie.curOp.focus=Pt(),zn(va);var fo=wo(me,ke);(va.line>=fo.to||va.line<fo.from)&&setTimeout(_o(ie,function(){qi==zo&&cr(co)}),150)}else{var ja=co.clientY<Mn.top?-20:co.clientY>Mn.bottom?20:0;ja&&setTimeout(_o(ie,function(){qi==zo&&(me.scroller.scrollTop+=ja,cr(co))}),50)}}function Br(co){ie.state.selectingText=!1,qi=1/0,co&&(ii(co),me.input.focus()),en(me.wrapper.ownerDocument,"mousemove",$r),en(me.wrapper.ownerDocument,"mouseup",No),ke.history.lastSelOrigin=null}var $r=_o(ie,function(co){co.buttons===0||!Gn(co)?Br(co):cr(co)}),No=_o(ie,Br);ie.state.selectingText=No,Dn(me.wrapper.ownerDocument,"mousemove",$r),Dn(me.wrapper.ownerDocument,"mouseup",No)}function Qg(ie,ae){var fe=ae.anchor,ce=ae.head,me=Yn(ie.doc,fe.line);if(xn(fe,ce)==0&&fe.sticky==ce.sticky)return ae;var ke=Sn(me);if(!ke)return ae;var Ge=Ot(ke,fe.ch,fe.sticky),Qe=ke[Ge];if(Qe.from!=fe.ch&&Qe.to!=fe.ch)return ae;var Xe=Ge+(Qe.from==fe.ch==(Qe.level!=1)?0:1);if(Xe==0||Xe==ke.length)return ae;var xt;if(ce.line!=fe.line)xt=(ce.line-fe.line)*(ie.doc.direction=="ltr"?1:-1)>0;else{var an=Ot(ke,ce.ch,ce.sticky),Ft=an-Ge||(ce.ch-fe.ch)*(Qe.level==1?-1:1);an==Xe-1||an==Xe?xt=Ft<0:xt=Ft>0}var zn=ke[Xe+(xt?-1:0)],Mn=xt==(zn.level==1),qi=Mn?zn.from:zn.to,cr=Mn?"after":"before";return fe.ch==qi&&fe.sticky==cr?ae:new us(new $t(fe.line,qi,cr),ce)}function Gh(ie,ae,fe,ce){var me,ke;if(ae.touches)me=ae.touches[0].clientX,ke=ae.touches[0].clientY;else try{me=ae.clientX,ke=ae.clientY}catch(zn){return!1}if(me>=Math.floor(ie.display.gutters.getBoundingClientRect().right))return!1;ce&&ii(ae);var Ge=ie.display,Qe=Ge.lineDiv.getBoundingClientRect();if(ke>Qe.bottom||!cn(ie,fe))return bi(ae);ke-=Qe.top-Ge.viewOffset;for(var Xe=0;Xe<ie.display.gutterSpecs.length;++Xe){var xt=Ge.gutters.childNodes[Xe];if(xt&&xt.getBoundingClientRect().right>=me){var an=Lt(ie.doc,ke),Ft=ie.display.gutterSpecs[Xe];return Qt(ie,fe,ie,an,Ft.className,ae),bi(ae)}}}function Lf(ie,ae){return Gh(ie,ae,"gutterClick",!0)}function kc(ie,ae){Ut(ie.display,ae)||$g(ie,ae)||ln(ie,ae,"contextmenu")||Ce||ie.display.input.onContextMenu(ae)}function $g(ie,ae){return cn(ie,"gutterContextMenu")?Gh(ie,ae,"gutterContextMenu",!1):!1}function Bf(ie){ie.display.wrapper.className=ie.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+ie.options.theme.replace(/(^|\s)\s*/g," cm-s-"),za(ie)}var yd={toString:function(){return"CodeMirror.Init"}},fg={},xd={};function qg(ie){var ae=ie.optionHandlers;function fe(ce,me,ke,Ge){ie.defaults[ce]=me,ke&&(ae[ce]=Ge?function(Qe,Xe,xt){xt!=yd&&ke(Qe,Xe,xt)}:ke)}ie.defineOption=fe,ie.Init=yd,fe("value","",function(ce,me){return ce.setValue(me)},!0),fe("mode",null,function(ce,me){ce.doc.modeOption=me,Ta(ce)},!0),fe("indentUnit",2,Ta,!0),fe("indentWithTabs",!1),fe("smartIndent",!0),fe("tabSize",4,function(ce){ad(ce),za(ce),Si(ce)},!0),fe("lineSeparator",null,function(ce,me){if(ce.doc.lineSep=me,!!me){var ke=[],Ge=ce.doc.first;ce.doc.iter(function(Xe){for(var xt=0;;){var an=Xe.text.indexOf(me,xt);if(an==-1)break;xt=an+me.length,ke.push($t(Ge,an))}Ge++});for(var Qe=ke.length-1;Qe>=0;Qe--)Ku(ce.doc,me,ke[Qe],$t(ke[Qe].line,ke[Qe].ch+me.length))}}),fe("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(ce,me,ke){ce.state.specialChars=new RegExp(me.source+(me.test(" ")?"":"| "),"g"),ke!=yd&&ce.refresh()}),fe("specialCharPlaceholder",Ho,function(ce){return ce.refresh()},!0),fe("electricChars",!0),fe("inputStyle",te?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),fe("spellcheck",!1,function(ce,me){return ce.getInputField().spellcheck=me},!0),fe("autocorrect",!1,function(ce,me){return ce.getInputField().autocorrect=me},!0),fe("autocapitalize",!1,function(ce,me){return ce.getInputField().autocapitalize=me},!0),fe("rtlMoveVisually",!pe),fe("wholeLineUpdateBefore",!0),fe("theme","default",function(ce){Bf(ce),Js(ce)},!0),fe("keyMap","default",function(ce,me,ke){var Ge=gd(me),Qe=ke!=yd&&gd(ke);Qe&&Qe.detach&&Qe.detach(ce,Ge),Ge.attach&&Ge.attach(ce,Qe||null)}),fe("extraKeys",null),fe("configureMouse",null),fe("lineWrapping",!1,ep,!0),fe("gutters",[],function(ce,me){ce.display.gutterSpecs=Ts(me,ce.options.lineNumbers),Js(ce)},!0),fe("fixedGutter",!0,function(ce,me){ce.display.gutters.style.left=me?kr(ce.display)+"px":"0",ce.refresh()},!0),fe("coverGutterNextToScrollbar",!1,function(ce){return Os(ce)},!0),fe("scrollbarStyle","native",function(ce){Bl(ce),Os(ce),ce.display.scrollbars.setScrollTop(ce.doc.scrollTop),ce.display.scrollbars.setScrollLeft(ce.doc.scrollLeft)},!0),fe("lineNumbers",!1,function(ce,me){ce.display.gutterSpecs=Ts(ce.options.gutters,me),Js(ce)},!0),fe("firstLineNumber",1,Js,!0),fe("lineNumberFormatter",function(ce){return ce},Js,!0),fe("showCursorWhenSelecting",!1,yr,!0),fe("resetSelectionOnContextMenu",!0),fe("lineWiseCopyCut",!0),fe("pasteLinesPerSelection",!0),fe("selectionsMayTouch",!1),fe("readOnly",!1,function(ce,me){me=="nocursor"&&(bs(ce),ce.display.input.blur()),ce.display.input.readOnlyChanged(me)}),fe("screenReaderLabel",null,function(ce,me){me=me===""?null:me,ce.display.input.screenReaderLabelChanged(me)}),fe("disableInput",!1,function(ce,me){me||ce.display.input.reset()},!0),fe("dragDrop",!0,Mf),fe("allowDropFileTypes",null),fe("cursorBlinkRate",530),fe("cursorScrollMargin",0),fe("cursorHeight",1,yr,!0),fe("singleCursorHeightPerLine",!0,yr,!0),fe("workTime",100),fe("workDelay",100),fe("flattenSpans",!0,ad,!0),fe("addModeClass",!1,ad,!0),fe("pollInterval",100),fe("undoDepth",200,function(ce,me){return ce.doc.history.undoDepth=me}),fe("historyEventDelay",1250),fe("viewportMargin",10,function(ce){return ce.refresh()},!0),fe("maxHighlightLength",1e4,ad,!0),fe("moveInputWithCursor",!0,function(ce,me){me||ce.display.input.resetPosition()}),fe("tabindex",null,function(ce,me){return ce.display.input.getField().tabIndex=me||""}),fe("autofocus",null),fe("direction","ltr",function(ce,me){return ce.doc.setDirection(me)},!0),fe("phrases",null)}function Mf(ie,ae,fe){var ce=fe&&fe!=yd;if(!ae!=!ce){var me=ie.display.dragFunctions,ke=ae?Dn:en;ke(ie.display.scroller,"dragstart",me.start),ke(ie.display.scroller,"dragenter",me.enter),ke(ie.display.scroller,"dragover",me.over),ke(ie.display.scroller,"dragleave",me.leave),ke(ie.display.scroller,"drop",me.drop)}}function ep(ie){ie.options.lineWrapping?(Bt(ie.display.wrapper,"CodeMirror-wrap"),ie.display.sizer.style.minWidth="",ie.display.sizerWidth=null):(Ze(ie.display.wrapper,"CodeMirror-wrap"),Yr(ie)),Er(ie),Si(ie),za(ie),setTimeout(function(){return Os(ie)},100)}function Ja(ie,ae){var fe=this;if(!(this instanceof Ja))return new Ja(ie,ae);this.options=ae=ae?tn(ae):{},tn(fg,ae,!1);var ce=ae.value;typeof ce=="string"?ce=new Us(ce,ae.mode,null,ae.lineSeparator,ae.direction):ae.mode&&(ce.modeOption=ae.mode),this.doc=ce;var me=new Ja.inputStyles[ae.inputStyle](this),ke=this.display=new _h(ie,ce,me,ae);ke.wrapper.CodeMirror=this,Bf(this),ae.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Bl(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 rt,keySeq:null,specialChars:null},ae.autofocus&&!te&&ke.input.focus(),yt&&Oe<11&&setTimeout(function(){return fe.display.input.reset(!0)},20),Ud(this),cu(),zl(this),this.curOp.forceUpdate=!0,lf(this,ce),ae.autofocus&&!te||this.hasFocus()?setTimeout(function(){fe.hasFocus()&&!fe.state.focused&&zr(fe)},20):bs(this);for(var Ge in xd)xd.hasOwnProperty(Ge)&&xd[Ge](this,ae[Ge],yd);Cs(this),ae.finishInit&&ae.finishInit(this);for(var Qe=0;Qe<Wh.length;++Qe)Wh[Qe](this);uu(this),at&&ae.lineWrapping&&getComputedStyle(ke.lineDiv).textRendering=="optimizelegibility"&&(ke.lineDiv.style.textRendering="auto")}Ja.defaults=fg,Ja.optionHandlers=xd;function Ud(ie){var ae=ie.display;Dn(ae.scroller,"mousedown",_o(ie,Ju)),yt&&Oe<11?Dn(ae.scroller,"dblclick",_o(ie,function(Xe){if(!ln(ie,Xe)){var xt=Eo(ie,Xe);if(!(!xt||Lf(ie,Xe)||Ut(ie.display,Xe))){ii(Xe);var an=ie.findWordAt(xt);ff(ie.doc,an.anchor,an.head)}}})):Dn(ae.scroller,"dblclick",function(Xe){return ln(ie,Xe)||ii(Xe)}),Dn(ae.scroller,"contextmenu",function(Xe){return kc(ie,Xe)}),Dn(ae.input.getField(),"contextmenu",function(Xe){ae.scroller.contains(Xe.target)||kc(ie,Xe)});var fe,ce={end:0};function me(){ae.activeTouch&&(fe=setTimeout(function(){return ae.activeTouch=null},1e3),ce=ae.activeTouch,ce.end=+new Date)}function ke(Xe){if(Xe.touches.length!=1)return!1;var xt=Xe.touches[0];return xt.radiusX<=1&&xt.radiusY<=1}function Ge(Xe,xt){if(xt.left==null)return!0;var an=xt.left-Xe.left,Ft=xt.top-Xe.top;return an*an+Ft*Ft>20*20}Dn(ae.scroller,"touchstart",function(Xe){if(!ln(ie,Xe)&&!ke(Xe)&&!Lf(ie,Xe)){ae.input.ensurePolled(),clearTimeout(fe);var xt=+new Date;ae.activeTouch={start:xt,moved:!1,prev:xt-ce.end<=300?ce:null},Xe.touches.length==1&&(ae.activeTouch.left=Xe.touches[0].pageX,ae.activeTouch.top=Xe.touches[0].pageY)}}),Dn(ae.scroller,"touchmove",function(){ae.activeTouch&&(ae.activeTouch.moved=!0)}),Dn(ae.scroller,"touchend",function(Xe){var xt=ae.activeTouch;if(xt&&!Ut(ae,Xe)&&xt.left!=null&&!xt.moved&&new Date-xt.start<300){var an=ie.coordsChar(ae.activeTouch,"page"),Ft;!xt.prev||Ge(xt,xt.prev)?Ft=new us(an,an):!xt.prev.prev||Ge(xt,xt.prev.prev)?Ft=ie.findWordAt(an):Ft=new us($t(an.line,0),Fi(ie.doc,$t(an.line+1,0))),ie.setSelection(Ft.anchor,Ft.head),ie.focus(),ii(Xe)}me()}),Dn(ae.scroller,"touchcancel",me),Dn(ae.scroller,"scroll",function(){ae.scroller.clientHeight&&(nl(ie,ae.scroller.scrollTop),dl(ie,ae.scroller.scrollLeft,!0),Qt(ie,"scroll",ie))}),Dn(ae.scroller,"mousewheel",function(Xe){return ll(ie,Xe)}),Dn(ae.scroller,"DOMMouseScroll",function(Xe){return ll(ie,Xe)}),Dn(ae.wrapper,"scroll",function(){return ae.wrapper.scrollTop=ae.wrapper.scrollLeft=0}),ae.dragFunctions={enter:function(Xe){ln(ie,Xe)||Di(Xe)},over:function(Xe){ln(ie,Xe)||(Xg(ie,Xe),Di(Xe))},start:function(Xe){return Yg(ie,Xe)},drop:_o(ie,Fc),leave:function(Xe){ln(ie,Xe)||Jg(ie)}};var Qe=ae.input.getField();Dn(Qe,"keyup",function(Xe){return og.call(ie,Xe)}),Dn(Qe,"keydown",_o(ie,ig)),Dn(Qe,"keypress",_o(ie,Xu)),Dn(Qe,"focus",function(Xe){return zr(ie,Xe)}),Dn(Qe,"blur",function(Xe){return bs(ie,Xe)})}var Wh=[];Ja.defineInitHook=function(ie){return Wh.push(ie)};function rl(ie,ae,fe,ce){var me=ie.doc,ke;fe==null&&(fe="add"),fe=="smart"&&(me.mode.indent?ke=So(ie,ae).state:fe="prev");var Ge=ie.options.tabSize,Qe=Yn(me,ae),Xe=it(Qe.text,null,Ge);Qe.stateAfter&&(Qe.stateAfter=null);var xt=Qe.text.match(/^\s*/)[0],an;if(!ce&&!/\S/.test(Qe.text))an=0,fe="not";else if(fe=="smart"&&(an=me.mode.indent(ke,Qe.text.slice(xt.length),Qe.text),an==Kn||an>150)){if(!ce)return;fe="prev"}fe=="prev"?ae>me.first?an=it(Yn(me,ae-1).text,null,Ge):an=0:fe=="add"?an=Xe+ie.options.indentUnit:fe=="subtract"?an=Xe-ie.options.indentUnit:typeof fe=="number"&&(an=Xe+fe),an=Math.max(0,an);var Ft="",zn=0;if(ie.options.indentWithTabs)for(var Mn=Math.floor(an/Ge);Mn;--Mn)zn+=Ge,Ft+=" ";if(zn<an&&(Ft+=On(an-zn)),Ft!=xt)return Ku(me,Ft,$t(ae,0),$t(ae,xt.length),"+input"),Qe.stateAfter=null,!0;for(var qi=0;qi<me.sel.ranges.length;qi++){var cr=me.sel.ranges[qi];if(cr.head.line==ae&&cr.head.ch<xt.length){var Br=$t(ae,xt.length);Eu(me,qi,new us(Br,Br));break}}}var Al=null;function Yd(ie){Al=ie}function Sd(ie,ae,fe,ce,me){var ke=ie.doc;ie.display.shift=!1,ce||(ce=ke.sel);var Ge=+new Date-200,Qe=me=="paste"||ie.state.pasteIncoming>Ge,Xe=Fr(ae),xt=null;if(Qe&&ce.ranges.length>1)if(Al&&Al.text.join(`
|
|
`)==ae){if(ce.ranges.length%Al.text.length==0){xt=[];for(var an=0;an<Al.text.length;an++)xt.push(ke.splitLines(Al.text[an]))}}else Xe.length==ce.ranges.length&&ie.options.pasteLinesPerSelection&&(xt=kn(Xe,function($r){return[$r]}));for(var Ft=ie.curOp.updateInput,zn=ce.ranges.length-1;zn>=0;zn--){var Mn=ce.ranges[zn],qi=Mn.from(),cr=Mn.to();Mn.empty()&&(fe&&fe>0?qi=$t(qi.line,qi.ch-fe):ie.state.overwrite&&!Qe?cr=$t(cr.line,Math.min(Yn(ke,cr.line).text.length,cr.ch+ht(Xe).length)):Qe&&Al&&Al.lineWise&&Al.text.join(`
|
|
`)==Xe.join(`
|
|
`)&&(qi=cr=$t(qi.line,0)));var Br={from:qi,to:cr,text:xt?xt[zn%xt.length]:Xe,origin:me||(Qe?"paste":ie.state.cutIncoming>Ge?"cut":"+input")};Ou(ie.doc,Br),Kr(ie,"inputRead",ie,Br)}ae&&!Qe&&pg(ie,ae),Rl(ie),ie.curOp.updateInput<2&&(ie.curOp.updateInput=Ft),ie.curOp.typing=!0,ie.state.pasteIncoming=ie.state.cutIncoming=-1}function gg(ie,ae){var fe=ie.clipboardData&&ie.clipboardData.getData("Text");if(fe)return ie.preventDefault(),!ae.isReadOnly()&&!ae.options.disableInput&&gr(ae,function(){return Sd(ae,fe,0,null,"paste")}),!0}function pg(ie,ae){if(!(!ie.options.electricChars||!ie.options.smartIndent))for(var fe=ie.doc.sel,ce=fe.ranges.length-1;ce>=0;ce--){var me=fe.ranges[ce];if(!(me.head.ch>100||ce&&fe.ranges[ce-1].head.line==me.head.line)){var ke=ie.getModeAt(me.head),Ge=!1;if(ke.electricChars){for(var Qe=0;Qe<ke.electricChars.length;Qe++)if(ae.indexOf(ke.electricChars.charAt(Qe))>-1){Ge=rl(ie,me.head.line,"smart");break}}else ke.electricInput&&ke.electricInput.test(Yn(ie.doc,me.head.line).text.slice(0,me.head.ch))&&(Ge=rl(ie,me.head.line,"smart"));Ge&&Kr(ie,"electricInput",ie,me.head.line)}}}function mg(ie){for(var ae=[],fe=[],ce=0;ce<ie.doc.sel.ranges.length;ce++){var me=ie.doc.sel.ranges[ce].head.line,ke={anchor:$t(me,0),head:$t(me+1,0)};fe.push(ke),ae.push(ie.getRange(ke.anchor,ke.head))}return{text:ae,ranges:fe}}function vg(ie,ae,fe,ce){ie.setAttribute("autocorrect",fe?"":"off"),ie.setAttribute("autocapitalize",ce?"":"off"),ie.setAttribute("spellcheck",!!ae)}function yg(){var ie=Ye("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),ae=Ye("div",[ie],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return at?ie.style.width="1000px":ie.setAttribute("wrap","off"),De&&(ie.style.border="1px solid black"),vg(ie),ae}function Hh(ie){var ae=ie.optionHandlers,fe=ie.helpers={};ie.prototype={constructor:ie,focus:function(){window.focus(),this.display.input.focus()},setOption:function(ce,me){var ke=this.options,Ge=ke[ce];ke[ce]==me&&ce!="mode"||(ke[ce]=me,ae.hasOwnProperty(ce)&&_o(this,ae[ce])(this,me,Ge),Qt(this,"optionChange",this,ce))},getOption:function(ce){return this.options[ce]},getDoc:function(){return this.doc},addKeyMap:function(ce,me){this.state.keyMaps[me?"push":"unshift"](gd(ce))},removeKeyMap:function(ce){for(var me=this.state.keyMaps,ke=0;ke<me.length;++ke)if(me[ke]==ce||me[ke].name==ce)return me.splice(ke,1),!0},addOverlay:io(function(ce,me){var ke=ce.token?ce:ie.getMode(this.options,ce);if(ke.startState)throw new Error("Overlays may not be stateful.");Oi(this.state.overlays,{mode:ke,modeSpec:ce,opaque:me&&me.opaque,priority:me&&me.priority||0},function(Ge){return Ge.priority}),this.state.modeGen++,Si(this)}),removeOverlay:io(function(ce){for(var me=this.state.overlays,ke=0;ke<me.length;++ke){var Ge=me[ke].modeSpec;if(Ge==ce||typeof ce=="string"&&Ge.name==ce){me.splice(ke,1),this.state.modeGen++,Si(this);return}}}),indentLine:io(function(ce,me,ke){typeof me!="string"&&typeof me!="number"&&(me==null?me=this.options.smartIndent?"smart":"prev":me=me?"add":"subtract"),_n(this.doc,ce)&&rl(this,ce,me,ke)}),indentSelection:io(function(ce){for(var me=this.doc.sel.ranges,ke=-1,Ge=0;Ge<me.length;Ge++){var Qe=me[Ge];if(Qe.empty())Qe.head.line>ke&&(rl(this,Qe.head.line,ce,!0),ke=Qe.head.line,Ge==this.doc.sel.primIndex&&Rl(this));else{var Xe=Qe.from(),xt=Qe.to(),an=Math.max(ke,Xe.line);ke=Math.min(this.lastLine(),xt.line-(xt.ch?0:1))+1;for(var Ft=an;Ft<ke;++Ft)rl(this,Ft,ce);var zn=this.doc.sel.ranges;Xe.ch==0&&me.length==zn.length&&zn[Ge].from().ch>0&&Eu(this.doc,Ge,new us(Xe,zn[Ge].to()),Rt)}}}),getTokenAt:function(ce,me){return Pr(this,ce,me)},getLineTokens:function(ce,me){return Pr(this,$t(ce),me,!0)},getTokenTypeAt:function(ce){ce=Fi(this.doc,ce);var me=Gr(this,Yn(this.doc,ce.line)),ke=0,Ge=(me.length-1)/2,Qe=ce.ch,Xe;if(Qe==0)Xe=me[2];else for(;;){var xt=ke+Ge>>1;if((xt?me[xt*2-1]:0)>=Qe)Ge=xt;else if(me[xt*2+1]<Qe)ke=xt+1;else{Xe=me[xt*2+2];break}}var an=Xe?Xe.indexOf("overlay "):-1;return an<0?Xe:an==0?null:Xe.slice(0,an-1)},getModeAt:function(ce){var me=this.doc.mode;return me.innerMode?ie.innerMode(me,this.getTokenAt(ce).state).mode:me},getHelper:function(ce,me){return this.getHelpers(ce,me)[0]},getHelpers:function(ce,me){var ke=[];if(!fe.hasOwnProperty(me))return ke;var Ge=fe[me],Qe=this.getModeAt(ce);if(typeof Qe[me]=="string")Ge[Qe[me]]&&ke.push(Ge[Qe[me]]);else if(Qe[me])for(var Xe=0;Xe<Qe[me].length;Xe++){var xt=Ge[Qe[me][Xe]];xt&&ke.push(xt)}else Qe.helperType&&Ge[Qe.helperType]?ke.push(Ge[Qe.helperType]):Ge[Qe.name]&&ke.push(Ge[Qe.name]);for(var an=0;an<Ge._global.length;an++){var Ft=Ge._global[an];Ft.pred(Qe,this)&&dn(ke,Ft.val)==-1&&ke.push(Ft.val)}return ke},getStateAfter:function(ce,me){var ke=this.doc;return ce=Ii(ke,ce==null?ke.first+ke.size-1:ce),So(this,ce+1,me).state},cursorCoords:function(ce,me){var ke,Ge=this.doc.sel.primary();return ce==null?ke=Ge.head:typeof ce=="object"?ke=Fi(this.doc,ce):ke=ce?Ge.from():Ge.to(),Xo(this,ke,me||"page")},charCoords:function(ce,me){return sa(this,Fi(this.doc,ce),me||"page")},coordsChar:function(ce,me){return ce=Fa(this,ce,me||"page"),Wa(this,ce.left,ce.top)},lineAtHeight:function(ce,me){return ce=Fa(this,{top:ce,left:0},me||"page").top,Lt(this.doc,ce+this.display.viewOffset)},heightAtLine:function(ce,me,ke){var Ge=!1,Qe;if(typeof ce=="number"){var Xe=this.doc.first+this.doc.size-1;ce<this.doc.first?ce=this.doc.first:ce>Xe&&(ce=Xe,Ge=!0),Qe=Yn(this.doc,ce)}else Qe=ce;return jr(this,Qe,{top:0,left:0},me||"page",ke||Ge).top+(Ge?this.doc.height-or(Qe):0)},defaultTextHeight:function(){return Ui(this.display)},defaultCharWidth:function(){return Un(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(ce,me,ke,Ge,Qe){var Xe=this.display;ce=Xo(this,Fi(this.doc,ce));var xt=ce.bottom,an=ce.left;if(me.style.position="absolute",me.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(me),Xe.sizer.appendChild(me),Ge=="over")xt=ce.top;else if(Ge=="above"||Ge=="near"){var Ft=Math.max(Xe.wrapper.clientHeight,this.doc.height),zn=Math.max(Xe.sizer.clientWidth,Xe.lineSpace.clientWidth);(Ge=="above"||ce.bottom+me.offsetHeight>Ft)&&ce.top>me.offsetHeight?xt=ce.top-me.offsetHeight:ce.bottom+me.offsetHeight<=Ft&&(xt=ce.bottom),an+me.offsetWidth>zn&&(an=zn-me.offsetWidth)}me.style.top=xt+"px",me.style.left=me.style.right="",Qe=="right"?(an=Xe.sizer.clientWidth-me.offsetWidth,me.style.right="0px"):(Qe=="left"?an=0:Qe=="middle"&&(an=(Xe.sizer.clientWidth-me.offsetWidth)/2),me.style.left=an+"px"),ke&&rs(this,{left:an,top:xt,right:an+me.offsetWidth,bottom:xt+me.offsetHeight})},triggerOnKeyDown:io(ig),triggerOnKeyPress:io(Xu),triggerOnKeyUp:og,triggerOnMouseDown:io(Ju),execCommand:function(ce){if(zh.hasOwnProperty(ce))return zh[ce].call(null,this)},triggerElectric:io(function(ce){pg(this,ce)}),findPosH:function(ce,me,ke,Ge){var Qe=1;me<0&&(Qe=-1,me=-me);for(var Xe=Fi(this.doc,ce),xt=0;xt<me&&(Xe=Ac(this.doc,Xe,Qe,ke,Ge),!Xe.hitSide);++xt);return Xe},moveH:io(function(ce,me){var ke=this;this.extendSelectionsBy(function(Ge){return ke.display.shift||ke.doc.extend||Ge.empty()?Ac(ke.doc,Ge.head,ce,me,ke.options.rtlMoveVisually):ce<0?Ge.from():Ge.to()},Bn)}),deleteH:io(function(ce,me){var ke=this.doc.sel,Ge=this.doc;ke.somethingSelected()?Ge.replaceSelection("",null,"+delete"):Wl(this,function(Qe){var Xe=Ac(Ge,Qe.head,ce,me,!1);return ce<0?{from:Xe,to:Qe.head}:{from:Qe.head,to:Xe}})}),findPosV:function(ce,me,ke,Ge){var Qe=1,Xe=Ge;me<0&&(Qe=-1,me=-me);for(var xt=Fi(this.doc,ce),an=0;an<me;++an){var Ft=Xo(this,xt,"div");if(Xe==null?Xe=Ft.left:Ft.left=Xe,xt=Bh(this,Ft,Qe,ke),xt.hitSide)break}return xt},moveV:io(function(ce,me){var ke=this,Ge=this.doc,Qe=[],Xe=!this.display.shift&&!Ge.extend&&Ge.sel.somethingSelected();if(Ge.extendSelectionsBy(function(an){if(Xe)return ce<0?an.from():an.to();var Ft=Xo(ke,an.head,"div");an.goalColumn!=null&&(Ft.left=an.goalColumn),Qe.push(Ft.left);var zn=Bh(ke,Ft,ce,me);return me=="page"&&an==Ge.sel.primary()&&su(ke,sa(ke,zn,"div").top-Ft.top),zn},Bn),Qe.length)for(var xt=0;xt<Ge.sel.ranges.length;xt++)Ge.sel.ranges[xt].goalColumn=Qe[xt]}),findWordAt:function(ce){var me=this.doc,ke=Yn(me,ce.line).text,Ge=ce.ch,Qe=ce.ch;if(ke){var Xe=this.getHelper(ce,"wordChars");(ce.sticky=="before"||Qe==ke.length)&&Ge?--Ge:++Qe;for(var xt=ke.charAt(Ge),an=He(xt,Xe)?function(Ft){return He(Ft,Xe)}:/\s/.test(xt)?function(Ft){return/\s/.test(Ft)}:function(Ft){return!/\s/.test(Ft)&&!He(Ft)};Ge>0&&an(ke.charAt(Ge-1));)--Ge;for(;Qe<ke.length&&an(ke.charAt(Qe));)++Qe}return new us($t(ce.line,Ge),$t(ce.line,Qe))},toggleOverwrite:function(ce){ce!=null&&ce==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Bt(this.display.cursorDiv,"CodeMirror-overwrite"):Ze(this.display.cursorDiv,"CodeMirror-overwrite"),Qt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Pt()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:io(function(ce,me){lu(this,ce,me)}),getScrollInfo:function(){var ce=this.display.scroller;return{left:ce.scrollLeft,top:ce.scrollTop,height:ce.scrollHeight-Ei(this)-this.display.barHeight,width:ce.scrollWidth-Ei(this)-this.display.barWidth,clientHeight:wi(this),clientWidth:Mi(this)}},scrollIntoView:io(function(ce,me){ce==null?(ce={from:this.doc.sel.primary().head,to:null},me==null&&(me=this.options.cursorScrollMargin)):typeof ce=="number"?ce={from:$t(ce,0),to:null}:ce.from==null&&(ce={from:ce,to:null}),ce.to||(ce.to=ce.from),ce.margin=me||0,ce.from.line!=null?Da(this,ce):jl(this,ce.from,ce.to,ce.margin)}),setSize:io(function(ce,me){var ke=this,Ge=function(Xe){return typeof Xe=="number"||/^\d+$/.test(String(Xe))?Xe+"px":Xe};ce!=null&&(this.display.wrapper.style.width=Ge(ce)),me!=null&&(this.display.wrapper.style.height=Ge(me)),this.options.lineWrapping&&Ma(this);var Qe=this.display.viewFrom;this.doc.iter(Qe,this.display.viewTo,function(Xe){if(Xe.widgets){for(var xt=0;xt<Xe.widgets.length;xt++)if(Xe.widgets[xt].noHScroll){Pi(ke,Qe,"widget");break}}++Qe}),this.curOp.forceUpdate=!0,Qt(this,"refresh",this)}),operation:function(ce){return gr(this,ce)},startOperation:function(){return zl(this)},endOperation:function(){return uu(this)},refresh:io(function(){var ce=this.display.cachedTextHeight;Si(this),this.curOp.forceUpdate=!0,za(this),lu(this,this.doc.scrollLeft,this.doc.scrollTop),sl(this.display),(ce==null||Math.abs(ce-Ui(this.display))>.5||this.options.lineWrapping)&&Er(this),Qt(this,"refresh",this)}),swapDoc:io(function(ce){var me=this.doc;return me.cm=null,this.state.selectingText&&this.state.selectingText(),lf(this,ce),za(this),this.display.input.reset(),lu(this,ce.scrollLeft,ce.scrollTop),this.curOp.forceScroll=!0,Kr(this,"swapDoc",this,me),me}),phrase:function(ce){var me=this.options.phrases;return me&&Object.prototype.hasOwnProperty.call(me,ce)?me[ce]:ce},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}},Yt(ie),ie.registerHelper=function(ce,me,ke){fe.hasOwnProperty(ce)||(fe[ce]=ie[ce]={_global:[]}),fe[ce][me]=ke},ie.registerGlobalHelper=function(ce,me,ke,Ge){ie.registerHelper(ce,me,Ge),fe[ce]._global.push({pred:ke,val:Ge})}}function Ac(ie,ae,fe,ce,me){var ke=ae,Ge=fe,Qe=Yn(ie,ae.line),Xe=me&&ie.direction=="rtl"?-fe:fe;function xt(){var No=ae.line+Xe;return No<ie.first||No>=ie.first+ie.size?!1:(ae=new $t(No,ae.ch,ae.sticky),Qe=Yn(ie,No))}function an(No){var co;if(ce=="codepoint"){var zo=Qe.text.charCodeAt(ae.ch+(ce>0?0:-1));isNaN(zo)?co=null:co=new $t(ae.line,Math.max(0,Math.min(Qe.text.length,ae.ch+fe*(zo>=55296&&zo<56320?2:1))),-fe)}else me?co=Ef(ie.cm,Qe,ae,fe):co=Gs(Qe,ae,fe);if(co==null)if(!No&&xt())ae=hh(me,ie.cm,Qe,ae.line,Xe);else return!1;else ae=co;return!0}if(ce=="char"||ce=="codepoint")an();else if(ce=="column")an(!0);else if(ce=="word"||ce=="group")for(var Ft=null,zn=ce=="group",Mn=ie.cm&&ie.cm.getHelper(ae,"wordChars"),qi=!0;!(fe<0&&!an(!qi));qi=!1){var cr=Qe.text.charAt(ae.ch)||`
|
|
`,Br=He(cr,Mn)?"w":zn&&cr==`
|
|
`?"n":!zn||/\s/.test(cr)?null:"p";if(zn&&!qi&&!Br&&(Br="s"),Ft&&Ft!=Br){fe<0&&(fe=1,an(),ae.sticky="after");break}if(Br&&(Ft=Br),fe>0&&!an(!qi))break}var $r=cd(ie,ae,ke,Ge,!0);return Xt(ke,$r)&&($r.hitSide=!0),$r}function Bh(ie,ae,fe,ce){var me=ie.doc,ke=ae.left,Ge;if(ce=="page"){var Qe=Math.min(ie.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Xe=Math.max(Qe-.5*Ui(ie.display),3);Ge=(fe>0?ae.bottom:ae.top)+fe*Xe}else ce=="line"&&(Ge=fe>0?ae.bottom+3:ae.top-3);for(var xt;xt=Wa(ie,ke,Ge),!!xt.outside;){if(fe<0?Ge<=0:Ge>=me.height){xt.hitSide=!0;break}Ge+=fe*5}return xt}var os=function(ie){this.cm=ie,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new rt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};os.prototype.init=function(ie){var ae=this,fe=this,ce=fe.cm,me=fe.div=ie.lineDiv;vg(me,ce.options.spellcheck,ce.options.autocorrect,ce.options.autocapitalize);function ke(Qe){for(var Xe=Qe.target;Xe;Xe=Xe.parentNode){if(Xe==me)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Xe.className))break}return!1}Dn(me,"paste",function(Qe){!ke(Qe)||ln(ce,Qe)||gg(Qe,ce)||Oe<=11&&setTimeout(_o(ce,function(){return ae.updateFromDOM()}),20)}),Dn(me,"compositionstart",function(Qe){ae.composing={data:Qe.data,done:!1}}),Dn(me,"compositionupdate",function(Qe){ae.composing||(ae.composing={data:Qe.data,done:!1})}),Dn(me,"compositionend",function(Qe){ae.composing&&(Qe.data!=ae.composing.data&&ae.readFromDOMSoon(),ae.composing.done=!0)}),Dn(me,"touchstart",function(){return fe.forceCompositionEnd()}),Dn(me,"input",function(){ae.composing||ae.readFromDOMSoon()});function Ge(Qe){if(!(!ke(Qe)||ln(ce,Qe))){if(ce.somethingSelected())Yd({lineWise:!1,text:ce.getSelections()}),Qe.type=="cut"&&ce.replaceSelection("",null,"cut");else if(ce.options.lineWiseCopyCut){var Xe=mg(ce);Yd({lineWise:!0,text:Xe.text}),Qe.type=="cut"&&ce.operation(function(){ce.setSelections(Xe.ranges,0,Rt),ce.replaceSelection("",null,"cut")})}else return;if(Qe.clipboardData){Qe.clipboardData.clearData();var xt=Al.text.join(`
|
|
`);if(Qe.clipboardData.setData("Text",xt),Qe.clipboardData.getData("Text")==xt){Qe.preventDefault();return}}var an=yg(),Ft=an.firstChild;ce.display.lineSpace.insertBefore(an,ce.display.lineSpace.firstChild),Ft.value=Al.text.join(`
|
|
`);var zn=document.activeElement;qt(Ft),setTimeout(function(){ce.display.lineSpace.removeChild(an),zn.focus(),zn==me&&fe.showPrimarySelection()},50)}}Dn(me,"copy",Ge),Dn(me,"cut",Ge)},os.prototype.screenReaderLabelChanged=function(ie){ie?this.div.setAttribute("aria-label",ie):this.div.removeAttribute("aria-label")},os.prototype.prepareSelection=function(){var ie=Qr(this.cm,!1);return ie.focus=document.activeElement==this.div,ie},os.prototype.showSelection=function(ie,ae){!ie||!this.cm.display.view.length||((ie.focus||ae)&&this.showPrimarySelection(),this.showMultipleSelections(ie))},os.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},os.prototype.showPrimarySelection=function(){var ie=this.getSelection(),ae=this.cm,fe=ae.doc.sel.primary(),ce=fe.from(),me=fe.to();if(ae.display.viewTo==ae.display.viewFrom||ce.line>=ae.display.viewTo||me.line<ae.display.viewFrom){ie.removeAllRanges();return}var ke=Nc(ae,ie.anchorNode,ie.anchorOffset),Ge=Nc(ae,ie.focusNode,ie.focusOffset);if(!(ke&&!ke.bad&&Ge&&!Ge.bad&&xn(gi(ke,Ge),ce)==0&&xn(Hi(ke,Ge),me)==0)){var Qe=ae.display.view,Xe=ce.line>=ae.display.viewFrom&&wd(ae,ce)||{node:Qe[0].measure.map[2],offset:0},xt=me.line<ae.display.viewTo&&wd(ae,me);if(!xt){var an=Qe[Qe.length-1].measure,Ft=an.maps?an.maps[an.maps.length-1]:an.map;xt={node:Ft[Ft.length-1],offset:Ft[Ft.length-2]-Ft[Ft.length-3]}}if(!Xe||!xt){ie.removeAllRanges();return}var zn=ie.rangeCount&&ie.getRangeAt(0),Mn;try{Mn=$e(Xe.node,Xe.offset,xt.offset,xt.node)}catch(qi){}Mn&&(!le&&ae.state.focused?(ie.collapse(Xe.node,Xe.offset),Mn.collapsed||(ie.removeAllRanges(),ie.addRange(Mn))):(ie.removeAllRanges(),ie.addRange(Mn)),zn&&ie.anchorNode==null?ie.addRange(zn):le&&this.startGracePeriod()),this.rememberSelection()}},os.prototype.startGracePeriod=function(){var ie=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){ie.gracePeriod=!1,ie.selectionChanged()&&ie.cm.operation(function(){return ie.cm.curOp.selectionChanged=!0})},20)},os.prototype.showMultipleSelections=function(ie){nt(this.cm.display.cursorDiv,ie.cursors),nt(this.cm.display.selectionDiv,ie.selection)},os.prototype.rememberSelection=function(){var ie=this.getSelection();this.lastAnchorNode=ie.anchorNode,this.lastAnchorOffset=ie.anchorOffset,this.lastFocusNode=ie.focusNode,this.lastFocusOffset=ie.focusOffset},os.prototype.selectionInEditor=function(){var ie=this.getSelection();if(!ie.rangeCount)return!1;var ae=ie.getRangeAt(0).commonAncestorContainer;return Et(this.div,ae)},os.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},os.prototype.blur=function(){this.div.blur()},os.prototype.getField=function(){return this.div},os.prototype.supportsTouch=function(){return!0},os.prototype.receivedFocus=function(){var ie=this;this.selectionInEditor()?this.pollSelection():gr(this.cm,function(){return ie.cm.curOp.selectionChanged=!0});function ae(){ie.cm.state.focused&&(ie.pollSelection(),ie.polling.set(ie.cm.options.pollInterval,ae))}this.polling.set(this.cm.options.pollInterval,ae)},os.prototype.selectionChanged=function(){var ie=this.getSelection();return ie.anchorNode!=this.lastAnchorNode||ie.anchorOffset!=this.lastAnchorOffset||ie.focusNode!=this.lastFocusNode||ie.focusOffset!=this.lastFocusOffset},os.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var ie=this.getSelection(),ae=this.cm;if(ne&&ot&&this.cm.display.gutterSpecs.length&&xg(ie.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var fe=Nc(ae,ie.anchorNode,ie.anchorOffset),ce=Nc(ae,ie.focusNode,ie.focusOffset);fe&&ce&&gr(ae,function(){cl(ae.doc,Fh(fe,ce),Rt),(fe.bad||ce.bad)&&(ae.curOp.selectionChanged=!0)})}}},os.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var ie=this.cm,ae=ie.display,fe=ie.doc.sel.primary(),ce=fe.from(),me=fe.to();if(ce.ch==0&&ce.line>ie.firstLine()&&(ce=$t(ce.line-1,Yn(ie.doc,ce.line-1).length)),me.ch==Yn(ie.doc,me.line).text.length&&me.line<ie.lastLine()&&(me=$t(me.line+1,0)),ce.line<ae.viewFrom||me.line>ae.viewTo-1)return!1;var ke,Ge,Qe;ce.line==ae.viewFrom||(ke=Wi(ie,ce.line))==0?(Ge=Ke(ae.view[0].line),Qe=ae.view[0].node):(Ge=Ke(ae.view[ke].line),Qe=ae.view[ke-1].node.nextSibling);var Xe=Wi(ie,me.line),xt,an;if(Xe==ae.view.length-1?(xt=ae.viewTo-1,an=ae.lineDiv.lastChild):(xt=Ke(ae.view[Xe+1].line)-1,an=ae.view[Xe+1].node.previousSibling),!Qe)return!1;for(var Ft=ie.doc.splitLines(Pd(ie,Qe,an,Ge,xt)),zn=Qi(ie.doc,$t(Ge,0),$t(xt,Yn(ie.doc,xt).text.length));Ft.length>1&&zn.length>1;)if(ht(Ft)==ht(zn))Ft.pop(),zn.pop(),xt--;else if(Ft[0]==zn[0])Ft.shift(),zn.shift(),Ge++;else break;for(var Mn=0,qi=0,cr=Ft[0],Br=zn[0],$r=Math.min(cr.length,Br.length);Mn<$r&&cr.charCodeAt(Mn)==Br.charCodeAt(Mn);)++Mn;for(var No=ht(Ft),co=ht(zn),zo=Math.min(No.length-(Ft.length==1?Mn:0),co.length-(zn.length==1?Mn:0));qi<zo&&No.charCodeAt(No.length-qi-1)==co.charCodeAt(co.length-qi-1);)++qi;if(Ft.length==1&&zn.length==1&&Ge==ce.line)for(;Mn&&Mn>ce.ch&&No.charCodeAt(No.length-qi-1)==co.charCodeAt(co.length-qi-1);)Mn--,qi++;Ft[Ft.length-1]=No.slice(0,No.length-qi).replace(/^\u200b+/,""),Ft[0]=Ft[0].slice(Mn).replace(/\u200b+$/,"");var va=$t(Ge,Mn),fo=$t(xt,zn.length?ht(zn).length-qi:0);if(Ft.length>1||Ft[0]||xn(va,fo))return Ku(ie.doc,Ft,va,fo,"+input"),!0},os.prototype.ensurePolled=function(){this.forceCompositionEnd()},os.prototype.reset=function(){this.forceCompositionEnd()},os.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},os.prototype.readFromDOMSoon=function(){var ie=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(ie.readDOMTimeout=null,ie.composing)if(ie.composing.done)ie.composing=null;else return;ie.updateFromDOM()},80))},os.prototype.updateFromDOM=function(){var ie=this;(this.cm.isReadOnly()||!this.pollContent())&&gr(this.cm,function(){return Si(ie.cm)})},os.prototype.setUneditable=function(ie){ie.contentEditable="false"},os.prototype.onKeyPress=function(ie){ie.charCode==0||this.composing||(ie.preventDefault(),this.cm.isReadOnly()||_o(this.cm,Sd)(this.cm,String.fromCharCode(ie.charCode==null?ie.keyCode:ie.charCode),0))},os.prototype.readOnlyChanged=function(ie){this.div.contentEditable=String(ie!="nocursor")},os.prototype.onContextMenu=function(){},os.prototype.resetPosition=function(){},os.prototype.needsContentAttribute=!0;function wd(ie,ae){var fe=Vo(ie,ae.line);if(!fe||fe.hidden)return null;var ce=Yn(ie.doc,ae.line),me=ti(fe,ce,ae.line),ke=Sn(ce,ie.doc.direction),Ge="left";if(ke){var Qe=Ot(ke,ae.ch);Ge=Qe%2?"right":"left"}var Xe=mo(me.map,ae.ch,Ge);return Xe.offset=Xe.collapse=="right"?Xe.end:Xe.start,Xe}function xg(ie){for(var ae=ie;ae;ae=ae.parentNode)if(/CodeMirror-gutter-wrapper/.test(ae.className))return!0;return!1}function Vh(ie,ae){return ae&&(ie.bad=!0),ie}function Pd(ie,ae,fe,ce,me){var ke="",Ge=!1,Qe=ie.doc.lineSeparator(),Xe=!1;function xt(Mn){return function(qi){return qi.id==Mn}}function an(){Ge&&(ke+=Qe,Xe&&(ke+=Qe),Ge=Xe=!1)}function Ft(Mn){Mn&&(an(),ke+=Mn)}function zn(Mn){if(Mn.nodeType==1){var qi=Mn.getAttribute("cm-text");if(qi){Ft(qi);return}var cr=Mn.getAttribute("cm-marker"),Br;if(cr){var $r=ie.findMarks($t(ce,0),$t(me+1,0),xt(+cr));$r.length&&(Br=$r[0].find(0))&&Ft(Qi(ie.doc,Br.from,Br.to).join(Qe));return}if(Mn.getAttribute("contenteditable")=="false")return;var No=/^(pre|div|p|li|table|br)$/i.test(Mn.nodeName);if(!/^br$/i.test(Mn.nodeName)&&Mn.textContent.length==0)return;No&&an();for(var co=0;co<Mn.childNodes.length;co++)zn(Mn.childNodes[co]);/^(pre|p)$/i.test(Mn.nodeName)&&(Xe=!0),No&&(Ge=!0)}else Mn.nodeType==3&&Ft(Mn.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;zn(ae),ae!=fe;)ae=ae.nextSibling,Xe=!1;return ke}function Nc(ie,ae,fe){var ce;if(ae==ie.display.lineDiv){if(ce=ie.display.lineDiv.childNodes[fe],!ce)return Vh(ie.clipPos($t(ie.display.viewTo-1)),!0);ae=null,fe=0}else for(ce=ae;;ce=ce.parentNode){if(!ce||ce==ie.display.lineDiv)return null;if(ce.parentNode&&ce.parentNode==ie.display.lineDiv)break}for(var me=0;me<ie.display.view.length;me++){var ke=ie.display.view[me];if(ke.node==ce)return tp(ke,ae,fe)}}function tp(ie,ae,fe){var ce=ie.text.firstChild,me=!1;if(!ae||!Et(ce,ae))return Vh($t(Ke(ie.line),0),!0);if(ae==ce&&(me=!0,ae=ce.childNodes[fe],fe=0,!ae)){var ke=ie.rest?ht(ie.rest):ie.line;return Vh($t(Ke(ke),ke.text.length),me)}var Ge=ae.nodeType==3?ae:null,Qe=ae;for(!Ge&&ae.childNodes.length==1&&ae.firstChild.nodeType==3&&(Ge=ae.firstChild,fe&&(fe=Ge.nodeValue.length));Qe.parentNode!=ce;)Qe=Qe.parentNode;var Xe=ie.measure,xt=Xe.maps;function an(Br,$r,No){for(var co=-1;co<(xt?xt.length:0);co++)for(var zo=co<0?Xe.map:xt[co],va=0;va<zo.length;va+=3){var fo=zo[va+2];if(fo==Br||fo==$r){var ja=Ke(co<0?ie.line:ie.rest[co]),ys=zo[va]+No;return(No<0||fo!=Br)&&(ys=zo[va+(No?1:0)]),$t(ja,ys)}}}var Ft=an(Ge,Qe,fe);if(Ft)return Vh(Ft,me);for(var zn=Qe.nextSibling,Mn=Ge?Ge.nodeValue.length-fe:0;zn;zn=zn.nextSibling){if(Ft=an(zn,zn.firstChild,0),Ft)return Vh($t(Ft.line,Ft.ch-Mn),me);Mn+=zn.textContent.length}for(var qi=Qe.previousSibling,cr=fe;qi;qi=qi.previousSibling){if(Ft=an(qi,qi.firstChild,-1),Ft)return Vh($t(Ft.line,Ft.ch+cr),me);cr+=qi.textContent.length}}var Qs=function(ie){this.cm=ie,this.prevInput="",this.pollingFast=!1,this.polling=new rt,this.hasSelection=!1,this.composing=null};Qs.prototype.init=function(ie){var ae=this,fe=this,ce=this.cm;this.createField(ie);var me=this.textarea;ie.wrapper.insertBefore(this.wrapper,ie.wrapper.firstChild),De&&(me.style.width="0px"),Dn(me,"input",function(){yt&&Oe>=9&&ae.hasSelection&&(ae.hasSelection=null),fe.poll()}),Dn(me,"paste",function(Ge){ln(ce,Ge)||gg(Ge,ce)||(ce.state.pasteIncoming=+new Date,fe.fastPoll())});function ke(Ge){if(!ln(ce,Ge)){if(ce.somethingSelected())Yd({lineWise:!1,text:ce.getSelections()});else if(ce.options.lineWiseCopyCut){var Qe=mg(ce);Yd({lineWise:!0,text:Qe.text}),Ge.type=="cut"?ce.setSelections(Qe.ranges,null,Rt):(fe.prevInput="",me.value=Qe.text.join(`
|
|
`),qt(me))}else return;Ge.type=="cut"&&(ce.state.cutIncoming=+new Date)}}Dn(me,"cut",ke),Dn(me,"copy",ke),Dn(ie.scroller,"paste",function(Ge){if(!(Ut(ie,Ge)||ln(ce,Ge))){if(!me.dispatchEvent){ce.state.pasteIncoming=+new Date,fe.focus();return}var Qe=new Event("paste");Qe.clipboardData=Ge.clipboardData,me.dispatchEvent(Qe)}}),Dn(ie.lineSpace,"selectstart",function(Ge){Ut(ie,Ge)||ii(Ge)}),Dn(me,"compositionstart",function(){var Ge=ce.getCursor("from");fe.composing&&fe.composing.range.clear(),fe.composing={start:Ge,range:ce.markText(Ge,ce.getCursor("to"),{className:"CodeMirror-composing"})}}),Dn(me,"compositionend",function(){fe.composing&&(fe.poll(),fe.composing.range.clear(),fe.composing=null)})},Qs.prototype.createField=function(ie){this.wrapper=yg(),this.textarea=this.wrapper.firstChild},Qs.prototype.screenReaderLabelChanged=function(ie){ie?this.textarea.setAttribute("aria-label",ie):this.textarea.removeAttribute("aria-label")},Qs.prototype.prepareSelection=function(){var ie=this.cm,ae=ie.display,fe=ie.doc,ce=Qr(ie);if(ie.options.moveInputWithCursor){var me=Xo(ie,fe.sel.primary().head,"div"),ke=ae.wrapper.getBoundingClientRect(),Ge=ae.lineDiv.getBoundingClientRect();ce.teTop=Math.max(0,Math.min(ae.wrapper.clientHeight-10,me.top+Ge.top-ke.top)),ce.teLeft=Math.max(0,Math.min(ae.wrapper.clientWidth-10,me.left+Ge.left-ke.left))}return ce},Qs.prototype.showSelection=function(ie){var ae=this.cm,fe=ae.display;nt(fe.cursorDiv,ie.cursors),nt(fe.selectionDiv,ie.selection),ie.teTop!=null&&(this.wrapper.style.top=ie.teTop+"px",this.wrapper.style.left=ie.teLeft+"px")},Qs.prototype.reset=function(ie){if(!(this.contextMenuPending||this.composing)){var ae=this.cm;if(ae.somethingSelected()){this.prevInput="";var fe=ae.getSelection();this.textarea.value=fe,ae.state.focused&&qt(this.textarea),yt&&Oe>=9&&(this.hasSelection=fe)}else ie||(this.prevInput=this.textarea.value="",yt&&Oe>=9&&(this.hasSelection=null))}},Qs.prototype.getField=function(){return this.textarea},Qs.prototype.supportsTouch=function(){return!1},Qs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!te||Pt()!=this.textarea))try{this.textarea.focus()}catch(ie){}},Qs.prototype.blur=function(){this.textarea.blur()},Qs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Qs.prototype.receivedFocus=function(){this.slowPoll()},Qs.prototype.slowPoll=function(){var ie=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){ie.poll(),ie.cm.state.focused&&ie.slowPoll()})},Qs.prototype.fastPoll=function(){var ie=!1,ae=this;ae.pollingFast=!0;function fe(){var ce=ae.poll();!ce&&!ie?(ie=!0,ae.polling.set(60,fe)):(ae.pollingFast=!1,ae.slowPoll())}ae.polling.set(20,fe)},Qs.prototype.poll=function(){var ie=this,ae=this.cm,fe=this.textarea,ce=this.prevInput;if(this.contextMenuPending||!ae.state.focused||be(fe)&&!ce&&!this.composing||ae.isReadOnly()||ae.options.disableInput||ae.state.keySeq)return!1;var me=fe.value;if(me==ce&&!ae.somethingSelected())return!1;if(yt&&Oe>=9&&this.hasSelection===me||de&&/[\uf700-\uf7ff]/.test(me))return ae.display.input.reset(),!1;if(ae.doc.sel==ae.display.selForContextMenu){var ke=me.charCodeAt(0);if(ke==8203&&!ce&&(ce="\u200B"),ke==8666)return this.reset(),this.cm.execCommand("undo")}for(var Ge=0,Qe=Math.min(ce.length,me.length);Ge<Qe&&ce.charCodeAt(Ge)==me.charCodeAt(Ge);)++Ge;return gr(ae,function(){Sd(ae,me.slice(Ge),ce.length-Ge,null,ie.composing?"*compose":null),me.length>1e3||me.indexOf(`
|
|
`)>-1?fe.value=ie.prevInput="":ie.prevInput=me,ie.composing&&(ie.composing.range.clear(),ie.composing.range=ae.markText(ie.composing.start,ae.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Qs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Qs.prototype.onKeyPress=function(){yt&&Oe>=9&&(this.hasSelection=null),this.fastPoll()},Qs.prototype.onContextMenu=function(ie){var ae=this,fe=ae.cm,ce=fe.display,me=ae.textarea;ae.contextMenuPending&&ae.contextMenuPending();var ke=Eo(fe,ie),Ge=ce.scroller.scrollTop;if(!ke||We)return;var Qe=fe.options.resetSelectionOnContextMenu;Qe&&fe.doc.sel.contains(ke)==-1&&_o(fe,cl)(fe.doc,Fh(ke),Rt);var Xe=me.style.cssText,xt=ae.wrapper.style.cssText,an=ae.wrapper.offsetParent.getBoundingClientRect();ae.wrapper.style.cssText="position: static",me.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(ie.clientY-an.top-5)+"px; left: "+(ie.clientX-an.left-5)+`px;
|
|
z-index: 1000; background: `+(yt?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ft;at&&(Ft=window.scrollY),ce.input.focus(),at&&window.scrollTo(null,Ft),ce.input.reset(),fe.somethingSelected()||(me.value=ae.prevInput=" "),ae.contextMenuPending=Mn,ce.selForContextMenu=fe.doc.sel,clearTimeout(ce.detectingSelectAll);function zn(){if(me.selectionStart!=null){var cr=fe.somethingSelected(),Br="\u200B"+(cr?me.value:"");me.value="\u21DA",me.value=Br,ae.prevInput=cr?"":"\u200B",me.selectionStart=1,me.selectionEnd=Br.length,ce.selForContextMenu=fe.doc.sel}}function Mn(){if(ae.contextMenuPending==Mn&&(ae.contextMenuPending=!1,ae.wrapper.style.cssText=xt,me.style.cssText=Xe,yt&&Oe<9&&ce.scrollbars.setScrollTop(ce.scroller.scrollTop=Ge),me.selectionStart!=null)){(!yt||yt&&Oe<9)&&zn();var cr=0,Br=function(){ce.selForContextMenu==fe.doc.sel&&me.selectionStart==0&&me.selectionEnd>0&&ae.prevInput=="\u200B"?_o(fe,Zs)(fe):cr++<10?ce.detectingSelectAll=setTimeout(Br,500):(ce.selForContextMenu=null,ce.input.reset())};ce.detectingSelectAll=setTimeout(Br,200)}}if(yt&&Oe>=9&&zn(),Ce){Di(ie);var qi=function(){en(window,"mouseup",qi),setTimeout(Mn,20)};Dn(window,"mouseup",qi)}else setTimeout(Mn,50)},Qs.prototype.readOnlyChanged=function(ie){ie||this.reset(),this.textarea.disabled=ie=="nocursor",this.textarea.readOnly=!!ie},Qs.prototype.setUneditable=function(){},Qs.prototype.needsContentAttribute=!1;function np(ie,ae){if(ae=ae?tn(ae):{},ae.value=ie.value,!ae.tabindex&&ie.tabIndex&&(ae.tabindex=ie.tabIndex),!ae.placeholder&&ie.placeholder&&(ae.placeholder=ie.placeholder),ae.autofocus==null){var fe=Pt();ae.autofocus=fe==ie||ie.getAttribute("autofocus")!=null&&fe==document.body}function ce(){ie.value=Qe.getValue()}var me;if(ie.form&&(Dn(ie.form,"submit",ce),!ae.leaveSubmitMethodAlone)){var ke=ie.form;me=ke.submit;try{var Ge=ke.submit=function(){ce(),ke.submit=me,ke.submit(),ke.submit=Ge}}catch(Xe){}}ae.finishInit=function(Xe){Xe.save=ce,Xe.getTextArea=function(){return ie},Xe.toTextArea=function(){Xe.toTextArea=isNaN,ce(),ie.parentNode.removeChild(Xe.getWrapperElement()),ie.style.display="",ie.form&&(en(ie.form,"submit",ce),!ae.leaveSubmitMethodAlone&&typeof ie.form.submit=="function"&&(ie.form.submit=me))}},ie.style.display="none";var Qe=Ja(function(Xe){return ie.parentNode.insertBefore(Xe,ie.nextSibling)},ae);return Qe}function Kh(ie){ie.off=en,ie.on=Dn,ie.wheelEventPixels=hu,ie.Doc=Us,ie.splitLines=Fr,ie.countColumn=it,ie.findColumn=ui,ie.isWordChar=Te,ie.Pass=Kn,ie.signal=Qt,ie.Line=qo,ie.changeEnd=Oh,ie.scrollbarModel=Nu,ie.Pos=$t,ie.cmpPos=xn,ie.modes=oi,ie.mimeModes=ki,ie.resolveMode=ir,ie.getMode=Mt,ie.modeExtensions=_t,ie.extendMode=At,ie.copyState=xi,ie.startState=fi,ie.innerMode=mi,ie.commands=zh,ie.keyMap=eu,ie.keyName=eg,ie.isModifierKey=Lh,ie.lookupKey=fu,ie.normalizeKeyMap=qf,ie.StringStream=wn,ie.SharedTextMarker=Yu,ie.TextMarker=jt,ie.LineWidget=Uu,ie.e_preventDefault=ii,ie.e_stopPropagation=Vi,ie.e_stop=Di,ie.addClass=Bt,ie.contains=Et,ie.rmClass=Ze,ie.keyNames=uh}qg(Ja),Hh(Ja);var ch="iter insert remove copy getEditor constructor".split(" ");for(var Ed in Us.prototype)Us.prototype.hasOwnProperty(Ed)&&dn(ch,Ed)<0&&(Ja.prototype[Ed]=function(ie){return function(){return ie.apply(this.doc,arguments)}}(Us.prototype[Ed]));return Yt(Us),Ja.inputStyles={textarea:Qs,contenteditable:os},Ja.defineMode=function(ie){!Ja.defaults.mode&&ie!="null"&&(Ja.defaults.mode=ie),Ji.apply(this,arguments)},Ja.defineMIME=$i,Ja.defineMode("null",function(){return{token:function(ie){return ie.skipToEnd()}}}),Ja.defineMIME("text/plain","null"),Ja.defineExtension=function(ie,ae){Ja.prototype[ie]=ae},Ja.defineDocExtension=function(ie,ae){Us.prototype[ie]=ae},Ja.fromTextArea=np,Kh(Ja),Ja.version="5.58.2",Ja})},25419:function(Zn,ei,Le){(function(le){le(Le(89780),Le(15525),Le(98101))})(function(le){"use strict";le.defineMode("markdown",function(Ue,pt){var St=le.getMode(Ue,"text/html"),yt=St.name=="null";function Oe(it){if(le.findModeByName){var rt=le.findModeByName(it);rt&&(it=rt.mime||rt.mimes[0])}var dn=le.getMode(Ue,it);return dn.name=="null"?null:dn}pt.highlightFormatting===void 0&&(pt.highlightFormatting=!1),pt.maxBlockquoteDepth===void 0&&(pt.maxBlockquoteDepth=0),pt.taskLists===void 0&&(pt.taskLists=!1),pt.strikethrough===void 0&&(pt.strikethrough=!1),pt.emoji===void 0&&(pt.emoji=!1),pt.fencedCodeBlockHighlighting===void 0&&(pt.fencedCodeBlockHighlighting=!0),pt.fencedCodeBlockDefaultMode===void 0&&(pt.fencedCodeBlockDefaultMode="text/plain"),pt.xml===void 0&&(pt.xml=!0),pt.tokenTypeOverrides===void 0&&(pt.tokenTypeOverrides={});var at={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 Ct in at)at.hasOwnProperty(Ct)&&pt.tokenTypeOverrides[Ct]&&(at[Ct]=pt.tokenTypeOverrides[Ct]);var ot=/^([*\-_])(?:\s*\1){2,}\s*$/,We=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Tt=/^\[(x| )\](?=\s)/i,dt=pt.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,kt=/^ {0,3}(?:\={1,}|-{2,})\s*$/,De=/^[^#!\[\]*_\\<>` "'(~:]+/,ne=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,te=/^\s*\[[^\]]+?\]:.*$/,de=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,se=" ";function pe(it,rt,dn){return rt.f=rt.inline=dn,dn(it,rt)}function ye(it,rt,dn){return rt.f=rt.block=dn,dn(it,rt)}function we(it){return!it||!/\S/.test(it.string)}function Ce(it){if(it.linkTitle=!1,it.linkHref=!1,it.linkText=!1,it.em=!1,it.strong=!1,it.strikethrough=!1,it.quote=0,it.indentedCode=!1,it.f==Ze){var rt=yt;if(!rt){var dn=le.innerMode(St,it.htmlState);rt=dn.mode.name=="xml"&&dn.state.tagStart===null&&!dn.state.context&&dn.state.tokenize.isInText}rt&&(it.f=ct,it.block=_e,it.htmlState=null)}return it.trailingSpace=0,it.trailingSpaceNewLine=!1,it.prevLine=it.thisLine,it.thisLine={stream:null},null}function _e(it,rt){var dn=it.column()===rt.indentation,ni=we(rt.prevLine.stream),Kn=rt.indentedCode,Rt=rt.prevLine.hr,En=rt.list!==!1,Bn=(rt.listStack[rt.listStack.length-1]||0)+3;rt.indentedCode=!1;var ui=rt.indentation;if(rt.indentationDiff===null&&(rt.indentationDiff=rt.indentation,En)){for(rt.list=null;ui<rt.listStack[rt.listStack.length-1];)rt.listStack.pop(),rt.listStack.length?rt.indentation=rt.listStack[rt.listStack.length-1]:rt.list=!1;rt.list!==!1&&(rt.indentationDiff=ui-rt.listStack[rt.listStack.length-1])}var It=!ni&&!Rt&&!rt.prevLine.header&&(!En||!Kn)&&!rt.prevLine.fencedCodeEnd,On=(rt.list===!1||Rt||ni)&&rt.indentation<=Bn&&it.match(ot),ht=null;if(rt.indentationDiff>=4&&(Kn||rt.prevLine.fencedCodeEnd||rt.prevLine.header||ni))return it.skipToEnd(),rt.indentedCode=!0,at.code;if(it.eatSpace())return null;if(dn&&rt.indentation<=Bn&&(ht=it.match(dt))&&ht[1].length<=6)return rt.quote=0,rt.header=ht[1].length,rt.thisLine.header=!0,pt.highlightFormatting&&(rt.formatting="header"),rt.f=rt.inline,nt(rt);if(rt.indentation<=Bn&&it.eat(">"))return rt.quote=dn?1:rt.quote+1,pt.highlightFormatting&&(rt.formatting="quote"),it.eatSpace(),nt(rt);if(!On&&!rt.setext&&dn&&rt.indentation<=Bn&&(ht=it.match(We))){var kn=ht[1]?"ol":"ul";return rt.indentation=ui+it.current().length,rt.list=!0,rt.quote=0,rt.listStack.push(rt.indentation),rt.em=!1,rt.strong=!1,rt.code=!1,rt.strikethrough=!1,pt.taskLists&&it.match(Tt,!1)&&(rt.taskList=!0),rt.f=rt.inline,pt.highlightFormatting&&(rt.formatting=["list","list-"+kn]),nt(rt)}else{if(dn&&rt.indentation<=Bn&&(ht=it.match(ne,!0)))return rt.quote=0,rt.fencedEndRE=new RegExp(ht[1]+"+ *$"),rt.localMode=pt.fencedCodeBlockHighlighting&&Oe(ht[2]||pt.fencedCodeBlockDefaultMode),rt.localMode&&(rt.localState=le.startState(rt.localMode)),rt.f=rt.block=st,pt.highlightFormatting&&(rt.formatting="code-block"),rt.code=-1,nt(rt);if(rt.setext||(!It||!En)&&!rt.quote&&rt.list===!1&&!rt.code&&!On&&!te.test(it.string)&&(ht=it.lookAhead(1))&&(ht=ht.match(kt)))return rt.setext?(rt.header=rt.setext,rt.setext=0,it.skipToEnd(),pt.highlightFormatting&&(rt.formatting="header")):(rt.header=ht[0].charAt(0)=="="?1:2,rt.setext=rt.header),rt.thisLine.header=!0,rt.f=rt.inline,nt(rt);if(On)return it.skipToEnd(),rt.hr=!0,rt.thisLine.hr=!0,at.hr;if(it.peek()==="[")return pe(it,rt,fn)}return pe(it,rt,rt.inline)}function Ze(it,rt){var dn=St.token(it,rt.htmlState);if(!yt){var ni=le.innerMode(St,rt.htmlState);(ni.mode.name=="xml"&&ni.state.tagStart===null&&!ni.state.context&&ni.state.tokenize.isInText||rt.md_inside&&it.current().indexOf(">")>-1)&&(rt.f=ct,rt.block=_e,rt.htmlState=null)}return dn}function st(it,rt){var dn=rt.listStack[rt.listStack.length-1]||0,ni=rt.indentation<dn,Kn=dn+3;if(rt.fencedEndRE&&rt.indentation<=Kn&&(ni||it.match(rt.fencedEndRE))){pt.highlightFormatting&&(rt.formatting="code-block");var Rt;return ni||(Rt=nt(rt)),rt.localMode=rt.localState=null,rt.block=_e,rt.f=ct,rt.fencedEndRE=null,rt.code=0,rt.thisLine.fencedCodeEnd=!0,ni?ye(it,rt,rt.block):Rt}else return rt.localMode?rt.localMode.token(it,rt.localState):(it.skipToEnd(),at.code)}function nt(it){var rt=[];if(it.formatting){rt.push(at.formatting),typeof it.formatting=="string"&&(it.formatting=[it.formatting]);for(var dn=0;dn<it.formatting.length;dn++)rt.push(at.formatting+"-"+it.formatting[dn]),it.formatting[dn]==="header"&&rt.push(at.formatting+"-"+it.formatting[dn]+"-"+it.header),it.formatting[dn]==="quote"&&(!pt.maxBlockquoteDepth||pt.maxBlockquoteDepth>=it.quote?rt.push(at.formatting+"-"+it.formatting[dn]+"-"+it.quote):rt.push("error"))}if(it.taskOpen)return rt.push("meta"),rt.length?rt.join(" "):null;if(it.taskClosed)return rt.push("property"),rt.length?rt.join(" "):null;if(it.linkHref?rt.push(at.linkHref,"url"):(it.strong&&rt.push(at.strong),it.em&&rt.push(at.em),it.strikethrough&&rt.push(at.strikethrough),it.emoji&&rt.push(at.emoji),it.linkText&&rt.push(at.linkText),it.code&&rt.push(at.code),it.image&&rt.push(at.image),it.imageAltText&&rt.push(at.imageAltText,"link"),it.imageMarker&&rt.push(at.imageMarker)),it.header&&rt.push(at.header,at.header+"-"+it.header),it.quote&&(rt.push(at.quote),!pt.maxBlockquoteDepth||pt.maxBlockquoteDepth>=it.quote?rt.push(at.quote+"-"+it.quote):rt.push(at.quote+"-"+pt.maxBlockquoteDepth)),it.list!==!1){var ni=(it.listStack.length-1)%3;ni?ni===1?rt.push(at.list2):rt.push(at.list3):rt.push(at.list1)}return it.trailingSpaceNewLine?rt.push("trailing-space-new-line"):it.trailingSpace&&rt.push("trailing-space-"+(it.trailingSpace%2?"a":"b")),rt.length?rt.join(" "):null}function Ye(it,rt){if(it.match(De,!0))return nt(rt)}function ct(it,rt){var dn=rt.text(it,rt);if(typeof dn!="undefined")return dn;if(rt.list)return rt.list=null,nt(rt);if(rt.taskList){var ni=it.match(Tt,!0)[1]===" ";return ni?rt.taskOpen=!0:rt.taskClosed=!0,pt.highlightFormatting&&(rt.formatting="task"),rt.taskList=!1,nt(rt)}if(rt.taskOpen=!1,rt.taskClosed=!1,rt.header&&it.match(/^#+$/,!0))return pt.highlightFormatting&&(rt.formatting="header"),nt(rt);var Kn=it.next();if(rt.linkTitle){rt.linkTitle=!1;var Rt=Kn;Kn==="("&&(Rt=")"),Rt=(Rt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var En="^\\s*(?:[^"+Rt+"\\\\]+|\\\\\\\\|\\\\.)"+Rt;if(it.match(new RegExp(En),!0))return at.linkHref}if(Kn==="`"){var Bn=rt.formatting;pt.highlightFormatting&&(rt.formatting="code"),it.eatWhile("`");var ui=it.current().length;if(rt.code==0&&(!rt.quote||ui==1))return rt.code=ui,nt(rt);if(ui==rt.code){var It=nt(rt);return rt.code=0,It}else return rt.formatting=Bn,nt(rt)}else if(rt.code)return nt(rt);if(Kn==="\\"&&(it.next(),pt.highlightFormatting)){var On=nt(rt),ht=at.formatting+"-escape";return On?On+" "+ht:ht}if(Kn==="!"&&it.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return rt.imageMarker=!0,rt.image=!0,pt.highlightFormatting&&(rt.formatting="image"),nt(rt);if(Kn==="["&&rt.imageMarker&&it.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return rt.imageMarker=!1,rt.imageAltText=!0,pt.highlightFormatting&&(rt.formatting="image"),nt(rt);if(Kn==="]"&&rt.imageAltText){pt.highlightFormatting&&(rt.formatting="image");var On=nt(rt);return rt.imageAltText=!1,rt.image=!1,rt.inline=rt.f=Et,On}if(Kn==="["&&!rt.image)return rt.linkText&&it.match(/^.*?\]/)||(rt.linkText=!0,pt.highlightFormatting&&(rt.formatting="link")),nt(rt);if(Kn==="]"&&rt.linkText){pt.highlightFormatting&&(rt.formatting="link");var On=nt(rt);return rt.linkText=!1,rt.inline=rt.f=it.match(/\(.*?\)| ?\[.*?\]/,!1)?Et:ct,On}if(Kn==="<"&&it.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){rt.f=rt.inline=$e,pt.highlightFormatting&&(rt.formatting="link");var On=nt(rt);return On?On+=" ":On="",On+at.linkInline}if(Kn==="<"&&it.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){rt.f=rt.inline=$e,pt.highlightFormatting&&(rt.formatting="link");var On=nt(rt);return On?On+=" ":On="",On+at.linkEmail}if(pt.xml&&Kn==="<"&&it.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var kn=it.string.indexOf(">",it.pos);if(kn!=-1){var Oi=it.string.substring(it.start,kn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Oi)&&(rt.md_inside=!0)}return it.backUp(1),rt.htmlState=le.startState(St),ye(it,rt,Ze)}if(pt.xml&&Kn==="<"&&it.match(/^\/\w*?>/))return rt.md_inside=!1,"tag";if(Kn==="*"||Kn==="_"){for(var ze=1,Me=it.pos==1?" ":it.string.charAt(it.pos-2);ze<3&&it.eat(Kn);)ze++;var Ee=it.peek()||" ",Te=!/\s/.test(Ee)&&(!de.test(Ee)||/\s/.test(Me)||de.test(Me)),He=!/\s/.test(Me)&&(!de.test(Me)||/\s/.test(Ee)||de.test(Ee)),Ae=null,et=null;if(ze%2&&(!rt.em&&Te&&(Kn==="*"||!He||de.test(Me))?Ae=!0:rt.em==Kn&&He&&(Kn==="*"||!Te||de.test(Ee))&&(Ae=!1)),ze>1&&(!rt.strong&&Te&&(Kn==="*"||!He||de.test(Me))?et=!0:rt.strong==Kn&&He&&(Kn==="*"||!Te||de.test(Ee))&&(et=!1)),et!=null||Ae!=null){pt.highlightFormatting&&(rt.formatting=Ae==null?"strong":et==null?"em":"strong em"),Ae===!0&&(rt.em=Kn),et===!0&&(rt.strong=Kn);var It=nt(rt);return Ae===!1&&(rt.em=!1),et===!1&&(rt.strong=!1),It}}else if(Kn===" "&&(it.eat("*")||it.eat("_"))){if(it.peek()===" ")return nt(rt);it.backUp(1)}if(pt.strikethrough){if(Kn==="~"&&it.eatWhile(Kn)){if(rt.strikethrough){pt.highlightFormatting&&(rt.formatting="strikethrough");var It=nt(rt);return rt.strikethrough=!1,It}else if(it.match(/^[^\s]/,!1))return rt.strikethrough=!0,pt.highlightFormatting&&(rt.formatting="strikethrough"),nt(rt)}else if(Kn===" "&&it.match(/^~~/,!0)){if(it.peek()===" ")return nt(rt);it.backUp(2)}}if(pt.emoji&&Kn===":"&&it.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){rt.emoji=!0,pt.highlightFormatting&&(rt.formatting="emoji");var on=nt(rt);return rt.emoji=!1,on}return Kn===" "&&(it.match(/^ +$/,!1)?rt.trailingSpace++:rt.trailingSpace&&(rt.trailingSpaceNewLine=!0)),nt(rt)}function $e(it,rt){var dn=it.next();if(dn===">"){rt.f=rt.inline=ct,pt.highlightFormatting&&(rt.formatting="link");var ni=nt(rt);return ni?ni+=" ":ni="",ni+at.linkInline}return it.match(/^[^>]+/,!0),at.linkInline}function Et(it,rt){if(it.eatSpace())return null;var dn=it.next();return dn==="("||dn==="["?(rt.f=rt.inline=Bt(dn==="("?")":"]"),pt.highlightFormatting&&(rt.formatting="link-string"),rt.linkHref=!0,nt(rt)):"error"}var Pt={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Bt(it){return function(rt,dn){var ni=rt.next();if(ni===it){dn.f=dn.inline=ct,pt.highlightFormatting&&(dn.formatting="link-string");var Kn=nt(dn);return dn.linkHref=!1,Kn}return rt.match(Pt[it]),dn.linkHref=!0,nt(dn)}}function fn(it,rt){return it.match(/^([^\]\\]|\\.)*\]:/,!1)?(rt.f=qt,it.next(),pt.highlightFormatting&&(rt.formatting="link"),rt.linkText=!0,nt(rt)):pe(it,rt,ct)}function qt(it,rt){if(it.match(/^\]:/,!0)){rt.f=rt.inline=vn,pt.highlightFormatting&&(rt.formatting="link");var dn=nt(rt);return rt.linkText=!1,dn}return it.match(/^([^\]\\]|\\.)+/,!0),at.linkText}function vn(it,rt){return it.eatSpace()?null:(it.match(/^[^\s]+/,!0),it.peek()===void 0?rt.linkTitle=!0:it.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),rt.f=rt.inline=ct,at.linkHref+" url")}var tn={startState:function(){return{f:_e,prevLine:{stream:null},thisLine:{stream:null},block:_e,htmlState:null,indentation:0,inline:ct,text:Ye,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(it){return{f:it.f,prevLine:it.prevLine,thisLine:it.thisLine,block:it.block,htmlState:it.htmlState&&le.copyState(St,it.htmlState),indentation:it.indentation,localMode:it.localMode,localState:it.localMode?le.copyState(it.localMode,it.localState):null,inline:it.inline,text:it.text,formatting:!1,linkText:it.linkText,linkTitle:it.linkTitle,linkHref:it.linkHref,code:it.code,em:it.em,strong:it.strong,strikethrough:it.strikethrough,emoji:it.emoji,header:it.header,setext:it.setext,hr:it.hr,taskList:it.taskList,list:it.list,listStack:it.listStack.slice(0),quote:it.quote,indentedCode:it.indentedCode,trailingSpace:it.trailingSpace,trailingSpaceNewLine:it.trailingSpaceNewLine,md_inside:it.md_inside,fencedEndRE:it.fencedEndRE}},token:function(it,rt){if(rt.formatting=!1,it!=rt.thisLine.stream){if(rt.header=0,rt.hr=!1,it.match(/^\s*$/,!0))return Ce(rt),null;if(rt.prevLine=rt.thisLine,rt.thisLine={stream:it},rt.taskList=!1,rt.trailingSpace=0,rt.trailingSpaceNewLine=!1,!rt.localState&&(rt.f=rt.block,rt.f!=Ze)){var dn=it.match(/^\s*/,!0)[0].replace(/\t/g,se).length;if(rt.indentation=dn,rt.indentationDiff=null,dn>0)return null}}return rt.f(it,rt)},innerMode:function(it){return it.block==Ze?{state:it.htmlState,mode:St}:it.localState?{state:it.localState,mode:it.localMode}:{state:it,mode:tn}},indent:function(it,rt,dn){return it.block==Ze&&St.indent?St.indent(it.htmlState,rt,dn):it.localState&&it.localMode.indent?it.localMode.indent(it.localState,rt,dn):le.Pass},blankLine:Ce,getType:nt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return tn},"xml"),le.defineMIME("text/markdown","markdown"),le.defineMIME("text/x-markdown","markdown")})},98101:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"use strict";le.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<le.modeInfo.length;Ue++){var pt=le.modeInfo[Ue];pt.mimes&&(pt.mime=pt.mimes[0])}le.findModeByMIME=function(St){St=St.toLowerCase();for(var yt=0;yt<le.modeInfo.length;yt++){var Oe=le.modeInfo[yt];if(Oe.mime==St)return Oe;if(Oe.mimes){for(var at=0;at<Oe.mimes.length;at++)if(Oe.mimes[at]==St)return Oe}}if(/\+xml$/.test(St))return le.findModeByMIME("application/xml");if(/\+json$/.test(St))return le.findModeByMIME("application/json")},le.findModeByExtension=function(St){St=St.toLowerCase();for(var yt=0;yt<le.modeInfo.length;yt++){var Oe=le.modeInfo[yt];if(Oe.ext){for(var at=0;at<Oe.ext.length;at++)if(Oe.ext[at]==St)return Oe}}},le.findModeByFileName=function(St){for(var yt=0;yt<le.modeInfo.length;yt++){var Oe=le.modeInfo[yt];if(Oe.file&&Oe.file.test(St))return Oe}var at=St.lastIndexOf("."),Ct=at>-1&&St.substring(at+1,St.length);if(Ct)return le.findModeByExtension(Ct)},le.findModeByName=function(St){St=St.toLowerCase();for(var yt=0;yt<le.modeInfo.length;yt++){var Oe=le.modeInfo[yt];if(Oe.name.toLowerCase()==St)return Oe;if(Oe.alias){for(var at=0;at<Oe.alias.length;at++)if(Oe.alias[at].toLowerCase()==St)return Oe}}}})},67549:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"use strict";le.defineMode("stex",function(Ue,pt){"use strict";function St(De,ne){De.cmdState.push(ne)}function yt(De){return De.cmdState.length>0?De.cmdState[De.cmdState.length-1]:null}function Oe(De){var ne=De.cmdState.pop();ne&&ne.closeBracket()}function at(De){for(var ne=De.cmdState,te=ne.length-1;te>=0;te--){var de=ne[te];if(de.name!="DEFAULT")return de}return{styleIdentifier:function(){return null}}}function Ct(De,ne,te){return function(){this.name=De,this.bracketNo=0,this.style=ne,this.styles=te,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var ot={};ot.importmodule=Ct("importmodule","tag",["string","builtin"]),ot.documentclass=Ct("documentclass","tag",["","atom"]),ot.usepackage=Ct("usepackage","tag",["atom"]),ot.begin=Ct("begin","tag",["atom"]),ot.end=Ct("end","tag",["atom"]),ot.label=Ct("label","tag",["atom"]),ot.ref=Ct("ref","tag",["atom"]),ot.eqref=Ct("eqref","tag",["atom"]),ot.cite=Ct("cite","tag",["atom"]),ot.bibitem=Ct("bibitem","tag",["atom"]),ot.Bibitem=Ct("Bibitem","tag",["atom"]),ot.RBibitem=Ct("RBibitem","tag",["atom"]),ot.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function We(De,ne){De.f=ne}function Tt(De,ne){var te;if(De.match(/^\\[a-zA-Z@]+/)){var de=De.current().slice(1);return te=ot.hasOwnProperty(de)?ot[de]:ot.DEFAULT,te=new te,St(ne,te),We(ne,kt),te.style}if(De.match(/^\\[$&%#{}_]/)||De.match(/^\\[,;!\/\\]/))return"tag";if(De.match("\\["))return We(ne,function(pe,ye){return dt(pe,ye,"\\]")}),"keyword";if(De.match("\\("))return We(ne,function(pe,ye){return dt(pe,ye,"\\)")}),"keyword";if(De.match("$$"))return We(ne,function(pe,ye){return dt(pe,ye,"$$")}),"keyword";if(De.match("$"))return We(ne,function(pe,ye){return dt(pe,ye,"$")}),"keyword";var se=De.next();if(se=="%")return De.skipToEnd(),"comment";if(se=="}"||se=="]"){if(te=yt(ne),te)te.closeBracket(se),We(ne,kt);else return"error";return"bracket"}else return se=="{"||se=="["?(te=ot.DEFAULT,te=new te,St(ne,te),"bracket"):/\d/.test(se)?(De.eatWhile(/[\w.%]/),"atom"):(De.eatWhile(/[\w\-_]/),te=at(ne),te.name=="begin"&&(te.argument=De.current()),te.styleIdentifier())}function dt(De,ne,te){if(De.eatSpace())return null;if(te&&De.match(te))return We(ne,Tt),"keyword";if(De.match(/^\\[a-zA-Z@]+/))return"tag";if(De.match(/^[a-zA-Z]+/))return"variable-2";if(De.match(/^\\[$&%#{}_]/)||De.match(/^\\[,;!\/]/)||De.match(/^[\^_&]/))return"tag";if(De.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(De.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var de=De.next();return de=="{"||de=="}"||de=="["||de=="]"||de=="("||de==")"?"bracket":de=="%"?(De.skipToEnd(),"comment"):"error"}function kt(De,ne){var te=De.peek(),de;return te=="{"||te=="["?(de=yt(ne),de.openBracket(te),De.eat(te),We(ne,Tt),"bracket"):/[ \t\r]/.test(te)?(De.eat(te),null):(We(ne,Tt),Oe(ne),Tt(De,ne))}return{startState:function(){var De=pt.inMathMode?function(ne,te){return dt(ne,te)}:Tt;return{cmdState:[],f:De}},copyState:function(De){return{cmdState:De.cmdState.slice(),f:De.f}},token:function(De,ne){return ne.f(De,ne)},blankLine:function(De){De.f=Tt,De.cmdState.length=0},lineComment:"%"}}),le.defineMIME("text/x-stex","stex"),le.defineMIME("text/x-latex","stex")})},15525:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"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},pt={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};le.defineMode("xml",function(St,yt){var Oe=St.indentUnit,at={},Ct=yt.htmlMode?Ue:pt;for(var ot in Ct)at[ot]=Ct[ot];for(var ot in yt)at[ot]=yt[ot];var We,Tt;function dt($e,Et){function Pt(qt){return Et.tokenize=qt,qt($e,Et)}var Bt=$e.next();if(Bt=="<")return $e.eat("!")?$e.eat("[")?$e.match("CDATA[")?Pt(ne("atom","]]>")):null:$e.match("--")?Pt(ne("comment","-->")):$e.match("DOCTYPE",!0,!0)?($e.eatWhile(/[\w\._\-]/),Pt(te(1))):null:$e.eat("?")?($e.eatWhile(/[\w\._\-]/),Et.tokenize=ne("meta","?>"),"meta"):(We=$e.eat("/")?"closeTag":"openTag",Et.tokenize=kt,"tag bracket");if(Bt=="&"){var fn;return $e.eat("#")?$e.eat("x")?fn=$e.eatWhile(/[a-fA-F\d]/)&&$e.eat(";"):fn=$e.eatWhile(/[\d]/)&&$e.eat(";"):fn=$e.eatWhile(/[\w\.\-:]/)&&$e.eat(";"),fn?"atom":"error"}else return $e.eatWhile(/[^&<]/),null}dt.isInText=!0;function kt($e,Et){var Pt=$e.next();if(Pt==">"||Pt=="/"&&$e.eat(">"))return Et.tokenize=dt,We=Pt==">"?"endTag":"selfcloseTag","tag bracket";if(Pt=="=")return We="equals",null;if(Pt=="<"){Et.tokenize=dt,Et.state=ye,Et.tagName=Et.tagStart=null;var Bt=Et.tokenize($e,Et);return Bt?Bt+" tag error":"tag error"}else return/[\'\"]/.test(Pt)?(Et.tokenize=De(Pt),Et.stringStartCol=$e.column(),Et.tokenize($e,Et)):($e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function De($e){var Et=function(Pt,Bt){for(;!Pt.eol();)if(Pt.next()==$e){Bt.tokenize=kt;break}return"string"};return Et.isInAttribute=!0,Et}function ne($e,Et){return function(Pt,Bt){for(;!Pt.eol();){if(Pt.match(Et)){Bt.tokenize=dt;break}Pt.next()}return $e}}function te($e){return function(Et,Pt){for(var Bt;(Bt=Et.next())!=null;){if(Bt=="<")return Pt.tokenize=te($e+1),Pt.tokenize(Et,Pt);if(Bt==">")if($e==1){Pt.tokenize=dt;break}else return Pt.tokenize=te($e-1),Pt.tokenize(Et,Pt)}return"meta"}}function de($e,Et,Pt){this.prev=$e.context,this.tagName=Et,this.indent=$e.indented,this.startOfLine=Pt,(at.doNotIndent.hasOwnProperty(Et)||$e.context&&$e.context.noIndent)&&(this.noIndent=!0)}function se($e){$e.context&&($e.context=$e.context.prev)}function pe($e,Et){for(var Pt;;){if(!$e.context||(Pt=$e.context.tagName,!at.contextGrabbers.hasOwnProperty(Pt)||!at.contextGrabbers[Pt].hasOwnProperty(Et)))return;se($e)}}function ye($e,Et,Pt){return $e=="openTag"?(Pt.tagStart=Et.column(),we):$e=="closeTag"?Ce:ye}function we($e,Et,Pt){return $e=="word"?(Pt.tagName=Et.current(),Tt="tag",st):at.allowMissingTagName&&$e=="endTag"?(Tt="tag bracket",st($e,Et,Pt)):(Tt="error",we)}function Ce($e,Et,Pt){if($e=="word"){var Bt=Et.current();return Pt.context&&Pt.context.tagName!=Bt&&at.implicitlyClosed.hasOwnProperty(Pt.context.tagName)&&se(Pt),Pt.context&&Pt.context.tagName==Bt||at.matchClosing===!1?(Tt="tag",_e):(Tt="tag error",Ze)}else return at.allowMissingTagName&&$e=="endTag"?(Tt="tag bracket",_e($e,Et,Pt)):(Tt="error",Ze)}function _e($e,Et,Pt){return $e!="endTag"?(Tt="error",_e):(se(Pt),ye)}function Ze($e,Et,Pt){return Tt="error",_e($e,Et,Pt)}function st($e,Et,Pt){if($e=="word")return Tt="attribute",nt;if($e=="endTag"||$e=="selfcloseTag"){var Bt=Pt.tagName,fn=Pt.tagStart;return Pt.tagName=Pt.tagStart=null,$e=="selfcloseTag"||at.autoSelfClosers.hasOwnProperty(Bt)?pe(Pt,Bt):(pe(Pt,Bt),Pt.context=new de(Pt,Bt,fn==Pt.indented)),ye}return Tt="error",st}function nt($e,Et,Pt){return $e=="equals"?Ye:(at.allowMissing||(Tt="error"),st($e,Et,Pt))}function Ye($e,Et,Pt){return $e=="string"?ct:$e=="word"&&at.allowUnquoted?(Tt="string",st):(Tt="error",st($e,Et,Pt))}function ct($e,Et,Pt){return $e=="string"?ct:st($e,Et,Pt)}return{startState:function($e){var Et={tokenize:dt,state:ye,indented:$e||0,tagName:null,tagStart:null,context:null};return $e!=null&&(Et.baseIndent=$e),Et},token:function($e,Et){if(!Et.tagName&&$e.sol()&&(Et.indented=$e.indentation()),$e.eatSpace())return null;We=null;var Pt=Et.tokenize($e,Et);return(Pt||We)&&Pt!="comment"&&(Tt=null,Et.state=Et.state(We||Pt,$e,Et),Tt&&(Pt=Tt=="error"?Pt+" error":Tt)),Pt},indent:function($e,Et,Pt){var Bt=$e.context;if($e.tokenize.isInAttribute)return $e.tagStart==$e.indented?$e.stringStartCol+1:$e.indented+Oe;if(Bt&&Bt.noIndent)return le.Pass;if($e.tokenize!=kt&&$e.tokenize!=dt)return Pt?Pt.match(/^(\s*)/)[0].length:0;if($e.tagName)return at.multilineTagIndentPastTag!==!1?$e.tagStart+$e.tagName.length+2:$e.tagStart+Oe*(at.multilineTagIndentFactor||1);if(at.alignCDATA&&/<!\[CDATA\[/.test(Et))return 0;var fn=Et&&/^<(\/)?([\w_:\.-]*)/.exec(Et);if(fn&&fn[1])for(;Bt;)if(Bt.tagName==fn[2]){Bt=Bt.prev;break}else if(at.implicitlyClosed.hasOwnProperty(Bt.tagName))Bt=Bt.prev;else break;else if(fn)for(;Bt;){var qt=at.contextGrabbers[Bt.tagName];if(qt&&qt.hasOwnProperty(fn[2]))Bt=Bt.prev;else break}for(;Bt&&Bt.prev&&!Bt.startOfLine;)Bt=Bt.prev;return Bt?Bt.indent+Oe:$e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:at.htmlMode?"html":"xml",helperType:at.htmlMode?"html":"xml",skipAttribute:function($e){$e.state==Ye&&($e.state=st)},xmlCurrentTag:function($e){return $e.tagName?{name:$e.tagName,close:$e.type=="closeTag"}:null},xmlCurrentContext:function($e){for(var Et=[],Pt=$e.context;Pt;Pt=Pt.prev)Pt.tagName&&Et.push(Pt.tagName);return Et.reverse()}}}),le.defineMIME("text/xml","xml"),le.defineMIME("application/xml","xml"),le.mimeModes.hasOwnProperty("text/html")||le.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Zn,ei,Le){"use strict";Le.d(ei,{$u:function(){return ot},BD:function(){return ze},E9:function(){return Ct},FF:function(){return Jn},FJ:function(){return ye},Hn:function(){return pe},KX:function(){return Ce},NB:function(){return Nt},S0:function(){return ht},UL:function(){return We},Vk:function(){return se},Vm:function(){return Ot},YI:function(){return kn},ZA:function(){return pt},Zt:function(){return Tt},al:function(){return Ae},bn:function(){return He},bx:function(){return Me},g2:function(){return Oi},h1:function(){return Ye},hD:function(){return Yt},l4:function(){return Oe},rU:function(){return Dt},s_:function(){return Ee},uz:function(){return pn},z6:function(){return dt}}),Zn=Le.hmd(Zn),function(){var be;function gn(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function li(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:gn(a)}}function Hn(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var oi=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},ki;if(typeof Object.setPrototypeOf=="function")ki=Object.setPrototypeOf;else{var Ji;e:{var $i={a:!0},ir={};try{ir.__proto__=$i,Ji=ir.a;break e}catch(a){}Ji=!1}ki=Ji?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var Mt=ki;function _t(a,y){if(a.prototype=oi(y.prototype),a.prototype.constructor=a,Mt)Mt(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 At=typeof Le.g!="undefined"&&Le.g!=null?Le.g:self,xi=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},mi=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function fi(a,y){if(y){var x=At;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&&mi(x,a,{writable:!0,value:y})}}fi("Object.assign",function(a){return a||xi}),fi("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 wn=typeof globalThis=="object"&&globalThis||typeof Le.g=="object"&&Le.g.global===Le.g&&Le.g||typeof self=="object"&&self.self===self&&self||{};wn.requestAnimationFrame===void 0&&(wn.setImmediate===void 0?wn.requestAnimationFrame=function(a){wn.setTimeout(a,0)}:wn.requestAnimationFrame=wn.setImmediate);function Yn(){}function Qi(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&wn.clearTimeout(x),x=vr(function(){x=-1,a.apply(E,b)},y)}}function vr(a,y){return wn.setTimeout(a,y)}function Dr(a){return wn.document.createElement(a)}function Ke(a){throw Error(a)}function Lt(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),Ke(a)}function _n(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),Ke(x+" is not in the range "+y+": "+a)}function ci(a){wn.console&&wn.console.log(a)}function $t(a){return typeof a=="object"&&a!==null}function xn(a){return Array.isArray(a)||wn.NodeList&&a instanceof wn.NodeList||wn.HTMLCollection&&a instanceof wn.HTMLCollection}function Xt(a){return Array.prototype.slice.call(a)}function ri(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):Ke("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function Hi(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):Ke("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function gi(){var a=So.pop();return a===void 0?[]:a}function Ii(a){a.length=0,So.push(a)}function Fi(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($t(a)&&a.constructor)return Fi(a.constructor);return typeof a}function Cr(a){var y=a;return $t(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 xr(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 Sr(a,y,x){Object.defineProperty(wo.prototype,a,{get:y,set:x})}function hn(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="",ee=0;ee<a.length;ee++)x=(x+1)%256,E=(E+y[x])%256,b=y[x],y[x]=y[E],y[E]=b,z+=String.fromCharCode(a.charCodeAt(ee)^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 ro=wn.navigator!==void 0&&0<wn.navigator.userAgent.indexOf("Trident/7"),Gr=wn.navigator!==void 0&&wn.navigator.platform!==void 0&&wn.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,So=[];Object.freeze([]),Yn.className="Util",Yn.Dx="32ab5ff3b26f42dc0ed90f21472913b5",Yn.adym="gojs.net",Yn.vfo="28e645fdb266",Yn.className="Util";function yn(a,y,x){Ar(this),this.j=a,this.xa=y,this.o=x}yn.prototype.toString=function(){return"EnumValue."+this.xa};function Xn(a,y){return y==null||y===""?null:a[y]}At.Object.defineProperties(yn.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),yn.className="EnumValue";function rr(){this.ew=[]}rr.prototype.toString=function(){return this.ew.join("")},rr.prototype.add=function(a){a!==""&&this.ew.push(a)},rr.className="StringBuilder";function er(){}er.className="PropertyCollection";var Pr={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){wn.console&&wn.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(ee,re){return function(){throw Error("Property "+ee.Zl[re.Tj]+" of "+ee.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function Wr(){}Wr.prototype.reset=function(){},Wr.prototype.next=function(){return!1},Wr.prototype.Ad=function(){return!1},Wr.prototype.first=function(){return null},Wr.prototype.any=function(){return!1},Wr.prototype.all=function(){return!0},Wr.prototype.each=function(){return this},Wr.prototype.map=function(){return this},Wr.prototype.filter=function(){return this},Wr.prototype.de=function(){},Wr.prototype.toString=function(){return"EmptyIterator"},At.Object.defineProperties(Wr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Wr.prototype.first=Wr.prototype.first,Wr.prototype.hasNext=Wr.prototype.Ad,Wr.prototype.next=Wr.prototype.next,Wr.prototype.reset=Wr.prototype.reset;var so=null;Wr.className="EmptyIterator",so=new Wr;function vo(a){this.key=-1,this.value=a}vo.prototype.reset=function(){this.key=-1},vo.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},vo.prototype.Ad=function(){return this.next()},vo.prototype.first=function(){return this.key=0,this.value},vo.prototype.any=function(a){return this.key=-1,a(this.value)},vo.prototype.all=function(a){return this.key=-1,a(this.value)},vo.prototype.each=function(a){return this.key=-1,a(this.value),this},vo.prototype.map=function(a){return new vo(a(this.value))},vo.prototype.filter=function(a){return a(this.value)?new vo(this.value):so},vo.prototype.de=function(){this.value=null},vo.prototype.toString=function(){return"SingletonIterator("+this.value+")"},At.Object.defineProperties(vo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),vo.prototype.first=vo.prototype.first,vo.prototype.hasNext=vo.prototype.Ad,vo.prototype.next=vo.prototype.next,vo.prototype.reset=vo.prototype.reset,vo.className="SingletonIterator";function po(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}po.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},po.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},po.prototype.Ad=function(){return this.next()},po.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},po.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},po.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},po.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},po.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 ee=y[z];(b===null||b(ee))&&x.push(a(ee))}return a=new Nn,a.s=x,a.xb(),a.iterator},po.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 ee=y[z];(b===null||b(ee))&&a(ee)&&x.push(ee)}return a=new Nn,a.s=x,a.xb(),a.iterator},po.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},po.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},At.Object.defineProperties(po.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}}}),po.prototype.first=po.prototype.first,po.prototype.hasNext=po.prototype.Ad,po.prototype.next=po.prototype.next,po.prototype.reset=po.prototype.reset,po.className="ListIterator";function yo(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}yo.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},yo.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)},yo.prototype.Ad=function(){return this.next()},yo.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},yo.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},yo.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},yo.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},yo.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 Nn,a.s=x,a.xb(),a.iterator},yo.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 Nn,a.s=x,a.xb(),a.iterator},yo.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},yo.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},At.Object.defineProperties(yo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),yo.prototype.first=yo.prototype.first,yo.prototype.hasNext=yo.prototype.Ad,yo.prototype.next=yo.prototype.next,yo.prototype.reset=yo.prototype.reset,yo.className="ListIteratorBackwards";function Nn(a){Ar(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&Ke("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}be=Nn.prototype,be.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.toString=function(){return"List()#"+br(this)},be.add=function(a){return a===null?this:(this._isFrozen&&Lt(this,a),this.s.push(a),this.xb(),this)},be.push=function(a){this.add(a)},be.addAll=function(a){if(a===null)return this;this._isFrozen&&Lt(this);var y=this.s;if(xn(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},be.clear=function(){this._isFrozen&&Lt(this),this.s.length=0,this.xb()},be.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},be.has=function(a){return this.contains(a)},be.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},be.M=function(a){var y=this.s;return(0>a||a>=y.length)&&_n(a,"0 <= i < length",Nn,"elt:i"),y[a]},be.get=function(a){return this.M(a)},be.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&_n(a,"0 <= i < length",Nn,"setElt:i"),this._isFrozen&&Lt(this,a),x[a]=y},be.set=function(a,y){this.cd(a,y)},be.first=function(){var a=this.s;return a.length===0?null:a[0]},be.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},be.pop=function(){this._isFrozen&&Lt(this);var a=this.s;return 0<a.length?a.pop():null},Nn.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},Nn.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},Nn.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},Nn.prototype.map=function(a){for(var y=new Nn,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},Nn.prototype.filter=function(a){for(var y=new Nn,x=[],E=this.s,b=E.length,z=0;z<b;z++){var ee=E[z];a(ee)&&x.push(ee)}return y.s=x,y.xb(),y},be=Nn.prototype,be.Gb=function(a,y){0>a&&_n(a,">= 0",Nn,"insertAt:i"),this._isFrozen&&Lt(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},be.remove=function(a){if(a===null)return!1;this._isFrozen&&Lt(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)},be.delete=function(a){return this.remove(a)},be.mb=function(a){var y=this.s;(0>a||a>=y.length)&&_n(a,"0 <= i < length",Nn,"removeAt:i"),this._isFrozen&&Lt(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},be.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&&Lt(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},Nn.prototype.copy=function(){var a=new Nn,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},be=Nn.prototype,be.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},be.Iv=function(){for(var a=new Tn,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},be.sort=function(a){return this._isFrozen&&Lt(this),this.s.sort(a),this.xb(),this},be.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&Lt(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&_n(y,"0 <= from < length",Nn,"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},be.reverse=function(){return this._isFrozen&&Lt(this),this.s.reverse(),this.xb(),this},At.Object.defineProperties(Nn.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 so;var a=this.Sa;return a!==null?(a.reset(),a):new po(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return so;var a=this.Hg;return a!==null?(a.reset(),a):new yo(this)}}}),Nn.prototype.reverse=Nn.prototype.reverse,Nn.prototype.sortRange=Nn.prototype.zi,Nn.prototype.sort=Nn.prototype.sort,Nn.prototype.toSet=Nn.prototype.Iv,Nn.prototype.toArray=Nn.prototype.Fa,Nn.prototype.removeRange=Nn.prototype.removeRange,Nn.prototype.removeAt=Nn.prototype.mb,Nn.prototype.delete=Nn.prototype.delete,Nn.prototype.remove=Nn.prototype.remove,Nn.prototype.insertAt=Nn.prototype.Gb,Nn.prototype.pop=Nn.prototype.pop,Nn.prototype.last=Nn.prototype.jc,Nn.prototype.first=Nn.prototype.first,Nn.prototype.set=Nn.prototype.set,Nn.prototype.setElt=Nn.prototype.cd,Nn.prototype.get=Nn.prototype.get,Nn.prototype.elt=Nn.prototype.M,Nn.prototype.indexOf=Nn.prototype.indexOf,Nn.prototype.has=Nn.prototype.has,Nn.prototype.contains=Nn.prototype.contains,Nn.prototype.clear=Nn.prototype.clear,Nn.prototype.addAll=Nn.prototype.addAll,Nn.prototype.push=Nn.prototype.push,Nn.prototype.add=Nn.prototype.add,Nn.prototype.thaw=Nn.prototype.ka,Nn.prototype.freeze=Nn.prototype.freeze,Nn.className="List";function ia(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}ia.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},ia.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)},ia.prototype.Ad=function(){return this.next()},ia.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},ia.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},ia.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},ia.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},ia.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new Nn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},ia.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new Nn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},ia.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},ia.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},At.Object.defineProperties(ia.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),ia.prototype.first=ia.prototype.first,ia.prototype.hasNext=ia.prototype.Ad,ia.prototype.next=ia.prototype.next,ia.prototype.reset=ia.prototype.reset,ia.className="SetIterator";function Tn(a){Ar(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&Ke("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}be=Tn.prototype,be.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.toString=function(){return"Set()#"+br(this)},be.add=function(a){if(a===null)return this;this._isFrozen&&Lt(this,a);var y=a;return $t(a)&&(y=Bo(a)),this.Tb[y]===void 0&&(this.Sb++,a=new Vt(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},be.addAll=function(a){if(a===null)return this;if(this._isFrozen&&Lt(this),xn(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},be.contains=function(a){if(a===null)return!1;var y=a;return $t(a)&&(y=br(a),y===void 0)?!1:this.Tb[y]!==void 0},be.has=function(a){return this.contains(a)},be.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},be.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},be.first=function(){var a=this.ea;return a===null?null:a.value},Tn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Tn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Tn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},Tn.prototype.map=function(a){for(var y=new Tn,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},Tn.prototype.filter=function(a){for(var y=new Tn,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},be=Tn.prototype,be.remove=function(a){if(a===null)return!1;this._isFrozen&&Lt(this,a);var y=a;if($t(a)&&(y=br(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},be.delete=function(a){return this.remove(a)},be.hp=function(a){if(a===null)return this;if(this._isFrozen&&Lt(this),xn(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},be.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&Lt(this);var y=new Tn;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},be.clear=function(){this._isFrozen&&Lt(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},Tn.prototype.copy=function(){var a=new Tn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},Tn.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},Tn.prototype.Hv=function(){var a=new Nn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function Ar(a){a.__gohashid=na++}function Bo(a){var y=a.__gohashid;return y===void 0&&(y=na++,a.__gohashid=y),y}function br(a){return a.__gohashid}At.Object.defineProperties(Tn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return so;var a=this.Sa;return a!==null?(a.reset(),a):new ia(this)}}}),Tn.prototype.toList=Tn.prototype.Hv,Tn.prototype.toArray=Tn.prototype.Fa,Tn.prototype.clear=Tn.prototype.clear,Tn.prototype.retainAll=Tn.prototype.pA,Tn.prototype.removeAll=Tn.prototype.hp,Tn.prototype.delete=Tn.prototype.delete,Tn.prototype.remove=Tn.prototype.remove,Tn.prototype.first=Tn.prototype.first,Tn.prototype.containsAny=Tn.prototype.Ty,Tn.prototype.containsAll=Tn.prototype.Sy,Tn.prototype.has=Tn.prototype.has,Tn.prototype.contains=Tn.prototype.contains,Tn.prototype.addAll=Tn.prototype.addAll,Tn.prototype.add=Tn.prototype.add,Tn.prototype.thaw=Tn.prototype.ka,Tn.prototype.freeze=Tn.prototype.freeze;var na=1;Tn.className="Set",Tn.uniqueHash=Ar,Tn.hashIdUnique=Bo,Tn.hashId=br;function Do(a){this.ma=a,this.qa=a.Ja,this.sa=null}Do.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Do.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)},Do.prototype.Ad=function(){return this.next()},Do.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},Do.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},Do.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},Do.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},Do.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new Nn;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Do.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new Nn;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Do.prototype.de=function(){this.value=this.key=null,this.qa=-1},Do.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},At.Object.defineProperties(Do.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Do.prototype.first=Do.prototype.first,Do.prototype.hasNext=Do.prototype.Ad,Do.prototype.next=Do.prototype.next,Do.prototype.reset=Do.prototype.reset,Do.className="MapKeySetIterator";function ho(a){Tn.call(this),Ar(this),this._isFrozen=!0,this.ma=a}_t(ho,Tn),be=ho.prototype,be.freeze=function(){return this},be.ka=function(){return this},be.toString=function(){return"MapKeySet("+this.ma.toString()+")"},be.add=function(){Ke("This Set is read-only: "+this.toString())},be.contains=function(a){return this.ma.contains(a)},be.has=function(a){return this.contains(a)},be.remove=function(){Ke("This Set is read-only: "+this.toString())},be.delete=function(a){return this.remove(a)},be.clear=function(){Ke("This Set is read-only: "+this.toString())},be.first=function(){var a=this.ma.ea;return a!==null?a.key:null},ho.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},ho.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},ho.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},ho.prototype.map=function(a){for(var y=new Tn,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},ho.prototype.filter=function(a){for(var y=new Tn,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},ho.prototype.copy=function(){return new ho(this.ma)},ho.prototype.Iv=function(){var a=new Tn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},ho.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},ho.prototype.Hv=function(){var a=new Nn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},At.Object.defineProperties(ho.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?so:new Do(this.ma)}}}),ho.prototype.toList=ho.prototype.Hv,ho.prototype.toArray=ho.prototype.Fa,ho.prototype.toSet=ho.prototype.Iv,ho.prototype.first=ho.prototype.first,ho.prototype.clear=ho.prototype.clear,ho.prototype.delete=ho.prototype.delete,ho.prototype.remove=ho.prototype.remove,ho.prototype.has=ho.prototype.has,ho.prototype.contains=ho.prototype.contains,ho.prototype.add=ho.prototype.add,ho.prototype.thaw=ho.prototype.ka,ho.prototype.freeze=ho.prototype.freeze,ho.className="MapKeySet";function Jo(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}Jo.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},Jo.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)},Jo.prototype.Ad=function(){return this.next()},Jo.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},Jo.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},Jo.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},Jo.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},Jo.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Nn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Jo.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Nn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},Jo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},Jo.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},At.Object.defineProperties(Jo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Jo.prototype.first=Jo.prototype.first,Jo.prototype.hasNext=Jo.prototype.Ad,Jo.prototype.next=Jo.prototype.next,Jo.prototype.reset=Jo.prototype.reset,Jo.className="MapValueSetIterator";function Vt(a,y){this.key=a,this.value=y,this.ll=this.va=null}Vt.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Vt.className="KeyValuePair";function jn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}jn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},jn.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)},jn.prototype.Ad=function(){return this.next()},jn.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},jn.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},jn.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},jn.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},jn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Nn;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},jn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Nn;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},jn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},jn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},At.Object.defineProperties(jn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),jn.prototype.first=jn.prototype.first,jn.prototype.hasNext=jn.prototype.Ad,jn.prototype.next=jn.prototype.next,jn.prototype.reset=jn.prototype.reset,jn.className="MapIterator";function Gt(a){Ar(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"&&Ke("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}be=Gt.prototype,be.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.toString=function(){return"Map()#"+br(this)},be.add=function(a,y){this._isFrozen&&Lt(this,a);var x=a;$t(a)&&(x=Bo(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new Vt(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},be.set=function(a,y){return this.add(a,y)},be.addAll=function(a){if(a===null)return this;if(xn(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 Gt)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},be.first=function(){return this.ea},Gt.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},Gt.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},Gt.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},Gt.prototype.map=function(a){for(var y=new Gt,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},Gt.prototype.filter=function(a){for(var y=new Gt,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},be=Gt.prototype,be.contains=function(a){var y=a;return $t(a)&&(y=br(a),y===void 0)?!1:this.Tb[y]!==void 0},be.has=function(a){return this.contains(a)},be.I=function(a){var y=a;return $t(a)&&(y=br(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},be.get=function(a){return this.I(a)},be.remove=function(a){if(a===null)return!1;this._isFrozen&&Lt(this,a);var y=a;if($t(a)&&(y=br(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},be.delete=function(a){return this.remove(a)},be.clear=function(){this._isFrozen&&Lt(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()},Gt.prototype.copy=function(){var a=new Gt,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},Gt.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 Vt(b.key,b.value),x++}return y},Gt.prototype.Lf=function(){return new ho(this)},At.Object.defineProperties(Gt.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return so;var a=this.Sa;return a!==null?(a.reset(),a):new jn(this)}},iteratorKeys:{get:function(){return 0>=this.count?so:new Do(this)}},iteratorValues:{get:function(){if(0>=this.count)return so;var a=this.jf;return a!==null?(a.reset(),a):new Jo(this)}}}),Gt.prototype.toKeySet=Gt.prototype.Lf,Gt.prototype.toArray=Gt.prototype.Fa,Gt.prototype.clear=Gt.prototype.clear,Gt.prototype.delete=Gt.prototype.delete,Gt.prototype.remove=Gt.prototype.remove,Gt.prototype.get=Gt.prototype.get,Gt.prototype.getValue=Gt.prototype.I,Gt.prototype.has=Gt.prototype.has,Gt.prototype.contains=Gt.prototype.contains,Gt.prototype.first=Gt.prototype.first,Gt.prototype.addAll=Gt.prototype.addAll,Gt.prototype.set=Gt.prototype.set,Gt.prototype.add=Gt.prototype.add,Gt.prototype.thaw=Gt.prototype.ka,Gt.prototype.freeze=Gt.prototype.freeze,Gt.className="Map";function Ie(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):Ke("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var ai,hi,_i,Yi,Ti;Ie.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},Ie.prototype.h=function(a,y){return this.x=a,this.y=y,this},Ie.prototype.sg=function(a,y){return this.x=a,this.y=y,this},Ie.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},Ie.prototype.copy=function(){var a=new Ie;return a.x=this.x,a.y=this.y,a},be=Ie.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&Ke("cannot thaw constant: "+this),this._isFrozen=!1,this};function In(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 Ie(x,b)}return new Ie}function si(a){return a.x.toString()+" "+a.y.toString()}be.toString=function(){return"Point("+this.x+","+this.y+")"},be.D=function(a){return a instanceof Ie?this.x===a.x&&this.y===a.y:!1},be.hi=function(a,y){return this.x===a&&this.y===y},be.Xa=function(a){return Re.B(this.x,a.x)&&Re.B(this.y,a.y)},be.add=function(a){return this.x+=a.x,this.y+=a.y,this},be.re=function(a){return this.x-=a.x,this.y-=a.y,this},be.offset=function(a,y){return this.x+=a,this.y+=y,this},Ie.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},be=Ie.prototype,be.scale=function(a,y){return this.x*=a,this.y*=y,this},be.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},be.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},be.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},be.ab=function(a){return yi(a.x-this.x,a.y-this.y)},be.direction=function(a,y){return yi(a-this.x,y-this.y)};function yi(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}be.Ry=function(a,y){return Re.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},be.fA=function(a,y,x,E){return Re.qh(a,y,x,E,this.x,this.y,this),this},be.gA=function(a,y){return Re.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},be.uA=function(a,y,x,E){return Re.No(this.x,this.y,a,y,x,E,this),this},be.vA=function(a,y){return Re.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},be.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},be.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},be.transform=function(a){return a.Ga(this),this};function $n(a,y){return y.Cd(a),a}function pi(a,y,x,E,b,z){var ee=b-x,re=z-E,oe=ee*ee+re*re;x-=a,E-=y;var ue=-x*ee-E*re;return 0>=ue||ue>=oe?(ee=b-a,re=z-y,Math.min(x*x+E*E,ee*ee+re*re)):(a=ee*E-re*x,a*a/oe)}function ur(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function Ki(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)}be.w=function(){return isFinite(this.x)&&isFinite(this.y)},Ie.alloc=function(){var a=Bi.pop();return a===void 0?new Ie:a},Ie.allocAt=function(a,y){var x=Bi.pop();return x===void 0?new Ie(a,y):(x.x=a,x.y=y,x)},Ie.free=function(a){Bi.push(a)},Ie.prototype.isReal=Ie.prototype.w,Ie.prototype.setSpot=Ie.prototype.yi,Ie.prototype.setRectSpot=Ie.prototype.xi,Ie.prototype.snapToGridPoint=Ie.prototype.vA,Ie.prototype.snapToGrid=Ie.prototype.uA,Ie.prototype.projectOntoLineSegmentPoint=Ie.prototype.gA,Ie.prototype.projectOntoLineSegment=Ie.prototype.fA,Ie.intersectingLineSegments=function(a,y,x,E,b,z,ee,re){return Re.Rl(a,y,x,E,b,z,ee,re)},Ie.prototype.compareWithLineSegmentPoint=Ie.prototype.Ry,Ie.compareWithLineSegment=function(a,y,x,E,b,z){return Re.Fl(a,y,x,E,b,z)},Ie.prototype.direction=Ie.prototype.direction,Ie.prototype.directionPoint=Ie.prototype.ab,Ie.prototype.normalize=Ie.prototype.normalize,Ie.prototype.distanceSquared=Ie.prototype.zd,Ie.prototype.distanceSquaredPoint=Ie.prototype.Bf,Ie.prototype.scale=Ie.prototype.scale,Ie.prototype.rotate=Ie.prototype.rotate,Ie.prototype.offset=Ie.prototype.offset,Ie.prototype.subtract=Ie.prototype.re,Ie.prototype.add=Ie.prototype.add,Ie.prototype.equalsApprox=Ie.prototype.Xa,Ie.prototype.equalTo=Ie.prototype.hi,Ie.prototype.equals=Ie.prototype.D,Ie.prototype.set=Ie.prototype.set,Ie.prototype.setTo=Ie.prototype.sg;var Bi=[];Ie.className="Point",Ie.parse=In,Ie.stringify=si,Ie.distanceLineSegmentSquared=pi,Ie.distanceSquared=ur,Ie.direction=Ki,Ie.Origin=ai=new Ie(0,0).ja(),Ie.InfiniteTopLeft=hi=new Ie(-1/0,-1/0).ja(),Ie.InfiniteBottomRight=_i=new Ie(1/0,1/0).ja(),Ie.SixPoint=Yi=new Ie(6,6).ja(),Ie.NoPoint=Ti=new Ie(NaN,NaN).ja(),Ie.parse=In,Ie.stringify=si,Ie.distanceLineSegmentSquared=pi,Ie.distanceSquared=ur,Ie.direction=Ki;function Pn(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):Ke("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var hr,or,xo,Yr,qo,Ko,Qo;Pn.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},Pn.prototype.h=function(a,y){return this.width=a,this.height=y,this},Pn.prototype.sg=function(a,y){return this.width=a,this.height=y,this},Pn.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},Pn.prototype.copy=function(){var a=new Pn;return a.width=this.width,a.height=this.height,a},be=Pn.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&Ke("cannot thaw constant: "+this),this._isFrozen=!1,this};function ra(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 Pn(x,b)}return new Pn}function Uo(a){return a.width.toString()+" "+a.height.toString()}be.toString=function(){return"Size("+this.width+","+this.height+")"},be.D=function(a){return a instanceof Pn?this.width===a.width&&this.height===a.height:!1},be.hi=function(a,y){return this.width===a&&this.height===y},be.Xa=function(a){return Re.B(this.width,a.width)&&Re.B(this.height,a.height)},be.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},be.w=function(){return isFinite(this.width)&&isFinite(this.height)},Pn.alloc=function(){var a=wa.pop();return a===void 0?new Pn:a},Pn.free=function(a){wa.push(a)},Pn.prototype.isReal=Pn.prototype.w,Pn.prototype.inflate=Pn.prototype.Bc,Pn.prototype.equalsApprox=Pn.prototype.Xa,Pn.prototype.equalTo=Pn.prototype.hi,Pn.prototype.equals=Pn.prototype.D,Pn.prototype.set=Pn.prototype.set,Pn.prototype.setTo=Pn.prototype.sg;var wa=[];Pn.className="Size",Pn.parse=ra,Pn.stringify=Uo,Pn.ZeroSize=hr=new Pn(0,0).ja(),Pn.OneSize=or=new Pn(1,1).ja(),Pn.SixSize=xo=new Pn(6,6).ja(),Pn.EightSize=Yr=new Pn(8,8).ja(),Pn.TenSize=qo=new Pn(10,10).ja(),Pn.InfiniteSize=Ko=new Pn(1/0,1/0).ja(),Pn.NoSize=Qo=new Pn(NaN,NaN).ja(),Pn.parse=ra,Pn.stringify=Uo;function Wt(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 Ie?(x=a.x,a=a.y,y instanceof Ie?(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 Pn?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):Ke("Incorrect second argument supplied to Rect constructor "+y)):Ke("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}be=Wt.prototype,be.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},be.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function Ho(a,y,x){a.width=y,a.height=x}be.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},be.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},be.dd=function(a){return this.x=a.x,this.y=a.y,this},be.tA=function(a){return this.width=a.width,this.height=a.height,this},Wt.prototype.copy=function(){var a=new Wt;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},be=Wt.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&Ke("cannot thaw constant: "+this),this._isFrozen=!1,this};function wr(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 ee=0;a[y]==="";)y++;return(E=a[y++])&&(ee=parseFloat(E)),new Wt(x,b,z,ee)}return new Wt}function no(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}be.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},be.D=function(a){return a instanceof Wt?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},be.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},be.Xa=function(a){return Re.B(this.x,a.x)&&Re.B(this.y,a.y)&&Re.B(this.width,a.width)&&Re.B(this.height,a.height)};function bo(a,y){return Re.$(a.x,y.x)&&Re.$(a.y,y.y)&&Re.$(a.width,y.width)&&Re.$(a.height,y.height)}be.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},be.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},be.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},be.offset=function(a,y){return this.x+=a,this.y+=y,this},be.Bc=function(a,y){return oo(this,y,a,y,a)},be.Co=function(a){return oo(this,a.top,a.right,a.bottom,a.left)},be.Fv=function(a){return oo(this,-a.top,-a.right,-a.bottom,-a.left)},be.Hz=function(a,y,x,E){return oo(this,a,y,x,E)};function oo(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}be.Ex=function(a){return fa(this,a.x,a.y,a.width,a.height)},be.Uu=function(a,y,x,E){return fa(this,a,y,x,E)};function fa(a,y,x,E,b){var z=Math.max(a.x,y),ee=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=ee,a.width=Math.max(0,y-z),a.height=Math.max(0,x-ee),a}be.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},be.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 ga(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))}be.Ye=function(a){return Mo(this,a.x,a.y,0,0)},be.ed=function(a){return Mo(this,a.x,a.y,a.width,a.height)},be.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),Mo(this,a,y,x,E)};function Mo(a,y,x,E,b){var z=Math.min(a.x,y),ee=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=ee,a.width=y-z,a.height=x-ee,a}be.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 Fo(a,y,x,E,b,z,ee,re){return ee===void 0&&(ee=0),re===void 0&&(re=0),a<=b&&b+ee<=a+x&&y<=z&&z+re<=y+E}function vs(a,y,x,E,b,z,ee,re){return a>ee+b||b>x+a?!1:!(y>re+z||z>E+y)}be.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},be.Mz=function(){return this.width===0&&this.height===0},Wt.alloc=function(){var a=ms.pop();return a===void 0?new Wt:a},Wt.allocAt=function(a,y,x,E){var b=ms.pop();return b===void 0?new Wt(a,y,x,E):b.h(a,y,x,E)},Wt.free=function(a){ms.push(a)},At.Object.defineProperties(Wt.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 Ie(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new Pn(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new Ie(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}}}),Wt.prototype.isEmpty=Wt.prototype.Mz,Wt.prototype.isReal=Wt.prototype.w,Wt.intersectsLineSegment=function(a,y,x,E,b,z,ee,re){return Re.Fx(a,y,x,E,b,z,ee,re)},Wt.prototype.setSpot=Wt.prototype.yi,Wt.prototype.union=Wt.prototype.Kv,Wt.prototype.unionRect=Wt.prototype.ed,Wt.prototype.unionPoint=Wt.prototype.Ye,Wt.prototype.intersects=Wt.prototype.Vu,Wt.prototype.intersectsRect=Wt.prototype.Yc,Wt.prototype.intersect=Wt.prototype.Uu,Wt.prototype.intersectRect=Wt.prototype.Ex,Wt.prototype.grow=Wt.prototype.Hz,Wt.prototype.subtractMargin=Wt.prototype.Fv,Wt.prototype.addMargin=Wt.prototype.Co,Wt.prototype.inflate=Wt.prototype.Bc,Wt.prototype.offset=Wt.prototype.offset,Wt.prototype.contains=Wt.prototype.contains,Wt.prototype.containsRect=Wt.prototype.Re,Wt.prototype.containsPoint=Wt.prototype.ca,Wt.prototype.equalsApprox=Wt.prototype.Xa,Wt.prototype.equalTo=Wt.prototype.hi,Wt.prototype.equals=Wt.prototype.D,Wt.prototype.setSize=Wt.prototype.tA,Wt.prototype.setPoint=Wt.prototype.dd,Wt.prototype.set=Wt.prototype.set,Wt.prototype.setTo=Wt.prototype.sg;var es=null,ps=null,ms=[];Wt.className="Rect",Wt.parse=wr,Wt.stringify=no,Wt.contains=Fo,Wt.intersects=vs,Wt.ZeroRect=es=new Wt(0,0,0,0).ja(),Wt.NoRect=ps=new Wt(NaN,NaN,NaN,NaN).ja(),Wt.parse=wr,Wt.stringify=no,Wt.contains=Fo,Wt.intersects=vs;function Kr(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):Ke("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}Kr.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},Kr.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},Kr.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},Kr.prototype.copy=function(){var a=new Kr;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},be=Kr.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&Ke("cannot thaw constant: "+this),this._isFrozen=!1,this};function Ka(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 Kr;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new Kr(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new Kr(x,b);for(var ee=NaN;a[y]==="";)y++;return(E=a[y++])&&(ee=parseFloat(E)),isNaN(ee)?new Kr(x,b):new Kr(x,b,z,ee)}return new Kr}function Ba(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}be.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},be.D=function(a){return a instanceof Kr?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},be.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},be.Xa=function(a){return Re.B(this.top,a.top)&&Re.B(this.right,a.right)&&Re.B(this.bottom,a.bottom)&&Re.B(this.left,a.left)},be.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},Kr.alloc=function(){var a=ls.pop();return a===void 0?new Kr:a},Kr.free=function(a){ls.push(a)},Kr.prototype.isReal=Kr.prototype.w,Kr.prototype.equalsApprox=Kr.prototype.Xa,Kr.prototype.equalTo=Kr.prototype.hi,Kr.prototype.equals=Kr.prototype.D,Kr.prototype.set=Kr.prototype.set,Kr.prototype.setTo=Kr.prototype.sg;var ss=null,Ya=null,ls=[];Kr.className="Margin",Kr.parse=Ka,Kr.stringify=Ba,Kr.ZeroMargin=ss=new Kr(0,0,0,0).ja(),Kr.TwoMargin=Ya=new Kr(2,2,2,2).ja(),Kr.parse=Ka,Kr.stringify=Ba;function Zi(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 Xr,Po,Yo,ea,Ea,Hr,Ns,is,Ut,Zt,bn,zi,Ei,Mi,wi,Fn,ti,dr,Tr,Vo,To,Ca,Sa,mo,_r,ar,oa,la,Ma,za,Ro,ua,ko,jr,Fa,sa;Zi.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},Zi.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},Zi.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},Zi.prototype.copy=function(){var a=new Zi;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},be=Zi.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&Ke("cannot thaw constant: "+this),this._isFrozen=!1,this};function Xo(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function Io(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return Xr;if(a==="TopLeft")return Po;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return Yo;if(a==="TopRight")return ea;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return Ea;if(a==="Center")return Hr;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return Ns;if(a==="BottomLeft")return is;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Ut;if(a==="BottomRight")return Zt;if(a==="TopSide")return bn;if(a==="LeftSide")return zi;if(a==="RightSide")return Ei;if(a==="BottomSide")return Mi;if(a==="TopBottomSides")return wi;if(a==="LeftRightSides")return Fn;if(a==="TopLeftSides")return ti;if(a==="TopRightSides")return dr;if(a==="BottomLeftSides")return Tr;if(a==="BottomRightSides")return Vo;if(a==="NotTopSide")return To;if(a==="NotLeftSide")return Ca;if(a==="NotRightSide")return Sa;if(a==="NotBottomSide")return mo;if(a==="AllSides")return _r;if(a==="Default")return ar;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 ee=0;a[y]==="";)y++;return E=a[y++],E!==void 0&&0<E.length&&(ee=parseFloat(E)),new Zi(x,b,z,ee)}return new Zi}function ca(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}be.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(Xr)?"None":this.D(Po)?"TopLeft":this.D(Yo)?"Top":this.D(ea)?"TopRight":this.D(Ea)?"Left":this.D(Hr)?"Center":this.D(Ns)?"Right":this.D(is)?"BottomLeft":this.D(Ut)?"Bottom":this.D(Zt)?"BottomRight":this.D(bn)?"TopSide":this.D(zi)?"LeftSide":this.D(Ei)?"RightSide":this.D(Mi)?"BottomSide":this.D(wi)?"TopBottomSides":this.D(Fn)?"LeftRightSides":this.D(ti)?"TopLeftSides":this.D(dr)?"TopRightSides":this.D(Tr)?"BottomLeftSides":this.D(Vo)?"BottomRightSides":this.D(To)?"NotTopSide":this.D(Ca)?"NotLeftSide":this.D(Sa)?"NotRightSide":this.D(mo)?"NotBottomSide":this.D(_r)?"AllSides":this.D(ar)?"Default":"None"},be.D=function(a){return a instanceof Zi?(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},be.gv=function(){return new Zi(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},be.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(oa))a=zi;else if(a.D(la))a=Ei;else if(a.D(Ma))a=bn;else if(a.D(za))a=Mi;else return!1;return a=a.offsetY,(this.offsetY&a)===a},be.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},be.Mc=function(){return isNaN(this.x)||isNaN(this.y)},be.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},be.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},be.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},Zi.alloc=function(){var a=Wa.pop();return a===void 0?new Zi:a},Zi.free=function(a){Wa.push(a)},Zi.prototype.isDefault=Zi.prototype.Xb,Zi.prototype.isNone=Zi.prototype.ys,Zi.prototype.isSide=Zi.prototype.$c,Zi.prototype.isNoSpot=Zi.prototype.Mc,Zi.prototype.isSpot=Zi.prototype.sb,Zi.prototype.includesSide=Zi.prototype.Hf,Zi.prototype.opposite=Zi.prototype.gv,Zi.prototype.equals=Zi.prototype.D,Zi.prototype.set=Zi.prototype.set,Zi.prototype.setTo=Zi.prototype.sg;var Wa=[];Zi.className="Spot",Zi.parse=Io,Zi.stringify=ca,Zi.None=Xr=Xo(new Zi(0,0,0,0),0).ja(),Zi.Default=ar=Xo(new Zi(0,0,-1,0),-1).ja(),Zi.TopLeft=Po=new Zi(0,0,0,0).ja(),Zi.TopCenter=Yo=new Zi(.5,0,0,0).ja(),Zi.TopRight=ea=new Zi(1,0,0,0).ja(),Zi.LeftCenter=Ea=new Zi(0,.5,0,0).ja(),Zi.Center=Hr=new Zi(.5,.5,0,0).ja(),Zi.RightCenter=Ns=new Zi(1,.5,0,0).ja(),Zi.BottomLeft=is=new Zi(0,1,0,0).ja(),Zi.BottomCenter=Ut=new Zi(.5,1,0,0).ja(),Zi.BottomRight=Zt=new Zi(1,1,0,0).ja(),Zi.MiddleTop=Ro=Yo,Zi.MiddleLeft=ua=Ea,Zi.MiddleRight=ko=Ns,Zi.MiddleBottom=jr=Ut,Zi.Top=Ma=Yo,Zi.Left=oa=Ea,Zi.Right=la=Ns,Zi.Bottom=za=Ut,Zi.TopSide=bn=Xo(new Zi(0,0,1,1),1).ja(),Zi.LeftSide=zi=Xo(new Zi(0,0,1,2),1).ja(),Zi.RightSide=Ei=Xo(new Zi(0,0,1,4),1).ja(),Zi.BottomSide=Mi=Xo(new Zi(0,0,1,8),1).ja(),Zi.TopBottomSides=wi=Xo(new Zi(0,0,1,9),1).ja(),Zi.LeftRightSides=Fn=Xo(new Zi(0,0,1,6),1).ja(),Zi.TopLeftSides=ti=Xo(new Zi(0,0,1,3),1).ja(),Zi.TopRightSides=dr=Xo(new Zi(0,0,1,5),1).ja(),Zi.BottomLeftSides=Tr=Xo(new Zi(0,0,1,10),1).ja(),Zi.BottomRightSides=Vo=Xo(new Zi(0,0,1,12),1).ja(),Zi.NotTopSide=To=Xo(new Zi(0,0,1,14),1).ja(),Zi.NotLeftSide=Ca=Xo(new Zi(0,0,1,13),1).ja(),Zi.NotRightSide=Sa=Xo(new Zi(0,0,1,11),1).ja(),Zi.NotBottomSide=mo=Xo(new Zi(0,0,1,7),1).ja(),Zi.AllSides=_r=Xo(new Zi(0,0,1,15),1).ja(),Fa=new Zi(.156,.156).ja(),sa=new Zi(.844,.844).ja(),Zi.parse=Io,Zi.stringify=ca;function gt(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}gt.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},gt.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},gt.prototype.copy=function(){var a=new gt;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},gt.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},gt.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},gt.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},gt.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},gt.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},gt.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,ee=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*ee+this.m21*a+this.dx,this.dy=this.m12*ee+this.m22*a+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},gt.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},gt.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,ee=this.m12*-E+this.m22*a;return this.m11=this.m11*a+this.m21*E,this.m12=b,this.m21=z,this.m22=ee,this.translate(-y,-x),this},be=gt.prototype,be.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},be.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},be.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)},be.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))},be.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))},be.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,ee=this.m12,re=this.m21,oe=this.m22,ue=this.dx,he=this.dy,ge=y*z+x*re+ue,xe=y*ee+x*oe+he,Pe=E*z+x*re+ue,Fe=E*ee+x*oe+he;return x=y*z+b*re+ue,y=y*ee+b*oe+he,z=E*z+b*re+ue,E=E*ee+b*oe+he,b=Math.min(ge,Pe),ge=Math.max(ge,Pe),Pe=Math.min(xe,Fe),xe=Math.max(xe,Fe),b=Math.min(b,x),ge=Math.max(ge,x),Pe=Math.min(Pe,y),xe=Math.max(xe,y),b=Math.min(b,z),ge=Math.max(ge,z),Pe=Math.min(Pe,E),xe=Math.max(xe,E),a.h(b,Pe,ge-b,xe-Pe),a},gt.alloc=function(){var a=Ht.pop();return a===void 0?new gt:a},gt.free=function(a){Ht.push(a)},gt.prototype.transformRect=gt.prototype.pp,gt.prototype.transformPoint=gt.prototype.Ga,gt.prototype.scale=gt.prototype.scale,gt.prototype.translate=gt.prototype.translate,gt.prototype.rotate=gt.prototype.rotate,gt.prototype.invert=gt.prototype.Vj,gt.prototype.multiplyInverted=gt.prototype.bv,gt.prototype.multiply=gt.prototype.multiply,gt.prototype.reset=gt.prototype.reset,gt.prototype.isIdentity=gt.prototype.ws,gt.prototype.equals=gt.prototype.D,gt.prototype.setTransform=gt.prototype.setTransform,gt.prototype.set=gt.prototype.set;var Ht=[];gt.className="Transform",gt.xF="54a702f3e53909c447824c6706603faf4c";var Re={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=Re.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);Re.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,ee){if(0>=b&&(b=1e-6),a<x)var re=a,oe=x;else re=x,oe=a;if(y<E)var ue=y,he=E;else ue=E,he=y;if(a===x)return ue<=ee&&ee<=he&&a-b<=z&&z<=a+b;if(y===E)return re<=z&&z<=oe&&y-b<=ee&&ee<=y+b;if(oe+=b,re-=b,re<=z&&z<=oe&&(he+=b,ue-=b,ue<=ee&&ee<=he))if(oe-re>he-ue)if(a-x>b||x-a>b){if(z=(E-y)/(x-a)*(z-a)+y,z-b<=ee&&ee<=z+b)return!0}else return!0;else if(y-E>b||E-y>b){if(ee=(x-a)/(E-y)*(ee-y)+a,ee-b<=z&&z<=ee+b)return!0}else return!0;return!1},cs:function(a,y,x,E,b,z,ee,re,oe,ue,he,ge){if(Re.Yb(a,y,ee,re,ge,x,E)&&Re.Yb(a,y,ee,re,ge,b,z))return Re.Yb(a,y,ee,re,ge,ue,he);var xe=(a+x)/2,Pe=(y+E)/2,Fe=(x+b)/2,Ne=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(xe+Fe)/2,x=(Pe+Ne)/2,Fe=(Fe+b)/2,Ne=(Ne+z)/2;var Je=(E+Fe)/2,Ve=(x+Ne)/2;return Re.cs(a,y,xe,Pe,E,x,Je,Ve,oe,ue,he,ge)||Re.cs(Je,Ve,Fe,Ne,b,z,ee,re,oe,ue,he,ge)},ax:function(a,y,x,E,b,z,ee,re,oe){var ue=(x+b)/2,he=(E+z)/2;return oe.h((((a+x)/2+ue)/2+(ue+(b+ee)/2)/2)/2,(((y+E)/2+he)/2+(he+(z+re)/2)/2)/2),oe},My:function(a,y,x,E,b,z,ee,re){var oe=(x+b)/2,ue=(E+z)/2;return Ki(((a+x)/2+oe)/2,((y+E)/2+ue)/2,(oe+(b+ee)/2)/2,(ue+(z+re)/2)/2)},Dl:function(a,y,x,E,b,z,ee,re,oe,ue){if(Re.Yb(a,y,ee,re,oe,x,E)&&Re.Yb(a,y,ee,re,oe,b,z))Mo(ue,a,y,0,0),Mo(ue,ee,re,0,0);else{var he=(a+x)/2,ge=(y+E)/2,xe=(x+b)/2,Pe=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(he+xe)/2,x=(ge+Pe)/2,xe=(xe+b)/2,Pe=(Pe+z)/2;var Fe=(E+xe)/2,Ne=(x+Pe)/2;Re.Dl(a,y,he,ge,E,x,Fe,Ne,oe,ue),Re.Dl(Fe,Ne,xe,Pe,b,z,ee,re,oe,ue)}return ue},Qe:function(a,y,x,E,b,z,ee,re,oe,ue){if(Re.Yb(a,y,ee,re,oe,x,E)&&Re.Yb(a,y,ee,re,oe,b,z))ue.length===0&&(ue.push(a),ue.push(y)),ue.push(ee),ue.push(re);else{var he=(a+x)/2,ge=(y+E)/2,xe=(x+b)/2,Pe=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(he+xe)/2,x=(ge+Pe)/2,xe=(xe+b)/2,Pe=(Pe+z)/2;var Fe=(E+xe)/2,Ne=(x+Pe)/2;Re.Qe(a,y,he,ge,E,x,Fe,Ne,oe,ue),Re.Qe(Fe,Ne,xe,Pe,b,z,ee,re,oe,ue)}return ue},jv:function(a,y,x,E,b,z,ee,re,oe,ue){if(Re.Yb(a,y,b,z,ue,x,E))return Re.Yb(a,y,b,z,ue,re,oe);var he=(a+x)/2,ge=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var xe=(he+x)/2,Pe=(ge+E)/2;return Re.jv(a,y,he,ge,xe,Pe,ee,re,oe,ue)||Re.jv(xe,Pe,x,E,b,z,ee,re,oe,ue)},OA:function(a,y,x,E,b,z,ee){return ee.h(((a+x)/2+(x+b)/2)/2,((y+E)/2+(E+z)/2)/2),ee},iv:function(a,y,x,E,b,z,ee,re){if(Re.Yb(a,y,b,z,ee,x,E))Mo(re,a,y,0,0),Mo(re,b,z,0,0);else{var oe=(a+x)/2,ue=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var he=(oe+x)/2,ge=(ue+E)/2;Re.iv(a,y,oe,ue,he,ge,ee,re),Re.iv(he,ge,x,E,b,z,ee,re)}return re},ep:function(a,y,x,E,b,z,ee,re){if(Re.Yb(a,y,b,z,ee,x,E))re.length===0&&(re.push(a),re.push(y)),re.push(b),re.push(z);else{var oe=(a+x)/2,ue=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var he=(oe+x)/2,ge=(ue+E)/2;Re.ep(a,y,oe,ue,he,ge,ee,re),Re.ep(he,ge,x,E,b,z,ee,re)}return re},Eo:function(a,y,x,E,b,z,ee,re,oe,ue,he,ge,xe,Pe){if(Re.Yb(a,y,ee,re,xe,x,E)&&Re.Yb(a,y,ee,re,xe,b,z))return!Re.Rl(a,y,ee,re,oe,ue,he,ge)||(xe=(a-ee)*(ue-ge)-(y-re)*(oe-he),xe===0)?!1:(Pe.h(((a*re-y*ee)*(oe-he)-(a-ee)*(oe*ge-ue*he))/xe,((a*re-y*ee)*(ue-ge)-(y-re)*(oe*ge-ue*he))/xe),!0);var Fe=(a+x)/2,Ne=(y+E)/2,Je=(x+b)/2,Ve=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(Fe+Je)/2,x=(Ne+Ve)/2,Je=(Je+b)/2,Ve=(Ve+z)/2;var ut=(E+Je)/2,ft=(x+Ve)/2,vt=1/0,bt=!1,zt=0,vi=0;return Re.Eo(a,y,Fe,Ne,E,x,ut,ft,oe,ue,he,ge,xe,Pe)&&(a=(Pe.x-oe)*(Pe.x-oe)+(Pe.y-ue)*(Pe.y-ue),a<vt&&(vt=a,bt=!0,zt=Pe.x,vi=Pe.y)),Re.Eo(ut,ft,Je,Ve,b,z,ee,re,oe,ue,he,ge,xe,Pe)&&(Pe.x-oe)*(Pe.x-oe)+(Pe.y-ue)*(Pe.y-ue)<vt&&(bt=!0,zt=Pe.x,vi=Pe.y),bt&&(Pe.x=zt,Pe.y=vi),bt},Fo:function(a,y,x,E,b,z,ee,re,oe,ue,he,ge,xe){var Pe=0;if(Re.Yb(a,y,ee,re,xe,x,E)&&Re.Yb(a,y,ee,re,xe,b,z)){if(xe=(a-ee)*(ue-ge)-(y-re)*(oe-he),xe===0)return Pe;var Fe=((a*re-y*ee)*(oe-he)-(a-ee)*(oe*ge-ue*he))/xe,Ne=((a*re-y*ee)*(ue-ge)-(y-re)*(oe*ge-ue*he))/xe;if(Fe>=he)return Pe;if((oe>he?oe-he:he-oe)<(ue>ge?ue-ge:ge-ue)){if(y<re?(oe=y,a=re):(oe=re,a=y),Ne<oe||Ne>a)return Pe}else if(a<ee?(oe=a,a=ee):oe=ee,Fe<oe||Fe>a)return Pe;0<xe?Pe++:0>xe&&Pe--}else{Fe=(a+x)/2,Ne=(y+E)/2;var Je=(x+b)/2,Ve=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(Fe+Je)/2,x=(Ne+Ve)/2,Je=(Je+b)/2,Ve=(Ve+z)/2;var ut=(E+Je)/2,ft=(x+Ve)/2;Pe+=Re.Fo(a,y,Fe,Ne,E,x,ut,ft,oe,ue,he,ge,xe),Pe+=Re.Fo(ut,ft,Je,Ve,b,z,ee,re,oe,ue,he,ge,xe)}return Pe},qh:function(a,y,x,E,b,z,ee){return Re.$(a,x)?(y<E?(x=y,y=E):x=E,z<x?(ee.h(a,x),!1):z>y?(ee.h(a,y),!1):(ee.h(a,z),!0)):Re.$(y,E)?(a<x?(E=a,a=x):E=x,b<E?(ee.h(E,y),!1):b>a?(ee.h(a,y),!1):(ee.h(b,y),!0)):(b=((a-b)*(a-x)+(y-z)*(y-E))/((x-a)*(x-a)+(E-y)*(E-y)),-5e-6>b?(ee.h(a,y),!1):1.000005<b?(ee.h(x,E),!1):(ee.h(a+b*(x-a),y+b*(E-y)),!0))},Ve:function(a,y,x,E,b,z,ee,re,oe){return Re.B(a,x)&&Re.B(y,E)?(oe.h(a,y),!1):Re.$(b,ee)?Re.$(a,x)?(Re.qh(a,y,x,E,b,z,oe),!1):Re.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,oe):(re=(re-z)/(ee-b),Re.$(a,x)?(x=re*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(oe.h(a,b),!1):x>y?(oe.h(a,y),!1):(oe.h(a,x),!0)):(ee=(E-y)/(x-a),Re.$(re,ee)?(Re.qh(a,y,x,E,b,z,oe),!1):(b=(ee*a-re*b+z-y)/(ee-re),Re.$(ee,0)?(a<x?(E=a,a=x):E=x,b<E?(oe.h(E,y),!1):b>a?(oe.h(a,y),!1):(oe.h(b,y),!0)):Re.qh(a,y,x,E,b,ee*(b-a)+y,oe))))},MA:function(a,y,x,E,b){return Re.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,ee,re,oe,ue){function he(Je,Ve){var ut=(Je-a)*(Je-a)+(Ve-y)*(Ve-y);ut<ge&&(ge=ut,oe.h(Je,Ve))}var ge=1/0;he(oe.x,oe.y);var xe=0,Pe=0,Fe=0,Ne=0;if(b<ee?(xe=b,Pe=ee):(xe=ee,Pe=b),z<re?(Fe=b,Ne=ee):(Fe=ee,Ne=b),xe=(Pe-xe)/2+ue,ue=(Ne-Fe)/2+ue,b=(b+ee)/2,z=(z+re)/2,xe===0||ue===0)return oe;if(.5>(x>a?x-a:a-x)){if(xe=1-(x-b)*(x-b)/(xe*xe),0>xe)return oe;xe=Math.sqrt(xe),E=-ue*xe+z,he(x,ue*xe+z),he(x,E)}else{if(x=(E-y)/(x-a),E=1/(xe*xe)+x*x/(ue*ue),re=2*x*(y-x*a)/(ue*ue)-2*x*z/(ue*ue)-2*b/(xe*xe),xe=re*re-4*E*(2*x*a*z/(ue*ue)-2*y*z/(ue*ue)+z*z/(ue*ue)+b*b/(xe*xe)-1+(y-x*a)*(y-x*a)/(ue*ue)),0>xe)return oe;xe=Math.sqrt(xe),ue=(-re+xe)/(2*E),he(ue,x*ue-x*a+y),xe=(-re-xe)/(2*E),he(xe,x*xe-x*a+y)}return oe},Ff:function(a,y,x,E,b,z,ee,re,oe){var ue=1e21,he=a,ge=y;if(Re.Ve(a,y,a,E,b,z,ee,re,oe)){var xe=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z);xe<ue&&(ue=xe,he=oe.x,ge=oe.y)}return Re.Ve(x,y,x,E,b,z,ee,re,oe)&&(xe=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),xe<ue&&(ue=xe,he=oe.x,ge=oe.y)),Re.Ve(a,y,x,y,b,z,ee,re,oe)&&(y=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),y<ue&&(ue=y,he=oe.x,ge=oe.y)),Re.Ve(a,E,x,E,b,z,ee,re,oe)&&(a=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),a<ue&&(ue=a,he=oe.x,ge=oe.y)),oe.h(he,ge),1e21>ue},us:function(a,y,x){return Re.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,ee,re){var oe=a+x,ue=y+E;return b===ee?(z<re?(ee=z,z=re):ee=re,a<=b&&b<=oe&&ee<=ue&&z>=y):z===re?(b<ee?(re=b,b=ee):re=ee,y<=z&&z<=ue&&re<=oe&&b>=a):!!(Fo(a,y,x,E,b,z)||Fo(a,y,x,E,ee,re)||Re.Rl(a,y,oe,y,b,z,ee,re)||Re.Rl(oe,y,oe,ue,b,z,ee,re)||Re.Rl(oe,ue,a,ue,b,z,ee,re)||Re.Rl(a,ue,a,y,b,z,ee,re))},Rl:function(a,y,x,E,b,z,ee,re){return a===x&&y===E&&b===ee&&z===re?a===b&&y===z:0>=Re.Fl(a,y,x,E,b,z)*Re.Fl(a,y,x,E,ee,re)&&0>=Re.Fl(b,z,ee,re,a,y)*Re.Fl(b,z,ee,re,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 ee=Math.PI;z||(E*=ee/180,b*=ee/180);var re=E>b?-1:1;z=[];var oe=ee/2,ue=E;if(E=Math.min(2*ee,Math.abs(b-E)),1e-5>E)return oe=ue+re*Math.min(E,oe),re=a+x*Math.cos(ue),ue=y+x*Math.sin(ue),a+=x*Math.cos(oe),y+=x*Math.sin(oe),x=(re+a)/2,oe=(ue+y)/2,z.push([re,ue,x,oe,x,oe,a,y]),z;for(;1e-5<E;)b=ue+re*Math.min(E,oe),z.push(Re.Vy(x,ue,b,a,y)),E-=Math.abs(b-ue),ue=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,ee=a*Math.cos(z),re=a*Math.sin(z),oe=-re,ue=ee*ee+oe*oe,he=ue+ee*ee+oe*re;return ue=4/3*(Math.sqrt(2*ue*he)-he)/(ee*re-oe*ee),re=ee-ue*oe,ee=oe+ue*ee,oe=-ee,ue=z+y,z=Math.cos(ue),ue=Math.sin(ue),[E+a*Math.cos(y),b+a*Math.sin(y),E+re*z-ee*ue,b+re*ue+ee*z,E+re*z-oe*ue,b+re*ue+oe*z,E+a*Math.cos(x),b+a*Math.sin(x)]},No:function(a,y,x,E,b,z,ee){x=Math.floor((a-x)/b)*b+x,E=Math.floor((y-E)/z)*z+E;var re=x;return x+b-a<b/2&&(re=x+b),a=E,E+z-y<z/2&&(a=E+z),ee.h(re,a),ee},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 ee=1,re=0;else ee=0,re=1;var oe=ee===0?a:y,ue=ee===0?x:E;return(ee===0?b:z)&&(ue=-ue),ee=re,x=ee===0?x:E,(ee===0?b:z)&&(x=-x),Re.az(oe,ee===0?a:y,ue,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 ee=y*E,re=-z+ee,oe=-z+Math.sqrt(a*a+ee*ee);y=re;for(var ue=0;9999999999>ue&&(y=.5*(re+oe),!(y===re||y===oe));++ue){var he=a/(y+b),ge=ee/(y+z);if(he=he*he+ge*ge-1,0<he)re=y;else if(0>he)oe=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 er,um:new er,Mf:new er,Nf:0,vm:100};Re.za=Re.AA;function lt(a){Ar(this),this.l=2,a===void 0&&(a=lt.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===lt.o?this.ee=new Nn:(lt.V===null&&(lt.V=new Nn().freeze()),this.ee=lt.V),this.aq=this.ee.Ja,this.Ip=new Wt().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=Po,this.gg=Zt,this.Rk=this.Sk=NaN,this.Uf=zn}lt.prototype.copy=function(){var a=new lt;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===lt.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},lt.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},lt.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==lt.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},lt.prototype.ka=function(){if(Object.isFrozen(this)&&Ke("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==lt.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},lt.prototype.Xa=function(a){if(!(a instanceof lt))return!1;if(this.type!==a.type)return this.type===lt.j&&a.type===lt.o?fr(this,a):a.type===lt.j&&this.type===lt.o?fr(a,this):!1;if(this.type===lt.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 Re.B(this.startX,a.startX)&&Re.B(this.startY,a.startY)&&Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)};function fr(a,y){return a.type!==lt.j||y.type!==lt.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&Re.B(a.startX,y.startX)&&Re.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===Pi&&Re.B(a.endX,y.endX)&&Re.B(a.endY,y.endY))))}lt.ia=function(a){return a.toString()},lt.prototype.qb=function(a){a.classType===lt&&(this.type=a)},lt.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case lt.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 lt.u:var y=new Wt(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 lt.F:if(y=new Wt(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 lt.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()}},lt.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},lt.parse=function(a,y){function x(){return Ne>=vt-1?!0:ue[Ne+1].match(bt)!==null}function E(){return Ne++,ue[Ne]}function b(qr){var Rr=parseFloat(E()),aa=parseFloat(E());Je===Je.toLowerCase()&&(Rr=ft.x+Rr,aa=ft.y+aa),qr.h(Rr,aa)}function z(){return b(ft),ft}function ee(){return b(ut),ut}function re(){var qr=Ve.toLowerCase();return qr!=="c"&&qr!=="s"&&qr!=="q"&&qr!=="t"?ft:new Ie(2*ft.x-ut.x,2*ft.y-ut.y)}y===void 0&&(y=!1);var oe=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(oe,"$1 $2"),a=a.replace(oe,"$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 ue=a.split(" ");for(a=0;a<ue.length;a++){var he=ue[a];if(he.match(/(\.[0-9]*)(\.)/gm)!==null){oe=gi();for(var ge="",xe=!1,Pe=0;Pe<he.length;Pe++){var Fe=he[Pe];Fe!=="."||xe?Fe==="."?(oe.push(ge),ge="."):ge+=Fe:(xe=!0,ge+=Fe)}for(oe.push(ge),ue.splice(a,1),he=0;he<oe.length;he++)ue.splice(a+he,0,oe[he]);a+=oe.length-1,Ii(oe)}}var Ne=-1,Je="",Ve="";oe=new Ie(0,0);var ut=new Ie(0,0),ft=new Ie(0,0),vt=ue.length;a=A1(null),xe=ge=he=!1,Pe=!0,Fe=null;for(var bt=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(Ne>=vt-1);)if(Ve=Je,Je=E(),Je!=="")switch(Je.toUpperCase()){case"X":Pe=!0,ge=he=!1;break;case"M":for(Fe=z(),a.mc===null||Pe===!0?(fp(a,Fe.x,Fe.y,he,!ge,xe),Pe=!1):a.moveTo(Fe.x,Fe.y),oe.assign(ft);!x();)Fe=z(),a.lineTo(Fe.x,Fe.y);break;case"L":for(;!x();)Fe=z(),a.lineTo(Fe.x,Fe.y);break;case"H":for(;!x();)ft=new Ie((Je===Je.toLowerCase()?ft.x:0)+parseFloat(E()),ft.y),a.lineTo(ft.x,ft.y);break;case"V":for(;!x();)ft=new Ie(ft.x,(Je===Je.toLowerCase()?ft.y:0)+parseFloat(E())),a.lineTo(ft.x,ft.y);break;case"C":for(;!x();){Fe=new Ie,b(Fe);var zt=ee(),vi=z();$d(a,Fe.x,Fe.y,zt.x,zt.y,vi.x,vi.y)}break;case"S":for(;!x();)Fe=re(),zt=ee(),vi=z(),$d(a,Fe.x,Fe.y,zt.x,zt.y,vi.x,vi.y);break;case"Q":for(;!x();)Fe=ee(),zt=z(),u0(a,Fe.x,Fe.y,zt.x,zt.y);break;case"T":for(;!x();)ut=Fe=re(),zt=z(),u0(a,Fe.x,Fe.y,zt.x,zt.y);break;case"B":for(;!x();){Fe=parseFloat(E()),zt=parseFloat(E()),vi=parseFloat(E());var Xi=parseFloat(E()),Ri=parseFloat(E()),Qn=Ri,Cn=!1;x()||(Qn=parseFloat(E()),x()||(Cn=parseFloat(E())!==0)),Je===Je.toLowerCase()&&(vi+=ft.x,Xi+=ft.y),a.arcTo(Fe,zt,vi,Xi,Ri,Qn,Cn)}break;case"A":for(;!x();)Fe=Math.abs(parseFloat(E())),zt=Math.abs(parseFloat(E())),vi=parseFloat(E()),Ri=Xi=!1,Cn=Qn=0,Qn=E(),Qn.length===1?(Xi=!!parseFloat(Qn),Ri=!!parseFloat(E()),Qn=parseFloat(E())):Qn.length===2?(Xi=!!parseFloat(Qn[0]),Ri=!!parseFloat(Qn[1]),Qn=parseFloat(E())):(Xi=!!parseFloat(Qn[0]),Ri=!!parseFloat(Qn[1]),Qn=parseFloat(Qn.slice(2))),Cn=parseFloat(E()),Je===Je.toLowerCase()&&(Qn=ft.x+Qn,Cn=ft.y+Cn),ft.h(Qn,Cn),PS(a,Fe,zt,vi,Xi,Ri,Qn,Cn);break;case"Z":wS(a),ft.assign(oe);break;case"F":for(Fe="",zt=1;ue[Ne+zt];)if(ue[Ne+zt]==="0")xe=!0,zt++;else if(ue[Ne+zt].match(/[Uu]/)!==null)zt++;else if(ue[Ne+zt].match(bt)===null)zt++;else{Fe=ue[Ne+zt];break}Fe.match(/[Mm]/)?he=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Fe="",zt=1;ue[Ne+zt];)if(ue[Ne+zt].match(/[Ff]/)!==null)zt++;else if(ue[Ne+zt].match(bt)===null)zt++;else{Fe=ue[Ne+zt];break}Fe.match(/[Mm]/)?ge=!0:a.mc.isShadowed=!1}if(oe=a.os,h0=a,y)for(y=oe.figures.iterator;y.next();)y.value.isFilled=!0;return oe},lt.Ha=function(a,y){for(var x=a.length,E=Ie.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}Ie.free(E)},lt.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===lt.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},lt.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===lt.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 ee=E[z];ee._isInvalidBounds=!1,ee.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),sr(this,a,!1),Mo(a,0,0,0,0),a.freeze()},lt.prototype.ix=function(){var a=new Wt;return sr(this,a,!0),a};function sr(a,y,x){switch(a.type){case lt.j:case lt.u:case lt.F:x?y.h(a.od,a.pd,0,0):Mo(y,a.od,a.pd,0,0),Mo(y,a.Dc,a.Ec,0,0);break;case lt.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):Mo(y,z.startX,z.startY,0,0);for(var ee=z.segments.s,re=ee.length,oe=z.startX,ue=z.startY,he=0;he<re;he++){var ge=ee[he];switch(ge.type){case Pi:case Si:oe=ge.endX,ue=ge.endY,Mo(y,oe,ue,0,0);break;case Jr:Re.Dl(oe,ue,ge.point1X,ge.point1Y,ge.point2X,ge.point2Y,ge.endX,ge.endY,.5,y),oe=ge.endX,ue=ge.endY;break;case Ur:Re.iv(oe,ue,ge.point1X,ge.point1Y,ge.endX,ge.endY,.5,y),oe=ge.endX,ue=ge.endY;break;case Nr:case Lo:var xe=ge.type===Nr?Eo(ge,z):Wi(ge,z,oe,ue),Pe=xe.length;if(Pe===0){oe=ge.type===Nr?ge.centerX:ge.endX,ue=ge.type===Nr?ge.centerY:ge.endY,Mo(y,oe,ue,0,0);break}ge=null;for(var Fe=0;Fe<Pe;Fe++)ge=xe[Fe],Re.Dl(ge[0],ge[1],ge[2],ge[3],ge[4],ge[5],ge[6],ge[7],.5,y);ge!==null&&(oe=ge[6],ue=ge[7]);break;default:Ke("Unknown Segment type: "+ge.type)}}}break;default:Ke("Unknown Geometry type: "+a.type)}}lt.prototype.normalize=function(){this._isFrozen&&Lt(this);var a=this.ix();return this.offset(-a.x,-a.y),new Ie(-a.x,-a.y)},lt.prototype.offset=function(a,y){return this._isFrozen&&Lt(this),this.transform(1,0,0,1,a,y),this},lt.prototype.scale=function(a,y){return this._isFrozen&&Lt(this),this.transform(a,0,0,y,0,0),this},lt.prototype.rotate=function(a,y,x){this._isFrozen&&Lt(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=gt.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),gt.free(E),this},be=lt.prototype,be.transform=function(a,y,x,E,b,z){switch(this.type){case lt.j:case lt.u:case lt.F:var ee=this.od,re=this.pd;this.od=ee*a+re*x+b,this.pd=ee*y+re*E+z,ee=this.Dc,re=this.Ec,this.Dc=ee*a+re*x+b,this.Ec=ee*y+re*E+z;break;case lt.o:for(var oe=this.figures.s,ue=oe.length,he=0;he<ue;he++){var ge=oe[he];ee=ge.startX,re=ge.startY,ge.startX=ee*a+re*x+b,ge.startY=ee*y+re*E+z,ge=ge.segments.s;for(var xe=ge.length,Pe=0;Pe<xe;Pe++){var Fe=ge[Pe];switch(Fe.type){case Pi:case Si:ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z;break;case Jr:ee=Fe.point1X,re=Fe.point1Y,Fe.point1X=ee*a+re*x+b,Fe.point1Y=ee*y+re*E+z,ee=Fe.point2X,re=Fe.point2Y,Fe.point2X=ee*a+re*x+b,Fe.point2Y=ee*y+re*E+z,ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z;break;case Ur:ee=Fe.point1X,re=Fe.point1Y,Fe.point1X=ee*a+re*x+b,Fe.point1Y=ee*y+re*E+z,ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z;break;case Nr:ee=Fe.centerX,re=Fe.centerY,Fe.centerX=ee*a+re*x+b,Fe.centerY=ee*y+re*E+z,y!==0&&(ee=180*Math.atan2(y,a)/Math.PI,0>ee&&(ee+=360),Fe.startAngle+=ee),0>a&&(Fe.startAngle=180-Fe.startAngle,Fe.sweepAngle=-Fe.sweepAngle),0>E&&(Fe.startAngle=-Fe.startAngle,Fe.sweepAngle=-Fe.sweepAngle),Fe.radiusX*=Math.sqrt(a*a+x*x),Fe.radiusY!==void 0&&(Fe.radiusY*=Math.sqrt(y*y+E*E));break;case Lo:if(ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z,Fe.radiusX===0||Fe.radiusY===0)break;y!==0&&(ee=180*Math.atan2(y,a)/Math.PI,0>ee&&(ee+=360),Fe.xAxisRotation+=ee),0>a&&(Fe.xAxisRotation=180-Fe.xAxisRotation,Fe.isClockwiseArc=!Fe.isClockwiseArc),0>E&&(Fe.xAxisRotation=-Fe.xAxisRotation,Fe.isClockwiseArc=!Fe.isClockwiseArc),Fe.radiusX*=Math.sqrt(a*a+x*x),Fe.radiusY*=Math.sqrt(y*y+E*E);break;default:Ke("Unknown Segment type: "+Fe.type)}}}}return this._isInvalidBounds=!0,this},be.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 lt.j:return Re.Yb(x,E,b,z,y,a.x,a.y);case lt.u:var ee=Wt.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=ee.ca(a),Wt.free(ee),a;case lt.F:ee=Math.min(x,b)-y;var re=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:(ee=a.x-(ee+x),re=a.y-(re+y),1>=ee*ee/(x*x)+re*re/(y*y));case lt.o:return pr(this,a,y,!0,!1);default:return!1}};function pr(a,y,x,E,b){var z=y.x;y=y.y;for(var ee=a.bounds.x-20,re=0,oe,ue,he,ge,xe=a.figures.s,Pe=xe.length,Fe=0;Fe<Pe;Fe++){var Ne=xe[Fe],Je=!Ne.isEvenOdd;if(Ne.isFilled){if(E&&Ne.ca(z,y,x))return!0;var Ve=Ne.segments;oe=Ne.startX,ue=Ne.startY;for(var ut=oe,ft=ue,vt=Ve.s,bt=0;bt<=Ve.length;bt++){var zt=void 0;if(bt!==Ve.length){zt=vt[bt];var vi=zt.type;a=zt.endX,ge=zt.endY}else vi=Pi,a=ut,ge=ft;switch(vi){case Si:if(ut=Ui(z,y,ee,y,oe,ue,ut,ft),isNaN(ut))return!0;re+=ut,ut=a,ft=ge;break;case Pi:if(oe=Ui(z,y,ee,y,oe,ue,a,ge),isNaN(oe))return!0;re+=oe;break;case Jr:he=Re.Fo(oe,ue,zt.point1X,zt.point1Y,zt.point2X,zt.point2Y,a,ge,ee,y,z,y,.5),re+=he;break;case Ur:he=Re.Fo(oe,ue,(oe+2*zt.point1X)/3,(ue+2*zt.point1Y)/3,(2*zt.point1X+a)/3,(2*zt.point1Y+ge)/3,a,ge,ee,y,z,y,.5),re+=he;break;case Nr:case Lo:vi=zt.type===Nr?Eo(zt,Ne):Wi(zt,Ne,oe,ue);var Xi=vi.length;if(Xi===0){if(oe=Ui(z,y,ee,y,oe,ue,zt.type===Nr?zt.centerX:zt.endX,zt.type===Nr?zt.centerY:zt.endY),isNaN(oe))return!0;re+=oe;break}zt=null;for(var Ri=0;Ri<Xi;Ri++){if(zt=vi[Ri],Ri===0){if(he=Ui(z,y,ee,y,oe,ue,zt[0],zt[1]),isNaN(he))return!0;re+=he}he=Re.Fo(zt[0],zt[1],zt[2],zt[3],zt[4],zt[5],zt[6],zt[7],ee,y,z,y,.5),re+=he}zt!==null&&(a=zt[6],ge=zt[7]);break;default:Ke("Unknown Segment type: "+zt.type)}oe=a,ue=ge}if(Je){if(re!==0)return!0}else if(re%2!==0)return!0;re=0}else if(Ne.ca(z,y,b?x:x+2))return!0}return!1}function Ui(a,y,x,E,b,z,ee,re){if(Re.Yb(b,z,ee,re,.05,a,y))return NaN;var oe=(a-x)*(z-re);if(oe===0)return 0;var ue=((a*E-y*x)*(b-ee)-(a-x)*(b*re-z*ee))/oe;if(y=(a*E-y*x)*(z-re)/oe,ue>=a)return 0;if((b>ee?b-ee:ee-b)<(z>re?z-re:re-z)){if(z<re){if(y<z||y>re)return 0}else if(y<re||y>z)return 0}else if(b<ee){if(ue<b||ue>ee)return 0}else if(ue<ee||ue>b)return 0;return 0<oe?1:-1}function Un(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}be.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new Ie),this.type===lt.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,ee=0,re=0;re<b;re++){var oe=E[re],ue=oe.length;for(a=0;a<ue;a++){var he=oe[a];if(ee+he>=z)return E=z-ee,E=he===0?0:E/he,x=x[re],re=x[2*a],b=x[2*a+1],y.h(re+(x[2*a+2]-re)*E,b+(x[2*a+3]-b)*E),y;ee+=he}}return y},be.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===lt.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,ee=0;ee<E;ee++){var re=x[ee],oe=re.length;for(a=0;a<oe;a++){var ue=re[a];if(z+ue>=b)return b=y[ee],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+=ue}}return NaN},be.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===lt.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,ee=0,re=0;re<b;re++){var oe=E[re],ue=oe.length;for(a=0;a<ue;a++){var he=oe[a];if(ee+he>=z)return E=z-ee,E=he===0?0:E/he,he=x[re],x=he[2*a],re=he[2*a+1],b=he[2*a+2],a=he[2*a+3],y[0]=x+(b-x)*E,y[1]=re+(a-re)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-re)?0:1>Math.abs(b-x)?0<=a-re?90:270:1>Math.abs(a-re)?0<=b-x?0:180:180*Math.atan2(a-re,b-x)/Math.PI,y;ee+=he}}return y},be.xx=function(a){if(this.type===lt.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 ee=x;E=b}else ee=b,E=x;return a<=ee?ee===x?0:1:a>=E?E===x?0:1:Math.abs(a-x)/(E-ee)}if(x===b)return y<E?ee=y:(ee=E,E=y),z<=ee?ee===y?0:1:z>=E?E===y?0:1:Math.abs(z-y)/(E-ee);ee=(E-y)*(E-y)+(b-x)*(b-x);var re=Ie.alloc();return Re.qh(y,x,E,b,z,a,re),a=re.x,z=re.y,Ie.free(re),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/ee)}}else if(this.type===lt.u){ee=this.startX,re=this.startY;var oe=this.endX;if(b=this.endY,ee!==oe||re!==b){y=oe-ee,x=b-re,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,ee),oe),a=Math.min(Math.max(a,re),b),ee=Math.abs(E-ee),oe=Math.abs(E-oe),re=Math.abs(a-re),b=Math.abs(a-b);var ue=Math.min(ee,oe,re,b);if(ue===re)return E/z;if(ue===oe)return(y+a)/z;if(ue===b)return(2*y+x-E)/z;if(ue===ee)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=Ie.alloc(),b=1/0,re=ee=0,oe=y.length;for(var he=ue=0,ge=0;ge<oe;ge++)for(var xe=y[ge],Pe=x[ge],Fe=xe.length,Ne=0;Ne<Fe;Ne+=2){var Je=xe[Ne],Ve=xe[Ne+1];if(Ne!==0){Re.qh(ue,he,Je,Ve,a.x,a.y,E);var ut=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);ut<b&&(b=ut,ee=re,ee+=Math.sqrt((E.x-ue)*(E.x-ue)+(E.y-he)*(E.y-he))),re+=Pe[(Ne-2)/2]}ue=Je,he=Ve}return Ie.free(E),a=ee/z,0>a?0:1<a?1:a}return 0};function Lr(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===lt.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===lt.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===lt.F){var z=new Zr;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var ee=new Er(Nr);if(ee.startAngle=0,ee.sweepAngle=360,ee.centerX=(a.startX+a.endX)/2,ee.centerY=(a.startY+a.endY)/2,ee.radiusX=Math.abs(a.startX-a.endX)/2,ee.radiusY=Math.abs(a.startY-a.endY)/2,z.add(ee),a=Eo(ee,z),b=a.length,b===0)E.push(ee.centerX),E.push(ee.centerY);else{ee=z.startX,z=z.startY;for(var re=0;re<b;re++){var oe=a[re];Re.Qe(ee,z,oe[2],oe[3],oe[4],oe[5],oe[6],oe[7],.5,E),ee=oe[6],z=oe[7]}}y.push(E),x.push(kr(E))}else for(a=a.figures.iterator;a.next();){b=a.value,E=[],E.push(b.startX),E.push(b.startY),ee=b.startX,z=b.startY,re=ee,oe=z;for(var ue=b.segments.s,he=ue.length,ge=0;ge<he;ge++){var xe=ue[ge];switch(xe.type){case Si:4<=E.length&&(y.push(E),x.push(kr(E))),E=[],E.push(xe.endX),E.push(xe.endY),ee=xe.endX,z=xe.endY,re=ee,oe=z;break;case Pi:E.push(xe.endX),E.push(xe.endY),ee=xe.endX,z=xe.endY;break;case Jr:Re.Qe(ee,z,xe.point1X,xe.point1Y,xe.point2X,xe.point2Y,xe.endX,xe.endY,.5,E),ee=xe.endX,z=xe.endY;break;case Ur:Re.ep(ee,z,xe.point1X,xe.point1Y,xe.endX,xe.endY,.5,E),ee=xe.endX,z=xe.endY;break;case Nr:var Pe=Eo(xe,b),Fe=Pe.length;if(Fe===0){E.push(xe.centerX),E.push(xe.centerY),ee=xe.centerX,z=xe.centerY;break}for(var Ne=0;Ne<Fe;Ne++){var Je=Pe[Ne];Re.Qe(ee,z,Je[2],Je[3],Je[4],Je[5],Je[6],Je[7],.5,E),ee=Je[6],z=Je[7]}break;case Lo:if(Pe=Wi(xe,b,ee,z),Fe=Pe.length,Ne=xe.endX,Je=xe.endY,Fe===0){E.push(Ne),E.push(Je),ee=Ne,z=Je;break}for(Ne=0;Ne<Fe;Ne++)Je=Pe[Ne],Re.Qe(ee,z,Je[2],Je[3],Je[4],Je[5],Je[6],Je[7],.5,E),ee=Je[6],z=Je[7];break;default:Ke("Segment not of valid type: "+xe.type)}xe.isClosed&&(E.push(re),E.push(oe))}4<=E.length&&(y.push(E),x.push(kr(E)))}}}function kr(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var ee=a[z],re=a[z+1];z!==0&&y.push(Math.sqrt(ur(x,E,ee,re))),x=ee,E=re}return y}be.add=function(a){return this.ee.add(a),this},be.pm=function(a,y,x,E,b,z,ee,re){return this._isFrozen&&Lt(this),this.fg=new Zi(a,y,b,z).freeze(),this.gg=new Zi(x,E,ee,re).freeze(),this},At.Object.defineProperties(lt.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 Lr(this),this.tk}},flattenedLengths:{get:function(){return Lr(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===lt.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===lt.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,ee=0;ee<z;ee++)a+=b[ee]}this.zm=a}return a}},type:{get:function(){return this.na},set:function(a){this.na!==a&&(this._isFrozen&&Lt(this,a),this.na=a,a===lt.o?this.ee=new Nn:(lt.V===null&&(lt.V=new Nn().freeze()),this.ee=lt.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&Lt(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&Lt(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&Lt(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&Lt(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&Lt(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&Lt(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&Lt(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&Lt(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),lt.prototype.setSpots=lt.prototype.pm,lt.prototype.add=lt.prototype.add,lt.prototype.getFractionForPoint=lt.prototype.xx,lt.prototype.getPointAndAngleAlongPath=lt.prototype.Qu,lt.prototype.getAngleAlongPath=lt.prototype.wx,lt.prototype.getPointAlongPath=lt.prototype.Pu,lt.prototype.containsPoint=lt.prototype.ca,lt.prototype.transform=lt.prototype.transform,lt.prototype.rotate=lt.prototype.rotate,lt.prototype.scale=lt.prototype.scale,lt.prototype.offset=lt.prototype.offset,lt.prototype.normalize=lt.prototype.normalize,lt.prototype.computeBoundsWithoutOrigin=lt.prototype.ix,lt.prototype.equalsApprox=lt.prototype.Xa,lt.className="Geometry",lt.j=new yn(lt,"Line",0),lt.u=new yn(lt,"Rectangle",1),lt.F=new yn(lt,"Ellipse",2),lt.o=new yn(lt,"Path",3),lt.V=null,lt.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",lt.className="Geometry",lt.stringify=lt.ia,lt.fillPath=lt.nb,lt.parse=lt.parse,lt.Line=lt.j,lt.Rectangle=lt.u,lt.Ellipse=lt.F,lt.Path=lt.o;function Zr(a,y,x,E,b){Ar(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 Nn,this.sr=this.pl.Ja,this.fw=null}Zr.prototype.copy=function(){var a=new Zr;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},be=Zr.prototype,be.Xa=function(a){if(!(a instanceof Zr&&Re.B(this.startX,a.startX)&&Re.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},be.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},be.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},be.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},be.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},be.add=function(a){return this.pl.add(a),this},be.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,ee=b,re=this.segments.s,oe=re.length,ue=0;ue<oe;ue++){var he=re[ue];switch(he.type){case Si:z=he.endX,ee=he.endY,E=he.endX,b=he.endY;break;case Pi:if(Re.Yb(E,b,he.endX,he.endY,x,a,y))return!0;E=he.endX,b=he.endY;break;case Jr:if(Re.cs(E,b,he.point1X,he.point1Y,he.point2X,he.point2Y,he.endX,he.endY,.5,a,y,x))return!0;E=he.endX,b=he.endY;break;case Ur:if(Re.jv(E,b,he.point1X,he.point1Y,he.endX,he.endY,.5,a,y,x))return!0;E=he.endX,b=he.endY;break;case Nr:case Lo:var ge=he.type===Nr?Eo(he,this):Wi(he,this,E,b),xe=ge.length,Pe=he.type===Nr?he.centerX:he.endX,Fe=he.type===Nr?he.centerY:he.endY;if(xe===0){if(Re.Yb(E,b,Pe,Fe,x,a,y))return!0;E=Pe,b=Fe;break}for(Pe=null,Fe=0;Fe<xe;Fe++)if(Pe=ge[Fe],Fe===0&&Re.Yb(E,b,Pe[0],Pe[1],x,a,y)||Re.cs(Pe[0],Pe[1],Pe[2],Pe[3],Pe[4],Pe[5],Pe[6],Pe[7],.5,a,y,x))return!0;Pe!==null&&(E=Pe[6],b=Pe[7]);break;default:Ke("Unknown Segment type: "+he.type)}if(he.isClosed&&(E!==z||b!==ee)&&Re.Yb(E,b,z,ee,x,a,y))return!0}return!1},At.Object.defineProperties(Zr.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&&Lt(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&Lt(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&Lt(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&Lt(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&Lt(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&Lt(this,a),this.pl=a,this._isInvalidBounds=!0}}}),Zr.prototype.add=Zr.prototype.add,Zr.prototype.equalsApprox=Zr.prototype.Xa,Zr.className="PathFigure";function Er(a,y,x,E,b,z,ee,re){Ar(this),a===void 0&&(a=Pi),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),ee===void 0&&(ee=0),a===Lo?(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 ee=="boolean"?ee&&(this.isLargeArc=!0):typeof ee=="number"&&ee&&(this.isLargeArc=!0),re&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===Nr&&(z=Math.max(z,0)),this.Wh=z,typeof ee=="number"?(a===Nr&&(ee=Math.max(ee,0)),this.Pg=ee):this.Pg=0),this.ae=null}Er.prototype.copy=function(){var a=new Er;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},be=Er.prototype,be.Xa=function(a){if(!(a instanceof Er)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Si:case Pi:return Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY);case Jr:return Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)&&Re.B(this.point1X,a.point1X)&&Re.B(this.point1Y,a.point1Y)&&Re.B(this.point2X,a.point2X)&&Re.B(this.point2Y,a.point2Y);case Ur:return Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)&&Re.B(this.point1X,a.point1X)&&Re.B(this.point1Y,a.point1Y);case Nr:return Re.B(this.startAngle,a.startAngle)&&Re.B(this.sweepAngle,a.sweepAngle)&&Re.B(this.centerX,a.centerX)&&Re.B(this.centerY,a.centerY)&&Re.B(this.radiusX,a.radiusX)&&Re.B(this.radiusY,a.radiusY);case Lo:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&Re.B(this.xAxisRotation,a.xAxisRotation)&&Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)&&Re.B(this.radiusX,a.radiusX)&&Re.B(this.radiusY,a.radiusY);default:return!1}},be.qb=function(a){a.classType===Er&&(this.type=a)},be.toString=function(a){switch(a===void 0&&(a=-1),this.type){case Si:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Pi:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Jr: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 Ur: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 Nr: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 Lo: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":"")},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.close=function(){return this.isClosed=!0,this};function Eo(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=Re.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var ee=gt.alloc();ee.reset(),x<E?ee.scale(1,E/x):ee.scale(x/E,1),lt.Ha(z,ee),gt.free(ee)}for(x=z.length,E=0;E<x;E++)ee=z[E],ee[0]+=y,ee[1]+=b,ee[2]+=y,ee[3]+=b,ee[4]+=y,ee[5]+=b,ee[6]+=y,ee[7]+=b;return a.ae=z,a.ae}function Wi(a,y,x,E){function b(Ne,Je,Ve,ut){return(Ne*ut<Je*Ve?-1:1)*Math.acos((Ne*Ve+Je*ut)/(Math.sqrt(Ne*Ne+Je*Je)*Math.sqrt(Ve*Ve+ut*ut)))}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 ee=Math.PI/180*a.Ne,re=a.isLargeArc,oe=a.isClockwiseArc,ue=a.Dc,he=a.Ec,ge=Math.cos(ee),xe=Math.sin(ee),Pe=ge*(x-ue)/2+xe*(E-he)/2;ee=-xe*(x-ue)/2+ge*(E-he)/2;var Fe=Pe*Pe/(y*y)+ee*ee/(z*z);return 1<Fe&&(y*=Math.sqrt(Fe),z*=Math.sqrt(Fe)),Fe=(re===oe?-1:1)*Math.sqrt((y*y*z*z-y*y*ee*ee-z*z*Pe*Pe)/(y*y*ee*ee+z*z*Pe*Pe)),isNaN(Fe)&&(Fe=0),re=Fe*y*ee/z,Fe=Fe*-z*Pe/y,isNaN(re)&&(re=0),isNaN(Fe)&&(Fe=0),x=(x+ue)/2+ge*re-xe*Fe,E=(E+he)/2+xe*re+ge*Fe,he=b(1,0,(Pe-re)/y,(ee-Fe)/z),ge=(Pe-re)/y,ue=(ee-Fe)/z,Pe=(-Pe-re)/y,re=(-ee-Fe)/z,ee=b(ge,ue,Pe,re),Pe=(ge*Pe+ue*re)/(Math.sqrt(ge*ge+ue*ue)*Math.sqrt(Pe*Pe+re*re)),-1>=Pe?ee=Math.PI:1<=Pe&&(ee=0),!oe&&0<ee&&(ee-=2*Math.PI),oe&&0>ee&&(ee+=2*Math.PI),oe=y>z?1:y/z,Pe=y>z?z/y:1,y=Re.jx(0,0,y>z?y:z,he,he+ee,!0),z=gt.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(oe,Pe),lt.Ha(y,z),gt.free(z),a.ae=y,a.ae}At.Object.defineProperties(Er.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&&Lt(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Lt(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&Lt(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Lt(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Lt(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&Lt(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&Lt(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Lt(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Lt(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&_n(a,">= zero",Er,"radiusX"),this._isFrozen&&Lt(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&_n(a,">= zero",Er,"radiusY"),this._isFrozen&&Lt(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Lt(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&&Lt(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&&Lt(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&&Lt(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&&Lt(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Er.prototype.equalsApprox=Er.prototype.Xa;var Si=new yn(Er,"Move",0),Pi=new yn(Er,"Line",1),Jr=new yn(Er,"Bezier",2),Ur=new yn(Er,"QuadraticBezier",3),Nr=new yn(Er,"Arc",4),Lo=new yn(Er,"SvgArc",4);Er.className="PathSegment",Er.Move=Si,Er.Line=Pi,Er.Bezier=Jr,Er.QuadraticBezier=Ur,Er.Arc=Nr,Er.SvgArc=Lo;function yr(){this.H=null,this.xu=new Ie(0,0).freeze(),this.mt=new Ie(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}yr.prototype.copy=function(){var a=new yr;return this.clone(a)},yr.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},yr.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},yr.prototype.So=function(a,y){var x=this.diagram;return x===null||Pf(x,a,y),y},yr.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(Pf(x,a,y),y.assign(x.Ps(y))),y},At.Object.defineProperties(yr.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}}}),yr.prototype.getMultiTouchDocumentPoint=yr.prototype.Bz,yr.prototype.getMultiTouchViewPoint=yr.prototype.So,yr.className="InputEvent";function Qr(){this.H=null,this.xa="",this.ar=this.Lr=null}Qr.prototype.copy=function(){var a=new Qr;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Qr.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},At.Object.defineProperties(Qr.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}}}),Qr.className="DiagramEvent";function tr(){this.Fm=uo,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}tr.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},tr.prototype.copy=function(){var a=new tr;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=$t(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=$t(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=$t(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=$t(y)&&typeof y.J=="function"?y.J():y,a},tr.prototype.qb=function(a){a.classType===tr&&(this.change=a)},tr.prototype.toString=function(){var a="";return a=this.change===Ir?a+"* ":this.change===uo?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===Ir?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=Cr(this.object)),this.oldValue!==null&&(a+=" old: "+Cr(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+Cr(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},tr.prototype.I=function(a){return a?this.oldValue:this.newValue},tr.prototype.Dz=function(a){return a?this.oldParam:this.newParam},tr.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},tr.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},tr.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},tr.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},At.Object.defineProperties(tr.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===Ir&&(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}}}),tr.prototype.redo=tr.prototype.redo,tr.prototype.canRedo=tr.prototype.canRedo,tr.prototype.undo=tr.prototype.undo,tr.prototype.canUndo=tr.prototype.canUndo,tr.prototype.getParam=tr.prototype.Dz,tr.prototype.getValue=tr.prototype.I,tr.prototype.clear=tr.prototype.clear;var Ir=new yn(tr,"Transaction",-1),uo=new yn(tr,"Property",0),Zo=new yn(tr,"Insert",1),ha=new yn(tr,"Remove",2);tr.className="ChangedEvent",tr.Transaction=Ir,tr.Property=uo,tr.Insert=Zo,tr.Remove=ha;function La(){this.o=new Nn().freeze(),this.xa="",this.j=!1}La.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},La.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()},La.prototype.canUndo=function(){return this.isComplete},La.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()}},La.prototype.canRedo=function(){return this.isComplete},La.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()}},La.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new Gt,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===uo&&E.object){var b=y.get(E.object);b||(b=new Gt,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()}},At.Object.defineProperties(La.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}}}),La.prototype.optimize=La.prototype.ak,La.prototype.redo=La.prototype.redo,La.prototype.canRedo=La.prototype.canRedo,La.prototype.undo=La.prototype.undo,La.prototype.canUndo=La.prototype.canUndo,La.prototype.clear=La.prototype.clear,La.className="Transaction";function zr(){this.Pt=new Tn,this.Jd=!1,this.u=new Nn().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new Nn().freeze(),this.hl=new Nn,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}zr.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},zr.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},zr.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},be=zr.prototype,be.Xw=function(a){this.Pt.add(a)},be.Rx=function(a){this.Pt.remove(a)},be.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},be.eb=function(a){return a===void 0&&(a=""),bs(this,!0,a)},be.Kf=function(){return bs(this,!1,"")};function bs(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&ci("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 ee=a.Ie.count;0<ee&&(x===""&&(x=a.Ie.M(0)),a.Ie.ka(),a.Ie.mb(ee-1),a.Ie.freeze()),ee=a.hl.count,0<ee&&(z=a.hl.M(ee-1),a.hl.mb(ee-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}be.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()}},zr.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},zr.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){ci("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},zr.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},zr.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){ci("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},zr.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new tr;for(E.change=Ir,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},zr.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new La);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||ci("Change not within a transaction: "+x.toString()))}},zr.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},At.Object.defineProperties(zr.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}}}),zr.prototype.handleChanged=zr.prototype.Tu,zr.prototype.redo=zr.prototype.redo,zr.prototype.undo=zr.prototype.undo,zr.prototype.canUndo=zr.prototype.canUndo,zr.prototype.discardHistoryAfterIndex=zr.prototype.lx,zr.prototype.rollbackTransaction=zr.prototype.Kf,zr.prototype.commitTransaction=zr.prototype.eb,zr.prototype.startTransaction=zr.prototype.Ea,zr.prototype.removeModel=zr.prototype.Rx,zr.prototype.addModel=zr.prototype.Xw,zr.prototype.clear=zr.prototype.clear,zr.className="UndoManager";function eo(){Ar(this),this.H=Yu,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new yr,this.Zr=-1}eo.prototype.toString=function(){return this.name!==""?this.name+" Tool":Fi(this.constructor)},eo.prototype.updateAdornments=function(){},eo.prototype.canStart=function(){return this.isEnabled},eo.prototype.doStart=function(){},eo.prototype.doActivate=function(){this.isActive=!0},eo.prototype.doDeactivate=function(){this.isActive=!1},eo.prototype.doStop=function(){},eo.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},eo.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},eo.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},eo.prototype.doMouseMove=function(){},eo.prototype.doMouseUp=function(){this.stopTool()},eo.prototype.doMouseWheel=function(){},eo.prototype.canStartMultiTouch=function(){return!0},eo.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Ie.allocAt(NaN,NaN)),E=y.So(1,Ie.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}Ie.free(x),Ie.free(E)},eo.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Ie.allocAt(NaN,NaN)),E=y.So(1,Ie.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 Ie((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 ee=a.commandHandler;if(z!==a.scale&&ee.canResetZoom(z)){var re=a.zoomPoint;a.zoomPoint=b,ee.resetZoom(z),a.zoomPoint=re}y.bubbles=!1}Ie.free(x),Ie.free(E)},eo.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},eo.prototype.doKeyUp=function(){},eo.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},eo.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},eo.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(Gr?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||(Gr?y.meta:y.control)||y.shift||a.clearSelection()}},eo.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,ka(a,E,x),E.handled};function ka(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)}}}eo.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,ee=z;for(a.Ck=E,this.doCurrentObjectChanged(z,E),y.handled=!1;z!==null;){var re=z.mouseLeave;if(re!==null&&(E===z||E!==null&&E.rg(z)||(re(y,z,E),b=!0,y.handled)))break;z=z.panel}for(z=ee,y.handled=!1;E!==null&&(ee=E.mouseEnter,!(ee!==null&&(z===E||z!==null&&z.rg(E)||(ee(y,E,z),b=!0,y.handled))));)E=E.panel;E=a.Ck}if(E!==null){for(z=E,ee="";z!==null&&(ee=z.cursor,ee==="");)z=z.panel;for(a.currentCursor=ee,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}},eo.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},eo.prototype.doCurrentObjectChanged=function(){},eo.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===rs&&!y.shift||b===Ha&&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===rs&&y.shift||b===Ha&&!y.control){E=a.position.copy();var z=y.event;b=z.deltaMode;var ee=z.deltaX;z=z.deltaY;var re="pixel";if(ee===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(re,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(re,0<x?"left":"right",Math.abs(x)));else{switch(b){case 0:re="pixel";break;case 1:re="line";break;case 2:re="page"}ee!==0&&a.allowHorizontalScroll&&(ee*=a.scrollHorizontalLineChange/16,a.scroll(re,0<ee?"right":"left",Math.abs(ee))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(re,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,E,y)}}},eo.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},eo.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=vr(function(){x.doWaitAfter(E)},a)},eo.prototype.cancelWaitAfter=function(){this.Zr!==-1&&wn.clearTimeout(this.Zr),this.Zr=-1},eo.prototype.doWaitAfter=function(){},eo.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof ta);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},eo.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},At.Object.defineProperties(eo.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof jt&&(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}}}),eo.prototype.startTransaction=eo.prototype.Ea,eo.className="Tool";function wo(){eo.call(this),this.name="ToolManager",this.hb=new Nn,this.ob=new Nn,this.Hb=new Nn,this.F=this.V=850,this.o=new Pn(2,2).ja(),this.Ha=5e3,this.ia=Ha,this.u=su,this.Mp=this.j=null,this.zj=-1}_t(wo,eo),wo.prototype.initializeStandardTools=function(){},wo.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof ta&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},wo.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Rl&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===lu){y.bubbles=!0;return}if(this.gestureBehavior===Rl)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===Ha?this.mouseWheelBehavior=rs:this.mouseWheelBehavior===rs&&(this.mouseWheelBehavior=Ha)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},wo.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===lu){y.bubbles=!0;return}if(this.gestureBehavior===Rl)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}}ts(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function ts(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}wo.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof ta&&(y===a||y.rg(a))||this.hideToolTip()},wo.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()))},wo.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)},wo.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 ta)||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()},wo.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof ta){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 Tu&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(wn.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=vr(function(){b.hideToolTip()},a)}},wo.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}},wo.prototype.hideToolTip=function(){this.zj!==-1&&(wn.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof ta?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Tu&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},wo.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()},wo.prototype.doMouseWheel=function(){this.standardMouseWheel()},wo.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},wo.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},wo.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},wo.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},wo.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)},At.Object.defineProperties(wo.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 ta?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}}}),wo.prototype.replaceStandardTool=wo.prototype.gb;var Ha=new yn(wo,"WheelScroll",0),rs=new yn(wo,"WheelZoom",1),Ol=new yn(wo,"WheelNone",2),su=new yn(wo,"GestureZoom",3),Rl=new yn(wo,"GestureCancel",4),lu=new yn(wo,"GestureNone",5);wo.className="ToolManager",wo.WheelScroll=Ha,wo.WheelZoom=rs,wo.WheelNone=Ol,wo.GestureZoom=su,wo.GestureCancel=Rl,wo.GestureNone=lu;function Da(){eo.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 Ie(NaN,NaN),this.Fr=new Ie,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new Tn().freeze(),this.ia=new ae,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var al;_t(Da,eo),Da.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},Da.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},Da.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,(Gr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},Da.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),Es=null,this.isActive=!0,this.tl.set(a.position),jl(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&&Us(a),Ff(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,Es=this,Wn=this.diagram,this.doSimulatedDragOut()))};function jl(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof qn?(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 Ra,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}Da.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},Da.prototype.Pd=function(a){return a===void 0?new ch(ai):this.isGridSnapEnabled?new ch(new Ie(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new ch(a.copy())},Da.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),nl(this),Zh(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<al.count){for(var y=al,x=y.length,E=0;E<x;E++){var b=y.M(E);Oa(b),pa(b),nl(b),b.diagram.ug()}y.clear()}Oa(this),this.tl.h(NaN,NaN),Wn!==null&&(Wn.currentCursor=""),Es=Wn=null,pa(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),bc(a,!0)},Da.prototype.stopTransaction=function(){var a=this.diagram,y=eo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function nl(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,Nu(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function oh(){var a=Es;pa(a),Os(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}Da.prototype.doCancel=function(){pa(this),Os(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},Da.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},Da.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function dl(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")):Os(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 Gt,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 qn&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,jl(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,tc(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function pa(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 qn&&(x.value.point=new Ie(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Oa(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 hs(a,y,x){var E=a.diagram,b=a.startPoint,z=Ie.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),Ie.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(Us(E),E.hk())}Da.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&pd(E,a,y,this.dragOptions,x)};function Os(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 qn&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),tc(E,-b.x,-b.y)}y.bd()}}function Rs(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),zl(a,!1));var E=a.findDragOverObject(y),b=x.lastInput;b.targetObject=E,a.doUpdateCursor(E);var z=x.skipsUndoManager,ee=!1;try{if(x.skipsUndoManager=!0,ee=Nu(a,b,E),!a.isActive&&Es===null)return;var re=E!==null?E.part:null;if(re===null||x.handlesDragDropForTopLevelParts&&re.isTopLevel&&!(re instanceof to)){var oe=x.mouseDragOver;oe!==null&&(oe(b),ee=!0)}if(!a.isActive&&Es===null||(a.doDragOver(y,E),!a.isActive&&Es===null))return}finally{x.skipsUndoManager=z,ee&&x.bd()}a.Bn=E,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(b.viewPoint)}Da.prototype.findDragOverObject=function(a){var y=this;return uh(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof ta||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},Da.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 Nu(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 ee=0;ee<b;ee++){var re=a.Cg[ee],oe=re.mouseDragLeave;if(oe!==null&&(oe(y,re,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&Es===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=Bl(b);for(b=a.Cg.length,x=0;x<b&&(ee=a.Cg[x],re=ee.mouseDragEnter,re===null||(re(y,ee,z),E=!0,!y.handled));x++);return E}function Bl(a){var y=a.panel;return y!==null?y:a instanceof mr&&!(a instanceof to)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function Du(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(ue){return E.findValidLinkablePort(ue,x)});a=Ie.alloc();var z=1/0,ee=null;for(b=b.iterator;b.next();){var re=b.value;if(re.part!==null){var oe=re.ga(Hr,a);oe=y.Bf(oe),oe<z&&(ee=re,z=oe)}}return Ie.free(a),ee}function zl(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,ee=null;x.fromNode===null&&(z=Du(a,x.i(0),!1),z!==null&&(ee=z.part));var re=null,oe=null;x.toNode===null&&(re=Du(a,x.i(x.pointsCount-1),!0),re!==null&&(oe=re.part)),b.isValidLink(ee,z,oe,re)?y?(x.defaultFromPoint=x.i(0),x.defaultToPoint=x.i(x.pointsCount-1),x.suspendsRouting=!1,x.fromNode=ee,z!==null&&(x.fromPortId=z.portId),x.toNode=oe,re!==null&&(x.toPortId=re.portId),x.fromPort!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):ql(b,ee,z,oe,re):ql(b,null,null,null,null)}}}}Da.prototype.doDragOver=function(){};function uu(a,y){var x=a.diagram;a.dragsLink&&zl(a,!0),nl(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 ee=z.mouseDrop;if(ee!==null&&(ee(b,z),b.handled))break;of(a,b,z),z=Bl(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||Es!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof Ci&&z.linksConnected.each(function(re){re.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||Es!==null){for(a=Wt.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof Ci&&af(x,E,a);Wt.free(a)}}}function of(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof to||(x=a.mouseDrop,x!==null&&x(y))}function af(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 qn},!0,function(b){return b instanceof qn},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}Da.prototype.doDropOnto=function(){},Da.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()?(dl(this,!1),Ff(a,this.copiedParts),hs(this,this.copiedParts,!1),Zh(a,this.copiedParts)):this.mayMove()?(pa(this),hs(this,this.draggedParts,!0)):this.mayDragOut()?(dl(this,!1),hs(this,this.copiedParts,!1)):pa(this),Rs(this,a.lastInput.documentPoint))}},Da.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?(pa(this),dl(this,!0),Ff(a,this.copiedParts),hs(this,this.copiedParts,!1),Zh(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,pa(this),this.mayMove()&&(hs(this,this.draggedParts,!0),Rs(this,a.lastInput.documentPoint))),this.Ym=!0,uu(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&mc(this),a.Ya(),Zh(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},Da.prototype.simulatedMouseMove=function(a,y,x){if(Es===null)return!1;var E=Es.diagram;x instanceof jt||(x=null);var b=Wn;return x!==b&&(b!==null&&b!==E&&(b.ug(),Es.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),Wn=x,x!==null&&x!==E&&(oh(),b=x.toolManager.findTool("Dragging"),b!==null&&(al.contains(b)||al.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)},Da.prototype.simulatedMouseUp=function(a,y,x){if(Es===null)return!1;var E=Wn,b=Es.diagram;if(x===null)return Es.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),Es.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;Wn=x,E=x.toolManager.findTool("Dragging"),E!==null&&(oh(),al.contains(E)||al.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 Ie),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=Es,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function mc(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof Ci&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}Da.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Gr?!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())},Da.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())},Da.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())},Da.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},Da.prototype.Az=function(){return Es},Da.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=Es;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},Da.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),Wl(a),a.animationManager.Cc(),a=Es,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},Da.prototype.doSimulatedDragLeave=function(){var a=Es;a!==null&&a.doSimulatedDragOut(),this.doCancel()},Da.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=Es;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;sf(this,y.draggedParts.Lf(),!1,a.firstInput),hs(this,this.copiedParts,!1),Rs(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},Da.prototype.doSimulatedDrop=function(){var a=this.diagram,y=Es;if(y!==null){var x=y.diagram;if(y.Ym=!0,pa(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),sf(this,y.draggedParts.Lf(),!0,a.lastInput),hs(this,this.copiedParts,!1);var E=new Tn;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),uu(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 sf(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=Wt.alloc();b=E=1/0;for(var ee=-1/0,re=-1/0,oe=y.iterator;oe.next();){var ue=oe.value;if(ue.isVisible()){var he=ue.location;ue=he.x,he=he.y,isNaN(ue)||isNaN(he)||(ue<E&&(E=ue),he<b&&(b=he),ue>ee&&(ee=ue),he>re&&(re=he))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,ee-E,re-b),E=z.x+z.width/2,b=z.y+z.height/2,Wt.free(z),z=a.Fr,ee=new Gt,re=Ie.alloc(),oe=y.iterator;oe.next();)ue=oe.value,ue instanceof qn&&ue.canCopy()&&(he=x.I(ue),he!==null&&(he.points=ue.points,tc(he,z.x-E,z.y-b),he.suspendsRouting=!0,ee.add(he,a.Pd())));for(y=y.iterator;y.next();)ue=y.value,ue.Zc()&&ue.canCopy()&&(oe=x.I(ue),oe!==null&&(ue=ue.location,re.h(z.x-(E-ue.x),z.y-(b-ue.y)),oe.location=re,oe.Va(),ee.add(oe,a.Pd(re))));Ie.free(re),a.copiedParts=ee,jl(a,ee.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,tc(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}Da.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},Da.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new Ie},At.Object.defineProperties(Da.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}}}),Da.prototype.getDraggingSource=Da.prototype.Az;var Es=null,Wn=null;Da.className="DraggingTool",al=new Nn,Sr("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),wo.prototype.doCancel=function(){Es!==null&&Es.doCancel(),eo.prototype.doCancel.call(this)};function gr(){eo.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new qn,y=new lo;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new lo,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new Ci,y=new lo,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=or,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new Ci,y=new lo,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=or,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 Gt,this.Of=this.gj=this.Pf=null}_t(gr,eo),gr.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},gr.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),ee=Pn.alloc();ee.width=y.naturalBounds.width*z,ee.height=y.naturalBounds.height*z,E.desiredSize=ee,Pn.free(ee),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=Hr,z=Ie.alloc(),x.location=y.ga(Hr,z),Ie.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},gr.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=or,y.fromSpot=Xr,y.toSpot=Xr),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},gr.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},gr.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof Ci){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)}},gr.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof Ci))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof Ci)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},gr.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(ge){return b.findValidLinkablePort(ge,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var ee=z.value,re=ee.part;if(re instanceof Ci){var oe=ee.ga(Hr,Ie.alloc()),ue=x.x-oe.x,he=x.y-oe.y;Ie.free(oe),oe=ue*ue+he*he,oe<E&&(ue=this.validPortsCache.I(ee),ue!==null?ue&&(y=ee,E=oe):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,re,ee)||!a&&this.isValidLink(re,ee,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(ee,!0),y=ee,E=oe):this.validPortsCache.add(ee,!1))}}return y!==null&&(x=y.part,x instanceof Ci&&(x.layer===null||x.layer.allowLink))?y:null},gr.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},gr.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},gr.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},gr.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof Ci))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof Ci))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},gr.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)},gr.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 Tn;return E.add(a),_o(this,x,y,E)};function _o(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),_o(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),_o(a,y.labeledLink,x,E))))}gr.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!==Sd){if(E===vg){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!io(this,a,y,x,!0)}if(E===yg){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!io(this,a,y,x,!0)}if(E===gg)return a===y?a=!0:(E=new Tn,E.add(y),a=nr(this,E,a,y,x)),!a;if(E===pg)return!io(this,a,y,x,!1);if(E===mg)return a===y?a=!0:(E=new Tn,E.add(y),a=Aa(this,E,a,y,x)),!a}return!0};function io(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 ee=z.value;if(ee!==E&&(!b||ee.isTreeLink)&&ee.toNode===y&&(ee=ee.fromNode,ee!==y&&io(a,ee,x,E,b)))return!0}return!1}function nr(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 ee=z.value;if(ee!==b&&ee.toNode===x&&(ee=ee.fromNode,ee!==x&&nr(a,y,ee,E,b)))return!0}return!1}function Aa(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 ee=z.value;if(ee!==b){var re=ee.fromNode;if(ee=ee.toNode,re=re===x?ee:re,re!==x&&Aa(a,y,re,E,b))return!0}}return!1}At.Object.defineProperties(gr.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}}}),gr.className="LinkingBaseTool";function ma(){gr.call(this),this.name="Linking",this.V={},this.F=null,this.K=Ua,this.Xd=null}_t(ma,gr),ma.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},ma.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 Ci)))return null;var x=this.direction;if(x===Ua||x===Pa){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===Ua||x===Ks)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},ma.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 Ci&&(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 Ci&&(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)},ma.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()},ma.prototype.doStop=function(){gr.prototype.doStop.call(this),this.startObject=null},ma.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,E=null,b=null,z=null;try{var ee=this.targetPort=this.findTargetPort(this.isForwards);if(ee!==null){var re=ee.part;re instanceof Ci&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=re,b=ee):(y=re,x=ee,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?(ee===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)}}},ma.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof qn)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)},ma.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},ma.prototype.doNoLink=function(){},At.Object.defineProperties(ma.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 Ua=new yn(ma,"Either",0),Pa=new yn(ma,"ForwardsOnly",0),Ks=new yn(ma,"BackwardsOnly",0);ma.className="LinkingTool",ma.Either=Ua,ma.ForwardsOnly=Pa,ma.BackwardsOnly=Ks;function Ra(){gr.call(this),this.name="Relinking";var a=new lo;a.figure="Diamond",a.desiredSize=Yr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new lo,a.figure="Diamond",a.desiredSize=Yr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new Wt}_t(Ra,gr),Ra.prototype.updateAdornments=function(a){if(a!==null&&a instanceof qn){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)}},Ra.prototype.makeAdornment=function(a,y){var x=new ta;return x.type=Vn.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},Ra.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},Ra.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 ta&&x.adornedPart instanceof qn))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=hr),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=hr),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},Ra.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===mp||x===nc)&&(x=wl),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}},Ra.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()},Ra.prototype.doStop=function(){gr.prototype.doStop.call(this),this.handle=null},Ra.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 ee=this.targetPort.part;ee instanceof Ci&&(this.isForwards?(E=ee,b=this.targetPort):(y=ee,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()}}},Ra.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},Ra.prototype.doNoRelink=function(){};function ql(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)}At.Object.defineProperties(Ra.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 ta))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),Ra.className="RelinkingTool",Sr("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),Sr("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function Xa(){eo.call(this),this.name="LinkReshaping";var a=new lo;a.figure="Rectangle",a.desiredSize=xo,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new lo,a.figure="Diamond",a.desiredSize=Yr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new Ie,this.Yq=new Nn}_t(Xa,eo),Xa.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:Zl},Xa.prototype.om=function(a,y){a.reshapingBehavior=y},Xa.prototype.updateAdornments=function(a){if(a!==null&&a instanceof qn){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)}},Xa.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new ta,b.type=Vn.Link,x=y.firstPickIndex;var z=y.lastPickIndex,ee=E?1:0;if(y.resegmentable&&y.computeCurve()!==vu)for(var re=x+ee;re<z-ee;re++){var oe=this.makeResegmentHandle(a,re);oe!==null&&(oe.segmentIndex=re,oe.segmentFraction=.5,oe.fromMaxLinks=999,b.add(oe))}for(ee=x+1;ee<z;ee++)if(re=this.makeHandle(a,ee),re!==null){if(re.segmentIndex=ee,ee!==x)if(ee===x+1&&E){oe=y.i(x);var ue=y.i(x+1);Re.B(oe.x,ue.x)&&Re.B(oe.y,ue.y)&&(ue=y.i(x-1)),Re.B(oe.x,ue.x)?(this.om(re,Ds),re.cursor="n-resize"):Re.B(oe.y,ue.y)&&(this.om(re,sl),re.cursor="w-resize")}else ee===z-1&&E?(oe=y.i(z-1),ue=y.i(z),Re.B(oe.x,ue.x)&&Re.B(oe.y,ue.y)&&(oe=y.i(z+1)),Re.B(oe.x,ue.x)?(this.om(re,Ds),re.cursor="n-resize"):Re.B(oe.y,ue.y)&&(this.om(re,sl),re.cursor="w-resize")):ee!==z&&(this.om(re,Su),re.cursor="move");b.add(re)}b.adornedObject=a}return b},Xa.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},Xa.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},Xa.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},Xa.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 qn){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}}},Xa.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},Xa.prototype.stopTransaction=function(){var a=this.diagram,y=eo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Xa.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},Xa.prototype.getResegmentingPoint=function(){return this.handle.ga(Hr)},Xa.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},Xa.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 ee=y.i(x-2);if(Math.abs(E.x-b.x)<this.resegmentingDistance&&Math.abs(E.y-b.y)<this.resegmentingDistance&&(Oo(this,ee,E,b,z,!0)||Oo(this,ee,E,b,z,!1))){var re=y.points.copy();Oo(this,ee,E,b,z,!0)?(re.cd(x-2,new Ie(ee.x,(z.y+ee.y)/2)),re.cd(x+1,new Ie(z.x,(z.y+ee.y)/2))):(re.cd(x-2,new Ie((z.x+ee.x)/2,ee.y)),re.cd(x+1,new Ie((z.x+ee.x)/2,z.y))),re.mb(x),re.mb(x-1),y.points=re,y.Wb()}else ee=y.i(x+2),Math.abs(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(Oo(this,E,b,z,ee,!0)||Oo(this,E,b,z,ee,!1))&&(re=y.points.copy(),Oo(this,E,b,z,ee,!0)?(re.cd(x-1,new Ie(E.x,(E.y+ee.y)/2)),re.cd(x+2,new Ie(ee.x,(E.y+ee.y)/2))):(re.cd(x-1,new Ie((E.x+ee.x)/2,E.y)),re.cd(x+2,new Ie((E.x+ee.x)/2,ee.y))),re.mb(x+1),re.mb(x),y.points=re,y.Wb())}}else ee=Ie.alloc(),Re.qh(E.x,E.y,z.x,z.y,b.x,b.y,ee)&&ee.Bf(b)<this.resegmentingDistance*this.resegmentingDistance&&(E=y.points.copy(),E.mb(x),y.points=E,y.Wb()),Ie.free(ee)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function Oo(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}Xa.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===Ds?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===sl&&(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===Ds?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===sl&&(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),ee=y.i(E+1);Re.B(z.x,b.x)&&Re.B(b.y,ee.y)?(Re.B(z.x,y.i(E-2).x)&&!Re.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),Re.B(ee.y,y.i(E+2).y)&&!Re.B(ee.x,y.i(E+2).x)?y.m(E+1,ee.x,a.y):y.L(E+1,ee.x,a.y)):Re.B(z.y,b.y)&&Re.B(b.x,ee.x)?(Re.B(z.y,y.i(E-2).y)&&!Re.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),Re.B(ee.x,y.i(E+2).x)&&!Re.B(ee.y,y.i(E+2).y)?y.m(E+1,a.x,ee.y):y.L(E+1,a.x,ee.y)):Re.B(z.x,b.x)&&Re.B(b.x,ee.x)?(Re.B(z.x,y.i(E-2).x)&&!Re.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),Re.B(ee.x,y.i(E+2).x)&&!Re.B(ee.y,y.i(E+2).y)?y.m(E+1,a.x,ee.y):y.L(E+1,a.x,ee.y)):Re.B(z.y,b.y)&&Re.B(b.y,ee.y)&&(Re.B(z.y,y.i(E-2).y)&&!Re.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),Re.B(ee.y,y.i(E+2).y)&&!Re.B(ee.x,y.i(E+2).x)?y.m(E+1,ee.x,a.y):y.L(E+1,ee.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(Hr,Ie.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,Ie.alloc()),y.L(0,E.x,E.y),Ie.free(z),Ie.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(Hr,Ie.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,Ie.alloc()),y.L(y.pointsCount-1,a.x,a.y),Ie.free(x),Ie.free(a));y.zf()},Xa.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case Su:return a;case Ds:return new Ie(y.i(x).x,a.y);case sl:return new Ie(a.x,y.i(x).y);default:case Zl:return y.i(x)}},At.Object.defineProperties(Xa.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 ta))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}}}),Xa.prototype.setReshapingBehavior=Xa.prototype.om,Xa.prototype.getReshapingBehavior=Xa.prototype.Ru;var Zl=new yn(Xa,"None",0),sl=new yn(Xa,"Horizontal",1),Ds=new yn(Xa,"Vertical",2),Su=new yn(Xa,"All",3);Xa.className="LinkReshapingTool",Xa.None=Zl,Xa.Horizontal=sl,Xa.Vertical=Ds,Xa.All=Su,Sr("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Cs(){eo.call(this),this.name="Resizing",this.o=new Pn(1,1).freeze(),this.j=new Pn(9999,9999).freeze(),this.yg=new Pn(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new lo;a.alignmentFocus=Hr,a.figure="Rectangle",a.desiredSize=xo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new Ie,this.Dw=new Pn,this.Tn=new Ie,this.rt=new Pn(0,0),this.qt=new Pn(1/0,1/0),this.pt=new Pn(1,1)}_t(Cs,eo),Cs.prototype.updateAdornments=function(a){if(!(a===null||a instanceof qn)){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(),Rc(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},Cs.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new ta,y.type=Vn.Spot,y.locationSpot=Hr;var x=new Sl;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,Po)),y.add(this.makeHandle(a,ea)),y.add(this.makeHandle(a,Zt)),y.add(this.makeHandle(a,is)),y.add(this.makeHandle(a,Ro)),y.add(this.makeHandle(a,ko)),y.add(this.makeHandle(a,jr)),y.add(this.makeHandle(a,ua))}else if(zu(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Cs.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Cs.prototype.updateResizeHandles=function(a,y){if(a!==null){if(!a.alignment.Xb()&&(a.cursor==="pointer"||0<a.cursor.indexOf("resize")))e:{var x=a.alignment;if(x.Mc()&&(x=Hr),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 e;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 Vn)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},Cs.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},Cs.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))},Cs.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Cs.prototype.stopTransaction=function(){var a=this.diagram,y=eo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Cs.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Cs.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,Ie.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),Ie.free(b)}},Cs.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,Ie.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),Ie.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Cs.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 to){var E=new Nn;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new ae;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()}},Cs.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=Hr);var ee=this.adornedObject.naturalBounds,re=ee.x,oe=ee.y,ue=ee.x+ee.width,he=ee.y+ee.height,ge=1;if(!z){ge=ee.width;var xe=ee.height;0>=ge&&(ge=1),0>=xe&&(xe=1),ge=xe/ge}return xe=Ie.alloc(),Re.No(a.x,a.y,re,oe,b.width,b.height,xe),a=ee.copy(),0>=y.x?0>=y.y?(a.x=Math.max(xe.x,ue-E.width),a.x=Math.min(a.x,ue-x.width),a.width=Math.max(ue-a.x,x.width),a.y=Math.max(xe.y,he-E.height),a.y=Math.min(a.y,he-x.height),a.height=Math.max(he-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ge*a.width,E.height),x.height),a.width=a.height/ge):(a.width=Math.max(Math.min(a.height/ge,E.width),x.width),a.height=ge*a.width),a.x=ue-a.width,a.y=he-a.height)):1<=y.y?(a.x=Math.max(xe.x,ue-E.width),a.x=Math.min(a.x,ue-x.width),a.width=Math.max(ue-a.x,x.width),a.height=Math.max(Math.min(xe.y-oe,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ge*a.width,E.height),x.height),a.width=a.height/ge):(a.width=Math.max(Math.min(a.height/ge,E.width),x.width),a.height=ge*a.width),a.x=ue-a.width)):(a.x=Math.max(xe.x,ue-E.width),a.x=Math.min(a.x,ue-x.width),a.width=ue-a.x,z||(a.height=Math.max(Math.min(ge*a.width,E.height),x.height),a.width=a.height/ge,a.y=oe+.5*(he-oe-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(xe.x-re,E.width),x.width),a.y=Math.max(xe.y,he-E.height),a.y=Math.min(a.y,he-x.height),a.height=Math.max(he-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ge*a.width,E.height),x.height),a.width=a.height/ge):(a.width=Math.max(Math.min(a.height/ge,E.width),x.width),a.height=ge*a.width),a.y=he-a.height)):1<=y.y?(a.width=Math.max(Math.min(xe.x-re,E.width),x.width),a.height=Math.max(Math.min(xe.y-oe,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ge*a.width,E.height),x.height),a.width=a.height/ge):(a.width=Math.max(Math.min(a.height/ge,E.width),x.width),a.height=ge*a.width))):(a.width=Math.max(Math.min(xe.x-re,E.width),x.width),z||(a.height=Math.max(Math.min(ge*a.width,E.height),x.height),a.width=a.height/ge,a.y=oe+.5*(he-oe-a.height))):0>=y.y?(a.y=Math.max(xe.y,he-E.height),a.y=Math.min(a.y,he-x.height),a.height=he-a.y,z||(a.width=Math.max(Math.min(a.height/ge,E.width),x.width),a.height=ge*a.width,a.x=re+.5*(ue-re-a.width))):1<=y.y&&(a.height=Math.max(Math.min(xe.y-oe,E.height),x.height),z||(a.width=Math.max(Math.min(a.height/ge,E.width),x.width),a.height=ge*a.width,a.x=re+.5*(ue-re-a.width))),Ie.free(xe),a},Cs.prototype.computeReshape=function(){var a=Mn;return this.adornedObject instanceof lo&&(a=Tv(this.adornedObject)),!(a===qi||this.diagram.lastInput.shift)},Cs.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},Cs.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},Cs.prototype.computeCellSize=function(){var a=new Pn(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},At.Object.defineProperties(Cs.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 ta))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 ta)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}}}),Cs.className="ResizingTool",Sr("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function Ts(){eo.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new Ie,this.ue=null;var a=new lo;a.figure="Ellipse",a.desiredSize=Yr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new Ie(NaN,NaN),this.u=0,this.F=50}_t(Ts,eo),Ts.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)}},Ts.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new ta,y.type=Vn.Position,y.locationSpot=Hr;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(zu(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ts.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},Ts.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)},Ts.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(Hr)},Ts.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)},Ts.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new Ie(NaN,NaN),this.isActive=a.isMouseCaptured=!1},Ts.prototype.stopTransaction=function(){var a=this.diagram,y=eo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ts.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Ts.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},Ts.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()},Ts.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()}},Ts.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},At.Object.defineProperties(Ts.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 ta))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 ta)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}}}),Ts.className="RotatingTool",Sr("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function Ml(){eo.call(this),this.name="ClickSelecting"}_t(Ml,eo),Ml.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},Ml.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},Ml.className="ClickSelectingTool";function Js(){eo.call(this),this.name="Action",this.pk=null}_t(Js,eo),Js.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},Js.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()},Js.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))}},Js.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()},Js.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())},Js.prototype.doStop=function(){this.pk=null},Js.className="ActionTool";function _h(){eo.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new Ie(0,0)}_t(_h,eo),_h.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)},_h.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},_h.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 mr)x.Zc()&&(zu(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);$t(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=Ie.allocAt(a.x,a.y);this.isGridSnapEnabled&&bf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),Ie.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},At.Object.defineProperties(_h.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}}}),_h.className="ClickCreatingTool";function Gl(){eo.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new mr;a.layerName="Tool",a.selectable=!1;var y=new lo;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}_t(Gl,eo),Gl.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))},Gl.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},Gl.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},Gl.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=Pn.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),Pn.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},Gl.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()},Gl.prototype.computeBoxBounds=function(){var a=this.diagram;return new Wt(a.firstInput.documentPoint,a.lastInput.documentPoint)},Gl.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),Gr?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 Nn,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)}},At.Object.defineProperties(Gl.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}}}),Gl.className="DragSelectingTool";function js(){eo.call(this),this.name="Panning",this.Xt=new Ie,this.xy=new Ie,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(wn.document,"scroll",a.Kw,!1),a.stopTool()}}_t(js,eo),js.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())},js.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(wn.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},js.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},js.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},js.prototype.doMouseMove=function(){this.move()},js.prototype.doMouseUp=function(){this.move(),this.stopTool()},js.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)}},At.Object.defineProperties(js.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),js.className="PanningTool",Sr("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),Sr("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),Sr("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),Sr("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),Sr("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Tu(){this.F=this.u=this.j=this.o=null}At.Object.defineProperties(Tu.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}}}),Tu.className="HTMLInfo";function hu(a,y,x){this.text=a,this.hx=y,this.visible=x}hu.className="ContextMenuButtonInfo";function ll(){eo.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new Ie,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}_t(ll,eo);function du(a){var y=new Tu;y.show=function(b,z,ee){ee.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},od=y,a.tu=function(){a.stopTool()},y=Dr("div");var x=Dr("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=Dr("style");wn.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",us,!1),E.addEventListener(y,"selectstart",us,!1),E.addEventListener(x,"contextmenu",us,!1)),y.className="goCXforeground",x.className="goCXbackground",wn.document.body&&(wn.document.body.appendChild(y),wn.document.body.appendChild(x)),yc=y,Pu=x,vc=!0}function us(a){return a.preventDefault(),!1}ll.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)},ll.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},ll.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},ll.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof jt||(a instanceof Ft?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},ll.prototype.doActivate=function(){},ll.prototype.doMouseDown=function(){if(eo.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof ta){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&wu(this)},ll.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof ta){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}wu(this)};function wu(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Tu||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(Fh(a,!0),a.isActive||a.stopTool())}ll.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function Fh(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=od,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof Ft?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof ta&&!a.currentContextMenu.visible&&a.stopTool()}}ll.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},ll.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof ta){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 Tu&&a.show(y,x,this);this.currentContextMenu=a},ll.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}},ll.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof ta?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Tu&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Oh(a){var y=new Nn;return y.add(new hu("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new hu("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new hu("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new hu("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new hu("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new hu("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new hu("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new hu("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new hu("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new hu("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new hu("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new hu("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new hu("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}ll.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Oh(this)),yc.innerHTML="",Pu.addEventListener("pointerdown",this.tu,!1);var y=this,x=Dr("ul");x.className="goCXul",yc.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=Dr("li"),z.className="goCXli";var ee=Dr("a");ee.className="goCXa",ee.href="#",ee.ky=b.hx,ee.addEventListener("pointerdown",function(re){return this.ky(a),y.stopTool(),re.preventDefault(),!1},!1),ee.textContent=b.text,z.appendChild(ee),x.appendChild(z)}}yc.style.display="block",Pu.style.display="block"},ll.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===od){yc.style.display="none",Pu.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Pu,"pointerdown",this.tu,!1),this.currentContextMenu=null}},At.Object.defineProperties(ll.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof ta?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return vc===!1&&od===null&&Ja&&du(this),od},set:function(a){a===null&&(vc=!0),od=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var od=null,vc=!1,Pu=null,yc=null;ll.className="ContextMenuTool",Sr("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Ta(){eo.call(this),this.name="TextEditing",this.Zh=new Ia,this.ia=null,this.V=_d,this.vj=null,this.qa=sd,this.u=1,this.F=!0,this.o=null,this.j=new Tu,this.kt=null,ad(this,this.j)}_t(Ta,eo);function ad(a,y){if(Ja){var x=Dr("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(Id)):b==="Tab"?(a.acceptText(lf),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==sd){var E=a.kt;a.qa===Sc&&(a.qa=ld),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==sd){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 Ia&&z instanceof Ta)if(z.state===ud)x.style.border="3px solid red",x.focus();else{var ee=E.ga(Hr),re=b.position,oe=b.scale,ue=E.Df()*oe;ue<z.minimumEditorScale&&(ue=z.minimumEditorScale);var he=E.naturalBounds.width*ue+6,ge=E.naturalBounds.height*ue+2,xe=(ee.x-re.x)*oe;ee=(ee.y-re.y)*oe,re=E.verticalAlignment,oe=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*ue,ge=re.y*ge-re.y*oe+re.offsetY-(.5*ge-.5*oe)-oe/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*ue+"%",x.style.lineHeight="normal",x.style.width=he+"px",x.style.left=(xe-he/2|0)-1+"px",x.style.top=(ee+ge|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=ue,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)}}}Ta.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||ah&&ah!==this&&(ah.acceptText(Iu),ah&&ah!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof Ia&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===_d&&!y.isSelected||this.starting===uf&&2>a.lastInput.clickCount)):!1},Ta.prototype.doStart=function(){ah=this,this.textBlock!==null&&this.doActivate()},Ta.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 Ia&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=Sc;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new Wt(this.textBlock.ga(Po),this.textBlock.ga(Zt));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},Ta.prototype.doCancel=function(){this.stopTool()},Ta.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Ta.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Iu)},Ta.prototype.acceptText=function(a){switch(a){case Iu:this.qa===Od?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===Sc||this.qa===ud||this.qa===ld)&&(this.qa=hf,Uf(this));break;case xc:case Id:case lf:(Id!==a||this.textBlock.isMultiline!==!0)&&(this.qa===Sc||this.qa===ud||this.qa===ld)&&(this.qa=hf,Uf(this))}};function Uf(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=Od,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=ud,a.doError(b,z))}}Ta.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)},Ta.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Ta.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=sd,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},Ta.prototype.doStop=function(){ah=null},Ta.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)))},Ta.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},At.Object.defineProperties(Ta.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)}}}),Ta.prototype.measureTemporaryTextBlock=Ta.prototype.Lx;var xc=new yn(Ta,"LostFocus",0),Iu=new yn(Ta,"MouseDown",1),lf=new yn(Ta,"Tab",2),Id=new yn(Ta,"Enter",3),Wg=new yn(Ta,"SingleClick",0),_d=new yn(Ta,"SingleClickSelected",1),uf=new yn(Ta,"DoubleClick",2),sd=new yn(Ta,"StateNone",0),Sc=new yn(Ta,"StateActive",1),ld=new yn(Ta,"StateEditing",2),hf=new yn(Ta,"StateValidating",3),ud=new yn(Ta,"StateInvalid",4),Od=new yn(Ta,"StateValidated",5),ah=null;Ta.className="TextEditingTool",Ta.LostFocus=xc,Ta.MouseDown=Iu,Ta.Tab=lf,Ta.Enter=Id,Ta.SingleClick=Wg,Ta.SingleClickSelected=_d,Ta.DoubleClick=uf,Ta.StateNone=sd,Ta.StateActive=Sc,Ta.StateEditing=ld,Ta.StateValidating=hf,Ta.StateInvalid=ud,Ta.StateValidated=Od,Sr("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function kl(a){Pc||(dd(),Pc=!0),this.H=Yu,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=il,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new Tn,this.ce=new Zs,this.ce.Yd=this,this.Ei=new Tn,this.pu=new Tn,this.Sr=new Tn,this.pr=new Tn,a&&Object.assign(this,a)}kl.prototype.Xe=function(a){this.H=a},kl.prototype.canStart=function(){return!0};function sh(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),Gs(a.H),a.zb=!0)}function df(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===il?(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===mf&&y.vc.clear(),a.Qw=!!(a.Pk===cd&&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(),Rd(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==rl&&E!==null&&(delete E.start.scale,delete E.end.scale),wn.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&Us(x),Fc(x),a.zb=!1,y.start(),y.bc&&(Eu(a),x.Ya(),Yf(y,0),Wl(x,!0),_u(a),x.R("AnimationStarting",a)))}))}}function lh(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function cf(a,y,x,E){a.isTicking||lh(a)||y instanceof qn&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}be=kl.prototype,be.fv=function(a){return this.ce.fv(a)},be.Xu=function(a){return this.ce.Xu(a)};function ff(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 ee=z.value;if(ee.bc!==!1){e:if(0<ee.yl.count)var re=!0;else{for(re=ee.vc.iterator;re.next();){var oe=re.key;if(oe instanceof Ft&&oe.diagram!==null||oe instanceof jt){re=!0;break e}}re=!1}re?Ec(ee,!1):ee.Xk=!0}}b.pu.clear(),b.bc!==!1&&(Eu(b),Wl(b.H),_u(b)),wn.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),wn.requestAnimationFrame(function(){x()}))}function Hg(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function Eu(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 _u(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}be.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(),Rd(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Rd(y,this.H)},be.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))},be.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),cl(this,a))},be.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),Ou(this.ce,y,"position",y.position,y.position),cl(this,a))};function gf(a,y,x){!a.zb||y.D(x)||lh(a)||(a.H.pi||(y=x.copy()),Ou(a.ce,a.H,"position",y,x))}function pf(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function cl(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function hd(a,y,x,E,b){a===null&&(a=[0,0,0,0]),y===null&&(y=[0,0,0,0]);var z=a[0],ee=a[1],re=a[2];a=a[3];var oe=y[0],ue=y[1],he=y[2];return y=y[3],re===0||re===100?(z=oe,ee=ue):(he===0||he===100)&&(oe=z,ue=ee),180<Math.abs(oe-z)&&(oe>z?z+=360:oe+=360),z=b(x,z,oe-z,E)%360,ee=b(x,ee,ue-ee,E),re=b(x,re,he-re,E),x=b(x,a,y-a,E),"hsla("+z+", "+ee+"%, "+re+"%, "+x+")"}function dd(){function a(x,E,b,z,ee,re){x.position=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}var y=new Gt;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,ee,re){ee<re?x.mm(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re),!1):x.position=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}),y.add("location",function(x,E,b,z,ee,re){ee<re?x.mm(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re),!0):x.location=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}),y.add("position:placeholder",function(x,E,b,z,ee,re){ee<re?x.mm(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re),!1):x.position=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}),y.add("position:nodeCollapse",function(x,E,b,z,ee,re){var oe=x.actualBounds,ue=b.actualBounds;b=ue.x+ue.width/2-oe.width/2,oe=ue.y+ue.height/2-oe.height/2,ee<re?x.mm(z(ee,E.x,b-E.x,re),z(ee,E.y,oe-E.y,re),!1):x.position=new Ie(z(ee,E.x,b-E.x,re),z(ee,E.y,oe-E.y,re))}),y.add("desiredSize",function(x,E,b,z,ee,re){x.desiredSize=new Wt(z(ee,E.width,b.width-E.width,re),z(ee,E.height,b.height-E.height,re))}),y.add("width",function(x,E,b,z,ee,re){x.width=z(ee,E,b-E,re)}),y.add("height",function(x,E,b,z,ee,re){x.height=z(ee,E,b-E,re)}),y.add("fill",function(x,E,b,z,ee,re){x.fill=hd(E,b,ee,re,z)}),y.add("stroke",function(x,E,b,z,ee,re){x.stroke=hd(E,b,ee,re,z)}),y.add("strokeWidth",function(x,E,b,z,ee,re){x.strokeWidth=z(ee,E,b-E,re)}),y.add("strokeDashOffset",function(x,E,b,z,ee,re){x.strokeDashOffset=z(ee,E,b-E,re)}),y.add("background",function(x,E,b,z,ee,re){x.background=hd(E,b,ee,re,z)}),y.add("areaBackground",function(x,E,b,z,ee,re){x.areaBackground=hd(E,b,ee,re,z)}),y.add("opacity",function(x,E,b,z,ee,re){x.opacity=z(ee,E,b-E,re)}),y.add("scale",function(x,E,b,z,ee,re){x.scale=z(ee,E,b-E,re)}),y.add("angle",function(x,E,b,z,ee,re){x.angle=z(ee,E,b-E,re)}),wc=y}At.Object.defineProperties(kl.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&&_n(a,">= 1",kl,"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}}}),kl.prototype.stopAnimation=kl.prototype.Cc;var wc=null,Pc=!1,il=new yn(kl,"Default",1),cd=new yn(kl,"AnimateLocations",2),mf=new yn(kl,"None",3);kl.className="AnimationManager",kl.defineAnimationEffect=function(a,y){Pc||(dd(),Pc=!0),wc.add(a,y)},kl.Default=il,kl.AnimateLocations=cd,kl.None=mf;function Zs(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=jd,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=ai,this.vc=new Gt,this.Tt=new Gt,this.yl=new Tn,this.Ut=new Tn,this.dw=Hh,a&&Object.assign(this,a)}Zs.prototype.suspend=function(){this.Xk=!0},Zs.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Ec(this,!0),Eu(this.Yd),Wl(this.H),_u(this.Yd),this.H.redraw()};function Rd(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}be=Zs.prototype,be.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 jt?a=x:x instanceof Ft&&(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===il&&this===y.defaultAnimation&&(this.Lp=vf,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=Ac),Eu(y),this.yl.each(function(E){E.data=null,a.add(E)}),_u(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,ff(y,this),this)},be.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},be.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof jt?this.H=a:a instanceof Ft&&a.diagram!==null&&(this.H=a.diagram)),a instanceof mr){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return Ou(this,a,y,x,E,b),this};function Ou(a,y,x,E,b,z){var ee=a.vc;if(y instanceof jt&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(mu(E),kf(),E=[Ul.j,Ul.u,Ul.o,Ul.F],mu(b),kf(),b=[Ul.j,Ul.u,Ul.o,Ul.F]),ee.contains(y)){var re=ee.I(y),oe=re.start,ue=re.end;oe[x]===void 0&&(oe[x]=Rh(E)),ue[x]=Rh(b)}else oe={},ue={},oe[x]=Rh(E),ue[x]=Rh(b),re=oe.position,y instanceof Ft&&re instanceof Ie&&!re.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&re.assign(ue.position),re=new Ku(oe,ue,z),ee.add(y,re);ee=oe[x],ee instanceof Ie&&!ee.w()&&ee.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof mr?re.Ku.location=Rh(y.location):z&&(re.Ku[x]=Rh(E))}function Rh(a){return a instanceof Ie||a instanceof Pn?a.copy():a}be.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},be.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Ec(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),Eu(x),Yf(a,b),Wl(a.H,!0),_u(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 Yf(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof Ft&&z.diagram===null)){var ee=E.value,re=b?ee.end:ee.start;ee=b?ee.start:ee.end;var oe=wc,ue;for(ue in ee)ue==="position"&&(ee["position:placeholder"]||ee["position:nodeCollapse"])||oe.get(ue)===null||oe.get(ue)(z,re[ue],ee[ue],a.Lp,y,x,a)}}}be.stop=function(){return this.bc?(this.Ml(!0),this):this},be.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,Eu(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=wc;E.next();){var ee=E.key,re=E.value,oe=b?re.end:re.start,ue=b?re.start:re.end,he=re.Ku,ge;for(ge in ue)if(z.get(ge)!==null){var xe=ge;!re.Hu||xe!=="position:nodeCollapse"&&xe!=="position:placeholder"||(xe="position"),z.get(xe)(ee,oe[ge],he[ge]!==void 0?he[ge]:re.Hu?oe[ge]:ue[ge],this.Lp,this.Gd,this.Gd,this)}re.Hu&&he.location!==void 0&&ee instanceof mr&&(ee.location=he.location),re.nv&&ee instanceof mr&&ee.Zb(!1)}if(y.As.clear(),bc(y,!1),y.Ya(),y.N(),Wl(y,!0),x.defaultAnimation===this){for(ge=x.pr.iterator;ge.next();)b=ge.value,b.Tg!==null&&(b.points=b.Tg,b.Tg=null);x.pr.clear()}Wl(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),_u(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Rd(this,null),x.Ml(this),y.$b())}},be.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof to&&(E=y.placeholder),E!==null?(x=E.ga(Po),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new Ie(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof to)for(a=a.memberParts;a.next();)E=a.value,E instanceof Ci&&this.Cj(E,y)},be.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof to&&(x=y.placeholder),x!==null){var E=x.ga(Po);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 to)for(a=a.memberParts;a.next();)E=a.value,E instanceof Ci&&this.Aj(E,y)}},be.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},At.Object.defineProperties(Zs.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&_n(a,">= 1",Zs,"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:Ke("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}}}),Zs.prototype.getTemporaryState=Zs.prototype.Ez,Zs.prototype.stop=Zs.prototype.stop,Zs.prototype.add=Zs.prototype.add,Zs.prototype.addTemporaryPart=Zs.prototype.Iy;function jd(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function vf(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}Zs.className="Animation",Zs.EaseLinear=function(a,y,x,E){return x*a/E+y},Zs.EaseInOutQuad=jd,Zs.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},Zs.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},Zs.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},Zs.EaseOutExpo=vf;function Ku(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}Ku.className="AnimationState";function Cu(a,y,x){this.xd=null,this.rf=a,this.so=x||Xf,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=jh))}Cu.prototype.copy=function(){var a=new Cu(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 Vg(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))}At.Object.defineProperties(Cu.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 Xf=new yn(Cu,"Default",1),jh=new yn(Cu,"Immediate",2),zd=new yn(Cu,"Bundled",3);Cu.className="AnimationTrigger",Cu.Default=Xf,Cu.Immediate=jh,Cu.Bundled=zd;function Fs(a){Ar(this),this.H=null,this.Pa=new Nn,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)}be=Fs.prototype,be.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,qs(x)}a.clear(),this.Zq.length=0},be.Xe=function(a){this.H=a},be.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,ee=0,re=this.Pa.iterator;re.next();){var oe=re.value;oe instanceof to?b++:oe instanceof Ci?E++:oe instanceof qn?z++:oe instanceof ta?ee++:x++}if(re="",0<x&&(re+=x+" Parts "),0<E&&(re+=E+" Nodes "),0<b&&(re+=b+" Groups "),0<z&&(re+=z+" Links "),0<ee&&(re+=ee+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,re+=`
|
|
`+x.toString(),E=x.data,E!==null&&br(E)&&(re+=" #"+br(E)),x instanceof Ci?re+=" "+Cr(E):x instanceof qn&&(re+=" "+Cr(x.fromNode)+" "+Cr(x.toNode));return y+" "+this.Pa.count+": "+re},be.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=Ie.alloc(),z=this.Pa.s,ee=z.length;ee--;){var re=z[ee];if((E!==!0||Rc(re)!==!1)&&re.isVisible()&&(b.assign(a),$n(b,re.oe),re=re.ic(b,y,x),re!==null&&(y!==null&&(re=y(re)),re!==null&&(x===null||x(re)))))return Ie.free(b),re}return Ie.free(b),null},be.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Nn||E instanceof Tn||(E=new Tn),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=Ie.alloc(),ee=this.Pa.s,re=ee.length;re--;){var oe=ee[re];if((b!==!0||Rc(oe)!==!1)&&oe.isVisible()){z.assign(a),$n(z,oe.oe);var ue=oe;oe.ji(z,y,x,E)&&(y!==null&&(ue=y(ue)),ue===null||x!==null&&!x(ue)||E.add(ue))}}return Ie.free(z),E},be.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 Nn||b instanceof Tn||(b=new Tn),this.Uh===!1)return b;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var ee=this.Pa.s,re=ee.length;re--;){var oe=ee[re];if((z!==!0||Rc(oe)!==!1)&&oe.isVisible()){var ue=oe;oe.Cf(a,y,x,E,b)&&(y!==null&&(ue=y(ue)),ue===null||x!==null&&!x(ue)||b.add(ue))}}return b},be.Nu=function(a,y,x,E,b,z,ee){if(this.Uh===!1)return b;for(var re=this.Pa.s,oe=re.length;oe--;){var ue=re[oe];if((ee!==!0||Rc(ue)!==!1)&&z(ue)&&ue.isVisible()){var he=ue;ue.Cf(a,y,x,E,b)&&(y!==null&&(he=y(he)),he===null||x!==null&&!x(he)||b.add(he))}}return b},be.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 Nn||b instanceof Tn)&&(z=b),b=!0),z instanceof Nn||z instanceof Tn||(z=new Tn),this.Uh===!1)return z;var ee=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(ee=!0);for(var re=Ie.alloc(),oe=Ie.alloc(),ue=this.Pa.s,he=ue.length;he--;){var ge=ue[he];if((ee!==!0||Rc(ge)!==!1)&&ge.isVisible()){re.assign(a),$n(re,ge.oe),oe.h(a.x+y,a.y),$n(oe,ge.oe);var xe=ge;ge.og(re,oe,x,E,b,z)&&(x!==null&&(xe=x(xe)),xe===null||E!==null&&!E(xe)||z.add(xe))}}return Ie.free(re),Ie.free(oe),z},be.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=gi();for(var b=gi(),z=0;z<E;z++){var ee=x[z];if(ee.vw=z,ee instanceof qn){if(ee.fd===!1)continue}else if(ee instanceof ta&&ee.adornedPart!==null)continue;var re=ee.actualBounds;ee.isVisible()&&ga(re,y)?(ee.Fd(!0),a.push(ee)):(ee.Fd(!1),ee.adornments!==null&&0<ee.adornments.count&&b.push(ee))}for(y=0;y<a.length;y++)for(x=a[y],Vv(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++)Vv(b[y]);Ii(a),Ii(b)}}};function Uu(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}be.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=Uu(this,a);var z=this.Zq;z.length=0;for(var ee=y.scale,re=Wt.alloc(),oe=0;oe<E;oe++)this.Oj(a,x[oe],y,z,ee,re,!0);if(Wt.free(re),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Kg(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 ee=Uu(a,y),re=a.Zq;re.length=0;for(var oe=x.scale,ue=Wt.alloc(),he=0;he<z;he++){var ge=b[he];E.contains(ge)&&a.Oj(y,ge,x,re,oe,ue,!1)}Wt.free(ue),y.globalAlpha=ee}}}be.Oj=function(a,y,x,E,b,z,ee){if(ee&&!Rc(y))a.Hs(y);else{if(E!==null&&y instanceof qn&&(y.isOrthogonal&&E.push(y),y.fd===!1)){a.Hs(y);return}for(ee=!1,E=y.containingGroup;E!==null;)ee?E.tb!==null&&z.Ex(E.tb):E.tb!==null&&(ee=!0,z.assign(E.tb)),E=E.containingGroup;var re=y.actualBounds;if(E=!1,ee&&y.isVisible()){if(!z.Yc(re)){a.Hs(y);return}E=!z.Re(re)}E&&(a.save(),a instanceof da?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),re.width*b>x.Oq||re.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&&(Qa(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(Qa(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),Qa(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))}},be.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(uo,a,this,y,x,E,b)},be.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&qs(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)),yf(this,a,y),a},be.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,qs(y),a};function yf(a,y,x){if(y=Cc(a,y,x),x instanceof to&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var E=-1,b=a.Pa.s,z=b.length,ee=0;ee<z;ee++){var re=b[ee];if(re===x&&(y=ee,0<=E)||0>E&&re.containingGroup===x&&(E=ee,0<=y))break}!(0>E)&&E<y&&(b=a.Pa,b.mb(y),b.Gb(E,x))}y=x.containingGroup,y!==null&&yf(a,-1,y)}x.svg!==null&&x.svg.remove()}function Cc(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,ee=NaN;0<=z&&(ee=a.M(z).zOrder,!!isNaN(ee));)z--;for(var re=y+1,oe=NaN;re<b&&(oe=a.M(re).zOrder,!!isNaN(oe));)re++;if(!isNaN(ee)&&ee>E)for(;;){if(z===-1||ee<=E){if(z++,z===y)break;return a.mb(y),a.Gb(z,x),z}for(ee=NaN;0<=--z&&(ee=a.M(z).zOrder,isNaN(ee)););}else if(!isNaN(oe)&&oe<E)for(;;){if(re===b||oe>=E){if(re--,re===y)break;return a.mb(y),a.Gb(re,x),re}for(oe=NaN;++re<b&&(oe=a.M(re).zOrder,isNaN(oe)););}return y}At.Object.defineProperties(Fs.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===""&&Ke("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&Ke("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)&&_n(a,"0 <= value <= 1",Fs,"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))}}}),Fs.prototype.findObjectsNear=Fs.prototype.og,Fs.prototype.findObjectsIn=Fs.prototype.Cf,Fs.prototype.findObjectsAt=Fs.prototype.ji,Fs.prototype.findObjectAt=Fs.prototype.ic,Fs.className="Layer";function jt(a,y){if(tp||(Qs(),tp=!0),Ar(this),Yu=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Ja){var x=this,E=function(){x.removeEventListener(wn.document,"DOMContentLoaded",E,!1),x.setRTL()};wn.document.body!==null?this.setRTL():x.addEventListener(wn.document,"DOMContentLoaded",E,!1)}this.ol=null,Mf.add("Model",ya);var b=this;return this.Hb=function(z){var ee=b.partManager;if(z.model===ee.diagram.model&&ee.diagram.aa){ee.diagram.aa=!1;try{var re=z.change;z.modelChange===""&&re===uo&&ee.updateDataBindings(z.object,z.propertyName)}finally{ee.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Ug(this),this.model=Sy(),this.Wg=!0,Yg(this),this.layout=new Va,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 np,a!==void 0&&(typeof a=="string"||wn.Element&&a instanceof Element?Qf(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var fd,Yu;function Ug(a){a.Yd=new kl,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new Nn,a.pj=new Gt,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new Ie(NaN,NaN).freeze(),a.du=new Ie(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new Ie(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new gt,a.zu=new Ie(NaN,NaN).freeze(),a.ut=new Wt(NaN,NaN,NaN,NaN).freeze(),a.rj=new Kr(0,0,0,0).freeze(),a.sj=Hh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=rl,a.zk=ar,a.Fg=rl,a.pq=ar,a.yt=Po,a.Bt=Po,a.Fc=!0,a.pn=!1,a.De=new Tn,a.Eh=new Gt,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new Kr(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new yr,a.bq.diagram=a,a.Qg=new yr,a.Qg.diagram=a,a.cj=new yr,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,Zp(a),a.ai=new Tn,a.Ht=!0,a.uu=Bh,a.pw=!1,a.wu=Sd,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 Gt,a.Xn=new Nn,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 Kr(5).freeze(),a.Hw=new Tn().freeze(),a.Nt=999999999,a.nw=new Tn().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 Tn,a.ow=new Tn,a.Xh=null,a.aw=new Pn(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new Ie,bounds:new Wt,Py:new Pn,bA:new Pn,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new Wt(NaN,NaN,NaN,NaN).freeze(),a.wo=new Pn(NaN,NaN).freeze(),a.Sp=new Wt(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new Gt;var y=new Ci,x=new Ia;x.bind(new cs("text","",Cr)),y.add(x),a.ny=y,a.Lg.add("",y),y=new Ci,x=new Ia,x.stroke="brown",x.bind(new cs("text","",Cr)),y.add(x),a.Lg.add("Comment",y),y=new Ci,y.selectable=!1,y.avoidable=!1,x=new lo,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new Pn(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new Gt,y=new to,y.selectionObjectName="GROUPPANEL",y.type=Vn.Vertical,x=new Ia,x.font="bold 12pt sans-serif",x.bind(new cs("text","",Cr)),y.add(x),x=new Vn(Vn.Auto),x.name="GROUPPANEL";var E=new lo;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new Sl,E.padding=new Kr(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new Gt,y=new qn,x=new lo,x.isPanelMain=!0,y.add(x),x=new lo,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new qn,x=new lo,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new ta,y.type=Vn.Auto,x=new lo,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new Sl,x.margin=new Kr(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new ta,y.type=Vn.Link,x=new lo,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 ya,a.toolManager=new wo,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new ae,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=zp(),a.eq=null,a.fq=Ti,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 Ie,a.zy=500,a.wp=new Ie,a.wq=!1}jt.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Ud=null,Wh="",Jf(this,!1),this.Xn.clear(),dp(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function Jf(a,y){a.animationManager.Cc(!0),a.Hw=new Tn().freeze(),a.nw=new Tn().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=[],ee=a.Wa.length;if(y){for(y=0;y<ee;y++)for(var re=a.Wa.s[y].parts;re.next();){var oe=re.value;oe!==b&&oe.data===null&&z.push(oe)}for(y=0;y<z.length;y++)a.remove(z[y])}for(y=0;y<ee;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(),dp(),a.Og.clear(),So=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function zp(){return null}jt.prototype.reset=function(){this.clear(),this.vb=!0,Ug(this),Ju(this),this.Wg=!0,Yg(this),this.layout=new Va,this.Wg=!1,this.model=Sy(),this.model.undoManager=new zr,this.vb=this.rn=!1,this.N()},jt.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=wn.document.body);var y=Dr("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},jt.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=wn.document.body);var y=0;if(Ja){var x=ep;y=fd,x===null&&(x=ep=Dr("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=fd=Dr("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||Gr||(y=11)}this.Db=y,this.Gw=!0},jt.prototype.qb=function(a){a.classType===jt&&(this.autoScale=a)},jt.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 Qf(a,y){if(Ja){if(y!=null||Ke("Diagram setup requires an argument DIV."),a.Ka!==null&&Ke("Diagram has already completed setup."),typeof y=="string"?a.Ka=wn.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:Ke("No DIV or DIV id supplied: "+y),a.Ka===null&&Ke("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&Ke("Invalid div id; div already has a Diagram associated with it."),!a.ol&&wn.ResizeObserver){var x=Qi(function(){a.$b()},250);a.ol=new wn.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}wn.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=wn.go;var b=new Xs(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",wn.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),Mc(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new Xs(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,Ja){b=Dr("div");var z=Dr("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=Jg,b.addEventListener("pointerdown",xf),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=Qi(function(){a.Yh=null,a.N()},300),a.Ov=Qi(function(){Fc(a)},250),a.preventDefault=function(ee){return ee.preventDefault(),!1},a.$j=function(ee){if(a.isEnabled){var re=eu(a,ee,!0);re.bubbles=!0;var oe=0,ue=0;re.delta=0,ee.deltaX!==void 0?(ee.deltaX!==0&&(oe=0<ee.deltaX?1:-1),ee.deltaY!==0&&(ue=0<ee.deltaY?1:-1),re.delta=Math.abs(ee.deltaX)>Math.abs(ee.deltaY)?-oe:-ue):ee.wheelDeltaX!==void 0?(ee.wheelDeltaX!==0&&(oe=0<ee.wheelDeltaX?-1:1),ee.wheelDeltaY!==0&&(ue=0<ee.wheelDeltaY?-1:1),re.delta=Math.abs(ee.wheelDeltaX)>Math.abs(ee.wheelDeltaY)?-oe:-ue):ee.wheelDelta!==void 0&&ee.wheelDelta!==0&&(re.delta=0<ee.wheelDelta?1:-1),a.doMouseWheel(),fu(re,ee)}},a.aA=function(ee){a.isEnabled&&(a.Vk=!1,eu(a,ee,!0),ee=a.currentTool,ee.cancelWaitAfter(),ee.standardMouseOver())},a.ui=function(ee){if(a.isEnabled){a.Vk=!0;var re=a.Yt;re[ee.pointerId]===void 0&&(re[ee.pointerId]=ee),re=a.oj;var oe=!1;if(re[0]===null||re[0].pointerId!==ee.pointerId&&re[0].pointerType===ee.pointerType)if(re[1]!==null&&re[1].pointerId===ee.pointerId)re[1]=ee,oe=!0;else if(re[0]===null)re[0]=ee;else if(re[1]===null)re[1]=ee,oe=!0;else{ee.preventDefault();return}else re[0]=ee;(re=ee.pointerType==="touch"||ee.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var ue=oe;oe=qf(a,ee,!0,!1,!0,ue),Lh(a,ee,oe),oe.targetDiagram=Gd(ee,ee.target),oe.targetObject=null,ue||oe.clone(a.bq),ue=a.uw,re=re?25:10,ee.timeStamp-a.tw<a.zy&&!(Math.abs(ue.x-ee.screenX)>re||Math.abs(ue.y-ee.screenY)>re)?a.yq++:a.yq=1,oe.clickCount=a.yq,a.tw=ee.timeStamp,a.uw.sg(ee.screenX,ee.screenY),a.doMouseDown(),ee.button===1?ee.preventDefault():fu(oe,ee)}},a.dk=function(ee){if(a.isEnabled){a.Vk=!0;var re=a.oj;if(re[0]===null||re[0].pointerId!==ee.pointerId&&re[0].pointerType===ee.pointerType){if(re[1]!==null&&re[1].pointerId===ee.pointerId){re[1]=ee;return}if(re[0]===null)re[0]=ee;else return}else re[0]=ee;if(re[0].pointerId===ee.pointerId){re=qf(a,ee,!1,!1,!1,re[1]!==null);var oe=wn.document.elementFromPoint(ee.clientX,ee.clientY)||null;oe!==null&&oe.shadowRoot!==void 0&&oe.shadowRoot!==null&&(oe=oe.shadowRoot.elementFromPoint(ee.clientX,ee.clientY));var ue=a,he=ee;oe&&oe.H&&(he=ee,ue=oe.H),re.targetDiagram=ue,Lh(a,he,re),re.targetObject=null,a.doMouseMove(),fu(re,ee)}}},a.fk=function(ee){if(a.isEnabled){a.Vk=!0;var re=ee.pointerType==="touch"||ee.pointerType==="pen",oe=a.Yt;if(re&&a.qu)delete oe[ee.pointerId],ee.preventDefault();else if(oe=a.oj,oe[0]===null||oe[0].pointerId!==ee.pointerId&&oe[0].pointerType===ee.pointerType)oe[1]!==null&&oe[1].pointerId===ee.pointerId&&(oe[1]=null);else{oe[0]=null,oe=qf(a,ee,!1,!0,!0,!1);var ue=wn.document.elementFromPoint(ee.clientX,ee.clientY)||null;ue!==null&&ue.shadowRoot!==void 0&&ue.shadowRoot!==null&&(ue=ue.shadowRoot.elementFromPoint(ee.clientX,ee.clientY)),ue!==null&&ue.H instanceof jt&&ue.H!==a&&Lh(ue.H,ee,oe),ue===null&&(ue=ee.target),Lh(a,ee,oe),oe.clickCount=a.yq,oe.targetDiagram=Gd(ee,ue),oe.targetObject=null,a.doMouseUp(),fu(oe,ee),re&&(a.wq=!1)}}},a.ek=function(ee){if(a.isEnabled){a.Vk=!1;var re=a.Yt;re[ee.pointerId]&&delete re[ee.pointerId],re=a.oj,re[0]!==null&&re[0].pointerId===ee.pointerId&&(re[0]=null),re[1]!==null&&re[1].pointerId===ee.pointerId&&(re[1]=null),ee.pointerType!=="touch"&&ee.pointerType!=="pen"&&(ee=a.currentTool,ee.cancelWaitAfter(),ee.standardMouseOver())}},a.ck=function(ee){var re=a.oj;re[0]!==null&&re[0].pointerId===ee.pointerId?(re[0]=null,a.wq=!1):re[1]!==null&&re[1].pointerId===ee.pointerId&&(re[1]=null)},a.Vp=E.Z["d"+Ed[1]+Ed[2]+"wI"+Pd.slice(1,5)]["b"+NS.slice(1,y)](E.Z,Nc,y,y),E.Vc(!0),Om(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}jt.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},jt.prototype.removeEventListener=function(a,y,x,E){a.removeEventListener(y,x,{capture:E})};function Om(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(wn,"resize",a.Ov,!1)}function Us(a){30<a.Sq&&(a.Yh=1)}function bc(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),Pr&&Pr.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}jt.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:wn.devicePixelRatio||1},jt.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},jt.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},jt.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},jt.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},jt.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},jt.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},jt.prototype.doFocus=function(){this.focus()},jt.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=wn.scrollX||wn.pageXOffset,y=wn.scrollY||wn.pageYOffset;this.ta.focus(),wn.scrollTo(a,y)}},jt.prototype.Oy=function(){this.H.R("GainedFocus")},jt.prototype.Ny=function(){this.H.R("LostFocus")};function Fc(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===rl&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Yg(a){var y=new Fs;y.name="Background",a.Al(y),y=new Fs,y.name="",a.Al(y),y=new Fs,y.name="Foreground",a.Al(y),y=new Fs,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new Fs,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new Fs,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function Xg(a){var y=new Vn(Vn.Grid);y.name="GRID";var x=new lo;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new lo,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new lo,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new lo,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new lo,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new lo,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new mr,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 Jg(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Vd(this.H)}function xf(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Vd(this.H)}jt.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,ee=E.x-z.left,re=E.y-z.top,oe=E.width+z.left+z.right,ue=E.height+z.top+z.bottom,he=E.right+z.right;z=E.bottom+z.bottom;var ge=b.x;E=b.y;var xe=b.width,Pe=b.height,Fe=b.right,Ne=b.bottom;b=this.scale;var Je=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Je=Je+a.scrollWidth-a.clientWidth;break;case"reverse":Je=a.scrollWidth-Je-a.clientWidth}var Ve=Je;xe<oe||Pe<ue?(Je=Ie.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Ve&&(Je.x=Ve/b+ee,this.ju=Ve),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Je.y=a.scrollTop/b+re,this.lu=a.scrollTop),this.position=Je,Ie.free(Je),this.Ee=this.qr=!1):(Je=Ie.alloc(),a.uy&&this.allowHorizontalScroll&&(ee<ge&&(this.position=Je.h(Ve+ee,this.position.y)),he>Fe&&(this.position=Je.h(-(y.scrollWidth-this.Aa)+Ve-this.Aa/b+he,this.position.y))),a.vy&&this.allowVerticalScroll&&(re<E&&(this.position=Je.h(this.position.x,a.scrollTop+re)),z>Ne&&(this.position=Je.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),Ie.free(Je),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,he=E.right,Fe=b.right,z=E.bottom,Ne=b.bottom,ee=E.x,ge=b.x,re=E.y,E=b.y,xe>=oe&&ee>=ge&&he<=Fe&&(x.style.width="1px"),Pe>=ue&&re>=E&&z<=Ne&&(x.style.height="1px"))}},jt.prototype.computeBounds=function(a){return a===void 0&&(a=new Wt),Gs(this),Sf(this,a)};function Sf(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 ee=E[z];if(ee.visible&&ee.isInDocumentBounds){ee=ee.Pa.s;for(var re=ee.length,oe=0;oe<re;oe++){var ue=ee[oe];ue.isInDocumentBounds&&ue.isVisible()&&(ue=ue.actualBounds,ue.w()&&(x?(x=!1,y.assign(ue)):y.ed(ue)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}jt.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(xn(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof qn||(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 qn||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new Wt(NaN,NaN,0,0):x};function cu(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=Ie.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=Wt.allocAt(0,0,E.width,E.height);var b=Ie.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,Wt.free(E),Ie.free(b),Ie.free(x)}x=a.yh,y&&a.Fg!==rl&&(x=a.Fg);var z=x!==rl?Zd(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var ee=a.ya/z,re=a.zk,oe=a.pq;y&&!re.sb()&&(oe.sb()||oe.Xb())&&(re=oe.Xb()?Hr:oe),$f(a,a.documentBounds,b,ee,re,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,Re.B(z.x,x)&&Re.B(z.y,E)&&Re.B(z.width,b)&&Re.B(z.height,ee)||a.onViewportBoundsChanged(new Wt(x,E,b,ee),z,y,!1)}}function Zd(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),ee=a.ya+(a.Be?a.Db:0),re=z/b,oe=ee/E;return y===Al?(y=Math.min(oe,re),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===Yd?(y=oe>re?(ee-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}jt.prototype.zoomToFit=function(){var a=this.sj;this.sj=Hh,this.scale=Zd(this,Al),a!==Hh&&(cu(this,!1),$f(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},be=jt.prototype,be.BA=function(a,y){y===void 0&&(y=Al);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===Al||y===Yd)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===Yd?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 Ie(a.x,a.y)}},be.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new Ie(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))},be.zz=function(a){if(a instanceof Ft){this.eq=a;var y=Ie.alloc();this.fq=this.op(a.ga(Po,y)),Ie.free(y)}else this.eq=null,this.fq=Ti};function $f(a,y,x,E,b,z){var ee=Ie.allocAt(a.pa.x,a.pa.y),re=ee.x,oe=ee.y;if(a.eq!==null){var ue=Ie.alloc();ue=a.eq.ga(Po,ue),re=ue.x-a.fq.x/a.scale,oe=ue.y-a.fq.y/a.scale,b=Xr,Ie.free(ue)}(z||a.scrollMode===Hh)&&(b.sb()&&(x>y.width&&(re=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(oe=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?(re=Math.min(re+x/2,y.right+Math.max(z,b.right)-x/2),re=Math.max(re,y.left-Math.max(z,b.left)+x/2),re-=x/2):re>y.left?re=y.left:re<y.right-x&&(re=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(oe=Math.min(oe+E/2,y.bottom+Math.max(x,b.bottom)-E/2),oe=Math.max(oe,y.top-Math.max(x,b.top)+E/2),oe-=E/2):oe>y.top?oe=y.top:oe<y.bottom-E&&(oe=y.bottom-E)),ee.x=isFinite(re)?re:-a.yb.left,ee.y=isFinite(oe)?oe:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,ee),ee.x=y.x,ee.y=y.y),gf(a.Yd,a.pa,ee),a.pa.h(ee.x,ee.y),Ju(a),Ie.free(ee)}be.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=uh(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof mr)return a}else if(a=uh(this,a,function(x){return x.part}),a instanceof mr)return a;return null},be.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),Gs(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 uh(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),Gs(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}be.lz=function(a,y,x){return y===void 0&&(y=!0),Lc(this,a,function(E){return E.part},y?function(E){return E instanceof mr&&E.canSelect()}:null,x)};function Lc(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof Nn||b instanceof Tn||(b=new Tn),Gs(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}be.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Nn||E instanceof Tn||(E=new Tn),Gs(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},be.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),wf(this,a,function(b){return b instanceof mr&&(!x||b.canSelect())},y,E)},be.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof Nn||b instanceof Tn||(b=new Tn),Gs(this);for(var z=this.Wa.iteratorBackwards;z.next();){var ee=z.value;ee.visible&&ee.Cf(a,y,x,E,b)}return b},be.Nu=function(a,y,x,E,b,z){var ee=new Tn;Gs(this);for(var re=this.Wa.iteratorBackwards;re.next();){var oe=re.value;oe.visible&&oe.Nu(a,y,x,E,ee,b,z)}return ee};function wf(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 Nn||b instanceof Tn||(b=new Tn),Gs(a),a=a.Wa.iteratorBackwards;a.next();){var ee=a.value;ee.visible&&!ee.isTemporary&&ee.Cf(y,z,x,E,b)}return b}be.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),Bc(this,a,y,function(z){return z instanceof mr&&(!E||z.canSelect())},x,b)},be.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 Nn||b instanceof Tn)&&(z=b),b=!0),z instanceof Nn||z instanceof Tn||(z=new Tn),Gs(this);for(var ee=this.Wa.iteratorBackwards;ee.next();){var re=ee.value;re.visible&&re.og(a,y,x,E,b,z)}return z};function Bc(a,y,x,E,b,z){var ee=null;for(ee===void 0&&(ee=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof Nn||b instanceof Tn)&&(z=b),b=!0),z instanceof Nn||z instanceof Tn||(z=new Tn),Gs(a),a=a.Wa.iteratorBackwards;a.next();){var re=a.value;re.visible&&!re.isTemporary&&re.og(y,x,ee,E,b,z)}return z}jt.prototype.acceptEvent=function(a){return eu(this,a,a instanceof MouseEvent)};function eu(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?Lh(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),Gr&&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=Gd(y,y.target),E.targetObject=null,E}function Gd(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 qf(a,y,x,E,b,z){var ee=a.Qg;return a.Qg=a.cj,a.cj=ee,ee.diagram=a,ee.clickCount=1,a=ee.delta=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),ee.modifiers=a,ee.event=y,ee.timestamp=y.timeStamp,ee.button=y.button,ee.buttons=y.buttons,Gr&&y.button===0&&y.ctrlKey&&(ee.button=2),ee.down=x,ee.up=E,ee.handled=!1,ee.bubbles=b,ee.isMultiTouch=z,ee}function fu(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}jt.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=eu(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(),fu(x,a)},jt.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=eu(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(),fu(x,a)},jt.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=eu(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),fu(x,a)},jt.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=eu(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),fu(x,a)},jt.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new Ie(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?$n(new Ie(y,a),this.Ab):new Ie(y,a)};function Lh(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,ee=0,re=0;E!==null&&(E=E.getBoundingClientRect(),ee=y.clientX-b/E.width*E.left,re=y.clientY-z/E.height*E.top),x.viewPoint.h(ee,re),a.Ab!==null?(y=Ie.allocAt(ee,re),a.Ab.Cd(y),x.documentPoint.assign(y),Ie.free(y)):x.documentPoint.h(ee,re)}function Pf(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))}}jt.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function eg(a){a.ld||Gs(a),a.Va()}jt.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},be=jt.prototype,be.Pz=function(){return this.kg},be.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,Wl(this),this.hf=!1,this.du=new Ie(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&vr(function(){E.ld=!1,sh(y,"Model"),a(E)},1)},be.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;wn.requestAnimationFrame(function(){y.kg&&y.bd()})}},be.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),Wl(this))};function gd(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Vd(a)||(y&&Gs(a),x&&cu(a,!1))}function Wl(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,ee=0;ee<z;ee++){var re=b[ee];qe(re,!1),re.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(oe){oe.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||Fc(a),gd(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Xu(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),Gs(a),z=!1,(!a.hf||a.xh)&&(a.hf?dg(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),dg(a,!1)),z=!0),a.Jk=!1,Gs(a),a.ou||eg(a),gd(a,!0,!1),ee=!1,z?(x=Wt.alloc(),x.assign(a.viewportBounds),a.hf||(ee=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,tg(a)),a.R("LayoutCompleted"),gd(a,!0,!1),Wt.free(x)):x.Ok&&x.Qw&&(a.Fg!==rl?a.scale=Zd(a,a.Fg):a.yh!==rl?a.scale=Zd(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),cu(a,!0)),z&&ee&&a.eb("Initial Layout"),Gs(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function tg(a){if(a.Fg!==rl)a.scale=Zd(a,a.Fg);else if(a.yh!==rl)a.scale=Zd(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}cu(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Xu(a)}function Gs(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 Tn,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof to&&E.U&65536&&(E.U=E.U^65536)})}}be.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof to||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof to&&x.isVisible()&&hh(this,x);for(a.reset();a.next();)x=a.value,x instanceof qn&&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 ta&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function hh(a,y){for(var x=gi(),E=gi(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof to?(tt(z)||mt(z)||Oc(z))&&hh(a,z):z instanceof qn?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(Ii(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();Ii(E)}be.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},be.gc=function(a){if(this.Ka!==null){if(this.ta===null&&Ke("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Hd(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,ee=Math.round(y.y*b)/b,re=this.Ab;for(re.reset(),b!==1&&re.scale(b),y.x===0&&y.y===0||re.translate(-z,-ee),a.ti=null,Za(a,re.m11,re.m12,re.m21,re.m22,re.dx,re.dy),this.pb!==1&&(a.globalAlpha=this.pb),zh(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?Kh(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(gt.prototype.Cd=gt.prototype.Eu),this.Fc=this.vd=!1}}}}else e:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Hd(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 e;z=this.Ab,z.reset(),ee=this.Mb,re=this.pa;var oe=this.Ca,ue=Math.round(re.x*oe)/oe,he=Math.round(re.y*oe)/oe;for(oe!==1&&z.scale(oe),re.x===0&&re.y===0||z.translate(-ue,-he),a.setTransform(ee,0,0,ee,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),zh(this,a),re=0;re<b;re++)a.setTransform(ee,0,0,ee,0,0),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),a.yc(),y[re].gc(a,this);if(y=!1,this.Yf?Kh(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(gt.prototype.Cd=gt.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=Pr&&Pr.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 Ef(a,y,x,E,b,z,ee,re,oe,ue){if(a.Ka!==null){a.ta===null&&Ke("No canvas specified"),ee===void 0&&(ee=null),re===void 0&&(re=null),oe===void 0&&(oe=!1),ue===void 0&&(ue=!1),Hd(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var he=a.Ca;a.Ca=b;var ge=a.Wa.s,xe=ge.length;try{var Pe=new Wt(z.x,z.y,E.width/b,E.height/b),Fe=Pe.copy();Fe.Co(x),Xu(a,Fe),Gs(a),a.Fd(ge,xe,a,Pe),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),re!==null&&re!==""&&(y.fillStyle=re,y.ox(0,0,E.width,E.height));var Ne=a.Mb;y.scale(Ne,Ne);var Je=gt.alloc();Je.reset(),Je.translate(x.left,x.top),Je.scale(b),z.x===0&&z.y===0||Je.translate(-z.x,-z.y),y.setTransform(Je.m11,Je.m12,Je.m21,Je.m22,Je.dx,Je.dy),y.yc(),y instanceof da&&Za(y,Je.m11,Je.m12,Je.m21,Je.m22,Je.dx,Je.dy),gt.free(Je),zh(a,y),y.globalAlpha=a.pb;var Ve=a.Qj("Grid");if(ee){var ut=new Tn,ft=ee.iterator;for(ft.reset();ft.next();){var vt=ft.value;vt instanceof mr&&(ue||vt.layer!==Ve)&&(vt.Gj(),ut.add(vt))}for(ue=0;ue<xe;ue++)Kg(ge[ue],y,a,ut,oe);ut.each(function(zt){return zt.Gj()})}else for(ut=0;ut<xe;ut++){var bt=ge[ut];bt===Ve?ue&&bt.gc(y,a,!0):bt.gc(y,a,oe)}a.$i=!1,a.Yf&&Kh(a.Yf,a)&&a.Vp()}finally{a.Ca=he,a.ib.Vc(!0),a.vd=!0,a.Fd(ge,xe,a,a.viewportBounds),Xu(a),a.ib instanceof da&&(a.ib.Nj.PA(),a.redraw())}}}be.Gf=function(a){return this.Rg[a]},be.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},be.Tx=function(){this.Rg=new er,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(Gr||ro),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function zh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}be.Ql=function(a){return this.on[a]},be.sA=function(a,y){this.on[a]=y},be.Sx=function(){this.on=new er,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},be.set=function(a){return Object.assign(this,a),this},be.Du=function(a){return this.nm(a)},be.nm=function(a){return Wd(this,a),this};function Wd(a,y){var x=a instanceof Vn,E=a instanceof jt,b;for(b in y){b===""&&Ke("Setting properties requires non-empty property names");var z=a,ee=b;if(x||E){var re=b.indexOf(".");if(0<re){var oe=b.substring(0,re);x?z=a.fb(oe):(z=a[oe],z==null&&(z=a.toolManager[oe])),$t(z)?ee=b.substr(re+1):Ke("Unable to find object named: "+oe+" in "+a.toString()+" when trying to set property: "+b)}}if(ee[0]!=="_"&&!xr(z,ee))if(E&&ee==="ModelChanged"){a.Yw(y[ee]);continue}else if(E&&ee==="Changed"){a.Pe(y[ee]);continue}else if(E&&xr(a.toolManager,ee))z=a.toolManager;else if(E&&Qg(a,ee)){a.Bj(ee,y[ee]);continue}else if(a instanceof lr&&ee==="Changed"){a.Pe(y[ee]);continue}else Ke('Trying to set undefined property "'+ee+'" on object: '+z.toString());z[ee]=y[b],ee[0]==="_"&&z instanceof Ft&&z.Vw(ee)}}be.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new Gt,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},be.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")},jt.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!==Ac&&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=Wt.alloc(),ug(this,this.computeBounds(E)),Wt.free(E)),E=this.ta,E===null||E instanceof jo)))){var ee=this.Mb;b=this.Aa*ee;var re=this.ya*ee,oe=this.scale*ee;z=Math.round(Math.round(y.x*oe)-Math.round(a.x*oe)),y=Math.round(Math.round(y.y*oe)-Math.round(a.y*oe)),oe=this.jw,a=this.oy,oe.width!==b&&(oe.width=b),oe.height!==re&&(oe.height=re),a.clearRect(0,0,b,re),oe=190*ee;var ue=70*ee,he=Math.max(z,0),ge=Math.max(y,0),xe=Math.floor(b-he),Pe=Math.floor(re-ge);a.drawImage(E.Oa,he,ge,xe,Pe,0,0,xe,Pe),Kh(this.Yf,this)&&a.clearRect(0,0,oe,ue),E=gi(),a=gi(),Pe=Math.abs(z),xe=Math.abs(y);var Fe=he===0?0:b-Pe;he=Ie.allocAt(Fe,0),Pe=Ie.allocAt(Pe+Fe,re),a.push(new Wt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y)));var Ne=this.Ab;if(Ne.reset(),Ne.scale(ee,ee),this.Ca!==1&&Ne.scale(this.Ca),ee=this.pa,(ee.x!==0||ee.y!==0)&&isFinite(ee.x)&&isFinite(ee.y)&&Ne.translate(-ee.x,-ee.y),$n(he,Ne),$n(Pe,Ne),E.push(new Wt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),Fe=ge===0?0:re-xe,he.h(0,Fe),Pe.h(b,xe+Fe),a.push(new Wt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),$n(he,Ne),$n(Pe,Ne),E.push(new Wt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),Kh(this.Yf,this)&&(b=0<z?0:-z,re=0<y?0:-y,he.h(b,re),Pe.h(oe+b,ue+re),a.push(new Wt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),$n(he,Ne),$n(Pe,Ne),E.push(new Wt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y)))),Ie.free(he),Ie.free(Pe),gd(this,!1,!0),this.Ka===null&&Ke("No div specified"),this.ta===null&&Ke("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(Hd(this),re=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*re,this.ya*re),b.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,ee=this.Ca,oe=Math.round(z.x*ee)/ee,ue=Math.round(z.y*ee)/ee,y=this.Ab,y.reset(),ee!==1&&y.scale(ee),z.x===0&&z.y===0||y.translate(-oe,-ue),b.save(),b.beginPath(),z=a.length,ee=0;ee<z;ee++)oe=a[ee],oe.width!==0&&oe.height!==0&&b.rect(Math.floor(oe.x),Math.floor(oe.y),Math.ceil(oe.width),Math.ceil(oe.height));for(b.clip(),b.setTransform(re,0,0,re,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),zh(this,b),b.globalAlpha=this.pb,re=0;re<z;re++)if(ee=y[re],oe=E,ee.visible&&ee.pb!==0){ue=Uu(ee,b),ge=ee.Zq,ge.length=0,he=this.scale,xe=Wt.alloc(),Pe=ee.Pa.s,Ne=Pe.length,Fe=oe.length;for(var Je=0;Je<Ne;Je++){var Ve=Pe[Je],ut=If(Ve,Ve.actualBounds);e:{for(var ft=2/he,vt=4/he,bt=0;bt<Fe;bt++){var zt=oe[bt];if(zt.width!==0&&zt.height!==0&&ut.Vu(zt.x-ft,zt.y-ft,zt.width+vt,zt.height+vt)){ut=!0;break e}}ut=!1}ut&&ee.Oj(b,Ve,this,ge,he,xe,!0)}Wt.free(xe),b.globalAlpha=ue}b.restore(),b.Vc(!0),this.Yf&&Kh(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}Ii(E),Ii(a),this.ld=!1}}else this.bd();x&&(Us(this),this.bd(),bc(this,!0))}else x?(Us(this),this.bd(),bc(this,!0)):this.bd()}};function Hd(a){a.pn!==!1&&(a.pn=!1,Mc(a,a.Aa,a.ya))}function Mc(a,y,x){Ju(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function Vd(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,ee=a.gf?a.Db:0,re=a.Be?a.Db:0,oe=b.clientWidth||x+ee,ue=b.clientHeight||E+re,he=a.viewportBounds;b=he.x;var ge=he.y,xe=he.width,Pe=he.height;if((oe!==x+ee||ue!==E+re)&&(a.gf=!1,a.Be=!1,re=ee=0,a.Aa=oe,a.ya=ue,z=a.pn=!0,Ju(a)),!a.hf||!a.viewportBounds.w())return!0;var Fe=a.ku,Ne=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Je=a.documentBounds,Ve=0,ut=0,ft=0,vt=0,bt=he.width,zt=he.height,vi=a.rj;a.contentAlignment.sb()?(Je.width>bt&&(Ve=vi.left,ut=vi.right),Je.height>zt&&(ft=vi.top,vt=vi.bottom)):(Ve=vi.left,ut=vi.right,ft=vi.top,vt=vi.bottom);var Xi=Je.width+Ve+ut,Ri=Je.height+ft+vt;vi=a.scale;var Qn=Xi>oe/vi,Cn=Ri>ue/vi;if(!(z||a.gf||a.Be||Qn||Cn))return!0;Ve=Je.x-Ve,oe=he.x,ut=Je.right+ut,ue=he.right+ee,ft=Je.y-ft;var qr=he.y;Je=Je.bottom+vt,he=he.bottom+re;var Rr="1px";if(vt="1px",a.scrollMode===Hh&&(Qn||Cn)&&(Qn&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Qn=1,Ve+1<oe&&(Qn=Math.max((oe-Ve)*vi+a.Aa,Qn)),ut>ue+1&&(Qn=Math.max((ut-ue)*vi+a.Aa,Qn)),bt+ee+1<Xi&&(Qn=Math.max((Xi-bt)*vi+a.Aa,Qn)),Rr=Qn.toString()+"px"),Cn&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Qn=1,ft+1<qr&&(Qn=Math.max((qr-ft)*vi+a.ya,Qn)),Je>he+1&&(Qn=Math.max((Je-he)*vi+a.ya,Qn)),zt+re+1<Ri&&(Qn=Math.max((Ri-zt)*vi+a.ya,Qn)),vt=Qn.toString()+"px")),Qn=Rr!=="1px",Cn=vt!=="1px",Qn&&Cn||!Qn&&!Cn||(Cn&&(ue-=a.Db),Qn&&(he-=a.Db),Xi<bt+ee||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(ee=1,Ve+1<oe&&(ee=Math.max((oe-Ve)*vi+a.Aa,ee)),ut>ue+1&&(ee=Math.max((ut-ue)*vi+a.Aa,ee)),bt+1<Xi&&(ee=Math.max((Xi-bt)*vi+a.Aa,ee)),Rr=ee.toString()+"px"),Qn=Rr!=="1px",ee=a.ya,Qn!==a.Be&&(ee=Qn?a.ya-a.Db:a.ya+a.Db),Ri<zt+re||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(re=1,ft+1<qr&&(re=Math.max((qr-ft)*vi+ee,re)),Je>he+1&&(re=Math.max((Je-he)*vi+ee,re)),zt+1<Ri&&(re=Math.max((Ri-zt)*vi+ee,re)),vt=re.toString()+"px"),Cn=vt!=="1px"),a.qr&&Qn===a.Be&&Cn===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(Qn!==a.Be&&(Rr==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=Qn,Ne.style.width=Rr,Cn!==a.gf&&(vt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(re=Ie.alloc(),Cn?(y.style.left=a.Db+"px",a.position=re.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=re.h(a.pa.x-a.Db/a.scale,a.pa.y)),Ie.free(re))),z&&Ju(a),a.gf=Cn,Ne.style.height=vt,a.gu=!0,z&&(a.pn=!0),y=Fe.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(bt+1<Xi?y=(a.position.x-Ve)*vi:Ve+1<oe?y=Fe.scrollWidth-Fe.clientWidth:ut>ue+1&&(y=a.position.x*vi)),a.tn)switch(a.bu){case"negative":y=-(Fe.scrollWidth-y-Fe.clientWidth);break;case"reverse":y=Fe.scrollWidth-y-Fe.clientWidth}return Fe.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(zt+1<Ri?Fe.scrollTop=(a.position.y-ft)*vi:ft+1<qr?Fe.scrollTop=Fe.scrollHeight-Fe.clientHeight:Je>he+1&&(Fe.scrollTop=a.position.y*vi)),oe=a.Aa,ue=a.ya,Fe.style.width=oe+(a.gf?a.Db:0)+"px",Fe.style.height=ue+(a.Be?a.Db:0)+"px",x!==oe||E!==ue||a.animationManager.zb?(x=Wt.allocAt(b,ge,xe,Pe),a.onViewportBoundsChanged(x,a.viewportBounds,vi,z),Wt.free(x),!1):!0}be=jt.prototype,be.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&Ke("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&&Ke('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(Zo,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},be.oi=function(a){this.partManager.oi(a);var y=this;Nf(a,function(x){Kd(y,x)}),(a instanceof ta||a instanceof to&&a.placeholder!==null)&&a.v(),a.data!==null&&Nf(a,function(x){vy(y.partManager,x)}),mt(a)!==!0&&Oc(a)!==!0||this.De.add(a),R1(a,!0,this),z1(a)?(a.actualBounds.w()&&this.N(If(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(If(a,a.actualBounds)),this.$b()},be.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&Nf(a,function(x){yy(y.partManager,x,y)}),this.De.remove(a),z1(a)?(a.actualBounds.w()&&this.N(If(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(If(a,a.actualBounds)),this.$b()},be.remove=function(a){ng(this,a,!0)};function ng(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(ha,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}be.Is=function(a,y){if(y===void 0&&(y=!1),xn(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 Tn,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},be.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},jt.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=Cf(this)),this.toolManager!==null){var b=new Gt;if(a!==null)if(xn(a))for(var z=0;z<a.length;z++)dh(this,b,a[z],x,E);else for(a=a.iterator;a.next();)dh(this,b,a.value,x,E);else{for(a=this.parts;a.next();)dh(this,b,a.value,x,E);for(a=this.nodes;a.next();)dh(this,b,a.value,x,E);for(a=this.links;a.next();)dh(this,b,a.value,x,E)}pd(this,b,y,E,x)}};function dh(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=Cf(a)),x instanceof Ci){if(y.add(x,a.Pd(b,x,x.location)),x instanceof to&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)dh(a,y,z.value,E,b,b.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var ee=z.value;if(!y.contains(ee)){var re=ee.fromNode,oe=ee.toNode;re!==null&&y.contains(re)&&oe!==null&&y.contains(oe)&&dh(a,y,ee,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)dh(a,y,x.value,E,b)}else if(x instanceof qn)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)dh(a,y,x.value,E,b);else x instanceof ta||y.add(x,a.Pd(b,x,x.location))}function pd(a,y,x,E,b){if(y!==null&&y.count!==0){var z=Ie.alloc(),ee=Ie.alloc();ee.assign(x),isNaN(ee.x)&&(ee.x=0),isNaN(ee.y)&&(ee.y=0),(x=a.Mr)||Ff(a,y);for(var re=gi(),oe=gi(),ue=y.iterator,he=Ie.alloc();ue.next();){var ge=ue.key,xe=ue.value;if(ge.Zc()){var Pe=ig(a,ge,y);Pe!==null?re.push(new ie(ge,xe,Pe)):(!b||ge.canMove())&&(Pe=xe.point,z.assign(Pe),a.computeMove(ge,z.add(ee),E,he),ge.location=he,xe.shifted===void 0&&(xe.shifted=new Ie),xe.shifted.assign(he.re(Pe)))}else ue.key instanceof qn&&oe.push(ue.sa)}for(Ie.free(he),b=re.length,ue=0;ue<b;ue++)ge=re[ue],z.assign(ge.info.point),ge.Su.shifted===void 0&&(ge.Su.shifted=new Ie),ge.node.location=z.add(ge.Su.shifted);for(b=Ie.alloc(),ue=Ie.alloc(),ge=oe.length,xe=0;xe<ge;xe++){var Fe=oe[xe];if(Pe=Fe.key,Pe instanceof qn)if(Pe.suspendsRouting){Pe.Tg=null,he=Pe.fromNode;var Ne=Pe.toNode;if(a.draggedLink!==null&&E.dragsLink)if(Ne=Fe.value.point,Pe.dragComputation===null)y.add(Pe,a.Pd(E,Pe,ee)),tc(Pe,ee.x-Ne.x,ee.y-Ne.y);else{Fe=Ie.allocAt(0,0),(he=Pe.i(0))&&he.w()&&Fe.assign(he);var Je=he=Ie.alloc().assign(Fe).add(ee);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Je=Ie.alloc(),bf(a,Pe,he,Je,E)),he.assign(Pe.dragComputation(Pe,he,Je)).re(Fe),y.add(Pe,a.Pd(E,Pe,he)),tc(Pe,he.x-Ne.x,he.y-Ne.y),Ie.free(Fe),Ie.free(he),Je!==he&&Ie.free(Je)}else he!==null&&(b.assign(he.location),Je=y.I(he),Je!==null&&b.re(Je.point)),Ne!==null&&(ue.assign(Ne.location),Je=y.I(Ne),Je!==null&&ue.re(Je.point)),he!==null&&Ne!==null?b.Xa(ue)?(he=Fe.value.point,Ne=z,Ne.assign(b),Ne.re(he),y.add(Pe,a.Pd(E,Pe,b)),tc(Pe,Ne.x,Ne.y)):(Pe.suspendsRouting=!1,Pe.bb()):(Fe=Fe.value.point,he=he!==null?b:Ne!==null?ue:ee,y.add(Pe,a.Pd(E,Pe,he)),tc(Pe,he.x-Fe.x,he.y-Fe.y))}else(Pe.fromNode===null||Pe.toNode===null)&&(he=Fe.value.point,y.add(Pe,a.Pd(E,Pe,ee)),tc(Pe,ee.x-he.x,ee.y-he.y))}Ie.free(z),Ie.free(ee),Ie.free(b),Ie.free(ue),Ii(re),Ii(oe),x||(Gs(a),Zh(a,y))}}jt.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new Ie),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=Ie.alloc(),bf(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;var ee=a.minLocation,re=ee.x;isNaN(re)&&(re=z?Math.round(1e3*a.location.x)/1e3:a.location.x),ee=ee.y,isNaN(ee)&&(ee=z?Math.round(1e3*a.location.y)/1e3:a.location.y);var oe=a.maxLocation,ue=oe.x;return isNaN(ue)&&(ue=z?Math.round(1e3*a.location.x)/1e3:a.location.x),oe=oe.y,isNaN(oe)&&(oe=z?Math.round(1e3*a.location.y)/1e3:a.location.y),E.h(Math.max(re,Math.min(x.x,ue)),Math.max(ee,Math.min(x.y,oe))),b!==y&&Ie.free(b),E};function Cf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function bf(a,y,x,E,b){if(b===void 0&&(b=Cf(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var ee=b.gridSnapOrigin,re=ee.x;if(ee=ee.y,b=b.gridSnapCellSpot,z!==null){var oe=z.gridCellSize;isNaN(a)&&(a=oe.width),isNaN(y)&&(y=oe.height),z=z.gridOrigin,isNaN(re)&&(re=z.x),isNaN(ee)&&(ee=z.y)}z=Ie.allocAt(0,0),z.yi(0,0,a,y,b),Re.No(x.x,x.y,re+z.x,ee+z.y,a,y,E),Ie.free(z)}}function Ff(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof qn&&(y.suspendsRouting=!0)}function Zh(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof qn&&(x.suspendsRouting=!1,iy(x)&&x.bb())}a.Mr=!1}}function ig(a,y,x){return y=y.containingGroup,y!==null&&(a=ig(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}be=jt.prototype,be.Pd=function(a,y,x){if(x===void 0)return new ch(ai);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new ch(new Ie(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new ch(x.copy())};function rg(a,y,x){if(y.diagram!==null&&y.diagram!==a&&Ke("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&Ke("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&Ke("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&Ke("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&&Ke("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}be.Al=function(a){rg(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(Zo,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},be.Ww=function(a,y){rg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(ha,"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(Zo,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},be.Cy=function(a,y){rg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(ha,"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(Zo,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},be.kA=function(a){if(a.diagram!==this&&Ke("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(ha,"layers",this,a,null,x,null),this.N(),this.Ya()}}},be.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},be.Yw=function(a){return this.pf===null&&(this.pf=new Nn),this.pf.add(a),this.model.Pe(a),this},be.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},be.Pe=function(a){return this.zg===null&&(this.zg=new Nn),this.zg.add(a),this},be.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},be.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==Ir&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},be.cb=function(a,y,x,E,b,z,ee){z===void 0&&(z=null),ee===void 0&&(ee=null);var re=new tr;re.diagram=this,re.change=a,re.propertyName=y,re.object=x,re.oldValue=E,re.oldParam=z,re.newValue=b,re.newParam=ee,this.ds(re)},be.g=function(a,y,x,E,b){this.cb(uo,a,this,y,x,E,b)},jt.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===uo){var b=a.object;if(Ga(b,a.propertyName,a.I(y)),b instanceof Ft){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===Zo){var ee=a.object,re=a.newParam,oe=a.newValue;if(ee instanceof Vn)if(typeof re=="number"&&oe instanceof Ft){y?ee.pc(re):ee.Gb(re,oe);var ue=ee.part;ue!==null&&ue.Wb()}else typeof re=="number"&&oe instanceof xs&&(oe.isRow?d1(ee,re,y?void 0:oe):c1(ee,re,y?void 0:oe));else if(ee instanceof Fs){var he=a.oldParam===!0;typeof re=="number"&&oe instanceof mr&&(y?(oe.isSelected=!1,oe.isHighlighted=!1,oe.Wb(),ee.pc(he?re:-1,oe,he)):ee.oi(re,oe,he))}else ee instanceof jt?typeof re=="number"&&oe instanceof Fs&&(y?this.Wa.mb(re):(oe.Xe(this),this.Wa.Gb(re,oe))):Ke("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===ha){var ge=a.object,xe=a.oldParam,Pe=a.oldValue;if(ge instanceof Vn)typeof xe=="number"&&Pe instanceof Ft?y?ge.Gb(xe,Pe):ge.pc(xe):typeof xe=="number"&&Pe instanceof xs&&(Pe.isRow?d1(ge,xe,y?Pe:void 0):c1(ge,xe,y?Pe:void 0));else if(ge instanceof Fs){var Fe=a.newParam===!0;typeof xe=="number"&&Pe instanceof mr&&(y?0>ge.Pa.indexOf(Pe)&&ge.oi(xe,Pe,Fe):(Pe.isSelected=!1,Pe.isHighlighted=!1,Pe.Wb(),ge.pc(Fe?xe:-1,Pe,Fe)))}else ge instanceof jt?typeof xe=="number"&&Pe instanceof Fs&&(y?(Pe.Xe(this),this.Wa.Gb(xe,Pe)):this.Wa.mb(xe)):Ke("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==Ir&&Ke("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},jt.prototype.Ea=function(a){return this.undoManager.Ea(a)},jt.prototype.eb=function(a){return this.undoManager.eb(a)},jt.prototype.Kf=function(){return this.undoManager.Kf()},jt.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}},jt.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},jt.prototype.rp=function(){this.partManager.rp()};function og(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Ju(a),a.N(),a.Ee=!0,E.zb&&(lh(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Ju(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,ee=a.ya,re=a.zoomPoint.x,oe=a.zoomPoint.y,ue=a.contentAlignment;isNaN(re)&&(ue.$c()?ue.Hf(zi)?re=0:ue.Hf(Ei)&&(re=z-1):re=ue.sb()?ue.x*(z-1):z/2),isNaN(oe)&&(ue.$c()?ue.Hf(bn)?oe=0:ue.Hf(Mi)&&(oe=ee-1):oe=ue.sb()?ue.y*(ee-1):ee/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=Ie.allocAt(a.pa.x+re/y-re/x,a.pa.y+oe/y-oe/x),a.position=z,Ie.free(z),a.Ca=x,Ju(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),cu(a,!1),E.zb&&(lh(E)||E.ce.add(E.H,"scale",y,a.Ca))}}jt.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!==rl||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof wo&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),ts(b,this)),this.vb||this.invalidateViewport(a,y),Xu(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 Xu(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=Pn.alloc(),b=1,z=1,ee=x.O.s,re=ee.length,oe=0;oe<re;oe++){var ue=ee[oe],he=Math.abs(ue.interval);2>he||(bv(ue.figure)?z=z*he/Re.vx(z,he):b=b*he/Re.vx(b,he))}if(ee=x.gridCellSize,E.h(z*ee.width,b*ee.height),y!==void 0)b=y.width,z=y.height,a=y.x,ee=y.y;else{if(y=Wt.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){Wt.free(y);return}b=y.width,z=y.height,a=y.x,ee=y.y,Wt.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=Ie.alloc(),Re.No(a,ee,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),Pn.free(E),x.part.location=y,Ie.free(y)}}jt.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)}},jt.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))},jt.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),xn(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof mr||Ke("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 mr||Ke("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},jt.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()}},be=jt.prototype,be.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},be.Jz=function(a){a=new Tn().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 mr||Ke("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},be.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=Ie.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)),Ie.free(z);return}Ke("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):Ke("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),Ie.free(z)},be.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)},be.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},be.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)},be.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,ee=y.m11,re=y.m12,oe=y.m21,ue=y.m22,he=y.dx,ge=y.dy,xe=x*ee+E*oe+he;y=x*re+E*ue+ge;var Pe=b*ee+E*oe+he;return a=b*re+E*ue+ge,E=x*ee+z*oe+he,x=x*re+z*ue+ge,ee=b*ee+z*oe+he,b=b*re+z*ue+ge,z=Math.min(xe,Pe),xe=Math.max(xe,Pe),Pe=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),xe=Math.max(xe,E),Pe=Math.min(Pe,x),y=Math.max(y,x),z=Math.min(z,ee),xe=Math.max(xe,ee),Pe=Math.min(Pe,b),y=Math.max(y,b),new Wt(z,Pe,xe-z,y-Pe)},be.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),$n(a.copy(),this.Ab)};function ag(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function sg(a){return a=Mf.get(a),a!==null?new a:new ya}jt.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===Ir&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(oe){return oe.diagram=b}),a.mouseMoveTools.each(function(oe){return oe.diagram=b}),a.mouseUpTools.each(function(oe){return oe.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===Ir){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),Gs(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||df(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 ee=a.isTransactionFinished;if(ee&&(ag(this),this.As.clear(),Hg(this.animationManager)),!this.Rt&&ee&&this.lastInput.targetDiagram){this.Rt=!0;var re=this;vr(function(){re.currentTool.standardMouseOver(),re.Rt=!1},10)}}}finally{this.aa=!0}}}};function Kd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)md(a,y[E])}function md(a,y){if(y instanceof Tl){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof Tn&&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 lg(a,y){if(y instanceof Tl){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 Tn&&x.Bg.remove(a),dp(E));break}}}}}jt.prototype.Wd=function(){this.partManager.Wd()},jt.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},jt.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},jt.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},jt.prototype.Vb=function(a){return this.partManager.Vb(a)},jt.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},be=jt.prototype,be.Lc=function(a){return this.partManager.Lc(a)},be.ii=function(a){return this.partManager.ii(a)},be.Kc=function(a){return this.partManager.Kc(a)},be.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:Hn(li(y)))},be.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:Hn(li(y)))};function Ju(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 ug(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),cu(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}be.Va=function(){if(this.Zi){var a=Wt.alloc();ug(this,this.computeBounds(a)),Wt.free(a)}},be.rz=function(){for(var a=new Tn,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},be.qz=function(){return this.ai.iterator},be.Uz=function(a){Gs(this),a&&vd(this,!0),this.ld?dg(this,!1):(this.Jk=!0,Wl(this))};function vd(a,y){for(var x=a.ai.iterator;x.next();)hg(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function hg(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)hg(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function dg(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||sh(z,"Layout")),a.xh=!1;for(var ee=a.ai.iterator;ee.next();)cg(a,ee.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),Gs(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||df(z),a.aa=x}}}function cg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)cg(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),hh(a,y),b.isValidLayout=!0):a.xh=!0)}}be.yz=function(){for(var a=new Nn,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&x.kh()===null&&a.add(x)}return a.iterator};function Zp(a){function y(b){var z=b.toLowerCase(),ee=new Nn;x.add(b,ee),x.add(z,ee),E.add(b,b),E.add(z,b)}var x=new Gt,E=new Gt;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 Qg(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function Gh(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;Ke("Unknown DiagramEvent name: "+y)}be.Bj=function(a,y){return a=Gh(this,a),a!==null&&a.add(y),this},be.am=function(a,y){a=Gh(this,a),a!==null&&a.remove(y)},be.R=function(a,y,x){var E=Gh(this,a),b=new Qr;if(b.diagram=this,a=Qg(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 Lf(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}be.Yj=function(a,y){return kc(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},jt.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Sf(this,a):a.assign(this.documentBounds)};function kc(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new sm(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=$g(a,x)),x===null){y=Wt.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var ee=z.value,re=ee.layer;re!==null&&re.visible&&!re.isTemporary&&Bf(a,ee,E,y)}Wt.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=Wt.alloc(),z=x.memberParts;z.next();)ee=z.value,ee instanceof Ci&&Bf(a,ee,E,y);Wt.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&ox(b);return b}function $g(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?$g(a,y.containingGroup):null}function Bf(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(vp(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(ic,x,y+1);else for(var ee=x;ee<=y;ee++)z[ee]=ic}else if(y instanceof to)for(y=y.memberParts;y.next();)b=y.value,b instanceof Ci&&Bf(a,b,x,E)}}function yd(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}jt.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():fg(this)};function fg(a){a.vk===-1&&(a.vk=vr(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=Wt.alloc(),a.computeBounds(y),y.ed(a.documentBounds),ug(a,y),Wt.free(y),a.Fc=!0,a.bd(),fg(a))}},a.vp))}jt.prototype.ug=function(){this.vk!==-1&&(wn.clearTimeout(this.vk),this.vk=-1)},jt.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=Wt.allocAt(0,0,E.width*b,E.height*b);var z=Ie.allocAt(0,0);if(a.x>=E.x&&a.x<E.x+x.left&&this.allowHorizontalScroll){var ee=Math.max(this.scrollHorizontalLineChange,1);ee|=0,z.x-=ee,a.x<E.x+x.left/2&&(z.x-=ee),a.x<E.x+x.left/4&&(z.x-=4*ee)}else a.x<=E.x+E.width&&a.x>E.x+E.width-x.right&&this.allowHorizontalScroll&&(ee=Math.max(this.scrollHorizontalLineChange,1),ee|=0,z.x+=ee,a.x>E.x+E.width-x.right/2&&(z.x+=ee),a.x>E.x+E.width-x.right/4&&(z.x+=4*ee));return a.y>=E.y&&a.y<E.y+x.top&&this.allowVerticalScroll?(ee=Math.max(this.scrollVerticalLineChange,1),ee|=0,z.y-=ee,a.y<E.y+x.top/2&&(z.y-=ee),a.y<E.y+x.top/4&&(z.y-=4*ee)):a.y<=E.y+E.height&&a.y>E.y+E.height-x.bottom&&this.allowVerticalScroll&&(ee=Math.max(this.scrollVerticalLineChange,1),ee|=0,z.y+=ee,a.y>E.y+E.height-x.bottom/2&&(z.y+=ee),a.y>E.y+E.height-x.bottom/4&&(z.y+=4*ee)),z.Xa(ai)||(y=new Ie(y.x+z.x/b,y.y+z.y/b)),Wt.free(E),Ie.free(z),y},be=jt.prototype,be.Cs=function(){return null},be.av=function(){return null},be.bs=function(a,y){this.pj.add(a,y)},be.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof to&&(y.$p=null)})};function xd(a,y,x){function E(){var he=+new Date;for(z=!0,ee.reset();ee.next();)if(!ee.value[0].al){z=!1;break}z||he-ue>oe?y(x,b,re):wn.requestAnimationFrame(E)}for(var b=x.callback,z=!0,ee=a.Og.iterator;ee.next();)if(!ee.value[0].al){z=!1;break}if(typeof b!="function"||z)return y(x,b,a);var re=a,oe=x.callbackTimeout||300,ue=+new Date;return wn.requestAnimationFrame(function(){E()}),null}be.Wz=function(a){return Ja?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},be.Jx=function(a){return a===void 0&&(a={}),xd(this,this.Xz,a)},be.Xz=function(a,y,x){var E=qg(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 Pd+"data":b=E.getImageData(0,0,x.width,x.height);break;case Pd:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&Ke('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 qg(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&Ke("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 ee=y.maxSize;y.maxSize===void 0&&(ee=x==="SVG"?new Pn(1/0,1/0):new Pn(2e3,2e3));var re=y.position||null,oe=y.parts||null,ue=y.padding===void 0?1:y.padding,he=y.background||null,ge=y.omitTemporary;ge===void 0&&(ge=!0);var xe=y.document||document,Pe=y.elementFinished||null,Fe=y.showTemporary;Fe===void 0&&(Fe=!ge),y=y.showGrid,y===void 0&&(y=Fe),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof ue=="number"?ue=new Kr(ue):ue instanceof Kr||Ke("MakeImage padding must be a Margin or a number."),ue.left=Math.max(ue.left,0),ue.right=Math.max(ue.right,0),ue.top=Math.max(ue.top,0),ue.bottom=Math.max(ue.bottom,0),a.ib.Vc(!0),ge=new Xs(null,xe,void 0,!0);var Ne=ge.context;if(!(b||z||oe||re))return ge.width=a.Aa+Math.ceil(ue.left+ue.right),ge.height=a.ya+Math.ceil(ue.top+ue.bottom),x==="SVG"?E===null?null:(E.resize(ge.width,ge.height,ge.width,ge.height),E.ownerDocument=xe,E.hs=Pe,Ef(a,E.context,ue,new Pn(ge.width,ge.height),a.Ca,a.pa,oe,he,Fe,y),E.context):(a.Xm=!1,Ef(a,Ne,ue,new Pn(ge.width,ge.height),a.Ca,a.pa,oe,he,Fe,y),a.Xm=!0,ge.context);var Je=a.Pp,Ve=a.documentBounds.copy();if(Ve.Fv(a.yb),Fe)for(var ut=a.Wa.s,ft=ut.length,vt=0;vt<ft;vt++){var bt=ut[vt];if(bt.visible&&bt.isTemporary){bt=bt.Pa.s;for(var zt=bt.length,vi=0;vi<zt;vi++){var Xi=bt[vi];Xi.isInDocumentBounds&&Xi.isVisible()&&(Xi=Xi.actualBounds,Xi.w()&&Ve.ed(Xi))}}}if(ut=new Ie(Ve.x,Ve.y),oe!==null){for(ft=new Wt(0,0,0,0),vt=!0,bt=oe.iterator,bt.reset();bt.next();)zt=bt.value,zt instanceof mr&&(vi=zt.layer,vi!==null&&!vi.visible||vi!==null&&!Fe&&vi.isTemporary||!zt.isVisible()||(zt=zt.actualBounds,zt.w()&&(vt?(vt=!1,ft.assign(zt)):ft.ed(zt))));Ve.width=ft.width,Ve.height=ft.height,ut.x=ft.x,ut.y=ft.y}return re!==null&&re.w()&&(ut=re,z||(z=Je)),ft=re=0,ue!==null&&(re=ue.left+ue.right,ft=ue.top+ue.bottom),vt=bt=0,b!==null&&(bt=b.width,vt=b.height,isFinite(bt)&&(bt=Math.max(0,bt-re)),isFinite(vt)&&(vt=Math.max(0,vt-ft))),b!==null&&z!==null?(z==="NaN"&&(z=Je),b.w()?(b=bt,Ve=vt):isNaN(vt)?(b=bt,Ve=Ve.height*z):(b=Ve.width*z,Ve=vt)):b!==null?b.w()?(z=Math.min(bt/Ve.width,vt/Ve.height),b=bt,Ve=vt):isNaN(vt)?(z=bt/Ve.width,b=bt,Ve=Ve.height*z):(z=vt/Ve.height,b=Ve.width*z,Ve=vt):z!==null?z==="NaN"&&ee.w()?(z=Math.min((ee.width-re)/Ve.width,(ee.height-ft)/Ve.height),z>Je?(z=Je,b=Ve.width,Ve=Ve.height):(b=ee.width,Ve=ee.height)):(b=Ve.width*z,Ve=Ve.height*z):(z=Je,b=Ve.width,Ve=Ve.height),ue!==null?(b+=re,Ve+=ft):ue=new Kr(0),ee!==null&&(Je=ee.width,ee=ee.height,isNaN(Je)&&(Je=2e3),isNaN(ee)&&(ee=2e3),isFinite(Je)&&(b=Math.min(b,Je)),isFinite(ee)&&(Ve=Math.min(Ve,ee))),ge.width=Math.ceil(b),ge.height=Math.ceil(Ve),x==="SVG"?E===null?null:(E.resize(ge.width,ge.height,ge.width,ge.height),E.ownerDocument=xe,E.hs=Pe,Ef(a,E.context,ue,new Pn(Math.ceil(b),Math.ceil(Ve)),z,ut,oe,he,Fe,y),E.context):(a.Xm=!1,Ef(a,Ne,ue,new Pn(Math.ceil(b),Math.ceil(Ve)),z,ut,oe,he,Fe,y),a.Xm=!0,ge.context)}At.Object.defineProperties(jt.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof me||(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 jo(this,wn.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 jo(this,wn.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(wn,"resize",this.Ov,!1),this.removeEventListener(wn,"wheel",this.$j,!0),Yu===this&&(Yu=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),Qf(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)&&_n(a,"0 <= value <= 1",jt,"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),cu(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),cu(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),cu(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),cu(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&_n(a,">= 0",jt,"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&&_n(a,">= 0",jt,"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 _n(a,">= 0",jt,"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||ag(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&&Ke("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=Jf(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,sh(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=sg(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(wn,"pointermove",this.dk,!0),this.addEventListener(wn,"pointerdown",this.ui,!0),this.addEventListener(wn,"pointerup",this.fk,!0),this.addEventListener(wn,"pointerout",this.ek,!0),this.addEventListener(wn,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(wn,"wheel",this.$j,!0),this.addEventListener(wn,"selectstart",this.preventDefault,!1)):(this.removeEventListener(wn,"pointermove",this.dk,!0),this.removeEventListener(wn,"pointerdown",this.ui,!0),this.removeEventListener(wn,"pointerup",this.fk,!0),this.removeEventListener(wn,"pointerout",this.ek,!0),this.removeEventListener(wn,"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(wn,"wheel",this.$j,!0),this.removeEventListener(wn,"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=Ie.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),gf(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?Ju(this):(this.vb=!0,a=this.scale,$f(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)}Ie.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=Xg(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=Xg(this)),a.type!==Vn.Grid&&Ke("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),Xu(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),Ju(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||Ke("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 Kr(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===Hh&&cu(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,cu(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,og(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&&og(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!==rl&&cu(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()||Ke("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()||Ke("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)):_n(a,"> 0",jt,"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)):_n(a,"> 0",jt,"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),cu(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 Kr(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&&Ke("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();)Qp(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Bh&&a!==os&&a!==wd&&Ke("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 Pn(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 Kr(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),At.Object.defineProperties(jt,{licenseKey:{get:function(){return xg.jc()},set:function(a){xg.add(a.replace(/\s/g,""))}},version:{get:function(){return Vh}}}),jt.prototype.makeImageData=jt.prototype.Jx,jt.prototype.makeImage=jt.prototype.Wz,jt.prototype.cacheGroupExternalLinks=jt.prototype.Fu,jt.prototype.addRenderer=jt.prototype.bs,jt.prototype.makeSVG=jt.prototype.av,jt.prototype.makeSvg=jt.prototype.Cs,jt.prototype.stopAutoScroll=jt.prototype.ug,jt.prototype.doAutoScroll=jt.prototype.gs,jt.prototype.isUnoccupied=jt.prototype.Yj,jt.prototype.raiseDiagramEvent=jt.prototype.R,jt.prototype.removeDiagramListener=jt.prototype.am,jt.prototype.addDiagramListener=jt.prototype.Bj,jt.prototype.findTreeRoots=jt.prototype.yz,jt.prototype.layoutDiagram=jt.prototype.Uz,jt.prototype.findTopLevelGroups=jt.prototype.qz,jt.prototype.findTopLevelNodesAndLinks=jt.prototype.rz,jt.prototype.ensureBounds=jt.prototype.Va,jt.prototype.findLinksByExample=jt.prototype.ls,jt.prototype.findNodesByExample=jt.prototype.ms,jt.prototype.findLinkForData=jt.prototype.Kc,jt.prototype.findNodeForData=jt.prototype.ii,jt.prototype.findPartForData=jt.prototype.Lc,jt.prototype.findLinkForKey=jt.prototype.findLinkForKey,jt.prototype.findNodeForKey=jt.prototype.Vb,jt.prototype.findPartForKey=jt.prototype.findPartForKey,jt.prototype.rebuildParts=jt.prototype.Wd,jt.prototype.transformViewToDoc=jt.prototype.Ps,jt.prototype.transformRectDocToView=jt.prototype.zA,jt.prototype.transformDocToView=jt.prototype.op,jt.prototype.centerRect=jt.prototype.es,jt.prototype.scrollToRect=jt.prototype.tv,jt.prototype.scroll=jt.prototype.scroll,jt.prototype.highlightCollection=jt.prototype.Jz,jt.prototype.highlight=jt.prototype.Iz,jt.prototype.selectCollection=jt.prototype.rA,jt.prototype.select=jt.prototype.select,jt.prototype.updateAllRelationshipsFromData=jt.prototype.rp,jt.prototype.updateAllTargetBindings=jt.prototype.updateAllTargetBindings,jt.prototype.commit=jt.prototype.commit,jt.prototype.rollbackTransaction=jt.prototype.Kf,jt.prototype.commitTransaction=jt.prototype.eb,jt.prototype.startTransaction=jt.prototype.Ea,jt.prototype.raiseChanged=jt.prototype.g,jt.prototype.raiseChangedEvent=jt.prototype.cb,jt.prototype.removeChangedListener=jt.prototype.ik,jt.prototype.addChangedListener=jt.prototype.Pe,jt.prototype.removeModelChangedListener=jt.prototype.mA,jt.prototype.addModelChangedListener=jt.prototype.Yw,jt.prototype.findLayer=jt.prototype.Qj,jt.prototype.removeLayer=jt.prototype.kA,jt.prototype.addLayerAfter=jt.prototype.Cy,jt.prototype.addLayerBefore=jt.prototype.Ww,jt.prototype.addLayer=jt.prototype.Al,jt.prototype.moveParts=jt.prototype.moveParts,jt.prototype.copyParts=jt.prototype.Kj,jt.prototype.removeParts=jt.prototype.Is,jt.prototype.remove=jt.prototype.remove,jt.prototype.add=jt.prototype.add,jt.prototype.clearDelayedGeometries=jt.prototype.bx,jt.prototype.setProperties=jt.prototype.nm,jt.prototype.attach=jt.prototype.Du,jt.prototype.set=jt.prototype.set,jt.prototype.resetInputOptions=jt.prototype.Sx,jt.prototype.setInputOption=jt.prototype.sA,jt.prototype.getInputOption=jt.prototype.Ql,jt.prototype.resetRenderingHints=jt.prototype.Tx,jt.prototype.setRenderingHint=jt.prototype.Xx,jt.prototype.getRenderingHint=jt.prototype.Gf,jt.prototype.maybeUpdate=jt.prototype.bd,jt.prototype.requestUpdate=jt.prototype.$b,jt.prototype.delayInitialization=jt.prototype.Xy,jt.prototype.isUpdateRequested=jt.prototype.Pz,jt.prototype.invalidateDocumentBounds=jt.prototype.Ya,jt.prototype.findObjectsNear=jt.prototype.og,jt.prototype.findPartsNear=jt.prototype.mz,jt.prototype.findObjectsIn=jt.prototype.Cf,jt.prototype.findPartsIn=jt.prototype.ux,jt.prototype.findObjectsAt=jt.prototype.ji,jt.prototype.findPartsAt=jt.prototype.lz,jt.prototype.findObjectAt=jt.prototype.ic,jt.prototype.findPartAt=jt.prototype.Ol,jt.prototype.focusObject=jt.prototype.zz,jt.prototype.alignDocument=jt.prototype.Jy,jt.prototype.zoomToRect=jt.prototype.BA,jt.prototype.zoomToFit=jt.prototype.zoomToFit,jt.prototype.diagramScroll=jt.prototype.kx,jt.prototype.focus=jt.prototype.focus;var Mf=new Gt,ep=null,Ja=wn.document!==void 0,Ud=null,Wh="",rl=new yn(jt,"None",0),Al=new yn(jt,"Uniform",1),Yd=new yn(jt,"UniformToFill",2),Sd=new yn(jt,"CycleAll",10),gg=new yn(jt,"CycleNotDirected",11),pg=new yn(jt,"CycleNotDirectedFast",12),mg=new yn(jt,"CycleNotUndirected",13),vg=new yn(jt,"CycleDestinationTree",14),yg=new yn(jt,"CycleSourceTree",15),Hh=new yn(jt,"DocumentScroll",1),Ac=new yn(jt,"InfiniteScroll",2),Bh=new yn(jt,"TreeParentCollapsed",21),os=new yn(jt,"AllParentsCollapsed",22),wd=new yn(jt,"AnyParentsCollapsed",23),xg=new Nn,Vh="2.3.10",Pd="image",Nc=null,tp=!1;function Qs(){if(Ja){var a=wn.document.createElement("canvas"),y=a.getContext("2d"),x=hn("7ca11abfd022028846");y[x]=hn("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",Yn.Dx+"4ae6247590da4bb21c324ba3a84e385776",gt.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",Re.za],b=1;5>b;b++)y[hn("7ca11abfd7330390")](hn(E[b-1]),10,15*b);for(y[x]=hn("39f046ebb36e4b"),x=1;5>x;x++)y[hn("7ca11abfd7330390")](hn(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(gt.prototype.Cd=gt.prototype.Eu),Nc=a}}jt.className="Diagram",jt.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=wn.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof jt?y.H:null},jt.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},jt.useDOM=function(a){Ja=a?wn.document!==void 0:!1},jt.isUsingDOM=function(){return Ja},jt.None=rl,jt.Uniform=Al,jt.UniformToFill=Yd,jt.CycleAll=Sd,jt.CycleNotDirected=gg,jt.CycleNotDirectedFast=pg,jt.CycleNotUndirected=mg,jt.CycleDestinationTree=vg,jt.CycleSourceTree=yg,jt.DocumentScroll=Hh,jt.InfiniteScroll=Ac,jt.TreeParentCollapsed=Bh,jt.AllParentsCollapsed=os,jt.AnyParentsCollapsed=wd;function np(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Kh(a,y){if(y.ib.setTransform(y.Mb,0,0,y.Mb,0,0),y.ib.yc(),a.Rc===null)e:{y="f";var x=wn[hn("76a715b2f73f148a")][hn("72ba13b5")]||"";if(a.Rc=!0,Ja){var E=jt[hn("76a115b6ed251eaf4692")];if(E)for(var b=xg.iterator;b.next()&&(E=b.value,E=hn(E).split(hn("39e9")),!(6>E.length));){var z=hn(E[1]).split(".");if(E[4]!=="7da71ca0")break;var ee=hn(Yn[hn("6cae19")]).split(".");if(z[0]>ee[0]||z[0]===ee[0]&&z[1]>=ee[1]){var re=wn[hn("74a900bae4370f8b51")][hn("6fbb13a1c2311e8a57")].toLowerCase();if(ee=re[hn("73a612b6fb191d")](hn("3aad1ab6e022098b4dc4")),z=hn(E[2]),-1<ee&&(re=re[hn("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<re&&re<ee),!a.Rc))break;for(ee=x[hn("76ad18b4f73e")],re=x[hn("73a612b6fb191d")](hn("35e7"))+2;re<ee;re++)y+=x[re];if(ee=y[hn("73a612b6fb191d")](z),0>ee&&z!==hn("7da71ca0ad381e90")&&(ee=y[hn("73a612b6fb191d")](hn("76a715b2ef3e149757"))),0>ee&&(ee=y[hn("73a612b6fb191d")](hn("76a715b2ef3e149757"))),0>ee&&(ee=y[hn("73a612b6fb191d")](hn("2bfa41fdb3784bca12"))),0>ee&&(ee=x[hn("73a612b6fb191d")](hn("7baa19a6f76c1988428554"))),a.Rc=!(0<=ee&&ee<y[hn("73a612b6fb191d")](hn("35"))||y[hn("73a612b6fb191d")](hn("35"))===-1),!a.Rc||x[hn("73a612b6fb191d")](hn("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[hn("73a612b6fb191d")](z)),!a.Rc)||(ee=wn[hn("76a715b2f73f148a")][hn("69ad17a1e03e")],re=ee[hn("73a612b6fb191d")](hn("7fb002b6ed25128b4da25b2e")),-1<re&&(a.Rc=!(ee[hn("73a612b6fb191d")](z)>re),!a.Rc)))break;if(z[0]==="#"){ee=wn.document.createElement("div");for(var oe=E[0].replace(/[A-Za-z]/g,"");4>oe.length;)oe+="9";if(re=oe,oe=oe.substr(oe.length-4),E="",E+=["gsh","gsf"][parseInt(oe.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(oe.substr(0,1),10)%4],ee[hn("79a417a0f0181a8946")]=E,wn.document[hn("78a712aa")]){wn.document[hn("78a712aa")][hn("7bb806b6ed32388c4a875b")](ee),oe=wn.getComputedStyle(ee).getPropertyValue(hn("78a704b7e62456904c9b12701b6532a8"));var ue=wn.getComputedStyle(ee).getPropertyValue(hn("75b817b0ea2202"));if(wn.document[hn("78a712aa")][hn("68ad1bbcf533388c4a875b")](ee),oe){if(ee=wn[hn("77a902b0eb1b1e804a8a")],ue==="0."+parseInt(re,10)%100||oe.indexOf(parseInt(z[1]+z[2],16))!==-1&&oe.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(ee&&ee(hn("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(E="."+E,z=0;z<document.styleSheets.length;z++){ee=document.styleSheets[z].rules||document.styleSheets[z].cssRules;for(var he in ee)if(E===ee[he].selectorText){a.Rc=!1;break e}}}}else a.Rc=null,a.Rc=!1}}}else{for(he=x[hn("76ad18b4f73e")],b=x[hn("73a612b6fb191d")](hn("35e7"))+2;b<he;b++)y+=x[b];x=y[hn("73a612b6fb191d")](hn("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[hn("73a612b6fb191d")](hn("35")))}}}return 0<a.Rc&&a!==a.wy}np.className="DiagramHelper";function ch(a){this.j=a===void 0?new Ie:a,this.o=new Ie}At.Object.defineProperties(ch.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 Ed="DraggingInfo";ch.className="DraggingInfo";function ie(a,y,x){this.node=a,this.info=y,this.Su=x}ie.className="DraggingNodeInfoPair";function ae(){this.reset()}ae.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new Pn(NaN,NaN).freeze(),this.gridSnapCellSpot=Po,this.gridSnapOrigin=new Ie(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},ae.className="DraggingOptions";function fe(a,y){if(typeof a=="string"||wn.Element&&a instanceof Element)var x=jt.call(this,a)||this;else x=jt.call(this)||this,y=a;return ce(x),y&&x.nm(y),x}_t(fe,jt);function ce(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=Yo,a.layout=new Hs}fe.prototype.reset=function(){jt.prototype.reset.call(this),ce(this)},fe.className="Palette";function me(a,y){if(typeof a=="string"||wn.Element&&a instanceof Element)var x=jt.call(this,a)||this;else x=jt.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 mr;var b=new lo;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 Kr(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Qe,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var ee=z.viewportBounds,re=E.lastInput.documentPoint;z.position=new Ie(re.x-ee.width/2,re.y-ee.height/2)}},x.Pf=function(){E.Ya(),Ge(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&&Ge(E)},x.autoScale=Al,x.vb=!1,y&&Object.assign(x,y),x}_t(me,jt),me.prototype.computePixelRatio=function(){return 1},me.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(Hd(this),this.ql===null){var x=new Xs(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),ke(this)}finally{this.ta=a,this.ib=y}}}jt.prototype.redraw.call(this)},me.prototype.gc=function(){if(this.Ka===null&&Ke("No div specified"),this.ta===null&&Ke("No canvas specified"),!(this.ta instanceof jo)&&(Vv(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Hd(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?ke(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 ke(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=Wt.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Xu(y,b),Wt.free(b),Gs(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 ee=0;ee<z;ee++){var re=y[ee],oe=a;if(re.visible&&re.opacity!==0){var ue=re.diagram.grid.part;if(!x&&re.isTemporary)E&&ue.layer===re&&(re=Uu(re,b),ue.gc(b,oe),b.globalAlpha=re);else{for(var he=Uu(re,b),ge=oe.scale,xe=Wt.alloc(),Pe=re.Pa.s,Fe=Pe.length,Ne=0;Ne<Fe;Ne++){var Je=Pe[Ne];(E||Je!==ue)&&re.Oj(b,Je,oe,null,ge,xe,!1)}Wt.free(xe),b.globalAlpha=he}}}}}function Ge(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=Pn.alloc();b.h(x.width,x.height),E.desiredSize=b,Pn.free(b),a=2/a.scale,E instanceof lo&&(E.strokeWidth=a),y.location=new Ie(x.x-a/2,x.y-a/2),y.isSelected=!0}}}me.prototype.computeBounds=function(){var a=this.observed;if(a===null)return es;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},me.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},me.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),Ge(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))},At.Object.defineProperties(me.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof me&&Ke("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),Ge(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),Ge(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)}}}),me.className="Overview";function Qe(){Da.call(this),this.j=null}_t(Qe,Da),Qe.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 Ie(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new Ie(a.x-this.j.x,a.y-this.j.y)),!0)},Qe.prototype.doActivate=function(){this.j=null,Da.prototype.doActivate.call(this)},Qe.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Qe.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 Ie(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new Ie(a.x-this.j.x,a.y-this.j.y)}}},Qe.className="OverviewDraggingTool";function Xe(){Ar(this),this.H=Yu,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=es,this.hb=!0,this.cg=null,this.ob=200}Xe.prototype.toString=function(){return"CommandHandler"},Xe.prototype.Xe=function(a){this.H=a},Xe.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=Gr?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()},Xe.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Xe.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof wo&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Xe.prototype.canStopCommand=function(){return!0},Xe.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=""}},Xe.prototype.canSelectAll=function(){return this.diagram.allowSelect},Xe.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 Tn,x=a.selection.iterator;x.next();)jc(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=""}},Xe.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Xe.prototype.copySelection=function(){var a=this.diagram,y=new Tn;for(a=a.selection.iterator;a.next();)jc(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Xe.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Xe.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Xe.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Xe.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Ud=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 Nn,x.addAll(z),Ud=x,Wh=y.model.dataFormat}}y.R("ClipboardChanged",x)},Xe.prototype.pasteFromClipboard=function(){var a=new Tn,y=Ud;if(y===null)return a;var x=this.diagram;if(Wh!==x.model.dataFormat)return a;var E=x.model,b=!1,z=!1,ee=null;try{E.Tl()&&(b=E.Jj,E.Jj=this.copiesParentKey),E.Wj()&&(z=E.Ij,E.Ij=this.copiesGroupKey),ee=x.Kj(y,x,!1)}finally{for(E.Tl()&&(E.Jj=b),E.Wj()&&(E.Ij=z),y=ee.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},Xe.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);pd(y,z,new Ie(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=""}},Xe.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Ud===null||Ud.count===0||Wh!==a.model.dataFormat)},Xe.prototype.undo=function(){this.diagram.undoManager.undo()},Xe.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Xe.prototype.redo=function(){this.diagram.undoManager.redo()},Xe.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Xe.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===rl&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Xe.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==rl?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Xe.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===rl&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Xe.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==rl?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Xe.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Xe.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Xe.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;sh(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=es):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),df(y)},Xe.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Xe.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(oe){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;sh(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=xt(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 oe=b.pop();0<b.length&&oe instanceof Ci&&oe.isTreeExpanded&&(!(oe instanceof to)||oe.isSubGraphExpanded);)oe=b.pop();0<b.length?(oe instanceof mr&&y.tv(oe.actualBounds),oe instanceof Ci&&!oe.isTreeExpanded&&(oe.isTreeExpanded=!0),oe instanceof to&&!oe.isSubGraphExpanded&&(oe.isSubGraphExpanded=!0)):(oe instanceof mr&&y.es(oe.actualBounds),y.am("LayoutCompleted",ee)),y.eb("Scroll To Part")},ee=function(){vr(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",ee),z()}}else{var re=y.position.copy();y.es(a.actualBounds),re.Xa(y.position)&&x.Cc()}}};function xt(a,y,x){if(y.isVisible())return x;if(y instanceof ta)xt(a,y.adornedPart,x);else if(y instanceof qn){var E=y.fromNode;E!==null&&xt(a,E,x),y=y.toNode,y!==null&&xt(a,y,x)}else y instanceof Ci&&(E=y.labeledLink,E!==null&&xt(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),xt(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),xt(a,y,x));return x}Xe.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof mr)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Xe.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),sh(y.animationManager,"Collapse Tree");var x=new Nn;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 Ci&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Xe.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Ci&&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 Ci&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Xe.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),sh(y.animationManager,"Expand Tree");var x=new Nn;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 Ci&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Xe.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Ci)||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 Ci&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Xe.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 Nn,z=a.selection.iterator;z.next();){var ee=z.value;ee.Zc()&&ee.canGroup()&&b.add(ee)}for(var re=new Nn,oe=b.iterator;oe.next();){var ue=oe.value;z=!1;for(var he=b.iterator;he.next();)if(ue.Td(he.value)){z=!0;break}z||re.add(ue)}if(0<re.count){var ge=re.first().containingGroup;if(ge!==null)for(;ge!==null;){b=!1;for(var xe=re.iterator;xe.next();)if(!xe.value.Td(ge)){b=!0;break}if(b)ge=ge.containingGroup;else break}if(x instanceof to)zu(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var Pe=y.copyNodeData(x);$t(Pe)&&(y.xf(Pe),E=a.ii(Pe))}if(E!==null){ge!==null&&this.isValidMember(ge,E)&&(E.containingGroup=ge);for(var Fe=re.iterator;Fe.next();){var Ne=Fe.value;this.isValidMember(E,Ne)&&(Ne.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Xe.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 an(a){var y=gi();for(a=a.iterator;a.next();){var x=a.value;x instanceof qn||y.push(x)}a=new Tn,x=y.length;for(var E=0;E<x;E++){for(var b=y[E],z=!0,ee=0;ee<x;ee++)if(b.Td(y[ee])){z=!1;break}z&&a.add(b)}return Ii(y),a}Xe.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof qn)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},Xe.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 Nn;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof to&&z.canUngroup()&&E.add(z)}var ee=new Nn;if(0<E.count){y.clearSelection(!0);for(var re=E.iterator;re.next();){var oe=re.value;oe.expandSubGraph();var ue=oe.containingGroup,he=ue!==null&&ue.data!==null?x.wa(ue.data):void 0;ee.addAll(oe.memberParts);for(var ge=ee.iterator;ge.next();){var xe=ge.value;if(xe.isSelected=!0,!(xe instanceof qn)){var Pe=xe.data;Pe!==null?x.mp(Pe,he):xe.containingGroup=ue}}y.remove(oe)}}y.R("SelectionUngrouped",E,ee)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Xe.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 to))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof to&&y.canUngroup())return!0;return!1},Xe.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=an(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Xe.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),sh(y.animationManager,"Collapse SubGraph");var x=new Nn;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 to&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Xe.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof to&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof to&&y.isSubGraphExpanded)return!0;return!1},Xe.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),sh(y.animationManager,"Expand SubGraph");var x=new Nn;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 to&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Xe.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof to&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof to&&!y.isSubGraphExpanded)return!0;return!1},Xe.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 Ia&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Xe.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 Ia))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 Ia&&x.editable}),a!==null))return!0;return!1},Xe.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 Ft?b=a.ga(Hr):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new Ie(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,Fh(x,!1,a)}},Xe.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)},Xe.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 Gt,a===null)return E;for(var z=a.iterator;z.next();)dh(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 qn&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},At.Object.defineProperties(Xe.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||Ke("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}}}),Xe.className="CommandHandler",zp=function(){return new Xe};function Ft(){Ar(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new Ie(NaN,NaN).freeze(),this.jd=Qo,this.Ab=new gt,this.wh=new gt,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=ss,this.uc=new Wt(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Wt(NaN,NaN,NaN,NaN).freeze(),this.dc=new Wt(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=ar,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 zn,Mn,qi,cr,Br,$r,No,co,zo,va;Ft.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=Xt(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},Ft.prototype.Vw=function(a){var y=this.Dh;if(xn(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},Ft.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},Ft.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},Ft.prototype.copy=function(){return this.clone()},be=Ft.prototype,be.qb=function(a){a.classType===qn?a.name.indexOf("Orient")===0?this.segmentOrientation=a:Ke("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===Ft&&(this.stretch=a)},be.toString=function(){return Fi(this.constructor)+"#"+br(this)},be.th=function(){this.A!==null&&(this.A.nc=!0)};function fo(a){a.A===null?a.A=new Or:a.A.nc&&(a.A=a.A.copy())}be.Xc=function(){if(this.ba===null){var a=new ao;a.Xi=Xr,a.yj=Xr,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},be.cb=function(a,y,x,E,b,z,ee){var re=this.part;if(re!==null&&(re.gk(a,y,x,E,b,z,ee),x===this&&a===uo&&ve(this)&&ja(this,re,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 Gt),ee=z.undoManager.transactionLevel===0,a.startCondition===jh?ee=!0:a.startCondition===zd&&(ee=!1),ee?(z=new Zs,Vg(a,z),ee=this.jo.get(a),ee!==null&&ee.stop(),this.jo.add(a,z),z.vu=this,z.Nw=a,z.add(this,y,E,b),z.start()):(sh(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof Vn&&x===re&&(re.l&16777216)!==0&&re.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)re=x[b],re instanceof Vn&&Nf(re,function(oe){oe.data!==null&&oe.l&16777216&&oe.La(y)})};function ja(a,y,x){var E=a.ih();if(E!==null)for(var b=a.localBindings.iterator;b.next();){var z=b.value,ee=null;if(z.sourceName!==null){if(ee=Lx(z,E,a),ee===null)continue;z.sp(a,ee,x,null)}else if(z.isToModel){var re=y.diagram;re===null||re.skipsModelSourceBindings||z.sp(a,re.model.modelData,x,E)}else{if(re=E.data,re===null)continue;var oe=y.diagram;oe===null||oe.skipsModelSourceBindings||z.sp(a,re,x,E)}ee===a&&(re=E.ks(z.Ai),re!==null&&z.Mv(re,ee,x))}}be.ks=function(a){return this.bindingId===a?this:null},be.g=function(a,y,x){this.cb(uo,a,this,y,x)},be.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 gt);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function ys(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}be.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?pi(a.x,a.y,0,0,0,E.height)<=y||pi(a.x,a.y,0,E.height,E.width,E.height)<=y||pi(a.x,a.y,E.width,E.height,E.width,0)<=y||pi(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},be.se=function(){return!0},be.ca=function(a){var y=Ie.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return Ie.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),ee=z/2,re=this.naturalBounds;E=this.Df()*E.scale;var oe=1/E;if(re.width*E<b&&re.height*E<b)return a=Fo(x.x-ee*oe,x.y-ee*oe,x.width+z*oe,x.height+z*oe,y.x,y.y),Ie.free(y),a}return b=!1,(this instanceof ta||this instanceof lo?Fo(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)),Ie.free(y),b},be.gh=function(a){var y=this.naturalBounds;return Fo(0,0,y.width,y.height,a.x,a.y)},be.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=Wt.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=Ie.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)))),Ie.free(b),Wt.free(y),E},be.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=Ie.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)))),Ie.free(b),E},be.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=Ie.allocAt(0,0),b=Ie.allocAt(0,x.height),z=Ie.allocAt(x.width,x.height),ee=Ie.allocAt(x.width,0),re=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(ee)))re=!0;else{x=Wt.allocAt(0,0,x.width,x.height);var oe=Ie.allocAt(a.x,a.y);x.ca(y.Cd(oe))?re=!0:(oe.h(a.x,a.bottom),x.ca(y.Cd(oe))?re=!0:(oe.h(a.right,a.bottom),x.ca(y.Cd(oe))?re=!0:(oe.h(a.right,a.y),x.ca(y.Cd(oe))&&(re=!0)))),Ie.free(oe),Wt.free(x),!re&&(Re.us(a,E,b)||Re.us(a,b,z)||Re.us(a,z,ee)||Re.us(a,ee,E))&&(re=!0)}return Ie.free(E),Ie.free(b),Ie.free(z),Ie.free(ee),re},be.ga=function(a,y){if(y===void 0&&(y=new Ie),a instanceof Zi){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},be.mi=function(a){a===void 0&&(a=new Wt);var y=this.naturalBounds,x=this.oe,E=Ie.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),Mo(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),Mo(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),Mo(a,E.x,E.y,0,0),Ie.free(E),a},be.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},be.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},be.qs=function(a,y){return y===void 0&&(y=new Ie),y.assign(a),this.oe.Cd(y),y},be.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},be.Sj=function(a,y,x,E,b){var z=this.transform,ee=1/(z.m11*z.m22-z.m12*z.m21),re=z.m22*ee,oe=-z.m12*ee,ue=-z.m21*ee,he=z.m11*ee,ge=ee*(z.m21*z.dy-z.m22*z.dx),xe=ee*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,Re.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(ee=a*re+y*ue+ge,a=a*oe+y*he+xe,y=x*re+E*ue+ge,x=x*oe+E*he+xe,b.h(0,0),E=this.naturalBounds,x=Re.Ff(0,0,E.width,E.height,ee,a,y,x,b),b.transform(z),x)},Ft.prototype.measure=function(a,y,x,E){if(tt(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 ee=this.kq();z===90||z===270?(a=isFinite(b.height)?b.height+ee:a,y=isFinite(b.width)?b.width+ee:y):(a=isFinite(b.width)?b.width+ee:a,y=isFinite(b.height)?b.height+ee:y),b=x||0,ee=E||0;var re=this instanceof Vn;switch(gl(this,!0)){case Mn:ee=b=0,re&&(y=a=1/0);break;case zn:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(ee=y);break;case cr:isFinite(a)&&a>x&&(b=a),ee=0,re&&(y=1/0);break;case Br:isFinite(y)&&y>E&&(ee=y),b=0,re&&(a=1/0)}re=this.maxSize;var oe=this.minSize;b>re.width&&oe.width<re.width&&(b=re.width),ee>re.height&&oe.height<re.height&&(ee=re.height),x=Math.max(b,oe.width),E=Math.max(ee,oe.height),re.width<x&&(x=Math.min(oe.width,x)),re.height<E&&(E=Math.min(oe.height,E)),a=Math.min(re.width,a),y=Math.min(re.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()||Ke("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),qe(this,!1)}},Ft.prototype.Wl=function(){},Ft.prototype.Dd=function(){return!1},Ft.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=Wt.alloc();z.assign(this.Ib),this.Ib.ka(),mt(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&&Qd(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 Ia&&(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()||Ke("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),wt(this,!1),Wt.free(z)},be=Ft.prototype,be.eh=function(){};function ol(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 ee=x.top+x.bottom;switch(x=z.width+y,z=z.height+ee,E+=y,b+=ee,y=gl(a,!0),x===E&&z===b&&(y=Mn),y){case Mn:(x>E||z>b)&&(qe(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case zn:qe(a,!0),a.measure(E,b,0,0);break;case cr:qe(a,!0),a.measure(E,z,0,0);break;case Br:qe(a,!0),a.measure(x,b,0,0)}}}be.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||Yv(x,!0),this.N(),bo(a,y)||(x.oh(),this.Pn(x)))},be.Pn=function(a){this.portId!==null&&(Yv(a,!0),a instanceof Ci&&H1(a,this))},be.gc=function(a,y){if(!Vl(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 Vn&&Qd(this),ee=this.Ib;if(z){var re=this.Ib,oe=this.dc,ue=this.areaBackground,he=this.Ma;ue===null&&he===null||a.yc(),ue!==null&&(Qa(this,a,ue,!0,!0,oe,re),ue instanceof $o&&ue.type===Fu?(a.beginPath(),a.rect(re.x,re.y,re.width,re.height),a.ng(ue)):a.fillRect(re.x,re.y,re.width,re.height)),he!==null&&(Qa(this,a,he,!0,!1,oe,re),he instanceof $o&&he.type===Fu?(a.beginPath(),a.rect(re.x,re.y,re.width,re.height),a.ng(he)):a.fillRect(re.x,re.y,re.width,re.height)),this.hh(a,y)}if(!z&&(z||ee.width!==0&&ee.height!==0&&!isNaN(ee.x)&&!isNaN(ee.y))){z=this.transform,re=this.panel,this.l&4096&&Bs(this),ue=this.part,oe=!1;var ge=0;ue&&y.Gf("drawShadows")&&(oe=ue.isShadowed)&&(he=ue.shadowOffset,ge=Math.max(he.y,he.x)*y.scale*y.Mb),he=this.Dd();var xe;if(!(xe=y.$i||!he)){var Pe=this.naturalBounds;xe=this.wh;var Fe=xe.m11,Ne=xe.m21,Je=xe.dx,Ve=xe.m12,ut=xe.m22,ft=xe.dy,vt,bt=vt=0;xe=vt*Fe+bt*Ne+Je;var zt=vt*Ve+bt*ut+ft;vt=Pe.width+ge,bt=0;var vi=vt*Fe+bt*Ne+Je;vt=vt*Ve+bt*ut+ft,bt=Math.min(xe,vi);var Xi=Math.min(zt,vt),Ri=Math.max(xe+0,vi)-bt,Qn=Math.max(zt+0,vt)-Xi;xe=bt,zt=Xi,vt=Pe.width+ge,bt=Pe.height+ge,vi=vt*Fe+bt*Ne+Je,vt=vt*Ve+bt*ut+ft,bt=Math.min(xe,vi),Xi=Math.min(zt,vt),Ri=Math.max(xe+Ri,vi)-bt,Qn=Math.max(zt+Qn,vt)-Xi,xe=bt,zt=Xi,vt=0,bt=Pe.height+ge,vi=vt*Fe+bt*Ne+Je,vt=vt*Ve+bt*ut+ft,bt=Math.min(xe,vi),Xi=Math.min(zt,vt),Ri=Math.max(xe+Ri,vi)-bt,Qn=Math.max(zt+Qn,vt)-Xi,xe=bt,zt=Xi,ge=y.viewportBounds,Pe=ge.x,Fe=ge.y,xe=!(xe>ge.width+Pe||Pe>Ri+xe||zt>ge.height+Fe||Fe>Qn+zt)}if(xe){if(xe=(this.l&256)!==0,a.clipInsteadOfFill&&(xe=!1),this instanceof Ia&&(a.font=this.font),xe){if(zt=re.se()?re.naturalBounds:re.actualBounds,Ri=Math.max(ee.x,zt.x),Qn=Math.max(ee.y,zt.y),ge=Math.min(ee.right,zt.right)-Ri,Pe=Math.min(ee.bottom,zt.bottom)-Qn,Fe=this.tb,Fe!==null&&(Ri=Fe.x,Qn=Fe.y,ge=Fe.width,Pe=Fe.height),Ri>ee.width+ee.x||ee.x>zt.width+zt.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(Ri,Qn,ge,Pe),a.clip()}if(he){if(!ue.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}oe&&(zt=ue.shadowOffset,a.Ev(zt.x*y.scale*this.scale*y.Mb,zt.y*y.scale*this.scale*y.Mb,ue.shadowBlur),zs(a),a.shadowColor=ue.shadowColor)}oe&&this.shadowVisible===!0?zs(a):oe&&this.shadowVisible===!1&&pl(a),ue=this.naturalBounds,this.areaBackground!==null&&(a.yc(),Hl(this,a,ue,ee)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),oe&&Ls(this,re)&&this.shadowVisible===null&&pl(a),this.Ma!==null&&(a.yc(),xl(this,a,ue,ee)),oe&&(this.Ma!==null||this.areaBackground!==null||Ls(this,re))?(gu(this,!0),this.shadowVisible===null&&pl(a)):gu(this,!1),this.hh(a,y),oe&&this.l&512&&zs(a),he&&oe&&pl(a),xe&&(a.restore(),a.Vc(this instanceof Vn)),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 Ls(a,y){return y===null?!1:(Qd(y)&&(y=y.panel),(y.l&512)!==0||(y.type===Vn.Auto||y.type===Vn.Spot)&&y.Pb()!==a)}be.Dv=function(){};function Hl(a,y,x,E){Qa(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof $o&&a.areaBackground.type===Fu?(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 xl(a,y,x,E){var b=a.kq(),z=x.x,ee=x.y,re=x.width+b,oe=x.height+b;Qa(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof $o&&a.Ma.type===Fu?(y.beginPath(),y.rect(z-b/2,ee-b/2,re,oe),y.ng(a.Ma)):y.fillRect(z-b/2,ee-b/2,re,oe)}function $s(a,y,x){for(var E=y.O.s,b=E.length,z=-1,ee=0;ee<b;ee++)if(E[ee]===a){z=ee;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===Vn.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 Vl(a,y,x){if(!(y instanceof da))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&&$s(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),zs(y),y.shadowColor=a.shadowColor}a instanceof Ia&&(y.font=a.font),y.yd=null;var ee=a.transform;z=a instanceof Vn;var re=a instanceof Vn?Qd(a):!1;a.l&4096&&Bs(a);var oe=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&re?(bu(y,1,0,0,1,0,0),a.svg=y.ad):z?(bu(y,ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy),a.svg=y.ad):bu(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var ue=ee.copy().Vj();y.rb.ha=[ue.m11,ue.m12,ue.m21,ue.m22,ue.dx,ue.dy],Hl(a,y,b,oe),y.rb.ha=[1,0,0,1,0,0],y.yd.gd=y.ad,y.yd.prepend(y.ad)}return z||(y.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy]),a.background!==null&&(z?(re&&(y.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy]),xl(a,y,b,oe),re&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy],xl(a,y,b,oe)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),ee=y.yd,b=a.part,re=!1,b&&x.Gf("drawShadows")&&(re=b.isShadowed),y.clipInsteadOfFill&&(re=!1),a.Dd()&&re&&zs(y),re&&a.shadowVisible===!0?zs(y):re&&a.shadowVisible===!1&&pl(y),b=a.panel,re&&Ls(a,b)&&a.shadowVisible===null&&pl(y),y.Il&&(ue=x.computePixelRatio(),ue="drop-shadow("+y.shadowOffsetX/ue+"px "+y.shadowOffsetY/ue+"px "+y.shadowBlur/ue/2+"px "+y.shadowColor+")",a.background!==null&&ee.Ma.setAttributeNS(null,"filter",ue),a.areaBackground!==null&&ee.gd.setAttributeNS(null,"filter",ue)),re&&(a.Ma!==null||a.areaBackground!==null||Ls(a,b))?(gu(a,!0),a.shadowVisible===null&&pl(y)):gu(a,!1),b=re,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),ee=y.Gv.hs,re=z?a.svg:y.yd,ue=a.svg,!z&&ue!==null&&re!==ue&&ue.parentNode===a.panel.svg?(a.svg.replaceWith(re),a.svg=re,re!==null&&a.$o(y,E,oe,re),fl(y,ue),!0):(a.svg=re,ee!==null&&re===null&&(pu(y),y.nh.pop()),re===null||(a.$o(y,E,oe,re),y.Il&&(x=x.computePixelRatio(),a.Dv(re,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),b&&a.l&512&&zs(y),a.Dd()&&pl(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&re.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&re.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(re):y.Nj.prepend(re),y.ti=re):E!==null&&$s(a,E,re),ee!==null&&ee(a,re)),!0)}be.$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 ee=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,ee=z.width,x=z.height),z=E.getAttribute("clip-path");var re=null;z!==null&&(re=a.svg.getElementById(z.split("#")[1].slice(0,-1))),re===null?(z="CLIP"+na++,re=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:ee,height:x}),this instanceof Vn&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),re.appendChild(y),a.svg.appendChild(re),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=re.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",b.toString()),a.setAttribute("width",ee.toString()),a.setAttribute("height",x.toString()))}else E.removeAttributeNS(null,"clip-path"),fl(a,E)};function fl(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function qs(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=li(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()}}be.hh=function(){},be.lv=function(){this.Uc=!0},be.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 Vn?Qd(this):!1;if(!(this instanceof Vn&&b))if(this instanceof Tl){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&ns(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",el(a)):y.setAttributeNS(null,"transform",el(a))}else if(!x||this instanceof Vn)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof lo){z=y.getElementsByTagName("path");for(var ee=0;ee<z.length;ee++)z[ee].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):(ee=E.copy().Vj(),a.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy],Hl(this,a,this.naturalBounds,this.actualBounds),a.rb.ha=[1,0,0,1,0,0],y.gd?(ee=y.gd.getAttribute("filter"),ee!==null&&a.ad.setAttribute("filter",ee),y.gd.replaceWith(a.ad)):y.prepend(a.ad),y.gd=a.ad),z&&Mh(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(Mh(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof Vn))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),xl(this,a,this.naturalBounds,this.actualBounds),y.Ma?(Mh(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&&Mh(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},be.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 Qa(a,y,x,E,b,z,ee){if(x!==null){var re=1,oe=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===Jd)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var ue=a.kq();if(re=z.width,oe=z.height,b?(re=ee.width,oe=ee.height):E||(re+=ue,oe+=ue),(z=y instanceof gh)&&x.xe&&(x.type===ap||x.yk===re&&x.ft===oe))var he=x.xe;else{var ge=0,xe=0,Pe=0,Fe=0,Ne=0,Je=0;if(Je=Ne=0,b?(Ne=ee.x,Je=ee.y):E||(Ne-=ue/2,Je-=ue/2),ge=x.start.x*re+x.start.offsetX,xe=x.start.y*oe+x.start.offsetY,Pe=x.end.x*re+x.end.offsetX,Fe=x.end.y*oe+x.end.offsetY,ge+=Ne,Pe+=Ne,xe+=Je,Fe+=Je,x.type===bd)he=y.createLinearGradient(ge,xe,Pe,Fe);else if(x.type===Fu)Je=isNaN(x.endRadius)?Math.max(re,oe)/2:x.endRadius,isNaN(x.startRadius)?(Ne=0,Je=Math.max(re,oe)/2):Ne=x.startRadius,he=y.createRadialGradient(ge,xe,Ne,Pe,Fe,Je);else if(x.type===ap)try{he=y.createPattern(x.pattern,"repeat")}catch(ut){he=null}if(x.type!==ap&&(b=x.colorStops,b!==null))for(b=b.iterator;b.next();)he.addColorStop(b.key,b.value);if(z&&(x.xe=he,he!==null&&(x.yk=re,x.ft=oe),he===null&&x.type===ap&&x.yk!==-1)){x.yk=-1;var Ve=a.diagram;Ve!==null&&x.yk===-1&&vr(function(){Ve.redraw()},600)}}E?y.fillStyle=he:y.strokeStyle=he}}}be.rg=function(a){if(a instanceof Vn)e:{if(this!==a&&a!==null)for(var y=this.panel;y!==null;){if(y===a){a=!0;break e}y=y.panel}a=!1}else a=!1;return a},be.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},be.If=function(){for(var a=this instanceof Vn?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Bs(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){Be(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)}Be(a,!1),je(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,je(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,je(a,!1)))}be.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Ie.alloc();z.yi(y,x,E,b,Hr),a.rotate(this.Kb,z.x,z.y),Ie.free(z)}},be.v=function(a){if(!tt(this)){a===void 0&&(a=!1),qe(this,!0),wt(this,!0);var y=this.panel;y===null||a||y.v()}},be.Uj=function(){tt(this)||(qe(this,!0),wt(this,!0))};function ul(a){if(!mt(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof Ci&&a.Bd(),y.$b())),wt(a,!0)}}be.Uk=function(){!(this.l&2048)&&(Be(this,!0),je(this,!0))},be.Wu=function(){je(this,!0)},be.N=function(){var a=this.part;a!==null&&a.N()};function gl(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===Vn.Table?Ru(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===Vn.Auto&&E.Pb()===a?Ms(a,zn,y):x===$r?E!==null?E.type===Vn.Spot&&E.Pb()===a?Ms(a,zn,y):(x=E.defaultStretch,x===$r?Ms(a,Mn,y):Ms(a,x,y)):Ms(a,Mn,y):Ms(a,x,y)}function Ru(a,y,x,E){var b=a.stretch;if(b!==$r)return Ms(a,b,E);var z=b=null;switch(y.stretch){case Br:z=!0;break;case zn:z=!0}switch(x.stretch){case cr:b=!0;break;case zn:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===cr||y===zn),z===null&&(z=y===Br||y===zn),b===!0&&z===!0?Ms(a,zn,E):b===!0?Ms(a,cr,E):z===!0?Ms(a,Br,E):Ms(a,Mn,E)}function Ms(a,y,x){if(x)return y;if(y===Mn||(x=a.desiredSize,x.w()))return Mn;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===cr)return Mn;if(y===zn)return Br}else{if(y===Br)return Mn;if(y===zn)return cr}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Br)return Mn;if(y===zn)return cr}else{if(y===cr)return Mn;if(y===zn)return Br}return y}function gu(a,y){a.l=y?a.l|512:a.l&-513}function ve(a){return(a.l&1024)!==0}function Se(a,y){a.l=y?a.l|1024:a.l&-1025}function Be(a,y){a.l=y?a.l|2048:a.l&-2049}function je(a,y){a.l=y?a.l|4096:a.l&-4097}function tt(a){return(a.l&8192)!==0}function qe(a,y){a.l=y?a.l|8192:a.l&-8193}function mt(a){return(a.l&16384)!==0}function wt(a,y){a.l=y?a.l|16384:a.l&-16385}be.Gj=function(){this.svg=null},be.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},be.Av=function(){},be.zv=function(a){return this.pa=a,ul(this),!0},be.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},be.kq=function(){return 0};function Jt(a){var y=a.part;if(y instanceof Ci&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||H1(y,a)}}function mn(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof Vn?a instanceof Ci?a.Bd():a.qm(a,function(x){Jt(x)}):Jt(a))}be.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new cs(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&f1(a)&&Ke("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new Nn),this.localBindings.add(b),this},be.set=function(a){return Object.assign(this,a),this},be.Du=function(a){return rn(this,a),this},be.apply=function(a){return a(this),this},be.nm=function(a){return Wd(this,a),this},be.pz=function(){return this.ih()},be.ih=function(){for(var a=this instanceof Vn?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},be.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new Gt),this.animationTriggers.add(a.propertyName,a),this};function sn(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=Li.I(a);typeof z=="function"?(x=Xt(arguments),E=z(x),$t(E)||Ke('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=wn.go[a]}if(E===null&&(b!=null&&b.constructor||Ke("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 jt&&1<x.length){z=E;var ee=x[1];(typeof ee=="string"||ee instanceof HTMLDivElement)&&(Qf(z,ee),b++)}for(;b<x.length;b++)z=x[b],z===void 0?Ke("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):rn(E,z);return E}function rn(a,y){if(typeof y=="string")if(a instanceof Ia)a.text=y;else if(a instanceof lo)a.figure=y;else if(a instanceof Tl)a.source=y;else if(a instanceof Vn)y=Qu.I(y),y!==null&&(a.type=y);else if(a instanceof $o){var x=Xn($o,y);x!==null?a.type=x:Ke("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof lt?(y=Xn(lt,y),y!==null&&(a.type=y)):a instanceof Er&&(y=Xn(Er,y),y!==null&&(a.type=y));else if(y instanceof Ft)a instanceof Vn||Ke("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof xs){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 xs?$m(E,y):Ke("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof yn)typeof a.qb=="function"&&a.qb(y);else if(y instanceof ws)a.type=y;else if(y instanceof cs)a instanceof Ft||a instanceof xs?a.bind(y):Ke("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Cu)a instanceof Ft?a.Jv(y):Ke("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof Zr)a instanceof lt&&a.type===lt.o?a.figures.add(y):Ke("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Er)a instanceof Zr?a.segments.add(y):Ke("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Va)a instanceof jt||a instanceof to?a.layout=y:Ke("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++)rn(a,y[x]);else if(typeof y=="object"&&y!==null)if(a instanceof $o){x=new er;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);Wd(a,x)}else if(a instanceof xs){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&Ke("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)&&Ke("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new er;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Wd(a,b)}else Wd(a,y);else Ke('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function nn(a,y){Li.add(a,y)}function Ln(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}At.Object.defineProperties(Ft.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Or),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 Or),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 Or),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(fo(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&&(fo(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:wl},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new Vr),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===wl&&(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 Vr),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 Vr),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:ai},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new Vr),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:$r},set:function(a){var y=this.stretch;y!==a&&(fo(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&&(fo(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)&&_n(a,"0 <= value <= 1",Ft,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(If(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(If(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(),mn(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&&Tc(a,"GraphObject.areaBackground"),a instanceof $o&&a.freeze(),fo(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&&Tc(a,"GraphObject.background"),a instanceof $o&&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 mr)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 Ie(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&&Ke("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,mn(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 lo&&this.qc(),this.g("desiredSize",E,a),ve(this)&&(a=this.part,a!==null&&(ja(this,a,"width"),ja(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 Pn(a,this.jd.height).freeze(),this.v(),this instanceof lo&&this.qc(),this.g("desiredSize",y,a),ve(this)&&(a=this.part,a!==null&&ja(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 Pn(this.jd.width,a).freeze(),this.v(),this instanceof lo&&this.qc(),this.g("desiredSize",y,a),ve(this)&&(a=this.part,a!==null&&ja(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:hr},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(),fo(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:Ko},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(),fo(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 Kr(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&&Bs(this),this.Ab}},oe:{get:function(){return this.l&4096&&Bs(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(fo(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Mn},set:function(a){this.reshapingBehavior!==a&&(fo(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()&&Ke("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),ul(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&&_n(a,">= 0",Ft,"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&&_n(a,">= 1",Ft,"columnSpan"),fo(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&&_n(a,">= 0",Ft,"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&&_n(a,">= 1",Ft,"rowSpan"),fo(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&&(fo(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 Ci||Ke("Cannot set portID on a Link: "+a),y!==null&&x!==null&&$v(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,U1(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Xr},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),Jt(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&_n(a,">= 0",Ft,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),Jt(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),Jt(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&&_n(a,">= 0",Ft,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Xr},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),Jt(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&_n(a,">= 0",Ft,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),Jt(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),Jt(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&&_n(a,">= 0",Ft,"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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(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&&(fo(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),Ft.prototype.trigger=Ft.prototype.Jv,Ft.prototype.findBindingPanel=Ft.prototype.ih,Ft.prototype.findTemplateBinder=Ft.prototype.pz,Ft.prototype.setProperties=Ft.prototype.nm,Ft.prototype.apply=Ft.prototype.apply,Ft.prototype.attach=Ft.prototype.Du,Ft.prototype.set=Ft.prototype.set,Ft.prototype.isEnabledObject=Ft.prototype.If,Ft.prototype.isVisibleObject=Ft.prototype.Ed,Ft.prototype.isContainedBy=Ft.prototype.rg,Ft.prototype.getNearestIntersectionPoint=Ft.prototype.rs,Ft.prototype.getLocalPoint=Ft.prototype.qs,Ft.prototype.getDocumentScale=Ft.prototype.Df,Ft.prototype.getDocumentAngle=Ft.prototype.li,Ft.prototype.getDocumentBounds=Ft.prototype.mi,Ft.prototype.getDocumentPoint=Ft.prototype.ga,Ft.prototype.intersectsRect=Ft.prototype.Yc,Ft.prototype.containedInRect=Ft.prototype.fh,Ft.prototype.containsRect=Ft.prototype.Re,Ft.prototype.containsPoint=Ft.prototype.ca,Ft.prototype.raiseChanged=Ft.prototype.g,Ft.prototype.raiseChangedEvent=Ft.prototype.cb,Ft.prototype.addCopyProperty=Ft.prototype.Vw;var Li=null;Ft.className="GraphObject",Li=new Gt,nn("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=sn(Vn,Vn.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof Vn){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"},sn(lo,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Zi(0,0,2.76142374915397,2.761423749153969),spot2:new Zi(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 Vn&&(x=E.fb("ButtonBorder"),x instanceof lo)){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 Vn&&(x=E.fb("ButtonBorder"),x instanceof lo&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof Vn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof lo){x=x.diagram;var z=x.skipsUndoManager;x.skipsUndoManager=!0;var ee=E._buttonFillPressed;E._buttonFillOver=b.fill,b.fill=ee,ee=E._buttonStrokePressed,E._buttonStrokeOver=b.stroke,b.stroke=ee,x.skipsUndoManager=z}}},y.actionUp=function(x,E){if(E.If()&&E instanceof Vn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof lo){var z=x.diagram,ee=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=ee}}},y.actionCancel=function(x,E){if(E.If()&&E instanceof Vn&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof lo){var z=x.diagram,ee=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=ee}}},y.actionMove=function(x,E){if(E.If()&&E instanceof Vn&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof lo))){var z=b.skipsUndoManager;b.skipsUndoManager=!0;var ee=E._buttonFillPressed;x.fill!==ee&&(x.fill=ee),ee=E._buttonStrokePressed,x.stroke!==ee&&(x.stroke=ee),b.skipsUndoManager=z}}},y}),nn("TreeExpanderButton",function(){var a=sn("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},sn(lo,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Yr},new cs("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new cs("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof ta&&(x=x.adornedPart),x instanceof Ci){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}),nn("SubGraphExpanderButton",function(){var a=sn("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},sn(lo,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Yr},new cs("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 ta&&(x=x.adornedPart),x instanceof to){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}),nn("ToolTip",function(){return sn(ta,Vn.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Ie(0,3),shadowBlur:5},sn(lo,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Zi(0,0,4,6),spot2:new Zi(1,1,-4,-4)}))}),nn("ContextMenu",function(){return sn(ta,Vn.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Ie(0,3),shadowBlur:5},new cs("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),nn("ContextMenuButton",function(){var a=sn("Button");a.stretch=cr;var y=a.fb("ButtonBorder");return y instanceof lo&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new Zi(0,0,2,3),y.spot2=new Zi(1,1,-2,-2)),a}),nn("PanelExpanderButton",function(a){var y=Ln(a,"COLLAPSIBLE"),x=sn("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},sn(lo,{name:"ButtonIcon",strokeWidth:2},new cs("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof lo&&(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 ee=b.ih();ee===null&&(ee=b.part),ee!==null&&(b=ee.fb(y),b!==null&&(E.handled=!0,z.Ea("Collapse/Expand Panel"),b.visible=!b.visible,z.eb("Collapse/Expand Panel")))}},x}),nn("CheckBoxButton",function(a){var y=Ln(a);return a=sn("Button",{desiredSize:new Pn(14,14)},sn(lo,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:zn,geometryStretch:qi,visible:!1},y!==""?new cs("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof Vn){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}),nn("CheckBox",function(a){a=Ln(a),a=sn("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new Kr(0,1,0,0)});var y=sn(Vn,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new Kr(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}),Ft.None=Mn=new yn(Ft,"None",0),Ft.Default=$r=new yn(Ft,"Default",0),Ft.Vertical=Br=new yn(Ft,"Vertical",4),Ft.Horizontal=cr=new yn(Ft,"Horizontal",5),Ft.Fill=zn=new yn(Ft,"Fill",3),Ft.Uniform=qi=new yn(Ft,"Uniform",1),Ft.UniformToFill=No=new yn(Ft,"UniformToFill",2),Ft.FlipVertical=co=new yn(Ft,"FlipVertical",1),Ft.FlipHorizontal=zo=new yn(Ft,"FlipHorizontal",2),Ft.FlipBoth=va=new yn(Ft,"FlipBoth",3),Ft.make=sn,Ft.getBuilders=function(){var a=new Gt,y;for(y in Li)if(y!==y.toLowerCase()){var x=Li.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},Ft.defineBuilder=nn,Ft.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=Li.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof Ft))return y&&E.set(y),E;Ke('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},Ft.takeBuilderArgument=Ln;function Or(){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=hr,this.o=Ko,this.hg=$r,this.ob=this.Bi=1,this.Pf=Mn,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Or.prototype.copy=function(){var a=new Or;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 Vr(){this.u=-1/0,this.o=0,this.F=ai,this.rr=wl,this.j=this.V="None"}Vr.prototype.copy=function(){var a=new Vr;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},Vr.className="LinkElementSettings";function ao(){this.yj=this.Xi=ar,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}ao.prototype.copy=function(){var a=new ao;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},ao.className="LinkSettings";function Co(){this.ha=[1,0,0,1,0,0]}Co.prototype.copy=function(){var a=new Co;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},Co.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},Co.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},Co.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,ee=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]=ee,this.translate(-y,-x)}},Co.className="STransform";function Go(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Go.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Go.className="SGradient";function jo(a,y,x){this.ownerDocument=a=y===void 0?wn.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 da(this,x)}jo.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},jo.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),$t(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},jo.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},jo.prototype.focus=function(){this.Oa.focus()},jo.prototype.mx=function(){this.ownerDocument=null},At.Object.defineProperties(jo.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}}}),jo.className="SVGSurface";function da(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 Co,this.j=pu(this),this.Nj=pu(this,"gojs-diagram"),this.Hl=this.ti=null;var x=na++,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 Za(a,y,x,E,b,z,ee){a.Nj===void 0?bu(a,y,x,E,b,z,ee):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+ee+")")}be=da.prototype,be.arc=function(a,y,x,E,b,z,ee,re){var oe=2*Math.PI,ue=oe-1e-6,he=x*Math.cos(E),ge=x*Math.sin(E),xe=a+he,Pe=y+ge,Fe=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(ee-xe)||1e-6<Math.abs(re-Pe))&&this.path.push(["L",xe,+Pe]),0>E&&(E=E%oe+oe),E>ue?(this.path.push(["A",x,x,0,1,Fe,a-he,y-ge]),this.path.push(["A",x,x,0,1,Fe,xe,Pe])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),Fe,a+x*Math.cos(b),y+x*Math.sin(b)])},be.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},be.Se=function(a){this.addPath(this.path,this.rb,a||0)},be.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},be.clearRect=function(){},be.clip=function(){this.Yl.clipPath=!0},be.closePath=function(){this.path.push(["z"])},be.createLinearGradient=function(a,y,x,E){var b=new Go("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},be.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"+na++,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(Pd,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},be.createRadialGradient=function(a,y,x,E,b,z){var ee=new Go("radial");return ee.x1=a,ee.y1=y,ee.r1=x,ee.x2=E,ee.y2=b,ee.r2=z,ee};function ns(a,y,x,E,b,z,ee,re,oe){E=re/E,b=oe/b,z===0&&ee===0||a.rb.translate(z,ee),E===1&&b===1||a.rb.scale(E,b),y===0&&x===0||a.rb.translate(-y,-x)}be.drawImage=function(a,y,x,E,b,z,ee,re,oe){var ue="";a instanceof HTMLCanvasElement&&(ue=a.toDataURL()),a instanceof HTMLImageElement&&(ue=a.getAttribute("src"));var he=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,E===void 0&&(z=y,ee=x,re=E=he,oe=b=a),E=E||0,b=b||0,re=re||0,oe=oe||0,ns(this,y,x,E,b,z||0,ee||0,re,oe),z={x:0,y:0,width:he||E,height:a||b,href:ue},Re.$(E,re)&&Re.$(b,oe)?ue.toLowerCase().indexOf(".svg")===-1&&ue.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||E!==he||b!==a)&&(E+=y,b+=x,z["clip-path"]="path('M "+y+","+x+" L "+E+" "+x+" L "+E+" "+b+" L "+y+" "+b+" z')"),$a(this,Pd,z,this.rb),this.addElement(Pd,z)},be.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),Ys(this,this.Yl)},be.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},be.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},$a(this,"fill",a,this.rb),this.addElement("rect",a)},be.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},$a(this,"fill",a,this.rb),Ys(this,a),this.svg.prepend(this.Ud("rect",a))},be.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},$a(this,"fill",y,this.rb),this.addElement("text",y,a[0])},be.lineTo=function(a,y){this.path.push(["L",a,y])},be.moveTo=function(a,y){this.path.push(["M",a,y])},be.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},be.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"])},be.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},be.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())},be.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||bu(this,a,y,x,E,b,z)};function el(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}be.scale=function(a,y){this.rb.scale(a,y)},be.translate=function(a,y){this.rb.translate(a,y)},be.transform=function(){},be.yc=function(){},be.stroke=function(){Kl(this,this.Yl)},be.jk=function(){this.clipInsteadOfFill||this.stroke()},be.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},be.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 $a(a,y,x,E){y==="fill"?Ys(a,x):y==="stroke"&&Kl(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function Ys(a,y){a.fillStyle instanceof Go?y.fill=fh(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 Nl(a,y,x){x=x?"fill":"stroke",a.fillStyle instanceof Go?y.setAttributeNS(null,"fill",fh(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 Kl(a,y){if(a.strokeStyle instanceof Go)y.stroke=fh(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 fh(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"+na++,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=[],ee=0;ee<y;ee++){var re=b[ee],oe=re.color;re={offset:re.offset,"stop-color":oe},/^rgba\(/.test(oe)&&(oe=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(oe),re["stop-color"]="rgb("+oe[1]+","+oe[2]+","+oe[3]+")",re["stop-opacity"]=oe[4]),z.push(re)}for(z.sort(function(ue,he){return ue.offset>he.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}be.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=Xt(a[b]),ee=[z.shift()];if(ee[0]==="A")ee.push(z.shift()+","+z.shift(),z.shift(),z.shift()+","+z.shift(),z.shift()+","+z.shift());else for(;z.length;)ee.push(z.shift()+","+z.shift());E.push(ee.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,$a(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var re in a)re!=="transform"&&y.setAttributeNS(null,re,a[re]);else{re=y.getElementsByTagName("path");for(var oe in a)oe!=="transform"&&re[x].setAttributeNS(null,oe,a[oe])}else this.addElement("path",a)};function bu(a,y,x,E,b,z,ee){var re=new Co;re.ha=[y,x,E,b,z,ee],y={},$a(a,"g",y,re),re=a.addElement("g",y),a.nh.push(re)}function pu(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}be.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function pl(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function zs(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}be.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},be.fs=function(){this.Ct=!1},be.Vc=function(){},be.Wx=function(){},da.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},da.prototype.getImageData=function(){return null},da.prototype.measureText=function(){return null};function Mh(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()))}da.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},da.className="SVGContext",jt.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new jo(this,wn.document));var y=new jo(this,wn.document,!0);a===void 0&&(a=new er);var x=this;return xd(this,function(E,b){return E=qg(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},jt.prototype.makeSvg=jt.prototype.Cs,jt.prototype.av=function(a){return this.Cs(a)},jt.prototype.makeSVG=jt.prototype.av;function Xs(a,y,x,E){this.ownerDocument=y=y===void 0?wn.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new gh(y,x,E),y.H=a}Xs.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},Xs.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},Xs.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Xs.prototype.focus=function(){this.Oa.focus()},Xs.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},At.Object.defineProperties(Xs.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}}}),Xs.className="CanvasSurface";function gh(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&Ke("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 gt,this.isTemporary=!!x}be=gh.prototype,be.Wx=function(a){this.Z.imageSmoothingEnabled=a},be.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},be.beginPath=function(){this.Z.beginPath()},be.Se=function(){},be.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},be.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},be.clip=function(){this.Z.clip()},be.closePath=function(){this.Z.closePath()},be.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},be.createPattern=function(a,y){return this.Z.createPattern(a,y)},be.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},be.drawImage=function(a,y,x,E,b,z,ee,re,oe){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,ee,re,oe)},be.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},be.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},be.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},be.fillText=function(a,y,x){this.Z.fillText(a,y,x)},be.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},be.lineTo=function(a,y){this.Z.lineTo(a,y)},be.measureText=function(a){return this.Z.measureText(a)},be.moveTo=function(a,y){this.Z.moveTo(a,y)},be.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},be.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},be.restore=function(){this.Z.restore()},be.save=function(){this.yc(),this.Z.save()},gh.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},be=gh.prototype,be.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},be.scale=function(a,y){this.El.scale(a,y)},be.translate=function(a,y){this.El.translate(a,y)},be.stroke=function(){this.Z.stroke()},be.transform=function(a,y,x,E,b,z){if(a!==1||y!==0||x!==0||E!==1||b!==0||z!==0){var ee=this.El,re=ee.m11*a+ee.m21*y;a=ee.m12*a+ee.m22*y,y=ee.m11*x+ee.m21*E,x=ee.m12*x+ee.m22*E,ee.dx=ee.m11*b+ee.m21*z+ee.dx,ee.dy=ee.m12*b+ee.m22*z+ee.dy,ee.m11=re,ee.m12=a,ee.m21=y,ee.m22=x}},be.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},be.ng=function(a,y){if(a instanceof $o&&a.type===Fu){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)},be.jk=function(){this.Hm||this.stroke()},be.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},be.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},be.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(Dc),a.lineDashOffset=0)},be.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},be.Hs=function(){},At.Object.defineProperties(gh.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 Dc=Object.freeze([]);gh.className="CanvasSurfaceContext";function ph(){this.F=this.o=this.u=this.j=0}ph.className="ColorNumbers";function $o(a,y){op||(rp(),op=!0),Ar(this),this._isFrozen=!1,a===void 0?(this.na=Jd,this.xk="black"):typeof a=="string"?(this.na=Jd,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===bd?(this.Qd=Yo,this.Lk=Ut):this.Lk=a===Fu?this.Qd=Hr:this.Qd=Xr,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}$o.prototype.copy=function(){var a=new $o;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},be=$o.prototype,be.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},be.ka=function(){return Object.isFrozen(this)&&Ke("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},be.qb=function(a){a.classType===$o&&(this.type=a)},be.toString=function(){var a="Brush(";if(this.type===Jd)a+=this.color;else if(a=this.type===bd?a+"Linear ":this.type===Fu?a+"Radial ":this.type===ap?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+")"},be.addColorStop=function(a,y){return this._isFrozen&&Lt(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&_n(a,"0 <= loc <= 1",$o,"addColorStop:loc"),this.we===null&&(this.we=new Gt),this.we.add(a,y),this.na===Jd&&(this.type=bd),this.xe=null,this},be.Vz=function(a,y){if(this._isFrozen&&Lt(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?sp:y,this.type===Jd)mu(this.color),this.color=Cd(a,y);else if((this.type===bd||this.type===Fu)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)mu(x.value),this.addColorStop(x.key,Cd(a,y));return this};function Xd(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?sp:x,mu(a),Cd(y,x)}be.Wy=function(a,y){if(this._isFrozen&&Lt(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?sp:y,this.type===Jd)mu(this.color),this.color=Cd(-a,y);else if((this.type===bd||this.type===Fu)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)mu(x.value),this.addColorStop(x.key,Cd(-a,y));return this};function Sg(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?sp:x,mu(a),Cd(-y,x)}function mh(a,y,x){mu(a),a=ba.j;var E=ba.u,b=ba.o,z=ba.F;return mu(y),x===void 0&&(x=.5),"rgba("+Math.round((ba.j-a)*x+a)+", "+Math.round((ba.u-E)*x+E)+", "+Math.round((ba.o-b)*x+b)+", "+Math.round((ba.F-z)*x+z)+")"}be.Gx=function(){if(this.type===Jd)return Uh(this.color);if((this.type===bd||this.type===Fu)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Fu)return Uh(a.first().value);if(a.get(.5)!==null)return Uh(a.get(.5));if(a.count===2)return a=a.Fa(),Uh(mh(a[0].value,a[1].value));for(var y=a.iterator,x=-1,E=-1,b=1,z=1;y.next();){var ee=y.key,re=Math.abs(.5-y.key);b>z&&re<b?(x=ee,b=re):z>=b&&re<z&&(E=ee,z=re)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,Uh(mh(a.get(x),a.get(E),1-z/b))}return!1};function Uh(a){return a?a instanceof $o?a.Gx():(mu(a),128>(299*ba.j+587*ba.u+114*ba.o)/1e3):!1}function Cd(a,y){switch(y){case sp:y=100*Af(ba.j);var x=100*Af(ba.u),E=100*Af(ba.o);return Ws.j=.4124564*y+.3575761*x+.1804375*E,Ws.u=.2126729*y+.7151522*x+.072175*E,Ws.o=.0193339*y+.119192*x+.9503041*E,Ws.F=ba.F,y=Gp(Ws.j/_c[0]),x=Gp(Ws.u/_c[1]),E=Gp(Ws.o/_c[2]),ju.j=116*x-16,ju.u=500*(y-x),ju.o=200*(x-E),ju.F=Ws.F,ju.j=Math.min(100,Math.max(0,ju.j+100*a)),a=(ju.j+16)/116,y=a-ju.o/200,Ws.j=_c[0]*wg(ju.u/500+a),Ws.u=_c[1]*(ju.j>Ic*Pg?Math.pow(a,3):ju.j/Ic),Ws.o=_c[2]*wg(y),Ws.F=ju.F,a=-.969266*Ws.j+1.8760108*Ws.u+.041556*Ws.o,y=.0556434*Ws.j+-.2040259*Ws.u+1.0572252*Ws.o,ba.j=255*ip((3.2404542*Ws.j+-1.5371385*Ws.u+-.4985314*Ws.o)/100),ba.u=255*ip(a/100),ba.o=255*ip(y/100),ba.F=Ws.F,ba.j=Math.round(ba.j),255<ba.j?ba.j=255:0>ba.j&&(ba.j=0),ba.u=Math.round(ba.u),255<ba.u?ba.u=255:0>ba.u&&(ba.u=0),ba.o=Math.round(ba.o),255<ba.o?ba.o=255:0>ba.o&&(ba.o=0),"rgba("+ba.j+", "+ba.u+", "+ba.o+", "+ba.F+")";case i1:return kf(),Ul.o=Math.min(100,Math.max(0,Ul.o+100*a)),"hsla("+Ul.j+", "+Ul.u+"%, "+Ul.o+"%, "+Ul.F+")";default:Ke("Unknown color space: "+y)}}function mu(a){op||(rp(),op=!0);var y=Eg;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,ba.j=a[0],ba.u=a[1],ba.o=a[2],ba.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,ba.j=0,ba.u=0,ba.o=0,ba.F=1)}}function kf(){var a=ba.j/255,y=ba.u/255,x=ba.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 ee=a=0;else{switch(E){case a:ee=(y-x)/z%6;break;case y:ee=(x-a)/z+2;break;case x:ee=(a-y)/z+4}ee*=60,0>ee&&(ee+=360),a=z/(1-Math.abs(2*b-1))}Ul.j=Math.round(ee),Ul.u=Math.round(100*a),Ul.o=Math.round(100*b),Ul.F=ba.F}function Af(a){return a/=255,.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function ip(a){return .0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function Gp(a){return a>Pg?Math.pow(a,1/3):(Ic*a+16)/116}function wg(a){var y=a*a*a;return y>Pg?y:(116*a-16)/Ic}function Tc(a,y){typeof a!="string"&&(a instanceof $o||Ke("Value for "+y+" must be a color string or a Brush, not "+a))}function rp(){Eg=Ja?new Xs(null,void 0,{willReadFrequently:!0}).context:null}At.Object.defineProperties($o.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&Lt(this,a),this.na=a,this.start.Mc()&&(a===bd?this.start=Yo:a===Fu&&(this.start=Hr)),this.end.Mc()&&(a===bd?this.end=Ut:a===Fu&&(this.end=Hr)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&Lt(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&Lt(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&Lt(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&Lt(this,a),0>a&&_n(a,">= zero",$o,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&Lt(this,a),0>a&&_n(a,">= zero",$o,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&Lt(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&Lt(this,a),this.cr=a,this.xe=null}}}),$o.prototype.isDark=$o.prototype.Gx,$o.prototype.darkenBy=$o.prototype.Wy,$o.prototype.lightenBy=$o.prototype.Vz,$o.prototype.addColorStop=$o.prototype.addColorStop;var Pg=216/24389,Ic=24389/27,_c=[95.047,100,108.883],Eg=null,ba=new ph,Ul=new ph,Ws=new ph,ju=new ph,op=!1;$o.className="Brush";var Jd;$o.Solid=Jd=new yn($o,"Solid",0);var bd;$o.Linear=bd=new yn($o,"Linear",1);var Fu;$o.Radial=Fu=new yn($o,"Radial",2);var ap;$o.Pattern=ap=new yn($o,"Pattern",4);var sp;$o.Lab=sp=new yn($o,"Lab",5);var i1;$o.HSL=i1=new yn($o,"HSL",6),$o.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},$o.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;op||(rp(),op=!0);var y=Eg;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)},$o.lighten=function(a){return Xd(a)},$o.lightenBy=Xd,$o.darken=function(a){return Sg(a)},$o.darkenBy=Sg,$o.mix=mh,$o.isDark=Uh;function ws(){this.xa="Base"}ws.prototype.measure=function(){},ws.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},ws.prototype.arrange=function(){},ws.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},ws.prototype.iA=function(a){a.Uj()},ws.prototype.gc=function(){},At.Object.defineProperties(ws.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return Vn}}}),ws.prototype.remeasureObject=ws.prototype.iA,ws.prototype.arrangeElement=ws.prototype.Ly,ws.prototype.measureElement=ws.prototype.Yz,ws.className="PanelLayout";function Rm(){this.xa="Base"}_t(Rm,ws),Rm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length;a=Fd(a);for(var oe=0;oe<re;oe++){var ue=E[oe];if(ue.visible||ue===a){var he=ue.margin,ge=he.right+he.left;he=he.top+he.bottom,ue.measure(y,x,z,ee);var xe=ue.measuredBounds;ge=Math.max(xe.width+ge,0),he=Math.max(xe.height+he,0),xe=ue.position.x;var Pe=ue.position.y;isFinite(xe)||(xe=0),isFinite(Pe)||(Pe=0),ue instanceof lo&&ue.isGeometryPositioned&&(ue=ue.strokeWidth/2,xe-=ue,Pe-=ue),Mo(b,xe,Pe,ge,he)}}},Rm.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],ee=z.measuredBounds,re=z.margin,oe=z.position.x,ue=z.position.y;if(oe=isNaN(oe)?-a:oe-a,ue=isNaN(ue)?-x:ue-x,z instanceof lo&&z.isGeometryPositioned){var he=z.strokeWidth/2;oe-=he,ue-=he}z.visible&&z.arrange(oe+re.left,ue+re.top,ee.width,ee.height)}};function jm(){this.xa="Base"}_t(jm,ws),jm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length;y=gi(),z=Fd(a);for(var oe=0;oe<re;oe++){var ue=E[oe];if(ue.visible||ue===z){var he=gl(ue,!1);if(he!==Mn&&he!==cr)y.push(ue);else{ue.measure(1/0,x,0,ee),he=ue.margin,ue=ue.measuredBounds;var ge=Math.max(ue.height+he.top+he.bottom,0);b.width+=Math.max(ue.width+he.right+he.left,0),b.height=Math.max(b.height,ge)}}}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++)oe=y[a],(oe.visible||oe===z)&&(he=oe.margin,re=he.right+he.left,he=he.top+he.bottom,oe.measure(1/0,x,0,ee),oe=oe.measuredBounds,he=Math.max(oe.height+he,0),b.width+=Math.max(oe.width+re,0),b.height=Math.max(b.height,he));Ii(y)},jm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,ee=a.isOpposite,re=ee?x.width:b.left,oe=0;oe<E;oe++){var ue=z,he=y[oe];if(he.visible){var ge=he.measuredBounds,xe=he.margin,Pe=xe.top+xe.bottom,Fe=z+b.bottom,Ne=ge.height,Je=gl(he,!1);(isNaN(he.desiredSize.height)&&Je===zn||Je===Br)&&(Ne=Math.max(x.height-Pe-Fe,0)),Pe=Ne+Pe+Fe,Fe=he.alignment,Fe.Xb()&&(Fe=a.defaultAlignment),Fe.sb()||(Fe=Hr),ee&&(re-=ge.width+xe.left+xe.right),he.arrange(re+Fe.offsetX+xe.left,ue+Fe.offsetY+xe.top+(x.height*Fe.y-Pe*Fe.y),ge.width,Ne),ee||(re+=ge.width+xe.left+xe.right)}}};function zm(){this.xa="Base"}_t(zm,ws),zm.prototype.measure=function(a,y,x,E,b,z){var ee=E.length;x=gi();for(var re=Fd(a),oe=0;oe<ee;oe++){var ue=E[oe];if(ue.visible||ue===re){var he=gl(ue,!1);if(he!==Mn&&he!==Br)x.push(ue);else{var ge=ue.margin;he=ge.right+ge.left,ge=ge.top+ge.bottom,ue.measure(y,1/0,z,0),ue=ue.measuredBounds,Ho(b,Math.max(b.width,Math.max(ue.width+he,0)),b.height+Math.max(ue.height+ge,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++)oe=x[a],(oe.visible||oe===re)&&(ue=oe.margin,ee=ue.right+ue.left,ue=ue.top+ue.bottom,oe.measure(y,1/0,z,0),oe=oe.measuredBounds,ue=Math.max(oe.height+ue,0),b.width=Math.max(b.width,Math.max(oe.width+ee,0)),b.height+=ue);Ii(x)}},zm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,ee=a.isOpposite,re=ee?x.height:b.top,oe=0;oe<E;oe++){var ue=z,he=y[oe];if(he.visible){var ge=he.measuredBounds,xe=he.margin,Pe=xe.left+xe.right,Fe=z+b.right,Ne=ge.width,Je=gl(he,!1);(isNaN(he.desiredSize.width)&&Je===zn||Je===cr)&&(Ne=Math.max(x.width-Pe-Fe,0)),Pe=Ne+Pe+Fe,Fe=he.alignment,Fe.Xb()&&(Fe=a.defaultAlignment),Fe.sb()||(Fe=Hr),ee&&(re-=ge.height+xe.bottom+xe.top),he.arrange(ue+Fe.offsetX+xe.left+(x.width*Fe.x-Pe*Fe.x),re+Fe.offsetY+xe.top,Ne,ge.height),ee||(re+=ge.height+xe.bottom+xe.top)}}};function Zm(){this.xa="Base"}_t(Zm,ws),Zm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length,oe=a.Pb(),ue=oe.margin,he=ue.right+ue.left,ge=ue.top+ue.bottom;oe.measure(y,x,z,ee);var xe=oe.measuredBounds;z=xe.width,ee=xe.height;var Pe=Math.max(z+he,0),Fe=Math.max(ee+ge,0),Ne=a.isClipping,Je=Wt.allocAt(-ue.left,-ue.top,Pe,Fe),Ve=Wt.allocAt(0,0,z,ee);Ev(oe,Ve,!0),z=Ve.width,ee=Ve.height;for(var ut=!0,ft=Fd(a),vt=0;vt<re;vt++){var bt=E[vt];xe=y;var zt=x;if(bt!==oe&&(bt.visible||bt===ft)){ue=bt.margin;var vi=ue.left,Xi=ue.top;switch(Pe=ue.right+ue.left,Fe=ue.top+ue.bottom,ue=gl(bt,!1),ue){case zn:xe=z,zt=ee,Xi=vi=Fe=Pe=0;break;case cr:xe=z,vi=Pe=0;break;case Br:zt=ee,Xi=Fe=0}bt.measure(xe,zt,0,0),xe=bt.measuredBounds,Pe=Math.max(xe.width+Pe,0),Fe=Math.max(xe.height+Fe,0),ue=bt.alignment,ue.Xb()&&(ue=a.defaultAlignment),ue.sb()||(ue=Hr);var Ri=bt.alignmentFocus;if(Ri.Xb()&&(Ri=Hr),zt=null,bt instanceof Vn&&bt.$e!==""&&(zt=bt.fb(bt.$e),zt===bt&&(zt=null)),vi=Ve.x-vi,Xi=Ve.y-Xi,zt!==null){for(bt.arrange(0,0,xe.width,xe.height),xe=zt.actualBounds,xe=Ie.allocAt(xe.x+(Ri.x*xe.width-Ri.offsetX),xe.y+(Ri.y*xe.height-Ri.offsetY)),zt=zt.panel;zt!==bt;)zt.transform.Ga(xe),zt=zt.panel;vi+=ue.x*z+ue.offsetX-xe.x,Xi+=ue.y*ee+ue.offsetY-xe.y,Ie.free(xe)}else vi+=ue.x*z+ue.offsetX-(Ri.x*xe.width+Ri.offsetX),Xi+=ue.y*ee+ue.offsetY-(Ri.y*xe.height+Ri.offsetY);ut?(ut=!1,b.h(vi,Xi,Pe,Fe)):Mo(b,vi,Xi,Pe,Fe)}}switch(ut?b.assign(Je):Ne?b.Uu(Ve.x,Ve.y,Ve.width,Ve.height):Mo(b,Je.x,Je.y,Je.width,Je.height),Wt.free(Je),Wt.free(Ve),ue=oe.stretch,ue===$r&&(ue=gl(oe,!1)),ue){case Mn:return;case zn:if(!isFinite(y)&&!isFinite(x))return;break;case cr:if(!isFinite(y))return;break;case Br:if(!isFinite(x))return}for(xe=oe.measuredBounds,z=xe.width,ee=xe.height,Pe=Math.max(z+he,0),Fe=Math.max(ee+ge,0),ue=oe.margin,Ve=Wt.allocAt(-ue.left,-ue.top,Pe,Fe),Ev(oe,Ve,!0),z=Ve.width,ee=Ve.height,y=0;y<re;y++)x=E[y],x===oe||!x.visible&&x!==ft||(ue=x.margin,Pe=ue.right+ue.left,Fe=ue.top+ue.bottom,xe=x.measuredBounds,Pe=Math.max(xe.width+Pe,0),Fe=Math.max(xe.height+Fe,0),he=x.alignment,he.Xb()&&(he=a.defaultAlignment),he.sb()||(he=Hr),x=x.alignmentFocus,x.Xb()&&(x=Hr),ut?(ut=!1,b.h(he.x*z+he.offsetX-(x.x*xe.width+x.offsetX)-ue.left,he.y*ee+he.offsetY-(x.y*xe.height+x.offsetY)-ue.top,Pe,Fe)):Mo(b,he.x*z+he.offsetX-(x.x*xe.width+x.offsetX)-ue.left,he.y*ee+he.offsetY-(x.y*xe.height+x.offsetY)-ue.top,Pe,Fe));ut?b.assign(Je):Ne?b.Uu(Ve.x,Ve.y,Ve.width,Ve.height):Mo(b,Je.x,Je.y,Je.width,Je.height),Wt.free(Ve)},Zm.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,ee=z.width,re=z.height,oe=a.padding;z=oe.left,oe=oe.top;var ue=z-x.x,he=oe-x.y;for(b.arrange(ue,he,ee,re),ee=Wt.allocAt(0,0,ee,re),Ev(b,ee,!1),re=0;re<E;re++){var ge=y[re];if(ge!==b){ue=ge.measuredBounds;var xe=ue.width,Pe=ue.height;he=ge.alignment,he.Xb()&&(he=a.defaultAlignment),he.sb()||(he=Hr);var Fe=ge.alignmentFocus;if(Fe.Xb()&&(Fe=Hr),ue=null,ge instanceof Vn&&ge.$e!==""&&(ue=ge.fb(ge.$e),ue===ge&&(ue=null)),ue!==null){var Ne=ue.actualBounds;for(Fe=Ie.allocAt(Ne.x+(Fe.x*Ne.width-Fe.offsetX),Ne.y+(Fe.y*Ne.height-Fe.offsetY)),ue=ue.panel;ue!==ge;)ue.transform.Ga(Fe),ue=ue.panel;ue=he.x*ee.width+he.offsetX-Fe.x,he=he.y*ee.height+he.offsetY-Fe.y,Ie.free(Fe)}else ue=he.x*ee.width+he.offsetX-(Fe.x*xe+Fe.offsetX),he=he.y*ee.height+he.offsetY-(Fe.y*Pe+Fe.offsetY);ue+=ee.x-x.x,he+=ee.y-x.y,ge.visible&&ge.arrange(z+ue,oe+he,xe,Pe)}}Wt.free(ee)};function Ev(a,y,x){var E=null;if(a instanceof Vn&&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 Gm(){this.xa="Base"}_t(Gm,ws),Gm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length,oe=a.Pb(),ue=oe.margin,he=y,ge=x,xe=ue.right+ue.left,Pe=ue.top+ue.bottom;oe.measure(y,x,z,ee),ue=oe.measuredBounds;var Fe=0,Ne=null;oe instanceof lo&&(Ne=oe,Fe=Ne.strokeWidth*Ne.scale);var Je=Math.max(ue.width+xe,0);ue=Math.max(ue.height+Pe,0);var Ve=Lv(oe),ut=Ve.x*Je+Ve.offsetX;Ve=Ve.y*ue+Ve.offsetY;var ft=Bv(oe),vt=ft.x*Je+ft.offsetX;for(ft=ft.y*ue+ft.offsetY,isFinite(y)&&(he=Math.max(Math.abs(ut-vt)-Fe,0)),isFinite(x)&&(ge=Math.max(Math.abs(Ve-ft)-Fe,0)),Fe=Pn.alloc(),Fe.h(0,0),a=Fd(a),ft=0;ft<re;ft++)Ve=E[ft],Ve===oe||!Ve.visible&&Ve!==a||(ue=Ve.margin,Je=ue.right+ue.left,ut=ue.top+ue.bottom,Ve.measure(he,ge,0,0),ue=Ve.measuredBounds,Je=Math.max(ue.width+Je,0),ue=Math.max(ue.height+ut,0),Fe.h(Math.max(Je,Fe.width),Math.max(ue,Fe.height)));if(re===1)b.width=Je,b.height=ue,Pn.free(Fe);else{switch(Ve=Lv(oe),ft=Bv(oe),re=E=0,ft.x!==Ve.x&&ft.y!==Ve.y&&(E=Fe.width/Math.abs(ft.x-Ve.x),re=Fe.height/Math.abs(ft.y-Ve.y)),Pn.free(Fe),Fe=0,Ne!==null&&(Fe=Ne.strokeWidth*Ne.scale,Tv(Ne)===qi&&(E=re=Math.max(E,re))),E+=Math.abs(Ve.offsetX)+Math.abs(ft.offsetX)+Fe,re+=Math.abs(Ve.offsetY)+Math.abs(ft.offsetY)+Fe,Ne=oe.stretch,Ne===$r&&(Ne=gl(oe,!1)),Ne){case Mn:ee=z=0;break;case zn:isFinite(y)&&(E=y),isFinite(x)&&(re=x);break;case cr:isFinite(y)&&(E=y),ee=0;break;case Br:z=0,isFinite(x)&&(re=x)}oe.Uj(),oe.measure(E,re,z,ee),b.width=oe.measuredBounds.width+xe,b.height=oe.measuredBounds.height+Pe}},Gm.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=Wt.alloc();z.h(0,0,1,1);var ee=E.margin,re=ee.left;ee=ee.top;var oe=a.padding,ue=oe.left;oe=oe.top,E.arrange(ue+re,oe+ee,b.width,b.height);var he=Lv(E),ge=Bv(E),xe=he.y*b.height+he.offsetY,Pe=ge.x*b.width+ge.offsetX;for(ge=ge.y*b.height+ge.offsetY,z.x=he.x*b.width+he.offsetX,z.y=xe,Mo(z,Pe,ge,0,0),z.x+=re+ue,z.y+=ee+oe,b=0;b<x;b++)re=y[b],re!==E&&(ue=re.measuredBounds,ee=re.margin,oe=Math.max(ue.width+ee.right+ee.left,0),he=Math.max(ue.height+ee.top+ee.bottom,0),xe=re.alignment,xe.Xb()&&(xe=a.defaultAlignment),xe.sb()||(xe=Hr),oe=z.width*xe.x+xe.offsetX-oe*xe.x+ee.left+z.x,ee=z.height*xe.y+xe.offsetY-he*xe.y+ee.top+z.y,re.visible&&(Fo(z.x,z.y,z.width,z.height,oe,ee,ue.width,ue.height)?re.arrange(oe,ee,ue.width,ue.height):re.arrange(oe,ee,ue.width,ue.height,new Wt(z.x,z.y,z.width,z.height))));Wt.free(z)};function Wm(){this.xa="Base",this.name="Table"}_t(Wm,ws),Wm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,ee=gi(),re=gi(),oe=0;oe<z;oe++){var ue=E[oe],he=ue instanceof Vn?ue:null;if(he!==null&&Qd(he)&&ue.visible){re.push(he);for(var ge=he.O.s,xe=ge.length,Pe=0;Pe<xe;Pe++){var Fe=ge[Pe];he.type===Vn.TableRow?Fe.row=ue.row:he.type===Vn.TableColumn&&(Fe.column=ue.column),ee.push(Fe)}}else ee.push(ue)}z=ee.length,z===0&&(a.Fb(0),a.Eb(0));for(var Ne=[],Je=0;Je<z;Je++){var Ve=ee[Je];Ve.visible&&(qe(Ve,!0),wt(Ve,!0),Ne[Ve.row]||(Ne[Ve.row]=[]),Ne[Ve.row][Ve.column]||(Ne[Ve.row][Ve.column]=[]),Ne[Ve.row][Ve.column].push(Ve))}Ii(ee);var ut=gi(),ft=gi(),vt=gi(),bt={count:0},zt={count:0},vi=y,Xi=x,Ri=a.rowDefs,Qn=a.colDefs,Cn=null;z=Ri.length;for(var qr=0;qr<z;qr++)Cn=Ri[qr],Cn!==void 0&&(Cn.actual=0);z=Qn.length;for(var Rr=0;Rr<z;Rr++)Cn=Qn[Rr],Cn!==void 0&&(Cn.actual=0);for(var aa=Ne.length,Na=0,ks=0;ks<aa;ks++)Ne[ks]&&(Na=Math.max(Na,Ne[ks].length));var _s=Math.min(a.topIndex,aa-1),ml=Math.min(a.leftIndex,Na-1),As=0;aa=Ne.length;for(var sc=Fd(a),fs=0;fs<aa;fs++)if(Ne[fs]){Na=Ne[fs].length;var wh=a.Fb(fs);wh.actual=0;for(var vl=wh.oc=0;vl<Na;vl++)if(Ne[fs][vl]){var lc=a.Eb(vl);ut[vl]===void 0&&(lc.actual=0,lc.oc=0,ut[vl]=!0);for(var xu=Ne[fs][vl],Wu=xu.length,iu=0;iu<Wu;iu++){var Xl=xu[iu];if(Xl.visible||Xl===sc){var Jc=1<Xl.rowSpan||1<Xl.columnSpan;Jc&&(fs<_s||vl<ml||ft.push(Xl));var Ph=Xl.margin,kp=Ph.right+Ph.left,ru=Ph.top+Ph.bottom,yl=Ru(Xl,wh,lc,!1),Mm=Xl.desiredSize,Ig=!isNaN(Mm.height),Nh=!isNaN(Mm.width)&&Ig;if(Jc||yl===Mn||Nh||fs<_s||vl<ml||(bt[vl]!==void 0||yl!==zn&&yl!==cr||(bt[vl]=-1,bt.count++),zt[fs]!==void 0||yl!==zn&&yl!==Br||(zt[fs]=-1,zt.count++),vt.push(Xl)),Xl.measure(1/0,1/0,0,0),!(fs<_s||vl<ml)){var Jl=Xl.measuredBounds,zf=Math.max(Jl.width+kp,0),ou=Math.max(Jl.height+ru,0);if(Xl.rowSpan===1&&(yl===Mn||yl===cr)){Cn=a.Fb(fs);var Qc=Cn.Wc();As=Math.max(ou-Cn.actual,0),As+Qc>Xi&&(As=Math.max(Xi-Qc,0));var cv=Cn.oa===0;Cn.oc=Cn.oc+As,Cn.actual=Cn.oa+As,Xi=Math.max(Xi-(As+(cv?Qc:0)),0)}if(Xl.columnSpan===1&&(yl===Mn||yl===Br)){Cn=a.Eb(vl);var km=Cn.Wc();As=Math.max(zf-Cn.actual,0),As+km>vi&&(As=Math.max(vi-km,0));var Jy=Cn.oa===0;Cn.oc=Cn.oc+As,Cn.actual=Cn.oa+As,vi=Math.max(vi-(As+(Jy?km:0)),0)}Jc&&Xl.Uj()}}}}}Ii(ut);var nd=0,Md=0;z=a.columnCount;for(var _g=0;_g<z;_g++){var $c=Qn[_g];$c!==void 0&&(nd+=isNaN($c.Hc)?$c.oc:$c.Hc,$c.oc!==0&&(nd+=$c.Wc()))}z=a.rowCount;for(var Ap=0;Ap<z;Ap++){var qc=Ri[Ap];qc!==void 0&&(Md+=isNaN(qc.Hc)?qc.oc:qc.Hc,qc.oc!==0&&(Md+=qc.Wc()))}vi=Math.max(y-nd,0);var id=Xi=Math.max(x-Md,0),uc=vi;z=vt.length;for(var Ql=0;Ql<z;Ql++){var Dh=vt[Ql],fv=a.Fb(Dh.row),kd=a.Eb(Dh.column),Np=Dh.measuredBounds,Eh=Dh.margin,Zf=Eh.right+Eh.left,Th=Eh.top+Eh.bottom;bt[Dh.column]=kd.oc===0&&bt[Dh.column]!==void 0?Math.max(Np.width+Zf,bt[Dh.column]):null,zt[Dh.row]=fv.oc===0&&zt[Dh.row]!==void 0?Math.max(Np.height+Th,zt[Dh.row]):null}var Og=0,Dp=0,ih;for(ih in zt)ih!=="count"&&(Og+=zt[ih]);for(ih in bt)ih!=="count"&&(Dp+=bt[ih]);for(var Vs=Pn.alloc(),Am=0;Am<z;Am++){var Fl=vt[Am];if(Fl.visible||Fl===sc){var gs=a.Fb(Fl.row),Ll=a.Eb(Fl.column),Ad=0;isFinite(Ll.width)?Ad=Ll.width:(isFinite(vi)&&bt[Fl.column]!==null?Dp===0?Ad=Ll.actual+vi:Ad=bt[Fl.column]/Dp*uc:bt[Fl.column]!==null?Ad=vi:Ad=Ll.actual||vi,Ad=Math.max(0,Ad-Ll.Wc()));var hc=0;switch(isFinite(gs.height)?hc=gs.height:(isFinite(Xi)&&zt[Fl.row]!==null?Og===0?hc=gs.actual+Xi:hc=zt[Fl.row]/Og*id:zt[Fl.row]!==null?hc=Xi:hc=gs.actual||Xi,hc=Math.max(0,hc-gs.Wc())),Vs.h(Math.max(Ll.minimum,Math.min(Ad,Ll.maximum)),Math.max(gs.minimum,Math.min(hc,gs.maximum))),yl=Ru(Fl,gs,Ll,!1),yl){case cr:Vs.height=Math.max(Vs.height,gs.actual+Xi);break;case Br:Vs.width=Math.max(Vs.width,Ll.actual+vi)}var Gf=Fl.margin,Qy=Gf.right+Gf.left,gv=Gf.top+Gf.bottom;Fl.Uj(),Fl.measure(Vs.width,Vs.height,Ll.minimum,gs.minimum);var Tp=Fl.measuredBounds,Wf=Math.max(Tp.width+Qy,0),Rg=Math.max(Tp.height+gv,0);isFinite(vi)&&(Wf=Math.min(Wf,Vs.width)),isFinite(Xi)&&(Rg=Math.min(Rg,Vs.height));var $l=0;$l=gs.actual,gs.actual=Math.max(gs.actual,Rg),gs.oc=Math.max(gs.oc,Rg),As=gs.actual-$l,Xi=Math.max(Xi-As,0),zt[Fl.row]===null&&(id=Math.max(id-As,0)),$l=Ll.actual,Ll.actual=Math.max(Ll.actual,Wf),Ll.oc=Math.max(Ll.oc,Wf),As=Ll.actual-$l,vi=Math.max(vi-As,0),bt[Fl.column]===null&&(uc=Math.max(uc-As,0))}}Ii(vt);var Nd=Pn.alloc(),Ch=gi(),Au=gi();if(z=ft.length,z!==0){for(var ef=0;ef<aa;ef++)if(Ne[ef]){Na=Ne[ef].length;var Ip=a.Fb(ef);Ch[ef]=Ip.actual;for(var tf=0;tf<Na;tf++)if(Ne[ef][tf]){var pv=a.Eb(tf);Au[tf]=pv.actual}}}for(var _p=0;_p<z;_p++){var as=ft[_p];if(as.visible||as===sc){var rh=a.Fb(as.row),Hu=a.Eb(as.column);switch(Vs.h(Math.max(Hu.minimum,Math.min(y,Hu.maximum)),Math.max(rh.minimum,Math.min(x,rh.maximum))),yl=Ru(as,rh,Hu,!1),yl){case zn:Au[Hu.index]!==0&&(Vs.width=Math.min(Vs.width,Au[Hu.index])),Ch[rh.index]!==0&&(Vs.height=Math.min(Vs.height,Ch[rh.index]));break;case cr:Au[Hu.index]!==0&&(Vs.width=Math.min(Vs.width,Au[Hu.index]));break;case Br:Ch[rh.index]!==0&&(Vs.height=Math.min(Vs.height,Ch[rh.index]))}isFinite(Hu.width)&&(Vs.width=Hu.width),isFinite(rh.height)&&(Vs.height=rh.height),Nd.h(0,0);for(var mv=Hu.minimum,au=rh.minimum,dc=1;dc<as.rowSpan&&!(as.row+dc>=a.rowCount);dc++)Cn=a.Fb(as.row+dc),As=0,As=yl===zn||yl===Br?Math.max(Cn.minimum,Ch[as.row+dc]===0?Cn.maximum:Math.min(Ch[as.row+dc],Cn.maximum)):Math.max(Cn.minimum,isNaN(Cn.Hc)?Cn.maximum:Math.min(Cn.Hc,Cn.maximum)),Nd.height+=As,au+=Cn.minimum;for(var Vu=1;Vu<as.columnSpan&&!(as.column+Vu>=a.columnCount);Vu++)Cn=a.Eb(as.column+Vu),As=0,As=yl===zn||yl===cr?Math.max(Cn.minimum,Au[as.column+Vu]===0?Cn.maximum:Math.min(Au[as.column+Vu],Cn.maximum)):Math.max(Cn.minimum,isNaN(Cn.Hc)?Cn.maximum:Math.min(Cn.Hc,Cn.maximum)),Nd.width+=As,mv+=Cn.minimum;Vs.width+=Nd.width,Vs.height+=Nd.height;var Op=as.margin,nf=Op.right+Op.left,Nm=Op.top+Op.bottom;as.measure(Vs.width,Vs.height,mv,au);for(var Rp=as.measuredBounds,Ih=Math.max(Rp.width+nf,0),Hf=Math.max(Rp.height+Nm,0),rf=0,jp=0;jp<as.rowSpan&&!(as.row+jp>=a.rowCount);jp++)Cn=a.Fb(as.row+jp),rf+=Cn.total||0;if(rf<Hf){var cc=Hf-rf,rd=Hf-rf;if(as.spanAllocation!==null)for(var fc=as.spanAllocation,Dd=0;Dd<as.rowSpan&&!(0>=cc)&&!(as.row+Dd>=a.rowCount);Dd++){Cn=a.Fb(as.row+Dd);var gc=Cn.oa||0,Vf=fc(as,Cn,rd);Cn.actual=Math.min(Cn.maximum,gc+Vf),Cn.oa!==gc&&(cc-=Cn.oa-gc)}for(;0<cc;){var bh=Cn.oa||0;if(isNaN(Cn.height)&&Cn.maximum>bh&&(Cn.actual=Math.min(Cn.maximum,bh+cc),Cn.oa!==bh&&(cc-=Cn.oa-bh)),Cn.index===0)break;Cn=a.Fb(Cn.index-1)}}for(var jg=0,pc=0;pc<as.columnSpan&&!(as.column+pc>=a.columnCount);pc++)Cn=a.Eb(as.column+pc),jg+=Cn.total||0;if(jg<Ih){var zg=Ih-jg,$y=Ih-jg;if(as.spanAllocation!==null)for(var Td=as.spanAllocation,Kf=0;Kf<as.columnSpan&&!(0>=zg)&&!(as.column+Kf>=a.columnCount);Kf++){Cn=a.Eb(as.column+Kf);var Dm=Cn.oa||0,qy=Td(as,Cn,$y);Cn.actual=Math.min(Cn.maximum,Dm+qy),Cn.oa!==Dm&&(zg-=Cn.oa-Dm)}for(;0<zg;){var vv=Cn.oa||0;if(isNaN(Cn.width)&&Cn.maximum>vv&&(Cn.actual=Math.min(Cn.maximum,vv+zg),Cn.oa!==vv&&(zg-=Cn.oa-vv)),Cn.index===0)break;Cn=a.Eb(Cn.index-1)}}}}Ii(ft),Pn.free(Nd),Pn.free(Vs),Ch!==void 0&&Ii(Ch),Au!==void 0&&Ii(Au);var Zg=0,Gg=0,yv=a.desiredSize,pS=a.maxSize;yl=gl(a,!0);var Tm=Md=nd=0,Im=0;z=a.columnCount;for(var xv=0;xv<z;xv++)Qn[xv]!==void 0&&(Cn=a.Eb(xv),isFinite(Cn.width)?(Tm+=Cn.width,Tm+=Cn.Wc()):qm(Cn)===Kp?(Tm+=Cn.oa,Tm+=Cn.Wc()):Cn.oa!==0&&(nd+=Cn.oa,nd+=Cn.Wc()));isFinite(yv.width)?Zg=Math.min(yv.width,pS.width):Zg=yl!==Mn&&isFinite(y)?y:nd,Zg=Math.max(Zg,a.minSize.width),Zg=Math.max(Zg-Tm,0);for(var QS=nd===0?1:Math.max(Zg/nd,1),Sv=0;Sv<z;Sv++)Qn[Sv]!==void 0&&(Cn=a.Eb(Sv),isFinite(Cn.width)||qm(Cn)===Kp||(Cn.actual=Cn.oa*QS),Cn.position=b.width,Cn.oa!==0&&(b.width+=Cn.oa,b.width+=Cn.Wc()));z=a.rowCount;for(var wv=0;wv<z;wv++)Ri[wv]!==void 0&&(Cn=a.Fb(wv),isFinite(Cn.height)?(Im+=Cn.height,Im+=Cn.Wc()):qm(Cn)===Kp?(Im+=Cn.oa,Im+=Cn.Wc()):Cn.oa!==0&&(Md+=Cn.oa,Md+=Cn.Wc()));isFinite(yv.height)?Gg=Math.min(yv.height,pS.height):Gg=yl!==Mn&&isFinite(x)?x:Md,Gg=Math.max(Gg,a.minSize.height),Gg=Math.max(Gg-Im,0);for(var $S=Md===0?1:Math.max(Gg/Md,1),Pv=0;Pv<z;Pv++)Ri[Pv]!==void 0&&(Cn=a.Fb(Pv),isFinite(Cn.height)||qm(Cn)===Kp||(Cn.actual=Cn.oa*$S),Cn.position=b.height,Cn.oa!==0&&(b.height+=Cn.oa,b.height+=Cn.Wc()));z=re.length;for(var e1=0;e1<z;e1++){var _m=re[e1],t1=0,n1=0;_m.type===Vn.TableRow?(t1=b.width,Cn=a.Fb(_m.row),n1=Cn.actual):(Cn=a.Eb(_m.column),t1=Cn.actual,n1=b.height),_m.measuredBounds.h(0,0,t1,n1),qe(_m,!1)}Ii(re),a.inRowsCols=Ne},Wm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding,z=b.left;b=b.top;var ee=a.inRowsCols;if(ee!==null){for(var re,oe,ue=ee.length,he=0,ge=0;ge<ue;ge++)ee[ge]&&(he=Math.max(he,ee[ge].length));oe=a.rowDefs,re=a.colDefs;var xe=ge=0,Pe=Math.min(a.topIndex,ue-1);if(0<oe.length){for(;Pe!==ue&&(oe[Pe]===void 0||oe[Pe].oa===0);)Pe++;Pe=Math.max(Math.min(Pe,ue-1),0),ge=-oe[Pe].position}var Fe=Math.min(a.leftIndex,he-1);if(0<re.length){for(;Fe!==he&&(re[Fe]===void 0||re[Fe].oa===0);)Fe++;Fe=Math.max(Math.min(Fe,he-1),0),xe=-re[Fe].position}for(var Ne=0,Je=0;Ne!==ue&&oe[Ne]===void 0;)Ne++;for(;Je!==ue&&re[Je]===void 0;)Je++;he=a.part,a.Fb(Ne),a.Eb(Je);for(var Ve=0;Ve<y.length;Ve++){var ut=y[Ve];if(ut instanceof Vn&&ut.visible&&Qd(ut)){if(ut.type===Vn.TableRow){re=a.Fb(ut.row);var ft=a.Eb(Je)}else re=a.Fb(Ne),ft=a.Eb(ut.column);oe=re.position+ge+b,re.oa!==0&&(oe+=re.Io(Math.max(Ne,Pe))),re=ft.position+xe+z,ft.oa!==0&&(re+=ft.Io(Math.max(Je,Fe))),ft=ut.measuredBounds,ut.Uk(),ut.actualBounds.ka();var vt=ut.actualBounds,bt=Wt.allocAt(vt.x,vt.y,vt.width,vt.height);vt.x=ut.type===Vn.TableRow?z:re,vt.y=ut.type===Vn.TableColumn?b:oe,vt.width=ft.width,vt.height=ft.height,ut.actualBounds.freeze(),wt(ut,!1),bo(bt,vt)||he===null||(he.oh(),ut.Pn(he)),Wt.free(bt)}}for(Ve=Pn.alloc(),ut=0;ut<ue;ut++)if(ee[ut]){for(he=ee[ut].length,ft=a.Fb(ut),oe=ft.position+ge+b,ft.oa!==0&&(oe+=ft.Io(Math.max(Ne,Pe))),vt=0;vt<he;vt++)if(ee[ut][vt]){bt=a.Eb(vt),re=bt.position+xe+z,bt.oa!==0&&(re+=bt.Io(Math.max(Je,Fe)));for(var zt=ee[ut][vt],vi=zt.length,Xi=0;Xi<vi;Xi++){var Ri=zt[Xi],Qn=Ri.measuredBounds;Ve.h(0,0);for(var Cn=1;Cn<Ri.rowSpan&&!(ut+Cn>=a.rowCount);Cn++){var qr=a.Fb(ut+Cn);qr.oa!==0&&(Ve.height+=qr.total)}for(Cn=1;Cn<Ri.columnSpan&&!(vt+Cn>=a.columnCount);Cn++)qr=a.Eb(vt+Cn),qr.oa!==0&&(Ve.width+=qr.total);var Rr=bt.oa+Ve.width,aa=ft.oa+Ve.height;Cn=re,qr=oe;var Na=Rr,ks=aa,_s=re,ml=oe,As=Rr,sc=aa;re+Rr>x.width&&(As=Math.max(x.width-re,0)),oe+aa>x.height&&(sc=Math.max(x.height-oe,0));var fs=Ri.alignment;if(fs.Xb()){fs=a.defaultAlignment,fs.sb()||(fs=Hr);var wh=fs.x,vl=fs.y,lc=fs.offsetX;fs=fs.offsetY;var xu=bt.alignment,Wu=ft.alignment;xu.sb()&&(wh=xu.x,lc=xu.offsetX),Wu.sb()&&(vl=Wu.y,fs=Wu.offsetY)}else wh=fs.x,vl=fs.y,lc=fs.offsetX,fs=fs.offsetY;(isNaN(wh)||isNaN(vl))&&(vl=wh=.5,fs=lc=0),xu=Qn.width,Wu=Qn.height;var iu=Ri.margin,Xl=iu.left+iu.right,Jc=iu.top+iu.bottom,Ph=Ru(Ri,ft,bt,!1);!isNaN(Ri.desiredSize.width)||Ph!==zn&&Ph!==cr||(xu=Math.max(Rr-Xl,0)),!isNaN(Ri.desiredSize.height)||Ph!==zn&&Ph!==Br||(Wu=Math.max(aa-Jc,0)),Rr=Ri.maxSize,aa=Ri.minSize,xu=Math.min(Rr.width,xu),Wu=Math.min(Rr.height,Wu),xu=Math.max(aa.width,xu),Wu=Math.max(aa.height,Wu),Rr=Wu+Jc,Cn+=Na*wh-(xu+Xl)*wh+lc+iu.left,qr+=ks*vl-Rr*vl+fs+iu.top,Ri.visible&&(Fo(_s,ml,As,sc,Cn,qr,Qn.width,Qn.height)?Ri.arrange(Cn,qr,xu,Wu):Ri.arrange(Cn,qr,xu,Wu,new Wt(_s,ml,As,sc)))}}}for(Pn.free(Ve),a=0;a<E;a++)x=y[a],z=x instanceof Vn?x:null,z!==null&&Qd(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function Hm(){this.xa="Base"}_t(Hm,ws),Hm.prototype.measure=function(){},Hm.prototype.arrange=function(){};function Vm(){this.xa="Base"}_t(Vm,ws),Vm.prototype.measure=function(){},Vm.prototype.arrange=function(){};function Km(){this.xa="Base"}_t(Km,ws),Km.prototype.measure=function(a,y,x,E,b,z,ee){1<E.length&&Ke("Viewbox Panel cannot contain more than one GraphObject."),E=E[0],E.Ca=1,E.Uj(),E.measure(1/0,1/0,z,ee);var re=E.measuredBounds,oe=E.margin,ue=oe.right+oe.left;if(oe=oe.top+oe.bottom,isFinite(y)||isFinite(x)){var he=E.scale,ge=re.width;re=re.height;var xe=Math.max(y-ue,0),Pe=Math.max(x-oe,0),Fe=1;a.viewboxStretch===qi?ge!==0&&re!==0&&(Fe=Math.min(xe/ge,Pe/re)):ge!==0&&re!==0&&(Fe=Math.max(xe/ge,Pe/re)),Fe===0&&(Fe=1e-4),E.Ca*=Fe,he!==E.scale&&(qe(E,!0),E.measure(1/0,1/0,z,ee))}re=E.measuredBounds,b.width=isFinite(y)?y:Math.max(re.width+ue,0),b.height=isFinite(x)?x:Math.max(re.height+oe,0)},Km.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 ee=y.alignment;ee.Xb()&&(ee=a.defaultAlignment),ee.sb()||(ee=Hr),y.arrange(x.width*ee.x-z*ee.x+ee.offsetX,x.height*ee.y-b*ee.y+ee.offsetY,E.width,E.height)};function Wp(){this.xa="Base"}_t(Wp,ws),Wp.prototype.measure=function(){},Wp.prototype.arrange=function(){},Wp.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,ee=a.actualBounds,re=z.width,oe=z.height,ue=Math.ceil(re/b),he=Math.ceil(oe/E),ge=a.gridOrigin,xe=ge.x;ge=ge.y,y.save(),y.beginPath(),y.rect(0,0,re,oe),y.clip(),y.Se();for(var Pe=[],Fe=a.O.s,Ne=Fe.length,Je=0;Je<Ne;Je++){var Ve=Fe[Je],ut=[];if(Pe.push(ut),Ve.visible){var ft=Ve.interval;if(!(0>ft)){Ve=bv(Ve.figure);for(var vt=0;vt<Ne;vt++)if(vt!==Je){var bt=Fe[vt];bt.visible&&bv(bt.figure)===Ve&&(bt=bt.interval,bt>ft&&ut.push(bt))}}}}for(Fe=a.O.s,Ne=Fe.length,Je=0;Je<Ne;Je++){var zt=Fe[Je];if(zt.visible&&(ut=zt.interval||1,Ve=Math.abs(ut),!(2>b*Ve*x))){if(ft=zt.segmentIndex,(!isFinite(ft)||isNaN(ft))&&(ft=0),0>ft&&(ft=Ve-Math.min(-ft,Ve)),ft=Math.round(ft%Ve),Ve=zt.opacity,vt=1,Ve!==1){if(Ve===0)continue;vt=y.globalAlpha,y.globalAlpha=vt*Ve}bt=Pe[Je];var vi=!1,Xi=zt.strokeDashArray;if(Xi!==null&&(vi=!0,y.js(Xi,zt.strokeDashOffset)),zt.figure==="LineV"&&zt.stroke!==null&&0<zt.strokeWidth){for(y.lineWidth=zt.strokeWidth,Qa(a,y,zt.stroke,!1,!1,z,ee),y.beginPath(),Xi=zt=Math.floor((xe-b)/b);Xi<=zt+ue;Xi++){var Ri=Xi*b+xe;0<=Ri&&Ri<=re&&Um(Xi,ut,ft,bt)&&(y.moveTo(Ri,0),y.lineTo(Ri,oe))}y.stroke(),y.Se()}else if(zt.figure==="LineH"&&zt.stroke!==null&&0<zt.strokeWidth){for(y.lineWidth=zt.strokeWidth,Qa(a,y,zt.stroke,!1,!1,z,ee),y.beginPath(),Xi=zt=Math.floor((ge-E)/E);Xi<=zt+he;Xi++)Ri=Xi*E+ge,0<=Ri&&Ri<=oe&&Um(Xi,ut,ft,bt)&&(y.moveTo(0,Ri),y.lineTo(re,Ri));y.stroke(),y.Se()}else if(zt.figure==="BarV"&&zt.fill!==null)for(Qa(a,y,zt.fill,!0,!1,z,ee),zt=zt.width,isNaN(zt)&&(zt=b),Ri=Xi=Math.floor((xe-b)/b);Ri<=Xi+ue;Ri++){var Qn=Ri*b+xe;0<=Qn+zt&&Qn<=re&&Um(Ri,ut,ft,bt)&&y.fillRect(Qn,0,zt,oe)}else if(zt.figure==="BarH"&&zt.fill!==null)for(Qa(a,y,zt.fill,!0,!1,z,ee),zt=zt.height,isNaN(zt)&&(zt=E),Ri=Xi=Math.floor((ge-E)/E);Ri<=Xi+he;Ri++)Qn=Ri*E+ge,0<=Qn+zt&&Qn<=oe&&Um(Ri,ut,ft,bt)&&y.fillRect(0,Qn,re,zt);vi&&y.fs(),Ve!==1&&(y.globalAlpha=vt)}}y.restore(),y.Vc(!1)};function Um(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 Ym(){this.xa="Base"}_t(Ym,ws),Ym.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof ta||a instanceof qn){var ee=null,re=null;if(a instanceof qn&&(ee=a),a instanceof ta&&(re=a,ee=re.adornedPart,a.j===null&&(a.j=[])),ee instanceof qn){var oe=ee;if(z===0)Ho(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var ue=a instanceof ta?null:ee.path;y=ee.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var he=oe.points,ge=ee.pointsCount;re!==null?re.Ul(!1):ee!==null&&ee.Ul(!1),re=y.width;var xe=y.height,Pe=a.j;if(Pe.length=0,ue!==null){r1(a,re,xe,ue);var Fe=ue.measuredBounds;x.ed(Fe),Pe.push(Fe)}Fe=gt.alloc();for(var Ne=Ie.alloc(),Je=Ie.alloc(),Ve=0;Ve<z;Ve++){var ut=E[Ve];if(ut!==ue)if(ut.isPanelMain&&ut instanceof lo){r1(a,re,xe,ut);var ft=ut.measuredBounds;x.ed(ft),Pe.push(ft)}else if(2>ge)ut.measure(1/0,1/0,0,0),ft=ut.measuredBounds,x.ed(ft),Pe.push(ft);else{var vt=ut.segmentIndex,bt=ut.segmentFraction,zt=ut.alignmentFocus;zt.Mc()&&(zt=Hr);var vi=ut.segmentOrientation,Xi=ut.segmentOffset;if(isNaN(vt)){var Ri=oe.ua;ft=gi(),Ri.Qu(bt,ft);var Qn=Ie.allocAt(ft[0],ft[1]);if(Qn.add(oe.i(0)),Ri.type===lt.j?Qn.offset(-Ri.startX,-Ri.startY):(Ri=Ri.figures.first(),Ri!==null&&Qn.offset(-Ri.startX,-Ri.startY)),Ri=ft[2],vi!==wl){var Cn=oe.computeAngle(ut,vi,Ri);ut.Kb=Cn}Cn=Qn.x-y.x;var qr=Qn.y-y.y;Ie.free(Qn),Ii(ft)}else if(vt<-ge||vt>=ge)ft=Ie.alloc(),oe.vg(),oe.computeMidPoint(ft),Ri=oe.midAngle,vi!==wl&&(Cn=oe.computeAngle(ut,vi,Ri),ut.Kb=Cn),Cn=ft.x-y.x,qr=ft.y-y.y,Ie.free(ft);else{if(Cn=0,0<=vt?(qr=he.M(vt),ft=vt<ge-1?he.M(vt+1):qr):(Cn=ge+vt,qr=he.M(Cn),ft=0<Cn?he.M(Cn-1):qr),qr.Xa(ft)){0<=vt?(Ri=0<vt?he.M(vt-1):qr,Cn=vt<ge-2?he.M(vt+2):ft):(Ri=Cn<ge-1?he.M(Cn+1):qr,Cn=1<Cn?he.M(Cn-2):ft),Qn=Ri.Bf(qr);var Rr=ft.Bf(Cn);Ri=Qn>Rr+10?0<=vt?Ri.ab(qr):qr.ab(Ri):Rr>Qn+10?0<=vt?ft.ab(Cn):Cn.ab(ft):0<=vt?Ri.ab(Cn):Cn.ab(Ri)}else Ri=0<=vt?qr.ab(ft):ft.ab(qr);vi!==wl&&(Cn=oe.computeAngle(ut,vi,Ri),ut.Kb=Cn),Cn=qr.x+(ft.x-qr.x)*bt-y.x,qr=qr.y+(ft.y-qr.y)*bt-y.y}ut.measure(1/0,1/0,0,0),ft=ut.measuredBounds,Qn=ut.naturalBounds;var aa=0;ut instanceof lo&&(aa=ut.strokeWidth),Rr=Qn.width+aa;var Na=Qn.height+aa;Fe.reset(),Fe.translate(-ft.x,-ft.y),Fe.scale(ut.scale,ut.scale),Fe.rotate(vi===wl?ut.angle:Ri,Rr/2,Na/2),vi!==nm&&vi!==rm||Fe.rotate(90,Rr/2,Na/2),vi!==im&&vi!==om||Fe.rotate(-90,Rr/2,Na/2),vi===C0&&(45<Ri&&135>Ri||225<Ri&&315>Ri)&&Fe.rotate(-Ri,Rr/2,Na/2),Qn=new Wt(0,0,Rr,Na),Ne.xi(Qn,zt),Fe.Ga(Ne),zt=-Ne.x+aa/2*ut.scale,ut=-Ne.y+aa/2*ut.scale,Je.assign(Xi),aa=isNaN(Xi.x);var ks=isNaN(Xi.y);if(aa||ks){Rr=Rr/2+3,Na=Na/2+3;var _s=45<=Ri&&135>=Ri,ml=225<=Ri&&315>=Ri;vi===wl&&(_s||ml)?(Je.x=ks?Rr:Xi.y,Je.y=aa?Na:Xi.x,_s?0<=vt||isNaN(vt)&&.5>bt||!aa||(Je.y=-Na):ml&&((0<=vt||isNaN(vt)&&.5>bt)&&aa&&(Je.y=-Na),ks&&(Je.x=-Rr))):(aa&&(Je.x=0<=vt||isNaN(vt)&&.5>bt?Rr:-Rr),ks&&(Je.y=-Na),Je.rotate(Ri))}else Je.rotate(Ri);Cn+=Je.x,qr+=Je.y,Qn.set(ft),Qn.h(Cn+zt,qr+ut,ft.width,ft.height),Pe.push(Qn),x.ed(Qn)}}if(ee!==null)for(E=ee.labelNodes;E.next();)E.value.measure(1/0,1/0);a.jg=x,a.position.h(y.x+x.x,y.y+x.y),Ho(b,x.width||0,x.height||0),gt.free(Fe),Ie.free(Ne),Ie.free(Je)}}}},Ym.prototype.arrange=function(a,y){var x=y.length;if(a instanceof ta||a instanceof qn){var E=a,b=null;a instanceof ta&&(b=a,E=b.adornedPart);var z=a instanceof ta?null:E.path,ee=a.j;if(ee.length!==0){var re=0;if(z!==null&&re<ee.length){var oe=ee[re];re++,z.arrange(oe.x-a.jg.x,oe.y-a.jg.y,oe.width,oe.height)}for(oe=0;oe<x;oe++){var ue=y[oe];if(ue!==z&&re<ee.length){var he=ee[re];re++,ue.arrange(he.x-a.jg.x,he.y-a.jg.y,he.width,he.height)}}}if(y=E.points,x=y.count,2<=x&&a instanceof qn)for(z=a.labelNodes;z.next();){var ge=a;ee=z.value,re=ee.segmentIndex,oe=ee.segmentFraction;var xe=ee.alignmentFocus;if(ue=ee.segmentOrientation,he=ee.segmentOffset,isNaN(re)){var Pe=ge.ua,Fe=gi();Pe.Qu(oe,Fe);var Ne=Ie.allocAt(Fe[0],Fe[1]);Ne.add(ge.i(0)),Pe.type===lt.j||(Pe=Pe.figures.first()),Ne.offset(-Pe.startX,-Pe.startY),Pe=Fe[2],ue!==wl&&(ge=ge.computeAngle(ee,ue,Pe),ee.angle=ge),ge=Ne.x;var Je=Ne.y;Ie.free(Ne),Ii(Fe)}else if(re<-x||re>=x)Fe=Ie.alloc(),Pe=ge,Je=Fe,Pe.vg(),Pe.computeMidPoint(Je),Pe=ge.midAngle,ue!==wl&&(ge=ge.computeAngle(ee,ue,Pe),ee.angle=ge),ge=Fe.x,Je=Fe.y,Ie.free(Fe);else{if(Ne=0,0<=re?(Fe=y.s[re],Je=re<x-1?y.s[re+1]:Fe):(Ne=x+re,Fe=y.s[Ne],Je=0<Ne?y.s[Ne-1]:Fe),Fe.Xa(Je)){0<=re?(Pe=0<re?y.s[re-1]:Fe,Ne=re<x-2?y.s[re+2]:Je):(Pe=Ne<x-1?y.s[Ne+1]:Fe,Ne=1<Ne?y.s[Ne-2]:Je);var Ve=Pe.Bf(Fe),ut=Je.Bf(Ne);Pe=Ve>ut+10?0<=re?Pe.ab(Fe):Fe.ab(Pe):ut>Ve+10?0<=re?Je.ab(Ne):Ne.ab(Je):0<=re?Pe.ab(Ne):Ne.ab(Pe)}else Pe=0<=re?Fe.ab(Je):Je.ab(Fe);ue!==wl&&(ge=ge.computeAngle(ee,ue,Pe),ee.angle=ge),ge=Fe.x+(Je.x-Fe.x)*oe,Je=Fe.y+(Je.y-Fe.y)*oe}if(xe.ys())ee.location=new Ie(ge,Je);else{xe.Mc()&&(xe=Hr),Fe=gt.alloc(),Fe.reset(),Fe.scale(ee.scale,ee.scale),Fe.rotate(ee.angle,0,0);var ft=ee.naturalBounds;Ne=Wt.allocAt(0,0,ft.width,ft.height),Ve=Ie.alloc(),Ve.xi(Ne,xe),Fe.Ga(Ve),xe=-Ve.x,ut=-Ve.y;var vt=ft.width,bt=ft.height;ft=Ie.alloc(),ft.assign(he);var zt=isNaN(he.x),vi=isNaN(he.y);if(zt||vi){vt=vt/2+3,bt=bt/2+3;var Xi=45<=Pe&&135>=Pe,Ri=225<=Pe&&315>=Pe;ue===wl&&(Xi||Ri)?(ft.x=vi?vt:he.y,ft.y=zt?bt:he.x,Xi?0<=re||isNaN(re)&&.5>oe||!zt||(ft.y=-bt):Ri&&((0<=re||isNaN(re)&&.5>oe)&&zt&&(ft.y=-bt),vi&&(ft.x=-vt))):(zt&&(ft.x=0<=re||isNaN(re)&&.5>oe?vt:-vt),vi&&(ft.y=-bt),ft.rotate(Pe))}else ft.rotate(Pe);ge+=ft.x,Je+=ft.y,Fe.pp(Ne),xe+=Ne.x,ut+=Ne.y,re=Ie.allocAt(ge+xe,Je+ut),ee.move(re),Ie.free(re),Ie.free(ft),Ie.free(Ve),Wt.free(Ne),gt.free(Fe)}}b!==null?b.Ul(!1):E.Ul(!1),E=D1(a),a.location.h(a.position.x+E.x,a.position.y+E.y),Ie.free(E)}};function r1(a,y,x,E){if(tt(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof ta&&a.type===Vn.Link&&a.adornedObject instanceof lo&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof qn&&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 ta&&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),qe(E,!1)}}function Hp(){this.xa="Base"}_t(Hp,ws),Hp.prototype.measure=function(a,y,x,E,b,z,ee){var re=a.Pb();a.graduatedBounds=[];var oe=re.margin,ue=oe.right+oe.left,he=oe.top+oe.bottom;re.measure(y,x,z,ee);var ge=re.measuredBounds,xe=new Wt(-oe.left,-oe.top,Math.max(ge.width+ue,0),Math.max(ge.height+he,0));a.graduatedBounds.push(xe),b.assign(xe);for(var Pe=re.geometry,Fe=re.strokeWidth,Ne=Pe.flattenedSegments,Je=Pe.flattenedLengths,Ve=Pe.flattenedTotalLength,ut=Ne.length,ft=0,vt=0,bt=gi(),zt=0;zt<ut;zt++){var vi=Ne[zt],Xi=[];vt=ft=0;for(var Ri=vi.length,Qn=0;Qn<Ri;Qn+=2){var Cn=vi[Qn],qr=vi[Qn+1];if(Qn!==0){var Rr=180*Math.atan2(qr-vt,Cn-ft)/Math.PI;0>Rr&&(Rr+=360),Xi.push(Rr)}ft=Cn,vt=qr}bt.push(Xi)}if(a.graduatedIntervals===null){for(var aa=[],Na=a.O.s,ks=Na.length,_s=0;_s<ks;_s++){var ml=Na[_s],As=[];if(aa.push(As),ml.visible){var sc=ml.interval;if(!(0>sc)){for(var fs=0;fs<ks;fs++)if(fs!==_s){var wh=Na[fs];if(wh.visible&&ml.constructor===wh.constructor){var vl=wh.interval;vl>sc&&As.push(vl)}}}}}a.graduatedIntervals=aa}var lc=a.graduatedIntervals,xu=a.O.s,Wu=xu.length,iu=0,Xl=0,Jc=Ve;a.graduatedMarks=[];for(var Ph,kp=0;kp<Wu;kp++){var ru=xu[kp];if(Ph=[],ru.visible&&ru!==re){var yl=Math.abs(ru.interval),Mm=a.graduatedTickUnit;if(!(2>Mm*yl*Ve/a.graduatedRange&&ru.graduatedSkip===null)){var Ig=Je[0][0],Nh=0,Jl=0;Xl=Ve*ru.graduatedStart-1e-4,Jc=Ve*ru.graduatedEnd+1e-4;var zf=Mm*yl,ou=a.graduatedTickBase;if(ou<a.graduatedMin){var Qc=(a.graduatedMin-ou)/zf;Qc=Qc%1===0?Qc:Math.floor(Qc+1),ou+=Qc*zf}else ou>a.graduatedMin+zf&&(ou-=Math.floor((ou-a.graduatedMin)/zf)*zf);for(var cv=lc[kp],km=ou,Jy=1e-6*a.graduatedMax,nd=1;ou<=a.graduatedMax+Jy;nd++){e:{for(var Md=cv.length,_g=0;_g<Md;_g++){var $c=(ou-a.graduatedTickBase)%(cv[_g]*a.graduatedTickUnit),Ap=1e-6*a.graduatedTickUnit;if($c<Ap&&$c>-Ap){var qc=!1;break e}}qc=!0}if(qc&&(ou>a.graduatedMax&&(ou=a.graduatedMax),ru.graduatedSkip===null||ru instanceof Ia&&!ru.graduatedSkip(ou,ru)||ru instanceof lo&&!ru.graduatedSkip(ou,ru))&&(iu=(ou-a.graduatedMin)*Ve/a.graduatedRange,iu>Ve&&(iu=Ve),Xl<=iu&&iu<=Jc)){for(var id=bt[Nh][Jl],uc=Je[Nh][Jl];Nh<Je.length;){for(;iu>Ig&&Jl<Je[Nh].length-1;)Jl++,id=bt[Nh][Jl],uc=Je[Nh][Jl],Ig+=uc;if(iu<=Ig)break;Nh++,Jl=0,id=bt[Nh][Jl],uc=Je[Nh][Jl],Ig+=uc}var Ql=Ne[Nh],Dh=Ql[2*Jl],fv=Ql[2*Jl+1],kd=(iu-(Ig-uc))/uc,Np=new Ie(Dh+(Ql[2*Jl+2]-Dh)*kd+Fe/2-Pe.bounds.x,fv+(Ql[2*Jl+3]-fv)*kd+Fe/2-Pe.bounds.y);Np.scale(re.scale,re.scale);e:{var Eh=id,Zf=bt[Nh];if(!(.5005>kd&&.4995<kd)){var Th=Eh;if(.5>kd?0<Jl?Th=Zf[Jl-1]:Re.$(Ql[0],Ql[Ql.length-2])&&Re.$(Ql[1],Ql[Ql.length-1])&&(Th=Zf[Zf.length-1]):.5<kd&&(Jl+1<Zf.length?Th=Zf[Jl+1]:Re.$(Ql[0],Ql[Ql.length-2])&&Re.$(Ql[1],Ql[Ql.length-1])&&(Th=Zf[0])),Eh!==Th){var Og=Math.abs(Eh-Th);if(180<Og&&(Eh<Th?Eh+=360:Th+=360,Og=Math.abs(Eh-Th)),5e-4>kd||.9995<kd){id=(Eh+Th)/2%360;break e}if(10>Og){var Dp=1-Math.abs(.5-kd);id=(Eh*Dp+Th*(1-Dp))%360;break e}}}id=Eh}if(ru instanceof Ia){var ih="";ru.graduatedFunction!==null?(ih=ru.graduatedFunction(ou,ru),ih=ih!=null?ih.toString():""):ih=(+ou.toFixed(2)).toString(),ih!==""&&Ph.push({$l:Np,angle:id,text:ih})}else Ph.push({$l:Np,angle:id})}ou=km+nd*zf}}}a.graduatedMarks.push(Ph)}Ii(bt);var Vs=a.graduatedMarks;if(Vs!==null)for(var Am=E.length,Fl=0;Fl<Am;Fl++){var gs=E[Fl],Ll=Vs[Fl];if(gs.visible&&gs!==re&&Ll.length!==0){if(gs instanceof lo){var Ad=a,hc=b,Gf=gs.alignmentFocus;Gf.Mc()&&(Gf=Yo);var Qy=gs.angle;gs.Kb=0,gs.measure(1/0,1/0,0,0),gs.Kb=Qy;var gv=gs.measuredBounds,Tp=gv.width,Wf=gv.height,Rg=Wt.allocAt(0,0,Tp,Wf),$l=Ie.alloc();$l.xi(Rg,Gf),Wt.free(Rg);for(var Nd=-$l.x,Ch=-$l.y,Au=new Wt,ef=Ll.length,Ip=0;Ip<ef;Ip++)for(var tf=Ll[Ip],pv=tf.$l.x,_p=tf.$l.y,as=tf.angle,rh=0;4>rh;rh++){switch(rh){case 0:$l.h(Nd,Ch);break;case 1:$l.h(Nd+Tp,Ch);break;case 2:$l.h(Nd,Ch+Wf);break;case 3:$l.h(Nd+Tp,Ch+Wf)}$l.rotate(as+gs.angle),$l.offset(pv,_p),Ip===0&&rh===0?Au.h($l.x,$l.y,0,0):Au.Ye($l),$l.offset(-pv,-_p),$l.rotate(-as-gs.angle)}Ie.free($l),Ad.graduatedBounds!==null&&Ad.graduatedBounds.push(Au),Mo(hc,Au.x,Au.y,Au.width,Au.height)}else if(gs instanceof Ia){var Hu=a,mv=b;Hu.temporaryTextBlock===null&&(Hu.temporaryTextBlock=new Ia);var au=Hu.temporaryTextBlock;x1(au,gs);var dc=gs.alignmentFocus;dc.Mc()&&(dc=Yo);for(var Vu=gs.segmentOrientation,Op=gs.segmentOffset,nf=new Wt,Nm=0,Rp=0,Ih=0,Hf=0,rf=0,jp=Ll.length,cc=0;cc<jp;cc++){var rd=Ll[cc];Nm=rd.$l.x,Rp=rd.$l.y,Ih=rd.angle,rf=Hf=gs.angle,Vu!==wl&&(rf=Vu===tm||Vu===E0?Ih+gs.angle:Ih,Hf=qn.computeAngle(Vu,rf)),au.Kb=Hf,au.text=rd.text||"",au.measure(1/0,1/0,0,0);var fc=au.measuredBounds,Dd=au.naturalBounds,gc=Dd.width,Vf=Dd.height,bh=gt.alloc();bh.reset(),bh.translate(-fc.x,-fc.y),bh.scale(au.scale,au.scale),bh.rotate(rf,gc/2,Vf/2),Vu!==nm&&Vu!==rm||bh.rotate(90,gc/2,Vf/2),Vu!==im&&Vu!==om||bh.rotate(-90,gc/2,Vf/2),Vu===C0&&(45<Ih&&135>Ih||225<Ih&&315>Ih)&&bh.rotate(-Ih,gc/2,Vf/2);var jg=Wt.allocAt(0,0,gc,Vf),pc=Ie.alloc();pc.xi(jg,dc),bh.Ga(pc);var zg=-pc.x,$y=-pc.y,Td=Ie.alloc();Td.assign(Op),isNaN(Td.x)&&(Td.x=gc/2+3),isNaN(Td.y)&&(Td.y=-(Vf/2+3)),Td.rotate(Ih),Nm+=Td.x+zg,Rp+=Td.y+$y;var Kf=new Wt(Nm,Rp,fc.width,fc.height),Dm=new Wt(fc.x,fc.y,fc.width,fc.height),qy=new Wt(Dd.x,Dd.y,Dd.width,Dd.height);rd.Sz=Hf,rd.lineCount=au.lineCount,rd.lines=[au.Cb,au.Ih,au.df,au.Le,au.Qc,au.Qb,au.ze],rd.actualBounds=Kf,rd.measuredBounds=Dm,rd.naturalBounds=qy,cc===0?nf.assign(Kf):nf.ed(Kf),Ie.free(Td),Ie.free(pc),Wt.free(jg),gt.free(bh)}Hu.graduatedBounds!==null&&Hu.graduatedBounds.push(nf),Mo(mv,nf.x,nf.y,nf.width,nf.height)}qe(gs,!1)}}},Hp.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var E=a.Pb(),b=a.graduatedMarks;if(b!==null){var z=a.graduatedBounds,ee=0,re=z[ee];ee++,E!==null&&E.arrange(re.x-x.x,re.y-x.y,re.width,re.height);for(var oe=y.length,ue=0;ue<oe;ue++){var he=y[ue];re=b[ue],he.visible&&he!==E&&re.length!==0&&(re=z[ee],ee++,he.arrange(re.x-x.x,re.y-x.y,re.width,re.height))}a.graduatedBounds=null}}},Hp.prototype.gc=function(a,y,x){var E=x.$i;x.$i=!0;var b=a.naturalBounds,z=b.width,ee=b.height;b=y instanceof da,y.save(),y.beginPath(),y.rect(-1,-1,z+1,ee+1),y.clip(),y.Se(),z=a.Pb(),z.gc(y,x),ee=a.Df()*x.scale,0>=ee&&(ee=1);for(var re=z.actualBounds,oe=a.O.s,ue=a.graduatedMarks,he=oe.length,ge=0;ge<he;ge++){var xe=oe[ge],Pe=ue[ge],Fe=Pe.length;if(xe.visible&&xe!==z&&Pe.length!==0){if(xe instanceof lo){if(!(2>a.graduatedTickUnit*xe.interval*z.geometry.flattenedTotalLength/a.graduatedRange*ee&&xe.graduatedSkip===null)){var Ne=xe.measuredBounds,Je=xe.strokeWidth*xe.scale,Ve=xe.alignmentFocus;Ve.Mc()&&(Ve=Yo);for(var ut=0;ut<Fe;ut++){var ft=Pe[ut].$l,vt=Pe[ut].angle,bt=Ve,zt=xe.Ab;zt.reset(),zt.translate(ft.x+re.x,ft.y+re.y),zt.rotate(vt+xe.angle,0,0),zt.translate(-Ne.width*bt.x+bt.offsetX+Je/2,-Ne.height*bt.y+bt.offsetY+Je/2),zt.scale(xe.scale,xe.scale),Be(xe,!1),xe.wh.set(xe.Ab),xe.Kk=xe.scale,je(xe,!1),xe.gc(y,x),b&&(a.svg.appendChild(xe.svg),xe.svg=null),xe.Ab.reset()}}}else if(xe instanceof Ia)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new Ia),Ne=a.temporaryTextBlock,x1(Ne,xe),Je=0;Je<Fe;Je++)Ve=Pe[Je],Ve.actualBounds&&Ve.measuredBounds&&Ve.naturalBounds&&(Ne.ec=Ve.text||"",Ne.Kb=Ve.Sz||0,Ne.Gc=Ve.lineCount||0,ut=Ve.lines,ut!==void 0&&(Ne.Cb=ut[0],Ne.Ih=ut[1],Ne.df=ut[2],Ne.Le=ut[3],Ne.Qc=ut[4],Ne.Qb=ut[5],Ne.ze=ut[6]),Ve.naturalBounds&&(Ne.dc=Ve.naturalBounds),Ve.actualBounds&&(ut=Ve.actualBounds,Ne.arrange(ut.x,ut.y,ut.width,ut.height)),ut=Ve.actualBounds,Ne.arrange(ut.x,ut.y,ut.width,ut.height),ft=Ve.measuredBounds,Ve=Ve.naturalBounds,vt=Ne.Ab,vt.reset(),vt.translate(ut.x+re.x,ut.y+re.y),vt.translate(-ft.x,-ft.y),Ne.no(vt,Ve.x,Ve.y,Ve.width,Ve.height),Be(Ne,!1),Ne.wh.set(Ne.Ab),Ne.Kk=Ne.scale,je(Ne,!1),Ne.Ng=xe.part,Ne.Me=xe.panel,Ne.gc(y,x),Ne.Me=null,Ne.Ng=null,b&&(a.svg.appendChild(Ne.svg),Ne.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function Vn(a,y){if(Ft.call(this),this.na=null,a===void 0)this.na=Vn.Position;else if(typeof a=="string"){var x=Qu.I(a);x!==null&&(this.na=x)}else a instanceof ws?this.na=a:a&&(this.na=Vn.Position,y=a);this.na===null&&Ke("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===Vn.Grid?1048576:0),this.O=new Nn,this.yb=ss,this.Tm=ar,this.Uf=$r,this.$g=null,this.$e="",this.jg=new Wt(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=qi,this.jn=qo,this.kn=ai,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}_t(Vn,Ft),Vn.prototype.cloneProtected=function(a){Ft.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},Vn.prototype.Af=function(a){Ft.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},Vn.prototype.copy=function(){var a=Ft.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,ee=z.count;if(z.Gb(ee,b),z=a.part,z!==null){z.Rh=null,b.portId!==null&&z instanceof Ci&&(z.Te=!0);var re=a.diagram;re!==null&&re.undoManager.isUndoingRedoing||z.cb(Zo,"elements",a,null,b,null,ee)}}return a}return null},be=Vn.prototype,be.toString=function(){return"Panel("+this.type.name+")#"+br(this)},be.Pn=function(a){Ft.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},be.hh=function(a,y){if(this.na===Vn.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===Vn.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===Vn.Table)if(a.yc(),a instanceof da){var x=a.yd;a.yd=pu(a,"gojs-ts"),Cv(this,a),a.nh.pop(),a.yd=x}else Cv(this,a);(x=this.isClipping&&this.na===Vn.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,ee=0;ee<z;ee++){var re=b[ee];x&&re===E&&(a.clipInsteadOfFill=!0),re.gc(a,y),x&&re===E&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function Cv(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,E=0<a.columnCount?a.colDefs:null;x!==null&&Xm(a,y,!0,x,!0),E!==null&&Xm(a,y,!1,E,!0),x!==null&&o1(a,y,!0,x),E!==null&&o1(a,y,!1,E),x!==null&&Xm(a,y,!0,x,!1),E!==null&&Xm(a,y,!1,E,!1)}function o1(a,y,x,E){for(var b=E.length,z=a.actualBounds,ee=a.naturalBounds,re=!0,oe=0;oe<b;oe++){var ue=E[oe];if(ue!==void 0&&ue.actual!==0)if(re)re=!1;else{if(x){if(ue.position>ee.height)continue}else if(ue.position>ee.width)continue;var he=ue.separatorStrokeWidth;isNaN(he)&&(he=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ge=ue.separatorStroke;if(ge===null&&(ge=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),he!==0&&ge!==null){Qa(a,y,ge,!1,!1,ee,z),ge=!1;var xe=ue.separatorDashArray;xe===null&&(xe=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),xe!==null&&(ge=!0,y.js(xe,0)),y.beginPath(),xe=ue.position+he,x?xe>ee.height&&(he-=xe-ee.height):xe>ee.width&&(he-=xe-ee.width),ue=ue.position+he/2,y.lineWidth=he,he=a.yb,x?(ue+=he.top,xe=ee.width-he.right,y.moveTo(he.left,ue),y.lineTo(xe,ue)):(ue+=he.left,xe=ee.height-he.bottom,y.moveTo(ue,he.top),y.lineTo(ue,xe)),y.stroke(),y.Se(),ge&&y.fs()}}}}function Xm(a,y,x,E,b){for(var z=E.length,ee=a.actualBounds,re=a.naturalBounds,oe=a1(a,!0),ue=a1(a,!1),he=0;he<z;he++){var ge=E[he];if(ge!==void 0&&ge.background!==null&&ge.coversSeparators!==b&&ge.actual!==0){var xe=x?ee.height:ee.width;if(!(ge.position>xe)){var Pe=ge.Wc(),Fe=ge.separatorStrokeWidth;isNaN(Fe)&&(Fe=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var Ne=ge.separatorStroke;Ne===null&&(Ne=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(Ne===null||ge.index===(x?oe:ue))&&(Fe=0),Pe-=Fe,Fe=ge.position+Fe,Pe+=ge.actual,Fe+Pe>xe&&(Pe=xe-Fe),0>=Pe||(xe=a.yb,Qa(a,y,ge.background,!0,!1,re,ee),x?y.fillRect(xe.left,Fe+xe.top,ee.width-(xe.left+xe.right),Pe):y.fillRect(Fe+xe.left,xe.top,Pe,ee.height-(xe.top+xe.bottom)))}}}}function a1(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 bv(a){return a==="LineV"||a==="BarV"}be.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},be.kk=function(a,y,x){if(!Ft.prototype.kk.call(this,a,y,x))return!1;if(this.type===Vn.Table)x=this.svg.getElementsByClassName("gojs-ts"),x=x.length!==0?x[0]:null,x!==null&&(x.innerHTML=""),a.yd=x,Cv(this,a),a.yd=null;else if(this.na===Vn.Grid||this.na===Vn.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},be.nk=function(){return!0},be.$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,ee=0;ee<y.length;ee++)if(y[ee].Ed()){var re=y[ee].actualBounds;b=ee===0?re.x:Math.min(re.x,b),z=ee===0?re.y:Math.min(re.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 Ft.prototype.$o.call(this,a,y,x,E)},be.Sj=function(a,y,x,E,b){var z=this.se(),ee=this.transform,re=1/(ee.m11*ee.m22-ee.m12*ee.m21),oe=ee.m22*re,ue=-ee.m12*re,he=-ee.m21*re,ge=ee.m11*re,xe=re*(ee.m21*ee.dy-ee.m22*ee.dx),Pe=re*(ee.m12*ee.dx-ee.m11*ee.dy);if(this.areaBackground!==null)return ee=this.actualBounds,Re.Ff(ee.left,ee.top,ee.right,ee.bottom,a,y,x,E,b);if(this.background!==null)return z=a*oe+y*he+xe,re=a*ue+y*ge+Pe,a=x*oe+E*he+xe,oe=x*ue+E*ge+Pe,b.h(0,0),x=this.naturalBounds,z=Re.Ff(0,0,x.width,x.height,z,re,a,oe,b),b.transform(ee),z;z||(oe=1,he=ue=0,ge=1,Pe=xe=0),re=a*oe+y*he+xe,a=a*ue+y*ge+Pe,oe=x*oe+E*he+xe,x=x*ue+E*ge+Pe,b.h(oe,x),E=(oe-re)*(oe-re)+(x-a)*(x-a),ue=!1,ge=this.O.s,Pe=ge.length,he=Ie.alloc(),xe=null,y=1/0;var Fe=null,Ne=this.isClipping&&this.na===Vn.Spot;Ne&&(Fe=Ie.alloc(),xe=this.Pb(),(ue=xe.Sj(re,a,oe,x,Fe))&&(y=(re-Fe.x)*(re-Fe.x)+(a-Fe.y)*(a-Fe.y)));for(var Je=0;Je<Pe;Je++){var Ve=ge[Je];Ve.visible&&Ve!==xe&&Ve.Sj(re,a,oe,x,he)&&(ue=!0,Ve=(re-he.x)*(re-he.x)+(a-he.y)*(a-he.y),Ve<E&&(E=Ve,b.set(he)))}return Ne&&(y>E&&b.set(Fe),Ie.free(Fe)),Ie.free(he),z&&b.transform(ee),ue},be.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();Ft.prototype.Gj.call(this)},be.v=function(a){if(!tt(this)){Ft.prototype.v.call(this,a),a=null,(this.na===Vn.Auto||this.na===Vn.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=gl(b,!1);(b instanceof Sl||b instanceof Vn||b instanceof Ia||z!==Mn)&&b.v(!0)}}}},be.Uj=function(){if(!tt(this)){qe(this,!0),wt(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},be.Uk=function(){if(!(this.l&2048)){Be(this,!0),je(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},be.Wu=function(){je(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},be.Wl=function(a,y,x,E){var b=this.jg;b.h(0,0,0,0);var z=this.desiredSize,ee=this.minSize;x===void 0&&(x=ee.width,E=ee.height),x=Math.max(x,ee.width),E=Math.max(E,ee.height);var re=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,re.width)),isNaN(z.height)||(y=Math.min(z.height,re.height)),a=Math.max(x,a),y=Math.max(E,y);var oe=this.yb;a=Math.max(a-oe.left-oe.right,0),y=Math.max(y-oe.top-oe.bottom,0);var ue=this.O.s;ue.length!==0&&this.na.measure(this,a,y,ue,b,x,E),a=b.width+oe.left+oe.right,oe=b.height+oe.top+oe.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(oe=z.height),a=Math.min(re.width,a),oe=Math.min(re.height,oe),a=Math.max(ee.width,a),oe=Math.max(ee.height,oe),a=Math.max(x,a),oe=Math.max(E,oe),Ho(b,a,oe),Ho(this.naturalBounds,a,oe),this.Ge(0,0,a,oe)},be.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 Fd(a){return a.part!==null?a.part.locationObject:null}be.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=gl(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var ee=this.Kg,re=ee.left+ee.right;switch(ee=ee.top+ee.bottom,y===x&&z===E&&(a=Mn),a){case Mn:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case zn:this.v(!0),this.measure(x+re,E+ee,0,0);break;case cr:this.v(!0),this.measure(x+re,z+ee,0,0);break;case Br:this.v(!0),this.measure(y+re,E+ee,0,0)}}this.na.arrange(this,b,this.jg)}},be.gh=function(a){var y=this.naturalBounds,x=Fd(this);if(Fo(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=Ie.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&($n(b.set(a),z.transform),z.ca(b)))return Ie.free(b),!0}return Ie.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},be.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},be.qm=function(a,y){if(y(this,a),a instanceof Vn){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function Nf(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 Vn&&s1(a,z,x)}}function vS(a,y){l1(a,a,y)}function l1(a,y,x){if(x(y),y instanceof Vn){y=y.O.s;for(var E=y.length,b=0;b<E;b++)l1(a,y[b],x)}}be.Nl=function(a){return u1(this,this,a)};function u1(a,y,x){if(x(y))return y;if(y instanceof Vn){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=u1(a,y[b],x);if(z!==null)return z}}return null}be.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=Vp(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof Vn){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function h1(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof Vn?x=Math.max(x,h1(b)):b instanceof lo&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}be.se=function(){return!(this.type===Vn.TableRow||this.type===Vn.TableColumn)};function Qd(a){return a.type===Vn.TableRow||a.type===Vn.TableColumn}be.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),mt(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),ee=z?a:$n(Ie.allocAt(a.x,a.y),this.transform),re=this.diagram,oe=10,ue=5;if(re!==null&&(oe=re.Ql("extraTouchArea"),ue=oe/2),Fo(-(ue*b),-(ue*b),E.width+oe*b,E.height+oe*b,ee.x,ee.y)){if(!this.isAtomic){b=this.O.s;var he=b.length;if(re=Ie.alloc(),ue=(oe=this.isClipping&&this.na===Vn.Spot)?this.Pb():null,oe&&(ue.se()?$n(re.set(a),ue.transform):re.set(a),!ue.ca(re)))return Ie.free(re),z||Ie.free(ee),null;for(var ge=Fd(this);he--;){var xe=b[he];if((xe.visible||xe===ge)&&(xe.se()?$n(re.set(a),xe.transform):re.set(a),!oe||xe!==ue)){var Pe=null;if(xe instanceof Vn?Pe=xe.ic(re,y,x):xe.pickable===!0&&xe.ca(re)&&(Pe=xe),Pe!==null&&(y!==null&&(Pe=y(Pe)),Pe!==null&&(x===null||x(Pe))))return Ie.free(re),z||Ie.free(ee),Pe}}Ie.free(re)}return this.background===null&&this.areaBackground===null?(z||Ie.free(ee),null):(a=Fo(0,0,E.width,E.height,ee.x,ee.y)?this:null,z||Ie.free(ee),a)}return z||Ie.free(ee),null},be.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(),ee=z?a:$n(Ie.allocAt(a.x,a.y),this.transform);if(b=Fo(0,0,b.width,b.height,ee.x,ee.y),Qd(this)||b){if(!this.isAtomic){for(var re=this.O.s,oe=re.length,ue=Ie.alloc(),he=Fd(this);oe--;){var ge=re[oe];if(ge.visible||ge===he){ge.se()?$n(ue.set(a),ge.transform):ue.set(a);var xe=ge;ge=ge instanceof Vn?ge:null,(ge!==null?ge.ji(ue,y,x,E):xe.ca(ue))&&xe.pickable!==!1&&(y!==null&&(xe=y(xe)),xe===null||x!==null&&!x(xe)||E.add(xe))}}Ie.free(ue)}return z||Ie.free(ee),b&&(this.background!==null||this.areaBackground!==null)}return z||Ie.free(ee),!1},be.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 ee=z;if(z===void 0&&(ee=gt.alloc(),ee.reset()),ee.multiply(this.transform),this.fh(a,ee))return Fv(this,y,x,b),z===void 0&>.free(ee),!0;if(this.Yc(a,ee)){if(!this.isAtomic)for(var re=Fd(this),oe=this.O.s,ue=oe.length;ue--;){var he=oe[ue];if(he.visible||he===re){var ge=he.actualBounds,xe=this.naturalBounds;ge.x>xe.width||ge.y>xe.height||0>ge.x+ge.width||0>ge.y+ge.height||(ge=he,he=he instanceof Vn?he:null,xe=gt.alloc(),xe.set(ee),(he!==null?he.Cf(a,y,x,E,b,xe):ys(ge,a,E,xe))&&(y!==null&&(ge=y(ge)),ge===null||x!==null&&!x(ge)||b.add(ge)),gt.free(xe))}}return z===void 0&>.free(ee),E}return z===void 0&>.free(ee),!1};function Fv(a,y,x,E){for(var b=a.O.s,z=b.length;z--;){var ee=b[z];if(ee.visible){var re=ee.actualBounds,oe=a.naturalBounds;re.x>oe.width||re.y>oe.height||0>re.x+re.width||0>re.y+re.height||(ee instanceof Vn&&Fv(ee,y,x,E),y!==null&&(ee=y(ee)),ee===null||x!==null&&!x(ee)||E.add(ee))}}}be.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 ee=this.naturalBounds,re=this.se(),oe=re?a:$n(Ie.allocAt(a.x,a.y),this.transform),ue=re?y:$n(Ie.allocAt(y.x,y.y),this.transform),he=oe.Bf(ue),ge=0<oe.x&&oe.x<ee.width&&0<oe.y&&oe.y<ee.height||pi(oe.x,oe.y,0,0,0,ee.height)<=he||pi(oe.x,oe.y,0,ee.height,ee.width,ee.height)<=he||pi(oe.x,oe.y,ee.width,ee.height,ee.width,0)<=he||pi(oe.x,oe.y,ee.width,0,0,0)<=he;if(ee=oe.zd(0,0)<=he&&oe.zd(0,ee.height)<=he&&oe.zd(ee.width,0)<=he&&oe.zd(ee.width,ee.height)<=he,re||(Ie.free(oe),Ie.free(ue)),ge){if(!this.isAtomic){oe=Ie.alloc(),ue=Ie.alloc(),he=Fd(this);for(var xe=this.O.s,Pe=xe.length;Pe--;){var Fe=xe[Pe];if(Fe.visible||Fe===he){var Ne=Fe.actualBounds,Je=this.naturalBounds;(!re||!(Ne.x>Je.width||Ne.y>Je.height||0>Ne.x+Ne.width||0>Ne.y+Ne.height))&&(Fe.se()?(Ne=Fe.transform,$n(oe.set(a),Ne),$n(ue.set(y),Ne)):(oe.set(a),ue.set(y)),Ne=Fe,Fe=Fe instanceof Vn?Fe:null,(Fe!==null?Fe.og(oe,ue,x,E,b,z):Ne.tx(oe,ue,b))&&(x!==null&&(Ne=x(Ne)),Ne===null||E!==null&&!E(Ne)||z.add(Ne)))}}Ie.free(oe),Ie.free(ue)}return b?ge:ee}return!1};function Lv(a){var y=null;return a instanceof lo&&(y=a.spot1,y===ar&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=Po),y}function Bv(a){var y=null;return a instanceof lo&&(y=a.spot2,y===ar&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=Zt),y}be.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},be.M=function(a){return this.O.M(a)},be.Gb=function(a,y){y instanceof mr&&Ke("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&Ke("Cannot make a Panel contain itself: "+this.toString()),Ke("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&Ke("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!==Vn.Grid||y instanceof lo||Ke("Can only add Shapes to a Grid Panel, not: "+y),this.na!==Vn.Graduated||y instanceof lo||y instanceof Ia||Ke("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 Gt),this.ge.add(E,y))}var b=this.O;if(E=-1,x===this){for(var z=-1,ee=this.O.s,re=ee.length,oe=0;oe<re;oe++)if(ee[oe]===y){z=oe;break}if(z!==-1){if(z===a||z+1>=b.count&&a>=b.count)return;b.mb(z),E=z}else Ke("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),tt(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof Vn&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Qm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof Ci&&(x.Te=!0),x.Te&&x instanceof Ci&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(ha,"elements",this,y,null,E,null),x.cb(Zo,"elements",this,null,y,null,a)))};function Mv(a,y){a.l=y?a.l|16777216:a.l&-16777217}be.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)},be.mb=function(a){0<=a&&this.pc(a,!0)},be.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),qe(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 Ci&&(E instanceof Vn?E.qm(E,function(ee,re){$v(z,re,y)}):$v(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(ha,"elements",this,E,null,a,null))},be.Fb=function(a){0>a&&_n(a,">= 0",Vn,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new xs;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(Zo,"rowdefs",this,null,x,null,a)}return y[a]},be.oA=function(a){if(0>a&&_n(a,">= 0",Vn,"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(ha,"rowdefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof xs?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}be.Eb=function(a){0>a&&_n(a,">= 0",Vn,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new xs;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(Zo,"coldefs",this,null,x,null,a)}return y[a]},be.jA=function(a){if(0>a&&_n(a,">= 0",Vn,"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(ha,"coldefs",this,x,null,a,null),this.v()}}};function c1(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof xs?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}be.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&$m(y,a),this},be.Hy=function(a,y){return(a=this.Fb(a))&&$m(a,new xs(y)),this},be.By=function(a,y){return(a=this.Eb(a))&&$m(a,new xs(y)),this},be.nz=function(a){if(0>a||this.type!==Vn.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},be.fz=function(a){if(0>a||this.type!==Vn.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},be.Fz=function(a,y){if(y===void 0&&(y=new Ie(NaN,NaN)),this.type!==Vn.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)},be.Gz=function(a){if(this.type!==Vn.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 zu(a){var y=a.allBindings;if(y===null)a.data!==null&&Ke("Template cannot have .data be non-null: "+a),a.allBindings=y=new Nn;else if(y._isFrozen)return;var x=new Nn;Mv(a,!1),a.qm(a,function(ue,he){he.th();var ge=he.localBindings;if(ge!==null)for(Se(he,!1),ge=ge.iterator;ge.next();){var xe=ge.value;xe.mode===fm&&Se(he,!0);var Pe=xe.sourceName;Pe!==null&&(Pe==="/"&&Mv(ue,!0),Pe=Lx(xe,ue,he),Pe!==null&&(x.add(Pe),Pe.srcBindings===null&&(Pe.srcBindings=new Nn),Pe.srcBindings.add(xe))),y.add(xe)}if(he instanceof Vn&&he.type===Vn.Table){if(0<he.rowCount){for(ue=he.rowDefs,ge=ue.length,xe=0;xe<ge;xe++)if(Pe=ue[xe],Pe!==void 0&&Pe.be!==null)for(var Fe=Pe.be.iterator;Fe.next();){var Ne=Fe.value;Ne.xd=Pe,Ne.to=2,Ne.wl=Pe.index,y.add(Ne)}}if(0<he.columnCount){for(he=he.colDefs,ue=he.length,ge=0;ge<ue;ge++)if(xe=he[ge],xe!==void 0&&xe.be!==null)for(Pe=xe.be.iterator;Pe.next();)Fe=Pe.value,Fe.xd=xe,Fe.to=1,Fe.wl=xe.index,y.add(Fe)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){Se(b,!0);for(var z=b.srcBindings.iterator;z.next();){var ee=z.value;b.localBindings===null&&(b.localBindings=new Nn),b.localBindings.add(ee)}}b.srcBindings=null}for(E=y.iterator;E.next();)if(b=E.value,z=b.xd,z!==null){b.xd=null;var re=b.targetProperty,oe=re.indexOf(".");0<oe&&z instanceof Vn&&(ee=re.substring(0,oe),re=re.substr(oe+1),oe=z.fb(ee),oe!==null?(z=oe,b.targetProperty=re):ci('Warning: unable to find GraphObject named "'+ee+'" for Binding: '+b.toString())),z instanceof xs?(ee=br(z.panel),b.Ai=ee===void 0?-1:ee,z.panel.bindingId=b.Ai):z instanceof Ft?(ee=br(z),b.Ai=ee===void 0?-1:ee,z.bindingId=b.Ai):Ke("Unknown type of binding target: "+z)}y.freeze(),a instanceof mr&&a.Zc()&&a.Va()}be.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vS(y,function(x){x instanceof Vn&&(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&&zu(y),y},be.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,ee=x.Ai;if(ee!==-1){if(z=this.ks(ee),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 Vn))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},be.sx=function(a){return a==null||this.ge===null?null:this.ge.I(a)};function yS(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 Vn&&z.data!==null));)b++,z=a[b];if(x-b!==E)return!0;if(z===null)return 0<E;for(var ee=0;b<x&&ee<E;){if(z=a[b],!(z instanceof Vn)||z.data!==y[ee])return!0;b++,ee++}return!1}function Vp(a){if(a.type===Vn.Spot||a.type===Vn.Auto)return Math.min(a.O.length,1);if(a.type===Vn.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof lo&&E.isPanelMain))break}return x}return a.type===Vn.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof Vn&&Qd(a))?1:0}be.mv=function(){for(var a=Vp(this);this.O.length>a;)this.pc(this.O.length-1,!1);g1(this,this.itemArray)};function g1(a,y){var x=Vp(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++)Jm(a,y[E],E,!0)}else{E=x;for(var b=0;b<y.length;b++,E++){var z=y[b],ee=E<a.O.length?a.O.M(E):null;if(ee instanceof Vn){if(ee.data!==z){var re=Av(a,ee.data),oe=Av(a,z),ue=oe!==re;ue||(re=Nv(a,re),ue=Nv(a,oe)!==re),ue?(a.pc(E,!1),Jm(a,z,b,!1)):ee.data=z}}else Jm(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,kv(a,x,0),tt(a)||a.v(),a.graduatedIntervals=null,a.If()||Qm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof Ci&&(y.Te=!0),y.Te&&y instanceof Ci&&(y.wc=null))}}function Jm(a,y,x,E){if(!(y==null||0>x)){var b=Av(a,y);if(b=Nv(a,b),b!==null){if(zu(b),b=b.copy(),b.l&16777216){var z=a.ih();z!==null&&Mv(z,!0)}typeof y=="object"&&(a.ge===null&&(a.ge=new Gt),a.ge.add(y,b)),z=x+Vp(a),a.Gb(z,b),E&&(b.ub=y,kv(a,z,x),b.ub=null),b.data=y}}}function kv(a,y,x){for(a=a.O;y<a.length;){var E=a.M(y);if(E instanceof Vn){var b=y,z=x;E.type===Vn.TableRow?E.row=b:E.type===Vn.TableColumn&&(E.column=b),E.itemIndex=z}y++,x++}}function Av(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=ds(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;Ke("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function Nv(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(p1||(p1=!0,ci('No item template Panel found for category "'+y+'" on '+a),ci(" Using default item template."),a=new Vn,y=new Ia,y.bind(new cs("text","",Cr)),a.add(y),m1=a),E=m1)),E}function Qm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof Vn){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof Vn&&!z.isEnabled||Qm(a,z,x)}}}function kh(a,y){y.name=a,Qu.add(a,y)}At.Object.defineProperties(Vn.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===Vn.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&&_n(a,">= 0",Vn,"padding"),a=new Kr(a)):(0>a.left&&_n(a.left,">= 0",Vn,"padding:value.left"),0>a.right&&_n(a.right,">= 0",Vn,"padding:value.right"),0>a.top&&_n(a.top,">= 0",Vn,"padding:value.top"),0>a.bottom&&_n(a.bottom,">= 0",Vn,"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:ss},set:function(a){typeof a=="number"&&(a=new Kr(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Lu),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 $o)&&(a instanceof $o&&a.freeze(),this.T===null&&(this.T=new Lu),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 Lu),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)||Ke("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 Lu),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 $o)&&(a instanceof $o&&a.freeze(),this.T===null&&(this.T=new Lu),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 Lu),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)||Ke("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 Lu),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 Lu),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||Ke("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Xu(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()||Ke("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Xu(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 Ld),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),ve(this)&&(a=this.part,a!==null&&ja(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 Ld),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),ve(this)&&(a=this.part,a!==null&&ja(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 Ld),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 Ld),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 Ld,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 Ld,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 Ld,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 Ld,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 Lu),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Lu),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:e0},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new Lu),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:e0},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new Lu),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)&&Ke("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Lu),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)&&Ke("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Lu),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 mr&&!(this instanceof ta);zu(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof qn?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof mr&&(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 Or),this.A.nb=a)}},itemArray:{get:function(){return this.Hh},set:function(a){var y=this.Hh;if(y!==a||a!==null&&yS(this,a)){var x=this.diagram;y!==a&&(x!==null&&y!==null&&yy(x.partManager,this,x),this.Hh=a,x!==null&&a!==null&&vy(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||g1(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 Gt}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof mr||a.isPanelMain)&&Ke("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(););fo(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&&(fo(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 to&&(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&&Qm(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))}}}),At.Object.defineProperties(Vn,{Position:{get:function(){return Qu.I("Position")}},Horizontal:{get:function(){return Qu.I("Horizontal")}},Vertical:{get:function(){return Qu.I("Vertical")}},Spot:{get:function(){return Qu.I("Spot")}},Auto:{get:function(){return Qu.I("Auto")}},Table:{get:function(){return Qu.I("Table")}},Viewbox:{get:function(){return Qu.I("Viewbox")}},TableRow:{get:function(){return Qu.I("TableRow")}},TableColumn:{get:function(){return Qu.I("TableColumn")}},Link:{get:function(){return Qu.I("Link")}},Grid:{get:function(){return Qu.I("Grid")}},Graduated:{get:function(){return Qu.I("Graduated")}}}),Vn.prototype.rebuildItemElements=Vn.prototype.mv,Vn.prototype.findItemPanelForData=Vn.prototype.sx,Vn.prototype.updateTargetBindings=Vn.prototype.La,Vn.prototype.copyTemplate=Vn.prototype.Uy,Vn.prototype.graduatedValueForPoint=Vn.prototype.Gz,Vn.prototype.graduatedPointForValue=Vn.prototype.Fz,Vn.prototype.findColumnForLocalX=Vn.prototype.fz,Vn.prototype.findRowForLocalY=Vn.prototype.nz,Vn.prototype.addColumnDefinition=Vn.prototype.By,Vn.prototype.addRowDefinition=Vn.prototype.Hy,Vn.prototype.addRowColumnDefinition=Vn.prototype.Gy,Vn.prototype.removeColumnDefinition=Vn.prototype.jA,Vn.prototype.getColumnDefinition=Vn.prototype.Eb,Vn.prototype.removeRowDefinition=Vn.prototype.oA,Vn.prototype.getRowDefinition=Vn.prototype.Fb,Vn.prototype.removeAt=Vn.prototype.mb,Vn.prototype.remove=Vn.prototype.remove,Vn.prototype.insertAt=Vn.prototype.Gb,Vn.prototype.elt=Vn.prototype.M,Vn.prototype.add=Vn.prototype.add,Vn.prototype.findObject=Vn.prototype.fb,Vn.prototype.findInVisualTree=Vn.prototype.Nl,Vn.prototype.walkVisualTreeFrom=Vn.prototype.qm,Vn.prototype.findMainElement=Vn.prototype.Pb;var p1=!1,m1=null,Qu=new Gt;Vn.className="Panel",Vn.definePanelLayout=kh,kh("Position",new Rm),kh("Vertical",new zm),kh("Auto",new Gm),kh("Link",new Ym);function Ld(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}Ld.prototype.copy=function(){var a=new Ld;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},Ld.className="GradPanelSettings";function Lu(){this.Pc=[],this.Oc=[],this.j=this.ob=e0,this.hb=this.Hb=0,this.Qp=ss,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Lu.prototype.copy=function(a){for(var y=new Lu,x=this.Pc,E=x.length,b=y.Pc,z=0;z<E;z++)if(x[z]!==void 0){var ee=x[z].copy();ee.wi(a),b[z]=ee}for(x=this.Oc,E=x.length,b=y.Oc,z=0;z<E;z++)x[z]!==void 0&&(ee=x[z].copy(),ee.wi(a),b[z]=ee);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},Lu.className="TablePanelSettings";function xs(a){Ar(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=ar,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Dv,this.hg=$r,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))}xs.prototype.copy=function(){var a=new xs;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=Xt(this.separatorDashArray)),a.Ma=this.Ma,a.Pm=this.Pm,a.be=this.be,a};function $m(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=Xt(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}be=xs.prototype,be.qb=function(a){a.classType===xs&&(this.sizing=a)},be.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+br(this)},be.wi=function(a){this.Me=a},be.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)},be.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===Vn.Table)for(var b=E?y.rowDefs.length:y.colDefs.length,z=0;z<b;z++){var ee=E?y.rowDefs[z]:y.colDefs[z];if(ee!==void 0&&ee.oa!==0){x=ee.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)},be.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(uo,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 qm(a){if(a.sizing===Dv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}be.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new cs(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&f1(y)&&Ke("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new Nn),this.be.add(b),this},At.Object.defineProperties(xs.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&&_n(a,">= 0",xs,"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&&_n(a,">= 0",xs,"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))&&_n(a,">= 0",xs,"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&&_n(a,">= 0",xs,"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 Kr(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&&Tc(a,"RowColumnDefinition.separatorStroke"),a instanceof $o&&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)||Ke("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&&Tc(a,"RowColumnDefinition.background"),a instanceof $o&&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}}}),xs.prototype.computeEffectiveSpacing=xs.prototype.Wc,xs.prototype.computeEffectiveSpacingTop=xs.prototype.Io;var Dv=new yn(xs,"Default",0),Kp=new yn(xs,"None",1),e0=new yn(xs,"ProportionalExtra",2);xs.className="RowColumnDefinition",xs.Default=Dv,xs.None=Kp,xs.ProportionalExtra=e0;function lo(a,y){Ft.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)}_t(lo,Ft),lo.prototype.cloneProtected=function(a){Ft.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=Xt(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 Df(a){a.Na===null?a.Na=new _v:a.Na.nc&&(a.Na=a.Na.copy())}be=lo.prototype,be.th=function(){Ft.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},be.qb=function(a){a===Mn||a===qi||a===No||a===$r?this.geometryStretch=a:Ft.prototype.qb.call(this,a)},be.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+br(this)};function lp(a,y,x,E){var b=x.length;if(!(4>b)){var z=E.measuredBounds,ee=Math.max(1,z.width);z=z.height;for(var re=x[0],oe=x[1],ue,he,ge,xe,Pe,Fe,Ne=0,Je=gi(),Ve=2;Ve<b;Ve+=2)ue=x[Ve],he=x[Ve+1],ge=ue-re,re=he-oe,ge===0&&(ge=.001),xe=re/ge,Pe=Math.atan2(re,ge),Fe=Math.sqrt(ge*ge+re*re),Je.push([ge,Pe,xe,Fe]),Ne+=Fe,re=ue,oe=he;re=x[0],oe=x[1],ge=E.measuredBounds.width,E instanceof lo&&(ge-=E.strokeWidth),1>ge&&(ge=1),b=x=ge,ue=ee/2,he=ue!==0,Ve=0,Fe=Je[Ve],ge=Fe[0],Pe=Fe[1],xe=Fe[2],Fe=Fe[3];for(var ut=0;.1<=Ne;){if(ut===0&&(he?(b=x,b-=ue,Ne-=ue,he=!1):b=x,b===0&&(b=1)),b>Ne){Ii(Je);return}b>Fe?(ut=b-Fe,b=Fe):ut=0;var ft=Math.sqrt(b*b/(1+xe*xe));if(0>ge&&(ft=-ft),re+=ft,oe+=xe*ft,a.translate(re,oe),a.rotate(Pe),a.translate(-(ee/2),-(z/2)),ut===0&&E.hh(a,y),a.translate(ee/2,z/2),a.rotate(-Pe),a.translate(-re,-oe),Ne-=b,Fe-=b,ut!==0){if(Ve++,Ve===Je.length){Ii(Je);return}Fe=Je[Ve],ge=Fe[0],Pe=Fe[1],xe=Fe[2],Fe=Fe[3],b=ut}}Ii(Je)}}be.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,ee=this.naturalBounds;E!==null&&Qa(this,a,E,!0,!1,ee,z);var re=this.part,oe=this.ig;if(x===null||oe!==0||re===null||!this.isPanelMain&&re.Pb()!==this||(oe=re.type===Vn.Link&&re instanceof ta&&re.category==="Selection"&&re.adornedObject instanceof lo&&re.adornedPart.Pb()===re.adornedObject?re.adornedObject.strokeWidth:0),oe===0&&(x=null),x!==null&&oe!==0&&(Qa(this,a,x,!1,!1,ee,z),a.lineWidth=oe,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,re&&y.Gf("drawShadows")&&(z=re.isShadowed),a.Il===!1&&(z=!1),re=!0,x===null||E!==null&&E!=="transparent"||(re=!1),ee=!1,oe=this.strokeDashArray,oe!==null&&(ee=!0,a.js(oe,this.strokeDashOffset)),b.type===lt.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===lt.u){var ue=b.startX;oe=b.startY;var he=b.endX,ge=b.endY;b=Math.min(ue,he);var xe=Math.min(oe,ge);ue=Math.abs(he-ue),oe=Math.abs(ge-oe),a.beginPath(),a.rect(b,xe,ue,oe),E!==null&&a.ng(E),x!==null&&(re&&z&&pl(a),a.jk(),re&&z&&zs(a)),a.Se()}else if(b.type===lt.F)ue=b.startX,oe=b.startY,he=b.endX,ge=b.endY,b=Math.abs(he-ue)/2,xe=Math.abs(ge-oe)/2,ue=Math.min(ue,he)+b,oe=Math.min(oe,ge)+xe,a.beginPath(),a.moveTo(ue,oe-xe),a.bezierCurveTo(ue+Re.wg*b,oe-xe,ue+b,oe-Re.wg*xe,ue+b,oe),a.bezierCurveTo(ue+b,oe+Re.wg*xe,ue+Re.wg*b,oe+xe,ue,oe+xe),a.bezierCurveTo(ue-Re.wg*b,oe+xe,ue-b,oe+Re.wg*xe,ue-b,oe),a.bezierCurveTo(ue-b,oe-Re.wg*xe,ue-Re.wg*b,oe-xe,ue,oe-xe),a.closePath(),E!==null&&a.ng(E),x!==null&&(re&&z&&pl(a),a.jk(),re&&z&&zs(a)),a.Se();else if(b.type===lt.o)for(b=b.figures,oe=b.length,xe=0;xe<oe;xe++){ue=b.s[xe],a.beginPath(),a.moveTo(ue.startX,ue.startY),he=ue.segments.s,ge=he.length;for(var Pe=null,Fe=0;Fe<ge;Fe++){var Ne=he[Fe];switch(Ne.type){case Si:a.moveTo(Ne.endX,Ne.endY);break;case Pi:a.lineTo(Ne.endX,Ne.endY);break;case Jr:a.bezierCurveTo(Ne.point1X,Ne.point1Y,Ne.point2X,Ne.point2Y,Ne.endX,Ne.endY);break;case Ur:a.quadraticCurveTo(Ne.point1X,Ne.point1Y,Ne.endX,Ne.endY);break;case Nr:if(Ne.radiusX===Ne.radiusY){var Je=Math.PI/180;a.arc(Ne.point1X,Ne.point1Y,Ne.radiusX,Ne.startAngle*Je,(Ne.startAngle+Ne.sweepAngle)*Je,0>Ne.sweepAngle,Pe!==null?Pe.endX:ue.startX,Pe!==null?Pe.endY:ue.startY)}else if(Pe=Eo(Ne,ue),Je=Pe.length,Je===0)a.lineTo(Ne.centerX,Ne.centerY);else for(var Ve=0;Ve<Je;Ve++){var ut=Pe[Ve];Ve===0&&a.lineTo(ut[0],ut[1]),a.bezierCurveTo(ut[2],ut[3],ut[4],ut[5],ut[6],ut[7])}break;case Lo:if(Ve=Je=0,Pe!==null&&Pe.type===Nr){if(Pe=Eo(Pe,ue),ut=Pe.length,ut===0){a.lineTo(Ne.endX,Ne.endY);break}Pe=Pe[ut-1]||null,Pe!==null&&(Je=Pe[6],Ve=Pe[7])}else Je=Pe!==null?Pe.endX:ue.startX,Ve=Pe!==null?Pe.endY:ue.startY;if(Pe=Wi(Ne,ue,Je,Ve),Je=Pe.length,Je===0){a.lineTo(Ne.endX,Ne.endY);break}for(Ve=0;Ve<Je;Ve++)ut=Pe[Ve],a.bezierCurveTo(ut[2],ut[3],ut[4],ut[5],ut[6],ut[7]);break;default:Ke("Segment not of valid type: "+Ne.type)}Ne.isClosed&&a.closePath(),Pe=Ne}he=ue.isFilled,z?ue.isShadowed?(he===!0&&E!=="transparent"&&E!==null&&a.ng(E,ue.isEvenOdd),x!==null&&(he&&re&&pl(a),a.jk(),he&&re&&zs(a))):(pl(a),he&&E!=="transparent"&&E!==null&&a.ng(E,ue.isEvenOdd),x!==null&&a.jk(),zs(a)):(he&&E!==null&&a.ng(E,ue.isEvenOdd),x!==null&&a.jk()),a.Se(xe)}if(ee&&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=gi(),z.type===lt.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),lp(a,y,E,x);else if(z.type===lt.o)for(z=z.figures.iterator;z.next();){for(re=z.value,E.length=0,E.push(re.startX),E.push(re.startY),ee=re.startX,b=re.startY,oe=ee,xe=b,ue=re.segments.s,he=ue.length,ge=0;ge<he;ge++){switch(Fe=ue[ge],Fe.type){case Si:lp(a,y,E,x),E.length=0,E.push(Fe.endX),E.push(Fe.endY),ee=Fe.endX,b=Fe.endY,oe=ee,xe=b;break;case Pi:E.push(Fe.endX),E.push(Fe.endY),ee=Fe.endX,b=Fe.endY;break;case Jr:Re.Qe(ee,b,Fe.point1X,Fe.point1Y,Fe.point2X,Fe.point2Y,Fe.endX,Fe.endY,.5,E),ee=Fe.endX,b=Fe.endY;break;case Ur:Re.ep(ee,b,Fe.point1X,Fe.point1Y,Fe.endX,Fe.endY,.5,E),ee=Fe.endX,b=Fe.endY;break;case Nr:if(Ne=Eo(Fe,re),Pe=Ne.length,Pe===0){E.push(Fe.centerX),E.push(Fe.centerY),ee=Fe.centerX,b=Fe.centerY;break}for(Je=0;Je<Pe;Je++)Ve=Ne[Je],Re.Qe(ee,b,Ve[2],Ve[3],Ve[4],Ve[5],Ve[6],Ve[7],.5,E),ee=Ve[6],b=Ve[7];break;case Lo:if(Ne=Wi(Fe,re,ee,b),Pe=Ne.length,Pe===0){E.push(Fe.endX),E.push(Fe.endY),ee=Fe.endX,b=Fe.endY;break}for(Je=0;Je<Pe;Je++)Ve=Ne[Je],Re.Qe(ee,b,Ve[2],Ve[3],Ve[4],Ve[5],Ve[6],Ve[7],.5,E),ee=Ve[6],b=Ve[7];break;default:Ke("Segment not of valid type: "+Fe.type)}Fe.isClosed&&(E.push(oe),E.push(xe),lp(a,y,E,x))}lp(a,y,E,x)}else if(z.type===lt.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),lp(a,y,E,x);else if(z.type===lt.F){if(b=new Zr,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,ee=new Er(Nr),ee.startAngle=0,ee.sweepAngle=360,ee.centerX=(z.startX+z.endX)/2,ee.centerY=(z.startY+z.endY)/2,ee.radiusX=Math.abs(z.startX-z.endX)/2,ee.radiusY=Math.abs(z.startY-z.endY)/2,b.add(ee),z=Eo(ee,b),re=z.length,re===0)E.push(ee.centerX),E.push(ee.centerY);else for(ee=b.startX,b=b.startY,oe=0;oe<re;oe++)xe=z[oe],Re.Qe(ee,b,xe[2],xe[3],xe[4],xe[5],xe[6],xe[7],.5,E),ee=xe[6],b=xe[7];lp(a,y,E,x)}Ii(E),a.restore(),a.Vc(!1)}}}},be.kk=function(a,y,x){return!Ft.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)},be.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:Ft.prototype.nk.call(this,a)},be.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)}},be.ga=function(a,y){if(y===void 0&&(y=new Ie),a instanceof Zi){a.Mc()&&Ke("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},be.mi=function(a){a===void 0&&(a=new Wt);var y=this.naturalBounds,x=this.oe;y=Wt.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=Ie.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),Mo(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),Mo(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),Mo(a,E.x,E.y,0,0),Wt.free(y),Ie.free(E),a},be.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!==lt.j||y||(b+=2);var z=Wt.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return Wt.free(z),!1;if(E=b+1e-4,x.type===lt.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:(Wt.free(z),Re.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===lt.u){y=x.startX;var ee=x.startY,re=x.endX;if(x=x.endY,z.x=Math.min(y,re),z.y=Math.min(ee,x),z.width=Math.abs(re-y),z.height=Math.abs(x-ee),this.fill===null){if(z.Bc(-E,-E),z.ca(a))return Wt.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),Wt.free(z),a}if(x.type===lt.F){ee=x.startX,b=x.startY,re=x.endX;var oe=x.endY;if(x=Math.min(ee,re),y=Math.min(b,oe),ee=Math.abs(re-ee)/2,b=Math.abs(oe-b)/2,x=a.x-(x+ee),y=a.y-(y+b),this.fill===null){if(ee-=E,b-=E,0>=ee||0>=b||1>=x*x/(ee*ee)+y*y/(b*b))return Wt.free(z),!1;ee+=E,b+=E}return this.stroke!==null&&(ee+=E,b+=E),Wt.free(z),0>=ee||0>=b?!1:1>=x*x/(ee*ee)+y*y/(b*b)}if(x.type===lt.o)return Wt.free(z),this.fill===null?Un(x,a.x,a.y,b):pr(x,a,b,1<this.strokeWidth,y);Ke("Unknown Geometry type: "+x.type)},be.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 ee=this.geometry.bounds;else{var re=this.figure,oe=Iv[re];if(oe===void 0){var ue=Re.Ze[re];typeof ue=="string"&&(ue=Re.Ze[ue]),typeof ue=="function"?(oe=ue(null,100,100),Iv[re]=oe):Ke("Unsupported Figure: "+re)}ee=oe.bounds}re=ee.width,oe=ee.height,ue=ee.width;var he=ee.height;switch(gl(this,!0)){case Mn:E=x=0;break;case zn:ue=Math.max(a-z,0),he=Math.max(y-z,0);break;case cr:ue=Math.max(a-z,0),E=0;break;case Br:x=0,he=Math.max(y-z,0)}isFinite(b.width)&&(ue=b.width),isFinite(b.height)&&(he=b.height);var ge=this.maxSize,xe=this.minSize;switch(x=Math.max(x-z,xe.width),E=Math.max(E-z,xe.height),ue=Math.min(ge.width,ue),he=Math.min(ge.height,he),ue=isFinite(ue)?Math.max(x,ue):Math.max(re,x),he=isFinite(he)?Math.max(E,he):Math.max(oe,E),x=Tv(this),x){case Mn:break;case zn:re=ue,oe=he;break;case qi:x=Math.min(ue/re,he/oe),isFinite(x)||(x=1),re*=x,oe*=x;break;default:Ke(x+" is not a valid geometryStretch.")}this.Rd!==null?(re===0&&(re=.001),oe===0&&(oe=.001),x=this.Rd!==null?this.Rd:this.ua,ee=x.bounds,E=re/ee.width,ee=oe/ee.height,isFinite(E)||(E=1),isFinite(ee)||(ee=1),this.ua=E===1&&ee===1?x:x.copy().scale(E,ee)):this.ua!==null&&Re.$(this.ua.Sk,a-z)&&Re.$(this.ua.Rk,y-z)||(this.ua=lo.makeGeometry(this,re,oe)),ee=this.ua.bounds,a===1/0||y===1/0?this.Ge(ee.x-z/2,ee.y-z/2,a===0&&re===0?0:ee.width+z,y===0&&oe===0?0:ee.height+z):this.Ge(-(z/2),-(z/2),ue+z,he+z),b.w()?(ue=b.width,he=b.height,ue=Math.min(ge.width,ue),he=Math.min(ge.height,he),ue=Math.max(xe.width,ue),he=Math.max(xe.height,he),this.dc.h(0,0,ue,he)):this.dc.assign(ee)};function Tv(a){var y=a.geometryStretch;return a.Rd!==null?y===$r?zn:y:y===$r?Iv[a.figure].defaultStretch:y}be.eh=function(a,y,x,E){ol(this,a,y,x,E)},be.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},be.Sj=function(a,y,x,E,b){var z=this.transform,ee=1/(z.m11*z.m22-z.m12*z.m21),re=z.m22*ee,oe=-z.m12*ee,ue=-z.m21*ee,he=z.m11*ee,ge=ee*(z.m21*z.dy-z.m22*z.dx),xe=ee*(z.m12*z.dx-z.m11*z.dy);z=a*re+y*ue+ge,ee=a*oe+y*he+xe,re=x*re+E*ue+ge,oe=x*oe+E*he+xe,ge=this.ig/2,ue=this.ua,ue===null&&(this.measure(1/0,1/0),ue=this.ua);var Pe=ue.bounds;if(he=!1,ue.type===lt.j)if(1.5>=this.strokeWidth)he=Re.Ve(ue.startX,ue.startY,ue.endX,ue.endY,z,ee,re,oe,b);else{if(ue.startX===ue.endX?(E=ge,he=0):(y=(ue.endY-ue.startY)/(ue.endX-ue.startX),he=ge/Math.sqrt(1+y*y),E=he*y),y=gi(),a=new Ie,Re.Ve(ue.startX+E,ue.startY+he,ue.endX+E,ue.endY+he,z,ee,re,oe,a)&&y.push(a),a=new Ie,Re.Ve(ue.startX-E,ue.startY-he,ue.endX-E,ue.endY-he,z,ee,re,oe,a)&&y.push(a),a=new Ie,Re.Ve(ue.startX+E,ue.startY+he,ue.startX-E,ue.startY-he,z,ee,re,oe,a)&&y.push(a),a=new Ie,Re.Ve(ue.endX+E,ue.endY+he,ue.endX-E,ue.endY-he,z,ee,re,oe,a)&&y.push(a),re=y.length,re===0)return Ii(y),!1;for(he=!0,oe=1/0,E=0;E<re;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-ee)*(a.y-ee),x<oe&&(oe=x,b.x=a.x,b.y=a.y);Ii(y)}else if(ue.type===lt.u)he=Re.Ff(Pe.x-ge,Pe.y-ge,Pe.x+Pe.width+ge,Pe.y+Pe.height+ge,z,ee,re,oe,b);else if(ue.type===lt.F){y=Wt.allocAt(Pe.x,Pe.y,Pe.width,Pe.height).Bc(ge,ge);e:if(y.width===0)he=Re.Ve(y.x,y.y,y.x,y.y+y.height,z,ee,re,oe,b);else if(y.height===0)he=Re.Ve(y.x,y.y,y.x+y.width,y.y,z,ee,re,oe,b);else{if(a=y.width/2,ue=y.height/2,E=y.x+a,he=y.y+ue,x=9999,z!==re&&(x=(ee-oe)/(z-re)),9999>Math.abs(x)){if(oe=ee-he-x*(z-E),0>a*a*x*x+ue*ue-oe*oe){b.x=NaN,b.y=NaN,he=!1;break e}ge=Math.sqrt(a*a*x*x+ue*ue-oe*oe),re=(-(a*a*x*oe)+a*ue*ge)/(ue*ue+a*a*x*x)+E,a=(-(a*a*x*oe)-a*ue*ge)/(ue*ue+a*a*x*x)+E,ue=x*(re-E)+oe+he,oe=x*(a-E)+oe+he,Math.abs((z-re)*(z-re))+Math.abs((ee-ue)*(ee-ue))<Math.abs((z-a)*(z-a))+Math.abs((ee-oe)*(ee-oe))?(b.x=re,b.y=ue):(b.x=a,b.y=oe)}else{if(re=ue*ue,oe=z-E,re-=re/(a*a)*oe*oe,0>re){b.x=NaN,b.y=NaN,he=!1;break e}oe=Math.sqrt(re),re=he+oe,oe=he-oe,Math.abs(re-ee)<Math.abs(oe-ee)?(b.x=z,b.y=re):(b.x=z,b.y=oe)}he=!0}Wt.free(y)}else if(ue.type===lt.o){xe=Ie.alloc();var Fe=re-z,Ne=oe-ee,Je=Fe*Fe+Ne*Ne,Ve=z,ut=ee;if(0<Je&&Pe.contains(Ve,ut)&&(xe.x=Ve,xe.y=ut,this.ca(xe)))for(Fe!==0&&.5>Math.abs(Fe)?(Ne*=.5/Fe,Fe=.5):Ne!==0&&.5>Math.abs(Ne)&&(Fe*=.5/Ne,Ne=.5),Ve-=Fe,ut-=Ne;Pe.contains(Ve,ut);)Ve-=Fe,ut-=Ne;for(b.x=re,b.y=oe,Ne=0;Ne<ue.figures.count;Ne++){var ft=ue.figures.s[Ne],vt=ft.isFilled?Ve:z,bt=ft.isFilled?ut:ee,zt=ft.segments;Pe=ft.startX,Fe=ft.startY;for(var vi=Pe,Xi=Fe,Ri=0;Ri<zt.count;Ri++){var Qn=zt.s[Ri],Cn=Qn.type,qr=Qn.endX,Rr=Qn.endY,aa=!1;switch(Cn){case Si:vi=qr,Xi=Rr;break;case Pi:aa=n0(Pe,Fe,qr,Rr,vt,bt,re,oe,xe);break;case Jr:aa=Re.Eo(Pe,Fe,Qn.point1X,Qn.point1Y,Qn.point2X,Qn.point2Y,qr,Rr,vt,bt,re,oe,.6,xe);break;case Ur:aa=Re.Eo(Pe,Fe,Pe+2/3*(Qn.point1X-Pe),Fe+2/3*(Qn.point1Y-Fe),qr+2/3*(Qn.point1X-qr),Rr+2/3*(Qn.point1Y-Rr),qr,Rr,vt,bt,re,oe,.6,xe);break;case Nr:case Lo:Cn=Qn.type===Nr?Eo(Qn,ft):Wi(Qn,ft,Pe,Fe);var Na=Cn.length;if(Na===0){aa=n0(Pe,Fe,Qn.type===Nr?Qn.centerX:Qn.endX,Qn.type===Nr?Qn.centerY:Qn.endY,vt,bt,re,oe,xe);break}for(Rr=null,qr=0;qr<Na;qr++){if(Rr=Cn[qr],qr===0&&n0(Pe,Fe,Rr[0],Rr[1],vt,bt,re,oe,xe)){var ks=t0(vt,bt,xe,Je,b);ks<Je&&(Je=ks,he=!0)}Re.Eo(Rr[0],Rr[1],Rr[2],Rr[3],Rr[4],Rr[5],Rr[6],Rr[7],vt,bt,re,oe,.6,xe)&&(ks=t0(vt,bt,xe,Je,b),ks<Je&&(Je=ks,he=!0))}qr=Rr[6],Rr=Rr[7];break;default:Ke("Unknown Segment type: "+Cn)}Pe=qr,Fe=Rr,aa&&(aa=t0(vt,bt,xe,Je,b),aa<Je&&(Je=aa,he=!0)),Qn.isClosed&&(qr=vi,Rr=Xi,n0(Pe,Fe,qr,Rr,vt,bt,re,oe,xe)&&(Qn=t0(vt,bt,xe,Je,b),Qn<Je&&(Je=Qn,he=!0)))}}z=x-a,ee=E-y,re=Math.sqrt(z*z+ee*ee),re!==0&&(z/=re,ee/=re),b.x-=z*ge,b.y-=ee*ge,Ie.free(xe)}else Ke("Unknown Geometry type: "+ue.type);return he?(this.transform.Ga(b),!0):!1};function t0(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 n0(a,y,x,E,b,z,ee,re,oe){if(Re.$(a,x)&&Re.$(y,E)||Re.$(b,ee)&&Re.$(z,re))return!1;var ue=!1,he=(b-ee)*(y-E)-(z-re)*(a-x);return he===0?!1:(oe.x=((b*re-z*ee)*(a-x)-(b-ee)*(a*E-y*x))/he,oe.y=((b*re-z*ee)*(y-E)-(z-re)*(a*E-y*x))/he,(a>x?a-x:x-a)<(y>E?y-E:E-y)?(a=y<E?y:E,y=y<E?E:y,(oe.y>a||Re.$(oe.y,a))&&(oe.y<y||Re.$(oe.y,y))&&(ue=!0)):(y=a<x?a:x,a=a<x?x:a,(oe.x>y||Re.$(oe.x,y))&&(oe.x<a||Re.$(oe.x,a))&&(ue=!0)),ue)}be.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=Ie.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)))),Ie.free(z),b},be.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=gt.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var ee=Ie.alloc();if(ee.h(E,z),x.Ga(ee),this.gh(ee,!0)||(ee.h(b,z),x.Ga(ee),this.gh(ee,!0))||(ee.h(E,a),x.Ga(ee),this.gh(ee,!0))||(ee.h(b,a),x.Ga(ee),this.gh(ee,!0)))return Ie.free(ee),!0;var re=Ie.alloc(),oe=Ie.alloc();return x.set(y),x.bv(this.transform),x.Vj(),re.x=b,re.y=z,re.transform(x),ee.x=E,ee.y=z,ee.transform(x),y=!1,Tf(this,ee,re,oe)?y=!0:(ee.x=b,ee.y=a,ee.transform(x),Tf(this,ee,re,oe)?y=!0:(re.x=E,re.y=a,re.transform(x),Tf(this,ee,re,oe)?y=!0:(ee.x=E,ee.y=z,ee.transform(x),Tf(this,ee,re,oe)&&(y=!0)))),Ie.free(ee),gt.free(x),Ie.free(re),Ie.free(oe),y};function Tf(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)}be.tx=function(a,y,x){function E(Je,Ve){for(var ut=Je.length,ft=0;ft<ut;ft+=2)if(Ve.zd(Je[ft],Je[ft+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 ee=y.bounds,re=ee.x,oe=ee.y,ue=ee.x+ee.width;if(ee=ee.y+ee.height,ur(a.x,a.y,re,oe)<=b&&ur(a.x,a.y,ue,oe)<=b&&ur(a.x,a.y,re,ee)<=b&&ur(a.x,a.y,ue,ee)<=b)return!0}if(re=y.startX,oe=y.startY,ue=y.endX,ee=y.endY,y.type===lt.j){if(x=(re-ue)*(a.x-ue)+(oe-ee)*(a.y-ee),pi(a.x,a.y,re,oe,ue,ee)<=(0<=(ue-re)*(a.x-re)+(ee-oe)*(a.y-oe)&&0<=x?b:z))return!0}else{if(y.type===lt.u)return y=!1,x&&(y=pi(a.x,a.y,re,oe,re,ee)<=b||pi(a.x,a.y,re,oe,ue,oe)<=b||pi(a.x,a.y,ue,oe,ue,ee)<=b||pi(a.x,a.y,re,ee,ue,ee)<=b),y;if(y.type===lt.F){y=a.x-(re+ue)/2,z=a.y-(oe+ee)/2;var he=Math.abs(ue-re)/2,ge=Math.abs(ee-oe)/2;if(he===0||ge===0)return pi(a.x,a.y,re,oe,ue,ee)<=b;if(x){if(a=Re.$y(he,ge,y,z),a*a<=b)return!0}else return!(ur(y,z,-he,0)>=b||ur(y,z,0,-ge)>=b||ur(y,z,0,ge)>=b||ur(y,z,he,0)>=b)}else if(y.type===lt.o){if(ue=y.bounds,z=ue.x,re=ue.y,oe=ue.x+ue.width,ue=ue.y+ue.height,a.x>oe&&a.x<z&&a.y>ue&&a.y<re&&pi(a.x,a.y,z,re,z,ue)>b&&pi(a.x,a.y,z,re,oe,re)>b&&pi(a.x,a.y,oe,ue,z,ue)>b&&pi(a.x,a.y,oe,ue,oe,re)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?Un(y,a.x,a.y,z):pr(y,a,z,!0,!1))return!0}else{for(x=y.figures,y=0;y<x.count;y++){if(z=x.s[y],ee=z.startX,he=z.startY,a.zd(ee,he)>b)return!1;for(re=z.segments.s,oe=re.length,ue=0;ue<oe;ue++)switch(ge=re[ue],ge.type){case Si:case Pi:if(ee=ge.endX,he=ge.endY,a.zd(ee,he)>b)return!1;break;case Jr:var xe=gi();if(Re.Qe(ee,he,ge.point1X,ge.point1Y,ge.point2X,ge.point2Y,ge.endX,ge.endY,.8,xe),ee=E(xe,a),Ii(xe),ee||(ee=ge.endX,he=ge.endY,a.zd(ee,he)>b))return!1;break;case Ur:if(xe=gi(),Re.ep(ee,he,ge.point1X,ge.point1Y,ge.endX,ge.endY,.8,xe),ee=E(xe,a),Ii(xe),ee||(ee=ge.endX,he=ge.endY,a.zd(ee,he)>b))return!1;break;case Nr:case Lo:xe=ge.type===Nr?Eo(ge,z):Wi(ge,z,ee,he);var Pe=xe.length;if(Pe===0){if(ee=ge.type===Nr?ge.centerX:ge.endX,he=ge.type===Nr?ge.centerY:ge.endY,a.zd(ee,he)>b)return!1;break}ge=null;for(var Fe=gi(),Ne=0;Ne<Pe;Ne++)if(ge=xe[Ne],Fe.length=0,Re.Qe(ge[0],ge[1],ge[2],ge[3],ge[4],ge[5],ge[6],ge[7],.8,Fe),E(Fe,a))return Ii(Fe),!1;Ii(Fe),ge!==null&&(ee=ge[6],he=ge[7]);break;default:Ke("Unknown Segment type: "+ge.type)}}return!0}}}return!1},be.qc=function(){this.ua=null},be.kq=function(){return this.ig};function v1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=tm,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=ko):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new Zi(1-ko.x,ko.y)))}lo.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Yh[a.toArrow];else a.fromArrow!=="None"?E=Yh[a.fromArrow]:(E=Re.Ze[a.figure],typeof E=="string"&&(E=Re.Ze[E]),E===void 0&&Ke("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=Re.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function y1(a){var y=Yh[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Yh[x],y===void 0){var E=null,b;for(b in Re.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=lt.parse(Re.um[E],!1),Yh[E]=a,x!==E&&(Yh[x]=E),E}}return typeof y=="string"?y:y instanceof lt?a:null}At.Object.defineProperties(lo.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),ve(this)&&(a=this.part,a!==null&&ja(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=lt.parse(a);var y=a.normalize();this.geometry=a,this.position=a=Ie.allocAt(-y.x,-y.y),Ie.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&&Tc(a,"Shape.fill"),a instanceof $o&&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&&Tc(a,"Shape.stroke"),a instanceof $o&&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 _n(a,"value >= 0",lo,"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"?_n(a,'"butt", "round", or "square"',lo,"strokeCap"):(Df(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"?_n(a,'"miter", "bevel", or "round"',lo,"strokeJoin"):(Df(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){Df(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)||Ke("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&&(Df(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=Re.Ze[a];typeof x=="function"?x=a:(x=Re.Ze[a.toLowerCase()])||Ke("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=y1(a);x===null?Ke("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Vr),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),v1(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=y1(a);x===null?Ke("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Vr),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),v1(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:ar},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),Df(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:ar},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),Df(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&&(Df(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:$r},set:function(a){var y=this.geometryStretch;y!==a&&(Df(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 Xh),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Xu(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 Xh),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 Xh),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 Xh),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),lo.prototype.intersectsRect=lo.prototype.Yc,lo.prototype.containedInRect=lo.prototype.fh,lo.prototype.getNearestIntersectionPoint=lo.prototype.rs,lo.prototype.getDocumentBounds=lo.prototype.mi,lo.prototype.getDocumentPoint=lo.prototype.ga;var Yh=new er,Iv=new er;lo.className="Shape",lo.getFigureGenerators=function(){var a=new Gt,y;for(y in Re.Ze)y!==y.toLowerCase()&&a.add(y,Re.Ze[y]);return a.freeze(),a},lo.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=Re.Ze;E[a]=y,E[x]=a},lo.getArrowheadGeometries=function(){var a=new Gt;for(E in Re.um)if(Yh[E]===void 0){var y=lt.parse(Re.um[E],!1);Yh[E]=y,y=E.toLowerCase(),y!==E&&(Yh[y]=E)}for(var x in Yh)if(x!==x.toLowerCase()){var E=Yh[x];E instanceof lt&&a.add(x,E)}return a.freeze(),a},lo.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=lt.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||Ke("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Yh;E[a]=x,E[y]=a};function _v(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=$r,this.gg=this.fg=ar}_v.prototype.copy=function(){var a=new _v;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 Ia(a,y){return Ft.call(this),s0||(Dl=Ja?new Xs(null).context:null,s0=!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}_t(Ia,Ft),Ia.prototype.cloneProtected=function(a){Ft.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 Ah(a){a.da===null?a.da=new Wv:a.da.nc&&(a.da=a.da.copy())}be=Ia.prototype,be.th=function(){Ft.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function x1(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}be.qb=function(a){a.classType===Ia?this.wrap=a:Ft.prototype.qb.call(this,a)},be.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},be.v=function(){Ft.prototype.v.call(this)},be.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,ee=Yp(this),re=a.textAlign=this.textAlign,oe=y.tn;re==="start"?re=oe?"right":"left":re==="end"&&(re=oe?"left":"right"),oe=this.isUnderline;var ue=this.isStrikethrough;Qa(this,a,this.xc,!0,!1,x,E),(oe||ue)&&Qa(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var he=this.oe,ge=he.dx-(ee*he.m21+he.dx);he=he.dy-(ee*he.m22+he.dy);var xe=y.scale;switch(8>(ge*ge+he*he)*xe*xe&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof da&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ge=this.spacingBelow,this.flip){case zo:a.translate(b,0),a.scale(-1,1);break;case co:a.translate(0,z),a.scale(1,-1);break;case va:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),he=this.Gc,xe=(y+ee+ge)*he,z>xe&&(E=this.verticalAlignment,E=E.y*z-E.y*xe+E.offsetY),he===1&&this.ze!==null)ge=this.Cb,ge>b&&(ge=b),this.Oj(this.ze,a,0,E+y,b,ee,ge,x,re,oe,ue);else if(this.Qc!==null&&this.Qb!==null)for(xe=0;xe<he;xe++){var Pe=this.Qc[xe];Pe>b&&(Pe=b),E+=y,this.Oj(this.Qb[xe],a,0,E,b,ee,Pe,x,re,oe,ue),E+=ee+ge}switch(this.flip){case zo:a.scale(-1,1),a.translate(-b,0);break;case co:a.scale(1,-1),a.translate(0,-z);break;case va:a.scale(-1,-1),a.translate(-b,-z)}}},be.Oj=function(a,y,x,E,b,z,ee,re,oe,ue,he){var ge=0;if(re)oe==="left"?ge=0:oe==="right"?ge=b-ee:oe==="center"&&(ge=(b-ee)/2),y.fillRect(x+ge,E+.25*z,ee,1);else{if(oe==="left"?ge=0:oe==="right"?ge=b:oe==="center"&&(ge=b/2),b=i0!==null?i0(this,z):.75*z,y.fillText(a,x+ge,E+b),a=z/20|0,a===0&&(a=1),oe==="right"?ge-=ee:oe==="center"&&(ge-=ee/2),ue){re=r0!==null?r0(this,z):.8*z,oe=x+ge,ue=E+re,b=x+ge+ee,re=E+re;var xe=a;y.beginPath(),y.lineWidth=xe,y.moveTo(oe,ue),y.lineTo(b,re),y.stroke(),y.Se(),y instanceof da&&y.ad.classList.add("gojs-td")}he&&(he=E+z-z/2.2|0,a%2!==0&&(he+=.5),E=x+ge,z=he,x=x+ge+ee,ee=he,ge=a,y.beginPath(),y.lineWidth=ge,y.moveTo(E,z),y.lineTo(x,ee),y.stroke(),y.Se(),y instanceof da&&y.ad.classList.add("gojs-td"))}},be.kk=function(a,y,x){if(!Ft.prototype.kk.call(this,a,y,x))return!1;if(Qa(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++)Nl(a,y[x],!1)}else y=this.svg,y.innerHTML=this.text,Nl(a,y,!0);return!0},be.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:Ft.prototype.nk.call(this,a)},be.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)}},be.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Dl!==null&&F1!==z&&(F1=Dl.font=z),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var ee;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 re=ee=0,oe=!1;!oe;){var ue=z.indexOf(`
|
|
`,re);ue===-1&&(ue=z.length,oe=!0),re=z.substr(re,ue-re),this.formatting===Xp&&(re=re.trim()),ee=Math.max(ee,$u(re)),re=ue+1}z=ee}else ee=z.indexOf(`
|
|
`,0),0<=ee&&(z=z.substr(0,ee)),z=$u(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)),ee=w1(this,z),isNaN(this.desiredSize.height)?ee=Math.min(ee,y/this.scale):ee=this.desiredSize.height,oe=ee,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===o0&&(y=this.Ae,y=this.overflow===o0?S1(y):0,ue=this.spacingAbove+this.spacingBelow,ue=Math.max(0,Yp(this)+ue),oe=Math.min(this.maxLines-1,Math.max(Math.floor(oe/ue+.01)-1,0)),!(oe+1>=this.Qb.length))){for(this.l|=16777216,ue=this.Qb[oe],y=Math.max(1,a-y);$u(ue)>y&&1<ue.length;)ue=ue.substr(0,ue.length-1);ue+=Jp,y=$u(ue),this.Qb[oe]=ue,this.Qb=this.Qb.slice(0,oe+1),this.Qc[oe]=y,this.Qc=this.Qc.slice(0,oe+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),ee=Math.max(E,ee),Ho(this.dc,z,ee),this.Ge(0,0,z,ee),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},be.eh=function(a,y,x,E){ol(this,a,y,x,E)};function Up(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 Ov(a,y,x,E){var b=a.formatting===Xp;b&&(y=y.trim());var z=0,ee=a.Ae,re=a.spacingAbove+a.spacingBelow;re=Math.max(0,Yp(a)+re);var oe=a.overflow===o0?S1(ee):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,re);else if(ee=y,a.wrap===Rv){a.Le=1;var ue=$u(y);if(oe===0||ue<=x)a.Cb=Math.max(a.Cb,ue),Up(a,y,a.Cb),E!==null&&E.h(ue,re);else{for(z=up(a,ee),ee=ee.substr(z.length),y=up(a,ee),ue=$u(z+y);0<y.length&&ue<=x;)z+=y,ee=ee.substr(y.length),y=up(a,ee),ue=z+y,b&&(ue=ue.trim()),ue=$u(ue);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-oe);$u(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=Jp;var he=$u(z);a.Cb=he,Up(a,z,he),E!==null&&E.h(he,re)}}else{for(oe=0,ee.length===0&&(oe=1,Up(a,ee,0));0<ee.length;){for(y=up(a,ee),ee=ee.substr(y.length);$u(y)>x;){var ge=1;for(ue=$u(y.substr(0,ge)),he=0;ue<=x;)ge++,he=ue,ue=$u(y.substr(0,ge));if(ge===1){var xe=ue;z=Math.max(z,ue)}else xe=he,z=Math.max(z,he);if(ge--,1>ge&&(ge=1),Up(a,y.substr(0,ge),xe),oe++,y=y.substr(ge),a.Gc+oe>a.maxLines)break}for(he=up(a,ee),ue=$u(y+he);0<he.length&&ue<=x;)y+=he,ee=ee.substr(he.length),he=up(a,ee),ue=y+he,b&&(ue=ue.trim()),ue=$u(ue);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),he.length===0?(ge=ue,z=Math.max(z,ue)):(ge=he=$u(y),z=Math.max(z,he)),Up(a,y,ge),oe++,a.Gc+oe>a.maxLines))break}a.Le=Math.min(a.maxLines,oe),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,re*a.Le)}}function up(a,y){if(a.wrap===E1)return y.substr(0,1);for(var x=y.length,E=0,b=xS;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 $u(a){return Dl===null?8*a.length:Dl.measureText(a).width}function Yp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Dl===null){var x=16;return a.df=x}return Zv[y]!==void 0&&5e3>b1?x=Zv[y]:(x=1.3*Dl.measureText("M").width,Zv[y]=x,b1++),a.df=x}function S1(a){if(Dl===null)return 6;if(a0[a]!==void 0&&5e3>Gv)var y=a0[a];else y=Dl.measureText(Jp).width,a0[a]=y,Gv++;return y}function w1(a,y){var x=a.ec.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,Yp(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,ee,re=!1;!re;){if(ee=x.indexOf(`
|
|
`,z),ee===-1&&(ee=x.length,re=!0),z<=ee){if(z=x.substr(z,ee-z),a.wrap!==Rv){a.Le=0;var oe=Pn.alloc();Ov(a,z,y,oe),b+=oe.height,Pn.free(oe),a.Gc+=a.Le}else Ov(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(re=!0)}z=ee+1}return a.Lq=b}At.Object.defineProperties(Ia.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"||(Ah(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:Mn},set:function(a){var y=this.flip;y!==a&&(Ah(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Ma},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Ah(this),this.da.Yr=a,ul(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=Pn.alloc();Ov(this,this.ec,999999,a);var y=a.width;Pn.free(a),a=w1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),Ho(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:jv},set:function(a){var y=this.wrap;y!==a&&(Ah(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:zv},set:function(a){var y=this.overflow;y!==a&&(Ah(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&&Tc(a,"TextBlock.stroke"),a instanceof $o&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return Yp(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&&(Ah(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&&(Ah(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 Xh),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 Xh),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 Xh),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 Xh),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 Xh),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&&(Ah(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&&(Ah(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&&(Ah(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&&(Ah(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:Xp},set:function(a){var y=this.formatting;y!==a&&(Ah(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&&_n(a,"> 0",Ia,"maxLines"),Ah(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 i0=null,r0=null,Rv=new yn(Ia,"None",0),P1=new yn(Ia,"WrapFit",1),jv=new yn(Ia,"WrapDesiredSize",2),E1=new yn(Ia,"WrapBreakAll",3),zv=new yn(Ia,"OverflowClip",0),o0=new yn(Ia,"OverflowEllipsis",1),Xp=new yn(Ia,"FormatTrim",0),C1=new yn(Ia,"FormatNone",0),xS=/[ \u200b\u00ad]/,Zv=new er,b1=0,a0=new er,Gv=0,Jp="...",F1="",Dl=null,s0=!1;Ia.className="TextBlock";function Wv(){this.nc=!1,this.Hd=null,this.Xf=Mn,this.gq=Xp,this.Jq=1/0,this.$q=zv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Ma,this.$r=jv}Wv.prototype.copy=function(){var a=new Wv;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},Ia.getEllipsis=function(){return Jp},Ia.setEllipsis=function(a){Jp=a,a0=new er,Gv=0},Ia.getBaseline=function(){return i0},Ia.setBaseline=function(a){i0=a},Ia.getUnderline=function(){return r0},Ia.setUnderline=function(a){r0=a},Ia.isValidFont=function(a){if(s0||(Dl=Ja?new Xs(null).context:null,s0=!0),Dl===null)return!0;var y=Dl.font;if(a===y||a==="10px sans-serif")return!0;Dl.font="10px sans-serif",Dl.font=a;var x=Dl.font;if(x!=="10px sans-serif")return Dl.font=y,!0;Dl.font="19px serif";var E=Dl.font;return Dl.font=a,x=Dl.font,Dl.font=y,x!==E},Ia.FormatNone=C1,Ia.FormatTrim=Xp,Ia.None=Rv,Ia.OverflowClip=zv,Ia.OverflowEllipsis=o0,Ia.WrapBreakAll=E1,Ia.WrapDesiredSize=jv,Ia.WrapFit=P1;function Xh(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Xh.prototype.copy=function(){var a=new Xh;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Xh.className="GradElementSettings";function Tl(a,y){Ft.call(this),this.Eg=null,this.qo="",this.Xg=ps,this.Nk=zn,this.Zg=this.Hd=null,this.Mk=Hr,this.Xf=Mn,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 hp;_t(Tl,Ft),Tl.prototype.cloneProtected=function(a){Ft.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},Tl.prototype.qb=function(a){a===Mn||a===qi||a===No?this.imageStretch=a:Ft.prototype.qb.call(this,a)},Tl.prototype.toString=function(){return"Picture("+this.source+")#"+br(this)};function dp(a){a===void 0&&(a=""),a!==""?hp[a]&&(delete hp[a],l0--):(hp=new er,l0=0)}function L1(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")||"",ee=b.Og.I(z);if(ee!==null)for(var re=ee.length,oe=0;oe<re;oe++)z=ee[oe],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()||(qe(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")||"",ee=b.Og.I(z);if(ee!==null){b=ee.length,z=gi();for(var re=0;re<b;re++)z.push(ee[re]);if(y.hn)for(re=0;re<b;re++)ee=z[re],ee.Hd!==null&&ee.Hd(ee,x);Ii(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Tl.prototype.hA=function(){if(this.source!==""){dp(this.source);var a=this.source;this.source="",this.source=a}},Tl.prototype.redraw=function(){this.N(),this.Uc=!0},Tl.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 gh)){var b=a instanceof da;E=this.naturalBounds;var z=0,ee=0,re=this.qn,oe=re?+x.width:x.naturalWidth;if(re=re?+x.height:x.naturalHeight,oe===void 0&&x.videoWidth&&(oe=x.videoWidth),re===void 0&&x.videoHeight&&(re=x.videoHeight),oe=oe||E.width,re=re||E.height,oe!==0&&re!==0){var ue=oe,he=re;this.sourceRect.w()&&(z=this.Xg.x,ee=this.Xg.y,oe=this.Xg.width,re=this.Xg.height);var ge=oe,xe=re,Pe=this.Nk,Fe=this.Mk;switch(Pe){case Mn:if(this.sourceRect.w())break;ge>=E.width&&(z=z+Fe.offsetX+(ge*Fe.x-E.width*Fe.x)),xe>=E.height&&(ee=ee+Fe.offsetY+(xe*Fe.y-E.height*Fe.y)),oe=Math.min(E.width,ge),re=Math.min(E.height,xe);break;case zn:ge=E.width,xe=E.height;break;case qi:case No:Pe===qi?(Pe=Math.min(E.height/xe,E.width/ge),ge*=Pe,xe*=Pe):Pe===No&&(Pe=Math.max(E.height/xe,E.width/ge),ge*=Pe,xe*=Pe,ge>=E.width&&(z=(z+Fe.offsetX+(ge*Fe.x-E.width*Fe.x)/ge)*oe),xe>=E.height&&(ee=(ee+Fe.offsetY+(xe*Fe.y-E.height*Fe.y)/xe)*re),oe*=1/(ge/E.width),re*=1/(xe/E.height),ge=E.width,xe=E.height)}Pe=this.Df()*y.scale;var Ne=ge*Pe*xe*Pe,Je=oe*re/Ne,Ve=x.__goCache;Pe=null;var ut=SS;if(!b){if(x.sq&&Ve!==void 0&&4<Ne&&Je>ut*ut)for(Ve.gi===null&&(M1(Ve,4,ue,he,x),M1(Ve,16,ue,he,x)),b=Ve.gi,ue=b.length,he=0;he<ue&&b[he].ratio*b[he].ratio<Je;he++)Pe=b[he];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new Xs(null).context;try{b.drawImage(this.Eg,0,0)}catch(ft){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(ft){this.vl=!0}}if(this.vl)return}}switch(b=ge<E.width?Fe.offsetX+(E.width*Fe.x-ge*Fe.x):0,Fe=xe<E.height?Fe.offsetY+(E.height*Fe.y-xe*Fe.y):0,this.flip){case zo:a.translate(Math.min(E.width,ge),0),a.scale(-1,1);break;case co:a.translate(0,Math.min(E.height,xe)),a.scale(1,-1);break;case va:a.translate(Math.min(E.width,ge),Math.min(E.height,xe)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&Ve!==void 0&&Pe!==null&&Pe.ratio!==1){a.save(),y=Pe.ratio;try{a.drawImage(Pe.source,z/y,ee/y,Math.min(Pe.source.width,oe/y),Math.min(Pe.source.height,re/y),b,Fe,Math.min(E.width,ge),Math.min(E.height,xe)),a instanceof da&&(this.bt=[z/y,ee/y,Math.min(Pe.source.width,oe/y),Math.min(Pe.source.height,re/y),b,Fe,Math.min(E.width,ge),Math.min(E.height,xe)])}catch(ft){this.en=!1}a.restore()}else try{a.drawImage(x,z,ee,oe,re,b,Fe,Math.min(E.width,ge),Math.min(E.height,xe)),a instanceof da&&(this.bt=[z,ee,oe,re,b,Fe,Math.min(E.width,ge),Math.min(E.height,xe)])}catch(ft){this.en=!1}switch(this.flip){case zo:a.scale(-1,1),a.translate(-Math.min(E.width,ge),0);break;case co:a.scale(1,-1),a.translate(0,-Math.min(E.height,xe));break;case va:a.scale(-1,-1),a.translate(-Math.min(E.width,ge),-Math.min(E.height,xe))}}}}},Tl.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=gl(this,!0),ee=this.Eg,re=this.qn,oe=0,ue=0;(re||!this.al&&ee&&ee.complete)&&(this.al=!0),ee===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(oe=re?+ee.width:ee.naturalWidth,ue=re?+ee.height:ee.naturalHeight),isFinite(b.width)||z===zn||z===cr?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:ee!==null&&(a=oe)),x=0):ee!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:oe),isFinite(b.height)||z===zn||z===Br?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:ee!==null&&(y=ue)),E=0):ee!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:ue),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),ee===null||ee.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),Ho(this.dc,a,y),this.Ge(0,0,a,y)},Tl.prototype.eh=function(a,y,x,E){ol(this,a,y,x,E)},At.Object.defineProperties(Tl.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||Ke("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&lg(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new Tn),E!==null&&x&&md(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()||(qe(this,!1),this.v())):x&&L1(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=hp;if(Ja){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<l0&&(dp(),x=hp),E=Dr("img"),E.hn=!0,L1(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,l0++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new B1),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}}}),Tl.prototype.redraw=Tl.prototype.redraw,Tl.prototype.reloadSource=Tl.prototype.hA;var l0=0,SS=4;Tl.className="Picture",hp=new er,Tl.clearCache=dp;function B1(){this.gi=null}function M1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new Xs(null),ee=z.context,re=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new k1(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),ee.setTransform(re*x,0,0,re*x,0,0),ee.yc(),ee.drawImage(b,0,0),a.gi.push(y))}B1.className="PictureCacheArray";function k1(a,y){this.source=a,this.ratio=y}k1.className="PictureCacheInstance";function cp(){this.os=new lt,this.mc=null}cp.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new lt,this.mc=null};function fp(a,y,x,E,b,z){a.mc=new Zr,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 wS(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}cp.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new Er(Si);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},cp.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new Er(Pi);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function $d(a,y,x,E,b,z,ee){var re;re===void 0&&(re=!1);var oe=new Er(Jr);oe.point1X=y,oe.point1Y=x,oe.point2X=E,oe.point2Y=b,oe.endX=z,oe.endY=ee,re&&oe.close(),a.mc.segments.add(oe)}function u0(a,y,x,E,b){var z;z===void 0&&(z=!1);var ee=new Er(Ur);ee.point1X=y,ee.point1Y=x,ee.endX=E,ee.endY=b,z&&ee.close(),a.mc.segments.add(ee)}cp.prototype.arcTo=function(a,y,x,E,b,z,ee){z===void 0&&(z=0),ee===void 0&&(ee=!1);var re=new Er(Nr);re.startAngle=a,re.sweepAngle=y,re.centerX=x,re.centerY=E,re.radiusX=b,re.radiusY=z!==0?z:b,ee&&re.close(),this.mc.segments.add(re)};function PS(a,y,x,E,b,z,ee,re){var oe;oe===void 0&&(oe=!1),y=new Er(Lo,ee,re,y,x,E,b,z),oe&&y.close(),a.mc.segments.add(y)}function A1(a){var y=h0;return y!==null?(h0=null,y.reset(a),y):(y=new cp,y.reset(a),y)}var h0=null;cp.className="StreamGeometryContext";function hl(a,y){var x=a.toLowerCase(),E=Re.Ze;E[a]=y,E[x]=a}hl("Rectangle",function(a,y,x){a="r"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new lt(lt.u),E.endX=y,E.endY=x,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),hl("Square",function(a,y,x){a="s"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new lt(lt.u),E.endX=y,E.endY=x,E.defaultStretch=qi,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),hl("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=Re.Mf[E];if(b!==void 0)return b;var z=a*Re.wg;return b=new lt().add(new Zr(a,0,!0).add(new Er(Pi,y-a,0)).add(new Er(Jr,y,a,y-z,0,y,z)).add(new Er(Pi,y,x-a)).add(new Er(Jr,y-a,x,y,x-z,y-z,x)).add(new Er(Pi,a,x)).add(new Er(Jr,0,x-a,z,x,0,x-z)).add(new Er(Pi,0,a)).add(new Er(Jr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new Zi(0,0,z,z),b.spot2=new Zi(1,1,-z,-z)),Re.Nf<Re.vm&&(Re.Mf[E]=b,Re.Nf++),b}),hl("Border","RoundedRectangle"),hl("Ellipse",function(a,y,x){a="e"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new lt(lt.F),E.endX=y,E.endY=x,E.spot1=Fa,E.spot2=sa,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),hl("Circle",function(a,y,x){a="c"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new lt(lt.F),E.endX=y,E.endY=x,E.spot1=Fa,E.spot2=sa,E.defaultStretch=qi,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),hl("TriangleRight",function(a,y,x){return new lt().add(new Zr(0,0).add(new Er(Pi,y,.5*x)).add(new Er(Pi,0,x).close())).pm(0,.25,.5,.75)}),hl("TriangleDown",function(a,y,x){return new lt().add(new Zr(0,0).add(new Er(Pi,y,0)).add(new Er(Pi,.5*y,x).close())).pm(.25,0,.75,.5)}),hl("TriangleLeft",function(a,y,x){return new lt().add(new Zr(y,x).add(new Er(Pi,0,.5*x)).add(new Er(Pi,y,0).close())).pm(.5,.25,1,.75)}),hl("TriangleUp",function(a,y,x){return new lt().add(new Zr(y,x).add(new Er(Pi,0,x)).add(new Er(Pi,.5*y,0).close())).pm(.25,.5,.75,1)}),hl("Triangle","TriangleUp"),hl("Diamond",function(a,y,x){return new lt().add(new Zr(.5*y,0).add(new Er(Pi,0,.5*x)).add(new Er(Pi,.5*y,x)).add(new Er(Pi,y,.5*x).close())).pm(.25,.25,.75,.75)}),hl("LineH",function(a,y,x){return a=new lt(lt.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),hl("LineV",function(a,y,x){return a=new lt(lt.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),hl("None","Rectangle"),hl("BarH","Rectangle"),hl("BarV","Rectangle"),hl("MinusLine","LineH"),hl("PlusLine",function(a,y,x){return new lt().add(new Zr(0,x/2,!1).add(new Er(Pi,y,x/2)).add(new Er(Si,y/2,0)).add(new Er(Pi,y/2,x)))}),hl("XLine",function(a,y,x){return new lt().add(new Zr(0,x,!1).add(new Er(Pi,y,0)).add(new Er(Si,0,0)).add(new Er(Pi,y,x)))}),hl("LineRight",function(a,y,x){return new lt().add(new Zr(.25*y,0,!1).add(new Er(Pi,.75*y,.5*x)).add(new Er(Pi,.25*y,x)))}),hl("LineDown",function(a,y,x){return new lt().add(new Zr(0,.25*x,!1).add(new Er(Pi,.5*y,.75*x)).add(new Er(Pi,y,.25*x)))}),hl("LineLeft",function(a,y,x){return new lt().add(new Zr(.75*y,0,!1).add(new Er(Pi,.25*y,.5*x)).add(new Er(Pi,.75*y,x)))}),hl("LineUp",function(a,y,x){return new lt().add(new Zr(0,.75*x,!1).add(new Er(Pi,.5*y,.25*x)).add(new Er(Pi,y,.75*x)))}),Re.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 Hv(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=Qo,this.ir=null,this.jr="",this.lr=ar,this.Gq="",this.Hq=Po,this.Pq=hi,this.Kq=_i,this.Up=null,this.Cq=127,this.zr=Yi,this.yr="gray",this.Vg=4}Hv.prototype.copy=function(){var a=new Hv;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 mr(a,y){a===void 0||a instanceof ws||typeof a=="string"?Vn.call(this,a):(Vn.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 Ie(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Wt,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}_t(mr,Vn),mr.prototype.cloneProtected=function(a){Vn.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},be=mr.prototype,be.Af=function(a){Vn.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},be.toString=function(){var a=Fi(this.constructor)+"#"+br(this);return this.data!==null&&(a+="("+Cr(this.data)+")"),a};function Il(a){a.P===null?a.P=new Hv:a.P.nc&&(a.P=a.P.copy())}be.th=function(){Vn.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},be.gk=function(a,y,x,E,b,z,ee){var re=this.diagram;re!==null&&(a===Zo&&y==="elements"?b instanceof Vn?Nf(b,function(oe){vy(re.partManager,oe),Kd(re,oe)}):md(re,b):a===ha&&y==="elements"&&(b instanceof Vn?Nf(b,function(oe){yy(re.partManager,oe,re)}):lg(re,b)),re.cb(a,y,x,E,b,z,ee))},be.La=function(a){if(Vn.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 Vn&&Nf(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},mr.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},mr.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},mr.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 Gt),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)))}}},mr.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)}},mr.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=gi();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);Ii(y)}},mr.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()}e:{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 to?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof ta))break e;zu(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=Vn.Link),x.adornedObject=y)}if(x!==null){x.type===Vn.Link&&x.v(),this.bh("Selection",x);break e}}this.Jf("Selection")}for(ES(this,a),y=this.adornments;y.next();)y.value.La()}},mr.prototype.Wb=function(){var a=this.diagram;a!==null&&(a.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Vv(a){a.G&16384&&(a.updateAdornments(),a.G&=-16385)}function ES(a,y){y.toolManager.mouseDownTools.each(function(x){x.isEnabled&&x.updateAdornments(a)}),y.toolManager.updateAdornments(a)}function d0(a){if(Oc(a)===!1){Uv(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function N1(a){if(a.G|=2097152,Oc(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||I1(a,y,x),x=a.Ib;var E=Wt.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),Wt.free(E),Uv(a,!1)}}mr.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new gt);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},mr.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Hr;this.locationSpot.sb()&&(z=this.locationSpot);var ee=Ie.alloc();if(this.locationObject!==this)for(y=this.locationObject,x=y.naturalBounds,ee.yi(x.x,x.y,x.width,x.height,z),y.Lb!==null&&y.Lb.Ga(ee),ee.offset(-y.measuredBounds.x,-y.measuredBounds.y),z=y.panel;z!==null&&z!==this;)z.Lb!==null&&z.Lb.Ga(ee),ee.offset(-z.measuredBounds.x,-z.measuredBounds.y),z=z.panel;else ee.yi(y,x,E,b,z);a.rotate(this.Kb,ee.x,ee.y),Ie.free(ee)}},mr.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},mr.prototype.moveTo=function(a,y,x){a=Ie.allocAt(a,y),this.move(a,x),Ie.free(a)},mr.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())},mr.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())},mr.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new Gt),y.I(a)!==null)return y.I(a);var x=Vn.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function qd(a,y,x,E){E===void 0&&(E=new Ie),x=x.Mc()?Hr: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}mr.prototype.mi=function(a){return a===void 0&&(a=new Wt),a.assign(this.actualBounds)},mr.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function D1(a){var y=Ie.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof lo?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 If(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=h1(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 ee=a.shadowBlur;return a=a.shadowOffset,z+=ee,y+=ee,E-=ee/2,b-=ee/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}mr.prototype.arrange=function(){if(mt(this)===!1)N1(this);else{wt(this,!1);var a=this.Ib,y=Wt.alloc();y.assign(a);var x=Rc(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;I1(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()||Re.B(y.width,a.width)&&Re.B(y.height,a.height)||0<=this.vw&&this.C(16),Wt.free(y),Uv(this,!1)}},be=mr.prototype,be.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=Wt.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),Wt.free(b)}!(this.G&65536)&&a.D(y)||R1(this,E,x),x.N(),!a.w()&&!y.w()||bo(a,y)||(this instanceof Ci&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},be.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&T1(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 Ie(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),Oc(this)===!1&&mt(this)===!1&&(d0(this),N1(this)),!0};function T1(a,y,x,E,b){y===null||a instanceof ta||(y=y.animationManager,y.zb&&cf(y,a,new Ie(E,b),x))}be.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;Oc(this)||mt(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)}d0(this)},be.Av=function(){this.G&=-2097153,d0(this)};function I1(a,y,x){var E=D1(a),b=a.diagram,z=x.w(),ee=y.w();z&&ee?a.G&2097152?_1(a,y,x,b,E):O1(a,y,x,b,E):z?_1(a,y,x,b,E):ee&&O1(a,y,x,b,E),a.G|=2097152,Ie.free(E),a.Uk()}function _1(a,y,x,E,b){var z=y.x,ee=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 ta||cf(x,a,new Ie(z,ee),y),E||y.x===z&&y.y===ee||a.g("position",new Ie(z,ee),y.copy()))}function O1(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){Yv(a,!1),a instanceof Ci&&yd(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?Rc(a)?(ga(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}be.si=function(){return!0},be.Zc=function(){return!0},be.ph=function(){return!1},be.Dd=function(){return!0};function Kv(a,y,x,E){y.constructor===a.constructor||Z1||(Z1=!0,ci('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),ci(" Old class: "+Fi(a.constructor)+", new class: "+Fi(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,ee=a.isHighlighted,re=!0,oe=!0,ue=!1;a instanceof Ci&&(re=a.isTreeLeaf,oe=a.isTreeExpanded,ue=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=ee?a.G|524288:a.G&-524289,a instanceof Ci&&(a.U=re?a.U|4:a.U&-5,a.U=oe?a.U|1:a.U&-2,a.U=ue?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)}mr.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},mr.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},mr.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},mr.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},mr.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},mr.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},mr.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},mr.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},mr.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 Oc(a){return(a.G&32768)!==0}function Uv(a,y){a.G=y?a.G|32768:a.G&-32769}function Yv(a,y){a.G=y?a.G|65536:a.G&-65537}function Rc(a){return(a.G&131072)!==0}be=mr.prototype,be.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function c0(a,y){a.G=y?a.G|1048576:a.G&-1048577}be.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},be.N=function(){var a=this.diagram;a!==null&&!mt(this)&&!Oc(this)&&this.isVisible()&&this.Ib.w()&&a.N(If(this,this.Ib))},be.v=function(){Vn.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof Ci&&this.labeledLink!==null&&ul(this.labeledLink),a.$b(!0))},be.Vo=function(a){a||(a=this.Ah,a!==null&&ey(a,this))},be.Wo=function(a){a||(a=this.Ah,a!==null&&ty(a,this))},be.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},be.oz=function(){return Xv(this,this)};function Xv(a,y){var x=y.containingGroup;return x!==null?1+Xv(a,x):y instanceof Ci&&(y=y.labeledLink,y!==null)?Xv(a,y):0}be.sz=function(){return j1(this,this)};function j1(a,y){var x=y.containingGroup;return x!==null||y instanceof Ci&&(x=y.labeledLink,x!==null)?j1(a,x):y}be.Td=function(a){return a instanceof to?Jv(this,this,a):!1};function Jv(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!Jv(a,E,x)?y instanceof Ci&&(y=y.labeledLink,y!==null)?Jv(a,y,x):!1:!0}be.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof to&&c0(y,!0),y instanceof Ci){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 Ci&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof to&&c0(y,!1),y instanceof Ci&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},mr.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof Ci&&this.isLinkLabel)},mr.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 Ci&&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 jc(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof ta)){if(a.add(y),y instanceof Ci){if(x&&y instanceof to)for(var ee=y.memberParts;ee.next();)jc(a,ee.value,x,E,b,z);if(b!==!1)for(ee=y.linksConnected;ee.next();){var re=ee.value;if(!a.contains(re)){var oe=re.fromNode,ue=re.toNode;oe=oe===null||a.contains(oe),ue=ue===null||a.contains(ue),(b?oe&&ue:oe||ue)&&jc(a,re,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)jc(a,y.value,x,E-1,b,z)}else if(y instanceof qn)for(y=y.labelNodes;y.next();)jc(a,y.value,x,E,b,z)}}At.Object.defineProperties(mr.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?so: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(ha,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(Zo,"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&&(Il(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&&yf(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 ta?this.type!==Vn.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:hi},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Il(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:_i},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Il(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&&(Il(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:Po},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),Il(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,mt(this)===!1&&(d0(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)),T1(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 ta)){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 ta?this instanceof ta&&(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&&(zu(x),x=x.copy(),x!==null&&Kv(this,x,y,a))):(z!==null&&z.jm(E,a),x=cx(x.partManager,E,a),x!==null&&(zu(x),x=x.copy(),x===null||x instanceof qn||(E=this.location.copy(),Kv(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){Kv(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&&(Il(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&&(Il(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&&(Il(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 qn?(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&&(Il(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&&(Il(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&&(Il(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:Qo},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Il(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&&(Il(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&&(Il(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:ar},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Il(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&&Ke("Cannot make a Group a member of itself: "+this.toString()),Ke("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?ty(y,this):this instanceof to&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?ey(a,this):this instanceof to&&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 to){for(x=new Tn,jc(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof Ci)for(E=E.linksConnected;E.next();)gp(E.value)}if(this instanceof Ci){for(x=this.linksConnected;x.next();)gp(x.value);x=this.labeledLink,x!==null&&gp(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&yf(y,-1,a))}}else Ke("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&&(Il(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof Ci&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Il(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&&(Il(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:Yi},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Il(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&&(Il(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&&(Il(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),mr.prototype.invalidateLayout=mr.prototype.C,mr.prototype.findCommonContainingGroup=mr.prototype.px,mr.prototype.isMemberOf=mr.prototype.Td,mr.prototype.findTopLevelPart=mr.prototype.sz,mr.prototype.findSubGraphLevel=mr.prototype.oz,mr.prototype.ensureBounds=mr.prototype.Va,mr.prototype.getDocumentBounds=mr.prototype.mi,mr.prototype.findObject=mr.prototype.fb,mr.prototype.moveTo=mr.prototype.moveTo,mr.prototype.invalidateAdornments=mr.prototype.Wb,mr.prototype.clearAdornments=mr.prototype.Ej,mr.prototype.removeAdornment=mr.prototype.Jf,mr.prototype.addAdornment=mr.prototype.bh,mr.prototype.findAdornment=mr.prototype.Pj,mr.prototype.updateTargetBindings=mr.prototype.La;var Z1=!1;mr.className="Part",mr.LayoutNone=0,mr.LayoutAdded=1,mr.LayoutRemoved=2,mr.LayoutShown=4,mr.LayoutHidden=8,mr.LayoutNodeSized=16,mr.LayoutGroupLayout=32,mr.LayoutNodeReplaced=64,mr.LayoutStandard=127,mr.LayoutAll=16777215;function ta(a,y){a===void 0||a instanceof ws||typeof a=="string"?mr.call(this,a):(mr.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)}_t(ta,mr),ta.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},ta.prototype.updateRelationshipsFromData=function(){},ta.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof qn&&y instanceof lo){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 lo&&(b.ua=a)}}},ta.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!mt(a))},ta.prototype.Zc=function(){return!1},ta.prototype.gk=function(a,y,x,E,b,z,ee){if(a===Zo&&y==="elements"){if(b instanceof Sl)this.$a===null&&(this.$a=b);else if(b instanceof Vn){var re=b.Nl(function(oe){return oe instanceof Sl});re instanceof Sl&&this.$a===null&&(this.$a=re)}}else a===ha&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Vn&&this.$a.rg(E)&&(this.$a=null));mr.prototype.gk.call(this,a,y,x,E,b,z,ee)},ta.prototype.updateAdornments=function(){},ta.prototype.Lj=function(){},At.Object.defineProperties(ta.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}}}),ta.className="Adornment";function Qv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=Ya,this.er=p0,this.Kr=this.ij=this.Nq=this.Mq=null}Qv.prototype.copy=function(){var a=new Qv;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 Ci(a,y){a===void 0||a instanceof ws||typeof a=="string"?mr.call(this,a):(mr.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new Nn,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}_t(Ci,mr),Ci.prototype.cloneProtected=function(a){mr.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},be=Ci.prototype,be.Af=function(a){mr.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function ec(a){a.Ba===null?a.Ba=new Qv:a.Ba.nc&&(a.Ba=a.Ba.copy())}be.th=function(){mr.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function G1(a,y){y!==null&&(a.af===null&&(a.af=new Tn),a.af.add(y))}function W1(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}be.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=W1(this,a,y,x),a!==null&&a.Sl()},be.gk=function(a,y,x,E,b,z,ee){a===Zo&&y==="elements"?this.wc=null:a===ha&&y==="elements"&&(this.wc=null),mr.prototype.gk.call(this,a,y,x,E,b,z,ee)},be.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||(tu(x.fromPort),tu(x.toPort),x.bb())}};function H1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&(tu(x.fromPort),tu(x.toPort),x.bb())}}function tu(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||tu(y.port)}}be.si=function(){return!0},Ci.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},Ci.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},Ci.prototype.isVisible=function(){if(!mr.prototype.isVisible.call(this))return!1;var a=!0,y=Bh,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Bh){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===os){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===wd&&(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},Ci.prototype.Zb=function(a){mr.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)}},Ci.prototype.qx=function(){var a=new Tn,y=new Tn;return V1(this,this,a,y),y.iterator};function V1(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(ee){ee.isTreeLink?(b?ee.fromNode===y:ee.toNode===y)&&V1(a,b?ee.toNode:ee.fromNode,x,E):E.add(ee)})}}Ci.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new po(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},be=Ci.prototype,be.Mo=function(a){a===void 0&&(a=null);var y=new po(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},be.Sd=function(a){a===void 0&&(a=null);var y=new po(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},be.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 Tn,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 Tn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new vo(x):so},be.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 Tn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new vo(x):so},be.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 Tn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new vo(x):so},be.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new po(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},be.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new po(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 f0(a,y,x){tu(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,ee=a.diagram;ee!==null&&(z=ee.aa,ee.aa=!0),b(a,y,x),ee!==null&&(ee.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 g0(a,y,x){tu(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 ee=!0;b!==null&&(ee=b.aa,b.aa=!0),z(a,y,x),b!==null&&(b.aa=ee)}}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)):Qp(y)))}function Qp(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}}}Ci.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},be=Ci.prototype,be.Vo=function(a){mr.prototype.Vo.call(this,a),a||(Qp(this),a=this.Yk,a!==null&&ex(a,this))},be.Wo=function(a){mr.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},be.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,mr.prototype.Lj.call(this)},be.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;K1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function K1(a){a.wc===null?a.wc=new Gt:a.wc.clear(),a.qm(a,function(y,x){U1(y,x)}),a.wc.count===0&&a.wc.add("",a)}function U1(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function $v(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=gi()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);Ii(x)}}}be.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},be.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}},be.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)c0(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;)c0(y,!1),y=y.pg();return x},be.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},be.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof Ci)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},be.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 Tn;return a(this,y),y},be.uz=function(){return Y1(this,this)};function Y1(a,y){return y=y.pg(),y===null?0:1+Y1(a,y)}be.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new po(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},be.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 Nn,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 Nn,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new vo(x):so},be.wz=function(a){a===void 0&&(a=1/0);var y=new Tn;return jc(y,this,!1,a,!0),y},Ci.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 Tn;x.add(this),X1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Bh),y.Ue=!1}};function X1(a,y,x,E,b,z,ee){if(1<E)for(var re=x?a.Mo():a.Sd();re.next();){var oe=re.value;oe.isTreeLink&&(oe=oe.To(a),oe===null||oe===a||y.contains(oe)||(y.add(oe),X1(oe,y,x,E-1,b,z,ee)))}else J1(a,y,x,b,z,ee)}function J1(a,y,x,E,b,z){for(var ee=b===a?!0:a.isTreeExpanded,re=x?a.Mo():a.Sd(),oe={};re.next();){var ue=re.value;if(ue.isTreeLink&&(ue=ue.To(a),ue!==null&&ue!==a)){var he=y.contains(ue);if(he||y.add(ue),ee){var ge=x?ue.Oo():ue.Po();oe.uv=a,ge.all(function(xe){return function(Pe){return Pe===xe.uv||!Pe.isTreeExpanded}}(oe))&&E.Aj(ue,b),ue.oh(),ue.Zb(!1)}ue.isTreeExpanded&&(ue.wasTreeExpanded=ue.isTreeExpanded,he||J1(ue,y,x,E,b,z))}oe={uv:oe.uv}}a.isTreeExpanded=!1}Ci.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 Tn;x.add(this),Q1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Bh),y.Ue=!1}};function Q1(a,y,x,E,b,z,ee){for(var re=z===a?!1:a.isTreeExpanded,oe=x?a.Mo():a.Sd(),ue={};oe.next();){var he=oe.value;if(he.isTreeLink&&(re||he.fd||he.bb(),he=he.To(a),he!==null&&he!==a&&!y.contains(he))){if(y.add(he),!re){he.Zb(!0),he.oh();var ge=x?he.Oo():he.Po();ue.vv=a,ge.all(function(xe){return function(Pe){return Pe===xe.vv||!Pe.isTreeExpanded}}(ue))&&b.Cj(he,z)}(2<E||he.wasTreeExpanded)&&(he.wasTreeExpanded=!1,Q1(he,y,x,E-1,b,z,ee))}ue={vv:ue.vv}}a.isTreeExpanded=!0}At.Object.defineProperties(Ci.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:p0},set:function(a){var y=this.portSpreading;y!==a&&(ec(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&&yd(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:Ya},set:function(a){typeof a=="number"&&(a=new Kr(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),ec(this),this.Ba.yp=a;var x=this.diagram;x!==null&&yd(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&&(ec(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&&(ec(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&&(ec(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 ee=z.wa(E);ee!==void 0&&z.Qx(b,ee)}}this.containingGroup=null}this.Yk=a,a!==null&&(ex(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),ul(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&K1(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&&(ec(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))}}}),Ci.prototype.expandTree=Ci.prototype.expandTree,Ci.prototype.collapseTree=Ci.prototype.collapseTree,Ci.prototype.findTreeParts=Ci.prototype.wz,Ci.prototype.findTreeChildrenNodes=Ci.prototype.Ou,Ci.prototype.findTreeChildrenLinks=Ci.prototype.Qo,Ci.prototype.findTreeLevel=Ci.prototype.uz,Ci.prototype.findTreeParentChain=Ci.prototype.vz,Ci.prototype.findTreeParentNode=Ci.prototype.pg,Ci.prototype.findTreeParentLink=Ci.prototype.kh,Ci.prototype.findCommonTreeParent=Ci.prototype.gz,Ci.prototype.findTreeRoot=Ci.prototype.xz,Ci.prototype.isInTreeOf=Ci.prototype.Nz,Ci.prototype.findPort=Ci.prototype.ns,Ci.prototype.findLinksTo=Ci.prototype.kz,Ci.prototype.findLinksBetween=Ci.prototype.jz,Ci.prototype.findNodesInto=Ci.prototype.Oo,Ci.prototype.findNodesOutOf=Ci.prototype.Po,Ci.prototype.findNodesConnected=Ci.prototype.Mu,Ci.prototype.findLinksInto=Ci.prototype.Sd,Ci.prototype.findLinksOutOf=Ci.prototype.Mo,Ci.prototype.findExternalTreeLinksConnected=Ci.prototype.qx,Ci.prototype.invalidateConnectedLinks=Ci.prototype.Bd,Ci.prototype.invalidateLinkBundle=Ci.prototype.Lz;var CS=new yn(Ci,"SpreadingNone",10),p0=new yn(Ci,"SpreadingEvenly",11),qv=new yn(Ci,"SpreadingPacked",12);Ci.className="Node",Ci.SpreadingNone=CS,Ci.SpreadingEvenly=p0,Ci.SpreadingPacked=qv;function to(a,y){a===void 0||a instanceof ws||typeof a=="string"?Ci.call(this,a):(Ci.call(this),a&&(y=a)),this.U|=4608,this.Gn=new Tn,this.$a=null,this.Sc=new Va,this.Sc.group=this,this.gl=new Tn,this.tb=this.$p=null,y&&Object.assign(this,y)}_t(to,Ci),to.prototype.cloneProtected=function(a){Ci.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof Sl});y instanceof Sl?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())},be=to.prototype,be.Af=function(a){Ci.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 Ci)x.Bd(y);else if(x instanceof qn)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},be.gk=function(a,y,x,E,b,z,ee){if(a===Zo&&y==="elements"){if(b instanceof Sl)this.$a===null?this.$a=b:this.$a!==b&&Ke("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof Vn){var re=b.Nl(function(oe){return oe instanceof Sl});re instanceof Sl&&(this.$a===null?this.$a=re:this.$a!==re&&Ke("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===ha&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Vn&&this.$a.rg(E)&&(this.$a=null));Ci.prototype.gk.call(this,a,y,x,E,b,z,ee)},be.Xl=function(a,y){Ci.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==Vn.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof Vn&&(a=a.Pb()),this.tb===null&&(this.tb=new Wt),a.mi(this.tb),a instanceof lo&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},be.eh=function(a,y,x,E){this.nf=this.$a,Ci.prototype.eh.call(this,a,y,x,E)},be.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof qn||y.Va()}),Ci.prototype.Va.call(this)},be.si=function(){if(!Ci.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof Ci){if(y.isVisible()&&mt(y))return!1}else if(y instanceof qn&&y.isVisible()&&mt(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function ey(a,y){if(a.Gn.add(y)){y instanceof to&&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 qn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function ty(a,y){if(a.Gn.remove(y)){y instanceof to&&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 qn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}be.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)}Ci.prototype.Lj.call(this)},to.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=an(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},to.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=an(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},to.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))},be=to.prototype,be.Bd=function(a){var y=(this.U&65536)!==0;if(Ci.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()?(tu(x.fromPort),tu(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&(tu(x.fromPort),tu(x.toPort),x.bb()))}}},be.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 Tn,E=y.iterator;E.next();){var b=E.value;if(b instanceof Ci)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},be.iz=function(){var a=this.Rj();a.add(this);for(var y=new Tn,x=a.iterator;x.next();){var E=x.value;if(E instanceof Ci)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},be.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new Tn;return a(this,y),y},be.Rj=function(){var a=new Tn;return jc(a,this,!0,0,!0),a.remove(this),a},be.Zb=function(a){Ci.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},to.prototype.collapseSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();$1(this,y,a,this),a.Ue=!1}};function $1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!1),z instanceof to&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,$1(z,y,x,E)),z instanceof Ci)z.Bd(y),x.Aj(z,E);else if(z instanceof qn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}to.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 to&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,q1(z,y,x,E)),z instanceof Ci)z.Bd(y),x.Cj(z,E);else if(z instanceof qn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}to.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=Ie.alloc(),Ci.prototype.move.call(this,a,y),a=new Tn,y=this.Rj().iterator;y.next();)b=y.value,b instanceof qn&&(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 Ci&&b.isLinkLabel)){var ee=b.position,re=b.location;ee.w()?(z.x=ee.x+E,z.y=ee.y+x,b.position=z):re.w()&&(z.x=re.x+E,z.y=re.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof qn&&(b.suspendsRouting=a.contains(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(ee=b.position,z.x=ee.x+E,z.y=ee.y+x,z.w()?b.move(z):b.bb(),iy(b)&&b.bb());Ie.free(z)}},At.Object.defineProperties(to.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&&Ke("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&&(ec(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&&(ec(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&&(ec(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&&(ec(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)}}}),to.prototype.expandSubGraph=to.prototype.expandSubGraph,to.prototype.collapseSubGraph=to.prototype.collapseSubGraph,to.prototype.findSubGraphParts=to.prototype.Rj,to.prototype.findContainingGroupChain=to.prototype.hz,to.prototype.findExternalNodesConnected=to.prototype.iz,to.prototype.findExternalLinksConnected=to.prototype.Lu,to.prototype.ensureBounds=to.prototype.Va,to.className="Group";function Sl(a){Ft.call(this),this.yb=ss,this.ko=new Wt(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}_t(Sl,Ft),Sl.prototype.cloneProtected=function(a){Ft.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},Sl.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return Fo(0,0,y.width,y.height,a.x,a.y)},Sl.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof to||a instanceof ta)||Ke("Placeholder is not inside a Group or Adornment."),a instanceof to){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(Ho(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=Ie.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),Ie.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 ee=0;z instanceof lo&&(ee=z.strokeWidth);var re=z.Df(),oe=z.naturalBounds,ue=(oe.width+ee)*re;ee=(oe.height+ee)*re,a.type!==Vn.Link&&(re=z.ga(a.category==="Selection"?Po:a.locationSpot,Ie.alloc()),a.location=re,Ie.free(re)),isNaN(ue)||isNaN(ee)?(a=z.ga(Po,Ie.alloc()),ue=Wt.allocAt(a.x,a.y,0,0),ue.Ye(z.ga(Zt,a)),ue.Ye(z.ga(ea,a)),ue.Ye(z.ga(is,a)),Ho(y,ue.width+E||0,ue.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),Ie.free(a),Wt.free(ue)):(Ho(y,ue+E||0,ee+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},Sl.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},Sl.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof to&&!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=Wt.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof to&&!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)),Wt.free(x),E&&y instanceof to&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},Sl.prototype.computeMemberBounds=function(a){if(!(this.part instanceof to))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,ee=y.memberParts;ee.next();){var re=ee.value;if(re.isVisible()){if(re instanceof qn&&(!y.computesBoundsIncludingLinks||tt(re)||re.fromNode===y||re.toNode===y))continue;re=re.actualBounds,re.left<x&&(x=re.left),re.top<E&&(E=re.top),re.right>b&&(b=re.right),re.bottom>z&&(z=re.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},At.Object.defineProperties(Sl.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new Kr(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),Sl.className="Placeholder";function qn(a){mr.call(this,Vn.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=wl,this.Om=0,this.Qm=wl,this.Rm=NaN,this.qj=ay,this.po=.5,this.wd=null,this.Nb=new Nn().freeze(),this.Tg=this.Mg=null,this.ml=new Wt,this.ua=new lt,this.u=this.o=this.Sf=this.Wf=null,this.su=new Ie,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}_t(qn,mr),qn.prototype.cloneProtected=function(a){mr.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())},be=qn.prototype,be.Af=function(a){mr.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&&tu(y),a=a.toPort,a!==null&&tu(a)},be.qb=function(a){a.classType===qn?(a.value&2)===2?this.routing=a:a===vu||a===nc||a===mp?this.curve=a:a===em||a===w0||a===P0?this.adjusting=a:a!==ay&&a!==wl&&Ke("Unknown Link enum value for a Link property: "+a):mr.prototype.qb.call(this,a)},be.Xc=function(){this.ba===null&&(this.ba=new ao)},be.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),mt(a)||Oc(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),mt(a)||Oc(a)))},be.zv=function(){return!1},be.Av=function(){},be.Zc=function(){return!1},qn.prototype.computeAngle=function(a,y,x){return qn.computeAngle(y,x)},qn.computeAngle=function(a,y){switch(a){default:case wl:a=0;break;case tm:a=y;break;case nm:a=y+90;break;case im:a=y-90;break;case sy:a=y+180;break;case E0:a=Re.bp(y),90<a&&270>a&&(a-=180);break;case rm:a=Re.bp(y+90),90<a&&270>a&&(a-=180);break;case om:a=Re.bp(y-90),90<a&&270>a&&(a-=180);break;case C0:if(a=Re.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return Re.bp(a)};function gp(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&&ty(x,a),a.Ah=y,y!==null&&ey(y,a);var b=a.containingGroupChanged;if(b!==null){var z=!0,ee=a.diagram;ee!==null&&(z=ee.aa,ee.aa=!0),b(a,x,y),ee!==null&&(ee.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}be=qn.prototype,be.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&mr.prototype.oh.call(this)},be.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},be.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function ex(a,y){a.wd===null&&(a.wd=new Tn),a.wd.add(y),a.v()}be.Vo=function(a){if(mr.prototype.Vo.call(this,a),_f(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,f0(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||f0(x,this,E)}$p(this)}},be.Wo=function(a){if(mr.prototype.Wo.call(this,a),_f(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,g0(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||g0(x,this,E)}qp(this)}},be.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))},qn.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},qn.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?mr.prototype.move.call(this,a,!1):(a=Ie.allocAt(x.x+E,x.y+b),mr.prototype.move.call(this,a,!1),Ie.free(a)),tc(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},qn.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},qn.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},qn.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(Ti),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()===vu))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()===vu){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return Re.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),Re.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 ee=this.flattenedLengths;for(x=this.flattenedTotalLength,b=z=E=0;E<x/2&&z<y&&(b=ee[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},qn.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()===vu))return this.ua.wx(.5);if(this.computeCurve()===vu&&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),Re.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)},be=qn.prototype,be.i=function(a){return this.Nb.s[a]},be.dd=function(a,y){this.Nb.cd(a,y)},be.L=function(a,y,x){this.Nb.cd(a,new Ie(y,x))},be.Kz=function(a,y){this.Nb.Gb(a,y)},be.m=function(a,y,x){this.Nb.Gb(a,new Ie(y,x))},be.ne=function(a){this.Nb.add(a)},be.yf=function(a,y){this.Nb.add(new Ie(a,y))},be.pv=function(a){this.Nb.mb(a)},be.Fj=function(){this.Nb.clear()};function tc(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 Nn,z=a.Nb.iterator;z.next();){var ee=z.value;b.add(new Ie(ee.x+y,ee.y+x).freeze())}b.freeze(),z=a.Nb,a.Nb=b,ee=a.diagram,isNaN(y)||isNaN(x)||ee!==null&&ee.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),ul(a)),E?m0(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),ee!==null&&ee.animationManager.zb&&pf(ee.animationManager,a,b),a.g("points",z,b)}}be.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},be.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,ee=0;ee<z;ee++){var re=b[ee];x=Math.min(re.x,x),E=Math.min(re.y,E)}re=ee=1/0;for(var oe=y.s,ue=oe.length,he=0;he<ue;he++){var ge=oe[he];ee=Math.min(ge.x,ee),re=Math.min(ge.y,re),ge.freeze()}if(y.freeze(),ue===z){for(z=0;z<ue;z++)if(he=b[z],ge=oe[z],he.x-x!==ge.x-ee||he.y-E!==ge.y-re){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&pf(x.animationManager,this,y),m0(this),this.g("points",a,y)}},be.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function m0(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),S0(a,!1))}be.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())}},be.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()}}},qn.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(Fg||(Fg=new Ci,Fg.desiredSize=hr,Fg.Va()),this.defaultFromPoint&&(Fg.location=this.defaultFromPoint,Fg.Va(),y=a=Fg)):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?(Lg||(Lg=new Ci,Lg.desiredSize=hr,Lg.Va()),this.defaultToPoint&&(Lg.location=this.defaultToPoint,Lg.Va(),b=E=Lg)):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,ee=this.computeSpot(!0,y);x=this.computeSpot(!1,b);var re=pp(ee),oe=pp(x),ue=y===b&&y!==null,he=this.isOrthogonal,ge=this.curve===vu;this.Wf=ue&&!he?ge=!0:!1;var xe=this.computeAdjusting()===wl||ue;if(!he&&!ue&&re&&oe){if(re=!1,!xe&&3<=z&&(xe=this.getLinkPoint(a,y,ee,!0,!1,E,b),oe=this.getLinkPoint(E,b,x,!1,!1,a,y),re=this.adjustPoints(0,xe,z-1,oe))&&(xe=this.getLinkPoint(a,y,ee,!0,!1,E,b),oe=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,xe,z-1,oe)),!re)if(this.Fj(),ge){z=this.getLinkPoint(a,y,ee,!0,!1,E,b),xe=this.getLinkPoint(E,b,x,!1,!1,a,y),re=xe.x-z.x,oe=xe.y-z.y,ue=this.computeCurviness(),ge=he=0;var Pe=z.x+re/3,Fe=z.y+oe/3,Ne=Pe,Je=Fe;Re.B(oe,0)?Je=0<re?Je-ue:Je+ue:(he=-re/oe,ge=Math.sqrt(ue*ue/(he*he+1)),0>ue&&(ge=-ge),Ne=(0>oe?-1:1)*ge+Pe,Je=he*(Ne-Pe)+Fe),Pe=z.x+2*re/3,Fe=z.y+2*oe/3;var Ve=Pe,ut=Fe;Re.B(oe,0)?ut=0<re?ut-ue:ut+ue:(Ve=(0>oe?-1:1)*ge+Pe,ut=he*(Ve-Pe)+Fe),this.Fj(),this.ne(z),this.yf(Ne,Je),this.yf(Ve,ut),this.ne(xe),this.dd(0,this.getLinkPoint(a,y,ee,!0,!1,E,b)),this.dd(3,this.getLinkPoint(E,b,x,!1,!1,a,y))}else z=E,xe=b,E=this.getLinkPoint(a,y,ee,!0,!1,z,xe),b=this.getLinkPoint(z,xe,x,!1,!1,a,y),this.hasCurviness()?(xe=b.x-E.x,x=b.y-E.y,ee=this.computeCurviness(),a=E.x+xe/2,y=E.y+x/2,z=a,re=y,Re.B(x,0)?re=0<xe?re-ee:re+ee:(xe=-xe/x,z=Math.sqrt(ee*ee/(xe*xe+1)),0>ee&&(z=-z),z=(0>x?-1:1)*z+a,re=xe*(z-a)+y),this.ne(E),this.yf(z,re),this.ne(b)):(this.ne(E),this.ne(b),re=Wt.alloc(),y.mi(re),oe=re.ca(b),xe.mi(re),ue=re.ca(E),(oe||ue)&&(ee=y.ga(y0(ee),new Ie),this.dd(0,this.getLinkPointFromPoint(a,y,ee,b,!0,ee)),x=xe.ga(y0(x),new Ie),this.dd(1,this.getLinkPointFromPoint(z,xe,x,E,!1,x))),Wt.free(re))}else{ge=this.isAvoiding,xe&&(he&&ge||ue)&&this.Fj();var ft=ue?this.computeCurviness():0;ge=this.getLinkPoint(a,y,ee,!0,he,E,b),Pe=Ne=Fe=0,(he||!re||ue)&&(Je=this.computeEndSegmentLength(a,y,ee,!0),Pe=this.getLinkDirection(a,y,ge,ee,!0,he,E,b),ue&&(re||ee.D(x)||!he&&ee.x+x.x===1&&ee.y+x.y===1)&&(Pe-=he?90:30,0>ft&&(Pe-=180)),0>Pe?Pe+=360:360<=Pe&&(Pe-=360),ue&&(Je+=Math.abs(ft)*(he?1:2)),Pe===0?Fe=Je:Pe===90?Ne=Je:Pe===180?Fe=-Je:Pe===270?Ne=-Je:(Fe=Je*Math.cos(Pe*Math.PI/180),Ne=Je*Math.sin(Pe*Math.PI/180)),ee.Mc()&&ue&&(Je=y.ga(Hr,Ie.alloc()),Ve=Ie.allocAt(Je.x+1e3*Fe,Je.y+1e3*Ne),this.getLinkPointFromPoint(a,y,Je,Ve,!0,ge),Ie.free(Je),Ie.free(Ve))),Je=this.getLinkPoint(E,b,x,!1,he,a,y);var vt=ut=Ve=0;if(he||!oe||ue){var bt=this.computeEndSegmentLength(E,b,x,!1);vt=this.getLinkDirection(E,b,Je,x,!1,he,a,y),ue&&(oe||ee.D(x)||!he&&ee.x+x.x===1&&ee.y+x.y===1)&&(vt+=he?0:30,0>ft&&(vt+=180)),0>vt?vt+=360:360<=vt&&(vt-=360),ue&&(bt+=Math.abs(ft)*(he?1:2)),vt===0?Ve=bt:vt===90?ut=bt:vt===180?Ve=-bt:vt===270?ut=-bt:(Ve=bt*Math.cos(vt*Math.PI/180),ut=bt*Math.sin(vt*Math.PI/180)),x.Mc()&&ue&&(x=b.ga(Hr,Ie.alloc()),ee=Ie.allocAt(x.x+1e3*Ve,x.y+1e3*ut),this.getLinkPointFromPoint(E,b,x,ee,!1,Je),Ie.free(x),Ie.free(ee))}x=ge,(he||!re||ue)&&(x=new Ie(ge.x+Fe,ge.y+Ne)),ee=Je,(he||!oe||ue)&&(ee=new Ie(Je.x+Ve,Je.y+ut)),!xe&&!he&&re&&3<z&&this.adjustPoints(0,ge,z-2,ee)?this.dd(z-1,Je):!xe&&!he&&oe&&3<z&&this.adjustPoints(1,x,z-1,Je)?this.dd(0,ge):!xe&&(he?6<=z:4<z)&&this.adjustPoints(1,x,z-2,ee)?(this.dd(0,ge),this.dd(z-1,Je)):(this.Fj(),this.ne(ge),(he||!re||ue)&&this.ne(x),he&&this.addOrthoPoints(x,Pe,ee,vt,a,E),(he||!oe||ue)&&this.ne(ee),this.ne(Je))}return!0};function ny(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}qn.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new Ie),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 ee=x.x;x=x.y}else{a=b.oe,b=1/(a.m11*a.m22-a.m12*a.m21),ee=a.m22*b;var re=-a.m12*b,oe=-a.m21*b,ue=a.m11*b,he=b*(a.m21*a.dy-a.m22*a.dx),ge=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*ee+E.y*oe+he,E=E.x*re+E.y*ue+ge,ee=x.x*ee+x.y*oe+he,x=x.x*re+x.y*ue+ge}return y.Sj(b,E,ee,x,z),a!==null&&z.transform(a),z};function v0(a,y){var x=y.Zn;return x===null&&(x=new Bg,x.port=y,x.node=y.part,y.Zn=x),lx(x,a)}qn.prototype.getLinkPoint=function(a,y,x,E,b,z,ee,re){if(re===void 0&&(re=new Ie),x.sb()&&!pp(x))return y.ga(x,re),re;if(x.$c()){var oe=v0(this,y);if(oe!==null){if(re.assign(oe.Zo),b&&this.routing===nx){var ue=v0(this,ee);if(ue!==null&&oe.Gl<ue.Gl){oe=Ie.alloc(),ue=Ie.alloc();var he=new Wt(y.ga(Po,oe),y.ga(Zt,ue)),ge=this.computeSpot(!E,ee);a=this.getLinkPoint(z,ee,ge,!E,b,a,y,ue),(x.Hf(zi)||x.Hf(Ei))&&a.y>=he.y&&a.y<=he.y+he.height?re.y=a.y:(x.Hf(bn)||x.Hf(Mi))&&a.x>=he.x&&a.x<=he.x+he.width&&(re.x=a.x),Ie.free(oe),Ie.free(ue)}}return re}}return x=y.ga(y0(x),Ie.alloc()),this.pointsCount>(b?6:2)?(ee=E?this.i(1):this.i(this.pointsCount-2),b&&(ee=ny(x,ee.copy()))):(oe=this.computeSpot(!E,ee),z=Ie.alloc(),ee=ee.ga(y0(oe),z),b&&(ee=ny(x,ee)),Ie.free(z)),this.getLinkPointFromPoint(a,y,x,ee,E,re),Ie.free(x),re},qn.prototype.getLinkDirection=function(a,y,x,E,b,z,ee,re){e:if(E.sb())var oe=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()&&(oe=v0(this,y),oe!==null))switch(oe.Nc){case 1:oe=270;break e;case 2:oe=180;break e;default:case 4:oe=0;break e;case 8:oe=90;break e}oe=y.ga(Hr,Ie.alloc()),this.pointsCount>(z?6:2)?(re=b?this.i(1):this.i(this.pointsCount-2),re=z?ny(oe,re.copy()):x):(x=Ie.alloc(),re=re.ga(Hr,x),Ie.free(x)),x=Math.abs(re.x-oe.x)>Math.abs(re.y-oe.y)?re.x>=oe.x?0:180:re.y>=oe.y?90:270,Ie.free(oe),oe=x}return E.Mc()&&ee.Td(a)&&(oe+=180,360<=oe&&(oe-=360)),pp(E)||(a=y.li(),a===0)||(45<=a&&135>a?oe+=90:135<=a&&225>a?oe+=180:225<=a&&315>a&&(oe+=270),360<=oe&&(oe-=360)),oe},qn.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=v0(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)},qn.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=Hr:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===ar?Xr:y)):(a=y||this.toPort,a===null?a=Hr:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===ar?Xr:y)),a};function pp(a){return a===Xr||a.x===.5&&a.y===.5}function y0(a){return a.x===.5&&a.y===.5?a:Hr}qn.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==wl&&4<this.pointsCount?this.computeMidPoint(new Ie):(a=y.Zn,a=a!==null?lx(a,this):null,a!==null?a.Zo:y.ga(Hr))},qn.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},qn.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 ee=z;if(z===void 0&&(ee=gt.alloc(),ee.reset()),ee.multiply(this.transform),this.fh(a,ee))return Fv(this,y,x,b),z===void 0&>.free(ee),!0;if(this.Yc(a,ee)){var re=!1;if(!this.isAtomic)for(var oe=this.O.s,ue=oe.length;ue--;){var he=oe[ue];if(he.visible||he===this.locationObject){var ge=he.actualBounds,xe=this.naturalBounds;if(!(ge.x>xe.width||ge.y>xe.height||0>ge.x+ge.width||0>ge.y+ge.height)){if(ge=gt.alloc(),ge.set(ee),he instanceof Vn)re=he.Cf(a,y,x,E,b,ge);else if(this.path===he){if(he instanceof lo)if(re=a,xe=E,he.pickable===!1)re=!1;else if(ge.multiply(he.transform),xe)e:{var Pe=re,Fe=ge;if(he.fh(Pe,Fe))re=!0;else{if(Fe===void 0&&(Fe=he.transform,Pe.Re(he.actualBounds))){re=!0;break e}re=Pe.left,xe=Pe.right;var Ne=Pe.top;Pe=Pe.bottom;var Je=Ie.alloc(),Ve=Ie.alloc(),ut=Ie.alloc(),ft=gt.alloc();ft.set(Fe),ft.bv(he.transform),ft.Vj(),Ve.x=xe,Ve.y=Ne,Ve.transform(ft),Je.x=re,Je.y=Ne,Je.transform(ft),Fe=!1,Tf(he,Je,Ve,ut)?Fe=!0:(Je.x=xe,Je.y=Pe,Je.transform(ft),Tf(he,Je,Ve,ut)?Fe=!0:(Ve.x=re,Ve.y=Pe,Ve.transform(ft),Tf(he,Je,Ve,ut)?Fe=!0:(Je.x=re,Je.y=Ne,Je.transform(ft),Tf(he,Je,Ve,ut)&&(Fe=!0)))),gt.free(ft),Ie.free(Je),Ie.free(Ve),Ie.free(ut),re=Fe}}else re=he.fh(re,ge)}else re=ys(he,a,E,ge);re&&(xe=he,y!==null&&(xe=y(he)),xe&&(x===null||x(xe))&&b.add(xe)),gt.free(ge)}}}return z===void 0&>.free(ee),re||this.background!==null||this.areaBackground!==null}return z===void 0&>.free(ee),!1},qn.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?vu:this.curve},qn.prototype.computeCorner=function(){if(this.curve===vu)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},qn.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},qn.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=rx;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,ee=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===tm||E===E0||E===sy?a=Math.max(a,b):E===im||E===om||E===nm||E===rm?a=Math.max(a,ee):(y=y.ga(Hr).ab(x.ga(Hr))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*ee)+Math.abs(Math.cos(y)*b)+1)),this.curve===vu&&(a*=1.333)}}return a},qn.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===wl&&x.bb()}},qn.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=ix;var y=this.Sf;if(y!==null){for(var x=gi(),E=0,b=y.links,z=0;z<b.length;z++){var ee=b[z].computeSpacing();x.push(ee),E+=ee}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),Ii(x)}}return a},qn.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},qn.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},qn.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===w0)return!1;b===P0&&(b=em)}switch(b){case w0:var z=this.i(a),ee=this.i(x);if(!z.Xa(y)||!ee.Xa(E)){b=z.x,z=z.y;var re=ee.x-b,oe=ee.y-z,ue=Math.sqrt(re*re+oe*oe);if(!Re.$(ue,0)){if(Re.$(re,0))var he=0>oe?-Math.PI/2:Math.PI/2;else he=Math.atan(oe/Math.abs(re)),0>re&&(he=Math.PI-he);ee=y.x;var ge=y.y;re=E.x-ee;var xe=E.y-ge;for(oe=Math.sqrt(re*re+xe*xe),Re.$(re,0)?xe=0>xe?-Math.PI/2:Math.PI/2:(xe=Math.atan(xe/Math.abs(re)),0>re&&(xe=Math.PI-xe)),ue=oe/ue,he=xe-he,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),re=y.x-b,oe=y.y-z,y=Math.sqrt(re*re+oe*oe),Re.$(y,0)||(Re.$(re,0)?oe=0>oe?-Math.PI/2:Math.PI/2:(oe=Math.atan(oe/Math.abs(re)),0>re&&(oe=Math.PI-oe)),re=oe+he,y*=ue,this.L(a,ee+y*Math.cos(re),ge+y*Math.sin(re)));this.dd(x,E)}}return!0;case P0:if(z=this.i(a),ge=this.i(x),!z.Xa(y)||!ge.Xa(E)){b=z.x,z=z.y,ee=ge.x,ge=ge.y,ue=(ee-b)*(ee-b)+(ge-z)*(ge-z),re=y.x,he=y.y,oe=E.x,xe=E.y;var Pe=1;if(oe-re!==0){var Fe=(xe-he)/(oe-re);Pe=Math.sqrt(1+1/(Fe*Fe))}else Fe=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var Ne=y.x,Je=y.y,Ve=.5;ue!==0&&(Ve=((b-Ne)*(b-ee)+(z-Je)*(z-ge))/ue);var ut=b+Ve*(ee-b),ft=z+Ve*(ge-z);y=Math.sqrt((Ne-ut)*(Ne-ut)+(Je-ft)*(Je-ft)),Je<Fe*(Ne-ut)+ft&&(y=-y),0<Fe&&(y=-y),Ne=re+Ve*(oe-re),Ve=he+Ve*(xe-he),Fe!==0?(y=Ne+y/Pe,this.L(a,y,Ve-(y-Ne)/Fe)):this.L(a,Ne,Ve+y)}this.dd(x,E)}return!0;case em:e:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),ee=this.i(a+2),re=z.x,he=z.y,ge=re,ue=he,Re.B(b.y,z.y)?Re.B(z.x,ee.x)?he=y.y:Re.B(z.y,ee.y)&&(re=y.x):Re.B(b.x,z.x)&&(Re.B(z.y,ee.y)?re=y.x:Re.B(z.x,ee.x)&&(he=y.y)),this.L(a+1,re,he),b=this.i(x),z=this.i(x-1),ee=this.i(x-2),re=z.x,he=z.y,oe=re,xe=he,Re.B(b.y,z.y)?Re.B(z.x,ee.x)?he=E.y:Re.B(z.y,ee.y)&&(re=E.x):Re.B(b.x,z.x)&&(Re.B(z.y,ee.y)?re=E.x:Re.B(z.x,ee.x)&&(he=E.y)),this.L(x-1,re,he),iy(this))){this.L(a+1,ge,ue),this.L(x-1,oe,xe),x=!1;break e}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},qn.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 ee=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 re=b.actualBounds.copy(),oe=z.actualBounds.copy();if(re.w()&&oe.w()){re.Bc(am,am),oe.Bc(am,am),re.Ye(a),oe.Ye(x);var ue=Ie.alloc(),he=Ie.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&oe.right>a.x||E===90&&x.y>a.y&&oe.right>a.x?(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),E===180?(ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),he.x=ue.x,he.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(ue.x=a.x<oe.left?this.computeMidOrthoPosition(a.x,a.y,oe.left,x.y,!1):a.x<oe.right&&(E===270&&a.y<oe.top||E===90&&a.y>oe.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):oe.right,he.x=ue.x,he.y=x.y):E===0&&a.x<oe.left&&a.y>oe.top&&a.y<oe.bottom&&(ue.x=a.x,ue.y=a.y<x.y?Math.min(x.y,oe.top):Math.max(x.y,oe.bottom),he.y=ue.y)):(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<re.top||E===270&&x.y>re.bottom)&&(E===180&&(oe.ca(a)||re.ca(x))?ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?ue.y=this.computeMidOrthoPosition(a.x,re.top,x.x,Math.max(x.y,oe.bottom),!0):x.y>a.y&&(E===180||E===270)&&(ue.y=this.computeMidOrthoPosition(a.x,re.bottom,x.x,Math.min(x.y,oe.top),!0)),he.x=x.x,he.y=ue.y),ue.y>re.top&&ue.y<re.bottom&&(x.x>=re.left&&x.x<=a.x||a.x<=oe.right&&a.x>=x.x?(E===90||E===270)&&(ue.h(Math.max((a.x+x.x)/2,a.x),a.y),he.h(ue.x,x.y)):(ue.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?re.top:Math.min(re.top,oe.top)):Math.max(x.y,E===0?re.bottom:Math.max(re.bottom,oe.bottom)),he.x=x.x,he.y=ue.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&oe.left<a.x||E===90&&x.y>a.y&&oe.left<a.x?(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),E===0?(ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),he.x=ue.x,he.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(ue.x=a.x>oe.right?this.computeMidOrthoPosition(a.x,a.y,oe.right,x.y,!1):a.x>oe.left&&(E===270&&a.y<oe.top||E===90&&a.y>oe.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):oe.left,he.x=ue.x,he.y=x.y):E===180&&a.x>oe.right&&a.y>oe.top&&a.y<oe.bottom&&(ue.x=a.x,ue.y=a.y<x.y?Math.min(x.y,oe.top):Math.max(x.y,oe.bottom),he.y=ue.y)):(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<re.top||E===270&&x.y>re.bottom)&&(E===0&&(oe.ca(a)||re.ca(x))?ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?ue.y=this.computeMidOrthoPosition(a.x,re.top,x.x,Math.max(x.y,oe.bottom),!0):x.y>a.y&&(E===0||E===270)&&(ue.y=this.computeMidOrthoPosition(a.x,re.bottom,x.x,Math.min(x.y,oe.top),!0)),he.x=x.x,he.y=ue.y),ue.y>re.top&&ue.y<re.bottom&&(x.x<=re.right&&x.x>=a.x||a.x>=oe.left&&a.x<=x.x?(E===90||E===270)&&(ue.h(Math.min((a.x+x.x)/2,a.x),a.y),he.h(ue.x,x.y)):(ue.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?re.top:Math.min(re.top,oe.top)):Math.max(x.y,E===180?re.bottom:Math.max(re.bottom,oe.bottom)),he.x=x.x,he.y=ue.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&oe.bottom>a.y||E===0&&x.x>a.x&&oe.bottom>a.y?(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),E===270?(ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),he.x=x.x,he.y=ue.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(ue.y=a.y<oe.top?this.computeMidOrthoPosition(a.x,a.y,x.x,oe.top,!0):a.y<oe.bottom&&(E===180&&a.x<oe.left||E===0&&a.x>oe.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):oe.bottom,he.x=x.x,he.y=ue.y):E===90&&a.y<oe.top&&a.x>oe.left&&a.x<oe.right&&(ue.x=a.x<x.x?Math.min(x.x,oe.left):Math.max(x.x,oe.right),ue.y=a.y,he.x=ue.x)):(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<re.left||E===180&&x.x>re.right)&&(E===270&&(oe.ca(a)||re.ca(x))?ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?ue.x=this.computeMidOrthoPosition(re.left,a.y,Math.max(x.x,oe.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(ue.x=this.computeMidOrthoPosition(re.right,a.y,Math.min(x.x,oe.left),x.y,!1)),he.x=ue.x,he.y=x.y),ue.x>re.left&&ue.x<re.right&&(x.y>=re.top&&x.y<=a.y||a.y<=oe.bottom&&a.y>=x.y?(E===0||E===180)&&(ue.h(a.x,Math.max((a.y+x.y)/2,a.y)),he.h(x.x,ue.y)):(ue.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?re.left:Math.min(re.left,oe.left)):Math.max(x.x,E===90?re.right:Math.max(re.right,oe.right)),he.x=ue.x,he.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&oe.top<a.y||E===0&&x.x>a.x&&oe.top<a.y?(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),E===90?(ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),he.x=x.x,he.y=ue.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(ue.y=a.y>oe.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,oe.bottom,!0):a.y>oe.top&&(E===180&&a.x<oe.left||E===0&&a.x>oe.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):oe.top,he.x=x.x,he.y=ue.y):E===270&&a.y>oe.bottom&&a.x>oe.left&&a.x<oe.right&&(ue.x=a.x<x.x?Math.min(x.x,oe.left):Math.max(x.x,oe.right),ue.y=a.y,he.x=ue.x)):(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<re.left||E===180&&x.x>re.right)&&(E===90&&(oe.ca(a)||re.ca(x))?ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?ue.x=this.computeMidOrthoPosition(re.left,a.y,Math.max(x.x,oe.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(ue.x=this.computeMidOrthoPosition(re.right,a.y,Math.min(x.x,oe.left),x.y,!1)),he.x=ue.x,he.y=x.y),ue.x>re.left&&ue.x<re.right&&(x.y<=re.bottom&&x.y>=a.y||a.y>=oe.top&&a.y<=x.y?(E===0||E===180)&&(ue.h(a.x,Math.min((a.y+x.y)/2,a.y)),he.h(x.x,ue.y)):(ue.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?re.left:Math.min(re.left,oe.left)):Math.max(x.x,E===270?re.right:Math.max(re.right,oe.right)),he.x=ue.x,he.y=x.y)));var ge=x;if(this.isAvoiding){var xe=this.diagram;if(xe===null||b===z||this.layer.isTemporary||!Lf(xe)||re.ca(ge)&&!z.Td(b)||oe.ca(a)&&!b.Td(z))y=!1;else{var Pe=kc(xe,!0,this.containingGroup,null);if(this.segmentIndex!==17&&Pe.Yj(Math.min(a.x,ue.x),Math.min(a.y,ue.y),Math.abs(a.x-ue.x),Math.abs(a.y-ue.y))&&Pe.Yj(Math.min(ue.x,he.x),Math.min(ue.y,he.y),Math.abs(ue.x-he.x),Math.abs(ue.y-he.y))&&Pe.Yj(Math.min(he.x,ge.x),Math.min(he.y,ge.y),Math.abs(he.x-ge.x),Math.abs(he.y-ge.y)))y=!1;else{b=a,z=ge;var Fe=x=null;if(xe.isVirtualized){xe=Pe.bounds.copy(),xe.Bc(-Pe.Ho,-Pe.Go);var Ne=Ie.alloc();vp(Pe,a.x,a.y)||(Re.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,a.x,a.y,ue.x,ue.y,Ne)?(x=a=Ne.copy(),y=Ne.ab(ue)):Re.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,ue.x,ue.y,he.x,he.y,Ne)?(x=a=Ne.copy(),y=Ne.ab(he)):Re.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,he.x,he.y,ge.x,ge.y,Ne)&&(x=a=Ne.copy(),y=Ne.ab(ge))),vp(Pe,ge.x,ge.y)||(Re.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,ge.x,ge.y,he.x,he.y,Ne)?(Fe=ge=Ne.copy(),E=he.ab(Ne)):Re.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,he.x,he.y,ue.x,ue.y,Ne)?(Fe=ge=Ne.copy(),E=ue.ab(Ne)):Re.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,ue.x,ue.y,a.x,a.y,Ne)&&(Fe=ge=Ne.copy(),E=a.ab(Ne))),Ie.free(Ne)}re=re.copy().ed(oe),re.Bc(Pe.Ho*Pe.Os,Pe.Go*Pe.Os),ax(Pe,a,y,ge,E,re,!0),oe=Jh(Pe,ge.x,ge.y),!Pe.abort&&oe>=yp&&(ox(Pe),re.Bc(Pe.Ho*Pe.Hx,Pe.Go*Pe.Ix),ax(Pe,a,y,ge,E,re,!1),oe=Jh(Pe,ge.x,ge.y)),!Pe.abort&&oe<yp&&Jh(Pe,ge.x,ge.y)!==ic?(ry(this,Pe,ge.x,ge.y,E,!0,ee),re=this.i(2),4>this.pointsCount?(y===0||y===180?(re.x=a.x,re.y=ge.y):(re.x=ge.x,re.y=a.y),this.L(2,re.x,re.y),this.m(3,re.x,re.y)):(ee=this.i(3),y===0||y===180?Re.B(re.x,ee.x)?(re=y===0?Math.max(re.x,a.x):Math.min(re.x,a.x),this.L(2,re,a.y),this.L(3,re,ee.y)):Re.B(re.y,ee.y)?(Math.abs(a.y-re.y)<=Pe.Go/2&&(this.L(2,re.x,a.y),this.L(3,ee.x,a.y)),this.m(2,re.x,a.y)):this.L(2,a.x,re.y):(y===90||y===270)&&(Re.B(re.y,ee.y)?(re=y===90?Math.max(re.y,a.y):Math.min(re.y,a.y),this.L(2,a.x,re),this.L(3,ee.x,re)):Re.B(re.x,ee.x)?(Math.abs(a.x-re.x)<=Pe.Ho/2&&(this.L(2,a.x,re.y),this.L(3,a.x,ee.y)),this.m(2,a.x,re.y)):this.L(2,re.x,a.y))),x!==null&&(a=this.i(1),ee=this.i(2),a.x!==ee.x&&a.y!==ee.y?y===0||y===180?this.m(2,a.x,ee.y):this.m(2,ee.x,a.y):y===0||y===180?this.m(2,b.x,x.y):this.m(2,x.x,b.y)),Fe!==null&&(E===0||E===180?this.yf(z.x,Fe.y):this.yf(Fe.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(ue.copy()),this.ne(he.copy())),Ie.free(ue),Ie.free(he)}},qn.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 iy(a){if(a.diagram===null||!a.isAvoiding||!Lf(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=kc(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 ry(a,y,x,E,b,z,ee){var re=y.Ho,oe=y.Go,ue=Jh(y,x,E),he=x,ge=E;for(b===0?he+=re:b===90?ge+=oe:b===180?he-=re:ge-=oe,b!==ee&&ue>Of&&Jh(y,he,ge)!==ue-1&&(Jh(y,x-re,E)===ue-1?(b=180,he=x-re,ge=E):Jh(y,x+re,E)===ue-1?(b=0,he=x+re,ge=E):Jh(y,x,E-oe)===ue-1?(b=270,he=x,ge=E-oe):Jh(y,x,E+oe)===ue-1&&(b=90,he=x,ge=E+oe));ue>Of&&Jh(y,he,ge)===ue-1;)x=he,E=ge,b===0?he+=re:b===90?ge+=oe:b===180?he-=re:ge-=oe,--ue;z?ue>Of&&(b===180||b===0?x=Math.floor(x/re)*re+re/2:(b===90||b===270)&&(E=Math.floor(E/oe)*oe+oe/2)):(x=Math.floor(x/re)*re+re/2,E=Math.floor(E/oe)*oe+oe/2),ue>Of&&(z=b,ee=x,he=E,b===0?(z=90,he+=oe):b===90?(z=180,ee-=re):b===180?(z=270,he-=oe):b===270&&(z=0,ee+=re),Jh(y,ee,he)===ue-1?ry(a,y,ee,he,z,!1,z):(ee=x,he=E,b===0?(z=270,he-=oe):b===90?(z=0,ee+=re):b===180?(z=90,he+=oe):b===270&&(z=180,ee-=re),Jh(y,ee,he)===ue-1&&ry(a,y,ee,he,z,!1,z))),a.yf(x,E)}qn.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=pi(y,a,x.x,x.y,E.x,E.y),z=0,ee=1;ee<this.pointsCount-1;ee++){x=this.i(ee+1);var re=pi(y,a,E.x,E.y,x.x,x.y);E=x,re<b&&(z=ee,b=re)}return z},qn.prototype.qc=function(){this.lk=!1,this.v()},qn.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 lo&&(b.ua=this.ua)}}},qn.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&_f(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 ee=this.computeCurve();if(ee===vu&&3<=y&&!Re.$(this.smoothness,0))if(y===3){var re=this.i(1);E=Math.min(b.x,re.x);var oe=Math.min(b.y,re.y);re=this.i(2),E=Math.min(E,re.x),oe=Math.min(oe,re.y)}else{if(this.isOrthogonal)for(oe=0;oe<y;oe++)re=E[oe],z.x=Math.min(re.x,z.x),z.y=Math.min(re.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),oe=this.i(E),z.x=Math.min(oe.x,z.x),z.y=Math.min(oe.y,z.y);E=z.x,oe=z.y}else{for(oe=0;oe<y;oe++)re=E[oe],z.x=Math.min(re.x,z.x),z.y=Math.min(re.y,z.y);E=z.x,oe=z.y}if(E-=this.su.x,oe-=this.su.y,b.x-=E,b.y-=oe,y!==2||_f(this)){if(a.type=lt.o,re=A1(a),this.computeShortLength(!0)!==0&&(b=Cg(this,b,!0,z)),fp(re,b.x,b.y,!1),ee===vu&&3<=y&&!Re.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-oe,b=this.i(2).copy(),b.x-=E,b.y-=oe,this.computeShortLength(!1)!==0&&(b=Cg(this,b,!1,z)),$d(re,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=Ie.allocAt(E,oe),x=Ie.alloc(),x.assign(this.i(1)),z=Ie.allocAt(E,oe),b=Ie.allocAt(E,oe),ee=this.i(0);for(var ue,he=this.smoothness/3,ge=1;ge<this.pointsCount-1;ge++){ue=this.i(ge);var xe=ee,Pe=ue,Fe=this.i(oy(this,ue,ge,!1));if((!Re.$(xe.x,Pe.x)||!Re.$(Pe.x,Fe.x))&&(!Re.$(xe.y,Pe.y)||!Re.$(Pe.y,Fe.y))){var Ne=he;isNaN(Ne)&&(Ne=this.smoothness/3);var Je=xe.x;xe=xe.y;var Ve=Pe.x;Pe=Pe.y;var ut=Fe.x;Fe=Fe.y;var ft=Ne*x0(Je,xe,Ve,Pe);Ne*=x0(Ve,Pe,ut,Fe),Re.$(xe,Pe)&&Re.$(Ve,ut)&&(Ve>Je?Fe>Pe?(z.x=Ve-ft,z.y=Pe-ft,b.x=Ve+Ne,b.y=Pe+Ne):(z.x=Ve-ft,z.y=Pe+ft,b.x=Ve+Ne,b.y=Pe-Ne):Fe>Pe?(z.x=Ve+ft,z.y=Pe-ft,b.x=Ve-Ne,b.y=Pe+Ne):(z.x=Ve+ft,z.y=Pe+ft,b.x=Ve-Ne,b.y=Pe-Ne)),Re.$(Je,Ve)&&Re.$(Pe,Fe)&&(Pe>xe?(ut>Ve?(z.x=Ve-ft,z.y=Pe-ft,b.x=Ve+Ne):(z.x=Ve+ft,z.y=Pe-ft,b.x=Ve-Ne),b.y=Pe+Ne):(ut>Ve?(z.x=Ve-ft,z.y=Pe+ft,b.x=Ve+Ne):(z.x=Ve+ft,z.y=Pe+ft,b.x=Ve-Ne),b.y=Pe-Ne)),(Re.$(Je,Ve)&&Re.$(Ve,ut)||Re.$(xe,Pe)&&Re.$(Pe,Fe))&&(Je=.5*(Je+ut),xe=.5*(xe+Fe),z.x=Je,z.y=xe,b.x=Je,b.y=xe),(ge===1||ge===2&&Re.$(ee.x,this.i(0).x)&&Re.$(ee.y,this.i(0).y))&&(x.x=.5*(ee.x+ue.x),x.y=.5*(ee.y+ue.y)),$d(re,x.x-E,x.y-oe,z.x-E,z.y-oe,ue.x-E,ue.y-oe),y.set(z),x.set(b),ee=ue}}ue=ee.x,ee=ee.y,he=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(he=Cg(this,he.copy(),!1,ai)),ue=.5*(ue+he.x),ee=.5*(ee+he.y),$d(re,b.x-E,b.y-oe,ue-E,ee-oe,he.x-E,he.y-oe),Ie.free(y),Ie.free(x),Ie.free(z),Ie.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),ee=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(ee=Cg(this,ee.copy(),!1,ai)),$d(re,z.x-E,z.y-oe,b.x-E,b.y-oe,ee.x-E,ee.y-oe);else{for(z=Ie.alloc(),z.assign(this.i(0)),b=Ie.alloc(),b.assign(z),ee=this.computeCorner(),ge=1,ue=0;ge<y;){if(ge=oy(this,z,ge,1<ge),he=this.i(ge),ge>=y-1){if(!z.D(he))this.computeShortLength(!1)!==0&&(he=Cg(this,he.copy(),!1,ai)),bg(this,re,-E,-oe,z,he,x);else if(ue===0)for(ge=1;ge<y;)b.assign(z),he=this.i(ge++),bg(this,re,-E,-oe,z,he,x),z.assign(he);break}if(ue=oy(this,he,ge+1,ge<y-3),ge=-E,Je=-oe,xe=he,Ve=this.i(ue),Ne=x,Re.B(z.y,xe.y)&&Re.B(xe.x,Ve.x))if(Fe=Math.min(ee,Math.abs(xe.x-b.x)/2),Fe=ft=Math.min(Fe,Math.abs(Ve.y-xe.y)/2),Re.B(Fe,0))bg(this,re,ge,Je,z,xe,Ne),z.assign(xe);else{var vt=xe.x,bt=xe.y;Pe=vt,ut=bt,xe.x>z.x?vt=xe.x-Fe:vt=xe.x+Fe,Ve.y>xe.y?ut=xe.y+ft:ut=xe.y-ft,Ve=Ie.allocAt(vt,bt),bg(this,re,ge,Je,z,Ve,Ne),Ie.free(Ve),u0(re,xe.x+ge,xe.y+Je,Pe+ge,ut+Je),z.h(Pe,ut)}else Re.B(z.x,xe.x)&&Re.B(xe.y,Ve.y)?(Fe=Math.min(ee,Math.abs(xe.y-b.y)/2),Fe=ft=Math.min(Fe,Math.abs(Ve.x-xe.x)/2),Re.B(ft,0)?(bg(this,re,ge,Je,z,xe,Ne),z.assign(xe)):(vt=xe.x,bt=xe.y,Pe=vt,ut=bt,xe.y>z.y?bt=xe.y-Fe:bt=xe.y+Fe,Ve.x>xe.x?Pe=xe.x+ft:Pe=xe.x-ft,Ve=Ie.allocAt(vt,bt),bg(this,re,ge,Je,z,Ve,Ne),Ie.free(Ve),u0(re,xe.x+ge,xe.y+Je,Pe+ge,ut+Je),z.h(Pe,ut))):(bg(this,re,ge,Je,z,xe,Ne),z.assign(xe));b.assign(he),ge=ue}Ie.free(z)}h0=re}else re=this.i(1).copy(),re.x-=E,re.y-=oe,this.computeShortLength(!0)!==0&&(b=Cg(this,b,!0,z)),this.computeShortLength(!1)!==0&&(re=Cg(this,re,!1,z)),a.type=lt.j,a.startX=b.x,a.startY=b.y,a.endX=re.x,a.endY=re.y;return this.lk=!0,a};function x0(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),Re.$(a,0)?y:Re.$(y,0)?a:Math.sqrt(a*a+y*y)))}function Cg(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=x0(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=x0(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 oy(a,y,x,E){for(var b=a.pointsCount,z=y;Re.$(y.x,z.x)&&Re.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!Re.$(y.x,z.x)&&!Re.$(y.y,z.y))return x-1;for(var ee=z;Re.$(y.x,z.x)&&Re.$(z.x,ee.x)&&(!E||(y.y>=z.y?z.y>=ee.y:z.y<=ee.y))||Re.$(y.y,z.y)&&Re.$(z.y,ee.y)&&(!E||(y.x>=z.x?z.x>=ee.x:z.x<=ee.x));){if(x>=b)return b-1;ee=a.i(x++)}return x-2}qn.prototype.computeJumpLength=function(){return 10};function bg(a,y,x,E,b,z,ee){if(!ee&&_f(a)){ee=a.computeJumpLength();var re=ee/2,oe=[],ue=0;if(a.isVisible()&&(ue=bS(a,b,z,oe)),0<ue){if(Re.B(b.y,z.y))if(b.x<z.x)for(var he=0;he<ue;){var ge=Math.max(b.x,Math.min(oe[he++]-re,z.x-ee));y.lineTo(ge+x,z.y+E);for(var xe=ge+x,Pe=Math.min(ge+ee,z.x);he<ue&&(ge=oe[he],ge<Pe+ee);)he++,Pe=Math.min(ge+re,z.x);ge=z.y-ee+E,Pe+=x;var Fe=z.y+E;a.curve===nc?fp(y,Pe,Fe,!1):$d(y,xe,ge,Pe,ge,Pe,Fe)}else for(--ue;0<=ue;){for(he=Math.min(b.x,Math.max(oe[ue--]+re,z.x+ee)),y.lineTo(he+x,z.y+E),xe=he+x,ge=Math.max(he-ee,z.x);0<=ue&&(he=oe[ue],he>ge-ee);)ue--,ge=Math.max(he-re,z.x);he=z.y-ee+E,ge+=x,Pe=z.y+E,a.curve===nc?fp(y,ge,Pe,!1):$d(y,xe,he,ge,he,ge,Pe)}else if(Re.B(b.x,z.x))if(b.y<z.y)for(he=0;he<ue;){for(ge=Math.max(b.y,Math.min(oe[he++]-re,z.y-ee)),y.lineTo(z.x+x,ge+E),xe=ge+E,ge=Math.min(ge+ee,z.y);he<ue&&(Pe=oe[he],Pe<ge+ee);)he++,ge=Math.min(Pe+re,z.y);Pe=z.x-ee+x,Fe=z.x+x,ge+=E,a.curve===nc?fp(y,Fe,ge,!1):$d(y,Pe,xe,Pe,ge,Fe,ge)}else for(--ue;0<=ue;){for(he=Math.min(b.y,Math.max(oe[ue--]+re,z.y+ee)),y.lineTo(z.x+x,he+E),xe=he+E,he=Math.max(he-ee,z.y);0<=ue&&(ge=oe[ue],ge>he-ee);)ue--,he=Math.max(ge-re,z.y);ge=z.x-ee+x,Pe=z.x+x,he+=E,a.curve===nc?fp(y,Pe,he,!1):$d(y,ge,xe,ge,he,Pe,he)}}}y.lineTo(z.x+x,z.y+E)}function bS(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 ee=z.length,re=0;re<ee;re++){var oe=z[re];if(oe instanceof qn){if(oe===a)return 0<E.length&&E.sort(function(he,ge){return he-ge}),E.length;if(oe.isVisible()&&_f(oe)){var ue=oe.routeBounds;ue.w()&&a.routeBounds.Yc(ue)&&!a.usesSamePort(oe)&&(ue=oe.path,ue!==null&&ue.Ed()&&FS(y,x,E,oe))}}}}}return 0<E.length&&E.sort(function(he,ge){return he-ge}),E.length}function FS(a,y,x,E){for(var b=Re.B(a.y,y.y),z=E.pointsCount,ee=E.i(0),re=Ie.alloc(),oe=1;oe<z;oe++){var ue=E.i(oe);if(oe<z-1){var he=E.i(oe+1);if(ee.y===ue.y&&ue.y===he.y){if(ue.x>ee.x&&he.x>=ue.x||ue.x<ee.x&&he.x<=ue.x)continue}else if(ee.x===ue.x&&ue.x===he.x&&(ue.y>ee.y&&he.y>=ue.y||ue.y<ee.y&&he.y<=ue.y))continue}e:{he=a.x;var ge=a.y,xe=y.x,Pe=y.y,Fe=ee.x;ee=ee.y;var Ne=ue.x,Je=ue.y;if(Re.B(he,xe)){if(!Re.B(ge,Pe)&&Re.B(ee,Je)&&Math.min(ge,Pe)<ee&&Math.max(ge,Pe)>ee&&Math.min(Fe,Ne)<he&&Math.max(Fe,Ne)>he&&!Re.B(Fe,Ne)){re.x=he,re.y=ee,he=!0;break e}}else if(Re.B(ge,Pe)&&Re.B(Fe,Ne)&&Math.min(he,xe)<Fe&&Math.max(he,xe)>Fe&&Math.min(ee,Je)<ge&&Math.max(ee,Je)>ge&&!Re.B(ee,Je)){re.x=Fe,re.y=ge,he=!0;break e}re.x=0,re.y=0,he=!1}he&&(b?x.push(re.x):x.push(re.y)),ee=ue}Ie.free(re)}function _f(a){return a=a.curve,a===mp||a===nc}function S0(a,y){(y||_f(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()))}qn.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 ee=b.length,re=0;re<ee;re++){var oe=b[re];oe instanceof qn&&(oe===this?z=!0:z&&tx(this,oe,a))}}else if(E)for(z=b.Pa.s,b=z.length,ee=0;ee<b;ee++)re=z[ee],re instanceof qn&&tx(this,re,a)}}}}};function tx(a,y,x){if(y!==null&&y.lk&&y.fd&&_f(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}qn.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},qn.prototype.isVisible=function(){if(!mr.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},qn.prototype.Zb=function(a){if(mr.prototype.Zb.call(this,a),a&&S0(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},qn.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?em:this.qk};function $p(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,ee=y.jb.s,re=ee.length,oe=0;oe<re;oe++){var ue=ee[oe];(ue.ef===y&&ue.ff===E&&ue.uf===x&&ue.vf===b||ue.ef===x&&ue.ff===b&&ue.uf===y&&ue.vf===E)&&(z===null?z=ue:(a===null&&(a=[],a.push(z)),a.push(ue)))}if(a!==null){for(z=W1(y,x,E,b),z===null&&(z=new b0(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 qp(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(Hi(y.links,a),y.Sl()))}qn.prototype.ph=function(){return!0},At.Object.defineProperties(qn.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&&g0(y,this,x),qp(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 ee=!0;E!==null&&(ee=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=ee)}a!==null&&(this.uf!==a&&f0(a,this,b),$p(this),this.C(1)),this.g("fromNode",y,a),gp(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&tu(x),qp(this),this.ff=a;var E=this.fromPort;E!==null&&tu(E);var b=this.diagram;if(b!==null){var z=this.data,ee=b.model;z!==null&&ee.ri()&&ee.xv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(ee=!0,b!==null&&(ee=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=ee))),$p(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&&g0(y,this,x),qp(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 ee=!0;E!==null&&(ee=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=ee)}a!==null&&(this.ef!==a&&f0(a,this,b),$p(this),this.C(1)),this.g("toNode",y,a),gp(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&tu(x),qp(this),this.vf=a;var E=this.toPort;E!==null&&tu(E);var b=this.diagram;if(b!==null){var z=this.data,ee=b.model;z!==null&&ee.ri()&&ee.Cv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(ee=!0,b!==null&&(ee=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=ee))),$p(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:ar},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&&tu(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&&_n(a,">= 0",qn,"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:ar},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&&tu(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&&_n(a,">= 0",qn,"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?so: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&&Qp(this.fromNode),this.toNode!==null&&Qp(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof lo?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()===vu&&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),Re.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 ee=this.i(z-2);z+3>=E&&(z=E-1);var re=this.i(z-1),oe=this.i(z);Re.Dl(b.x,b.y,ee.x,ee.y,re.x,re.y,oe.x,oe.y,.5,a),y=Math.min(oe.x,y),x=Math.min(oe.y,x),b=oe}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 Ie)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||m0(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);Re.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):Re.$(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 Nn,E=0;E<a.length/2;E++)b=new Ie(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(!$t(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new Nn,E=0;E<a.length;E++)b=a[E],x.add(new Ie(b.x,b.y).freeze())}}else if(a instanceof Nn)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else Ke("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),m0(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&pf(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||!pp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!pp(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(),S0(this,y===nc||y===mp||a===nc||a===mp),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(),S0(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)}}}),qn.prototype.invalidateOtherJumpOvers=qn.prototype.Xo,qn.prototype.findClosestSegment=qn.prototype.ez,qn.prototype.updateRoute=qn.prototype.vg,qn.prototype.invalidateRoute=qn.prototype.bb,qn.prototype.rollbackRoute=qn.prototype.rv,qn.prototype.commitRoute=qn.prototype.zf,qn.prototype.startRoute=qn.prototype.uh,qn.prototype.clearPoints=qn.prototype.Fj,qn.prototype.removePoint=qn.prototype.pv,qn.prototype.addPointAt=qn.prototype.yf,qn.prototype.addPoint=qn.prototype.ne,qn.prototype.insertPointAt=qn.prototype.m,qn.prototype.insertPoint=qn.prototype.Kz,qn.prototype.setPointAt=qn.prototype.L,qn.prototype.setPoint=qn.prototype.dd,qn.prototype.getPoint=qn.prototype.i,qn.prototype.getOtherPort=qn.prototype.Cz,qn.prototype.getOtherNode=qn.prototype.To;var Fg=null,Lg=null,ay=new yn(qn,"Normal",1),LS=new yn(qn,"Orthogonal",2),BS=new yn(qn,"AvoidsNodes",6),nx=new yn(qn,"AvoidsNodesStraight",7),wl=new yn(qn,"None",0),vu=new yn(qn,"Bezier",9),nc=new yn(qn,"JumpGap",10),mp=new yn(qn,"JumpOver",11),em=new yn(qn,"End",17),w0=new yn(qn,"Scale",18),P0=new yn(qn,"Stretch",19),tm=new yn(qn,"OrientAlong",21),nm=new yn(qn,"OrientPlus90",22),im=new yn(qn,"OrientMinus90",23),sy=new yn(qn,"OrientOpposite",24),E0=new yn(qn,"OrientUpright",25),rm=new yn(qn,"OrientPlus90Upright",26),om=new yn(qn,"OrientMinus90Upright",27),C0=new yn(qn,"OrientUpright45",28),ix=16,rx=14,am=8;qn.className="Link",qn.Normal=ay,qn.Orthogonal=LS,qn.AvoidsNodes=BS,qn.AvoidsNodesStraight=nx,qn.None=wl,qn.Bezier=vu,qn.JumpGap=nc,qn.JumpOver=mp,qn.End=em,qn.Scale=w0,qn.Stretch=P0,qn.OrientAlong=tm,qn.OrientPlus90=nm,qn.OrientMinus90=im,qn.OrientOpposite=sy,qn.OrientUpright=E0,qn.OrientPlus90Upright=rm,qn.OrientMinus90Upright=om,qn.OrientUpright45=C0,qn.EndSegmentStep=8,qn.CurvinessStart=ix,qn.SpacingMin=rx,qn.OrthoShortCut=am;function b0(a,y,x,E){Ar(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}b0.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},b0.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))}},b0.className="LinkBundle";function sm(a){Ar(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}sm.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=ly,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 vp(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Jh(a,y,x){return vp(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):ly}function ox(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]>=Of&&(x[E]=ly)}sm.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]===ic)return!1}return!0};function Qh(a,y,x,E,b,z,ee,re,oe){if(!(y<z||y>ee||x<re||x>oe)){var ue=y|0,he=x|0,ge=a.ac[ue][he];if(ge>=Of&&ge<yp)for(b?he+=E:ue+=E,ge+=1;z<=ue&&ue<=ee&&re<=he&&he<=oe&&!(ge>=a.ac[ue][he]);)a.ac[ue][he]=ge,ge+=1,b?he+=E:ue+=E;if(ue=b?he:ue,b)if(0<E)for(x+=E;x<ue;x+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe);else for(x+=E;x>ue;x+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe);else if(0<E)for(y+=E;y<ue;y+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe);else for(y+=E;y>ue;y+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe)}}function F0(a,y,x,E,b,z,ee,re,oe){y|=0,x|=0;var ue=ic,he=Of;for(a.ac[y][x]=he;ue===ic&&y>z&&y<ee&&x>re&&x<oe;)he+=1,a.ac[y][x]=he,b?x+=E:y+=E,ue=a.ac[y][x]}function L0(a,y,x,E,b,z,ee,re,oe){y|=0,x|=0;var ue=ic,he=yp;for(a.ac[y][x]=he;ue===ic&&y>z&&y<ee&&x>re&&x<oe;)a.ac[y][x]=he,b?x+=E:y+=E,ue=a.ac[y][x]}function ax(a,y,x,E,b,z,ee){if(a.ac!==null){a.abort=!1;var re=y.x,oe=y.y;if(vp(a,re,oe)){re-=a.Nd,re/=a.rc,oe-=a.Od,oe/=a.sc;var ue=E.x,he=E.y;if(vp(a,ue,he))if(ue-=a.Nd,ue/=a.rc,he-=a.Od,he/=a.sc,1>=Math.abs(re-ue)&&1>=Math.abs(oe-he))a.abort=!0;else{var ge=z.x;E=z.y,y=z.x+z.width;var xe=z.y+z.height;ge-=a.Nd,ge/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,xe-=a.Od,xe/=a.sc,z=Math.max(0,Math.min(a.di,ge|0)),y=Math.min(a.di,Math.max(0,y|0)),ge=Math.max(0,Math.min(a.ei,E|0)),xe=Math.min(a.ei,Math.max(0,xe|0)),E=a.ac,re|=0,oe|=0,ue|=0,he|=0;var Pe=x===0||x===90?1:-1;if(x=x===90||x===270,E[re][oe]===ic?(F0(a,re,oe,Pe,x,z,y,ge,xe),F0(a,re,oe,1,!x,z,y,ge,xe),F0(a,re,oe,-1,!x,z,y,ge,xe)):F0(a,re,oe,Pe,x,re,oe,re,oe),E[ue][he]===ic?(L0(a,ue,he,b===0||b===90?1:-1,b===90||b===270,z,y,ge,xe),L0(a,ue,he,1,!(b===90||b===270),z,y,ge,xe),L0(a,ue,he,-1,!(b===90||b===270),z,y,ge,xe)):L0(a,ue,he,Pe,x,ue,he,ue,he),x=gi(),ee&&sx(a,ue,he,b,re,oe,x))for((x[0]!==ue||x[1]!==he)&&(x.unshift(he),x.unshift(ue)),(x[x.length-2]!==re||x[x.length-1]!==oe)&&(x.push(re),x.push(oe)),a=Of,b=x[x.length-2],ee=x[x.length-1],E[b][ee]=a++,z=x.length-4;0<=z;z-=2)for(b=x[z+2],ee=x[z+3],y=x[z],ue=x[z+1];y>b?b++:y<b?b--:ue>ee?ee++:ue<ee&&ee--,E[b][ee]=a++,b!==y||ee!==ue;);else Qh(a,re,oe,1,!1,z,y,ge,xe),Qh(a,re,oe,-1,!1,z,y,ge,xe),Qh(a,re,oe,1,!0,z,y,ge,xe),Qh(a,re,oe,-1,!0,z,y,ge,xe);Ii(x)}}}}function sx(a,y,x,E,b,z,ee){for(var re=a.ac,oe=y,ue=x;;){if(oe===b&&ue===z)return!0;var he=oe,ge=ue;if(E===0)if(he<b)he++;else break;else if(E===90)if(ge<z)ge++;else break;else if(E===180)if(he>b)he--;else break;else if(ge>z)ge--;else break;var xe=re[he][ge];if(xe===0||xe===uy)break;oe=he,ue=ge}for(;;){if(he=E,ge=oe,xe=ue,E===0?xe<z?(he=90,xe++):xe>z&&(he=270,xe--):E===90?ge<b?(he=0,ge++):ge>b&&(he=180,ge--):E===180?xe<z?(he=90,xe++):xe>z&&(he=270,xe--):ge<b?(he=0,ge++):ge>b&&(he=180,ge--),ge=re[ge][xe],he!==E&&ge!==0&&ge!==uy){if(ee.push(oe),ee.push(ue),sx(a,oe,ue,he,b,z,ee))return!0;ee.pop(),ee.pop()}if(re[oe][ue]=uy,E===0){if(oe===y)return!1;oe--}else if(E===90){if(ue===x)return!1;ue--}else if(E===180){if(oe===y)return!1;oe++}else{if(ue===x)return!1;ue++}}}At.Object.defineProperties(sm.prototype,{bounds:{get:function(){return new Wt(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 ic=0,Of=1,yp=999999,ly=yp+1,uy=yp+2;sm.className="PositionArray";function Bg(){Ar(this),this.port=this.node=null,this.pe=[],this.ap=!1}Bg.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 MS(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}Bg.prototype.Sl=function(){this.pe.length=0};function lx(a,y){var x=a.pe;if(x.length===0){e:if(!a.ap){x=a.ap,a.ap=!0;var E=null,b=a.node,z=b instanceof to?b:null;if(z===null||z.isSubGraphExpanded)var ee=b.isTreeExpanded?b.findLinksConnected(a.port.portId):b.qx();else{if(!z.actualBounds.w()){a.ap=x;break e}E=z,ee=E.Lu()}z=a.pe.length=0;var re=a.port.ga(Po,Ie.alloc()),oe=a.port.ga(Zt,Ie.alloc());for(b=Wt.allocAt(re.x,re.y,0,0),b.Ye(oe),Ie.free(re),Ie.free(oe),re=Ie.allocAt(b.x+b.width/2,b.y+b.height/2),oe=a.port.li(),ee=ee.iterator;ee.next();){var ue=ee.value;if(ue.isVisible()&&ue.fromPort!==ue.toPort){var he=ue.fromPort===a.port||ue.fromNode!==null&&ue.fromNode.Td(E),ge=ue.computeSpot(he,a.port);if(ge.$c()&&(he=he?ue.toPort:ue.fromPort,he!==null)){var xe=he.part;if(xe!==null){var Pe=xe.findVisibleNode();Pe!==null&&Pe!==xe&&(xe=Pe,he=xe.port),he=ue.computeOtherPoint(xe,he),xe=re.ab(he),xe-=oe,0>xe?xe+=360:360<=xe&&(xe-=360),ge=MS(b,ge,xe,ue.isOrthogonal),ge===0?(ge=4,180<xe&&(xe-=360)):ge===90?(ge=8,270<xe&&(xe-=360)):ge===180?ge=2:(ge=1,90>xe&&(xe+=360)),Pe=a.pe[z],Pe===void 0?(Pe=new hy(ue,xe,ge),a.pe[z]=Pe):(Pe.link=ue,Pe.angle=xe,Pe.Nc=ge),Pe.hv.set(he),z++}}}}for(Ie.free(re),a.pe.sort(Bg.prototype.j),oe=a.pe.length,E=-1,z=re=0;z<oe;z++)ee=a.pe[z],ee!==void 0&&(ee.Nc!==E&&(E=ee.Nc,re=0),ee.Uo=re,re++);for(E=-1,re=0,z=oe-1;0<=z;z--)oe=a.pe[z],oe!==void 0&&(oe.Nc!==E&&(E=oe.Nc,re=oe.Uo+1),oe.Gl=re);if(z=a.pe,ge=a.port,E=a.node.portSpreading,re=Ie.alloc(),oe=Ie.alloc(),ee=Ie.alloc(),ue=Ie.alloc(),ge.ga(Po,re),ge.ga(ea,oe),ge.ga(Zt,ee),ge.ga(is,ue),Pe=xe=he=ge=0,E===qv)for(var Fe=0;Fe<z.length;Fe++){var Ne=z[Fe];if(Ne!==null){var Je=Ne.link.computeThickness();switch(Ne.Nc){case 8:xe+=Je;break;case 2:Pe+=Je;break;case 1:ge+=Je;break;default:case 4:he+=Je}}}var Ve=Fe=0,ut=1,ft=Ne=0;for(Je=0;Je<z.length;Je++){var vt=z[Je];if(vt!==null){if(Fe!==vt.Nc){switch(Fe=vt.Nc,Fe){case 8:var bt=ee;Ve=ue;break;case 2:bt=ue,Ve=re;break;case 1:bt=re,Ve=oe;break;default:case 4:bt=oe,Ve=ee}switch(Ne=Ve.x-bt.x,ft=Ve.y-bt.y,Fe){case 8:xe>Math.abs(Ne)?(ut=Math.abs(Ne)/xe,xe=Math.abs(Ne)):ut=1;break;case 2:Pe>Math.abs(ft)?(ut=Math.abs(ft)/Pe,Pe=Math.abs(ft)):ut=1;break;case 1:ge>Math.abs(Ne)?(ut=Math.abs(Ne)/ge,ge=Math.abs(Ne)):ut=1;break;default:case 4:he>Math.abs(ft)?(ut=Math.abs(ft)/he,he=Math.abs(ft)):ut=1}Ve=0}var zt=vt.Zo;if(E===qv){switch(vt=vt.link.computeThickness(),vt*=ut,zt.set(bt),Fe){case 8:zt.x=bt.x+Ne/2+xe/2-Ve-vt/2;break;case 2:zt.y=bt.y+ft/2+Pe/2-Ve-vt/2;break;case 1:zt.x=bt.x+Ne/2-ge/2+Ve+vt/2;break;default:case 4:zt.y=bt.y+ft/2-he/2+Ve+vt/2}Ve+=vt}else{var vi=.5;E===p0&&(vi=(vt.Uo+1)/(vt.Gl+1)),zt.x=bt.x+Ne*vi,zt.y=bt.y+ft*vi}}}for(Ie.free(re),Ie.free(oe),Ie.free(ee),Ie.free(ue),bt=a.pe,z=0;z<bt.length;z++)E=bt[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,Wt.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}Bg.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},Bg.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,Xr,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)},Bg.className="Knot";function hy(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new Ie,this.Gl=this.Uo=0,this.Zo=new Ie,this.Ju=0}hy.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()},hy.className="LinkInfo";function Va(a){Ar(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new Ie(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Va.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},Va.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Va.prototype.qb=function(){},Va.prototype.toString=function(){var a=Fi(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Va.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())}}},Va.prototype.createNetwork=function(){return new _a(this)},Va.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof jt?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof to?y.lg(a.memberParts):y.lg(a.iterator),y},Va.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")}},Va.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()}},Va.prototype.doLayout=function(a){var y=new Tn;a instanceof jt?(zc(this,y,a.nodes,!0,this.rh,!0,!1,!0),zc(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof to?zc(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},Va.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,ee=0;for(a=a.iterator;a.next();){var re=a.value;lm(re);var oe=re.measuredBounds,ue=oe.width;oe=oe.height,re.moveTo(E,b),re instanceof to&&(re.rh=!1),E+=Math.max(ue,50)+20,ee=Math.max(ee,Math.max(oe,50)),z>=y-1?(z=0,E=x,b+=ee+20,ee=0):z++}},Va.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,ee=this.network.vertexes.iterator;ee.next();){var re=ee.value.node;if(!(re===null||re instanceof qn)&&(lm(re),this.rh(re))){var oe=re.measuredBounds,ue=oe.width;oe=oe.height,re.moveTo(x,E),re instanceof to&&(re.rh=!1),x+=Math.max(ue,50)+20,z=Math.max(z,Math.max(oe,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Va.prototype.rh=function(a){return!!(!a.location.w()||a instanceof to&&a.rh)};function zc(a,y,x,E,b,z,ee,re){for(x=x.iterator;x.next();){var oe=x.value;E&&!oe.isTopLevel||b!==null&&!b(oe)||!oe.canLayout()||(z&&oe instanceof Ci?oe.isLinkLabel||(oe instanceof to&&oe.layout===null?zc(a,y,oe.memberParts,!1,b,z,ee,re):(lm(oe),y.add(oe))):ee&&oe instanceof qn?y.add(oe):!re||!oe.Zc()||oe instanceof Ci||(lm(oe),y.add(oe)))}}function lm(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Va.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new Wt),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Va.prototype.ex=function(a){var y=new Tn;return a instanceof jt?(zc(this,y,a.nodes,!0,null,!0,!0,!0),zc(this,y,a.links,!0,null,!0,!0,!0),zc(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof to?zc(this,y,a.memberParts,!1,null,!0,!0,!0):zc(this,y,a.iterator,!1,null,!0,!0,!0),y},Va.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(Po),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},At.Object.defineProperties(Va.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())}}}),Va.prototype.collectParts=Va.prototype.ex,Va.prototype.getLayoutBounds=Va.prototype.ni,Va.prototype.invalidateLayout=Va.prototype.C,Va.className="Layout";function _a(a){Ar(this),this.Sc=a,this.wf=new Tn,this.ye=new Tn,this.Es=new Gt,this.zs=new Gt}_a.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 Tn,this.ye=new Tn,this.Es=new Gt,this.zs=new Gt},_a.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},_a.prototype.createVertex=function(){return new Ps(this)},_a.prototype.createEdge=function(){return new nu(this)},_a.prototype.lg=function(a,y,x){if(a!==null){for(y===void 0&&(y=!1),x===void 0&&(x=null),x===null&&(x=function(ee){if(ee instanceof Ci)return!ee.isLinkLabel;if(ee instanceof qn){var re=ee.fromNode;return re===null||re.isLinkLabel?!1:(ee=ee.toNode,!(ee===null||ee.isLinkLabel))}return!1}),a=a.iterator;a.next();){var E=a.value;if(E instanceof Ci&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof to&&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 qn&&(!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))}}},_a.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},be=_a.prototype,be.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},be.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},be.Iu=function(a){if(a!==null&&ux(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 ux(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}be.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},be.ki=function(a){return a===null?null:this.Es.I(a)},be.Bo=function(a){if(a!==null){dy(this,a);var y=a.toVertex;y!==null&&y.Cl(a),y=a.fromVertex,y!==null&&y.zl(a)}};function dy(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}}be.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},be.Mj=function(a){if(a!==null){var y=a.toVertex;y!==null&&y.Kl(a),y=a.fromVertex,y!==null&&y.Jl(a),cy(this,a)}};function cy(a,y){y!==null&&a.ye.remove(y)&&(y=y.link,y!==null&&a.zs.remove(y))}be.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},be.Lo=function(a){return a===null?null:this.zs.I(a)},be.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},be.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))}},be.Ko=function(){for(var a=gi(),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]);Ii(a)},_a.prototype.deleteArtificialVertexes=function(){for(var a=gi(),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=gi(),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]);Ii(a),Ii(y)};function kS(a){for(var y=gi(),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]);Ii(y)}_a.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),kS(this),this.Ko()),a=new Nn;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),fy(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 fy(a,y,x){if(x!==null&&x.network!==y){ux(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(cy(a,b),dy(y,b),fy(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(cy(a,x),dy(y,x),fy(a,y,x.toVertex))}}_a.prototype.dz=function(){for(var a=new Tn,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},At.Object.defineProperties(_a.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}}}),_a.prototype.findAllParts=_a.prototype.dz,_a.prototype.splitIntoSubNetworks=_a.prototype.Zx,_a.prototype.deleteSelfEdges=_a.prototype.Ko,_a.prototype.reverseEdge=_a.prototype.gm,_a.prototype.linkVertexes=_a.prototype.Zj,_a.prototype.findEdge=_a.prototype.Lo,_a.prototype.deleteLink=_a.prototype.Yy,_a.prototype.deleteEdge=_a.prototype.Mj,_a.prototype.addLink=_a.prototype.Dy,_a.prototype.addEdge=_a.prototype.Bo,_a.prototype.findVertex=_a.prototype.ki,_a.prototype.deleteNode=_a.prototype.Zy,_a.prototype.deleteVertex=_a.prototype.Iu,_a.prototype.addNode=_a.prototype.Bl,_a.prototype.addVertex=_a.prototype.dh,_a.prototype.addParts=_a.prototype.lg,_a.className="LayoutNetwork";function Ps(a){Ar(this),this.ob=a,this.j=new Wt(0,0,10,10).freeze(),this.o=new Ie(5,5).freeze(),this.Sh=this.ub=null,this.tg=new Nn,this.mg=new Nn}Ps.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new Nn,this.mg=new Nn},Ps.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+br(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},Ps.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;$t(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 to)){x=Wt.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(Hr);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),Wt.free(x);return}Wt.free(x)}a.moveTo(y.x,y.y)}},Ps.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},Ps.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},Ps.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},Ps.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function gy(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}At.Object.defineProperties(Ps.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=Wt.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),Wt.free(x),!(a instanceof to)&&(a=a.locationObject.ga(Hr),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 Tn,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new Tn,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new Tn,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 Nn,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}}}),Ps.prototype.deleteDestinationEdge=Ps.prototype.Jl,Ps.prototype.addDestinationEdge=Ps.prototype.zl,Ps.prototype.deleteSourceEdge=Ps.prototype.Kl,Ps.prototype.addSourceEdge=Ps.prototype.Cl,Ps.className="LayoutVertex",Ps.standardComparer=gy,Ps.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 nu(a){Ar(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}nu.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},nu.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+br(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},nu.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},nu.prototype.commit=function(){},nu.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},At.Object.defineProperties(nu.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)}}}),nu.prototype.getOtherVertex=nu.prototype.Ax,nu.className="LayoutEdge";function Hs(a){Va.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new Pn(NaN,NaN).freeze(),this.tf=new Pn(10,10).freeze(),this.Jb=um,this.Rb=M0,this.nd=hm,this.hd=hx,a&&Object.assign(this,a)}_t(Hs,Va),Hs.prototype.cloneProtected=function(a){Va.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},Hs.prototype.qb=function(a){a.classType===Hs?a===hm||a===A0||a===py||a===k0?this.sorting=a:a===M0||a===vh?this.arrangement=a:a===um||a===B0?this.alignment=a:Ke("Unknown enum value: "+a):Va.prototype.qb.call(this,a)},Hs.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 to)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 k0:b.reverse();break;case hm:b.sort(this.comparer);break;case A0:b.sort(this.comparer),b.reverse()}var z=this.wrappingColumn;isNaN(z)&&(z=0);var ee=this.wrappingWidth;switch(isNaN(ee)&&a!==null?(y=a.padding,ee=Math.max(a.viewportBounds.width-y.left-y.right,0)):ee=Math.max(this.wrappingWidth,0),0>=z&&0>=ee&&(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 B0:var re=y,oe=x,ue=Wt.alloc(),he=Math.max(this.cellSize.width,1);if(!isFinite(he))for(var ge=he=0;ge<b.length;ge++){var xe=this.ni(b[ge],ue);he=Math.max(he,xe.width)}if(he=Math.max(he+re,1),ge=Math.max(this.cellSize.height,1),!isFinite(ge))for(xe=ge=0;xe<b.length;xe++){var Pe=this.ni(b[xe],ue);ge=Math.max(ge,Pe.height)}ge=Math.max(ge+oe,1),xe=this.arrangement;for(var Fe=Pe=this.arrangementOrigin.x,Ne=this.arrangementOrigin.y,Je=0,Ve=0,ut=0;ut<b.length;ut++){var ft=b[ut],vt=this.ni(ft,ue),bt=Math.ceil((vt.width+re)/he)*he,zt=Math.ceil((vt.height+oe)/ge)*ge;switch(xe){case vh:var vi=Math.abs(Fe-vt.width);break;default:vi=Fe+vt.width}switch((0<z&&Je>z-1||0<ee&&0<Je&&vi-Pe>ee)&&(E.push(new Wt(0,Ne,ee+re,Ve)),Je=0,Fe=Pe,Ne+=Ve,Ve=0),Ve=Math.max(Ve,zt),xe){case vh:vt=-vt.width;break;default:vt=0}switch(ft.moveTo(Fe+vt,Ne),xe){case vh:Fe-=bt;break;default:Fe+=bt}Je++}E.push(new Wt(0,Ne,ee+re,Ve)),Wt.free(ue);break;case um:for(oe=ee,he=z,ge=y,xe=x,ee=Wt.alloc(),Pe=Math.max(this.cellSize.width,1),z=Ne=ue=0,re=Ie.alloc(),Fe=0;Fe<b.length;Fe++)Ve=b[Fe],Je=this.ni(Ve,ee),Ve=qd(Ve,Ve.locationObject,Ve.locationSpot,re),ue=Math.max(ue,Ve.x),Ne=Math.max(Ne,Je.width-Ve.x),z=Math.max(z,Ve.y);switch(Fe=this.arrangement,Fe){case vh:ue+=ge;break;default:Ne+=ge}Pe=isFinite(Pe)?Math.max(Pe+ge,1):Math.max(ue+Ne,1);var Xi=Ve=this.arrangementOrigin.x;for(ut=this.arrangementOrigin.y,Ne=0,oe>=ue&&(oe-=ue),ue=ft=0,bt=Math.max(this.cellSize.height,1),vt=z=0,zt=!0,Je=Ie.alloc(),vi=0;vi<b.length;vi++){var Ri=b[vi],Qn=this.ni(Ri,ee),Cn=qd(Ri,Ri.locationObject,Ri.locationSpot,re);if(0<Ne)switch(Fe){case vh:Xi=(Xi-Ve-(Qn.width-Cn.x))/Pe,Xi=Re.$(Math.round(Xi),Xi)?Math.round(Xi):Math.floor(Xi),Xi=Xi*Pe+Ve;break;default:Xi=(Xi-Ve+Cn.x)/Pe,Xi=Re.$(Math.round(Xi),Xi)?Math.round(Xi):Math.ceil(Xi),Xi=Xi*Pe+Ve}else switch(Fe){case vh:ft=Xi+Cn.x+Qn.width;break;default:ft=Xi-Cn.x}switch(Fe){case vh:var qr=-(Xi+Cn.x)+ft;break;default:qr=Xi+Qn.width-Cn.x-ft}if(0<he&&Ne>he-1||0<oe&&0<Ne&&qr>oe){for(E.push(new Wt(0,zt?ut-z:ut,oe+ge,vt+z+xe)),Xi=0;Xi<Ne&&vi!==Ne;Xi++){qr=b[vi-Ne+Xi];var Rr=qd(qr,qr.locationObject,qr.locationSpot,Je);qr.moveTo(qr.position.x,qr.position.y+z-Rr.y)}vt+=xe,ut=zt?ut+vt:ut+(vt+z),Ne=vt=z=0,Xi=Ve,zt=!1}switch(Xi===Ve&&(ue=Fe===vh?Math.max(ue,Qn.width-Cn.x):Math.min(ue,-Cn.x)),z=Math.max(z,Cn.y),vt=Math.max(vt,Qn.height-Cn.y),isFinite(bt)&&(vt=Math.max(vt,Math.max(Qn.height,bt)-Cn.y)),zt?Ri.moveTo(Xi-Cn.x,ut-Cn.y):Ri.moveTo(Xi-Cn.x,ut),Fe){case vh:Xi-=Cn.x+ge;break;default:Xi+=Qn.width-Cn.x+ge}Ne++}if(E.push(new Wt(0,ut,oe+ge,(zt?vt:vt+z)+xe)),b.length!==Ne)for(oe=0;oe<Ne;oe++)he=b[b.length-Ne+oe],ge=qd(he,he.locationObject,he.locationSpot,re),he.moveTo(he.position.x,he.position.y+z-ge.y);if(Ie.free(re),Ie.free(Je),Fe===vh)for(b=0;b<E.length;b++)z=E[b],z.width+=ue,z.x-=ue;else for(b=0;b<E.length;b++)z=E[b],z.x>ue&&(z.width+=z.x-ue,z.x=ue);Wt.free(ee)}for(re=z=ee=b=0;re<E.length;re++)oe=E[re],b=Math.min(b,oe.x),ee=Math.min(ee,oe.y),z=Math.max(z,oe.x+oe.width);this.arrangement===vh?this.commitLayers(E,new Ie(b+y/2-(z+b),ee-x/2)):this.commitLayers(E,new Ie(b-y/2,ee-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Hs.prototype.commitLayers=function(){};function hx(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}At.Object.defineProperties(Hs.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!==um&&a!==B0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==M0&&a!==vh||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==py&&a!==k0&&a!==hm&&a!==A0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var B0=new yn(Hs,"Position",0),um=new yn(Hs,"Location",1),M0=new yn(Hs,"LeftToRight",2),vh=new yn(Hs,"RightToLeft",3),py=new yn(Hs,"Forward",4),k0=new yn(Hs,"Reverse",5),hm=new yn(Hs,"Ascending",6),A0=new yn(Hs,"Descending",7);Hs.className="GridLayout",Hs.standardComparer=hx,Hs.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},Hs.Position=B0,Hs.Location=um,Hs.LeftToRight=M0,Hs.RightToLeft=vh,Hs.Forward=py,Hs.Reverse=k0,Hs.Ascending=hm,Hs.Descending=A0;function ya(){this.On=new Tn,this.Dn=new Tn,this.Pa=new Tn,this.cf=new Gt,this.bf=new Gt,this.aj=new Gt,this.H=null,this.tp=!1}be=ya.prototype,be.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},be.Xe=function(a){this.H=a},be.oi=function(a){if(a instanceof Ci){if(this.On.add(a),a instanceof to){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 qn?this.Dn.add(a):a instanceof ta||this.Pa.add(a);y=a.data,y===null||a instanceof ta||(a instanceof qn?this.bf.add(y,a):this.cf.add(y,a))},be.pc=function(a){if(a.Ej(),a instanceof Ci){if(this.On.remove(a),a instanceof to){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 qn?this.Dn.remove(a):a instanceof ta||this.Pa.remove(a);y=a.data,y===null||a instanceof ta||(a instanceof qn?this.bf.remove(y):this.cf.remove(y))},be.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 to)&&Ke('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 to||Ke('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 qn||Ke('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=gi(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=gi(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=gi(),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]);Ii(y),Ii(x),Ii(a)}},ya.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},ya.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&dx(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&vd(this.diagram,!1)};function dx(a,y,x){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(y)){x===void 0&&(x=!0);e:{if(y!=null&&!a.H.undoManager.isUndoingRedoing&&!a.cf.contains(y)){var E=a.Ro(y),b=cx(a,y,E);if(b!==null&&(zu(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 e}}E=null}E!==null&&x&&a.resolveReferencesForData(y)}}ya.prototype.insertLink=function(){return null},ya.prototype.resolveReferencesForData=function(){},ya.prototype.Ro=function(a){return this.H.model.Ro(a)};function cx(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&&(px||(px=!0,ci('No Group template found for category "'+x+'"'),ci(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(gx||(gx=!0,ci('No Node template found for category "'+x+'"'),ci(" Using default node template")),y=a.ny))),y}ya.prototype.getLinkCategoryForData=function(){return""},ya.prototype.setLinkCategoryForData=function(){},ya.prototype.setFromNodeForLink=function(){},ya.prototype.setToNodeForLink=function(){},ya.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(mx||(mx=!0,ci('No Link template found for category "'+a+'"'),ci(" Using default link template")),x=y.my)),x},ya.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},ya.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},ya.prototype.ip=function(a){a=this.Lc(a),a!==null&&(ng(this.diagram,a,!1),this.unresolveReferencesForPart(a))},ya.prototype.unresolveReferencesForPart=function(){},ya.prototype.removeDataForLink=function(){},ya.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},ya.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof Ci?a:null)},ya.prototype.findLinkForKey=function(){return null},be=ya.prototype,be.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},be.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof Ci?a:null)},be.Kc=function(a){return a===null?null:this.bf.I(a)},be.ms=function(a){for(var y=0;y<arguments.length;++y);y=new Tn;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 ee=arguments[z];if($t(ee)&&my(this,b,ee)){y.add(E);break}}}return y.iterator},be.ls=function(a){for(var y=0;y<arguments.length;++y);y=new Tn;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 ee=arguments[z];if($t(ee)&&my(this,b,ee)){y.add(E);break}}}return y.iterator};function my(a,y,x){for(var E in x){var b=y[E],z=x[E];if(xn(z)){if(!xn(b)||b.length<z.length)return!1;for(var ee=0;ee<b.length;ee++){var re=z[ee];if(re!==void 0&&!fx(a,b[ee],re))return!1}}else if(!fx(a,b,z))return!1}return!0}function fx(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($t(y)&&$t(x)){if(!my(a,y,x))return!1}else if(y!==x)return!1;return!0}ya.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===uo){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===Zo){var ee=a.newValue;E==="nodeDataArray"&&$t(ee)&&dx(this,ee),y.isModified=!0}else if(x===ha){var re=a.oldValue;E==="nodeDataArray"&&$t(re)&&this.ip(re),y.isModified=!0}else x===Ir&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===uo){var oe=a.propertyName,ue=a.object;ue===y.model?(oe==="nodeKeyProperty"||oe==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(ue,oe),y.isModified=!0}else if(x===Zo||x===ha){var he=a.change===Zo,ge=he?a.newParam:a.oldParam,xe=he?a.newValue:a.oldValue,Pe=this.aj.I(a.object);if(Array.isArray(Pe))for(a=0;a<Pe.length;a++){var Fe=Pe[a];if(he)Jm(Fe,xe,ge,!0);else if(!(0>ge)){var Ne=ge+Vp(Fe);Fe.pc(Ne,!0),kv(Fe,Ne,ge)}}y.isModified=!0}}finally{y.aa=!0}}}}},ya.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)},ya.prototype.rp=function(){for(var a=this.H.model,y=new Tn,x=a.nodeDataArray,E=0;E<x.length;E++)y.add(x[E]);var b=[];for(this.nodes.each(function(ee){ee.data===null||y.contains(ee.data)||b.push(ee.data)}),this.parts.each(function(ee){ee.data===null||y.contains(ee.data)||b.push(ee.data)}),b.forEach(function(ee){bx(a,ee,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&Cx(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()},ya.prototype.refreshDataBoundLinks=function(){},ya.prototype.updateRelationshipsFromData=function(){},ya.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 ee=b[z].sx(a);ee!==null&&(x===null&&(x=gi()),x.push(ee))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);Ii(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function vy(a,y){var x=y.Hh;if(xn(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 yy(a,y,x){Nf(y,function(ee){ee=ee.O.s;for(var re=ee.length,oe=0;oe<re;oe++)lg(x,ee[oe])});var E=y.Hh;if(xn(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}}}}ya.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new Gt;if(xn(a))for(var b=0;b<a.length;b++)N0(this,a[b],y,E,x);else for(a=a.iterator;a.next();)N0(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 Tn;for(var z=new Gt,ee=E.iterator;ee.next();){var re=ee.value;if(re instanceof qn)a||re.fromNode!==null&&re.toNode!==null||b.add(re);else if(re instanceof Ci&&re.data!==null&&x.Tl()){var oe=re;re=ee.key;var ue=re.pg();ue!==null&&(ue=E.I(ue),ue!==null?(x.qe(oe.data,x.wa(ue.data)),oe=y.Kc(oe.data),re=re.kh(),re!==null&&oe!==null&&z.add(re,oe)):x.qe(oe.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 he=new Gt;E.each(function(ge){ge.key.data!==null&&he.add(ge.key.data,ge.value.data)}),x(he,y,this.H.model)}for(y=E.iterator;y.next();)y.value.La();return E};function N0(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 mr))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof Ci){for(var ee=y.linksConnected;ee.next();){var re=ee.value;if(re.fromNode===y){var oe=E.I(re);oe!==null&&(oe.fromNode=z)}re.toNode===y&&(re=E.I(re),re!==null&&(re.toNode=z))}if(y instanceof to&&z instanceof to)for(y=y.memberParts;y.next();)ee=N0(a,y.value,x,E,b),ee instanceof qn||ee===null||(ee.containingGroup=z)}else if(y instanceof qn&&z instanceof qn)for(ee=y.fromNode,ee!==null&&(ee=E.I(ee),ee!==null&&(z.fromNode=ee)),ee=y.toNode,ee!==null&&(ee=E.I(ee),ee!==null&&(z.toNode=ee)),y=y.labelNodes;y.next();)ee=N0(a,y.value,x,E,b),ee!==null&&ee instanceof Ci&&(ee.labeledLink=z);return z}ya.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof qn||(E=b.copyNodeData(E),$t(E)&&(b.xf(E),x=y.Lc(E)))}else zu(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 qn||(b=y.copyNodeData(E)),$t(b)&&(x.data=b)));return x},At.Object.defineProperties(ya.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}}}),ya.prototype.updateAllRelationshipsFromData=ya.prototype.rp,ya.prototype.findLinksByExample=ya.prototype.ls,ya.prototype.findNodesByExample=ya.prototype.ms,ya.prototype.findLinkForData=ya.prototype.Kc,ya.prototype.findNodeForData=ya.prototype.ii,ya.prototype.findPartForData=ya.prototype.Lc,ya.prototype.findNodeForKey=ya.prototype.Vb,ya.prototype.removeModeledPart=ya.prototype.ip,ya.prototype.removeModeledParts=ya.prototype.Gs,ya.prototype.rebuildParts=ya.prototype.Wd;var gx=!1,px=!1,mx=!1;ya.className="PartManager";function Is(a){ya.apply(this,arguments)}_t(Is,ya),Is.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),vx(this,a.linkDataArray)},Is.prototype.addModeledParts=function(a){for(ya.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)gp(a.value);vd(this.diagram,!1)};function vx(a,y){y.forEach(function(x){yx(a,x)}),vd(a.diagram,!1)}function yx(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){zu(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=_0(x,y,!0);z!==""&&(b.fromPortId=z),z=yu(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof Ci&&(b.fromNode=z)),z=_0(x,y,!1),z!==""&&(b.toPortId=z),z=yu(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof Ci&&(b.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(ee){ee=a.Vb(ee),ee!==null&&(ee.labeledLink=b)}),a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=E}}}}Is.prototype.removeAllModeledParts=function(){var a=this.diagram.model;xx(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function xx(a,y){y.forEach(function(x){a.ip(x)})}Is.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Is.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Is.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Is.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Is.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Is.prototype.findPartForKey=function(a){var y=ya.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Is.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Is.prototype.doModelChanged=function(a){var y=this;if(ya.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===uo){if(b==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var ee=this.Vb(a.newValue);z.fromNode=ee}}else if(b==="linkToKey"){var re=this.Kc(a.object);if(re!==null){var oe=this.Vb(a.newValue);re.toNode=oe}}else if(b==="linkFromPortId"){var ue=this.Kc(a.object);if(ue!==null){var he=a.newValue;typeof he=="string"&&(ue.fromPortId=he)}}else if(b==="linkToPortId"){var ge=this.Kc(a.object);if(ge!==null){var xe=a.newValue;typeof xe=="string"&&(ge.toPortId=xe)}}else if(b==="nodeGroupKey"){var Pe=this.Lc(a.object);if(Pe!==null){var Fe=a.newValue;if(Fe!==void 0){var Ne=this.Vb(Fe);Ne instanceof to?Pe.containingGroup=Ne:Pe.containingGroup=null}else Pe.containingGroup=null}}else if(b==="linkLabelKeys"){var Je=this.Kc(a.object);if(Je!==null){var Ve=a.oldValue,ut=a.newValue;Array.isArray(Ve)&&Ve.forEach(function(Cn){0<=ut.indexOf(Cn)||(Cn=y.Vb(Cn),Cn!==null&&(Cn.labeledLink=null))}),Array.isArray(ut)&&ut.forEach(function(Cn){Cn=y.Vb(Cn),Cn!==null&&(Cn.labeledLink=Je)})}}else if(b==="linkCategory"){var ft=this.Kc(a.object),vt=a.newValue;ft!==null&&typeof vt=="string"&&(ft.category=vt)}else b==="linkDataArray"&&(xx(this,a.oldValue),vx(this,a.newValue));x.isModified=!0}else if(E===Zo){var bt=a.newValue;if(b==="linkDataArray"&&typeof bt=="object"&&bt!==null)yx(this,bt);else if(b==="linkLabelKeys"&&Gc(bt)){var zt=this.Kc(a.object),vi=this.Vb(bt);zt!==null&&vi!==null&&(vi.labeledLink=zt)}x.isModified=!0}else if(E===ha){var Xi=a.oldValue;if(b==="linkDataArray"&&typeof Xi=="object"&&Xi!==null)this.ip(Xi);else if(b==="linkLabelKeys"&&Gc(Xi)){var Ri=this.Vb(Xi);Ri!==null&&(Ri.labeledLink=null)}x.isModified=!0}}else if(E===uo){var Qn=a.propertyName;a.object!==x.model||Qn!=="linkFromKeyProperty"&&Qn!=="linkToKeyProperty"&&Qn!=="linkFromPortIdProperty"&&Qn!=="linkToPortIdProperty"&&Qn!=="linkLabelKeysProperty"&&Qn!=="nodeIsGroupProperty"&&Qn!=="nodeGroupKeyProperty"&&Qn!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Is.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new Tn,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){Ax(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&kx(y,z,!1)})},Is.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 qn){var b=yu(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=yu(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 Tn().addAll(y);var ee=new Tn;a.labelNodes.each(function(re){re.data!==null&&(re=E.wa(re.data),re!==void 0&&ee.add(re))}),y=ee.copy(),y.hp(b),b=b.copy(),b.hp(ee),(0<y.count||0<b.count)&&(y.each(function(re){re=x.Vb(re),re!==null&&re.labeledLink===a&&(re.labeledLink=null)}),b.each(function(re){re=x.Vb(re),re!==null&&re.labeledLink!==a&&(re.labeledLink=a)}))}}else!(a instanceof ta)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof to)&&(a.containingGroup=y)}}},Is.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=dm(y,x),b=this.Lc(a);if(E!==null&&b!==null){E=E.iterator;for(var z={};E.next();){var ee=E.value;y.lb(ee)?b instanceof to&&y.lh(ee)===x&&(ee=this.Lc(ee),ee!==null&&(ee.containingGroup=b)):(z.link=this.Kc(ee),z.link!==null&&b instanceof Ci&&(yu(y,ee,!0)===x&&(z.link.fromNode=b),yu(y,ee,!1)===x&&(z.link.toNode=b),ee=y.Ef(ee),Array.isArray(ee)&&ee.some(function(re){return function(oe){return oe===x?(b.labeledLink=re.link,!0):!1}}(z)))),z={link:z.link}}xh(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof to&&(b.containingGroup=a))}},Is.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Ci){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)yh(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&yh(y,x,E.data)),a instanceof to)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&yh(y,x,E)}}},Is.prototype.copyPartData=function(a,y){var x=ya.prototype.copyPartData.call(this,a,y);if(a instanceof qn)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},Is.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,ee=b.toolManager.findTool("Linking"),re="";if(a!==null&&(y===null&&(y=a),re=y.portId,re===null&&(re="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=ee.archetypeLinkData,E instanceof qn){if(zu(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=re,z.toNode=x,z.toPortId=y,b.add(z),a=ee.archetypeLabelNodeData,a instanceof Ci&&(zu(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&&Sp(z,E,z.wa(a.data),!0),wp(z,E,re,!0),x!==null&&Sp(z,E,z.wa(x.data),!1),wp(z,E,y,!1),z.fi(E),a=ee.archetypeLabelNodeData,a===null||a instanceof Ci||(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},Is.prototype.findLinkForKey=Is.prototype.findLinkForKey,Is.prototype.findPartForKey=Is.prototype.findPartForKey,Is.prototype.removeAllModeledParts=Is.prototype.removeAllModeledParts,Is.prototype.addModeledParts=Is.prototype.addModeledParts,Is.prototype.addAllModeledParts=Is.prototype.addAllModeledParts,Is.className="GraphLinksPartManager";function Bu(){ya.apply(this,arguments),this.Sg=null}_t(Bu,ya);function D0(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||!io(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(zu(E),E=E.copy(),E!==null))){var ee=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=ee}}}Bu.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Bu.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Bu.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}},Bu.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))},Bu.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Bu.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Bu.prototype.doModelChanged=function(a){if(ya.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===uo){if(E==="nodeParentKey"){var b=a.object,z=this.Vb(a.newValue),ee=this.ii(b);if(this.Sg!==null)z!==null&&(this.Sg.data=b,this.Sg.category=this.getLinkCategoryForData(b));else if(ee!==null){var re=ee.kh();re!==null?z===null?y.remove(re):y.isTreePathToChildren?re.fromNode=z:re.toNode=z:D0(this,z,ee)}}else if(E==="parentLinkCategory"){var oe=this.ii(a.object),ue=a.newValue;if(oe!==null&&typeof ue=="string"){var he=oe.kh();he!==null&&(he.category=ue)}}y.isModified=!0}}else if(x===uo){var ge=a.propertyName;a.object===y.model&&ge==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Bu.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof Ci&&(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:D0(this,y,a):E!==null&&ng(x,E,!1)))}}},Bu.prototype.updateDataBindings=function(a,y){ya.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Bu.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=dm(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 Ci&&y.mh(z)===x&&D0(this,b,this.ii(z))}xh(y,x)}a=y.mh(a),a!==void 0&&b instanceof Ci&&(a=this.Vb(a),D0(this,a,b))}},Bu.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Ci){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(ha,"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)&&yh(y,x,b)}},Bu.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},Bu.prototype.findLinkForKey=Bu.prototype.findLinkForKey,Bu.className="TreePartManager";function lr(a,y){this.kl=new Tn,this.il=new Tn,this.Wv=`,
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
"removedNodeKeys": `,this.vh=null,Ar(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new Gt,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 Gt,this.Lt=new Nn,this.Wg=!1,this.o=null,this.undoManager=new zr,a!==void 0&&(xn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}lr.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},lr.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},lr.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},lr.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)+":"+Cr(b)}}return y},lr.prototype.xA=function(a){a.change!==Ir&&Ke("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof La?(wx(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},lr.prototype.Qv=function(a,y){var x=this,E=!1,b=new Tn,z=new Tn,ee=new Tn,re=this.vh;a.changes.each(function(ge){ge.model===x&&(ge.modelChange==="nodeDataArray"?ge.change===Zo?b.add(ge.newValue):ge.change===ha&&ee.add(ge.oldValue):x.lb(ge.object)?z.add(ge.object):ge.change!==uo||x.modelData!==ge.object&&ge.propertyName!=="modelData"?ge.object!==null&&(re&&re.contains(ge.object)?re.get(ge.object).each(function(xe){x.lb(xe)&&z.add(xe)}):ge.object instanceof lr||x.ri()&&x.Jc(ge.object)||Px(x,ge.object).each(function(xe){z.add(xe)})):E=!0)});var oe=this.il;oe.clear(),b.each(function(ge){oe.add(x.wa(ge)),y||z.add(ge)});var ue=this.kl;ue.clear(),ee.each(function(ge){ue.add(x.wa(ge)),y&&z.add(ge)}),a=x.cloneDeep(z.Fa());var he=null;return E&&(he===null&&(he={}),he.modelData=this.cloneDeep(this.modelData)),0<oe.count&&(he===null&&(he={}),y?he.removedNodeKeys=oe.Fa():he.insertedNodeKeys=oe.Fa()),0<a.length&&(he===null&&(he={}),he.modifiedNodeData=a),0<ue.count&&(he===null&&(he={}),y?he.insertedNodeKeys=ue.Fa():he.removedNodeKeys=ue.Fa()),ue.clear(),oe.clear(),he},lr.prototype.cloneDeep=function(a){return xp(this,a,!0)};function xp(a,y,x,E,b,z){function ee(ge,xe){re?(ge.__gohashid===void 0&&z.push(ge),E.set(ge,xe)):(ge=na++,E.set(ge,xe),b.set(ge,y))}if(!$t(y))return y;z||(z=[]);var re=Object.isExtensible(y);if(E||(E=new Gt),re){var oe=E.get(y);if(oe)return oe}else for(b||(b=new Gt),oe=b.iterator;oe.next();){var ue=oe.key;if(oe.value===y&&(ue=E.get(ue)))return ue}if(Array.isArray(y)){oe=[],ee(y,oe);for(var he=0;he<y.length;he++)oe.push(xp(a,y[he],!1,E,b,z))}else if(y instanceof Ie||y instanceof Pn||y instanceof Wt||y instanceof Kr||y instanceof Zi)oe=y.copy(),ee(y,oe);else{if(y instanceof $o||y instanceof lt||y instanceof yn)return y;if(y instanceof Nn)oe=new Nn().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof Tn)oe=new Tn().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof Gt)oe=new Gt().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof Date)oe=new Date(y.getTime()),ee(y,oe);else if(y instanceof RegExp)oe=new RegExp(y),ee(y,oe),oe.lastIndex=y.lastIndex;else if(typeof y.copy=="function")oe=y.copy(),ee(y,oe);else for(he in oe={},ee(y,oe),y)he!=="__gohashid"&&(oe[he]=xp(a,y[he],!1,E,b,z))}return x&&z.forEach(function(ge){delete ge.__gohashid}),oe}be=lr.prototype,be.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},be.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},be.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 Sx(a,y){y=y.modelData,$t(y)&&(a.dm(y),a.modelData=y)}be.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!Ex(x,a[x])){y=!0;break}return a="",y&&(a=`,
|
|
"modelData": `+xy(this,this.modelData)),a+`,
|
|
"nodeDataArray": `+Zc(this,this.nodeDataArray,!0)},be.kv=function(a){Sx(this,a),a=a.nodeDataArray,xn(a)&&(this.dm(a),this.nodeDataArray=a)};function wx(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var ee=E.get(b);ee===null?(ee=new Tn,ee.add(z),E.add(b,ee)):ee.add(z)}}var E=a.vh;E===null&&(E=new Gt,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===uo?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===Zo||z===ha)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function Px(a,y){for(var x=new Tn,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];T0(a,y,b,b,x)}return x}function T0(a,y,x,E,b){if(Array.isArray(x))for(var z=0;z<x.length;z++){var ee=x[z];if(ee===y)return b.add(E),!0;if(T0(a,y,ee,E,b))return!0}else if($t(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(ee=x[z],ee===y)return b.add(E),!0;if(T0(a,y,ee,E,b))return!0}return!1}be.Pv=function(a,y){var x=this,E=!1,b=new Tn,z=new Tn,ee=new Tn,re=this.vh;a.changes.each(function(he){he.model===x&&(he.modelChange==="nodeDataArray"?he.change===Zo?b.add(he.newValue):he.change===ha&&ee.add(he.oldValue):x.lb(he.object)?z.add(he.object):he.change!==uo||x.modelData!==he.object&&he.propertyName!=="modelData"?he.object!==null&&(re&&re.contains(he.object)?re.get(he.object).each(function(ge){x.lb(ge)&&z.add(ge)}):he.object instanceof lr||x.ri()&&x.Jc(he.object)||Px(x,he.object).each(function(ge){z.add(ge)})):E=!0)});var oe=this.il;oe.clear(),b.each(function(he){oe.add(x.wa(he)),y||z.add(he)});var ue=this.kl;return ue.clear(),ee.each(function(he){ue.add(x.wa(he)),y&&z.add(he)}),a="",E&&(a+=`,
|
|
"modelData": `+xy(this,this.modelData)),0<oe.count&&(a+=(y?this.Yv:this.Wv)+Zc(this,oe.Fa(),!0)),0<z.count&&(a+=this.jy+Zc(this,z.Fa(),!0)),0<ue.count&&(a+=(y?this.Wv:this.Yv)+Zc(this,ue.Fa(),!0)),ue.clear(),oe.clear(),a},be.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)&&Ke("applyIncrementalJson cannot change Model properties"),Sx(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new Gt;if(Array.isArray(x))for(var b=0;b<x.length;b++){var z=x[b],ee=this.wa(z);ee!=null&&E.set(ee,z)}if(Array.isArray(y))for(b=y.length,z=0;z<b;z++){ee=y[z];var re=this.hc(ee);re===null&&(re=(re=E.get(ee))?re:this.copyNodeData({}),this.km(re,ee),this.xf(re))}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 oe in b)oe==="__gohashid"||oe===this.nodeKeyProperty||this.Wj()&&oe===this.nodeIsGroupProperty||this.setDataProperty(z,oe,b[oe]);this.lm(b,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,oe=0;oe<x;oe++)y=this.hc(a[oe]),y!==null&&this.cm(y)},be.$x=function(a,y){a.change!==Ir&&Ke("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof La?(y===void 0&&(y=cm(this,this)),wx(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 }'},be.yA=function(a,y){return this.$x(a,y)},be.np=function(a){return a===void 0&&(a=cm(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},be.toJSON=function(a){return this.np(a)},be.Zw=function(a){var y=null;if(typeof a=="string")try{y=wn.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:Ke("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&Ke("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},be.Ky=function(a){return this.Zw(a)},lr.constructGraphLinksModel=function(){return new lr},be=lr.prototype,be.dm=function(a){if(xn(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if($t(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:Ke("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if($t(a)){for(y in a)if(x=a[y],$t(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 Nn,E=0;E<x.length/2;E++)b.add(new Ie(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return AS(a)}return a},be.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()):xn(a)?Zc(this,a):$t(a)?xy(this,a):typeof a=="function"?"null":a.toString()};function Zc(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new rr;b.add("["),x&&1<E&&b.add(`
|
|
`);for(var z=0;z<E;z++){var ee=y[z];ee!==void 0&&(0<z&&(b.add(","),x&&b.add(`
|
|
`)),b.add(a.sm(ee)))}return x&&1<E&&b.add(`
|
|
`),b.add("]"),b.toString()}function Ex(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function Pl(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function xy(a,y){var x=y;if(x instanceof Ie)y={class:"go.Point",x:Pl(x.x),y:Pl(x.y)};else if(x instanceof Pn)y={class:"go.Size",width:Pl(x.width),height:Pl(x.height)};else if(x instanceof Wt)y={class:"go.Rect",x:Pl(x.x),y:Pl(x.y),width:Pl(x.width),height:Pl(x.height)};else if(x instanceof Kr)y={class:"go.Margin",top:Pl(x.top),right:Pl(x.right),bottom:Pl(x.bottom),left:Pl(x.left)};else if(x instanceof Zi)x.sb()?y={class:"go.Spot",x:Pl(x.x),y:Pl(x.y),offsetX:Pl(x.offsetX),offsetY:Pl(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof $o){if(y={class:"go.Brush",type:x.type.name},x.type===Jd?y.color=x.color:(x.type===bd||x.type===Fu)&&(y.start=x.start,y.end=x.end,x.type===Fu&&(x.startRadius!==0&&(y.startRadius=Pl(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=Pl(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 lt?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=Pl(x.startX)),x.startY!==0&&(y.startY=Pl(x.startY)),x.endX!==0&&(y.endX=Pl(x.endX)),x.endY!==0&&(y.endY=Pl(x.endY)),x.spot1.D(Po)||(y.spot1=x.spot1),x.spot2.D(Zt)||(y.spot2=x.spot2),x.type===lt.o&&(y.path=lt.ia(x))):x instanceof yn&&(y={class:"go.EnumValue",classType:cm(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=ds(y,b);if(!Ex(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof Nn){var ee="[";for(z=z.iterator;z.next();){var re=z.value;1<ee.length&&(ee+=","),ee+=a.sm(re.x),ee+=",",ee+=a.sm(re.y)}ee+="]",E+=ee}else E+=a.sm(z)}return E+"}"}function El(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function AS(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 Ie(El(a.x),El(a.y));else if(y==="Size")x=new Pn(El(a.width),El(a.height));else if(y==="Rect")x=new Wt(El(a.x),El(a.y),El(a.width),El(a.height));else if(y==="Margin")x=new Kr(El(a.top),El(a.right),El(a.bottom),El(a.left));else if(y==="Spot")typeof a.enum=="string"?x=Io(a.enum):x=new Zi(El(a.x),El(a.y),El(a.offsetX),El(a.offsetY));else if(y==="Brush"){if(x=new $o,x.type=Xn($o,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof Zi&&(x.start=a.start),a.end instanceof Zi&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=El(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=El(a.endRadius)),a=a.colorStops,$t(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=lt.parse(a.path):x=new lt,x.type=Xn(lt,a.type),typeof a.startX=="number"&&(x.startX=El(a.startX)),typeof a.startY=="number"&&(x.startY=El(a.startY)),typeof a.endX=="number"&&(x.endX=El(a.endX)),typeof a.endY=="number"&&(x.endY=El(a.endY)),a.spot1 instanceof Zi&&(x.spot1=a.spot1),a.spot2 instanceof Zi&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=wy(E),typeof E=="function"&&(x=Xn(E,a.name)));return x}be.Pe=function(a){return this.Lt.add(a),this},be.ik=function(a){this.Lt.remove(a)},be.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)},be.cb=function(a,y,x,E,b,z,ee){Ss(this,"",a,y,x,E,b,z,ee)},be.g=function(a,y,x,E,b){Ss(this,"",uo,a,this,y,x,E,b)},be.Fs=function(a,y,x,E,b,z){Ss(this,"",uo,y,a,x,E,b,z)};function Ss(a,y,x,E,b,z,ee,re,oe){re===void 0&&(re=null),oe===void 0&&(oe=null);var ue=new tr;ue.model=a,ue.change=x,ue.modelChange=y,ue.propertyName=E,ue.object=b,ue.oldValue=z,ue.oldParam=re,ue.newValue=ee,ue.newParam=oe,a.ds(ue)}lr.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===uo){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)),Ga(x,E,b)}else a.change===Zo?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,$t(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&Hi(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&ri(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!xn(E)&&a.propertyName&&(E=ds(a.object,a.propertyName)),xn(E)&&typeof x=="number"&&(a=a.newValue,y?Hi(E,x):ri(E,x,a))):Ke("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===ha?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,$t(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&ri(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&Hi(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!xn(E)&&a.propertyName&&(E=ds(a.object,a.propertyName)),xn(E)&&typeof x=="number"&&(a=a.oldValue,y?ri(E,x,a):Hi(E,x))):Ke("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==Ir&&Ke("unknown ChangedEvent: "+a.toString())},lr.prototype.Ea=function(a){return this.undoManager.Ea(a)},lr.prototype.eb=function(a){return this.undoManager.eb(a)},lr.prototype.Kf=function(){return this.undoManager.Kf()},lr.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}},be=lr.prototype,be.La=function(a,y){y===void 0&&(y=""),Ss(this,"SourceChanged",Ir,y,a,null,null)},be.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=ds(a,y),y!==void 0)){if(Gc(y))return y;Ke("Key value for node data "+a+" is not a number or a string: "+y)}}},be.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=ds(a,x);E!==y&&this.hc(y)===null&&(Ga(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),Ss(this,"nodeKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Ga(a,x,y)}};function Gc(a){return typeof a=="number"||typeof a=="string"}be.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},be.hc=function(a){return a===null&&Ke("Model.findNodeDataForKey:key must not be null"),a!==void 0&&Gc(a)?this.kb.I(a):null},be.$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))){Ga(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Ga(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Ga(a,y,x)}}}}},be.xf=function(a){a!==null&&(Bo(a),this.lb(a)||Cx(this,a,!0))};function Cx(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&&Ke("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,ri(a.Tc,E,y)),Ss(a,"nodeDataArray",Zo,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}be.Fy=function(a){if(xn(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)},be.cm=function(a){a!==null&&bx(this,a,!0)};function bx(a,y,x){var E=a.wa(y);if(E!==void 0&&a.kb.remove(E),E=null,x){e: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 e}E=-1}if(0>E)return;Hi(a.Tc,E)}Ss(a,"nodeDataArray",ha,"nodeDataArray",a,y,null,E,null),a.qp(y)}be.nA=function(a){if(xn(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)},be.$z=function(a){if(a!==this.nodeDataArray&&xn(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],ee=this.wa(z);if(ee!==void 0){x.add(ee);var re=this.hc(ee);re!==z&&(re!==null?(this.Do(re,z),this.lm(z,re)):(z=this.cloneDeep(z),this.km(z,ee),this.xf(z)))}else ee=this.cloneDeep(z),this.xf(ee),x.add(this.wa(ee))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.hc(E))&&this.cm(E);y.clear(),x.clear()}},be.jp=function(a,y){y!==void 0&&(a=dm(this,a),a instanceof Tn&&this.Vf.add(y,a))},be.Lv=function(){},be.fm=function(){},be.em=function(){},be.qp=function(){};function yh(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new Tn,a.Vf.add(y,E)),E.add(x)}}function xh(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof Tn&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function dm(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof Tn?a:null)}be.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},lr.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):I0(this,a,!0),$t(a)&&Ar(a),a};function I0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=I0(a,y[x],a.copiesArrayObjects);E.push(b)}return Ar(E),E}if(x&&$t(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=ds(y,E),ee=cm(a,z);ee==="GraphObject"||ee==="Diagram"||ee==="Layer"||ee==="RowColumnDefinition"||ee==="AnimationManager"||ee==="Tool"||ee==="CommandHandler"||ee==="Layout"||ee==="InputEvent"||ee==="DiagramEvent"||z instanceof lr||z instanceof zr||z instanceof La||z instanceof tr||(z=I0(a,z,!1)),Ga(x,E,z)}return Ar(x),x}return y instanceof Ie||y instanceof Pn||y instanceof Wt||y instanceof Zi||y instanceof Kr?y.copy():y}lr.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!Fx&&a instanceof Ft&&(Fx=!0,ci('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),ci(" Is that really your intent?"));var E=ds(a,y);E!==x&&(Ga(a,y,x),this.Fs(a,y,E,x))},be=lr.prototype,be.set=function(a,y,x){this.setDataProperty(a,y,x)},be.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])}},be.Ay=function(a,y){this.ts(a,-1,y)},be.ts=function(a,y,x){0>y&&(y=a.length),ri(a,y,x),Ss(this,"",Zo,"",a,null,x,null,y)},be.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&Ke("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];Hi(a,y),Ss(this,"",ha,"",a,x,null,y,null)},be.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=ds(a,y),y===void 0))return"";if(typeof y=="string")return y;Ke("getCategoryForNodeData found a non-string category for "+a+": "+y)},be.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=ds(a,x);E===void 0&&(E=""),E!==y&&(Ga(a,x,y),Ss(this,"nodeCategory",uo,x,a,E,y))}else Ga(a,x,y)}},be.lm=function(a,y){this.jm(y,this.Ro(a))},be.Tl=function(){return!1},be.Wj=function(){return!1},be.ri=function(){return!1},be.xs=function(){return!1},be.Xj=function(){return!1};function Sy(){return new lr}function cm(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 cm(a,y.constructor);return typeof y}function wy(a){return qu[a]?qu[a]:wn.go!==void 0&&wn.go[a]?wn.go[a]:null}function ds(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 Ga(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){}}At.Object.defineProperties(lr.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===""&&Ke("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&Ke("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];$t(b)||Ke("Model.nodeDataArray must only contain Objects, not: "+b),Bo(b)}for(this.Tc=a,E=new Nn,b=0;b<x;b++){var z=a[b],ee=this.wa(z);ee===void 0||this.kb.I(ee)!==null?E.add(z):this.kb.add(ee,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(Ss(this,"nodeDataArray",uo,"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"}}}),lr.prototype.setCategoryForNodeData=lr.prototype.jm,lr.prototype.getCategoryForNodeData=lr.prototype.Ro,lr.prototype.removeArrayItem=lr.prototype.ov,lr.prototype.insertArrayItem=lr.prototype.ts,lr.prototype.addArrayItem=lr.prototype.Ay,lr.prototype.assignAllDataProperties=lr.prototype.Do,lr.prototype.set=lr.prototype.set,lr.prototype.clearUnresolvedReferences=lr.prototype.Qy,lr.prototype.mergeNodeDataArray=lr.prototype.$z,lr.prototype.removeNodeDataCollection=lr.prototype.nA,lr.prototype.removeNodeData=lr.prototype.cm,lr.prototype.addNodeDataCollection=lr.prototype.Fy,lr.prototype.addNodeData=lr.prototype.xf,lr.prototype.makeNodeDataKeyUnique=lr.prototype.$u,lr.prototype.findNodeDataForKey=lr.prototype.hc,lr.prototype.containsNodeData=lr.prototype.lb,lr.prototype.setKeyForNodeData=lr.prototype.km,lr.prototype.getKeyForNodeData=lr.prototype.wa,lr.prototype.updateTargetBindings=lr.prototype.La,lr.prototype.commit=lr.prototype.commit,lr.prototype.rollbackTransaction=lr.prototype.Kf,lr.prototype.commitTransaction=lr.prototype.eb,lr.prototype.startTransaction=lr.prototype.Ea,lr.prototype.raiseDataChanged=lr.prototype.Fs,lr.prototype.raiseChanged=lr.prototype.g,lr.prototype.raiseChangedEvent=lr.prototype.cb,lr.prototype.removeChangedListener=lr.prototype.ik,lr.prototype.addChangedListener=lr.prototype.Pe,lr.prototype.writeJsonValue=lr.prototype.sm,lr.prototype.replaceJsonObjects=lr.prototype.dm,lr.prototype.applyIncrementalJSON=lr.prototype.Ky,lr.prototype.applyIncrementalJson=lr.prototype.Zw,lr.prototype.toJSON=lr.prototype.toJSON,lr.prototype.toJson=lr.prototype.np,lr.prototype.toIncrementalJSON=lr.prototype.yA,lr.prototype.toIncrementalJson=lr.prototype.$x,lr.prototype.toIncrementalData=lr.prototype.xA,lr.prototype.clear=lr.prototype.clear;var Fx=!1,qu={};lr.className="Model",lr.fromJSON=lr.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=wn.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:Ke("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=wy(E)):(b=wy(E),b===null&&(b=wn[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof lr?y=a:Ke("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=lr.constructGraphLinksModel()),y.gp(x),y.kv(x),y},lr.safePropertyValue=ds,lr.safePropertySet=Ga,qu.Brush=$o,qu.ChangedEvent=tr,qu.Geometry=lt,qu.Margin=Kr,qu.Panel=Vn,qu.Point=Ie,qu.Rect=Wt,qu.Size=Pn,qu.Spot=Zi,qu.Transaction=La,qu.UndoManager=zr;function cs(a,y,x,E){Ar(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=Bx,this.wk=null):(this.el=fm,this.wk=E),this.st=new Tn}cs.prototype.copy=function(){var a=new cs;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},be=cs.prototype,be.qb=function(a){a.classType===cs&&(this.mode=a)},be.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.Kx=function(a){return a===void 0&&(a=null),this.mode=fm,this.backConverter=a,this},be.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},be.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function Lx(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}be.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==="")ci("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=ds(y,E)),z!==void 0)if(b===null)x!==""&&Ga(a,x,z);else try{if(x!==""){var ee=b(z,a);Ga(a,x,ee)}else b(z,a)}catch(re){}}}},be.sp=function(a,y,x,E){if(this.el===fm){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,ee=a;if(b!==""&&(ee=ds(a,b)),ee!==void 0&&!this.st.contains(a))try{this.st.add(a);var re=E!==null?E.diagram:null,oe=re!==null?re.model:null;if(z===null){if(x!=="")oe!==null?oe.setDataProperty(y,x,ee):Ga(y,x,ee);else if(oe!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var ue=E.itemIndex,he=E.panel.itemArray;oe.ov(he,ue),oe.ts(he,ue,ee)}}else try{if(x!==""){var ge=z(ee,y,oe);oe!==null?oe.setDataProperty(y,x,ge):Ga(y,x,ge)}else{var xe=z(ee,y,oe);if(xe!==void 0&&oe!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var Pe=E.itemIndex,Fe=E.panel.itemArray;oe.ov(Fe,Pe),oe.ts(Fe,Pe,xe)}}}catch(Ne){}}finally{this.st.remove(a)}}}},At.Object.defineProperties(cs.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&Lt(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&Lt(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&Lt(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&Lt(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&Lt(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&Lt(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&Lt(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&Lt(this),this.el=a}}}),cs.prototype.updateSource=cs.prototype.sp,cs.prototype.updateTarget=cs.prototype.Mv,cs.prototype.ofModel=cs.prototype.dA,cs.prototype.ofObject=cs.prototype.cp,cs.prototype.makeTwoWay=cs.prototype.Kx;var NS="Binding",Bx=new yn(cs,"OneWay",1),fm=new yn(cs,"TwoWay",2);cs.className="Binding",cs.parseEnum=function(a,y){return function(x){return x=Xn(a,x),x===null?y:x}},cs.toString=Cr,cs.OneWay=Bx,cs.TwoWay=fm;function Wo(a,y,x){lr.call(this),this.Vv=`,
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
"removedLinkKeys": `,this.md=[],this.$f=new Tn,this.wb=new Gt,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&&(xn(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}_t(Wo,lr),Wo.constructGraphLinksModel=lr.constructGraphLinksModel,Wo.prototype.cloneProtected=function(a){lr.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},be=Wo.prototype,be.clear=function(){lr.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},be.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)+":"+Cr(b)}for(y+=`
|
|
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+yu(this,b,!0)+"-->"+yu(this,b,!1)}return y},be.Qv=function(a,y){this.linkKeyProperty===""&&Ke("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=lr.prototype.Qv.call(this,a,y),E=this,b=new Tn,z=new Tn,ee=new Tn,re=this.vh;a.changes.each(function(he){he.model===E&&(he.modelChange==="linkDataArray"?he.change===Zo?b.add(he.newValue):he.change===ha&&ee.add(he.oldValue):E.Jc(he.object)?z.add(he.object):he.object!==null&&(he.object!==null&&re&&re.contains(he.object)?re.get(he.object).each(function(ge){E.Jc(ge)&&z.add(ge)}):he.object instanceof lr||E.lb(he.object)||Mx(E,he.object).each(function(ge){z.add(ge)})))});var oe=this.il;oe.clear(),b.each(function(he){oe.add(E.Ac(he)),y||z.add(he)});var ue=this.kl;return ue.clear(),ee.each(function(he){ue.add(E.Ac(he)),y&&z.add(he)}),a=E.cloneDeep(z.Fa()),0<oe.count&&(x===null&&(x={}),y?x.removedLinkKeys=oe.Fa():x.insertedLinkKeys=oe.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<ue.count&&(x===null&&(x={}),y?x.insertedLinkKeys=ue.Fa():x.removedLinkKeys=ue.Fa()),ue.clear(),oe.clear(),x},be.rm=function(){var a=lr.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},be.gp=function(a){lr.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)},be.Rv=function(){var a=lr.prototype.Rv.call(this),y=`,
|
|
"linkDataArray": `+Zc(this,this.linkDataArray,!0);return a+y},be.kv=function(a){lr.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function Mx(a,y){for(var x=new Tn,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];T0(a,y,b,b,x)}return x}be.Pv=function(a,y){this.linkKeyProperty===""&&Ke("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=lr.prototype.Pv.call(this,a,y),E=this,b=new Tn,z=new Tn,ee=new Tn,re=this.vh;a.changes.each(function(he){he.model===E&&(he.modelChange==="linkDataArray"?he.change===Zo?b.add(he.newValue):he.change===ha&&ee.add(he.oldValue):E.Jc(he.object)?z.add(he.object):he.object!==null&&(he.object!==null&&re&&re.contains(he.object)?re.get(he.object).each(function(ge){E.Jc(ge)&&z.add(ge)}):he.object instanceof lr||E.lb(he.object)||Mx(E,he.object).each(function(ge){z.add(ge)})))});var oe=this.il;oe.clear(),b.each(function(he){oe.add(E.Ac(he)),y||z.add(he)});var ue=this.kl;return ue.clear(),ee.each(function(he){ue.add(E.Ac(he)),y&&z.add(he)}),a=x,0<oe.count&&(a+=(y?this.Xv:this.Vv)+Zc(this,oe.Fa(),!0)),0<z.count&&(a+=this.iy+Zc(this,z.Fa(),!0)),0<ue.count&&(a+=(y?this.Vv:this.Xv)+Zc(this,ue.Fa(),!0)),ue.clear(),oe.clear(),a},be.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)&&Ke("applyIncrementalJson cannot change Model properties"),lr.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 ee in b)ee!=="__gohashid"&&ee!==this.linkKeyProperty&&this.setDataProperty(z,ee,b[ee]);Nx(this,b,z)}}if(a=a.removedLinkKeys,Array.isArray(a))for(ee=a.length,y=0;y<ee;y++)x=this.jh(a[y]),x!==null&&this.bm(x)},Wo.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===uo){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),Ga(x,E,b);return}}else if(a.change===Zo){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,$t(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===ha){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,$t(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}}lr.prototype.changeState.call(this,a,y)}},be=Wo.prototype,be.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),Ga(x,this.nodeKeyProperty,a),this.xf(x))}return a}},be.yx=function(a){return yu(this,a,!0)},be.wv=function(a,y){Sp(this,a,y,!0)},be.Bx=function(a){return yu(this,a,!1)},be.Bv=function(a,y){Sp(this,a,y,!1)};function yu(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=ds(y,a),a!==void 0))){if(Gc(a))return a;Ke((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Sp(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=ds(y,b);z!==x&&(xh(a,z,y),Ga(y,b,x),a.hc(x)===null&&yh(a,x,y),Ss(a,E?"linkFromKey":"linkToKey",uo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Ga(y,b,x)}}be.zx=function(a){return _0(this,a,!0)},be.xv=function(a,y){wp(this,a,y,!0)},be.Cx=function(a){return _0(this,a,!1)},be.Cv=function(a,y){wp(this,a,y,!1)};function _0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=ds(y,a),y===void 0?"":y)}function wp(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=ds(y,b);z===void 0&&(z=""),z!==x&&(Ga(y,b,x),Ss(a,E?"linkFromPortId":"linkToPortId",uo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Ga(y,b,x)}}be.Ef=function(a){if(a===null)return O0;var y=this.je;return y===""?O0:(a=ds(a,y),a===void 0?O0:a)},be.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=ds(a,x);if(E===void 0&&(E=O0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)xh(this,E[z],a);for(Ga(a,x,y),b=y.length,z=0;z<b;z++){var ee=y[z];this.hc(ee)===null&&yh(this,ee,a)}Ss(this,"linkLabelKeys",uo,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Ga(a,x,y)}},be.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=ds(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&&yh(this,y,a),Ss(this,"linkLabelKeys",Zo,x,a,null,y,null,b)))}else Ke(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},be.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=ds(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(xh(this,y,a),Ss(this,"linkLabelKeys",ha,x,a,y,null,b,null)))}else E!==void 0&&Ke(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},be.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=ds(a,y),y!==void 0)){if(Gc(y))return y;Ke("Key value for link data "+a+" is not a number or a string: "+y)}}},be.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=ds(a,x);E!==y&&this.jh(y)===null&&(Ga(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),Ss(this,"linkKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ga(a,x,y)}},be.jh=function(a){return a===null&&Ke("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&Gc(a)?this.wb.I(a):null},be.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))){Ga(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Ga(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Ga(a,y,x)}}}}},be.Jc=function(a){return a===null?!1:this.$f.contains(a)},be.fi=function(a){a!==null&&(Bo(a),this.Jc(a)||kx(this,a,!0))};function kx(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&&Ke("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)),Ss(a,"linkDataArray",Zo,"linkDataArray",a,null,y,null,E),Py(a,y)}be.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)},be.bm=function(a){a!==null&&Ax(this,a,!0)};function Ax(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(Ss(a,"linkDataArray",ha,"linkDataArray",a,y,null,E,null),x=yu(a,y,!0),xh(a,x,y),x=yu(a,y,!1),xh(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],xh(a,x,y)}be.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)},be.Zz=function(a){if(this.linkKeyProperty===""&&Ke("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&xn(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],ee=this.Ac(z);if(ee!==void 0){x.add(ee);var re=this.jh(ee);re!==z&&(re!==null?(this.Do(re,z),Nx(this,z,re)):(z=this.cloneDeep(z),this.Ks(z,ee),this.fi(z)))}else ee=this.cloneDeep(z),this.fi(ee),x.add(this.Ac(ee))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.jh(E))&&this.bm(E);y.clear(),x.clear()}};function Py(a,y){var x=yu(a,y,!0);x=a.Vl(x),a.hc(x)===null&&yh(a,x,y),x=yu(a,y,!1),x=a.Vl(x),a.hc(x)===null&&yh(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&&yh(a,x,y)}be.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):I0(this,a,!0),$t(a)&&(Ar(a),this.lf!==""&&Ga(a,this.lf,void 0),this.mf!==""&&Ga(a,this.mf,void 0),this.je!==""&&Ga(a,this.je,[])),a},be.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!ds(a,y)},be.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=ds(a,y),y!==void 0)){if(Gc(y))return y;Ke("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},be.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=ds(a,x);E!==y&&(xh(this,E,a),Ga(a,x,y),this.hc(y)===null&&yh(this,y,a),Ss(this,"nodeGroupKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ga(a,x,y)}},Wo.prototype.copyNodeData=function(a){return a===null?null:(a=lr.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||ds(a,this.Je)===void 0||Ga(a,this.Je,void 0),a)},Wo.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){Sp(this,a,x,!0);return}if(y===this.linkToKeyProperty){Sp(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){wp(this,a,x,!0);return}if(y===this.linkToPortIdProperty){wp(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=ds(a,y);E!==x&&(Ga(a,y,x),this.Fs(a,y,E,x))},be=Wo.prototype,be.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&&ds(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},be.jp=function(a,y){lr.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(yu(this,E,!0)===b){var ee=this.lf;Ga(E,ee,z),Ss(this,"linkFromKey",uo,ee,E,b,z),typeof ee=="string"&&this.La(E,ee)}if(yu(this,E,!1)===b&&(ee=this.mf,Ga(E,ee,z),Ss(this,"linkToKey",uo,ee,E,b,z),typeof ee=="string"&&this.La(E,ee)),ee=this.Ef(E),Array.isArray(ee))for(var re=ee.length,oe=this.je,ue=0;ue<re;ue++)ee[ue]===b&&(ee[ue]=z,Ss(this,"linkLabelKeys",Zo,oe,E,b,z,ue,ue))}},be.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Ga(a,E,x),Ss(this,"nodeGroupKey",uo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},be.Lv=function(){lr.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)Py(this,a[x])},be.fm=function(a){lr.prototype.fm.call(this,a),a=this.wa(a);var y=dm(this,a);if(y!==null){var x=gi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;Ss(this,"nodeGroupKey",uo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(yu(this,E,!0)===a&&(b=this.lf,Ss(this,"linkFromKey",uo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),yu(this,E,!1)===a&&(b=this.mf,Ss(this,"linkToKey",uo,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,ee=this.je,re=0;re<z;re++)b[re]===a&&(Ss(this,"linkLabelKeys",Zo,ee,E,a,a,re,re),x.push(E))}for(y=0;y<x.length;y++)xh(this,a,x[y]);Ii(x)}},be.em=function(a){lr.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&yh(this,y,a)},be.qp=function(a){lr.prototype.qp.call(this,a);var y=this.lh(a);xh(this,y,a)},be.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=ds(a,y),y===void 0))return"";if(typeof y=="string")return y;Ke("getCategoryForLinkData found a non-string category for "+a+": "+y)},Wo.prototype.getLinkCategoryForData=function(a){return this.ps(a)},Wo.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=ds(a,x);E===void 0&&(E=""),E!==y&&(Ga(a,x,y),Ss(this,"linkCategory",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ga(a,x,y)}},Wo.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},be=Wo.prototype,be.lm=function(a,y){lr.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function Nx(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))}be.Wj=function(){return!0},be.ri=function(){return!0},be.xs=function(){return!0},be.Xj=function(){return!0},At.Object.defineProperties(Wo.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];$t(b)||Ke("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),Bo(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new Nn,b=0;b<x;b++){var z=a[b],ee=this.Ac(z);ee===void 0||this.wb.I(ee)!==null?E.add(z):this.wb.add(ee,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 Tn,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,Ss(this,"linkDataArray",uo,"linkDataArray",this,y,a),y=0;y<x;y++)Py(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"}}}),Wo.prototype.setCategoryForLinkData=Wo.prototype.lp,Wo.prototype.getCategoryForLinkData=Wo.prototype.ps,Wo.prototype.assignAllDataProperties=Wo.prototype.Do,Wo.prototype.setGroupKeyForNodeData=Wo.prototype.mp,Wo.prototype.getGroupKeyForNodeData=Wo.prototype.lh,Wo.prototype.isGroupForNodeData=Wo.prototype.Yu,Wo.prototype.copyLinkData=Wo.prototype.Jo,Wo.prototype.mergeLinkDataArray=Wo.prototype.Zz,Wo.prototype.removeLinkDataCollection=Wo.prototype.lA,Wo.prototype.removeLinkData=Wo.prototype.bm,Wo.prototype.addLinkDataCollection=Wo.prototype.Ey,Wo.prototype.addLinkData=Wo.prototype.fi,Wo.prototype.containsLinkData=Wo.prototype.Jc,Wo.prototype.makeLinkDataKeyUnique=Wo.prototype.Bs,Wo.prototype.findLinkDataForKey=Wo.prototype.jh,Wo.prototype.setKeyForLinkData=Wo.prototype.Ks,Wo.prototype.getKeyForLinkData=Wo.prototype.Ac,Wo.prototype.removeLabelKeyForLinkData=Wo.prototype.Qx,Wo.prototype.addLabelKeyForLinkData=Wo.prototype.Bu,Wo.prototype.setLabelKeysForLinkData=Wo.prototype.Ls,Wo.prototype.getLabelKeysForLinkData=Wo.prototype.Ef,Wo.prototype.setToPortIdForLinkData=Wo.prototype.Cv,Wo.prototype.getToPortIdForLinkData=Wo.prototype.Cx,Wo.prototype.setFromPortIdForLinkData=Wo.prototype.xv,Wo.prototype.getFromPortIdForLinkData=Wo.prototype.zx,Wo.prototype.setToKeyForLinkData=Wo.prototype.Bv,Wo.prototype.getToKeyForLinkData=Wo.prototype.Bx,Wo.prototype.setFromKeyForLinkData=Wo.prototype.wv,Wo.prototype.getFromKeyForLinkData=Wo.prototype.yx,Wo.prototype.clear=Wo.prototype.clear;var O0=Object.freeze([]);Wo.className="GraphLinksModel",qu.GraphLinksModel=Wo,lr.constructGraphLinksModel=lr.constructGraphLinksModel=function(){return new Wo},lr.initDiagramModel=Sy=function(){return new Wo};function Cl(a,y){lr.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(xn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}_t(Cl,lr),Cl.constructGraphLinksModel=lr.constructGraphLinksModel,Cl.prototype.cloneProtected=function(a){lr.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},be=Cl.prototype,be.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)+":"+Cr(b)}}return y},be.rm=function(){var a=lr.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
|
|
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},be.gp=function(a){lr.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},be.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&Ke("applyIncrementalJson cannot change Model properties"),lr.prototype.fp.call(this,a)},be.Vl=function(a){return a},be.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=ds(a,y),y!==void 0)){if(Gc(y))return y;Ke("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},be.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=ds(a,x);E!==y&&(xh(this,E,a),Ga(a,x,y),this.hc(y)===null&&yh(this,y,a),Ss(this,"nodeParentKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ga(a,x,y)}},be.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=ds(a,y),y===void 0)?"":typeof y=="string"?y:(Ke("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},Cl.prototype.getLinkCategoryForData=function(a){return this.ss(a)},Cl.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=ds(a,x);E===void 0&&(E=""),E!==y&&(Ga(a,x,y),Ss(this,"parentLinkCategory",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ga(a,x,y)}},Cl.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},Cl.prototype.copyNodeData=function(a){return a===null?null:(a=lr.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||ds(a,this.Ke)===void 0||Ga(a,this.Ke,void 0),a)},Cl.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=ds(a,y);E!==x&&(Ga(a,y,x),this.Fs(a,y,E,x))},be=Cl.prototype,be.jp=function(a,y){lr.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},be.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Ga(a,E,x),Ss(this,"nodeParentKey",uo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},be.fm=function(a){lr.prototype.fm.call(this,a),a=this.wa(a);var y=dm(this,a);if(y!==null){var x=gi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;Ss(this,"nodeParentKey",uo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)xh(this,a,x[y]);Ii(x)}},be.em=function(a){lr.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&yh(this,y,a)},be.qp=function(a){lr.prototype.qp.call(this,a);var y=this.mh(a);xh(this,y,a)},be.lm=function(a,y){lr.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},be.Tl=function(){return!0},be.xs=function(){return!0},At.Object.defineProperties(Cl.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"}}}),Cl.prototype.setParentLinkCategoryForNodeData=Cl.prototype.Ms,Cl.prototype.getParentLinkCategoryForNodeData=Cl.prototype.ss,Cl.prototype.setParentKeyForNodeData=Cl.prototype.qe,Cl.prototype.getParentKeyForNodeData=Cl.prototype.mh,Cl.className="TreeModel",qu.TreeModel=Cl;function qa(a){Va.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=eh,this.Ti=0,this.Zv=new Ie,this.Jp=this.me=0,this.Xr=new vm,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=eh,this.K=bl,this.nd=Ep,this.hd=gy,this.tf=6,this.Nn=H0,a&&Object.assign(this,a)}_t(qa,Va),qa.prototype.cloneProtected=function(a){Va.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},qa.prototype.qb=function(a){a.classType===qa?a===G0||a===W0||a===z0||a===Z0||a===Ep?this.sorting=a:a===Rf||a===Pp||a===bl||a===Hc?this.direction=a:a===rc||a===Wc||a===eh||a===th?this.arrangement=a:(a===Mg||a===H0)&&(this.nodeDiameterFormula=a):Va.prototype.qb.call(this,a)},qa.prototype.createNetwork=function(){return new Cp(this)},qa.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 Nn;y.addAll(a.iterator),a=new Nn;var x=new Nn,E=this.sort(y),b,z,ee=this.Jp,re=this.arrangement,oe=this.nodeDiameterFormula,ue=this.radius;(!isFinite(ue)||0>=ue)&&(ue=NaN);var he=this.aspectRatio;(!isFinite(he)||0>=he)&&(he=1);var ge=this.startAngle;isFinite(ge)||(ge=0);var xe=this.sweepAngle;if((!isFinite(xe)||360<xe||1>xe)&&(xe=360),y=this.spacing,isFinite(y)||(y=NaN),re===th&&oe===Mg?re=eh:re===th&&oe!==Mg&&(re=this.arrangement),(this.direction===Rf||this.direction===Pp)&&this.sorting!==Ep){for(oe=0;!(oe>=E.length)&&(a.add(E.M(oe)),!(oe+1>=E.length));oe+=2)x.add(E.M(oe+1));this.direction===Rf?(this.arrangement===th&&a.reverse(),E=new Nn,E.addAll(a),E.addAll(x)):(this.arrangement===th&&x.reverse(),E=new Nn,E.addAll(x),E.addAll(a))}oe=E.length;for(var Pe=z=b=0;Pe<E.length;Pe++){var Fe=ge+xe*z*(this.direction===bl?1:-1)/oe,Ne=E.M(Pe).diameter;isNaN(Ne)&&(Ne=Vc(E.M(Pe),Fe)),360>xe&&(Pe===0||Pe===E.length-1)&&(Ne/=2),b+=Ne,z++}if(isNaN(ue)||re===th){if(isNaN(y)&&(y=6),re!==eh&&re!==th){for(z=-1/0,ee=0;ee<oe;ee++)Pe=E.M(ee),b=E.M(ee===oe-1?0:ee+1),isNaN(Pe.diameter)&&Vc(Pe,0),isNaN(b.diameter)&&Vc(b,0),z=Math.max(z,(Pe.diameter+b.diameter)/2);ee=z+y,re===rc?ue=(z+y)/(2*Math.PI/oe):ue=R0(this,ee*(360<=xe?oe:oe-1),he,ge*Math.PI/180,xe*Math.PI/180)}else ue=R0(this,b+(360<=xe?oe:oe-1)*(re!==th?y:1.6*y),he,ge*Math.PI/180,xe*Math.PI/180);z=ue*he}else if(z=ue*he,Pe=Ey(this,ue,z,ge*Math.PI/180,xe*Math.PI/180),isNaN(y))(re===eh||re===th)&&(y=(Pe-b)/(360<=xe?oe:oe-1));else if(re===eh||re===th)Pe=(Pe-b)/(360<=xe?oe:oe-1),Pe<y?(ue=R0(this,b+y*(360<=xe?oe:oe-1),he,ge*Math.PI/180,xe*Math.PI/180),z=ue*he):y=Pe;else{for(ee=-1/0,b=0;b<oe;b++)Fe=E.M(b),Ne=E.M(b===oe-1?0:b+1),isNaN(Fe.diameter)&&Vc(Fe,0),isNaN(Ne.diameter)&&Vc(Ne,0),ee=Math.max(ee,(Fe.diameter+Ne.diameter)/2);ee+=y,b=R0(this,ee*(360<=xe?oe:oe-1),he,ge*Math.PI/180,xe*Math.PI/180),b>ue?(ue=b,z=ue*he):ee=Pe/(360<=xe?oe:oe-1)}if(this.kw=re,this.lc=ue,this.Zm=he,this.lw=ge,this.Wp=xe,this.Ti=y,this.me=z,this.Jp=ee,y=E,E=this.kw,re=this.lc,ue=this.lw,he=this.Wp,ge=this.Ti,xe=this.me,oe=this.Jp,this.direction!==Rf&&this.direction!==Pp||E!==th)if(this.direction===Rf||this.direction===Pp){switch(ee=0,E){case Wc:ee=180*j0(this,re,xe,ue,oe)/Math.PI;break;case eh:oe=y=0,ee=a.first(),ee!==null&&(y=Vc(ee,Math.PI/2)),ee=x.first(),ee!==null&&(oe=Vc(ee,Math.PI/2)),ee=180*j0(this,re,xe,ue,ge+(y+oe)/2)/Math.PI;break;case rc:ee=he/y.length}if(this.direction===Rf){switch(E){case Wc:mm(this,a,ue,Hc);break;case eh:pm(this,a,ue,Hc);break;case rc:gm(this,a,he/2,ue,Hc)}switch(E){case Wc:mm(this,x,ue+ee,bl);break;case eh:pm(this,x,ue+ee,bl);break;case rc:gm(this,x,he/2,ue+ee,bl)}}else{switch(E){case Wc:mm(this,x,ue,Hc);break;case eh:pm(this,x,ue,Hc);break;case rc:gm(this,x,he/2,ue,Hc)}switch(E){case Wc:mm(this,a,ue+ee,bl);break;case eh:pm(this,a,ue+ee,bl);break;case rc:gm(this,a,he/2,ue+ee,bl)}}}else switch(E){case Wc:mm(this,y,ue,this.direction);break;case eh:pm(this,y,ue,this.direction);break;case rc:gm(this,y,he,ue,this.direction);break;case th:Dx(this,y,he,ue,this.direction)}else Dx(this,y,he,ue-he/2,bl)}this.updateParts(),this.network=null,this.isValidLayout=!0};function gm(a,y,x,E,b){var z=a.Wp,ee=a.lc;a=a.me,E=E*Math.PI/180,x=x*Math.PI/180;for(var re=y.length,oe=0;oe<re;oe++){var ue=E+(b===bl?oe*x/(360<=z?re:re-1):-(oe*x)/re),he=y.M(oe),ge=ee*Math.tan(ue)/a;ge=Math.sqrt((ee*ee+a*a*ge*ge)/(1+ge*ge)),he.centerX=ge*Math.cos(ue),he.centerY=ge*Math.sin(ue),he.actualAngle=180*ue/Math.PI}}function pm(a,y,x,E){var b=a.lc,z=a.me,ee=a.Ti;x=x*Math.PI/180;for(var re=y.length,oe=0;oe<re;oe++){var ue=y.M(oe),he=y.M(oe===re-1?0:oe+1),ge=z*Math.sin(x);ue.centerX=b*Math.cos(x),ue.centerY=ge,ue.actualAngle=180*x/Math.PI,isNaN(ue.diameter)&&Vc(ue,0),isNaN(he.diameter)&&Vc(he,0),ue=j0(a,b,z,E===bl?x:-x,(ue.diameter+he.diameter)/2+ee),x+=E===bl?ue:-ue}}function mm(a,y,x,E){var b=a.lc,z=a.me,ee=a.Jp;x=x*Math.PI/180;for(var re=y.length,oe=0;oe<re;oe++){var ue=y.M(oe);ue.centerX=b*Math.cos(x),ue.centerY=z*Math.sin(x),ue.actualAngle=180*x/Math.PI,ue=j0(a,b,z,E===bl?x:-x,ee),x+=E===bl?ue:-ue}}function Dx(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new vm,360>x){for(z=E+(b===bl?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,Ix(a,y,x,E,b)}else Tx(a,y,x,E,b);a.Xr.commit(y)}function Tx(a,y,x,E,b){var z=a.lc,ee=a.Ti,re=a.Zm,oe=z*Math.cos(E*Math.PI/180),ue=a.me*Math.sin(E*Math.PI/180),he=y.Fa();if(he.length===3)he[0].centerX=z,he[0].centerY=0,he[1].centerX=he[0].centerX-he[0].width/2-he[1].width/2-ee,he[1].y=he[0].y,he[2].centerX=(he[0].centerX+he[1].centerX)/2,he[2].y=he[0].y-he[2].height-ee;else if(he.length===4)he[0].centerX=z,he[0].centerY=0,he[2].centerX=-he[0].centerX,he[2].centerY=he[0].centerY,he[1].centerX=0,he[1].y=Math.min(he[0].y,he[2].y)-he[1].height-ee,he[3].centerX=0,he[3].y=Math.max(he[0].y+he[0].height+ee,he[2].y+he[2].height+ee);else{z=Ie.alloc();for(var ge=0;ge<he.length&&(he[ge].centerX=oe,he[ge].centerY=ue,!(ge>=he.length-1));ge++)_x(a,oe,ue,he,ge,b,z)||Ox(a,oe,ue,he,ge,b,z),oe=z.x,ue=z.y;if(Ie.free(z),a.mj++,!(23<a.mj)){oe=he[0].centerX,ue=he[0].centerY,z=he[he.length-1].centerX,ge=he[he.length-1].centerY;var xe=Math.abs(oe-z)-((he[0].width+he[he.length-1].width)/2+ee),Pe=Math.abs(ue-ge)-((he[0].height+he[he.length-1].height)/2+ee);ee=0,1>Math.abs(Pe)?Math.abs(oe-z)<(he[0].width+he[he.length-1].width)/2&&(ee=0):ee=0<Pe?Pe:1>Math.abs(xe)?0:xe,oe=Math.abs(z)>Math.abs(ge)?0<z!=ue>ge:0<ge!=oe<z,(oe=b===bl?oe:!oe)&&(ee=-Math.abs(ee),ee=Math.min(ee,-he[he.length-1].width),ee=Math.min(ee,-he[he.length-1].height)),a.Xr.compare(ee,he),1<Math.abs(ee)&&(a.lc=8>a.mj?a.lc-ee/(2*Math.PI):5>he.length&&10<ee?a.lc/2:a.lc-(0<ee?1.7:-2.3),a.me=a.lc*re,Tx(a,y,x,E,b))}}}function Ix(a,y,x,E,b){for(var z=a.lc,ee=a.me,re=a.Zm,oe=z*Math.cos(E*Math.PI/180),ue=ee*Math.sin(E*Math.PI/180),he=Ie.alloc(),ge=y.Fa(),xe=0;xe<ge.length&&(ge[xe].centerX=oe,ge[xe].centerY=ue,!(xe>=ge.length-1));xe++)_x(a,oe,ue,ge,xe,b,he)||Ox(a,oe,ue,ge,xe,b,he),oe=he.x,ue=he.y;if(Ie.free(he),a.mj++,!(23<a.mj)){if(oe=Math.atan2(ue,oe),oe=b===bl?a.gt-oe:oe-a.gt,oe=Math.abs(oe)<Math.abs(oe-2*Math.PI)?oe:oe-2*Math.PI,z=oe*(z+ee)/2,ee=a.Xr,Math.abs(z)<Math.abs(ee.Pl))for(ee.Pl=z,ee.mk=[],ee.tm=[],oe=0;oe<ge.length;oe++)ee.mk[oe]=ge[oe].bounds.x,ee.tm[oe]=ge[oe].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*re,Ix(a,y,x,E,b))}}function _x(a,y,x,E,b,z,ee){var re=a.lc,oe=a.me,ue=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var he=!1;if(0<=x!=(z===bl)){if(z=y+a,z>re){if(z=y-a,z<-re)return ee.x=z,ee.y=ue,!1;he=!0}}else if(z=y-a,z<-re){if(z=y+a,z>re)return ee.x=z,ee.y=ue,!1;he=!0}return ue=Math.sqrt(1-Math.min(1,z*z/(re*re)))*oe,0>x!==he&&(ue=-ue),Math.abs(x-ue)>(E[b].height+E[b+1].height)/2?(ee.x=z,ee.y=ue,!1):(ee.x=z,ee.y=ue,!0)}function Ox(a,y,x,E,b,z,ee){var re=a.lc,oe=a.me,ue=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===bl)){if(z=x-a,z<-oe){if(z=x+a,z>oe){ee.x=ue,ee.y=z;return}E=!0}}else if(z=x+a,z>oe){if(z=x-a,z<-oe){ee.x=ue,ee.y=z;return}E=!0}ue=Math.sqrt(1-Math.min(1,z*z/(oe*oe)))*re,0>y!==E&&(ue=-ue),ee.x=ue,ee.y=z}qa.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},qa.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 Ie(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))},qa.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function Ey(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 ee=0,re=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),oe=0,ue=0;ue<=z;ue++){E!==void 0&&b!==void 0?oe=E+ue*b/z:oe=ue*Math.PI/(2*z);var he=Math.sin(oe);ee+=Math.sqrt(1-a*a*he*he)*re}return E!==void 0&&b!==void 0?(y>x?y:x)*ee:4*(y>x?y:x)*ee}function R0(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?Ey(a,1,x,E,b):Ey(a,1,x))}function j0(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,ee=0;a=2*Math.PI/(700*a.network.vertexes.count),y>x&&(E+=Math.PI/2);for(var re=0;;re++){var oe=Math.sin(E+re*a);if(ee+=(y>x?y:x)*Math.sqrt(1-z*z*oe*oe)*a,ee>=b)return re*a}}qa.prototype.sort=function(a){switch(this.sorting){case z0:break;case Z0:a.reverse();break;case G0:a.sort(this.comparer);break;case W0:a.sort(this.comparer),a.reverse();break;case Ep:return this.ak(DS(a));default:Ke("Invalid sorting type.")}return a};function DS(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new Nn;for(var E=0;E<a.length;E++){var b=-1,z=-1;if(E===0)for(var ee=0;ee<a.length;ee++){var re=a.M(ee).edgesCount;re>b&&(b=re,z=ee)}else for(ee=0;ee<a.length;ee++)re=y[ee],re>b&&(b=re,z=ee);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),ee=z.sourceEdges;ee.next();)b=a.indexOf(ee.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}qa.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 ee=[],re=[];E=[],b=new Nn;for(var oe=0,ue=0;ue<y.length;ue++){var he=y[ue].length;if(he===1)E.push(ue);else if(he===0)b.add(a.M(ue));else{if(oe===0)x.push(ue);else{for(var ge=he=1/0,xe=-1,Pe=[],Fe=0;Fe<x.length;Fe++)0>y[x[Fe]].indexOf(x[Fe===x.length-1?0:Fe+1])&&Pe.push(Fe===x.length-1?0:Fe+1);if(Pe.length===0)for(Fe=0;Fe<x.length;Fe++)Pe.push(Fe);for(Fe=0;Fe<Pe.length;Fe++){for(var Ne=Pe[Fe],Je=y[ue],Ve=0,ut=0;ut<ee.length;ut++){var ft=z[ee[ut]],vt=z[re[ut]];if(ft<vt){var bt=ft;ft=vt}else bt=vt;if(bt<Ne&&Ne<=ft)for(vt=0;vt<Je.length;vt++){var zt=Je[vt];0>x.indexOf(zt)||bt<z[zt]&&z[zt]<ft||bt===z[zt]||ft===z[zt]||Ve++}else for(vt=0;vt<Je.length;vt++)zt=Je[vt],0>x.indexOf(zt)||bt<z[zt]&&z[zt]<ft&&bt!==z[zt]&&ft!==z[zt]&&Ve++}for(Je=Ve,ut=Ve=0;ut<y[ue].length;ut++)bt=x.indexOf(y[ue][ut]),0<=bt&&(bt=Math.abs(Ne-(bt>=Ne?bt+1:bt)),Ve+=bt<x.length+1-bt?bt:x.length+1-bt);for(ut=0;ut<ee.length;ut++)bt=z[ee[ut]],ft=z[re[ut]],bt>=Ne&&bt++,ft>=Ne&&ft++,bt>ft&&(vt=ft,ft=bt,bt=vt),ft-bt<(x.length+2)/2==(bt<Ne&&Ne<=ft)&&Ve++;(Je<he||Je===he&&Ve<ge)&&(he=Je,ge=Ve,xe=Ne)}for(x.splice(xe,0,ue),he=0;he<x.length;he++)z[x[he]]=he;for(he=0;he<y[ue].length;he++)ge=y[ue][he],0<=x.indexOf(ge)&&(ee.push(ue),re.push(ge))}oe++}}for(ee=x.length;;){for(z=!0,re=0;re<E.length;re++)if(oe=E[re],ue=y[oe][0],he=x.indexOf(ue),0<=he){for(xe=ge=0;xe<y[ue].length;xe++)Pe=x.indexOf(y[ue][xe]),0>Pe||Pe===he||(Fe=Pe>he?Pe-he:he-Pe,ge+=Pe<he!=Fe>ee-Fe?1:-1);x.splice(0>ge?he:he+1,0,oe),E.splice(re,1),re--}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},At.Object.defineProperties(qa.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!==th&&a!==eh&&a!==Wc&&a!==rc||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==bl&&a!==Hc&&a!==Rf&&a!==Pp||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==z0&&a!==Z0&&a!==G0&&!W0&&a!==Ep||(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!==H0&&a!==Mg||(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 eh=new yn(qa,"ConstantSpacing",0),Wc=new yn(qa,"ConstantDistance",1),rc=new yn(qa,"ConstantAngle",2),th=new yn(qa,"Packed",3),bl=new yn(qa,"Clockwise",4),Hc=new yn(qa,"Counterclockwise",5),Rf=new yn(qa,"BidirectionalLeft",6),Pp=new yn(qa,"BidirectionalRight",7),z0=new yn(qa,"Forwards",8),Z0=new yn(qa,"Reverse",9),G0=new yn(qa,"Ascending",10),W0=new yn(qa,"Descending",11),Ep=new yn(qa,"Optimized",12),H0=new yn(qa,"Pythagorean",13),Mg=new yn(qa,"Circular",14);qa.className="CircularLayout",qa.ConstantSpacing=eh,qa.ConstantDistance=Wc,qa.ConstantAngle=rc,qa.Packed=th,qa.Clockwise=bl,qa.Counterclockwise=Hc,qa.BidirectionalLeft=Rf,qa.BidirectionalRight=Pp,qa.Forwards=z0,qa.Reverse=Z0,qa.Ascending=G0,qa.Descending=W0,qa.Optimized=Ep,qa.Pythagorean=H0,qa.Circular=Mg;function vm(){this.Pl=-1/0,this.tm=this.mk=null}vm.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},vm.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]}},vm.className="VertexArrangement";function Cp(a){_a.call(this,a)}_t(Cp,_a),Cp.prototype.createVertex=function(){return new ym(this)},Cp.prototype.createEdge=function(){return new V0(this)},Cp.className="CircularNetwork";function ym(a){Ps.call(this,a),this.u=this.Si=NaN}_t(ym,Ps);function Vc(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===th)if(x.nodeDiameterFormula===Mg)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===Mg?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}At.Object.defineProperties(ym.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)}}}),ym.className="CircularVertex";function V0(a){nu.call(this,a)}_t(V0,nu),V0.className="CircularEdge";function tl(a){Va.call(this),this.ah=null,this.An=0,this.$d=new Pn(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)}_t(tl,Va),tl.prototype.cloneProtected=function(a){Va.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},tl.prototype.createNetwork=function(){return new kg(this)},tl.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}Rx(this,0,a)}this.network=y;var ee=E=x.iterator;E=this.arrangementSpacing;var re=ee.count,oe=!0;z=b=0;for(var ue=gi(),he=0;he<re+y.vertexes.count+2;he++)ue[he]=null;re=0,ee.reset();for(var ge=Wt.alloc();ee.next();)if(he=ee.value,this.computeBounds(he,ge),oe)oe=!1,b=ge.x+ge.width/2,z=ge.y+ge.height/2,ue[0]=new Ie(ge.x+ge.width+E.width,ge.y),ue[1]=new Ie(ge.x,ge.y+ge.height+E.height),re=2;else{var xe=jx(ue,re,b,z,ge.width,ge.height,E),Pe=ue[xe],Fe=new Ie(Pe.x+ge.width+E.width,Pe.y),Ne=new Ie(Pe.x,Pe.y+ge.height+E.height);for(xe+1<re&&ue.splice(xe+1,0,null),ue[xe]=Fe,ue[xe+1]=Ne,re++,xe=Pe.x-ge.x,Pe=Pe.y-ge.y,he=he.vertexes.iterator;he.next();)Fe=he.value,Fe.centerX+=xe,Fe.centerY+=Pe}for(Wt.free(ge),he=y.vertexes.iterator;he.next();)ee=he.value,xe=ee.bounds,2>re?(b=xe.x+xe.width/2,z=xe.y+xe.height/2,ue[0]=new Ie(xe.x+xe.width+E.width,xe.y),ue[1]=new Ie(xe.x,xe.y+xe.height+E.height),re=2):(oe=jx(ue,re,b,z,xe.width,xe.height,E),ge=ue[oe],Pe=new Ie(ge.x+xe.width+E.width,ge.y),xe=new Ie(ge.x,ge.y+xe.height+E.height),oe+1<re&&ue.splice(oe+1,0,null),ue[oe]=Pe,ue[oe+1]=xe,re++,ee.centerX=ge.x+ee.width/2,ee.centerY=ge.y+ee.height/2);for(Ii(ue),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)}}Zx(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},tl.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},tl.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 Rx(a,y,x){if(TS(a,y)){var E=a.Zf;a.Zf*=1+1/(y+1);var b=IS(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,Rx(a,y+1,x),Zx(a,z),_S(a,b),y=b.vertexes.Fa(),y.sort(function(ee,re){return ee===null||re===null||ee===re?0:re.Vd-ee.Vd}),x=0;x<y.length;x++)OS(a,y[x]);a.Zf=E}}function TS(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 IS(a,y){for(var x=a.network,E=new kg(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var ee=new Gx;ee.Rs=z.Vd,ee.Ss=z.width,ee.Qs=z.height,ee.Sv=z.focus.x,ee.Tv=z.focus.y,z.We===null&&(z.We=new Nn),z.We.add(ee),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var re=z.value;b=re.fromVertex,ee=re.toVertex,b.network===E&&ee.network===E?E.Bo(re):b.network===E?(re=b.Hj,re===null&&(re=new Nn,b.Hj=re),re.add(ee),b.Vd--,b.sh+=ee.sh):ee.network===E&&(re=ee.Hj,re===null&&(re=new Nn,ee.Hj=re),re.add(b),ee.Vd--,ee.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,Re.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var oe=b.Hj;if(oe!==null&&0<oe.count&&(ee=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=ee))){for(var ue=re=0,he=oe.count-ee;he<oe.count;he++){var ge=oe.M(he),xe=null;for(z=ge.edges.iterator;z.next();){var Pe=z.value;if(Pe.Ax(ge)===b){xe=Pe;break}}xe!==null&&(ue+=xe.length,re+=ge.width*ge.height)}z=b.centerX,oe=b.centerY,he=b.width,ge=b.height,xe=b.focus,Pe=he*ge,1>Pe&&(Pe=1),re=Re.sqrt((re+Pe+ue*ue*4/(ee*ee))/Pe),ee=(re-1)*he/2,re=(re-1)*ge/2,b.bounds=new Wt(z-xe.x-ee,oe-xe.y-re,he+2*ee,ge+2*re),b.focus=new Ie(xe.x+ee,xe.y+re)}}return a.network=E,x}function _S(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,ee=b.Tv;E.bounds=new Wt(E.centerX-z,E.centerY-ee,b.Ss,b.Qs),E.focus=new Ie(z,ee),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function OS(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var E=y.centerX,b=y.centerY,z=y.width,ee=y.height;y.We!==null&&0<y.We.count&&(ee=y.We.M(0),z=ee.Ss,ee=ee.Qs),z=Re.sqrt(z*z+ee*ee)/2;for(var re=!1,oe=ee=0,ue=0,he=y.vertexes.iterator;he.next();){var ge=he.value;1>=ge.Vd?oe++:(re=!0,ue++,ee+=Math.atan2(y.centerY-ge.centerY,y.centerX-ge.centerX))}if(oe!==0){for(0<ue&&(ee/=ue),ue=y=0,y=re?2*Math.PI/(oe+1):2*Math.PI/oe,oe%2===0&&(ue=y/2),1<x.count&&x.sort(function(Pe,Fe){return Pe===null||Fe===null||Pe===Fe?0:Fe.width*Fe.height-Pe.width*Pe.height}),re=oe%2===0?0:1,x=x.iterator;x.next();)if(oe=x.value,!(1<oe.Vd||a.isFixed(oe))){for(he=null,ge=oe.edges.iterator;ge.next();){he=ge.value;break}ge=oe.width;var xe=oe.height;ge=Re.sqrt(ge*ge+xe*xe)/2,he=z+he.length+ge,ge=ee+(y*(re/2>>1)+ue)*(re%2===0?1:-1),oe.centerX=E+he*Math.cos(ge),oe.centerY=b+he*Math.sin(ge),re++}}}}function jx(a,y,x,E,b,z,ee){var re=9e19,oe=-1,ue=0;e:for(;ue<y;ue++){var he=a[ue],ge=he.x-x,xe=he.y-E;if(ge=ge*ge+xe*xe,ge<re){for(xe=ue-1;0<=xe;xe--)if(a[xe].y>he.y&&a[xe].x-he.x<b+ee.width)continue e;for(xe=ue+1;xe<y;xe++)if(a[xe].x>he.x&&a[xe].y-he.y<z+ee.height)continue e;oe=ue,re=ge}}return oe}tl.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},tl.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 zx(a,y){var x=a.bounds,E=x.x;a=x.y;var b=x.width;x=x.height;var z=y.bounds,ee=z.x;y=z.y;var re=z.width;return z=z.height,E+b<ee?a>y+z?(x=E+b-ee,a=a-y-z,Re.sqrt(x*x+a*a)):a+x<y?(E=E+b-ee,a=a+x-y,Re.sqrt(E*E+a*a)):ee-(E+b):E>ee+re?a>y+z?(x=E-ee-re,a=a-y-z,Re.sqrt(x*x+a*a)):a+x<y?(E=E-ee-re,a=a+x-y,Re.sqrt(E*E+a*a)):E-(ee+re):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function Zx(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,RS(a)););a.ah=null}function RS(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,ee=1;ee<y.length;ee++){var re=y[ee];re.forceX=0,re.forceY=0;var oe=re.centerX;re=re.centerY,E=Math.min(E,oe),b=Math.max(b,oe),x=Math.min(x,re),z=Math.max(z,re)}(b=b-E>z-x)?y.sort(function(Ne,Je){return Ne===null||Je===null||Ne===Je?0:Ne.centerX-Je.centerX}):y.sort(function(Ne,Je){return Ne===null||Je===null||Ne===Je?0:Ne.centerY-Je.centerY}),x=a.Zf;var ue=E=re=0;for(z=0;z<y.length;z++){ee=y[z],E=ee.bounds,re=ee.focus,oe=E.x+re.x;var he=E.y+re.y;E=ee.charge*a.electricalFieldX(oe,he),ue=ee.charge*a.electricalFieldY(oe,he),E+=ee.mass*a.gravitationalFieldX(oe,he),ue+=ee.mass*a.gravitationalFieldY(oe,he),ee.forceX+=E,ee.forceY+=ue;for(var ge=z+1;ge<y.length;ge++){var xe=y[ge];if(xe!==ee){E=xe.bounds,re=xe.focus,ue=E.x+re.x;var Pe=E.y+re.y;if(oe-ue>x||ue-oe>x){if(b)break}else if(he-Pe>x||Pe-he>x){if(!b)break}else{var Fe=zx(ee,xe);1>Fe?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new K0),Fe=E.random(),re=E.random(),oe>ue?(E=Math.abs(xe.bounds.right-ee.bounds.x),E=(1+E)*Fe):oe<ue?(E=Math.abs(xe.bounds.x-ee.bounds.right),E=-(1+E)*Fe):(E=Math.max(xe.width,ee.width),E=(1+E)*Fe-E/2),he>Pe?(ue=Math.abs(xe.bounds.bottom-ee.bounds.y),ue=(1+ue)*re):oe<ue?(ue=Math.abs(xe.bounds.y-ee.bounds.bottom),ue=-(1+ue)*re):(ue=Math.max(xe.height,ee.height),ue=(1+ue)*re-ue/2)):(re=-(ee.charge*xe.charge)/(Fe*Fe),E=(ue-oe)/Fe*re,ue=(Pe-he)/Fe*re),ee.forceX+=E,ee.forceY+=ue,xe.forceX-=E,xe.forceY-=ue}}}}for(b=a.network.edges.iterator;b.next();)re=b.value,x=re.fromVertex,z=re.toVertex,ee=x.bounds,oe=x.focus,E=ee.x+oe.x,ee=ee.y+oe.y,he=z.bounds,ge=z.focus,oe=he.x+ge.x,he=he.y+ge.y,ge=zx(x,z),1>ge?(ge=a.randomNumberGenerator,ge===null&&(a.randomNumberGenerator=ge=new K0),re=ge.random(),ge=ge.random(),E=(E>oe?1:-1)*(1+(z.width>x.width?z.width:x.width))*re,ue=(ee>he?1:-1)*(1+(z.height>x.height?z.height:x.height))*ge):(re=re.stiffness*(ge-re.length),E=(oe-E)/ge*re,ue=(he-ee)/ge*re),x.forceX+=E,x.forceY+=ue,z.forceX-=E,z.forceY-=ue;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}tl.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},tl.prototype.moveFixedVertex=function(){},tl.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},tl.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=ar,y.toSpot=ar)}},tl.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=Wt.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,Wt.free(x)}x=Wt.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()}Wt.free(x)},tl.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},tl.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},tl.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},tl.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},tl.prototype.electricalFieldX=function(){return 0},tl.prototype.electricalFieldY=function(){return 0},tl.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},tl.prototype.gravitationalFieldX=function(){return 0},tl.prototype.gravitationalFieldY=function(){return 0},tl.prototype.isFixed=function(a){return a.isFixed},At.Object.defineProperties(tl.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"&&Ke('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())}}}),tl.className="ForceDirectedLayout";function Gx(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}Gx.className="ForceDirectedSubnet";function kg(a){_a.call(this,a)}_t(kg,_a),kg.prototype.createVertex=function(){return new xm(this)},kg.prototype.createEdge=function(){return new Sm(this)},kg.className="ForceDirectedNetwork";function xm(a){Ps.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}_t(xm,Ps),At.Object.defineProperties(xm.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)}}}),xm.className="ForceDirectedVertex";function Sm(a){nu.call(this,a),this.j=this.o=NaN}_t(Sm,nu),At.Object.defineProperties(Sm.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)}}}),Sm.className="ForceDirectedEdge";function K0(){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()}K0.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},K0.className="RandomNumberGenerator";function xa(a){Va.call(this),this.kc=this.ie=25,this.K=0,this.Dk=Q0,this.Zk=$0,this.Qk=q0,this.bj=4,this.rk=ev,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 Ie,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}_t(xa,Va),xa.prototype.cloneProtected=function(a){Va.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},xa.prototype.qb=function(a){a.classType===xa?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:Ke("Unknown enum value: "+a):Va.prototype.qb.call(this,a)},xa.prototype.createNetwork=function(){return new Fp(this)},xa.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!==Pm&&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===Pm&&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 ee=0,re=0,oe=0,ue=0;if(E.link!==null){if(re=E.link,re===null)continue;var he=b.node;if(ee=z.node,he===null||ee===null)continue;var ge=re.fromNode;oe=re.toNode;for(var xe=re.fromPort;xe!==null&&!xe.Ed();)xe=xe.panel;for(re=re.toPort;re!==null&&!re.Ed();)re=re.panel;if(E.rev){ue=ge;var Pe=xe;ge=oe,xe=re,oe=ue,re=Pe}var Fe=b.focus;ue=z.focus;var Ne=E.rev?z.bounds:b.bounds;Pe=Ie.alloc(),he!==ge?Ne.w()&&ge.isVisible()?ge.actualBounds.w()?(qd(ge,xe,Hr,Pe),Pe.x+=ge.actualBounds.x-Ne.x,Pe.y+=ge.actualBounds.y-Ne.y):(qd(ge,xe,Hr,Pe),Pe.w()||Pe.assign(Fe)):Pe.assign(Fe):Ne.w()?(qd(ge,xe,Hr,Pe),Pe.w()||Pe.assign(Fe)):Pe.assign(Fe),ge=E.rev?b.bounds:z.bounds,he=Ie.alloc(),ee!==oe?ge.w()&&oe.isVisible()?oe.actualBounds.w()?(qd(oe,re,Hr,he),he.x+=oe.actualBounds.x-ge.x,he.y+=oe.actualBounds.y-ge.y):(qd(oe,re,Hr,he),he.w()||he.assign(ue)):he.assign(ue):ge.w()?(qd(oe,re,Hr,he),he.w()||he.assign(ue)):he.assign(ue),this.K===90||this.K===270?(ee=Math.round((Pe.x-Fe.x)/this.kc),oe=Pe.x,re=Math.round((he.x-ue.x)/this.kc),ue=he.x):(ee=Math.round((Pe.y-Fe.y)/this.kc),oe=Pe.y,re=Math.round((he.y-ue.y)/this.kc),ue=he.y),Ie.free(Pe),Ie.free(he),E.portFromColOffset=ee,E.portFromPos=oe,E.portToColOffset=re,E.portToPos=ue}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(Pe=b.layer,he=z.layer,ge=0,Ne=E.link,Ne!==null){var Je=Ne.fromPort,Ve=Ne.toPort;if(Je!==null&&Ve!==null){var ut=Ne.fromNode;if(xe=Ne.toNode,ut!==null&&xe!==null){var ft=J0(this,!0),vt=J0(this,!1),bt=this.setsPortSpots?ft:Ne.computeSpot(!0,Je);Fe=this.setsPortSpots?vt:Ne.computeSpot(!1,Ve);var zt=Ne.isOrthogonal;bt.$c()&&bt.Hf(vt)&&Fe.$c()&&Fe.Hf(ft)?ge=0:(ft=Ne.getLinkPoint(ut,Je,bt,!0,zt,xe,Ve,Ie.alloc()),vt=Ne.getLinkDirection(ut,Je,ft,bt,!0,zt,xe,Ve),Ie.free(ft),bt.ys()||vt!==Qx(this,E,!0)?this.setsPortSpots&&ut!==null&&ut.ports.count===1&&E.rev&&(ge+=1):ge+=1,bt=Ne.getLinkPoint(xe,Ve,Fe,!1,zt,ut,Je,Ie.alloc()),Ne=Ne.getLinkDirection(xe,Ve,bt,Fe,!1,zt,ut,Je),Ie.free(bt),Fe.ys()||Ne!==Qx(this,E,!1)?this.setsPortSpots&&xe!==null&&xe.ports.count===1&&E.rev&&(ge+=2):ge+=2)}}}if(xe=ge,ge=xe===1||xe===3,(xe=xe===2||xe===3)&&(Fe=a.createVertex(),Fe.node=null,Fe.Dj=1,Fe.layer=Pe,Fe.near=b,a.dh(Fe),b=a.Zj(b,Fe,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=ee,b.portToColOffset=0,b.portFromPos=oe,b.portToPos=0,b=Fe),Ne=1,ge&&Ne--,Pe-he>Ne&&0<Pe){for(E.valid=!1,Fe=a.createVertex(),Fe.node=null,Fe.Dj=2,Fe.layer=Pe-1,a.dh(Fe),b=a.Zj(b,Fe,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=xe?0:ee,b.portToColOffset=0,b.portFromPos=xe?0:oe,b.portToPos=0,b=Fe,Pe--;Pe-he>Ne&&0<Pe;)Fe=a.createVertex(),Fe.node=null,Fe.Dj=3,Fe.layer=Pe-1,a.dh(Fe),b=a.Zj(b,Fe,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=Fe,Pe--;b=a.Zj(Fe,z,E.link),b.valid=!ge,ge&&(Fe.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=re,b.portFromPos=0,b.portToPos=ue}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=Kc(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),Uc(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},xa.prototype.linkMinLength=function(){return 1};function Cy(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}xa.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},xa.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 _l(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 Mu(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 Wx(a,y,x){var E=Kc(a,y),b=a.tc[y];(a.Jn===null||a.Jn.length<b*b)&&(a.Jn=[]);for(var z=a.Jn,ee=0;ee<b;ee++){var re=0,oe=E[ee],ue=oe.near;if(ue!==null&&ue.layer===oe.layer)if(oe=ue.index,oe>ee)for(var he=ee+1;he<oe;he++){var ge=E[he];ge.near===ue&&ge.Dj===ue.Dj||re++}else for(he=ee-1;he>oe;he--)ge=E[he],ge.near===ue&&ge.Dj===ue.Dj||re++;var xe;if(0<=x)for(oe=E[ee].sourceEdgesArrayAccess,ue=0;ue<oe.length;ue++){var Pe=oe[ue];if(Pe.valid&&Pe.fromVertex.layer!==y)for(ge=Pe.fromVertex.index,he=Pe.portToPos,Pe=Pe.portFromPos,xe=ue+1;xe<oe.length;xe++){var Fe=oe[xe];if(Fe.valid&&Fe.fromVertex.layer!==y){var Ne=Fe.fromVertex.index,Je=Fe.portToPos;Fe=Fe.portFromPos,he<Je&&(ge>Ne||ge===Ne&&Pe>Fe)&&re++,Je<he&&(Ne>ge||Ne===ge&&Fe>Pe)&&re++}}}if(0>=x){for(oe=E[ee].destinationEdgesArrayAccess,ue=0;ue<oe.length;ue++)if(Pe=oe[ue],Pe.valid&&Pe.toVertex.layer!==y)for(ge=Pe.toVertex.index,he=Pe.portToPos,Pe=Pe.portFromPos,xe=ue+1;xe<oe.length;xe++)Fe=oe[xe],Fe.valid&&Fe.toVertex.layer!==y&&(Ne=Fe.toVertex.index,Je=Fe.portToPos,Fe=Fe.portFromPos,Pe<Fe&&(ge>Ne||ge===Ne&&he>Je)&&re++,Fe<Pe&&(Ne>ge||Ne===ge&&Je>he)&&re++)}for(z[ee*b+ee]=re,oe=ee+1;oe<b;oe++){var Ve=0,ut=0;if(0<=x){re=E[ee].sourceEdgesArrayAccess;var ft=E[oe].sourceEdgesArrayAccess;for(ue=0;ue<re.length;ue++)if(Pe=re[ue],Pe.valid&&Pe.fromVertex.layer!==y)for(ge=Pe.fromVertex.index,Pe=Pe.portFromPos,xe=0;xe<ft.length;xe++)Fe=ft[xe],Fe.valid&&Fe.fromVertex.layer!==y&&(Ne=Fe.fromVertex.index,Fe=Fe.portFromPos,(ge<Ne||ge===Ne&&Pe<Fe)&&ut++,(Ne<ge||Ne===ge&&Fe<Pe)&&Ve++)}if(0>=x){for(re=E[ee].destinationEdgesArrayAccess,ft=E[oe].destinationEdgesArrayAccess,ue=0;ue<re.length;ue++)if(Pe=re[ue],Pe.valid&&Pe.toVertex.layer!==y)for(ge=Pe.toVertex.index,he=Pe.portToPos,xe=0;xe<ft.length;xe++)Fe=ft[xe],Fe.valid&&Fe.toVertex.layer!==y&&(Ne=Fe.toVertex.index,Je=Fe.portToPos,(ge<Ne||ge===Ne&&he<Je)&&ut++,(Ne<ge||Ne===ge&&Je<he)&&Ve++)}z[ee*b+oe]=Ve,z[oe*b+ee]=ut}}return Uc(a,y,E),z}xa.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=Wx(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 U0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=Kc(E,b),ee=E.tc[b],re=0,oe=0;oe<ee;oe++){var ue=z[oe].destinationEdgesArrayAccess;if(ue!==null)for(var he=0;he<ue.length;he++){var ge=ue[he];if(ge.valid&&ge.toVertex.layer!==b){var xe=ge.fromVertex.column+ge.portFromColOffset,Pe=ge.toVertex.column+ge.portToColOffset;re+=(Math.abs(xe-Pe)+1)*Cy(ge)}}}Uc(E,b,z),y+=re}return y}xa.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 by(a,y,x){for(var E=Kc(a,y),b=a.tc[y],z=[],ee=0;ee<b;ee++){var re=E[ee],oe=null;0>=x&&(oe=re.sourceEdgesArrayAccess);var ue=null;0<=x&&(ue=re.destinationEdgesArrayAccess);var he=0,ge=0,xe=re.near;if(xe!==null&&xe.layer===re.layer&&(he+=xe.column-1,ge++),oe!==null)for(xe=0;xe<oe.length;xe++){re=oe[xe];var Pe=re.fromVertex;re.valid&&!re.rev&&Pe.layer!==y&&(he+=Pe.column,ge++)}if(ue!==null)for(oe=0;oe<ue.length;oe++)re=ue[oe],xe=re.toVertex,re.valid&&!re.rev&&xe.layer!==y&&(he+=xe.column,ge++);z[ee]=ge===0?-1:he/ge}return Uc(a,y,E),z}function Hx(a,y,x){for(var E=Kc(a,y),b=a.tc[y],z=[],ee=0;ee<b;ee++){var re=E[ee],oe=null;0>=x&&(oe=re.sourceEdgesArrayAccess);var ue=null;0<=x&&(ue=re.destinationEdgesArrayAccess);var he=0,ge=[],xe=re.near;if(xe!==null&&xe.layer===re.layer&&(ge[he]=xe.column-1,he++),re=void 0,oe!==null)for(xe=0;xe<oe.length;xe++){re=oe[xe];var Pe=re.fromVertex;re.valid&&!re.rev&&Pe.layer!==y&&(ge[he]=Pe.column+re.portFromColOffset,he++)}if(ue!==null)for(oe=0;oe<ue.length;oe++)re=ue[oe],xe=re.toVertex,re.valid&&!re.rev&&xe.layer!==y&&(ge[he]=xe.column+re.portToColOffset,he++);he===0?z[ee]=-1:(ge.sort(function(Fe,Ne){return Fe-Ne}),ue=he>>1,z[ee]=he&1?ge[ue]:ge[ue-1]+ge[ue]>>1)}return Uc(a,y,E),z}function wm(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var ee=y.destinationEdges;ee.next();){var re=ee.value,oe=re.toVertex,ue=y.layer-oe.layer;re=a.linkMinLength(re),ue===re&&wm(a,oe,x,E,b,z)}if(z)for(ee=y.sourceEdges;ee.next();)re=ee.value,oe=re.fromVertex,ue=oe.layer-y.layer,re=a.linkMinLength(re),ue===re&&wm(a,oe,x,E,b,z)}}function Fy(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var ee=y.destinationEdges;ee.next();)Fy(a,ee.value.toVertex,x,E,b,z);if(z)for(y=y.sourceEdges;y.next();)Fy(a,y.value.fromVertex,x,E,b,z)}}xa.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case My: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(;jS(a)!==null;){for(b=Vx(a);b!==null;)E[x]=b,x--,b.valid=!1,b=Vx(a);for(b=Kx(a);b!==null;)E[y]=b,y++,b.valid=!1,b=Kx(a);b=null;for(var z=0,ee=this.network.vertexes.iterator;ee.next();){var re=ee.value;if(re.valid){for(var oe=0,ue=re.destinationEdges;ue.next();)ue.value.toVertex.valid&&oe++;ue=0;for(var he=re.sourceEdges;he.next();)he.value.fromVertex.valid&&ue++;(b===null||z<oe-ue)&&(b=re,z=oe-ue)}}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 Q0: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&&Ly(this,y);for(E.reset();E.next();)y=E.value,y.Ll===-1&&Ly(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 Pm: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 jS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function Vx(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 Kx(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 Ly(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,Ly(a,b))}y.finish=a.Kn,a.Kn++}xa.prototype.assignLayers=function(){switch(this.Zk){case ky:Ux(this);break;case Ay:for(var a,y=this.network.vertexes.iterator;y.next();)a=Xx(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 $0:for(Ux(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&Jx(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 Ux(a){for(var y=a.network.vertexes.iterator;y.next();){var x=Yx(a,y.value);a.Ia=Math.max(x,a.Ia)}}function Yx(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,Yx(a,z)+b)}y.layer=x}else x=y.layer;return x}function Xx(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,Xx(a,z)+b)}y.layer=x}else x=y.layer;return x}function Jx(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)Jx(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 ee=E[z],re=ee.fromVertex,oe=ee.toVertex;ee=a.linkMinLength(ee),re.layer-oe.layer>ee&&wm(a,re,0,-1,!0,!1)}for(wm(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,re=0,oe=null,ee=a.network.vertexes.iterator;ee.next();){var ue=ee.value;if(ue.component===1){var he=0,ge=!1,xe=ue.sourceEdgesArrayAccess;b=xe.length;for(var Pe=0;Pe<b;Pe++){var Fe=xe[Pe],Ne=Fe.fromVertex;he+=1,Ne.component!==1&&(z+=1,Ne=Ne.layer-ue.layer,Fe=a.linkMinLength(Fe),E=Math.min(E,Ne-Fe))}for(xe=ue.destinationEdgesArrayAccess,b=xe.length,Pe=0;Pe<b;Pe++)Fe=xe[Pe].toVertex,--he,Fe.component!==1?--z:ge=!0;(oe===null||he<re)&&!ge&&(oe=ue,re=he)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else oe.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(wm(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,re=null,oe=a.network.vertexes.iterator;oe.next();)if(ee=oe.value,ee.component===1){for(ue=0,he=!1,xe=ee.sourceEdgesArrayAccess,ge=xe.length,Pe=0;Pe<ge;Pe++)Fe=xe[Pe].fromVertex,ue+=1,Fe.component!==1?E+=1:he=!0;for(xe=ee.destinationEdgesArrayAccess,ge=xe.length,Pe=0;Pe<ge;Pe++)Fe=xe[Pe],Ne=Fe.toVertex,--ue,Ne.component!==1&&(--E,Ne=ee.layer-Ne.layer,Fe=a.linkMinLength(Fe),b=Math.min(b,Ne-Fe));(re===null||ue>z)&&!he&&(re=ee,z=ue)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);y.component=0}else re.component=0}}}function Qx(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}xa.prototype.initializeIndices=function(){switch(this.Qk){default:case Dy: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 q0: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&&$x(this,x);break;case Ny: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&&qx(this,x)}};function $x(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&&$x(a,E))}function qx(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&&qx(a,E))}xa.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=_l(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Y0(this,E,1),Zu(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=_l(this)),E=this.Ia;0<=E;E--)Y0(this,E,-1),Zu(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=_l(this))}for(Mu(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Y0(this,E,0),Zu(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=_l(this)),E=this.Ia;0<=E;E--)Y0(this,E,0),Zu(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=_l(this))}Mu(this,y);var z,ee,re;switch(this.rk){case Ty:break;case Iy:for(re=a+1;(E=this.countCrossings())<re;)for(re=E,x=this.Ia;0<=x;x--)for(ee=0;ee<=x;ee++){for(z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=Zu(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=Zu(this,E,1)||z;for(b=this.countCrossings(),b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=Zu(this,E,1)||z;for(b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=Zu(this,E,-1)||z;for(b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=Zu(this,E,0)||z;for(b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=Zu(this,E,0)||z;b>=a?Mu(this,y):(a=b,y=_l(this))}break;default:case ev:for(x=this.Ia,ee=0,re=a+1;(E=this.countCrossings())<re;){for(re=E,z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=Zu(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=Zu(this,E,1)||z;for(b=this.countCrossings(),b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=Zu(this,E,1)||z;for(b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=Zu(this,E,-1)||z;for(b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=Zu(this,E,0)||z;for(b>=a?Mu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=Zu(this,E,0)||z;b>=a?Mu(this,y):(a=b,y=_l(this))}}Mu(this,y)};function Y0(a,y,x){var E=Kc(a,y),b=a.tc[y],z=Hx(a,y,x),ee=by(a,y,x);for(x=0;x<b;x++)ee[x]===-1&&(ee[x]=E[x].column),z[x]===-1&&(z[x]=E[x].column);for(var re=!0,oe;re;)for(re=!1,x=0;x<b-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&ee[x+1]<ee[x])&&(re=!0,oe=z[x],z[x]=z[x+1],z[x+1]=oe,oe=ee[x],ee[x]=ee[x+1],ee[x+1]=oe,oe=E[x],E[x]=E[x+1],E[x+1]=oe);for(x=z=0;x<b;x++)oe=E[x],oe.index=x,z+=a.nodeMinColumnSpace(oe,!0),oe.column=z,z+=1,z+=a.nodeMinColumnSpace(oe,!1);Uc(a,y,E)}function Zu(a,y,x){var E=Kc(a,y),b=a.tc[y];x=Wx(a,y,x);var z,ee=[];for(z=0;z<b;z++)ee[z]=-1;var re=[];for(z=0;z<b;z++)re[z]=-1;for(var oe=!1,ue=!0;ue;)for(ue=!1,z=0;z<b-1;z++){var he=x[E[z].index*b+E[z+1].index],ge=x[E[z+1].index*b+E[z].index],xe=0,Pe=0,Fe=E[z].column,Ne=E[z+1].column,Je=a.nodeMinColumnSpace(E[z],!0),Ve=a.nodeMinColumnSpace(E[z],!1),ut=a.nodeMinColumnSpace(E[z+1],!0),ft=a.nodeMinColumnSpace(E[z+1],!1);Je=Fe-Je+ut,Ve=Ne-Ve+ft;var vt=E[z].sourceEdges.iterator;for(vt.reset();vt.next();)if(ut=vt.value,ft=ut.fromVertex,ut.valid&&ft.layer===y){for(ut=0;E[ut]!==ft;)ut++;ut<z&&(xe+=2*(z-ut),Pe+=2*(z+1-ut)),ut===z+1&&(xe+=1),ut>z+1&&(xe+=4*(ut-z),Pe+=4*(ut-(z+1)))}for(vt=E[z].destinationEdges.iterator,vt.reset();vt.next();)if(ut=vt.value,ft=ut.toVertex,ut.valid&&ft.layer===y){for(ut=0;E[ut]!==ft;)ut++;ut===z+1&&(Pe+=1)}for(vt=E[z+1].sourceEdges.iterator,vt.reset();vt.next();)if(ut=vt.value,ft=ut.fromVertex,ut.valid&&ft.layer===y){for(ut=0;E[ut]!==ft;)ut++;ut<z&&(xe+=2*(z+1-ut),Pe+=2*(z-ut)),ut===z&&(Pe+=1),ut>z+1&&(xe+=4*(ut-(z+1)),Pe+=4*(ut-z))}for(vt=E[z+1].destinationEdges.iterator,vt.reset();vt.next();)if(ut=vt.value,ft=ut.toVertex,ut.valid&&ft.layer===y){for(ut=0;E[ut]!==ft;)ut++;ut===z&&(xe+=1)}ut=ft=0,vt=ee[E[z].index];var bt=re[E[z].index],zt=ee[E[z+1].index],vi=re[E[z+1].index];vt!==-1&&(ft+=Math.abs(vt-Fe),ut+=Math.abs(vt-Ve)),bt!==-1&&(ft+=Math.abs(bt-Fe),ut+=Math.abs(bt-Ve)),zt!==-1&&(ft+=Math.abs(zt-Ne),ut+=Math.abs(zt-Je)),vi!==-1&&(ft+=Math.abs(vi-Ne),ut+=Math.abs(vi-Je)),(Pe<xe-.5||Pe===xe&&ge<he-.5||Pe===xe&&ge===he&&ut<ft-.5)&&(ue=oe=!0,E[z].column=Ve,E[z+1].column=Je,he=E[z],E[z]=E[z+1],E[z+1]=he)}for(z=0;z<b;z++)E[z].index=z;return Uc(a,y,E),oe}xa.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&US)!==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=bp(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=bp(this,y,-1)||x;x=bp(this,this.Md,0)||x}if(this.bg&4){for(y=this.Md+1;y<=this.Ia;y++)By(this,y,1);for(y=this.Md-1;0<=y;y--)By(this,y,-1);By(this,this.Md,0)}if(a&&(eS(this,-1),eS(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=bp(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=bp(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=bp(this,y,0)||x}}else WS(this)};function bp(a,y,x){for(var E=!1;zS(a,y,x);)E=!0;return E}function zS(a,y,x){var E,b=Kc(a,y),z=a.tc[y],ee=by(a,y,-1);if(0<x)for(E=0;E<z;E++)ee[E]=-1;var re=by(a,y,1);if(0>x)for(E=0;E<z;E++)re[E]=-1;for(var oe=!1,ue=!0;ue;)for(ue=!1,E=0;E<z;E++){var he=b[E].column,ge=a.nodeMinColumnSpace(b[E],!0),xe=a.nodeMinColumnSpace(b[E],!1),Pe=0;0>E-1||he-b[E-1].column-1>ge+a.nodeMinColumnSpace(b[E-1],!1)?Pe=he-1:Pe=he,ge=E+1>=z||b[E+1].column-he-1>xe+a.nodeMinColumnSpace(b[E+1],!0)?he+1:he;var Fe=xe=0,Ne=0;if(0>=x)for(var Je=b[E].sourceEdges.iterator;Je.next();){var Ve=Je.value,ut=Ve.fromVertex;if(Ve.valid&&ut.layer!==y){var ft=Cy(Ve),vt=Ve.portFromColOffset;Ve=Ve.portToColOffset,ut=ut.column,xe+=(Math.abs(he+Ve-(ut+vt))+1)*ft,Fe+=(Math.abs(Pe+Ve-(ut+vt))+1)*ft,Ne+=(Math.abs(ge+Ve-(ut+vt))+1)*ft}}if(0<=x)for(Je=b[E].destinationEdges.iterator;Je.next();)Ve=Je.value,ut=Ve.toVertex,Ve.valid&&ut.layer!==y&&(ft=Cy(Ve),vt=Ve.portFromColOffset,Ve=Ve.portToColOffset,ut=ut.column,xe+=(Math.abs(he+vt-(ut+Ve))+1)*ft,Fe+=(Math.abs(Pe+vt-(ut+Ve))+1)*ft,Ne+=(Math.abs(ge+vt-(ut+Ve))+1)*ft);Ve=vt=ft=0,Je=ee[b[E].index],ut=re[b[E].index],Je!==-1&&(ft+=Math.abs(Je-he),vt+=Math.abs(Je-Pe),Ve+=Math.abs(Je-ge)),ut!==-1&&(ft+=Math.abs(ut-he),vt+=Math.abs(ut-Pe),Ve+=Math.abs(ut-ge)),Fe<xe||Fe===xe&&vt<ft?(ue=oe=!0,b[E].column=Pe):(Ne<xe||Ne===xe&&Ve<ft)&&(ue=oe=!0,b[E].column=ge)}return Uc(a,y,b),a.normalize(),oe}function By(a,y,x){var E=Kc(a,y),b=a.tc[y],z=Hx(a,y,x),ee=[];for(x=0;x<b;x++)ee[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<b;x++){var re=E[x].column,oe=a.nodeMinColumnSpace(E[x],!0),ue=a.nodeMinColumnSpace(E[x],!1),he=0;if(ee[x]===-1)if(x===0&&x===b-1)he=re;else if(x===0){var ge=E[x+1].column;ge-re===ue+a.nodeMinColumnSpace(E[x+1],!0)?he=re-1:he=re}else x===b-1?(ge=E[x-1].column,he=re-ge===oe+a.nodeMinColumnSpace(E[x-1],!1)?re+1:re):(ge=E[x-1].column,oe=ge+a.nodeMinColumnSpace(E[x-1],!1)+oe+1,ge=E[x+1].column,ue=ge-a.nodeMinColumnSpace(E[x+1],!0)-ue-1,he=(oe+ue)/2|0);else x===0&&x===b-1?he=ee[x]:x===0?(ge=E[x+1].column,ue=ge-a.nodeMinColumnSpace(E[x+1],!0)-ue-1,he=Math.min(ee[x],ue)):x===b-1?(ge=E[x-1].column,oe=ge+a.nodeMinColumnSpace(E[x-1],!1)+oe+1,he=Math.max(ee[x],oe)):(ge=E[x-1].column,oe=ge+a.nodeMinColumnSpace(E[x-1],!1)+oe+1,ge=E[x+1].column,ue=ge-a.nodeMinColumnSpace(E[x+1],!0)-ue-1,oe<ee[x]&&ee[x]<ue?he=ee[x]:oe>=ee[x]?he=oe:ue<=ee[x]&&(he=ue));he!==re&&(z=!0,E[x].column=he)}Uc(a,y,E),a.normalize()}function ZS(a,y){for(var x=!0,E=a.network.vertexes.iterator;E.next();){var b=E.value,z=a.nodeMinColumnSpace(b,!0),ee=a.nodeMinColumnSpace(b,!1);if(b.column-z<=y&&b.column+ee>=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 GS(a,y){var x=y+1,E,b=[],z=[];for(E=0;E<=a.Ia;E++)b[E]=!1,z[E]=!1;for(var ee=a.network.vertexes.iterator;ee.next();){E=ee.value;var re=E.column-a.nodeMinColumnSpace(E,!0),oe=E.column+a.nodeMinColumnSpace(E,!1);re<=y&&oe>=y&&(b[E.layer]=!0),re<=x&&oe>=x&&(z[E.layer]=!0)}for(re=!0,x=!1,E=0;E<=a.Ia;E++)re=re&&!(b[E]&&z[E]);if(re)for(ee.reset();ee.next();)a=ee.value,a.column>y&&(--a.column,x=!0);return x}function eS(a,y){for(var x=0;x<=a.Ra;x++)for(;ZS(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;GS(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=_l(a),z=U0(a);for(E=z+1;z<E;){E=z,tS(a,x,1);var ee=U0(a);ee>z?Mu(a,b):ee<z&&(z=ee,b=_l(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=_l(a),z=U0(a),E=z+1;z<E;)E=z,tS(a,x,-1),ee=U0(a),ee>z?Mu(a,b):ee<z&&(z=ee,b=_l(a));a.normalize()}function tS(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&&(Fy(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 ee=z.layer,re=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),oe=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));re<=oe;re++)b[ee*(a.Ra+1)+re]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(ee=0;ee<a.Ra;ee++)b[z*(a.Ra+1)+ee]!==-1&&b[z*(a.Ra+1)+ee+1]!==-1&&b[z*(a.Ra+1)+ee]!==b[z*(a.Ra+1)+ee+1]&&(y[b[z*(a.Ra+1)+ee]*a.le+b[z*(a.Ra+1)+ee+1]]=!0);if(0>x)for(ee=a.Ra;0<ee;ee--)b[z*(a.Ra+1)+ee]!==-1&&b[z*(a.Ra+1)+ee-1]!==-1&&b[z*(a.Ra+1)+ee]!==b[z*(a.Ra+1)+ee-1]&&(y[b[z*(a.Ra+1)+ee]*a.le+b[z*(a.Ra+1)+ee-1]]=!0)}for(b=[],z=0;z<a.le;z++)b[z]=!0;for(ee=[],ee.push(0);ee.length!==0;)if(oe=ee[ee.length-1],ee.pop(),b[oe])for(b[oe]=!1,z=0;z<a.le;z++)y[oe*a.le+z]&&ee.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 WS(a){for(var y=gi(),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 Tn,HS(y,x);var z=null,ee=null,re=null,oe=null,ue=(a.ve&1)!==0,he=(a.ve&2)!==0,ge=(a.ve&4)!==0,xe=(a.ve&8)!==0;for(ue&&(a.verticalAlignment(y,x,!0),z=X0(a,y,!0,!1)),y.reverse(),ge&&(a.verticalAlignment(y,x,!1),re=X0(a,y,!1,!1)),E=li(y),b=E.next();!b.done;b=E.next())b.value.reverse();xe&&(a.verticalAlignment(y,x,!1),oe=X0(a,y,!1,!0)),y.reverse(),he&&(a.verticalAlignment(y,x,!0),ee=X0(a,y,!0,!0)),Ii(y),a.u(z,ee,re,oe),a.network.vertexes.each(function(Pe){var Fe=gi();ue&&Fe.push(z.get(Pe)),he&&Fe.push(ee.get(Pe)),ge&&Fe.push(re.get(Pe)),xe&&Fe.push(oe.get(Pe)),Fe.sort(function(Je,Ve){return Je-Ve});var Ne=Fe.length;Ne=(Fe[Math.floor((Ne-1)/2)]+Fe[Math.ceil((Ne-1)/2)])/2,Ii(Fe),Pe.zc=Ne})}function HS(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,ee=a[E],re=a[E+1],oe=0;z<re.length;oe++){var ue=re[oe];e:{if(ue.node===null){var he=_y(ue);if(0<he.length){he=he[0].node===null;break e}}he=!1}var ge=he;if(oe===re.length-1||ge){for(he=ee.length-1,ge&&(he=_y(ue)[0].index);z<=oe;){if(ue=re[z],!ue.bo){ge=[];for(var xe=li(ue.sourceEdgesArrayAccess),Pe=xe.next();!Pe.done;Pe=xe.next())Pe=Pe.value,Pe.valid&&ge.push(Pe);ue.bo=ge}for(ue=li(ue.bo),ge=ue.next();!ge.done;ge=ue.next())ge=ge.value,xe=ge.fromVertex.index,(xe<b||xe>he)&&y.add(ge);z++}b=he}}}xa.prototype.verticalAlignment=function(a,y,x){VS(a),a=li(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=li(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var ee=x?_y(z):YS(z),re=ee.length;if(0<re){ee.sort(function(ge,xe){return ge.vi-xe.vi});var oe=(re-1)/2;for(re=Math.floor(oe),oe=Math.ceil(oe);re<=oe;re++)if(z.align===z){var ue=ee[re],he=void 0;he=x?tv(ue,z):tv(z,ue),!y.contains(he)&&b<ue.vi&&(ue.align=z,z.root=ue.root,z.align=ue.root,b=ue.vi)}}}}};function VS(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 X0(a,y,x,E){for(var b=a.K===90||a.K===270,z=li(y),ee=z.next();!ee.done;ee=z.next()){var re=li(ee.value);for(ee=re.next();!ee.done;ee=re.next())ee=ee.value,ee.sd=ee,ee.shift=1/0,ee.zc=NaN,ee.qg=0}for(ee=a.K===90||a.K===270,z=li(y),re=z.next();!re.done;re=z.next()){re=li(re.value);for(var oe=re.next();!oe.done;oe=re.next())if(oe=oe.value,oe.root===oe){for(var ue=0,he=oe;he.align!==oe;){var ge=he.align,xe=ee?he.width:he.height,Pe=ee?ge.width:ge.height;if(x){var Fe=tv(he,ge),Ne=Fe.portFromPos,Je=Fe.portToPos;Fe.link!==null&&(he.node&&he.node!==Fe.link.fromNode&&(Ne=ee?he.focusX:he.focusY),ge.node&&ge.node!==Fe.link.toNode&&(Je=ee?ge.focusX:ge.focusY))}else Fe=tv(ge,he),Ne=Fe.portToPos,Je=Fe.portFromPos,Fe.link!==null&&(he.node&&he.node!==Fe.link.toNode&&(Ne=ee?he.focusX:he.focusY),ge.node&&ge.node!==Fe.link.fromNode&&(Je=ee?ge.focusX:ge.focusY));xe=E?he.qg+(xe-Ne)-(Pe-Je):he.qg+Ne-Je,ge.qg=xe,ue=Math.min(ue,xe),he=he.align}he=oe;do he.qg=he.qg-ue,he=he.align;while(he!==oe)}}for(x=li(y),ee=x.next();!ee.done;ee=x.next())for(z=li(ee.value),ee=z.next();!ee.done;ee=z.next())ee=ee.value,ee.root===ee&&nS(a,ee,y);for(x=0;x<y.length;x++)if(!(0>=y[x].length)&&(ee=y[x][0],ee.sd===ee)){ee.sd.shift===1/0&&(ee.sd.shift=0),ee=x,re=0;do{for(z=y[ee][re];z.align!==z.root;)z=z.align,ee++,0<z.vi&&(re=iS(z,y),re.sd.shift=Math.min(re.sd.shift,z.sd.shift+z.zc+z.qg-(re.zc+re.qg+(b?re.width:re.height)+a.columnSpacing)));re=z.vi+1}while(ee<y.length&&re<y[ee].length&&z.sd===y[ee][re].sd)}for(a=new Gt,y=li(y),ee=y.next();!ee.done;ee=y.next())for(x=li(ee.value),ee=x.next();!ee.done;ee=x.next())ee=ee.value,ee.zc=ee.zc+ee.sd.shift+ee.qg,z=b?ee.width:ee.height,a.add(ee,E?-ee.zc-z:ee.zc);return a}function nS(a,y,x){if(isNaN(y.zc)){y.zc=0;var E=y;do{if(0<E.vi){var b=iS(E,x),z=b.root;nS(a,z,x),y.sd===y&&(y.sd=z.sd);var ee=a.K===90||a.K===270?b.width:b.height;y.sd===z.sd&&(y.zc=Math.max(y.zc,z.zc+b.qg+ee-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 iS(a,y){var x=a.Tz;return a=a.vi,1>a&&Ke("Could not determine previous vertex in layer"),y[x][a-1]}xa.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=gi(),b=gi(),z=1/0,ee=0;4>ee;ee++)if(y[ee]){var re=KS(this,y[ee],E,b,ee);re<z&&(x=ee,z=re)}for(z={},ee=0;4>ee;z={delta:z.delta},ee++)y[ee]&&(z.delta=ee===0||ee===2?E[x]-E[ee]:b[x]-b[ee],z.delta!==0&&y[ee].each(function(oe){return function(ue){ue.value+=oe.delta}}(z)));Ii(E),Ii(b)};function KS(a,y,x,E,b){if(!y||y.count===0)return x[b]=0,E[b]=0,1/0;var z=1/0,ee=-1/0;return y.each(function(re){var oe=re.key;re=re.value,oe=a.K===90||a.K===270?oe.width:oe.height,re<z&&(z=re),re+oe>ee&&(ee=re+oe)}),x[b]=z,E[b]=ee,ee-z}xa.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=J0(this,!0),y=J0(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 J0(a,y){return a.K===270?y?Ro:jr:a.K===90?y?jr:Ro:a.K===180?y?ua:ko:y?ko:ua}xa.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,ee=b=1/0,re=-1/0;a.next();){var oe=a.value,ue=oe.layer,he=oe.column|0;E?(ee=y.x+this.kc*he,ue=this.Kd[ue]):(ee=this.Kd[ue],ue=y.y+this.kc*he),oe.centerX=ee,oe.centerY=ue,x&&isFinite(oe.zc)&&(E?oe.node?oe.x=y.x+oe.zc:oe.centerX=y.x+oe.zc:oe.node?oe.y=y.y+oe.zc:oe.centerY=y.y+oe.zc),z=Math.min(oe.x,z),b=Math.min(oe.y,b),E?(ee=z,re=Math.max(re,oe.bounds.right)):(ee=b,re=Math.max(re,oe.bounds.bottom))}for(this.xw=re-ee,z=y.x-z,y=y.y-b,this.Rf=new Ie(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},xa.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 Wt(0,0,x,Math.abs(this.Ta[0]))):y.push(new Wt(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new Wt(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new Wt(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new Wt(0,0,Math.abs(this.Ta[0]),x)):y.push(new Wt(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new Wt(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new Wt(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},xa.prototype.commitLayers=function(){},xa.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,ee=E.fromPort,re=E.toPort;if(b!==null){var oe=b.findVisibleNode();oe!==null&&oe!==b&&(b=oe,ee=oe.port)}z!==null&&(oe=z.findVisibleNode(),oe!==null&&oe!==z&&(z=oe,re=oe.port));var ue=y.computeSpot(!0,ee);oe=y.computeSpot(!1,re);var he=x.fromVertex,ge=x.toVertex;if(x.valid)y.curve===vu&&y.pointsCount===4&&(he.column===ge.column&&this.alignOption===0?(x=y.getLinkPoint(b,ee,ue,!0,!1,z,re),re=y.getLinkPoint(z,re,oe,!1,!1,b,ee),x.w()||x.set(b.actualBounds.center),re.w()||re.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+re.x)/3,(2*x.y+re.y)/3),y.yf((x.x+2*re.x)/3,(x.y+2*re.y)/3),y.yf(re.x,re.y)):(x=E=!1,ee!==null&&ue===Xr&&(E=!0),re!==null&&oe===Xr&&(x=!0),(E||x)&&(oe=null,E&&(oe=y.getLinkPointFromPoint(b,ee,ee.ga(Hr),y.i(3),!0),oe.w()||oe.set(b.actualBounds.center),y.L(0,oe.x,oe.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,re,re.ga(Hr),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),oe&&(z=y.i(2),y.L(1,(2*oe.x+z.x)/3,(2*oe.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(he.layer===ge.layer)y.zf();else{var xe=!1,Pe=!1,Fe=this.ie,Ne=y.firstPickIndex+1;if(y.isOrthogonal){Pe=!0;var Je=y.pointsCount;4<Je&&y.points.removeRange(2,Je-3)}else if(y.curve===vu)xe=!0,Je=y.pointsCount,4<Je&&y.points.removeRange(2,Je-3),Je===4&&(Ne=2);else{Je=y.pointsCount;var Ve=ue===Xr,ut=oe===Xr;2<Je&&Ve&&ut?y.points.removeRange(1,Je-2):3<Je&&Ve&&!ut?y.points.removeRange(1,Je-3):3<Je&&!Ve&&ut?y.points.removeRange(2,Je-2):4<Je&&!Ve&&!ut&&y.points.removeRange(2,Je-3)}if(x.rev){for(;ge!==null&&he!==ge;){var ft=Je=null;for(Ve=ge.sourceEdges.iterator;Ve.next()&&(ut=Ve.value,ut.link!==x.link||(Je=ut.fromVertex,ft=ut.toVertex,Je.node!==null)););if(Je===null)break;if(Je!==he){Ve=y.i(Ne-1).x,ut=y.i(Ne-1).y;var vt=Je.centerX,bt=Je.centerY;if(Pe)this.K===180||this.K===0?Ne===y.firstPickIndex+1?(y.m(Ne++,Ve,ut),y.m(Ne++,Ve,bt)):(ft!==null?ft.centerY:ut)!==bt&&(ft=this.Ta[Je.layer-1]+this.Rf.x,y.m(Ne++,ft,ut),y.m(Ne++,ft,bt)):Ne===y.firstPickIndex+1?(y.m(Ne++,Ve,ut),y.m(Ne++,vt,ut)):(ft!==null?ft.centerX:Ve)!==vt&&(ft=this.Ta[Je.layer-1]+this.Rf.y,y.m(Ne++,Ve,ft),y.m(Ne++,vt,ft));else if(Ne===y.firstPickIndex+1){ft=Math.max(10,this.he[ge.layer]);var zt=Math.max(10,this.Ld[ge.layer]);if(xe)this.K===180?vt<=ge.bounds.x?(ge=ge.bounds.x,y.m(Ne++,ge-ft,bt),y.m(Ne++,ge,bt),y.m(Ne++,ge+zt,bt)):(y.m(Ne++,vt-ft,bt),y.m(Ne++,vt,bt),y.m(Ne++,vt+zt,bt)):this.K===90?bt>=ge.bounds.bottom?(ge=ge.bounds.y+ge.bounds.height,y.m(Ne++,vt,ge+zt),y.m(Ne++,vt,ge),y.m(Ne++,vt,ge-ft)):(y.m(Ne++,vt,bt+zt),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt-ft)):this.K===270?bt<=ge.bounds.y?(ge=ge.bounds.y,y.m(Ne++,vt,ge-ft),y.m(Ne++,vt,ge),y.m(Ne++,vt,ge+zt)):(y.m(Ne++,vt,bt-ft),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt+zt)):this.K===0&&(vt>=ge.bounds.right?(ge=ge.bounds.x+ge.bounds.width,y.m(Ne++,ge+zt,bt),y.m(Ne++,ge,bt),y.m(Ne++,ge-ft,bt)):(y.m(Ne++,vt+zt,bt),y.m(Ne++,vt,bt),y.m(Ne++,vt-ft,bt)));else{y.m(Ne++,Ve,ut);var vi=0;this.K===180||this.K===0?((this.K===180?vt>=ge.bounds.right:vt<=ge.bounds.x)&&(vi=(this.K===0?-ft:zt)/2),y.m(Ne++,Ve+vi,bt)):((this.K===270?bt>=ge.bounds.bottom:bt<=ge.bounds.y)&&(vi=(this.K===90?-ft:zt)/2),y.m(Ne++,vt,ut+vi)),y.m(Ne++,vt,bt)}}else ft=Math.max(10,this.he[Je.layer]),zt=Math.max(10,this.Ld[Je.layer]),xe?this.K===180?(y.m(Ne++,vt-ft-Fe,bt),y.m(Ne++,Math.min(vt-ft+Fe/2,vt),bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,Math.max(vt+zt-Fe/2,vt),bt),y.m(Ne++,vt+zt+Fe,bt)):this.K===90?(y.m(Ne++,vt,bt+zt+Fe),y.m(Ne++,vt,Math.max(bt+zt-Fe/2,bt)),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,Math.min(bt-ft+Fe/2,bt)),y.m(Ne++,vt,bt-ft-Fe)):this.K===270?(y.m(Ne++,vt,bt-ft-Fe),y.m(Ne++,vt,Math.min(bt-ft+Fe/2,bt)),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,Math.max(bt+zt-Fe/2,bt)),y.m(Ne++,vt,bt+zt+Fe)):(y.m(Ne++,vt+zt+Fe,bt),y.m(Ne++,Math.max(vt+zt-Fe/2,vt),bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,Math.min(vt-ft+Fe/2,vt),bt),y.m(Ne++,vt-ft-Fe,bt)):y.m(Ne++,vt,bt)}ge=Je}(re===null||ue!==Xr||Pe)&&(Ve=y.i(Ne-1).x,ut=y.i(Ne-1).y,vt=y.i(Ne).x,bt=y.i(Ne).y,Pe?(Fe=this.Ld[he.layer],this.K===180||this.K===0?(Pe=ut,Pe>=he.bounds.y&&Pe<=he.bounds.bottom&&(this.K===180?vt>=he.bounds.x:vt<=he.bounds.right)&&(ge=he.centerX+(this.K===180?-Fe:Fe),Pe<he.bounds.y+he.bounds.height/2?Pe=he.bounds.y-this.kc/2:Pe=he.bounds.bottom+this.kc/2,y.m(Ne++,ge,ut),y.m(Ne++,ge,Pe)),y.m(Ne++,vt,Pe)):(Pe=Ve,Pe>=he.bounds.x&&Pe<=he.bounds.right&&(this.K===270?bt>=he.bounds.y:bt<=he.bounds.bottom)&&(ge=he.centerY+(this.K===270?-Fe:Fe),Pe<he.bounds.x+he.bounds.width/2?Pe=he.bounds.x-this.kc/2:Pe=he.bounds.right+this.kc/2,y.m(Ne++,Ve,ge),y.m(Ne++,Pe,ge)),y.m(Ne++,Pe,bt)),y.m(Ne++,vt,bt)):xe?(ft=Math.max(10,this.he[he.layer]),zt=Math.max(10,this.Ld[he.layer]),this.K===180&&vt>=he.bounds.x?(ge=he.bounds.x+he.bounds.width,y.L(Ne-2,ge,ut),y.L(Ne-1,ge+zt,ut)):this.K===90&&bt<=he.bounds.bottom?(ge=he.bounds.y,y.L(Ne-2,Ve,ge),y.L(Ne-1,Ve,ge-ft)):this.K===270&&bt>=he.bounds.y?(ge=he.bounds.y+he.bounds.height,y.L(Ne-2,Ve,ge),y.L(Ne-1,Ve,ge+zt)):this.K===0&&vt<=he.bounds.right&&(ge=he.bounds.x,y.L(Ne-2,ge,ut),y.L(Ne-1,ge-ft,ut))):(ft=Math.max(10,this.he[he.layer]),zt=Math.max(10,this.Ld[he.layer]),Pe=0,this.K===180||this.K===0?((this.K===180?vt<=he.bounds.x:vt>=he.bounds.right)&&(Pe=(this.K===0?zt:-ft)/2),y.m(Ne++,vt+Pe,ut)):((this.K===270?bt<=he.bounds.y:bt>=he.bounds.bottom)&&(Pe=(this.K===90?zt:-ft)/2),y.m(Ne++,Ve,bt+Pe)),y.m(Ne++,vt,bt)))}else{for(;he!==null&&he!==ge;){for(ft=Je=null,he=he.destinationEdges.iterator;he.next()&&(Ve=he.value,Ve.link!==x.link||(Je=Ve.toVertex,ft=Ve.fromVertex,ft.node!==null&&(ft=null),Je.node!==null)););if(Je===null)break;Je!==ge&&(Ve=y.i(Ne-1).x,ut=y.i(Ne-1).y,vt=Je.centerX,bt=Je.centerY,Pe?this.K===180||this.K===0?(ft!==null?ft.centerY:ut)!==bt&&(ft=this.Ta[Je.layer]+this.Rf.x,Ne===y.firstPickIndex+1&&(ft=this.K===0?Math.max(ft,Ve):Math.min(ft,Ve)),y.m(Ne++,ft,ut),y.m(Ne++,ft,bt)):(ft!==null?ft.centerX:Ve)!==vt&&(ft=this.Ta[Je.layer]+this.Rf.y,Ne===y.firstPickIndex+1&&(ft=this.K===90?Math.max(ft,ut):Math.min(ft,ut)),y.m(Ne++,Ve,ft),y.m(Ne++,vt,ft)):(ft=Math.max(10,this.he[Je.layer]),zt=Math.max(10,this.Ld[Je.layer]),xe?this.K===180?(y.m(Ne++,vt+zt+Fe,bt),y.m(Ne++,Math.max(vt+zt-Fe/2,vt),bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,Math.min(vt-ft+Fe/2,vt),bt),y.m(Ne++,vt-ft-Fe,bt)):this.K===90?(y.m(Ne++,vt,bt-ft-Fe),y.m(Ne++,vt,Math.min(bt-ft+Fe/2,bt)),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,Math.max(bt+zt-Fe/2,bt)),y.m(Ne++,vt,bt+zt+Fe)):this.K===270?(y.m(Ne++,vt,bt+zt+Fe),y.m(Ne++,vt,Math.max(bt+zt-Fe/2,bt)),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,Math.min(bt-ft+Fe/2,bt)),y.m(Ne++,vt,bt-ft-Fe)):(y.m(Ne++,vt-ft-Fe,bt),y.m(Ne++,Math.min(vt-ft+Fe/2,vt),bt),y.m(Ne++,vt,bt),y.m(Ne++,vt,bt),y.m(Ne++,Math.max(vt+zt-Fe/2,vt),bt),y.m(Ne++,vt+zt+Fe,bt)):this.K===180?(y.m(Ne++,vt+zt,bt),y.m(Ne++,vt-ft,bt)):this.K===90?(y.m(Ne++,vt,bt-ft),y.m(Ne++,vt,bt+zt)):this.K===270?(y.m(Ne++,vt,bt+zt),y.m(Ne++,vt,bt-ft)):(y.m(Ne++,vt-ft,bt),y.m(Ne++,vt+zt,bt)))),he=Je}Pe&&(Ve=y.i(Ne-1).x,ut=y.i(Ne-1).y,vt=y.i(Ne).x,bt=y.i(Ne).y,this.K===180||this.K===0?ut!==bt&&(ft=this.K===0?Math.min(Math.max((vt+Ve)/2,this.Ta[ge.layer]+this.Rf.x),vt):Math.max(Math.min((vt+Ve)/2,this.Ta[ge.layer]+this.Rf.x),vt),y.m(Ne++,ft,ut),y.m(Ne++,ft,bt)):Ve!==vt&&(ft=this.K===90?Math.min(Math.max((bt+ut)/2,this.Ta[ge.layer]+this.Rf.y),bt):Math.max(Math.min((bt+ut)/2,this.Ta[ge.layer]+this.Rf.y),bt),y.m(Ne++,Ve,ft),y.m(Ne++,vt,ft)))}E!==null&&xe&&4<=y.pointsCount&&(ee!==null&&(ee=ue===Xr?y.getLinkPointFromPoint(b,ee,ee.ga(Hr),y.i(3),!0):y.i(0),ue===Xr&&(ue=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(ee.x+ue.x)/2,ue.y),y.L(2,E.x,(ue.y+E.y)/2)):(y.L(1,ue.x,(ee.y+ue.y)/2),y.L(2,(ue.x+E.x)/2,E.y))),ee.w()||ee.set(b.actualBounds.center),y.L(0,ee.x,ee.y)),re!==null&&(b=oe===Xr?y.getLinkPointFromPoint(z,re,re.ga(Hr),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),oe===Xr&&(re=y.i(y.pointsCount-3),oe=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.x+re.x)/2,re.y),y.L(y.pointsCount-2,oe.x,(re.y+oe.y)/2)):(y.L(y.pointsCount-2,re.x,(b.y+re.y)/2),y.L(y.pointsCount-3,(re.x+oe.x)/2,oe.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},xa.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new Nn,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),ee=E.i(b+1);if(this.B(z.y,ee.y)&&!this.B(z.x,ee.x)){var re=new Yc;re.layer=Math.floor(z.y/2);var oe=E.i(0),ue=E.i(E.pointsCount-1);if(re.first=oe.x*oe.x+oe.y,re.jc=ue.x*ue.x+ue.y,re.rd=Math.min(z.x,ee.x),re.Ic=Math.max(z.x,ee.x),re.index=b,re.link=E,b+2<E.pointsCount){oe=E.i(b-1),ue=E.i(b+2);var he=0;oe.y<z.y?he=ue.y<z.y?3:z.x<ee.x?2:1:oe.y>z.y&&(he=ue.y>z.y?0:ee.x<z.x?2:1),re.j=he}x.push(re)}}}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(ee=x[z].Ic,b=a+1;b<E&&x[b].rd<ee;)ee=Math.max(ee,x[b].Ic),b++;if(ee=b-z,1<ee){for(this.zi(x,this.Js,z,z+ee),he=1,re=x[z].jc,oe=z;oe<b;oe++)ue=x[oe],ue.jc!==re&&(he++,re=ue.jc);this.zi(x,this.Ux,z,z+ee);var ge=1;for(re=x[z].first,oe=z;oe<b;oe++)ue=x[oe],ue.first!==re&&(ge++,re=ue.first);for(oe=!0,ue=ge,he<ge?(oe=!1,ue=he,re=x[z].jc,this.zi(x,this.Js,z,z+ee)):re=x[z].first,he=0,ge=z;ge<b;ge++){var xe=x[ge];(oe?xe.first:xe.jc)!==re&&(he++,re=oe?xe.first:xe.jc);var Pe=xe.link;z=Pe.i(xe.index),ee=Pe.i(xe.index+1);var Fe=this.linkSpacing*(he-(ue-1)/2);y++,Pe.uh(),Pe.L(xe.index,z.x,z.y+Fe),Pe.L(xe.index+1,ee.x,ee.y+Fe),Pe.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),ee=E.i(b+1),this.B(z.x,ee.x)&&!this.B(z.y,ee.y)&&(re=new Yc,re.layer=Math.floor(z.x/2),oe=E.i(0),ue=E.i(E.pointsCount-1),re.first=oe.x+oe.y*oe.y,re.jc=ue.x+ue.y*ue.y,re.rd=Math.min(z.y,ee.y),re.Ic=Math.max(z.y,ee.y),re.index=b,re.link=E,b+2<E.pointsCount&&(oe=E.i(b-1),ue=E.i(b+2),he=0,oe.x<z.x?he=ue.x<z.x?3:z.y<ee.y?2:1:oe.x>z.x&&(he=ue.x>z.x?0:ee.y<z.y?2:1),re.j=he),x.push(re));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(ee=x[z].Ic,b=a+1;b<E&&x[b].rd<ee;)ee=Math.max(ee,x[b].Ic),b++;if(ee=b-z,1<ee){for(this.zi(x,this.Js,z,z+ee),he=1,re=x[z].jc,oe=z;oe<b;oe++)ue=x[oe],ue.jc!==re&&(he++,re=ue.jc);for(this.zi(x,this.Ux,z,z+ee),ge=1,re=x[z].first,oe=z;oe<b;oe++)ue=x[oe],ue.first!==re&&(ge++,re=ue.first);for(oe=!0,ue=ge,he<ge?(oe=!1,ue=he,re=x[z].jc,this.zi(x,this.Js,z,z+ee)):re=x[z].first,he=0,ge=z;ge<b;ge++)xe=x[ge],(oe?xe.first:xe.jc)!==re&&(he++,re=oe?xe.first:xe.jc),Pe=xe.link,z=Pe.i(xe.index),ee=Pe.i(xe.index+1),Fe=this.linkSpacing*(he-(ue-1)/2),y++,Pe.uh(),Pe.L(xe.index,z.x+Fe,z.y),Pe.L(xe.index+1,ee.x+Fe,ee.y),Pe.zf()}z=b}a=E}}}},be=xa.prototype,be.Vx=function(a,y){return a instanceof Yc&&y instanceof Yc&&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},be.Ux=function(a,y){return a instanceof Yc&&y instanceof Yc&&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},be.Js=function(a,y){return a instanceof Yc&&y instanceof Yc&&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},be.B=function(a,y){return a-=y,-1<a&&1>a},be.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&Ke("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 Kc(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 Uc(a,y,x){a.He[a.tc[y]]=x}At.Object.defineProperties(xa.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()):Ke("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==My&&a!==Q0&&a!==Pm||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==$0&&a!==ky&&a!==Ay||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==q0&&a!==Ny&&a!==Dy||(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!==Ty&&a!==ev&&a!==Iy||(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 Q0=new yn(xa,"CycleDepthFirst",0),My=new yn(xa,"CycleGreedy",1),Pm=new yn(xa,"CycleFromLayers",2),$0=new yn(xa,"LayerOptimalLinkLength",0),ky=new yn(xa,"LayerLongestPathSink",1),Ay=new yn(xa,"LayerLongestPathSource",2),q0=new yn(xa,"InitDepthFirstOut",0),Ny=new yn(xa,"InitDepthFirstIn",1),Dy=new yn(xa,"InitNaive",2),Ty=new yn(xa,"AggressiveNone",0),ev=new yn(xa,"AggressiveLess",1),Iy=new yn(xa,"AggressiveMore",2),US=8;xa.className="LayeredDigraphLayout",xa.CycleDepthFirst=Q0,xa.CycleGreedy=My,xa.CycleFromLayers=Pm,xa.LayerOptimalLinkLength=$0,xa.LayerLongestPathSink=ky,xa.LayerLongestPathSource=Ay,xa.InitDepthFirstOut=q0,xa.InitDepthFirstIn=Ny,xa.InitNaive=Dy,xa.AggressiveNone=Ty,xa.AggressiveLess=ev,xa.AggressiveMore=Iy,xa.PackNone=0,xa.PackExpand=1,xa.PackStraighten=2,xa.PackMedian=4,xa.PackAll=15,xa.AlignNone=0,xa.AlignUpperLeft=1,xa.AlignUpperRight=2,xa.AlignLowerLeft=4,xa.AlignLowerRight=8,xa.AlignAll=15;function Yc(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Yc.className="SegInfo";function Fp(a){_a.call(this,a)}_t(Fp,_a),Fp.prototype.createVertex=function(){return new ku(this)},Fp.prototype.createEdge=function(){return new Em(this)},Fp.className="LayeredDigraphNetwork";function ku(a){Ps.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}_t(ku,Ps);function rS(a,y){return a.index-y.index}function tv(a,y){if(!a.$n){for(var x=[],E=li(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=li(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;Ke("Unable to find destination edge to given vertex")}function _y(a){if(!a.co){for(var y=[],x=li(a.sourceEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.fromVertex);y.sort(rS),a.co=y}return a.co}function YS(a){if(!a.ao){for(var y=[],x=li(a.destinationEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.toVertex);y.sort(rS),a.ao=y}return a.ao}ku.prototype.Cl=function(a){Ps.prototype.Cl.call(this,a),this.bo=this.co=null},ku.prototype.Kl=function(a){Ps.prototype.Kl.call(this,a),this.bo=this.co=null},ku.prototype.zl=function(a){Ps.prototype.zl.call(this,a),this.$n=this.ao=null},ku.prototype.Jl=function(a){Ps.prototype.Jl.call(this,a),this.$n=this.ao=null},At.Object.defineProperties(ku.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)}}}),ku.prototype.deleteDestinationEdge=ku.prototype.Jl,ku.prototype.addDestinationEdge=ku.prototype.zl,ku.prototype.deleteSourceEdge=ku.prototype.Kl,ku.prototype.addSourceEdge=ku.prototype.Cl,ku.className="LayeredDigraphVertex";function Em(a){nu.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}_t(Em,nu),At.Object.defineProperties(Em.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)}}}),Em.className="LayeredDigraphEdge";function Ao(a){Va.call(this),this.Ub=new Tn,this.Wn=ov,this.ud=$h,this.vo=sv,this.Bq=Uy,this.$v=[],this.td=!0,this.Rb=lv,this.$d=new Pn(10,10).freeze();var y=new Tg(this);this.W=new Gu(y),this.Y=new Gu(y),this.ru=[],a&&Object.assign(this,a)}_t(Ao,Va),Ao.prototype.cloneProtected=function(a){Va.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)},Ao.prototype.qb=function(a){a.classType===Ao?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:Ke("Unknown enum value: "+a):Va.prototype.qb.call(this,a)},Ao.prototype.createNetwork=function(){return new Tg(this)},Ao.prototype.makeNetwork=function(a){function y(E){if(E instanceof Ci)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof qn){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 jt?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof to?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Ao.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==uv&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof jt&&(y=a),this.path===ov&&y!==null?this.ud=y.isTreePathToChildren?$h:Ng:this.ud=this.path===ov?$h: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 Tn,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof Ci?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof Gu&&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,Oy(this,y));for(y=this.network.vertexes,a=null;a=XS(y),0<a.count;)y=oS(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,Oy(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Gu&&sS(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Gu&&lS(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Gu&&uS(this,y);if(this.Cu(),this.layerStyle===hv){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===Yy)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 Gu&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new Tn,this.isValidLayout=!0};function XS(a){var y=new Tn;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Ao.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case $h:x.sourceEdges.count===0&&this.Ub.add(x);break;case Ng:x.destinationEdges.count===0&&this.Ub.add(x);break;default:Ke("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=oS(this,a),a!==null&&this.Ub.add(a))};function oS(a,y){var x=999999,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case $h:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case Ng:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:Ke("Unhandled path value "+a.ud.toString())}}return E}function Oy(a,y){if(y!==null){switch(a.ud){case $h:if(0<y.destinationEdges.count){for(var x=new Nn,E=y.destinationVertexes;E.next();){var b=E.value;aS(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case Ng:if(0<y.sourceEdges.count){for(x=new Nn,E=y.sourceVertexes;E.next();)b=E.value,aS(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:Ke("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++)Oy(a,x[y])}}function aS(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}Ao.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 sS(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===td&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,ee=z.length,re=0;re<ee;re++){var oe=z[re];sS(a,oe),x+=oe.descendantCount+1,E=Math.max(E,oe.maxChildrenCount),b=Math.max(b,oe.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function JS(a,y){switch(a.vo){default:case sv:return y.parent!==null?y.parent:a.W;case Vy:return y.parent===null?a.W:y.parent.parent===null?a.Y:y.parent;case Hy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case Wy: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}}Ao.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(JS(this,a)),a.parent!==null&&a.parent.alignment===td){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 lS(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lS(a,y[E])}}Ao.prototype.assignTreeVertexValues=function(){};function uS(a,y){if(y!==null){y.alignment!==td&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)uS(a,y[E])}}Ao.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Lp:break;case bm:a.children.reverse();break;case Fm:a.children.sort(a.comparer);break;case Lm:a.children.sort(a.comparer),a.children.reverse();break;default:Ke("Unhandled sorting value "+a.sorting.toString())}},Ao.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Ao.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Xc(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,ee=0,re=0,oe=a.commentSpacing;if(a.node!==null)for(var ue=a.node.Mu();ue.next();){var he=ue.value;he.category==="Comment"&&he.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(he),he.Va(),he=he.measuredBounds,y&&!x||!b&&!E&&x||b&&E&&x?(z=Math.max(z,he.width),ee+=he.height+Math.abs(re)):(z+=he.width+Math.abs(re),ee=Math.max(ee,he.height)),re=oe)}a.comments!==null&&(y&&!x||!b&&!E&&x||b&&E&&x?(z+=Math.abs(a.commentMargin),ee=Math.max(0,ee-a.height)):(ee+=Math.abs(a.commentMargin),z=Math.max(0,z-a.width)),b=Wt.allocAt(0,0,a.bounds.width+z,a.bounds.height+ee),a.bounds=b,Wt.free(b))};function Xc(a){return a===oc||a===td||a===ac||a===Bd}function Cm(a){return a===oc||a===td}function Ry(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Xc(x)){if(Cm(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===ac)return!0}}return!1}Ao.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=Xc(z)),E=E===90||E===270,x=b===90||b===270;for(var ee=a.childrenCount===0,re=Ry(a),oe=0,ue=a.comments,he=ue.length,ge=Ie.alloc(),xe=0;xe<he;xe++){var Pe=ue[xe],Fe=Pe.measuredBounds;if(E&&!ee||!z&&!x&&ee||z&&x&&ee){if(135<b&&!z||x&&re)if(0<=a.commentMargin)for(ge.h(a.bounds.x-a.commentMargin-Fe.width,a.bounds.y+oe),Pe.move(ge),Pe=Pe.Sd();Pe.next();){var Ne=Pe.value;Ne.fromSpot=ua,Ne.toSpot=ko}else for(ge.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+oe),Pe.move(ge),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=ko,Ne.toSpot=ua;else if(0<=a.commentMargin)for(ge.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+oe),Pe.move(ge),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=ko,Ne.toSpot=ua;else for(ge.h(a.bounds.x+a.commentMargin-Fe.width,a.bounds.y+oe),Pe.move(ge),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=ua,Ne.toSpot=ko;oe=0<=a.commentSpacing?oe+(Fe.height+a.commentSpacing):oe+(a.commentSpacing-Fe.height)}else{if(135<b&&!z||!x&&re)if(0<=a.commentMargin)for(ge.h(a.bounds.x+oe,a.bounds.y-a.commentMargin-Fe.height),Pe.move(ge),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Ro,Ne.toSpot=jr;else for(ge.h(a.bounds.x+oe,a.bounds.y+2*a.focus.y-a.commentMargin),Pe.move(ge),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=jr,Ne.toSpot=Ro;else if(0<=a.commentMargin)for(ge.h(a.bounds.x+oe,a.bounds.y+2*a.focus.y+a.commentMargin),Pe.move(ge),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=jr,Ne.toSpot=Ro;else for(ge.h(a.bounds.x+oe,a.bounds.y+a.commentMargin-Fe.height),Pe.move(ge),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Ro,Ne.toSpot=jr;oe=0<=a.commentSpacing?oe+(Fe.width+a.commentSpacing):oe+(a.commentSpacing-Fe.width)}}if(Ie.free(ge),y=oe-a.commentSpacing-(E?y.height:y.width),this.ud===$h)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)}},Ao.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 av:hS(this,a);break;case Bm:if(a.alignment===td)hS(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Xc(x)),E=Ry(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=nh(a);y=b===90||b===270;var z=0,ee=a.children,re=ee.length;for(x=0;x<re;x++)E=ee[x],z=Math.max(z,y?E.Da.width:E.Da.height);var oe=a.alignment;E=oe===qh;var ue=oe===ed,he=Xc(oe),ge=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var xe=a.nodeSpacing,Pe=this.computeNodeIndent(a),Fe=a.rowSpacing,Ne=0;(E||ue||a.hm||a.im&&a.maxGenerationCount===1)&&(Ne=Math.max(0,a.rowIndent)),E=a.width;var Je=a.height,Ve=0,ut=0,ft=0,vt=null,bt=null,zt=0,vi=0,Xi=0,Ri=0,Qn=0,Cn=0,qr=0,Rr=0;if(he&&!Cm(oe)&&135<b&&ee.reverse(),Cm(oe))if(1<re)for(var aa=0;aa<re;aa++)aa%2===0&&aa!==re-1&&(Rr=Math.max(Rr,y?ee[aa].Da.width:ee[aa].Da.height));else re===1&&(Rr=y?ee[0].Da.width:ee[0].Da.height);if(he){switch(oe){case oc:ut=135>b?dS(this,a,ee,Rr,Ve,ut):cS(this,a,ee,Rr,Ve,ut),Rr=ut.x,Ve=ut.width,ut=ut.height;break;case ac:for(vt=0;vt<re;vt++)bt=ee[vt],ge=bt.Da,ft=Cn===0?0:Fe,y?(bt.S.h(z-ge.width,Ri+ft),Ve=Math.max(Ve,ge.width),ut=Math.max(ut,Ri+ft+ge.height),Ri+=ft+ge.height):(bt.S.h(Xi+ft,z-ge.height),Ve=Math.max(Ve,Xi+ft+ge.width),ut=Math.max(ut,ge.height),Xi+=ft+ge.width),Cn++;break;case Bd:for(vt=0;vt<re;vt++)bt=ee[vt],z=bt.Da,ge=Cn===0?0:Fe,y?(bt.S.h(xe/2+a.focus.x,Ri+ge),Ve=Math.max(Ve,z.width),ut=Math.max(ut,Ri+ge+z.height),Ri+=ge+z.height):(bt.S.h(Xi+ge,xe/2+a.focus.y),Ve=Math.max(Ve,Xi+ge+z.width),ut=Math.max(ut,z.height),Xi+=ge+z.width),Cn++}vt=Yl(this,2),bt=Yl(this,2),y?(vt[0].h(0,0),vt[1].h(0,ut),bt[0].h(Ve,0)):(vt[0].h(0,0),vt[1].h(Ve,0),bt[0].h(0,ut)),bt[1].h(Ve,ut)}else for(aa=0;aa<re;aa++){var Na=ee[aa],ks=Na.Da;if(y){0<ge&&0<Cn&&Xi+xe+ks.width>ge&&(Xi<z&&jf(a,oe,z-Xi,0,qr,aa-1),Qn++,Cn=0,qr=aa,ft=ut,Xi=0,Ri=135<b?-ut-Fe:ut+Fe),iv(this,Na,0,Ri);var _s=0;if(Cn===0)vt=Na.Yo,bt=Na.kp,zt=ks.width,vi=ks.height,(vt===null||bt===null||b!==nh(Na))&&(vt=Yl(this,2),bt=Yl(this,2),vt[0].h(0,0),vt[1].h(0,vi),bt[0].h(zt,0),bt[1].h(zt,vi));else{var ml=gi();vi=fS(this,a,Na,vt,bt,zt,vi,ml),_s=vi.x,vt=ml[0],bt=ml[1],zt=vi.width,vi=vi.height,Ii(ml),Xi<ks.width&&0>_s&&(Ag(a,-_s,0,qr,aa-1),rv(vt,-_s,0),rv(bt,-_s,0),_s=0)}Na.S.h(_s,Ri),Ve=Math.max(Ve,zt),ut=Math.max(ut,ft+(Qn===0?0:Fe)+ks.height),Xi=zt}else 0<ge&&0<Cn&&Ri+xe+ks.height>ge&&(Ri<z&&jf(a,oe,0,z-Ri,qr,aa-1),Qn++,Cn=0,qr=aa,ft=Ve,Ri=0,Xi=135<b?-Ve-Fe:Ve+Fe),iv(this,Na,Xi,0),_s=0,Cn===0?(vt=Na.Yo,bt=Na.kp,zt=ks.width,vi=ks.height,(vt===null||bt===null||b!==nh(Na))&&(vt=Yl(this,2),bt=Yl(this,2),vt[0].h(0,0),vt[1].h(zt,0),bt[0].h(0,vi),bt[1].h(zt,vi))):(ml=gi(),vi=fS(this,a,Na,vt,bt,zt,vi,ml),_s=vi.x,vt=ml[0],bt=ml[1],zt=vi.width,vi=vi.height,Ii(ml),Ri<ks.height&&0>_s&&(Ag(a,0,-_s,qr,aa-1),rv(vt,0,-_s),rv(bt,0,-_s),_s=0)),Na.S.h(Xi,_s),ut=Math.max(ut,vi),Ve=Math.max(Ve,ft+(Qn===0?0:Fe)+ks.width),Ri=vi;Cn++}switch(0<Qn&&(y?(ut+=Math.max(0,x),Xi<Ve&&jf(a,oe,Ve-Xi,0,qr,re-1),0<Ne&&(ue||Ag(a,Ne,0,0,re-1),Ve+=Ne)):(Ve+=Math.max(0,x),Ri<ut&&jf(a,oe,0,ut-Ri,qr,re-1),0<Ne&&(ue||Ag(a,0,Ne,0,re-1),ut+=Ne))),Ne=ue=0,oe){case Bp:y?ue+=Ve/2-a.focus.x-Pe/2:Ne+=ut/2-a.focus.y-Pe/2;break;case Dg:0<Qn?y?ue+=Ve/2-a.focus.x-Pe/2:Ne+=ut/2-a.focus.y-Pe/2:y?(Rr=ee[0].S.x+ee[0].la.x,ue+=Rr+(ee[re-1].S.x+ee[re-1].la.x+2*ee[re-1].focus.x-Rr)/2-a.focus.x-Pe/2):(Rr=ee[0].S.y+ee[0].la.y,Ne+=Rr+(ee[re-1].S.y+ee[re-1].la.y+2*ee[re-1].focus.y-Rr)/2-a.focus.y-Pe/2);break;case qh:y?(ue-=Pe,Ve+=Pe):(Ne-=Pe,ut+=Pe);break;case ed:y?(ue+=Ve-a.width+Pe,Ve+=Pe):(Ne+=ut-a.height+Pe,ut+=Pe);break;case oc:y?1<re?ue+=Rr+xe/2-a.focus.x:ue+=ee[0].focus.x-a.focus.x+ee[0].la.x:1<re?Ne+=Rr+xe/2-a.focus.y:Ne+=ee[0].focus.y-a.focus.y+ee[0].la.y;break;case ac:y?ue+=Ve+xe/2-a.focus.x:Ne+=ut+xe/2-a.focus.y;break;case Bd:break;default:ut=this.customAlignment(a,ue,Ne,Ve,ut),ue=ut[0],Ne=ut[1],Ve=ut[2],ut=ut[3]}for(Pe=0;Pe<re;Pe++)Rr=ee[Pe],y?Rr.S.h(Rr.S.x+Rr.la.x-ue,Rr.S.y+(135<b?(he?-ut:-Rr.Da.height)+Rr.la.y-x:Je+x+Rr.la.y)):Rr.S.h(Rr.S.x+(135<b?(he?-Ve:-Rr.Da.width)+Rr.la.x-x:E+x+Rr.la.x),Rr.S.y+Rr.la.y-Ne);if(re=ee=0,he?y?(Ve=jy(a,Ve,ue),0>ue&&(ue=0),135<b&&(Ne+=ut+x),ut+=Je+x,oe===Bd&&(ee+=xe/2+a.focus.x),re+=Je+x):(135<b&&(ue+=Ve+x),Ve+=E+x,ut=zy(a,ut,Ne),0>Ne&&(Ne=0),oe===Bd&&(re+=xe/2+a.focus.y),ee+=E+x):y?(a.comments===null?E>Ve&&(Ve=Zy(oe,E-Ve,0),ee=Ve.x,re=Ve.y,Ve=E,ue=0):Ve=jy(a,Ve,ue),0>ue&&(ee-=ue,ue=0),135<b&&(Ne+=ut+x),ut=Math.max(Math.max(ut,Je),ut+Je+x),re+=Je+x):(135<b&&(ue+=Ve+x),Ve=Math.max(Math.max(Ve,E),Ve+E+x),a.comments===null?Je>ut&&(ut=Zy(oe,0,Je-ut),ee=ut.x,re=ut.y,ut=Je,Ne=0):ut=zy(a,ut,Ne),0>Ne&&(re-=Ne,Ne=0),ee+=E+x),0<Qn)b=Yl(this,4),Qn=Yl(this,4),y?(b[2].h(0,Je+x),b[3].h(b[2].x,ut),Qn[2].h(Ve,b[2].y),Qn[3].h(Qn[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(Ve,b[2].y),Qn[2].h(b[2].x,ut),Qn[3].h(b[3].x,Qn[2].y));else{for(b=Yl(this,vt.length+2),Qn=Yl(this,bt.length+2),oe=0;oe<vt.length;oe++)he=vt[oe],b[oe+2].h(he.x+ee,he.y+re);for(oe=0;oe<bt.length;oe++)he=bt[oe],Qn[oe+2].h(he.x+ee,he.y+re)}y?(b[0].h(ue,0),b[1].h(b[0].x,Je),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])),Qn[0].h(ue+E,0),Qn[1].h(Qn[0].x,Je),Qn[2].y<Qn[1].y&&(Qn[2].x<Qn[0].x?Qn[2].assign(Qn[1]):Qn[1].assign(Qn[2])),Qn[3].y<Qn[2].y&&(Qn[3].x<Qn[0].x?Qn[3].assign(Qn[2]):Qn[2].assign(Qn[3])),b[2].y-=x/2,Qn[2].y-=x/2):(b[0].h(0,Ne),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])),Qn[0].h(0,Ne+Je),Qn[1].h(E,Qn[0].y),Qn[2].x<Qn[1].x&&(Qn[2].y<Qn[0].y?Qn[2].assign(Qn[1]):Qn[1].assign(Qn[2])),Qn[3].x<Qn[2].x&&(Qn[3].y<Qn[0].y?Qn[3].assign(Qn[2]):Qn[2].assign(Qn[3])),b[2].x-=x/2,Qn[2].x-=x/2),Sh(this,vt),Sh(this,bt),a.Yo=b,a.kp=Qn,a.la.h(ue,Ne),a.Da.h(Ve,ut)}break;default:Ke("Unhandled compaction value "+a.compaction.toString())}}};function hS(a,y){if(y.childrenCount===0){var x=!1,E=0;y.parent!==null&&(E=y.parent.angle,x=y.parent.alignment,x=Xc(x));var b=Ry(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=nh(y),x=E===90||E===270;var z=0;b=y.children;for(var ee=b.length,re=0;re<ee;re++){var oe=b[re];z=Math.max(z,x?oe.Da.width:oe.Da.height)}var ue=y.alignment,he=ue===qh,ge=ue===ed;re=Xc(ue);var xe=Math.max(0,y.breadthLimit);oe=a.computeLayerSpacing(y);var Pe=y.nodeSpacing,Fe=a.computeNodeIndent(y),Ne=he||ge?0:Fe/2,Je=y.rowSpacing,Ve=0;(he||ge||y.hm||y.im&&y.maxGenerationCount===1)&&(Ve=Math.max(0,y.rowIndent)),he=y.width;var ut=y.height,ft=0,vt=0,bt=0,zt=0,vi=0,Xi=0,Ri=0,Qn=0,Cn=0,qr=0;if(re&&!Cm(ue)&&135<E&&b.reverse(),Cm(ue))if(1<ee)for(var Rr=0;Rr<ee;Rr++){var aa=b[Rr],Na=aa.Da;Rr%2===0&&Rr!==ee-1?Cn=Math.max(Cn,(x?Na.width:Na.height)+a.computeBusNodeSpacing(aa)-Pe):Rr%2!==0&&(qr=Math.max(qr,(x?Na.width:Na.height)+a.computeBusNodeSpacing(aa)-Pe))}else ee===1&&(Cn=x?b[0].Da.width:b[0].Da.height);if(re)switch(ue){case oc:case td:vt=135>E?dS(a,y,b,Cn,ft,vt):cS(a,y,b,Cn,ft,vt),Cn=vt.x,ft=vt.width,vt=vt.height;break;case ac:for(xe=0;xe<ee;xe++)Ne=b[xe],bt=Ne.Da,qr=Ri===0?0:Je,x?(Ne.S.h(z-bt.width,vi+qr),ft=Math.max(ft,bt.width),vt=Math.max(vt,vi+qr+bt.height),vi+=qr+bt.height):(Ne.S.h(zt+qr,z-bt.height),ft=Math.max(ft,zt+qr+bt.width),vt=Math.max(vt,bt.height),zt+=qr+bt.width),Ri++;break;case Bd:for(z=0;z<ee;z++)xe=b[z],Ne=xe.Da,bt=Ri===0?0:Je,x?(xe.S.h(Pe/2+y.focus.x,vi+bt),ft=Math.max(ft,Ne.width),vt=Math.max(vt,vi+bt+Ne.height),vi+=bt+Ne.height):(xe.S.h(zt+bt,Pe/2+y.focus.y),ft=Math.max(ft,zt+bt+Ne.width),vt=Math.max(vt,Ne.height),zt+=bt+Ne.width),Ri++}else for(qr=0;qr<ee;qr++)Rr=b[qr],aa=Rr.Da,x?(0<xe&&0<Ri&&zt+Pe+aa.width>xe&&(zt<z&&jf(y,ue,z-zt,0,Qn,qr-1),Xi++,Ri=0,Qn=qr,bt=vt,zt=0,vi=135<E?-vt-Je:vt+Je),Na=Ri===0?Ne:Pe,iv(a,Rr,0,vi),Rr.S.h(zt+Na,vi),ft=Math.max(ft,zt+Na+aa.width),vt=Math.max(vt,bt+(Xi===0?0:Je)+aa.height),zt+=Na+aa.width):(0<xe&&0<Ri&&vi+Pe+aa.height>xe&&(vi<z&&jf(y,ue,0,z-vi,Qn,qr-1),Xi++,Ri=0,Qn=qr,bt=ft,vi=0,zt=135<E?-ft-Je:ft+Je),Na=Ri===0?Ne:Pe,iv(a,Rr,zt,0),Rr.S.h(zt,vi+Na),vt=Math.max(vt,vi+Na+aa.height),ft=Math.max(ft,bt+(Xi===0?0:Je)+aa.width),vi+=Na+aa.height),Ri++;switch(0<Xi&&(x?(vt+=Math.max(0,oe),zt<ft&&jf(y,ue,ft-zt,0,Qn,ee-1),0<Ve&&(ge||Ag(y,Ve,0,0,ee-1),ft+=Ve)):(ft+=Math.max(0,oe),vi<vt&&jf(y,ue,0,vt-vi,Qn,ee-1),0<Ve&&(ge||Ag(y,0,Ve,0,ee-1),vt+=Ve))),Ve=ge=0,ue){case Bp:x?ge+=ft/2-y.focus.x-Fe/2:Ve+=vt/2-y.focus.y-Fe/2;break;case Dg:0<Xi?x?ge+=ft/2-y.focus.x-Fe/2:Ve+=vt/2-y.focus.y-Fe/2:x?(a=b[0].S.x+b[0].la.x,ge+=a+(b[ee-1].S.x+b[ee-1].la.x+2*b[ee-1].focus.x-a)/2-y.focus.x-Fe/2):(a=b[0].S.y+b[0].la.y,Ve+=a+(b[ee-1].S.y+b[ee-1].la.y+2*b[ee-1].focus.y-a)/2-y.focus.y-Fe/2);break;case qh:x?(ge-=Fe,ft+=Fe):(Ve-=Fe,vt+=Fe);break;case ed:x?(ge+=ft-y.width+Fe,ft+=Fe):(Ve+=vt-y.height+Fe,vt+=Fe);break;case oc:case td:x?1<ee?ge+=Cn+Pe/2-y.focus.x:ge+=b[0].focus.x-y.focus.x+b[0].la.x:1<ee?Ve+=Cn+Pe/2-y.focus.y:Ve+=b[0].focus.y-y.focus.y+b[0].la.y;break;case ac:x?ge+=ft+Pe/2-y.focus.x:Ve+=vt+Pe/2-y.focus.y;break;case Bd:break;default:a=a.customAlignment(y,ge,Ve,ft,vt),ge=a[0],Ve=a[1],ft=a[2],vt=a[3]}for(a=0;a<ee;a++)Fe=b[a],x?Fe.S.h(Fe.S.x+Fe.la.x-ge,Fe.S.y+(135<E?(re?-vt:-Fe.Da.height)+Fe.la.y-oe:ut+oe+Fe.la.y)):Fe.S.h(Fe.S.x+(135<E?(re?-ft:-Fe.Da.width)+Fe.la.x-oe:he+oe+Fe.la.x),Fe.S.y+Fe.la.y-Ve);x?(ft=jy(y,ft,ge),0>ge&&(ge=0),135<E&&(Ve+=vt+oe),vt=Math.max(Math.max(vt,ut),vt+ut+oe)):(135<E&&(ge+=ft+oe),ft=Math.max(Math.max(ft,he),ft+he+oe),vt=zy(y,vt,Ve),0>Ve&&(Ve=0)),y.la.h(ge,Ve),y.Da.h(ft,vt)}}Ao.prototype.customAlignment=function(a,y,x,E,b){return[y,x,E,b]};function dS(a,y,x,E,b,z){var ee=x.length;if(ee===0)return new Wt(E,0,b,z);if(ee===1)return y=x[0],b=y.Da.width,z=y.Da.height,new Wt(E,0,b,z);for(var re=y.nodeSpacing,oe=y.rowSpacing,ue=nh(y)===90,he=0,ge=0,xe=0,Pe=0;Pe<ee;Pe++)if(!(Pe%2!==0||1<ee&&Pe===ee-1)){var Fe=x[Pe],Ne=Fe.Da,Je=he===0?0:oe;if(ue){var Ve=a.computeBusNodeSpacing(Fe)-re;Fe.S.h(E-(Ne.width+Ve),xe+Je),b=Math.max(b,Ne.width+Ve),z=Math.max(z,xe+Je+Ne.height),xe+=Je+Ne.height}else Ve=a.computeBusNodeSpacing(Fe)-re,Fe.S.h(ge+Je,E-(Ne.height+Ve)),z=Math.max(z,Ne.height+Ve),b=Math.max(b,ge+Je+Ne.width),ge+=Je+Ne.width;he++}for(he=0,Fe=ge,Pe=xe,ue?(ge=E+re,xe=0):(ge=0,xe=E+re),Ne=0;Ne<ee;Ne++)if(Ne%2!==0){Je=x[Ne],Ve=Je.Da;var ut=he===0?0:oe;if(ue){var ft=a.computeBusNodeSpacing(Je)-re;Je.S.h(ge+ft,xe+ut),b=Math.max(b,ge+Ve.width+ft),z=Math.max(z,xe+ut+Ve.height),xe+=ut+Ve.height}else ft=a.computeBusNodeSpacing(Je)-re,Je.S.h(ge+ut,xe+ft),b=Math.max(b,ge+ut+Ve.width),z=Math.max(z,xe+Ve.height+ft),ge+=ut+Ve.width;he++}return 1<ee&&ee%2===1&&(x=x[ee-1],ee=x.Da,a=a.computeBusLastRowSpacing(x,ue?Math.max(Math.abs(Pe),Math.abs(xe)):Math.max(Math.abs(Fe),Math.abs(ge))),ue?(x.S.h(E+re/2-x.focus.x-x.la.x,z+a),ue=E+re/2-x.focus.x-x.la.x,b=Math.max(b,ue+ee.width),0>ue&&(b-=ue),z=Math.max(z,Math.max(Pe,xe)+a+ee.height),0>x.S.x&&(E=nv(y,x.S.x,!1,E,re))):(x.S.h(b+a,E+re/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(Fe,ge)+a+ee.width),xe=E+re/2-x.focus.y-x.la.y,z=Math.max(z,xe+ee.height),0>xe&&(z-=xe),0>x.S.y&&(E=nv(y,x.S.y,!0,E,re)))),new Wt(E,0,b,z)}function cS(a,y,x,E,b,z){var ee=x.length;if(ee===0)return new Wt(E,0,b,z);if(ee===1)return x=x[0],b=x.Da.width,z=x.Da.height,new Wt(E,0,b,z);for(var re=y.nodeSpacing,oe=y.rowSpacing,ue=nh(y)===270,he=0,ge=0,xe=0,Pe=0;Pe<ee;Pe++)if(!(Pe%2!==0||1<ee&&Pe===ee-1)){var Fe=x[Pe],Ne=Fe.Da,Je=he===0?0:oe;if(ue){var Ve=a.computeBusNodeSpacing(Fe)-re;xe-=Je+Ne.height,Fe.S.h(E-(Ne.width+Ve),xe),b=Math.max(b,Ne.width+Ve),z=Math.max(z,Math.abs(xe))}else Ve=a.computeBusNodeSpacing(Fe)-re,ge-=Je+Ne.width,Fe.S.h(ge,E-(Ne.height+Ve)),z=Math.max(z,Ne.height+Ve),b=Math.max(b,Math.abs(ge));he++}for(he=0,Fe=ge,Pe=xe,ue?(ge=E+re,xe=0):(ge=0,xe=E+re),Ne=0;Ne<ee;Ne++)if(Ne%2!==0){Je=x[Ne],Ve=Je.Da;var ut=he===0?0:oe;if(ue){var ft=a.computeBusNodeSpacing(Je)-re;xe-=ut+Ve.height,Je.S.h(ge+ft,xe),b=Math.max(b,ge+Ve.width+ft),z=Math.max(z,Math.abs(xe))}else ft=a.computeBusNodeSpacing(Je)-re,ge-=ut+Ve.width,Je.S.h(ge,xe+ft),z=Math.max(z,xe+Ve.height+ft),b=Math.max(b,Math.abs(ge));he++}for(1<ee&&ee%2===1&&(oe=x[ee-1],he=oe.Da,a=a.computeBusLastRowSpacing(oe,ue?Math.max(Math.abs(Pe),Math.abs(xe)):Math.max(Math.abs(Fe),Math.abs(ge))),ue?(oe.S.h(E+re/2-oe.focus.x-oe.la.x,-z-he.height-a),ge=E+re/2-oe.focus.x-oe.la.x,b=Math.max(b,ge+he.width),0>ge&&(b-=ge),z=Math.max(z,Math.abs(Math.min(Pe,xe))+a+he.height),0>oe.S.x&&(E=nv(y,oe.S.x,!1,E,re))):(oe.S.h(-b-he.width-a,E+re/2-oe.focus.y-oe.la.y),b=Math.max(b,Math.abs(Math.min(Fe,ge))+a+he.width),xe=E+re/2-oe.focus.y-oe.la.y,z=Math.max(z,xe+he.height),0>xe&&(z-=xe),0>oe.S.y&&(E=nv(y,oe.S.y,!0,E,re)))),y=0;y<ee;y++)re=x[y],ue?re.S.h(re.S.x,re.S.y+z):re.S.h(re.S.x+b,re.S.y);return new Wt(E,0,b,z)}Ao.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Ao.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function nv(a,y,x,E,b){a=a.children;for(var z=a.length,ee=0;ee<z;ee++)x?a[ee].S.h(a[ee].S.x,a[ee].S.y-y):a[ee].S.h(a[ee].S.x-y,a[ee].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 jy(a,y,x){switch(a.alignment){case Dg:case Bp:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case qh:return a.width>y?a.width:y;case ed:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case oc:case td:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case ac:return a.width-a.focus.x+a.nodeSpacing/2+y;case Bd:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function zy(a,y,x){switch(a.alignment){case Dg:case Bp:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case qh:return a.height>y?a.height:y;case ed:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case oc:case td:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case ac:return a.height-a.focus.y+a.nodeSpacing/2+y;case Bd:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function Zy(a,y,x){switch(a){case Bp:y/=2,x/=2;break;case Dg:y/=2,x/=2;break;case qh:x=y=0;break;case ed:break;default:Ke("Unhandled alignment value "+a.toString())}return new Ie(y,x)}function jf(a,y,x,E,b,z){y=Zy(y,x,E),Ag(a,y.x,y.y,b,z)}function Ag(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 iv(a,y,x,E){var b=y.parent;switch(a.ud){case $h:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case Ng:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:Ke("Unhandled path value "+a.ud.toString())}}function rv(a,y,x){for(var E=0;E<a.length;E++){var b=a[E];b.x+=y,b.y+=x}}function fS(a,y,x,E,b,z,ee,re){var oe=nh(y),ue=oe===90||oe===270,he=y.nodeSpacing;y=E;var ge=b;E=z;var xe=ee,Pe=x.Yo,Fe=x.kp;ee=x.Da;var Ne=ue?Math.max(xe,ee.height):Math.max(E,ee.width);if((Pe===null||oe!==nh(x))&&(Pe=Yl(a,2),Fe=Yl(a,2),ue?(Pe[0].h(0,0),Pe[1].h(0,ee.height),Fe[0].h(ee.width,0),Fe[1].h(Fe[0].x,Pe[1].y)):(Pe[0].h(0,0),Pe[1].h(ee.width,0),Fe[0].h(0,ee.height),Fe[1].h(Pe[1].x,Fe[0].y))),ue){if(xe=9999999,!(ge===null||2>ge.length||Pe===null||2>Pe.length))for(b=x=0;x<ge.length&&b<Pe.length;){z=ge[x];var Je=Pe[b];oe=Je.x,ue=Je.y,oe+=E;var Ve=z;x+1<ge.length&&(Ve=ge[x+1]);var ut=Je;Je=ut.x,ut=ut.y,b+1<Pe.length&&(ut=Pe[b+1],Je=ut.x,ut=ut.y,Je+=E);var ft=xe;z.y===ue?ft=oe-z.x:z.y>ue&&z.y<ut?ft=oe+(z.y-ue)/(ut-ue)*(Je-oe)-z.x:ue>z.y&&ue<Ve.y&&(ft=oe-(z.x+(ue-z.y)/(Ve.y-z.y)*(Ve.x-z.x))),ft<xe&&(xe=ft),Ve.y<=z.y?x++:ut<=ue?b++:(Ve.y<=ut&&x++,ut<=Ve.y&&b++)}if(xe=E-xe,xe+=he,x=Pe,b=xe,y===null||2>y.length||x===null||2>x.length)E=null;else{for(he=Yl(a,y.length+x.length),E=z=oe=0;z<x.length&&x[z].y<y[0].y;)ue=x[z++],he[E++].h(ue.x+b,ue.y);for(;oe<y.length;)ue=y[oe++],he[E++].h(ue.x,ue.y);for(oe=y[y.length-1].y;z<x.length&&x[z].y<=oe;)z++;for(;z<x.length&&x[z].y>oe;)ue=x[z++],he[E++].h(ue.x+b,ue.y);for(x=Yl(a,E),oe=0;oe<E;oe++)x[oe].assign(he[oe]);Sh(a,he),E=x}if(z=Fe,oe=xe,ge===null||2>ge.length||z===null||2>z.length)b=null;else{for(he=Yl(a,ge.length+z.length),b=ue=x=0;x<ge.length&&ge[x].y<z[0].y;)Ve=ge[x++],he[b++].h(Ve.x,Ve.y);for(;ue<z.length;)Ve=z[ue++],he[b++].h(Ve.x+oe,Ve.y);for(z=z[z.length-1].y;x<ge.length&&ge[x].y<=z;)x++;for(;x<ge.length&&ge[x].y>z;)oe=ge[x++],he[b++].h(oe.x,oe.y);for(z=Yl(a,b),x=0;x<b;x++)z[x].assign(he[x]);Sh(a,he),b=z}return z=Math.max(0,xe)+ee.width,ee=Ne,Sh(a,y),Sh(a,Pe),Sh(a,ge),Sh(a,Fe),re[0]=E,re[1]=b,new Wt(xe,0,z,ee)}if(E=9999999,!(ge===null||2>ge.length||Pe===null||2>Pe.length))for(b=x=0;x<ge.length&&b<Pe.length;)z=ge[x],Je=Pe[b],oe=Je.x,ue=Je.y,ue+=xe,Ve=z,x+1<ge.length&&(Ve=ge[x+1]),ut=Je,Je=ut.x,ut=ut.y,b+1<Pe.length&&(ut=Pe[b+1],Je=ut.x,ut=ut.y,ut+=xe),ft=E,z.x===oe?ft=ue-z.y:z.x>oe&&z.x<Je?ft=ue+(z.x-oe)/(Je-oe)*(ut-ue)-z.y:oe>z.x&&oe<Ve.x&&(ft=ue-(z.y+(oe-z.x)/(Ve.x-z.x)*(Ve.y-z.y))),ft<E&&(E=ft),Ve.x<=z.x?x++:Je<=oe?b++:(Ve.x<=Je&&x++,Je<=Ve.x&&b++);if(xe-=E,xe+=he,x=Pe,b=xe,y===null||2>y.length||x===null||2>x.length)E=null;else{for(he=Yl(a,y.length+x.length),E=z=oe=0;z<x.length&&x[z].x<y[0].x;)ue=x[z++],he[E++].h(ue.x,ue.y+b);for(;oe<y.length;)ue=y[oe++],he[E++].h(ue.x,ue.y);for(oe=y[y.length-1].x;z<x.length&&x[z].x<=oe;)z++;for(;z<x.length&&x[z].x>oe;)ue=x[z++],he[E++].h(ue.x,ue.y+b);for(x=Yl(a,E),oe=0;oe<E;oe++)x[oe].assign(he[oe]);Sh(a,he),E=x}if(z=Fe,oe=xe,ge===null||2>ge.length||z===null||2>z.length)b=null;else{for(he=Yl(a,ge.length+z.length),b=ue=x=0;x<ge.length&&ge[x].x<z[0].x;)Ve=ge[x++],he[b++].h(Ve.x,Ve.y);for(;ue<z.length;)Ve=z[ue++],he[b++].h(Ve.x,Ve.y+oe);for(z=z[z.length-1].x;x<ge.length&&ge[x].x<=z;)x++;for(;x<ge.length&&ge[x].x>z;)oe=ge[x++],he[b++].h(oe.x,oe.y);for(z=Yl(a,b),x=0;x<b;x++)z[x].assign(he[x]);Sh(a,he),b=z}return z=Ne,ee=Math.max(0,xe)+ee.height,Sh(a,y),Sh(a,Pe),Sh(a,ge),Sh(a,Fe),re[0]=E,re[1]=b,new Wt(xe,0,z,ee)}function Yl(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 Ie;return a}function Sh(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Ao.prototype.arrangeTrees=function(){if(this.Rb===uv)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof Gu){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),Gy(this,y,x,E)}}}else{for(a=[],y=this.Ub.iterator;y.next();)x=y.value,x instanceof Gu&&a.push(x);switch(this.sorting){case Lp:break;case bm:a.reverse();break;case Fm:a.sort(this.comparer);break;case Lm:a.sort(this.comparer),a.reverse();break;default:Ke("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(Gy(this,b,y+b.la.x,x+b.la.y),this.Rb){case lv:x+=b.Da.height+this.$d.height;break;case Ky:y+=b.Da.width+this.$d.width;break;default:Ke("Unhandled arrangement value "+this.Rb.toString())}}}};function Gy(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 ee=y[z];Gy(a,ee,x+ee.S.x,E+ee.S.y)}}}Ao.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Ao.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Ao.prototype.Gu=function(){if(this.layerStyle===hv){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 Ie(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new Ie(-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 ee=0;ee<a.length;ee++)z+=a[ee]+y[ee];for(ee=0;ee<a.length;ee++){var re=a[ee]+y[ee];this.angle===270?(z-=re,b.push(new Wt(0,z,x,re))):this.angle===90?(b.push(new Wt(0,z,x,re)),z+=re):this.angle===180?(z-=re,b.push(new Wt(z,0,re,x))):(b.push(new Wt(z,0,re,x)),z+=re)}this.commitLayers(b,E)}},Ao.prototype.commitLayers=function(){},Ao.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Ao.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof Gu&&gS(this,y)}};function gS(a,y){if(y!==null){a.setPortSpots(y),y=y.children;for(var x=y.length,E=0;E<x;E++)gS(a,y[E])}}Ao.prototype.setPortSpots=function(a){var y=a.alignment;if(Xc(y)){var x=this.ud===$h,E=nh(a);switch(E){case 0:var b=ko;break;case 90:b=jr;break;case 180:b=ua;break;default:b=Ro}var z=a.children,ee=z.length;switch(y){case oc:case td:for(y=0;y<ee;y++){var re=z[y];if(re=(x?re.sourceEdges:re.destinationEdges).first(),re!==null&&(re=re.link,re!==null)){var oe=E===90||E===270?ua:Ro;if(ee===1||y===ee-1&&ee%2===1)switch(E){case 0:oe=ua;break;case 90:oe=Ro;break;case 180:oe=ko;break;default:oe=jr}else y%2===0&&(oe=E===90||E===270?ko:jr);x?(a.setsPortSpot&&(re.fromSpot=b),a.setsChildPortSpot&&(re.toSpot=oe)):(a.setsPortSpot&&(re.fromSpot=oe),a.setsChildPortSpot&&(re.toSpot=b))}}break;case ac:for(E=E===90||E===270?ko:jr,z=x?a.destinationEdges:a.sourceEdges;z.next();)ee=z.value.link,ee!==null&&(x?(a.setsPortSpot&&(ee.fromSpot=b),a.setsChildPortSpot&&(ee.toSpot=E)):(a.setsPortSpot&&(ee.fromSpot=E),a.setsChildPortSpot&&(ee.toSpot=b)));break;case Bd:for(E=E===90||E===270?ua:Ro,z=x?a.destinationEdges:a.sourceEdges;z.next();)ee=z.value.link,ee!==null&&(x?(a.setsPortSpot&&(ee.fromSpot=b),a.setsChildPortSpot&&(ee.toSpot=E)):(a.setsPortSpot&&(ee.fromSpot=E),a.setsChildPortSpot&&(ee.toSpot=b)))}}else if(x=nh(a),this.ud===$h){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=ko;break;case 90:E.fromSpot=jr;break;case 180:E.fromSpot=ua;break;default:E.fromSpot=Ro}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=ua;break;case 90:E.toSpot=Ro;break;case 180:E.toSpot=ko;break;default:E.toSpot=jr}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=ko;break;case 90:E.toSpot=jr;break;case 180:E.toSpot=ua;break;default:E.toSpot=Ro}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=ua;break;case 90:E.fromSpot=Ro;break;case 180:E.fromSpot=ko;break;default:E.fromSpot=jr}else E.fromSpot=a.childPortSpot}};function nh(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Ao.prototype.computeLayerSpacing=function(a){var y=nh(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},Ao.prototype.computeNodeIndent=function(a){var y=nh(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)},At.Object.defineProperties(Ao.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!==sv&&a!==Hy&&a!==Wy&&a!==Vy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==Uy&&a!==Yy&&a!==hv||(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!==lv&&a!==Ky&&a!==uv||(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!==Lp&&a!==bm&&a!==Fm&&!Lm||(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()):Ke("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!==av&&a!==Bm||(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!==Lp&&a!==bm&&a!==Fm&&!Lm||(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!==av&&a!==Bm||(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 ov=new yn(Ao,"PathDefault",-1),$h=new yn(Ao,"PathDestination",0),Ng=new yn(Ao,"PathSource",1),Lp=new yn(Ao,"SortingForwards",10),bm=new yn(Ao,"SortingReverse",11),Fm=new yn(Ao,"SortingAscending",12),Lm=new yn(Ao,"SortingDescending",13),Bp=new yn(Ao,"AlignmentCenterSubtrees",20),Dg=new yn(Ao,"AlignmentCenterChildren",21),qh=new yn(Ao,"AlignmentStart",22),ed=new yn(Ao,"AlignmentEnd",23),oc=new yn(Ao,"AlignmentBus",24),td=new yn(Ao,"AlignmentBusBranching",25),ac=new yn(Ao,"AlignmentTopLeftBus",26),Bd=new yn(Ao,"AlignmentBottomRightBus",27),av=new yn(Ao,"CompactionNone",30),Bm=new yn(Ao,"CompactionBlock",31),sv=new yn(Ao,"StyleLayered",40),Wy=new yn(Ao,"StyleLastParents",41),Hy=new yn(Ao,"StyleAlternating",42),Vy=new yn(Ao,"StyleRootOnly",43),lv=new yn(Ao,"ArrangementVertical",50),Ky=new yn(Ao,"ArrangementHorizontal",51),uv=new yn(Ao,"ArrangementFixedRoots",52),Uy=new yn(Ao,"LayerIndividual",60),Yy=new yn(Ao,"LayerSiblings",61),hv=new yn(Ao,"LayerUniform",62);Ao.className="TreeLayout",Ao.PathDefault=ov,Ao.PathDestination=$h,Ao.PathSource=Ng,Ao.SortingForwards=Lp,Ao.SortingReverse=bm,Ao.SortingAscending=Fm,Ao.SortingDescending=Lm,Ao.AlignmentCenterSubtrees=Bp,Ao.AlignmentCenterChildren=Dg,Ao.AlignmentStart=qh,Ao.AlignmentEnd=ed,Ao.AlignmentBus=oc,Ao.AlignmentBusBranching=td,Ao.AlignmentTopLeftBus=ac,Ao.AlignmentBottomRightBus=Bd,Ao.CompactionNone=av,Ao.CompactionBlock=Bm,Ao.StyleLayered=sv,Ao.StyleLastParents=Wy,Ao.StyleAlternating=Hy,Ao.StyleRootOnly=Vy,Ao.ArrangementVertical=lv,Ao.ArrangementHorizontal=Ky,Ao.ArrangementFixedRoots=uv,Ao.LayerIndividual=Uy,Ao.LayerSiblings=Yy,Ao.LayerUniform=hv;function Tg(a){_a.call(this,a)}_t(Tg,_a),Tg.prototype.createVertex=function(){return new Gu(this)},Tg.prototype.createEdge=function(){return new Mp(this)},Tg.className="TreeNetwork";function Gu(a){Ps.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 Ie(0,0),this.Da=new Pn(0,0),this.la=new Ie(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Lp,this.hd=gy,this.Kb=0,this.Jb=Dg,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Bm,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=ar,this.wr=!0,this.Dp=ar}_t(Gu,Ps),Gu.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)},At.Object.defineProperties(Gu.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)}}}),Gu.className="TreeVertex";function Mp(a){nu.call(this,a),this.$t=new Ie(0,0)}_t(Mp,nu),Mp.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 $h:x=this.fromVertex,E=this.toVertex;break;case Ng:x=this.toVertex,E=this.fromVertex;break;default:Ke("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=nh(x),ee=y.computeLayerSpacing(x),re=x.rowSpacing;a.vg();var oe=a.curve===vu,ue=a.isOrthogonal,he;if(a.uh(),ue||oe){for(he=2;4<a.pointsCount;)a.pv(2);var ge=a.i(1),xe=a.i(2)}else{for(he=1;3<a.pointsCount;)a.pv(1);ge=a.i(0),xe=a.i(a.pointsCount-1)}var Pe=a.i(a.pointsCount-1);z===0?(x.alignment===ed?(z=E.bottom+b.y,b.y===0&&ge.y>Pe.y+x.rowIndent&&(z=Math.min(z,Math.max(ge.y,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.top+b.y,b.y===0&&ge.y<Pe.y-x.rowIndent&&(z=Math.max(z,Math.min(ge.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,oe?(a.m(he,ge.x,z),he++,a.m(he,E.right+ee,z),he++,a.m(he,E.right+ee+(b.x-re)/3,z),he++,a.m(he,E.right+ee+2*(b.x-re)/3,z),he++,a.m(he,E.right+ee+(b.x-re),z),he++,a.m(he,xe.x,z)):(ue&&(a.m(he,E.right+ee/2,ge.y),he++),a.m(he,E.right+ee/2,z),he++,a.m(he,E.right+ee+b.x-(ue?re/2:re),z),he++,ue&&a.m(he,a.i(he-1).x,xe.y))):z===90?(x.alignment===ed?(z=E.right+b.x,b.x===0&&ge.x>Pe.x+x.rowIndent&&(z=Math.min(z,Math.max(ge.x,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.left+b.x,b.x===0&&ge.x<Pe.x-x.rowIndent&&(z=Math.max(z,Math.min(ge.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,oe?(a.m(he,z,ge.y),he++,a.m(he,z,E.bottom+ee),he++,a.m(he,z,E.bottom+ee+(b.y-re)/3),he++,a.m(he,z,E.bottom+ee+2*(b.y-re)/3),he++,a.m(he,z,E.bottom+ee+(b.y-re)),he++,a.m(he,z,xe.y)):(ue&&(a.m(he,ge.x,E.bottom+ee/2),he++),a.m(he,z,E.bottom+ee/2),he++,a.m(he,z,E.bottom+ee+b.y-(ue?re/2:re)),he++,ue&&a.m(he,xe.x,a.i(he-1).y))):z===180?(x.alignment===ed?(z=E.bottom+b.y,b.y===0&&ge.y>Pe.y+x.rowIndent&&(z=Math.min(z,Math.max(ge.y,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.top+b.y,b.y===0&&ge.y<Pe.y-x.rowIndent&&(z=Math.max(z,Math.min(ge.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,oe?(a.m(he,ge.x,z),he++,a.m(he,E.left-ee,z),he++,a.m(he,E.left-ee+(b.x+re)/3,z),he++,a.m(he,E.left-ee+2*(b.x+re)/3,z),he++,a.m(he,E.left-ee+(b.x+re),z),he++,a.m(he,xe.x,z)):(ue&&(a.m(he,E.left-ee/2,ge.y),he++),a.m(he,E.left-ee/2,z),he++,a.m(he,E.left-ee+b.x+(ue?re/2:re),z),he++,ue&&a.m(he,a.i(he-1).x,xe.y))):z===270?(x.alignment===ed?(z=E.right+b.x,b.x===0&&ge.x>Pe.x+x.rowIndent&&(z=Math.min(z,Math.max(ge.x,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.left+b.x,b.x===0&&ge.x<Pe.x-x.rowIndent&&(z=Math.max(z,Math.min(ge.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,oe?(a.m(he,z,ge.y),he++,a.m(he,z,E.top-ee),he++,a.m(he,z,E.top-ee+(b.y+re)/3),he++,a.m(he,z,E.top-ee+2*(b.y+re)/3),he++,a.m(he,z,E.top-ee+(b.y+re)),he++,a.m(he,z,xe.y)):(ue&&(a.m(he,ge.x,E.top-ee/2),he++),a.m(he,z,E.top-ee/2),he++,a.m(he,z,E.top-ee+b.y+(ue?re/2:re)),he++,ue&&a.m(he,xe.x,a.i(he-1).y))):Ke("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=nh(x),y!==nh(b)&&(ee=E.computeLayerSpacing(x),re=x.bounds,x=b.bounds,y===0&&x.left-re.right<ee+1||y===90&&x.top-re.bottom<ee+1||y===180&&re.left-x.right<ee+1||y===270&&re.top-x.bottom<ee+1||(a.vg(),x=a.curve===vu,b=a.isOrthogonal,E=Xc(this.fromVertex.alignment),a.uh(),y===0?(y=re.right+ee/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=re.bottom+ee/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=re.left-ee/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=re.top-ee/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()))}}},At.Object.defineProperties(Mp.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)}}}),Mp.className="TreeEdge",wo.prototype.initializeStandardTools=function(){this.gb("Action",new Js,this.mouseDownTools),this.gb("Relinking",new Ra,this.mouseDownTools),this.gb("LinkReshaping",new Xa,this.mouseDownTools),this.gb("Rotating",new Ts,this.mouseDownTools),this.gb("Resizing",new Cs,this.mouseDownTools),this.gb("Linking",new ma,this.mouseMoveTools),this.gb("Dragging",new Da,this.mouseMoveTools),this.gb("DragSelecting",new Gl,this.mouseMoveTools),this.gb("Panning",new js,this.mouseMoveTools),this.gb("ContextMenu",new ll,this.mouseUpTools),this.gb("TextEditing",new Ta,this.mouseUpTools),this.gb("ClickCreating",new _h,this.mouseUpTools),this.gb("ClickSelecting",new Ml,this.mouseUpTools)},kh("Horizontal",new jm),kh("Spot",new Zm),kh("Table",new Wm),kh("Viewbox",new Km),kh("TableRow",new Hm),kh("TableColumn",new Vm),kh("Graduated",new Hp),kh("Grid",new Wp),Mf.add("GraphLinksModel",Is),Mf.add("TreeModel",Bu);var dv=wn.go,Xy={get licenseKey(){return jt.licenseKey},set licenseKey(a){jt.licenseKey=a},get version(){return jt.version},Group:to,EnumValue:yn,List:Nn,Set:Tn,Map:Gt,Point:Ie,Size:Pn,Rect:Wt,Margin:Kr,Spot:Zi,Geometry:lt,PathFigure:Zr,PathSegment:Er,InputEvent:yr,DiagramEvent:Qr,ChangedEvent:tr,Model:lr,GraphLinksModel:Wo,TreeModel:Cl,Binding:cs,Transaction:La,UndoManager:zr,CommandHandler:Xe,Tool:eo,DraggingTool:Da,DraggingInfo:ch,DraggingOptions:ae,LinkingBaseTool:gr,LinkingTool:ma,RelinkingTool:Ra,LinkReshapingTool:Xa,ResizingTool:Cs,RotatingTool:Ts,ClickSelectingTool:Ml,ActionTool:Js,ClickCreatingTool:_h,HTMLInfo:Tu,ContextMenuTool:ll,DragSelectingTool:Gl,PanningTool:js,TextEditingTool:Ta,ToolManager:wo,Animation:Zs,AnimationManager:kl,AnimationTrigger:Cu,Layer:Fs,Diagram:jt,Palette:fe,Overview:me,Brush:$o,GraphObject:Ft,Panel:Vn,RowColumnDefinition:xs,Shape:lo,TextBlock:Ia,Picture:Tl,Part:mr,Adornment:ta,Node:Ci,Link:qn,Placeholder:Sl,Layout:Va,LayoutNetwork:_a,LayoutVertex:Ps,LayoutEdge:nu,GridLayout:Hs,PanelLayout:ws,CircularLayout:qa,CircularNetwork:Cp,CircularVertex:ym,CircularEdge:V0,ForceDirectedLayout:tl,ForceDirectedNetwork:kg,ForceDirectedVertex:xm,ForceDirectedEdge:Sm,LayeredDigraphLayout:xa,LayeredDigraphNetwork:Fp,LayeredDigraphVertex:ku,LayeredDigraphEdge:Em,TreeLayout:Ao,TreeNetwork:Tg,TreeVertex:Gu,TreeEdge:Mp};typeof dv=="object"&&dv.version&&ci("WARNING: a `go` object on the root object is already defined. "+("Debug"in dv?"debug ":"")+"version: "+dv.version+", replaced with version: "+Xy.version),jt.prototype.go=Xy,wn.go=Xy,typeof Zn.exports=="object"&&(Zn.exports=typeof Le.g!="undefined"?Le.g.go:self.go)}();var le=typeof Le.g!="undefined"?Le.g.go:self.go;const Ue=typeof Le.g!="undefined"?Le.g.go:self.go,pt=Ue.Group,St=Ue.EnumValue,yt=Ue.List,Oe=Ue.Set,at=Ue.Map,Ct=Ue.Point,ot=Ue.Size,We=Ue.Rect,Tt=Ue.Margin,dt=Ue.Spot,kt=Ue.Geometry,De=Ue.PathFigure,ne=Ue.PathSegment,te=Ue.InputEvent,de=Ue.DiagramEvent,se=Ue.ChangedEvent,pe=Ue.Model,ye=Ue.GraphLinksModel,we=Ue.TreeModel,Ce=Ue.Binding,_e=Ue.Transaction,Ze=Ue.UndoManager,st=Ue.CommandHandler,nt=Ue.Tool,Ye=Ue.DraggingTool,ct=Ue.DraggingInfo,$e=Ue.LinkingBaseTool,Et=Ue.LinkingTool,Pt=Ue.RelinkingTool,Bt=Ue.LinkReshapingTool,fn=Ue.ResizingTool,qt=Ue.RotatingTool,vn=Ue.ClickSelectingTool,tn=Ue.ActionTool,it=Ue.ClickCreatingTool,rt=Ue.HTMLInfo,dn=Ue.ContextMenuTool,ni=Ue.DragSelectingTool,Kn=Ue.PanningTool,Rt=Ue.TextEditingTool,En=Ue.ToolManager,Bn=Ue.Animation,ui=Ue.AnimationManager,It=Ue.AnimationTrigger,On=Ue.Layer,ht=Ue.Diagram,kn=Ue.Palette,Oi=Ue.Overview,ze=Ue.Brush,Me=Ue.GraphObject,Ee=Ue.Panel,Te=Ue.RowColumnDefinition,He=Ue.Shape,Ae=Ue.TextBlock,et=Ue.TextBlockMetrics,on=Ue.Picture,Kt=Ue.Part,pn=Ue.Adornment,Nt=Ue.Node,Dt=Ue.Link,Ot=Ue.Placeholder,un=Ue.Layout,Sn=Ue.LayoutNetwork,An=Ue.LayoutVertex,Dn=Ue.LayoutEdge,Ai=Ue.GridLayout,en=Ue.PanelLayout,Qt=Ue.CircularLayout,ln=Ue.CircularNetwork,di=Ue.CircularVertex,cn=Ue.CircularEdge,Yt=Ue.ForceDirectedLayout,ii=Ue.ForceDirectedNetwork,Vi=Ue.ForceDirectedVertex,bi=Ue.ForceDirectedEdge,Di=Ue.LayeredDigraphLayout,Mr=Ue.LayeredDigraphNetwork,Gn=Ue.LayeredDigraphVertex,Rn=Ue.LayeredDigraphEdge,Jn=Ue.TreeLayout,Ni=Ue.TreeNetwork,ji=Ue.TreeVertex,Gi=Ue.TreeEdge,Fr=Ue.version},24334:function(Zn,ei,Le){var le,Ue;(function(pt,St){Zn.exports=St(pt)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Le.g!="undefined"?Le.g:this,function(pt){"use strict";pt=pt||{};var St=pt.Base64,yt="2.6.4",Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",at=function(Pt){for(var Bt={},fn=0,qt=Pt.length;fn<qt;fn++)Bt[Pt.charAt(fn)]=fn;return Bt}(Oe),Ct=String.fromCharCode,ot=function(Pt){if(Pt.length<2){var Bt=Pt.charCodeAt(0);return Bt<128?Pt:Bt<2048?Ct(192|Bt>>>6)+Ct(128|Bt&63):Ct(224|Bt>>>12&15)+Ct(128|Bt>>>6&63)+Ct(128|Bt&63)}else{var Bt=65536+(Pt.charCodeAt(0)-55296)*1024+(Pt.charCodeAt(1)-56320);return Ct(240|Bt>>>18&7)+Ct(128|Bt>>>12&63)+Ct(128|Bt>>>6&63)+Ct(128|Bt&63)}},We=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Tt=function(Pt){return Pt.replace(We,ot)},dt=function(Pt){var Bt=[0,2,1][Pt.length%3],fn=Pt.charCodeAt(0)<<16|(Pt.length>1?Pt.charCodeAt(1):0)<<8|(Pt.length>2?Pt.charCodeAt(2):0),qt=[Oe.charAt(fn>>>18),Oe.charAt(fn>>>12&63),Bt>=2?"=":Oe.charAt(fn>>>6&63),Bt>=1?"=":Oe.charAt(fn&63)];return qt.join("")},kt=pt.btoa&&typeof pt.btoa=="function"?function(Pt){return pt.btoa(Pt)}:function(Pt){if(Pt.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return Pt.replace(/[\s\S]{1,3}/g,dt)},De=function(Pt){return kt(Tt(String(Pt)))},ne=function(Pt){return Pt.replace(/[+\/]/g,function(Bt){return Bt=="+"?"-":"_"}).replace(/=/g,"")},te=function(Pt,Bt){return Bt?ne(De(Pt)):De(Pt)},de=function(Pt){return te(Pt,!0)},se;pt.Uint8Array&&(se=function(Pt,Bt){for(var fn="",qt=0,vn=Pt.length;qt<vn;qt+=3){var tn=Pt[qt],it=Pt[qt+1],rt=Pt[qt+2],dn=tn<<16|it<<8|rt;fn+=Oe.charAt(dn>>>18)+Oe.charAt(dn>>>12&63)+(typeof it!="undefined"?Oe.charAt(dn>>>6&63):"=")+(typeof rt!="undefined"?Oe.charAt(dn&63):"=")}return Bt?ne(fn):fn});var pe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ye=function(Pt){switch(Pt.length){case 4:var Bt=(7&Pt.charCodeAt(0))<<18|(63&Pt.charCodeAt(1))<<12|(63&Pt.charCodeAt(2))<<6|63&Pt.charCodeAt(3),fn=Bt-65536;return Ct((fn>>>10)+55296)+Ct((fn&1023)+56320);case 3:return Ct((15&Pt.charCodeAt(0))<<12|(63&Pt.charCodeAt(1))<<6|63&Pt.charCodeAt(2));default:return Ct((31&Pt.charCodeAt(0))<<6|63&Pt.charCodeAt(1))}},we=function(Pt){return Pt.replace(pe,ye)},Ce=function(Pt){var Bt=Pt.length,fn=Bt%4,qt=(Bt>0?at[Pt.charAt(0)]<<18:0)|(Bt>1?at[Pt.charAt(1)]<<12:0)|(Bt>2?at[Pt.charAt(2)]<<6:0)|(Bt>3?at[Pt.charAt(3)]:0),vn=[Ct(qt>>>16),Ct(qt>>>8&255),Ct(qt&255)];return vn.length-=[0,0,2,1][fn],vn.join("")},_e=pt.atob&&typeof pt.atob=="function"?function(Pt){return pt.atob(Pt)}:function(Pt){return Pt.replace(/\S{1,4}/g,Ce)},Ze=function(Pt){return _e(String(Pt).replace(/[^A-Za-z0-9\+\/]/g,""))},st=function(Pt){return we(_e(Pt))},nt=function(Pt){return String(Pt).replace(/[-_]/g,function(Bt){return Bt=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Ye=function(Pt){return st(nt(Pt))},ct;pt.Uint8Array&&(ct=function(Pt){return Uint8Array.from(Ze(nt(Pt)),function(Bt){return Bt.charCodeAt(0)})});var $e=function(){var Pt=pt.Base64;return pt.Base64=St,Pt};if(pt.Base64={VERSION:yt,atob:Ze,btoa:kt,fromBase64:Ye,toBase64:te,utob:Tt,encode:te,encodeURI:de,btou:we,decode:Ye,noConflict:$e,fromUint8Array:se,toUint8Array:ct},typeof Object.defineProperty=="function"){var Et=function(Pt){return{value:Pt,enumerable:!1,writable:!0,configurable:!0}};pt.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Et(function(){return Ye(this)})),Object.defineProperty(String.prototype,"toBase64",Et(function(Pt){return te(this,Pt)})),Object.defineProperty(String.prototype,"toBase64URI",Et(function(){return te(this,!0)}))}}return pt.Meteor&&(Base64=pt.Base64),Zn.exports?Zn.exports.Base64=pt.Base64:(le=[],Ue=function(){return pt.Base64}.apply(ei,le),Ue!==void 0&&(Zn.exports=Ue)),{Base64:pt.Base64}})},2859:function(Zn,ei,Le){"use strict";Le.d(ei,{hP:function(){return Oi}});var le=function(ze,Me){return(le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ee,Te){Ee.__proto__=Te}||function(Ee,Te){for(var He in Te)Object.prototype.hasOwnProperty.call(Te,He)&&(Ee[He]=Te[He])})(ze,Me)};function Ue(ze,Me){function Ee(){this.constructor=ze}le(ze,Me),ze.prototype=Me===null?Object.create(Me):(Ee.prototype=Me.prototype,new Ee)}function pt(ze,Me,Ee,Te){return new(Ee||(Ee=Promise))(function(He,Ae){function et(pn){try{Kt(Te.next(pn))}catch(Nt){Ae(Nt)}}function on(pn){try{Kt(Te.throw(pn))}catch(Nt){Ae(Nt)}}function Kt(pn){var Nt;pn.done?He(pn.value):(Nt=pn.value,Nt instanceof Ee?Nt:new Ee(function(Dt){Dt(Nt)})).then(et,on)}Kt((Te=Te.apply(ze,Me||[])).next())})}function St(ze,Me){var Ee,Te,He,Ae,et={label:0,sent:function(){if(1&He[0])throw He[1];return He[1]},trys:[],ops:[]};return Ae={next:on(0),throw:on(1),return:on(2)},typeof Symbol=="function"&&(Ae[Symbol.iterator]=function(){return this}),Ae;function on(Kt){return function(pn){return function(Nt){if(Ee)throw new TypeError("Generator is already executing.");for(;et;)try{if(Ee=1,Te&&(He=2&Nt[0]?Te.return:Nt[0]?Te.throw||((He=Te.return)&&He.call(Te),0):Te.next)&&!(He=He.call(Te,Nt[1])).done)return He;switch(Te=0,He&&(Nt=[2&Nt[0],He.value]),Nt[0]){case 0:case 1:He=Nt;break;case 4:return et.label++,{value:Nt[1],done:!1};case 5:et.label++,Te=Nt[1],Nt=[0];continue;case 7:Nt=et.ops.pop(),et.trys.pop();continue;default:if(He=et.trys,!((He=He.length>0&&He[He.length-1])||Nt[0]!==6&&Nt[0]!==2)){et=0;continue}if(Nt[0]===3&&(!He||Nt[1]>He[0]&&Nt[1]<He[3])){et.label=Nt[1];break}if(Nt[0]===6&&et.label<He[1]){et.label=He[1],He=Nt;break}if(He&&et.label<He[2]){et.label=He[2],et.ops.push(Nt);break}He[2]&&et.ops.pop(),et.trys.pop();continue}Nt=Me.call(ze,et)}catch(Dt){Nt=[6,Dt],Te=0}finally{Ee=He=0}if(5&Nt[0])throw Nt[1];return{value:Nt[0]?Nt[1]:void 0,done:!0}}([Kt,pn])}}}function yt(){for(var ze=0,Me=0,Ee=arguments.length;Me<Ee;Me++)ze+=arguments[Me].length;var Te=Array(ze),He=0;for(Me=0;Me<Ee;Me++)for(var Ae=arguments[Me],et=0,on=Ae.length;et<on;et++,He++)Te[He]=Ae[et];return Te}var Oe=function(){function ze(){}return ze.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ze.setAttributes=function(Me,Ee){for(var Te=0,He=Ee;Te<He.length;Te++){var Ae=He[Te],et=Ae[0],on=Ae[1];Me.setAttribute(et,on)}},ze.createRect=function(Me,Ee,Te){var He=document.createElementNS("http://www.w3.org/2000/svg","rect");return He.setAttribute("width",Me.toString()),He.setAttribute("height",Ee.toString()),Te&&ze.setAttributes(He,Te),He},ze.createLine=function(Me,Ee,Te,He,Ae){var et=document.createElementNS("http://www.w3.org/2000/svg","line");return et.setAttribute("x1",Me.toString()),et.setAttribute("y1",Ee.toString()),et.setAttribute("x2",Te.toString()),et.setAttribute("y2",He.toString()),Ae&&ze.setAttributes(et,Ae),et},ze.createPolygon=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Te.setAttribute("points",Me),Ee&&ze.setAttributes(Te,Ee),Te},ze.createCircle=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","circle");return Te.setAttribute("cx",(Me/2).toString()),Te.setAttribute("cy",(Me/2).toString()),Te.setAttribute("r",Me.toString()),Ee&&ze.setAttributes(Te,Ee),Te},ze.createEllipse=function(Me,Ee,Te){var He=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return He.setAttribute("cx",(Me/2).toString()),He.setAttribute("cy",(Ee/2).toString()),He.setAttribute("rx",(Me/2).toString()),He.setAttribute("ry",(Ee/2).toString()),Te&&ze.setAttributes(He,Te),He},ze.createGroup=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","g");return Me&&ze.setAttributes(Ee,Me),Ee},ze.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ze.createMarker=function(Me,Ee,Te,He,Ae,et,on){var Kt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ze.setAttributes(Kt,[["id",Me],["orient",Ee],["markerWidth",Te.toString()],["markerHeight",He.toString()],["refX",Ae.toString()],["refY",et.toString()]]),Kt.appendChild(on),Kt},ze.createText=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","text");return Ee.setAttribute("x","0"),Ee.setAttribute("y","0"),Me&&ze.setAttributes(Ee,Me),Ee},ze.createTSpan=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Te.textContent=Me,Ee&&ze.setAttributes(Te,Ee),Te},ze.createImage=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","image");return Me&&ze.setAttributes(Ee,Me),Ee},ze.createPoint=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Te.x=Me,Te.y=Ee,Te},ze.createPath=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","path");return Te.setAttribute("d",Me),Ee&&ze.setAttributes(Te,Ee),Te},ze}(),at=function(){function ze(){}return ze.addKey=function(Me){ze.key=Me},Object.defineProperty(ze,"isLicensed",{get:function(){return!!ze.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ze.key)},enumerable:!1,configurable:!0}),ze}(),Ct=function(){function ze(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ze.prototype.rasterize=function(Me,Ee,Te){var He=this;return new Promise(function(Ae){var et=Te!==void 0?Te:document.createElement("canvas");Me===null&&(He.markersOnly=!0,He.naturalSize=!1);var on=document.createElementNS("http://www.w3.org/2000/svg","svg");on.setAttribute("xmlns","http://www.w3.org/2000/svg"),on.setAttribute("width",Ee.width.baseVal.valueAsString),on.setAttribute("height",Ee.height.baseVal.valueAsString),on.setAttribute("viewBox","0 0 "+Ee.viewBox.baseVal.width.toString()+" "+Ee.viewBox.baseVal.height.toString()),on.innerHTML=Ee.innerHTML,He.naturalSize===!0?(on.width.baseVal.value=Me.naturalWidth,on.height.baseVal.value=Me.naturalHeight):He.width!==void 0&&He.height!==void 0&&(on.width.baseVal.value=He.width,on.height.baseVal.value=He.height),et.width=on.width.baseVal.value,et.height=on.height.baseVal.value;var Kt=on.outerHTML,pn=et.getContext("2d");He.markersOnly!==!0&&pn.drawImage(Me,0,0,et.width,et.height);var Nt=window.URL,Dt=new Image(et.width,et.height);Dt.setAttribute("crossOrigin","anonymous");var Ot=new Blob([Kt],{type:"image/svg+xml"}),un=Nt.createObjectURL(Ot);Dt.onload=function(){pn.drawImage(Dt,0,0),Nt.revokeObjectURL(un);var Sn=et.toDataURL(He.imageType,He.imageQuality);Ae(Sn)},Dt.src=un})},ze}(),ot=function(){},We=function(){function ze(Me){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Me+"_"}return Object.defineProperty(ze.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ze.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(ze.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ze.prototype.addClass=function(Me){return this.styleSheet===void 0&&this.addStyleSheet(),Me.name=""+this.classNamePrefix+Me.localName,this.classes.push(Me),this.styleSheet.sheet.insertRule("."+Me.name+" {"+Me.style+"}",this.styleSheet.sheet.cssRules.length),Me},ze.prototype.addRule=function(Me){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Me),this.styleSheet.sheet.insertRule(Me.selector+" {"+Me.style+"}",this.styleSheet.sheet.cssRules.length)},ze.prototype.addStyleSheet=function(){var Me;this.styleSheet=document.createElement("style"),((Me=this.styleSheetRoot)!==null&&Me!==void 0?Me:document.head).appendChild(this.styleSheet),this.addRule(new Tt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Tt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Tt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new dt("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new dt("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},ze.prototype.removeStyleSheet=function(){var Me;this.styleSheet&&(((Me=this.styleSheetRoot)!==null&&Me!==void 0?Me:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ze}(),Tt=function(ze,Me){this.selector=ze,this.style=Me},dt=function(ze,Me){this.localName=ze,this.style=Me},kt=function(){function ze(Me,Ee,Te,He,Ae){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Me,this.displayMode=Ee,this.markerItems=Te,this.uiStyleSettings=He,this.styles=Ae,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ze.prototype.show=function(Me){var Ee=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Me,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Te=document.createElement("div");Te.className=this.toolbarBlockStyleClass.name,Te.style.whiteSpace="nowrap",this.uiContainer.appendChild(Te),this.addActionButton(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Ae){var et=document.createElement("div");et.className=""+Ee.toolbarButtonStyleClass.name,et.setAttribute("data-type-name",Ae.typeName),et.innerHTML=Ae.icon,et.addEventListener("click",function(){Ee.markerToolbarButtonClicked(et,Ae)}),Ee.buttons.push(et),Ee.markerButtons.push(et)}),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 He=document.createElement("div");He.className=this.toolbarBlockStyleClass.name,He.style.whiteSpace="nowrap",He.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(He),this.addActionButton(He,'<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(He,'<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()},ze.prototype.addButtonClickListener=function(Me){this.buttonClickListeners.push(Me)},ze.prototype.removeButtonClickListener=function(Me){this.buttonClickListeners.indexOf(Me)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Me),1)},ze.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ze.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Me=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Ee=0;Ee<this.markerButtons.length;Ee++)Ee<Me||Ee===Me&&this.markerButtons.length-1===Me?this.markerButtonBlock.appendChild(this.markerButtons[Ee]):(Ee===Me&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Ee]))}},ze.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")},ze.prototype.resetButtonStyles=function(){var Me=this;this.buttons.forEach(function(Ee){Ee.className=Ee.className.replace(Me.uiStyleSettings.toolbarButtonStyleColorsClassName?Me.uiStyleSettings.toolbarButtonStyleColorsClassName:Me.toolbarButtonStyleColorsClass.name,"").trim(),Ee.className=Ee.className.replace(Me.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Me.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Me.toolbarActiveButtonStyleColorsClass.name,"").trim(),Ee.className+=" "+(Me.uiStyleSettings.toolbarButtonStyleColorsClassName?Me.uiStyleSettings.toolbarButtonStyleColorsClassName:Me.toolbarButtonStyleColorsClass.name)})},ze.prototype.addActionButton=function(Me,Ee,Te){var He=this,Ae=document.createElement("div");switch(Ae.className=""+this.toolbarButtonStyleClass.name,Ae.innerHTML=Ee,Ae.setAttribute("data-action",Te),Ae.addEventListener("click",function(){He.actionToolbarButtonClicked(Ae,Te)}),Te){case"select":Ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Ae.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Ae.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Ae.style.fill=this.uiStyleSettings.closeButtonColor}Me.appendChild(Ae),this.buttons.push(Ae)},ze.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new dt("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 dt("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new dt("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new dt("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 dt("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var Me=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new dt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*Me)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*Me)+`px;
|
|
padding: `+Me+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Tt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Tt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},ze.prototype.markerToolbarButtonClicked=function(Me,Ee){this.setActiveButton(Me),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Te){return Te("marker",Ee)}),this.markerButtonOverflowBlock.style.display="none"},ze.prototype.actionToolbarButtonClicked=function(Me,Ee){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Te){return Te("action",Ee)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ze.prototype.setActiveButton=function(Me){this.resetButtonStyles(),Me.className=Me.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Me.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ze.prototype.setActiveMarkerButton=function(Me){var Ee=this.markerButtons.find(function(Te){return Te.getAttribute("data-type-name")===Me});Ee&&this.setActiveButton(Ee)},ze.prototype.setCurrentMarker=function(Me){var Ee=this;this.currentMarker=Me,this.buttons.filter(function(Te){return/delete|notes/.test(Te.getAttribute("data-action"))}).forEach(function(Te){Ee.currentMarker===void 0?(Te.style.fillOpacity="0.4",Te.style.pointerEvents="none"):(Te.style.fillOpacity="1",Te.style.pointerEvents="all")})},ze}(),De=function(){function ze(Me,Ee,Te,He){this.panels=[],this.panelButtons=[],this.markerjsContainer=Me,this.displayMode=Ee,this.uiStyleSettings=Te,this.styles=He,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ze.prototype.addStyles=function(){var Me;this.toolboxStyleClass=this.styles.addClass(new dt("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 dt("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var Ee=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new dt("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new dt("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new dt("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 dt("toolbox-panel-row_colors",`
|
|
background-color: `+((Me=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Me!==void 0?Me:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new dt("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*Ee)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*Ee)+`px;
|
|
padding: `+Ee+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new dt("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new dt("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Tt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Tt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},ze.prototype.show=function(Me){var Ee;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Me,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Ee=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Ee!==void 0?Ee:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ze.prototype.setPanelButtons=function(Me){var Ee,Te,He=this;this.panels=Me,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Ee=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Ee!==void 0?Ee:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Te=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Te!==void 0?Te:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Ae){var et;Ae.uiStyleSettings=He.uiStyleSettings;var on=document.createElement("div");on.className=He.toolboxButtonStyleClass.name+" "+((et=He.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&et!==void 0?et:He.toolboxButtonStyleColorsClass.name),on.innerHTML=Ae.icon,on.title=Ae.title,on.addEventListener("click",function(){He.panelButtonClick(Ae)}),He.panelButtons.push(on),He.buttonRow.appendChild(on)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ze.prototype.panelButtonClick=function(Me){var Ee=this,Te=-1;if(Me!==this.activePanel){Te=this.panels.indexOf(Me),this.panelRow.innerHTML="";var He=Me.getUi();He.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(He),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=Me}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Ee.displayMode==="inline"?Ee.panelRow.style.display="none":Ee.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Ae,et){var on,Kt;Ae.className=Ee.toolboxButtonStyleClass.name+" "+(et===Te?""+((on=Ee.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&on!==void 0?on:Ee.toolboxActiveButtonStyleColorsClass.name):""+((Kt=Ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Kt!==void 0?Kt:Ee.toolboxButtonStyleColorsClass.name))})},ze}(),ne=function(ze,Me){this.title=ze,this.icon=Me},te=function(ze){function Me(Ee,Te,He,Ae){var et=ze.call(this,Ee,Ae||'<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 et.colors=[],et.addTransparent=!1,et.colorBoxes=[],et.colors=Te,et.currentColor=He,et.setCurrentColor=et.setCurrentColor.bind(et),et.getColorBox=et.getColorBox.bind(et),et}return Ue(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.overflow="hidden",Te.style.whiteSpace="nowrap",this.colors.forEach(function(He){var Ae=Ee.getColorBox(He);Te.appendChild(Ae),Ee.colorBoxes.push(Ae)}),Te},Me.prototype.getColorBox=function(Ee){var Te=this,He=this.uiStyleSettings.toolbarHeight/4,Ae=this.uiStyleSettings.toolbarHeight-He,et=document.createElement("div");et.style.display="inline-block",et.style.boxSizing="content-box",et.style.width=Ae-2+"px",et.style.height=Ae-2+"px",et.style.padding="1px",et.style.marginRight="2px",et.style.marginBottom="2px",et.style.borderWidth="2px",et.style.borderStyle="solid",et.style.borderRadius=(Ae+2)/2+"px",et.style.borderColor=Ee===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",et.addEventListener("click",function(){Te.setCurrentColor(Ee,et)});var on=document.createElement("div");return on.style.display="inline-block",on.style.width=Ae-2+"px",on.style.height=Ae-2+"px",on.style.backgroundColor=Ee,on.style.borderRadius=Ae/2+"px",Ee==="transparent"&&(on.style.fill=this.uiStyleSettings.toolboxAccentColor,on.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>`),et.appendChild(on),et},Me.prototype.setCurrentColor=function(Ee,Te){var He=this;this.currentColor=Ee,this.colorBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Ee)},Me}(ne),de=function(){function ze(Me,Ee,Te){this._state="new",this._isSelected=!1,this._container=Me,this._overlayContainer=Ee,this.globalSettings=Te,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ze.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ze.prototype.ownsTarget=function(Me){return!1},Object.defineProperty(ze.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ze.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ze.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ze.prototype.pointerDown=function(Me,Ee){},ze.prototype.dblClick=function(Me,Ee){},ze.prototype.manipulate=function(Me){},ze.prototype.pointerUp=function(Me){this.stateChanged()},ze.prototype.dispose=function(){},ze.prototype.addMarkerVisualToContainer=function(Me){this.container.childNodes.length>0?this.container.insertBefore(Me,this.container.childNodes[0]):this.container.appendChild(Me)},ze.prototype.getState=function(){return{typeName:ze.typeName,state:this.state,notes:this.notes}},ze.prototype.restoreState=function(Me){this._state=Me.state,this.notes=Me.notes},ze.prototype.scale=function(Me,Ee){},ze.prototype.colorChanged=function(Me){this.onColorChanged&&this.onColorChanged(Me),this.stateChanged()},ze.prototype.fillColorChanged=function(Me){this.onFillColorChanged&&this.onFillColorChanged(Me),this.stateChanged()},ze.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Me=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Me.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Me)&&this.onStateChanged(this)}},ze.typeName="MarkerBase",ze}(),se=function(){function ze(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ze.prototype.findGripByVisual=function(Me){return this.topLeft.ownsTarget(Me)?this.topLeft:this.topCenter.ownsTarget(Me)?this.topCenter:this.topRight.ownsTarget(Me)?this.topRight:this.centerLeft.ownsTarget(Me)?this.centerLeft:this.centerRight.ownsTarget(Me)?this.centerRight:this.bottomLeft.ownsTarget(Me)?this.bottomLeft:this.bottomCenter.ownsTarget(Me)?this.bottomCenter:this.bottomRight.ownsTarget(Me)?this.bottomRight:void 0},ze}(),pe=function(){function ze(){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 ze.prototype.ownsTarget=function(Me){return Me===this.visual||Me===this.visual.childNodes[0]||Me===this.visual.childNodes[1]},ze}(),ye=function(){function ze(){}return ze.toITransformMatrix=function(Me){return{a:Me.a,b:Me.b,c:Me.c,d:Me.d,e:Me.e,f:Me.f}},ze.toSVGMatrix=function(Me,Ee){return Me.a=Ee.a,Me.b=Ee.b,Me.c=Ee.c,Me.d=Ee.d,Me.e=Ee.e,Me.f=Ee.f,Me},ze}(),we=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.left=0,Ae.top=0,Ae.width=0,Ae.height=0,Ae.defaultSize={x:50,y:20},Ae.offsetX=0,Ae.offsetY=0,Ae.rotationAngle=0,Ae.CB_DISTANCE=10,Ae._suppressMarkerCreateEvent=!1,Ae.container.transform.baseVal.appendItem(Oe.createTransform()),Ae.setupControlBox(),Ae}return Ue(Me,ze),Object.defineProperty(Me.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Me.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Me.prototype,"visual",{get:function(){return this._visual},set:function(Ee){this._visual=Ee;var Te=Oe.createTransform();this._visual.transform.baseVal.appendItem(Te)},enumerable:!1,configurable:!0}),Me.prototype.ownsTarget=function(Ee){return!!ze.prototype.ownsTarget.call(this,Ee)||!!(this.controlGrips.findGripByVisual(Ee)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Ee))},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.left=Ee.x,this.top=Ee.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var He=this.unrotatePoint(Ee);if(this.manipulationStartX=He.x,this.manipulationStartY=He.y,this.offsetX=He.x-this.left,this.offsetY=He.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Te),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Te)){this.activeGrip=this.rotatorGrip;var Ae=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Ae.x-this.width/2,this.top=Ae.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var et=this.container.transform.baseVal.getItem(0);et.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(et,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Me.prototype.pointerUp=function(Ee){var Te=this.state;ze.prototype.pointerUp.call(this,Ee),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Ee),this._state="select",Te==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Me.prototype.moveVisual=function(Ee){this.visual.style.transform="translate("+Ee.x+"px, "+Ee.y+"px)"},Me.prototype.manipulate=function(Ee){var Te=this.unrotatePoint(Ee);this.state==="creating"?this.resize(Ee):this.state==="move"?(this.left=this.manipulationStartLeft+(Te.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Te.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Te):this.state==="rotate"&&this.rotate(Ee)},Me.prototype.resize=function(Ee){var Te=this.manipulationStartLeft,He=this.manipulationStartWidth,Ae=this.manipulationStartTop,et=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Te=this.manipulationStartLeft+Ee.x-this.manipulationStartX,He=this.manipulationStartWidth+this.manipulationStartLeft-Te;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:He=this.manipulationStartWidth+Ee.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Ae=this.manipulationStartTop+Ee.y-this.manipulationStartY,et=this.manipulationStartHeight+this.manipulationStartTop-Ae;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:et=this.manipulationStartHeight+Ee.y-this.manipulationStartY}He>=0?(this.left=Te,this.width=He):(this.left=Te+He,this.width=-He),et>=0?(this.top=Ae,this.height=et):(this.top=Ae+et,this.height=-et),this.setSize()},Me.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Me.prototype.rotate=function(Ee){if(Math.abs(Ee.x-this.centerX)>.1){var Te=Math.sign(Ee.x-this.centerX);this.rotationAngle=180*Math.atan((Ee.y-this.centerY)/(Ee.x-this.centerX))/Math.PI+90*Te,this.applyRotation()}},Me.prototype.applyRotation=function(){var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0)},Me.prototype.rotatePoint=function(Ee){if(this.rotationAngle===0)return Ee;var Te=this.container.getCTM(),He=Oe.createPoint(Ee.x,Ee.y);return{x:(He=He.matrixTransform(Te)).x,y:He.y}},Me.prototype.unrotatePoint=function(Ee){if(this.rotationAngle===0)return Ee;var Te=this.container.getCTM();Te=Te.inverse();var He=Oe.createPoint(Ee.x,Ee.y);return{x:(He=He.matrixTransform(Te)).x,y:He.y}},Me.prototype.select=function(){ze.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Me.prototype.deselect=function(){ze.prototype.deselect.call(this),this.controlBox.style.display="none"},Me.prototype.setupControlBox=function(){this.controlBox=Oe.createGroup();var Ee=Oe.createTransform();Ee.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Ee),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 se,this.addControlGrips(),this.controlBox.style.display="none"},Me.prototype.adjustControlBox=function(){var Ee=this.controlBox.transform.baseVal.getItem(0);Ee.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Ee,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()},Me.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()},Me.prototype.createGrip=function(){var Ee=new pe;return Ee.visual.transform.baseVal.appendItem(Oe.createTransform()),this.controlBox.appendChild(Ee.visual),Ee},Me.prototype.positionGrips=function(){var Ee=this.controlGrips.topLeft.GRIP_SIZE,Te=-Ee/2,He=Te,Ae=(this.width+this.CB_DISTANCE)/2-Ee/2,et=(this.height+this.CB_DISTANCE)/2-Ee/2,on=this.height+this.CB_DISTANCE-Ee/2,Kt=this.width+this.CB_DISTANCE-Ee/2;this.positionGrip(this.controlGrips.topLeft.visual,Te,He),this.positionGrip(this.controlGrips.topCenter.visual,Ae,He),this.positionGrip(this.controlGrips.topRight.visual,Kt,He),this.positionGrip(this.controlGrips.centerLeft.visual,Te,et),this.positionGrip(this.controlGrips.centerRight.visual,Kt,et),this.positionGrip(this.controlGrips.bottomLeft.visual,Te,on),this.positionGrip(this.controlGrips.bottomCenter.visual,Ae,on),this.positionGrip(this.controlGrips.bottomRight.visual,Kt,on),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Ae,He-3*this.CB_DISTANCE)},Me.prototype.positionGrip=function(Ee,Te,He){var Ae=Ee.transform.baseVal.getItem(0);Ae.setTranslate(Te,He),Ee.transform.baseVal.replaceItem(Ae,0)},Me.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Me.prototype.showControlBox=function(){this.controlBox.style.display=""},Me.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ye.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ye.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ze.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.left=Te.left,this.top=Te.top,this.width=Te.width,this.height=Te.height,this.rotationAngle=Te.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ye.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Te.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ye.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Te.containerTransformMatrix))},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te);var He=this.rotatePoint({x:this.left,y:this.top}),Ae=this.unrotatePoint({x:He.x*Ee,y:He.y*Te});this.left=Ae.x,this.top=Ae.y,this.width=this.width*Ee,this.height=this.height*Te,this.adjustControlBox()},Me}(de),Ce=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor="transparent",Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.opacity=1,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setFillColor=Ae.setFillColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.createVisual=Ae.createVisual.bind(Ae),Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual)},Me.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.setSize=function(){ze.prototype.setSize.call(this),Oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Me.prototype.pointerUp=function(Ee){ze.prototype.pointerUp.call(this,Ee),this.setSize()},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Ee),this.stateChanged()},Me.prototype.setFillColor=function(Ee){this.fillColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Me.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ze.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){var Te=Ee;this.fillColor=Te.fillColor,this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.opacity=Te.opacity,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize()},Me.title="Rectangle marker",Me}(we),_e=function(ze){function Me(Ee,Te,He,Ae){var et=ze.call(this,Ee,Ae||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return et.widths=[],et.widthBoxes=[],et.widths=Te,et.currentWidth=He,et.setCurrentWidth=et.setCurrentWidth.bind(et),et}return Ue(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2",this.widths.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.flexGrow="2",Ae.style.alignItems="center",Ae.style.justifyContent="space-between",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderColor=He===Ee.currentWidth?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentWidth(He,Ae)}),Te.appendChild(Ae);var et=document.createElement("div");et.innerText=He.toString(),et.style.marginRight="5px",Ae.appendChild(et);var on=document.createElement("div");on.style.minHeight="20px",on.style.flexGrow="2",on.style.display="flex",on.style.alignItems="center";var Kt=document.createElement("hr");Kt.style.minWidth="20px",Kt.style.border="0px",Kt.style.borderTop=He+"px solid "+Ee.uiStyleSettings.toolboxColor,Kt.style.flexGrow="2",on.appendChild(Kt),Ae.appendChild(on),Ee.widthBoxes.push(Ae)}),Te},Me.prototype.setCurrentWidth=function(Ee,Te){var He=this;this.currentWidth=Ee,this.widthBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Me}(ne),Ze=function(ze){function Me(Ee,Te,He,Ae){var et=ze.call(this,Ee,Ae||'<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 et.styles=[],et.styleBoxes=[],et.styles=Te,et.currentStyle=He,et.setCurrentStyle=et.setCurrentStyle.bind(et),et}return Ue(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2",this.styles.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.alignItems="center",Ae.style.justifyContent="space-between",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.overflow="hidden",Ae.style.maxWidth=100/Ee.styles.length-5+"%",Ae.style.borderColor=He===Ee.currentStyle?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentStyle(He,Ae)}),Te.appendChild(Ae);var et=document.createElement("div");et.style.minHeight="20px",et.style.flexGrow="2",et.style.overflow="hidden";var on=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Ee.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(He!==""?'stroke-dasharray="'+He+'"':"")+` />
|
|
</svg>`;et.innerHTML=on,Ae.appendChild(et),Ee.styleBoxes.push(Ae)}),Te},Me.prototype.setCurrentStyle=function(Ee,Te){var He=this;this.currentStyle=Ee,this.styleBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Me}(ne),st=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",He.defaultColorSet,He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ue(Me,ze),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="FrameMarker",Me.title="Frame marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Me}(Ce),nt=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"},Ye=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.x1=0,Ae.y1=0,Ae.x2=0,Ae.y2=0,Ae.defaultLength=50,Ae.manipulationStartX=0,Ae.manipulationStartY=0,Ae.manipulationStartX1=0,Ae.manipulationStartY1=0,Ae.manipulationStartX2=0,Ae.manipulationStartY2=0,Ae.setupControlBox(),Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!!ze.prototype.ownsTarget.call(this,Ee)||!(!this.grip1.ownsTarget(Ee)&&!this.grip2.ownsTarget(Ee))},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.manipulationStartX=Ee.x,this.manipulationStartY=Ee.y,this.state==="new"&&(this.x1=Ee.x,this.y1=Ee.y,this.x2=Ee.x,this.y2=Ee.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(Te)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Te)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Me.prototype.pointerUp=function(Ee){var Te=this.state;ze.prototype.pointerUp.call(this,Ee),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(Ee),this._state="select",Te==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Me.prototype.adjustVisual=function(){},Me.prototype.manipulate=function(Ee){this.state==="creating"?this.resize(Ee):this.state==="move"?(this.x1=this.manipulationStartX1+Ee.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Ee.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Ee.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Ee.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Ee)},Me.prototype.resize=function(Ee){switch(this.activeGrip){case this.grip1:this.x1=Ee.x,this.y1=Ee.y;break;case this.grip2:case void 0:this.x2=Ee.x,this.y2=Ee.y}this.adjustVisual(),this.adjustControlBox()},Me.prototype.select=function(){ze.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Me.prototype.deselect=function(){ze.prototype.deselect.call(this),this.controlBox.style.display="none"},Me.prototype.setupControlBox=function(){this.controlBox=Oe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Me.prototype.adjustControlBox=function(){this.positionGrips()},Me.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Me.prototype.createGrip=function(){var Ee=new pe;return Ee.visual.transform.baseVal.appendItem(Oe.createTransform()),this.controlBox.appendChild(Ee.visual),Ee},Me.prototype.positionGrips=function(){var Ee=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Ee/2,this.y1-Ee/2),this.positionGrip(this.grip2.visual,this.x2-Ee/2,this.y2-Ee/2)},Me.prototype.positionGrip=function(Ee,Te,He){var Ae=Ee.transform.baseVal.getItem(0);Ae.setTranslate(Te,He),Ee.transform.baseVal.replaceItem(Ae,0)},Me.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ze.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.x1=Te.x1,this.y1=Te.y1,this.x2=Te.x2,this.y2=Te.y2},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.x1=this.x1*Ee,this.y1=this.y1*Te,this.x2=this.x2*Ee,this.y2=this.y2*Te,this.adjustVisual(),this.adjustControlBox()},Me}(de),ct=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",He.defaultColorSet,He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.selectorLine&&Ee!==this.visibleLine)},Me.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Me.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()]]))},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.adjustVisual(),this.colorChanged(Ee)},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.adjustVisual()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.createVisual(),this.adjustVisual()},Me.typeName="LineMarker",Me.title="Line marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Me}(Ye),$e=function(ze){function Me(Ee,Te,He,Ae){var et=ze.call(this,Ee,Ae||'<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 et.fonts=[],et.fontBoxes=[],et.fonts=Te,et.currentFont=He,et.setCurrentFont=et.setCurrentFont.bind(et),et}return Ue(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.overflow="hidden",Te.style.flexGrow="2",this.fonts.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="inline-block",Ae.style.alignItems="center",Ae.style.justifyContent="space-between",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.overflow="hidden",Ae.style.maxWidth=100/Ee.fonts.length-5+"%",Ae.style.borderColor=He===Ee.currentFont?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentFont(He,Ae)}),Te.appendChild(Ae);var et=document.createElement("div");et.style.display="flex",et.style.minHeight="20px",et.style.flexGrow="2",et.style.fontFamily=He,et.style.overflow="hidden";var on=document.createElement("div");on.style.whiteSpace="nowrap",on.style.overflow="hidden",on.style.textOverflow="ellipsis",on.innerHTML="The quick brown fox jumps over the lazy dog",et.appendChild(on),Ae.appendChild(et),Ee.fontBoxes.push(Ae)}),Te},Me.prototype.setCurrentFont=function(Ee,Te){var He=this;this.currentFont=Ee,this.fontBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Me}(ne),Et=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.color="transparent",Ae.padding=5,Ae.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Ae.text=Ae.DEFAULT_TEXT,Ae.isMoved=!1,Ae.color=He.defaultColor,Ae.fontFamily=He.defaultFontFamily,Ae.defaultSize={x:100,y:30},Ae.setColor=Ae.setColor.bind(Ae),Ae.setFont=Ae.setFont.bind(Ae),Ae.renderText=Ae.renderText.bind(Ae),Ae.sizeText=Ae.sizeText.bind(Ae),Ae.textEditDivClicked=Ae.textEditDivClicked.bind(Ae),Ae.showTextEditor=Ae.showTextEditor.bind(Ae),Ae.setSize=Ae.setSize.bind(Ae),Ae.positionTextEditor=Ae.positionTextEditor.bind(Ae),Ae.colorPanel=new te("Color",He.defaultColorSet,He.defaultColor),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.fontFamilyPanel=new $e("Font",He.defaultFontFamilies,He.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){if(ze.prototype.ownsTarget.call(this,Ee)||Ee===this.visual||Ee===this.textElement||Ee===this.bgRectangle)return!0;var Te=!1;return this.textElement.childNodes.forEach(function(He){He===Ee&&(Te=!0)}),Te},Me.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()},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.isMoved=!1,this.pointerDownPoint=Ee,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.renderText=function(){var Ee=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(Te){Ee.textElement.appendChild(Oe.createTSpan(Te.trim()===""?" ":Te.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Me.prototype.getTextScale=function(){var Ee=this.textElement.getBBox(),Te=1;if(Ee.width>0&&Ee.height>0){var He=(1*this.width-this.width*this.padding*2/100)/Ee.width,Ae=(1*this.height-this.height*this.padding*2/100)/Ee.height;Te=Math.min(He,Ae)}return Te},Me.prototype.getTextPosition=function(Ee){var Te=this.textElement.getBBox(),He=0,Ae=0;return Te.width>0&&Te.height>0&&(He=(this.width-Te.width*Ee)/2,Ae=this.height/2-Te.height*Ee/2),{x:He,y:Ae}},Me.prototype.sizeText=function(){var Ee=this.textElement.getBBox(),Te=this.getTextScale(),He=this.getTextPosition(Te);He.y-=Ee.y*Te,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+He.x+"px, "+He.y+"px) scale("+Te+", "+Te+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(He.x,He.y),this.textElement.transform.baseVal.getItem(1).setScale(Te,Te))},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Ee.x-this.pointerDownPoint.x)>5||Math.abs(Ee.y-this.pointerDownPoint.y)>5)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.isMoved=!0,this.setSize(),this.sizeText()},Me.prototype.setSize=function(){ze.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()]]))},Me.prototype.pointerUp=function(Ee){var Te=this.state;Te==="creating"&&(this._suppressMarkerCreateEvent=!0),ze.prototype.pointerUp.call(this,Ee),this.setSize(),(Te==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Me.prototype.showTextEditor=function(){var Ee=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(Te){Te.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Te=Number.parseFloat(Ee.textEditor.style.fontSize);Ee.textEditor.clientWidth>=Number.parseInt(Ee.textEditor.style.maxWidth)&&Te>.9;)Te-=.1,Ee.textEditor.style.fontSize=Math.max(Te,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Te){Te.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Te){if(Te.clipboardData){var He=Te.clipboardData.getData("text"),Ae=window.getSelection();if(!Ae.rangeCount)return!1;Ae.deleteFromDocument(),Ae.getRangeAt(0).insertNode(document.createTextNode(He)),Te.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Ee.textEditDivClicked(Ee.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Me.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Ee=this.getTextScale(),Te=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),He=this.textElement.getBBox(),Ae={x:He.width*Ee,y:He.height*Ee};Te.x-=Ae.x/2,Te.y-=Ae.y/2,this.textEditor.style.top=Te.y+"px",this.textEditor.style.left=Te.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Te.x+"px",this.textEditor.style.fontSize=Math.max(16*Ee,12)+"px",this.textElement.style.display="none"}},Me.prototype.textEditDivClicked=function(Ee){this.text=Ee.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Me.prototype.select=function(){ze.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Me.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ze.prototype.deselect.call(this)},Me.prototype.dblClick=function(Ee,Te){ze.prototype.dblClick.call(this,Ee,Te),this.showTextEditor()},Me.prototype.setColor=function(Ee){this.textElement&&Oe.setAttributes(this.textElement,[["fill",Ee]]),this.color=Ee,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Ee)},Me.prototype.setFont=function(Ee){this.textElement&&Oe.setAttributes(this.textElement,[["font-family",Ee]]),this.fontFamily=Ee,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Me.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Me.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.color=Te.color,this.fontFamily=Te.fontFamily,this.padding=Te.padding,this.text=Te.text,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize(),this.sizeText(),this.positionTextEditor()},Me.typeName="TextMarker",Me.title="Text marker",Me.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>',Me}(we),Pt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.color="transparent",Ae.lineWidth=3,Ae.drawing=!1,Ae.pixelRatio=1,Ae.color=He.defaultColor,Ae.lineWidth=He.defaultStrokeWidth,Ae.pixelRatio=He.freehandPixelRatio,Ae.setColor=Ae.setColor.bind(Ae),Ae.addCanvas=Ae.addCanvas.bind(Ae),Ae.finishCreation=Ae.finishCreation.bind(Ae),Ae.setLineWidth=Ae.setLineWidth.bind(Ae),Ae.colorPanel=new te("Color",He.defaultColorSet,He.defaultColor),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.lineWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.lineWidthPanel.onWidthChanged=Ae.setLineWidth,Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.drawingImage)},Me.prototype.createVisual=function(){this.visual=Oe.createGroup(),this.drawingImage=Oe.createImage(),this.visual.appendChild(this.drawingImage);var Ee=Oe.createTransform();this.visual.transform.baseVal.appendItem(Ee),this.addMarkerVisualToContainer(this.visual)},Me.prototype.pointerDown=function(Ee,Te){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(Ee.x,Ee.y),this.drawing=!0):ze.prototype.pointerDown.call(this,Ee,Te)},Me.prototype.manipulate=function(Ee){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Ee.x,Ee.y),this.canvasContext.stroke()):ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),Oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Me.prototype.pointerUp=function(Ee){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ze.prototype.pointerUp.call(this,Ee)},Me.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)},Me.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ze.prototype.select.call(this)},Me.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ze.prototype.deselect.call(this)},Me.prototype.finishCreation=function(){for(var Ee=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Te=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],He=Te[0],Ae=Te[1],et=Te[2],on=Te[3],Kt=!1,pn=0;pn<this.canvasElement.height;pn++)for(var Nt=0;Nt<this.canvasElement.width;Nt++)Ee.data[pn*this.canvasElement.width*4+4*Nt+3]>0&&(Kt=!0,pn<Ae&&(Ae=pn),Nt<He&&(He=Nt),pn>on&&(on=pn),Nt>et&&(et=Nt));if(Kt){this.left=He/this.pixelRatio,this.top=Ae/this.pixelRatio,this.width=(et-He)/this.pixelRatio,this.height=(on-Ae)/this.pixelRatio;var Dt=document.createElement("canvas");Dt.width=et-He,Dt.height=on-Ae,Dt.getContext("2d").putImageData(this.canvasContext.getImageData(He,Ae,et-He,on-Ae),0,0),this.drawingImgUrl=Dt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Me.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})},Me.prototype.setColor=function(Ee){this.color=Ee,this.colorChanged(Ee)},Me.prototype.setLineWidth=function(Ee){this.lineWidth=Ee},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({drawingImgUrl:this.drawingImgUrl},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.drawingImgUrl=Ee.drawingImgUrl,this.setDrawingImage()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setDrawingImage()},Me.typeName="FreehandMarker",Me.title="Freehand marker",Me.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>',Me}(we),Bt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,He||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Ae.typeBoxes=[],Ae.currentType=Te,Ae.setCurrentType=Ae.setCurrentType.bind(Ae),Ae}return Ue(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2";for(var He=function(on){var Kt="both";switch(on){case 0:Kt="both";break;case 1:Kt="start";break;case 2:Kt="end";break;case 3:Kt="none"}var pn=document.createElement("div");if(pn.style.display="flex",pn.style.flexGrow="2",pn.style.alignItems="center",pn.style.justifyContent="space-between",pn.style.padding="5px",pn.style.borderWidth="2px",pn.style.borderStyle="solid",pn.style.borderColor=Kt===Ae.currentType?Ae.uiStyleSettings.toolboxAccentColor:"transparent",pn.addEventListener("click",function(){Ee.setCurrentType(Kt,pn)}),Te.appendChild(pn),Kt==="both"||Kt==="start"){var Nt=document.createElement("div");Nt.style.display="flex",Nt.style.alignItems="center",Nt.style.minHeight="20px",Nt.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="`+(Ae.uiStyleSettings!==void 0?Ae.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Nt.style.marginLeft="5px",pn.appendChild(Nt)}var Dt=document.createElement("div");Dt.style.display="flex",Dt.style.alignItems="center",Dt.style.minHeight="20px",Dt.style.flexGrow="2";var Ot=document.createElement("hr");if(Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop="3px solid "+(Ae.uiStyleSettings!==void 0?Ae.uiStyleSettings.toolboxColor:"#eeeeee"),Ot.style.flexGrow="2",Dt.appendChild(Ot),pn.appendChild(Dt),Kt==="both"||Kt==="end"){var un=document.createElement("div");un.style.display="flex",un.style.alignItems="center",un.style.minHeight="20px",un.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="`+(Ae.uiStyleSettings!==void 0?Ae.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,un.style.marginRight="5px",pn.appendChild(un)}Ae.typeBoxes.push(pn)},Ae=this,et=0;et<4;et++)He(et);return Te},Me.prototype.setCurrentType=function(Ee,Te){var He=this;this.currentType=Ee,this.typeBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings!==void 0?He.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Me}(ne),fn=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.arrowType="end",Ae.arrowBaseHeight=10,Ae.arrowBaseWidth=10,Ae.getArrowPoints=Ae.getArrowPoints.bind(Ae),Ae.setArrowType=Ae.setArrowType.bind(Ae),Ae.arrowTypePanel=new Bt("Arrow type","end"),Ae.arrowTypePanel.onArrowTypeChanged=Ae.setArrowType,Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.arrow1&&Ee!==this.arrow2)},Me.prototype.getArrowPoints=function(Ee,Te){var He=this.arrowBaseWidth+2*this.strokeWidth,Ae=this.arrowBaseHeight+2*this.strokeWidth;return Ee-He/2+","+(Te+Ae/2)+" "+Ee+","+(Te-Ae/2)+" "+(Ee+He/2)+","+(Te+Ae/2)},Me.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="creating"&&this.createTips()},Me.prototype.adjustVisual=function(){if(ze.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 Ee=0;Math.abs(this.x1-this.x2)>.1&&(Ee=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var Te=this.arrow1.transform.baseVal.getItem(0);Te.setRotate(Ee,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Te,0);var He=this.arrow2.transform.baseVal.getItem(0);He.setRotate(Ee+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(He,0)}},Me.prototype.setArrowType=function(Ee){this.arrowType=Ee,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({arrowType:this.arrowType},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.arrowType=Te.arrowType,this.createTips(),this.adjustVisual()},Me.typeName="ArrowMarker",Me.title="Arrow marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Me}(ct),qt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor=He.defaultFillColor,Ae.strokeWidth=0,Ae.fillPanel=new te("Color",He.defaultColorSet,He.defaultFillColor),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae}return Ue(Me,ze),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="CoverMarker",Me.title="Cover marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Me}(Ce),vn=function(ze){function Me(Ee,Te,He,Ae){var et=ze.call(this,Ee,Ae||'<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 et.opacities=[],et.opacityBoxes=[],et.opacities=Te,et.currentOpacity=He,et.setCurrentOpacity=et.setCurrentOpacity.bind(et),et}return Ue(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2",Te.style.justifyContent="space-between",this.opacities.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.alignItems="center",Ae.style.justifyContent="center",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderColor=He===Ee.currentOpacity?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentOpacity(He,Ae)}),Te.appendChild(Ae);var et=document.createElement("div");et.innerText=100*He+"%",Ae.appendChild(et),Ee.opacityBoxes.push(Ae)}),Te},Me.prototype.setCurrentOpacity=function(Ee,Te){var He=this;this.currentOpacity=Ee,this.opacityBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Me}(ne),tn=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.setOpacity=Ae.setOpacity.bind(Ae),Ae.fillColor=He.defaultHighlightColor,Ae.strokeWidth=0,Ae.opacity=He.defaultHighlightOpacity,Ae.fillPanel=new te("Color",He.defaultColorSet,Ae.fillColor),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.opacityPanel=new vn("Opacity",He.defaultOpacitySteps,Ae.opacity),Ae.opacityPanel.onOpacityChanged=Ae.setOpacity,Ae}return Ue(Me,ze),Me.prototype.setOpacity=function(Ee){this.opacity=Ee,this.visual&&Oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="HighlightMarker",Me.title="Highlight marker",Me.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>',Me}(qt),it='<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>',rt='<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>',dn=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.bgColor="transparent",Ae.tipPosition={x:0,y:0},Ae.tipBase1Position={x:0,y:0},Ae.tipBase2Position={x:0,y:0},Ae.tipMoving=!1,Ae.color=He.defaultStrokeColor,Ae.bgColor=He.defaultFillColor,Ae.fontFamily=He.defaultFontFamily,Ae.defaultSize={x:100,y:30},Ae.setBgColor=Ae.setBgColor.bind(Ae),Ae.getTipPoints=Ae.getTipPoints.bind(Ae),Ae.positionTip=Ae.positionTip.bind(Ae),Ae.setTipPoints=Ae.setTipPoints.bind(Ae),Ae.colorPanel=new te("Text color",He.defaultColorSet,Ae.color,it),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.bgColorPanel=new te("Fill color",He.defaultColorSet,Ae.bgColor,rt),Ae.bgColorPanel.onColorChanged=Ae.setBgColor,Ae.fontFamilyPanel=new $e("Font",He.defaultFontFamilies,He.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae.tipGrip=new pe,Ae.tipGrip.visual.transform.baseVal.appendItem(Oe.createTransform()),Ae.controlBox.appendChild(Ae.tipGrip.visual),Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return ze.prototype.ownsTarget.call(this,Ee)||this.tipGrip.ownsTarget(Ee)||this.tip===Ee},Me.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)},Me.prototype.pointerDown=function(Ee,Te){this.state==="new"&&ze.prototype.pointerDown.call(this,Ee,Te),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Te)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ze.prototype.pointerDown.call(this,Ee,Te)},Me.prototype.pointerUp=function(Ee){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ze.prototype.pointerUp.call(this,Ee);else{var Te=this.state==="creating";ze.prototype.pointerUp.call(this,Ee),this.setTipPoints(Te),this.positionTip()}},Me.prototype.manipulate=function(Ee){if(this.tipMoving){var Te=this.unrotatePoint(Ee);this.tipPosition={x:Te.x-this.manipulationStartLeft,y:Te.y-this.manipulationStartTop},this.positionTip()}else ze.prototype.manipulate.call(this,Ee)},Me.prototype.setBgColor=function(Ee){this.bgRectangle&&this.tip&&(Oe.setAttributes(this.bgRectangle,[["fill",Ee]]),Oe.setAttributes(this.tip,[["fill",Ee]])),this.bgColor=Ee,this.fillColorChanged(Ee)},Me.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},Me.prototype.setTipPoints=function(Ee){Ee===void 0&&(Ee=!1);var Te=Math.min(this.height/2,15),He=this.height/5;Ee&&(this.tipPosition={x:Te+He/2,y:this.height+20});var Ae=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Ae<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:Te,y:0},this.tipBase2Position={x:Te+He,y:0}):(this.tipBase1Position={x:0,y:Te},this.tipBase2Position={x:0,y:Te+He}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Ae<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Te-He,y:0},this.tipBase2Position={x:this.width-Te,y:0}):(this.tipBase1Position={x:this.width,y:Te},this.tipBase2Position={x:this.width,y:Te+He}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Ae<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Te-He,y:this.height},this.tipBase2Position={x:this.width-Te,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Te-He},this.tipBase2Position={x:this.width,y:this.height-Te}):Ae<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:Te,y:this.height},this.tipBase2Position={x:Te+He,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Te},this.tipBase2Position={x:0,y:this.height-Te-He})},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.positionTip()},Me.prototype.positionTip=function(){Oe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Ee=this.tipGrip.visual.transform.baseVal.getItem(0);Ee.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Ee,0)},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Me.prototype.select=function(){this.positionTip(),ze.prototype.select.call(this)},Me.prototype.getState=function(){var Ee=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.bgColor=Te.bgColor,this.tipPosition=Te.tipPosition,ze.prototype.restoreState.call(this,Ee),this.createTip(),this.setTipPoints()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.tipPosition={x:this.tipPosition.x*Ee,y:this.tipPosition.y*Te},this.positionTip()},Me.typeName="CalloutMarker",Me.title="Callout marker",Me.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>',Me}(Et),ni=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor="transparent",Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.opacity=1,Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.fillColor=He.defaultFillColor,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setFillColor=Ae.setFillColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.setOpacity=Ae.setOpacity.bind(Ae),Ae.createVisual=Ae.createVisual.bind(Ae),Ae.strokePanel=new te("Line color",yt(He.defaultColorSet,["transparent"]),He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.fillPanel=new te("Fill color",yt(He.defaultColorSet,["transparent"]),Ae.fillColor,rt),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae.opacityPanel=new vn("Opacity",He.defaultOpacitySteps,Ae.opacity),Ae.opacityPanel.onOpacityChanged=Ae.setOpacity,Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual)},Me.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.setSize=function(){ze.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()]])},Me.prototype.pointerUp=function(Ee){ze.prototype.pointerUp.call(this,Ee),this.setSize()},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Ee),this.stateChanged()},Me.prototype.setFillColor=function(Ee){this.fillColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Ee),this.stateChanged()},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Me.prototype.setOpacity=function(Ee){this.opacity=Ee,this.visual&&Oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.fillColor=Te.fillColor,this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.opacity=Te.opacity,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize()},Me.typeName="EllipseMarker",Me.title="Ellipse marker",Me.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>',Me}(we),Kn=function(ze){function Me(Ee,Te,He){return ze.call(this,Ee,Te,He)||this}return Ue(Me,ze),Object.defineProperty(Me.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.tip1&&Ee!==this.tip2)},Me.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="creating"&&this.createTips()},Me.prototype.adjustVisual=function(){if(ze.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 Ee=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Te=this.tip1.transform.baseVal.getItem(0);Te.setRotate(Ee,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Te,0);var He=this.tip2.transform.baseVal.getItem(0);He.setRotate(Ee+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(He,0)}},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee),this.createTips(),this.adjustVisual()},Me.typeName="MeasurementMarker",Me.title="Measurement marker",Me.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>',Me}(ct),Rt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokePanel.colors=He.defaultColorSet,Ae.fillColor="transparent",Ae}return Ue(Me,ze),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="EllipseFrameMarker",Me.title="Ellipse frame marker",Me.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>',Me}(ni),En=function(){function ze(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ze.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ze.prototype.addUndoStep=function(Me){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Me)||(this.undoStack.push(Me),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Me)&&this.redoStack.splice(0,this.redoStack.length))},ze.prototype.replaceLastUndoStep=function(Me){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Me)},ze.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ze.prototype.undo=function(){if(this.undoStack.length>1){var Me=this.undoStack.pop();return Me!==void 0&&this.redoStack.push(Me),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ze.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ze}(),Bn=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.curveX=0,Ae.curveY=0,Ae.manipulationStartCurveX=0,Ae.manipulationStartCurveY=0,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.positionGrips=Ae.positionGrips.bind(Ae),Ae.addControlGrips=Ae.addControlGrips.bind(Ae),Ae.adjustVisual=Ae.adjustVisual.bind(Ae),Ae.setupControlBox=Ae.setupControlBox.bind(Ae),Ae.resize=Ae.resize.bind(Ae),Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",He.defaultColorSet,He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.selectorCurve&&Ee!==this.visibleCurve&&!this.curveGrip.ownsTarget(Ee))},Me.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Me.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Ee.x,this.curveY=Ee.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Te)&&(this.activeGrip=this.curveGrip,this._state="resize")},Me.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()]]))},Me.prototype.setupControlBox=function(){ze.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)},Me.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ze.prototype.addControlGrips.call(this)},Me.prototype.positionGrips=function(){ze.prototype.positionGrips.call(this);var Ee=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Ee/2,this.curveY-Ee/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()))},Me.prototype.manipulate=function(Ee){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Ee.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Ee.y-this.manipulationStartY),ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){this.activeGrip===this.curveGrip&&(this.curveX=Ee.x,this.curveY=Ee.y),ze.prototype.resize.call(this,Ee),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.adjustVisual(),this.colorChanged(Ee)},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.adjustVisual()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.adjustVisual()},Me.prototype.scale=function(Ee,Te){this.curveX=this.curveX*Ee,this.curveY=this.curveY*Te,ze.prototype.scale.call(this,Ee,Te)},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.curveX=Te.curveX,this.curveY=Te.curveY,this.createVisual(),this.adjustVisual()},Me.typeName="CurveMarker",Me.title="Curve marker",Me.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>',Me}(Ye),ui=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor="transparent",Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.textColor="transparent",Ae.fontSize="1rem",Ae.isMoved=!1,Ae.captionText="Caption",Ae.PADDING=5,Ae.captionBoxWidth=0,Ae.captionBoxHeight=0,Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.fillColor=He.defaultFillColor,Ae.textColor=He.defaultStrokeColor,Ae.fontFamily=He.defaultFontFamily,Ae.fontSize=He.defaultCaptionFontSize,Ae.captionText=He.defaultCaptionText,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setFillColor=Ae.setFillColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.createVisual=Ae.createVisual.bind(Ae),Ae.sizeCaption=Ae.sizeCaption.bind(Ae),Ae.setCaptionText=Ae.setCaptionText.bind(Ae),Ae.showTextEditor=Ae.showTextEditor.bind(Ae),Ae.positionTextEditor=Ae.positionTextEditor.bind(Ae),Ae.finishTextEditing=Ae.finishTextEditing.bind(Ae),Ae.setFont=Ae.setFont.bind(Ae),Ae.setTextColor=Ae.setTextColor.bind(Ae),Ae.strokePanel=new te("Line color",yt(He.defaultColorSet,["transparent"]),Ae.strokeColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.fillPanel=new te("Fill color",yt(He.defaultColorSet,["transparent"]),Ae.fillColor,rt),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae.fontFamilyPanel=new $e("Font",He.defaultFontFamilies,He.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae.textColorPanel=new te("Text color",He.defaultColorSet,Ae.textColor,it),Ae.textColorPanel.onColorChanged=Ae.setTextColor,Ae}return Ue(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.frame&&Ee!==this.captionBg&&Ee!==this.captionElement)},Me.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()},Me.prototype.setCaptionText=function(Ee){this.captionText=Ee,this.captionElement.textContent=this.captionText,this.sizeCaption()},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.isMoved=!1,this.pointerDownPoint=Ee,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Ee.x-this.pointerDownPoint.x)>5||Math.abs(Ee.y-this.pointerDownPoint.y)>5)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.sizeCaption=function(){var Ee=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=Ee.width+2*this.PADDING,this.captionBoxHeight=Ee.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')"]])},Me.prototype.showTextEditor=function(){var Ee=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(Te){Te.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(Te){Te.key==="Enter"&&Ee.finishTextEditing(Ee.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(Te){Te.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){Ee.finishTextEditing(Ee.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){Ee.finishTextEditing(Ee.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Me.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"))},Me.prototype.finishTextEditing=function(Ee){this.setCaptionText(Ee.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Me.prototype.setFont=function(Ee){this.captionElement&&Oe.setAttributes(this.captionElement,[["font-family",Ee]]),this.fontFamily=Ee,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Me.prototype.setTextColor=function(Ee){this.captionElement&&Oe.setAttributes(this.captionElement,[["fill",Ee]]),this.textColor=Ee,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Me.prototype.setSize=function(){ze.prototype.setSize.call(this),Oe.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Me.prototype.pointerUp=function(Ee){ze.prototype.pointerUp.call(this,Ee),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Me.prototype.dblClick=function(Ee,Te){ze.prototype.dblClick.call(this,Ee,Te),this.showTextEditor()},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.frame&&Oe.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Ee),this.stateChanged()},Me.prototype.setFillColor=function(Ee){this.fillColor=Ee,this.captionBg&&Oe.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Ee),this.stateChanged()},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.frame&&Oe.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.frame&&Oe.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=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},ze.prototype.getState.call(this));return Ee.typeName=this.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.fillColor=Te.fillColor,this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.textColor=Te.textColor,this.fontFamily=Te.fontFamily,this.captionText=Te.captionText,this.fontSize=Te.fontSize,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize()},Me.typeName="CaptionFrameMarker",Me.title="Caption frame marker",Me.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>',Me}(we),It=function(){function ze(Me,Ee){Ee===void 0&&(Ee=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Me,this.cancelable=Ee}return Object.defineProperty(ze.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ze.prototype.preventDefault=function(){this._defaultPrevented=!0},ze}(),On=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,!1)||this;return Ae.dataUrl=Te,Ae.state=He,Ae}return Ue(Me,ze),Me}(It),ht=function(ze){function Me(Ee,Te,He){He===void 0&&(He=!1);var Ae=ze.call(this,Ee,He)||this;return Ae.marker=Te,Ae}return Ue(Me,ze),Me}(It),kn=function(){function ze(){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 ze.prototype.addEventListener=function(Me,Ee){this[Me].push(Ee)},ze.prototype.removeEventListener=function(Me,Ee){var Te=this[Me].indexOf(Ee);Te>-1&&this[Me].splice(Te,1)},ze}(),Oi=function(){function ze(Me){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new nt,this._isOpen=!1,this.undoRedoManager=new En,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 kn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ze.instanceCounter++,this.styles=new We(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Me,this.targetRoot=document.body,this.width=Me.clientWidth,this.height=Me.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(ze.prototype,"ALL_MARKER_TYPES",{get:function(){return[st,Pt,fn,Et,Rt,ni,tn,dn,Kn,qt,ct,Bn,ui]},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[st,Pt,fn,Et,ni,tn,dn]},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"BASIC_MARKER_TYPES",{get:function(){return[st,Pt,fn,Et,tn]},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Me){var Ee=this;this._availableMarkerTypes.splice(0),Me.forEach(function(Te){if(typeof Te=="string"){var He=Ee.ALL_MARKER_TYPES.find(function(Ae){return Ae.typeName===Te});He!==void 0&&Ee._availableMarkerTypes.push(He)}else Ee._availableMarkerTypes.push(Te)})},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Me){this._zoomLevel=Me,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(ze.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ze.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),at.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ze.prototype.show=function(){var Me=this;this.styles.styleSheetRoot===void 0&&ot.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ot.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Ee){return Ee(new It(Me))})},ze.prototype.render=function(){return pt(this,void 0,void 0,function(){var Me;return St(this,function(Ee){switch(Ee.label){case 0:return this.setCurrentMarker(),(Me=new Ct).naturalSize=this.renderAtNaturalSize,Me.imageType=this.renderImageType,Me.imageQuality=this.renderImageQuality,Me.markersOnly=this.renderMarkersOnly,Me.width=this.renderWidth,Me.height=this.renderHeight,[4,Me.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Ee.sent(),[4,Me.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Ee.sent()]}})})},ze.prototype.close=function(Me){var Ee=this;if(Me===void 0&&(Me=!1),this.isOpen){var Te=!1;Me||this.eventListeners.beforeclose.forEach(function(He){var Ae=new It(Ee,!0);He(Ae),Ae.defaultPrevented&&(Te=!0)}),Te||(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(He){return He(new It(Ee))}),this.detachEvents(),this._isOpen=!1)}},ze.prototype.addMarkersToToolbar=function(){for(var Me,Ee=[],Te=0;Te<arguments.length;Te++)Ee[Te]=arguments[Te];(Me=this._availableMarkerTypes).push.apply(Me,Ee)},ze.prototype.addRenderEventListener=function(Me){this.addEventListener("render",function(Ee){Me(Ee.dataUrl,Ee.state)})},ze.prototype.removeRenderEventListener=function(Me){},ze.prototype.addCloseEventListener=function(Me){this.addEventListener("close",function(){Me()})},ze.prototype.removeCloseEventListener=function(Me){},ze.prototype.setupResizeObserver=function(){var Me=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Me.resize(Me.target.clientWidth,Me.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Me.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ze.prototype.onPopupTargetResize=function(){var Me=1*this.target.clientWidth/this.target.clientHeight,Ee=this.editorCanvas.clientWidth/Me>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Me:this.editorCanvas.clientWidth,Te=Ee<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Me;this.resize(Ee,Te)},ze.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ze.prototype.resize=function(Me,Ee){this._isResizing=!0;var Te=Me/this.imageWidth,He=Ee/this.imageHeight;this.imageWidth=Math.round(Me),this.imageHeight=Math.round(Ee),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(Te,He),this._isResizing=!1},ze.prototype.scaleMarkers=function(Me,Ee){var Te,He=this;this._currentMarker&&this._currentMarker instanceof Et?this._currentMarker.scale(Me,Ee):(Te=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Ae){Ae!==He._currentMarker&&Ae.scale(Me,Ee)}),Te!==void 0&&this.setCurrentMarker(Te)},ze.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"},ze.prototype.setTopLeft=function(){var Me=this.editingTarget.getBoundingClientRect(),Ee=this.editorCanvas.getBoundingClientRect();this.left=Me.left-Ee.left,this.top=Me.top-Ee.top},ze.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)},ze.prototype.addDefs=function(){for(var Me,Ee=[],Te=0;Te<arguments.length;Te++)Ee[Te]=arguments[Te];this.defs=Oe.createDefs(),this.addDefsToImage(),(Me=this.defs).append.apply(Me,Ee)},ze.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ze.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)},ze.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ze.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ze.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)},ze.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ze.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)},ze.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 Me=document.createElement("a");Me.href="https://markerjs.com/",Me.target="_blank",Me.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>',Me.title="Powered by marker.js",Me.style.display="grid",Me.style.alignItems="center",Me.style.justifyItems="center",Me.style.padding="3px",Me.style.width="20px",Me.style.height="20px",this.logoUI.appendChild(Me),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ze.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")},ze.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"},ze.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ze.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 Me=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=Me+"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 kt(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 De(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ze.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ze.prototype.removeMarker=function(Me){this.markerImage.removeChild(Me.container),this.markers.indexOf(Me)>-1&&this.markers.splice(this.markers.indexOf(Me),1),Me.dispose()},ze.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())},ze.prototype.toolbarButtonClicked=function(Me,Ee){if(Me==="marker"&&Ee!==void 0)this.createNewMarker(Ee);else if(Me==="action")switch(Ee){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()}},ze.prototype.deleteSelectedMarker=function(){var Me=this;if(this._currentMarker!==void 0){var Ee=!1;if(this.eventListeners.markerbeforedelete.forEach(function(He){var Ae=new ht(Me,Me._currentMarker,!0);He(Ae),Ae.defaultPrevented&&(Ee=!0)}),!Ee){var Te=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(He){return He(new ht(Me,Te))})}}},ze.prototype.clear=function(){var Me=this,Ee=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(et){var on=new ht(Me,void 0,!0);et(on),on.defaultPrevented&&(Ee=!0)}),!Ee)){this.setCurrentMarker();for(var Te=function(et){var on=He.markers[et];He.setCurrentMarker(He.markers[et]),He._currentMarker.dispose(),He.markerImage.removeChild(He._currentMarker.container),He.markers.splice(He.markers.indexOf(He._currentMarker),1),He.eventListeners.markerdelete.forEach(function(Kt){return Kt(new ht(Me,on))})},He=this,Ae=this.markers.length-1;Ae>=0;Ae--)Te(Ae);this.addUndoStep()}},Object.defineProperty(ze.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ze.prototype.showNotesEditor=function(){var Me;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=(Me=this._currentMarker.notes)!==null&&Me!==void 0?Me:"",this.overlayContainer.appendChild(this.notesArea))},ze.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)},ze.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ze.prototype.addUndoStep=function(){var Me=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Ee=this.getState(),Te=this.undoRedoManager.getLastUndoStep();if(!Te||Te.width===Ee.width&&Te.height===Ee.height){var He=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Ee),He<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Ae){return Ae(new It(Me))})}else this.undoRedoManager.replaceLastUndoStep(Ee),this.eventListeners.statechange.forEach(function(Ae){return Ae(new It(Me))})}},ze.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ze.prototype.undoStep=function(){var Me=this,Ee=this.undoRedoManager.undo();Ee!==void 0&&(this.restoreState(Ee),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Te){return Te(new It(Me))}))},ze.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ze.prototype.redoStep=function(){var Me=this,Ee=this.undoRedoManager.redo();Ee!==void 0&&(this.restoreState(Ee),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Te){return Te(new It(Me))}))},ze.prototype.stepZoom=function(){var Me=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Me<this.zoomSteps.length-1?this.zoomSteps[Me+1]:this.zoomSteps[0]},ze.prototype.panTo=function(Me){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Me.x,top:this.prevPanPoint.y-Me.y}),this.prevPanPoint=Me},ze.prototype.startRenderAndClose=function(){return pt(this,void 0,void 0,function(){var Me,Ee,Te=this;return St(this,function(He){switch(He.label){case 0:return[4,this.render()];case 1:return Me=He.sent(),Ee=this.getState(),this.eventListeners.render.forEach(function(Ae){return Ae(new On(Te,Me,Ee))}),this.close(!0),[2]}})})},ze.prototype.getState=function(Me){Me===!0&&this.setCurrentMarker();var Ee={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Te){return Ee.markers.push(Te.getState())}),Ee},ze.prototype.restoreState=function(Me){var Ee=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Me.markers.forEach(function(Te){var He=Ee._availableMarkerTypes.find(function(et){return et.typeName===Te.typeName});if(He!==void 0){var Ae=Ee.addNewMarker(He);Ae.restoreState(Te),Ee.markers.push(Ae)}}),Me.width&&Me.height&&(Me.width!==this.imageWidth||Me.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Me.width,this.imageHeight/Me.height),this.eventListeners.restorestate.forEach(function(Te){return Te(new It(Ee))})},ze.prototype.addNewMarker=function(Me){var Ee=Oe.createGroup();return this.markerImage.appendChild(Ee),new Me(Ee,this.overlayContainer,this.settings)},ze.prototype.createNewMarker=function(Me){var Ee,Te=this;(Ee=typeof Me=="string"?this._availableMarkerTypes.find(function(He){return He.typeName===Me}):Me)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Ee),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(Ee.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(He){return He(new ht(Te,Te._currentMarker))}))},ze.prototype.markerCreated=function(Me){var Ee=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Me),this.setCurrentMarker(Me),Me instanceof Pt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Pt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Te){return Te(new ht(Ee,Ee._currentMarker))})},ze.prototype.colorChanged=function(Me){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Me,this.settings.defaultStrokeColor=Me)},ze.prototype.fillColorChanged=function(Me){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Me)},ze.prototype.markerStateChanged=function(Me){var Ee=this;this.eventListeners.markerchange.forEach(function(Te){return Te(new ht(Ee,Me))})},ze.prototype.setCurrentMarker=function(Me){var Ee=this;this._currentMarker!==Me&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Te){return Te(new ht(Ee,Ee._currentMarker))})),this._currentMarker=Me,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(Te){return Te(new ht(Ee,Ee._currentMarker))}))},ze.prototype.onPointerDown=function(Me){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Me.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Ee=this.markers.find(function(Te){return Te.ownsTarget(Me.target)});Ee!==void 0?(this.setCurrentMarker(Ee),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Me.clientX,Me.clientY),Me.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Me.clientX,y:Me.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Me.clientX,Me.clientY))},ze.prototype.onDblClick=function(Me){if(this._isFocused||this.focus(),this.mode==="select"){var Ee=this.markers.find(function(Te){return Te.ownsTarget(Me.target)});Ee!==void 0&&Ee!==this._currentMarker&&this.setCurrentMarker(Ee),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Me.clientX,Me.clientY),Me.target):this.setCurrentMarker()}},ze.prototype.onPointerMove=function(Me){this.touchPoints!==1&&Me.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Me.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Me.clientX,Me.clientY)):this.zoomLevel>1&&this.panTo({x:Me.clientX,y:Me.clientY}))},ze.prototype.onPointerUp=function(Me){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Me.clientX,Me.clientY)),this.isDragging=!1,this.addUndoStep()},ze.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ze.prototype.onKeyUp=function(Me){this._currentMarker===void 0||this.notesArea!==void 0||Me.key!=="Delete"&&Me.key!=="Backspace"||this.deleteSelectedMarker()},ze.prototype.clientToLocalCoordinates=function(Me,Ee){var Te=this.markerImage.getBoundingClientRect();return{x:(Me-Te.left)/this.zoomLevel,y:(Ee-Te.top)/this.zoomLevel}},ze.prototype.onWindowResize=function(){this.positionUI()},ze.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Me=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Me+"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()},ze.prototype.addLicenseKey=function(Me){at.addKey(Me)},ze.prototype.addEventListener=function(Me,Ee){this.eventListeners.addEventListener(Me,Ee)},ze.prototype.removeEventListener=function(Me,Ee){this.eventListeners.removeEventListener(Me,Ee)},ze.prototype.renderState=function(Me){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Me),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ze.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ze.prototype.focus=function(){var Me=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Ee){return Ee(new It(Me))}))},ze.prototype.blur=function(){var Me=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Ee){return Ee(new It(Me))}))},ze.instanceCounter=0,ze}()},63727:function(Zn,ei,Le){"use strict";Le.d(ei,{s:function(){return Nt},default:function(){return Ai}});var le=Le(71409),Ue=Le(89490),pt=Le(62730),St=Le(11036),yt=Le(39224),Oe=Le(37463),at=Le(6551),Ct=Le(6089),ot=Le(18929),We=Le(59301),Tt=We.createContext({}),dt=Tt,kt=Le(28788),De=Le(87075),ne="__rc_cascader_search_mark__",te=function(Qt,ln,di){var cn=di.label,Yt=cn===void 0?"":cn;return ln.some(function(ii){return String(ii[Yt]).toLowerCase().includes(Qt.toLowerCase())})},de=function(Qt,ln,di,cn){return ln.map(function(Yt){return Yt[cn.label]}).join(" / ")},se=function(Qt,ln,di,cn,Yt,ii){var Vi=Yt.filter,bi=Vi===void 0?te:Vi,Di=Yt.render,Mr=Di===void 0?de:Di,Gn=Yt.limit,Rn=Gn===void 0?50:Gn,Jn=Yt.sort;return We.useMemo(function(){var Ni=[];if(!Qt)return[];function ji(Gi,Fr){var be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Gi.forEach(function(gn){if(!(!Jn&&Rn!==!1&&Rn>0&&Ni.length>=Rn)){var li=[].concat((0,pt.Z)(Fr),[gn]),Hn=gn[di.children],oi=be||gn.disabled;if((!Hn||Hn.length===0||ii)&&bi(Qt,li,{label:di.label})){var ki;Ni.push((0,Ue.Z)((0,Ue.Z)({},gn),{},(ki={disabled:oi},(0,De.Z)(ki,di.label,Mr(Qt,li,cn,di)),(0,De.Z)(ki,ne,li),(0,De.Z)(ki,di.children,void 0),ki)))}Hn&&ji(gn[di.children],li,oi)}})}return ji(ln,[]),Jn&&Ni.sort(function(Gi,Fr){return Jn(Gi[ne],Fr[ne],Qt,di)}),Rn!==!1&&Rn>0?Ni.slice(0,Rn):Ni},[Qt,ln,di,cn,Mr,ii,bi,Jn,Rn])},pe=se,ye="__RC_CASCADER_SPLIT__",we="SHOW_PARENT",Ce="SHOW_CHILD";function _e(en){return en.join(ye)}function Ze(en){return en.map(_e)}function st(en){return en.split(ye)}function nt(en){var Qt=en||{},ln=Qt.label,di=Qt.value,cn=Qt.children,Yt=di||"value";return{label:ln||"label",value:Yt,key:Yt,children:cn||"children"}}function Ye(en,Qt){var ln,di;return(ln=en.isLeaf)!==null&&ln!==void 0?ln:!((di=en[Qt.children])!==null&&di!==void 0&&di.length)}function ct(en){var Qt=en.parentElement;if(Qt){var ln=en.offsetTop-Qt.offsetTop;ln-Qt.scrollTop<0?Qt.scrollTo({top:ln}):ln+en.offsetHeight-Qt.scrollTop>Qt.offsetHeight&&Qt.scrollTo({top:ln+en.offsetHeight-Qt.offsetHeight})}}function $e(en,Qt){return en.map(function(ln){var di;return(di=ln[ne])===null||di===void 0?void 0:di.map(function(cn){return cn[Qt.value]})})}function Et(en){return Array.isArray(en)&&Array.isArray(en[0])}function Pt(en){return en?Et(en)?en:(en.length===0?[]:[en]).map(function(Qt){return Array.isArray(Qt)?Qt:[Qt]}):[]}function Bt(en,Qt,ln){var di=new Set(en),cn=Qt();return en.filter(function(Yt){var ii=cn[Yt],Vi=ii?ii.parent:null,bi=ii?ii.children:null;return ii&&ii.node.disabled?!0:ln===Ce?!(bi&&bi.some(function(Di){return Di.key&&di.has(Di.key)})):!(Vi&&!Vi.node.disabled&&di.has(Vi.key))})}function fn(en,Qt,ln){for(var di=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,cn=Qt,Yt=[],ii=function(){var Di,Mr,Gn,Rn=en[Vi],Jn=(Di=cn)===null||Di===void 0?void 0:Di.findIndex(function(ji){var Gi=ji[ln.value];return di?String(Gi)===String(Rn):Gi===Rn}),Ni=Jn!==-1?(Mr=cn)===null||Mr===void 0?void 0:Mr[Jn]:null;Yt.push({value:(Gn=Ni==null?void 0:Ni[ln.value])!==null&&Gn!==void 0?Gn:Rn,index:Jn,option:Ni}),cn=Ni==null?void 0:Ni[ln.children]},Vi=0;Vi<en.length;Vi+=1)ii();return Yt}var qt=function(en,Qt,ln,di,cn){return We.useMemo(function(){var Yt=cn||function(ii){var Vi=di?ii.slice(-1):ii,bi=" / ";return Vi.every(function(Di){return["string","number"].includes((0,kt.Z)(Di))})?Vi.join(bi):Vi.reduce(function(Di,Mr,Gn){var Rn=We.isValidElement(Mr)?We.cloneElement(Mr,{key:Gn}):Mr;return Gn===0?[Rn]:[].concat((0,pt.Z)(Di),[bi,Rn])},[])};return en.map(function(ii){var Vi,bi=fn(ii,Qt,ln),Di=Yt(bi.map(function(Gn){var Rn,Jn=Gn.option,Ni=Gn.value;return(Rn=Jn==null?void 0:Jn[ln.label])!==null&&Rn!==void 0?Rn:Ni}),bi.map(function(Gn){var Rn=Gn.option;return Rn})),Mr=_e(ii);return{label:Di,value:Mr,key:Mr,valueCells:ii,disabled:(Vi=bi[bi.length-1])===null||Vi===void 0||(Vi=Vi.option)===null||Vi===void 0?void 0:Vi.disabled}})},[en,Qt,ln,cn,di])};function vn(en,Qt){return We.useCallback(function(ln){var di=[],cn=[];return ln.forEach(function(Yt){var ii=fn(Yt,en,Qt);ii.every(function(Vi){return Vi.option})?cn.push(Yt):di.push(Yt)}),[cn,di]},[en,Qt])}var tn=Le(34061),it=function(en,Qt){var ln=We.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),di=We.useCallback(function(){return ln.current.options!==en&&(ln.current.options=en,ln.current.info=(0,tn.I8)(en,{fieldNames:Qt,initWrapper:function(Yt){return(0,Ue.Z)((0,Ue.Z)({},Yt),{},{pathKeyEntities:{}})},processEntity:function(Yt,ii){var Vi=Yt.nodes.map(function(bi){return bi[Qt.value]}).join(ye);ii.pathKeyEntities[Vi]=Yt,Yt.key=Vi}})),ln.current.info.pathKeyEntities},[Qt,en]);return di};function rt(en,Qt){var ln=We.useMemo(function(){return Qt||[]},[Qt]),di=it(ln,en),cn=We.useCallback(function(Yt){var ii=di();return Yt.map(function(Vi){var bi=ii[Vi].nodes;return bi.map(function(Di){return Di[en.value]})})},[di,en]);return[ln,di,cn]}var dn=Le(48736);function ni(en){return We.useMemo(function(){if(!en)return[!1,{}];var Qt={matchInputWidth:!0,limit:50};return en&&(0,kt.Z)(en)==="object"&&(Qt=(0,Ue.Z)((0,Ue.Z)({},Qt),en)),Qt.limit<=0&&(Qt.limit=!1),[!0,Qt]},[en])}var Kn=Le(34643);function Rt(en,Qt,ln,di,cn,Yt,ii,Vi){return function(bi){if(!en)Qt(bi);else{var Di=_e(bi),Mr=Ze(ln),Gn=Ze(di),Rn=Mr.includes(Di),Jn=cn.some(function(oi){return _e(oi)===Di}),Ni=ln,ji=cn;if(Jn&&!Rn)ji=cn.filter(function(oi){return _e(oi)!==Di});else{var Gi=Rn?Mr.filter(function(oi){return oi!==Di}):[].concat((0,pt.Z)(Mr),[Di]),Fr=Yt(),be;if(Rn){var gn=(0,Kn.S)(Gi,{checked:!1,halfCheckedKeys:Gn},Fr);be=gn.checkedKeys}else{var li=(0,Kn.S)(Gi,!0,Fr);be=li.checkedKeys}var Hn=Bt(be,Yt,Vi);Ni=ii(Hn)}Qt([].concat((0,pt.Z)(ji),(0,pt.Z)(Ni)))}}}function En(en,Qt,ln,di,cn){return We.useMemo(function(){var Yt=cn(Qt),ii=(0,St.Z)(Yt,2),Vi=ii[0],bi=ii[1];if(!en||!Qt.length)return[Vi,[],bi];var Di=Ze(Vi),Mr=ln(),Gn=(0,Kn.S)(Di,!0,Mr),Rn=Gn.checkedKeys,Jn=Gn.halfCheckedKeys;return[di(Rn),di(Jn),bi]},[en,Qt,ln,di,cn])}var Bn=Le(92310),ui=Le.n(Bn),It=We.memo(function(en){var Qt=en.children;return Qt},function(en,Qt){return!Qt.open}),On=It;function ht(en){var Qt,ln=en.prefixCls,di=en.checked,cn=en.halfChecked,Yt=en.disabled,ii=en.onClick,Vi=en.disableCheckbox,bi=We.useContext(dt),Di=bi.checkable,Mr=typeof Di!="boolean"?Di:null;return We.createElement("span",{className:ui()("".concat(ln),(Qt={},(0,De.Z)(Qt,"".concat(ln,"-checked"),di),(0,De.Z)(Qt,"".concat(ln,"-indeterminate"),!di&&cn),(0,De.Z)(Qt,"".concat(ln,"-disabled"),Yt||Vi),Qt)),onClick:ii},Mr)}var kn="__cascader_fix_label__";function Oi(en){var Qt=en.prefixCls,ln=en.multiple,di=en.options,cn=en.activeValue,Yt=en.prevValuePath,ii=en.onToggleOpen,Vi=en.onSelect,bi=en.onActive,Di=en.checkedSet,Mr=en.halfCheckedSet,Gn=en.loadingKeys,Rn=en.isSelectable,Jn=en.disabled,Ni="".concat(Qt,"-menu"),ji="".concat(Qt,"-menu-item"),Gi=We.useContext(dt),Fr=Gi.fieldNames,be=Gi.changeOnSelect,gn=Gi.expandTrigger,li=Gi.expandIcon,Hn=Gi.loadingIcon,oi=Gi.dropdownMenuColumnStyle,ki=Gi.optionRender,Ji=gn==="hover",$i=function(_t){return Jn||_t},ir=We.useMemo(function(){return di.map(function(Mt){var _t,At=Mt.disabled,xi=Mt.disableCheckbox,mi=Mt[ne],fi=(_t=Mt[kn])!==null&&_t!==void 0?_t:Mt[Fr.label],wn=Mt[Fr.value],Yn=Ye(Mt,Fr),Qi=mi?mi.map(function(_n){return _n[Fr.value]}):[].concat((0,pt.Z)(Yt),[wn]),vr=_e(Qi),Dr=Gn.includes(vr),Ke=Di.has(vr),Lt=Mr.has(vr);return{disabled:At,label:fi,value:wn,isLeaf:Yn,isLoading:Dr,checked:Ke,halfChecked:Lt,option:Mt,disableCheckbox:xi,fullPath:Qi,fullPathKey:vr}})},[di,Di,Fr,Mr,Gn,Yt]);return We.createElement("ul",{className:Ni,role:"menu"},ir.map(function(Mt){var _t,At=Mt.disabled,xi=Mt.label,mi=Mt.value,fi=Mt.isLeaf,wn=Mt.isLoading,Yn=Mt.checked,Qi=Mt.halfChecked,vr=Mt.option,Dr=Mt.fullPath,Ke=Mt.fullPathKey,Lt=Mt.disableCheckbox,_n=function(){if(!$i(At)){var Xt=(0,pt.Z)(Dr);Ji&&fi&&Xt.pop(),bi(Xt)}},ci=function(){Rn(vr)&&!$i(At)&&Vi(Dr,fi)},$t;return typeof vr.title=="string"?$t=vr.title:typeof xi=="string"&&($t=xi),We.createElement("li",{key:Ke,className:ui()(ji,(_t={},(0,De.Z)(_t,"".concat(ji,"-expand"),!fi),(0,De.Z)(_t,"".concat(ji,"-active"),cn===mi||cn===Ke),(0,De.Z)(_t,"".concat(ji,"-disabled"),$i(At)),(0,De.Z)(_t,"".concat(ji,"-loading"),wn),_t)),style:oi,role:"menuitemcheckbox",title:$t,"aria-checked":Yn,"data-path-key":Ke,onClick:function(){_n(),!Lt&&(!ln||fi)&&ci()},onDoubleClick:function(){be&&ii(!1)},onMouseEnter:function(){Ji&&_n()},onMouseDown:function(Xt){Xt.preventDefault()}},ln&&We.createElement(ht,{prefixCls:"".concat(Qt,"-checkbox"),checked:Yn,halfChecked:Qi,disabled:$i(At)||Lt,disableCheckbox:Lt,onClick:function(Xt){Lt||(Xt.stopPropagation(),ci())}}),We.createElement("div",{className:"".concat(ji,"-content")},ki?ki(vr):xi),!wn&&li&&!fi&&We.createElement("div",{className:"".concat(ji,"-expand-icon")},li),wn&&Hn&&We.createElement("div",{className:"".concat(ji,"-loading-icon")},Hn))}))}var ze=function(Qt,ln){var di=We.useContext(dt),cn=di.values,Yt=cn[0],ii=We.useState([]),Vi=(0,St.Z)(ii,2),bi=Vi[0],Di=Vi[1];return We.useEffect(function(){Qt||Di(Yt||[])},[ln,Yt]),[bi,Di]},Me=ze,Ee=Le(10228),Te=function(en,Qt,ln,di,cn,Yt,ii){var Vi=ii.direction,bi=ii.searchValue,Di=ii.toggleOpen,Mr=ii.open,Gn=Vi==="rtl",Rn=We.useMemo(function(){for(var oi=-1,ki=Qt,Ji=[],$i=[],ir=di.length,Mt=$e(Qt,ln),_t=function(wn){var Yn=ki.findIndex(function(Qi,vr){return(Mt[vr]?_e(Mt[vr]):Qi[ln.value])===di[wn]});if(Yn===-1)return 1;oi=Yn,Ji.push(oi),$i.push(di[wn]),ki=ki[oi][ln.children]},At=0;At<ir&&ki&&!_t(At);At+=1);for(var xi=Qt,mi=0;mi<Ji.length-1;mi+=1)xi=xi[Ji[mi]][ln.children];return[$i,oi,xi,Mt]},[di,ln,Qt]),Jn=(0,St.Z)(Rn,4),Ni=Jn[0],ji=Jn[1],Gi=Jn[2],Fr=Jn[3],be=function(ki){cn(ki)},gn=function(ki){var Ji=Gi.length,$i=ji;$i===-1&&ki<0&&($i=Ji);for(var ir=0;ir<Ji;ir+=1){$i=($i+ki+Ji)%Ji;var Mt=Gi[$i];if(Mt&&!Mt.disabled){var _t=Ni.slice(0,-1).concat(Fr[$i]?_e(Fr[$i]):Mt[ln.value]);be(_t);return}}},li=function(){if(Ni.length>1){var ki=Ni.slice(0,-1);be(ki)}else Di(!1)},Hn=function(){var ki,Ji=((ki=Gi[ji])===null||ki===void 0?void 0:ki[ln.children])||[],$i=Ji.find(function(Mt){return!Mt.disabled});if($i){var ir=[].concat((0,pt.Z)(Ni),[$i[ln.value]]);be(ir)}};We.useImperativeHandle(en,function(){return{onKeyDown:function(ki){var Ji=ki.which;switch(Ji){case Ee.Z.UP:case Ee.Z.DOWN:{var $i=0;Ji===Ee.Z.UP?$i=-1:Ji===Ee.Z.DOWN&&($i=1),$i!==0&&gn($i);break}case Ee.Z.LEFT:{if(bi)break;Gn?Hn():li();break}case Ee.Z.RIGHT:{if(bi)break;Gn?li():Hn();break}case Ee.Z.BACKSPACE:{bi||li();break}case Ee.Z.ENTER:{if(Ni.length){var ir=Gi[ji],Mt=(ir==null?void 0:ir[ne])||[];Mt.length?Yt(Mt.map(function(_t){return _t[ln.value]}),Mt[Mt.length-1]):Yt(Ni,Gi[ji])}break}case Ee.Z.ESC:Di(!1),Mr&&ki.stopPropagation()}},onKeyUp:function(){}}})},He=We.forwardRef(function(en,Qt){var ln,di,cn,Yt=en.prefixCls,ii=en.multiple,Vi=en.searchValue,bi=en.toggleOpen,Di=en.notFoundContent,Mr=en.direction,Gn=en.open,Rn=en.disabled,Jn=We.useRef(null),Ni=Mr==="rtl",ji=We.useContext(dt),Gi=ji.options,Fr=ji.values,be=ji.halfValues,gn=ji.fieldNames,li=ji.changeOnSelect,Hn=ji.onSelect,oi=ji.searchOptions,ki=ji.dropdownPrefixCls,Ji=ji.loadData,$i=ji.expandTrigger,ir=ki||Yt,Mt=We.useState([]),_t=(0,St.Z)(Mt,2),At=_t[0],xi=_t[1],mi=function(Cr){if(!(!Ji||Vi)){var xr=fn(Cr,Gi,gn),Sr=xr.map(function(Gr){var So=Gr.option;return So}),hn=Sr[Sr.length-1];if(hn&&!Ye(hn,gn)){var ro=_e(Cr);xi(function(Gr){return[].concat((0,pt.Z)(Gr),[ro])}),Ji(Sr)}}};We.useEffect(function(){At.length&&At.forEach(function(Fi){var Cr=st(Fi),xr=fn(Cr,Gi,gn,!0).map(function(hn){var ro=hn.option;return ro}),Sr=xr[xr.length-1];(!Sr||Sr[gn.children]||Ye(Sr,gn))&&xi(function(hn){return hn.filter(function(ro){return ro!==Fi})})})},[Gi,At,gn]);var fi=We.useMemo(function(){return new Set(Ze(Fr))},[Fr]),wn=We.useMemo(function(){return new Set(Ze(be))},[be]),Yn=Me(ii,Gn),Qi=(0,St.Z)(Yn,2),vr=Qi[0],Dr=Qi[1],Ke=function(Cr){Dr(Cr),mi(Cr)},Lt=function(Cr){if(Rn)return!1;var xr=Cr.disabled,Sr=Ye(Cr,gn);return!xr&&(Sr||li||ii)},_n=function(Cr,xr){var Sr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Hn(Cr),!ii&&(xr||li&&($i==="hover"||Sr))&&bi(!1)},ci=We.useMemo(function(){return Vi?oi:Gi},[Vi,oi,Gi]),$t=We.useMemo(function(){for(var Fi=[{options:ci}],Cr=ci,xr=$e(Cr,gn),Sr=function(){var Gr=vr[hn],So=Cr.find(function(Xn,rr){return(xr[rr]?_e(xr[rr]):Xn[gn.value])===Gr}),yn=So==null?void 0:So[gn.children];if(!(yn!=null&&yn.length))return 1;Cr=yn,Fi.push({options:yn})},hn=0;hn<vr.length&&!Sr();hn+=1);return Fi},[ci,vr,gn]),xn=function(Cr,xr){Lt(xr)&&_n(Cr,Ye(xr,gn),!0)};Te(Qt,ci,gn,vr,Ke,xn,{direction:Mr,searchValue:Vi,toggleOpen:bi,open:Gn}),We.useEffect(function(){if(!Vi)for(var Fi=0;Fi<vr.length;Fi+=1){var Cr,xr=vr.slice(0,Fi+1),Sr=_e(xr),hn=(Cr=Jn.current)===null||Cr===void 0?void 0:Cr.querySelector('li[data-path-key="'.concat(Sr.replace(/\\{0,2}"/g,'\\"'),'"]'));hn&&ct(hn)}},[vr,Vi]);var Xt=!((ln=$t[0])!==null&&ln!==void 0&&(ln=ln.options)!==null&&ln!==void 0&&ln.length),ri=[(di={},(0,De.Z)(di,gn.value,"__EMPTY__"),(0,De.Z)(di,kn,Di),(0,De.Z)(di,"disabled",!0),di)],Hi=(0,Ue.Z)((0,Ue.Z)({},en),{},{multiple:!Xt&&ii,onSelect:_n,onActive:Ke,onToggleOpen:bi,checkedSet:fi,halfCheckedSet:wn,loadingKeys:At,isSelectable:Lt}),gi=Xt?[{options:ri}]:$t,Ii=gi.map(function(Fi,Cr){var xr=vr.slice(0,Cr),Sr=vr[Cr];return We.createElement(Oi,(0,le.Z)({key:Cr},Hi,{prefixCls:ir,options:Fi.options,prevValuePath:xr,activeValue:Sr}))});return We.createElement(On,{open:Gn},We.createElement("div",{className:ui()("".concat(ir,"-menus"),(cn={},(0,De.Z)(cn,"".concat(ir,"-menu-empty"),Xt),(0,De.Z)(cn,"".concat(ir,"-rtl"),Ni),cn)),ref:Jn},Ii))}),Ae=He,et=We.forwardRef(function(en,Qt){var ln=(0,Oe.lk)();return We.createElement(Ae,(0,le.Z)({},en,ln,{ref:Qt}))}),on=et,Kt=Le(70425);function pn(){}function Nt(en){var Qt,ln=en,di=ln.prefixCls,cn=di===void 0?"rc-cascader":di,Yt=ln.style,ii=ln.className,Vi=ln.options,bi=ln.checkable,Di=ln.defaultValue,Mr=ln.value,Gn=ln.fieldNames,Rn=ln.changeOnSelect,Jn=ln.onChange,Ni=ln.showCheckedStrategy,ji=ln.loadData,Gi=ln.expandTrigger,Fr=ln.expandIcon,be=Fr===void 0?">":Fr,gn=ln.loadingIcon,li=ln.direction,Hn=ln.notFoundContent,oi=Hn===void 0?"Not Found":Hn,ki=ln.disabled,Ji=!!bi,$i=(0,Kt.C8)(Di,{value:Mr,postState:Pt}),ir=(0,St.Z)($i,2),Mt=ir[0],_t=ir[1],At=We.useMemo(function(){return nt(Gn)},[JSON.stringify(Gn)]),xi=rt(At,Vi),mi=(0,St.Z)(xi,3),fi=mi[0],wn=mi[1],Yn=mi[2],Qi=vn(fi,At),vr=En(Ji,Mt,wn,Yn,Qi),Dr=(0,St.Z)(vr,3),Ke=Dr[0],Lt=Dr[1],_n=Dr[2],ci=(0,Kt.zX)(function(gi){if(_t(gi),Jn){var Ii=Pt(gi),Fi=Ii.map(function(Sr){return fn(Sr,fi,At).map(function(hn){return hn.option})}),Cr=Ji?Ii:Ii[0],xr=Ji?Fi:Fi[0];Jn(Cr,xr)}}),$t=Rt(Ji,ci,Ke,Lt,_n,wn,Yn,Ni),xn=(0,Kt.zX)(function(gi){$t(gi)}),Xt=We.useMemo(function(){return{options:fi,fieldNames:At,values:Ke,halfValues:Lt,changeOnSelect:Rn,onSelect:xn,checkable:bi,searchOptions:[],dropdownPrefixCls:void 0,loadData:ji,expandTrigger:Gi,expandIcon:be,loadingIcon:gn,dropdownMenuColumnStyle:void 0}},[fi,At,Ke,Lt,Rn,xn,bi,ji,Gi,be,gn]),ri="".concat(cn,"-panel"),Hi=!fi.length;return We.createElement(dt.Provider,{value:Xt},We.createElement("div",{className:ui()(ri,(Qt={},(0,De.Z)(Qt,"".concat(ri,"-rtl"),li==="rtl"),(0,De.Z)(Qt,"".concat(ri,"-empty"),Hi),Qt),ii),style:Yt},Hi?oi:We.createElement(Ae,{prefixCls:cn,searchValue:"",multiple:Ji,toggleOpen:pn,open:!0,direction:li,disabled:ki})))}function Dt(en){var Qt=en.onPopupVisibleChange,ln=en.popupVisible,di=en.popupClassName,cn=en.popupPlacement;warning(!Qt,"`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead."),warning(ln===void 0,"`popupVisible` is deprecated. Please use `open` instead."),warning(di===void 0,"`popupClassName` is deprecated. Please use `dropdownClassName` instead."),warning(cn===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function Ot(en,Qt){if(en){var ln=function di(cn){for(var Yt=0;Yt<cn.length;Yt++){var ii=cn[Yt];if(ii[Qt==null?void 0:Qt.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(ii[Qt==null?void 0:Qt.children])&&di(ii[Qt==null?void 0:Qt.children]))return!0}};ln(en)}}var un=null,Sn=["id","prefixCls","fieldNames","defaultValue","value","changeOnSelect","onChange","displayRender","checkable","autoClearSearchValue","searchValue","onSearch","showSearch","expandTrigger","options","dropdownPrefixCls","loadData","popupVisible","open","popupClassName","dropdownClassName","dropdownMenuColumnStyle","dropdownStyle","popupPlacement","placement","onDropdownVisibleChange","onPopupVisibleChange","expandIcon","loadingIcon","children","dropdownMatchSelectWidth","showCheckedStrategy","optionRender"],An=We.forwardRef(function(en,Qt){var ln=en.id,di=en.prefixCls,cn=di===void 0?"rc-cascader":di,Yt=en.fieldNames,ii=en.defaultValue,Vi=en.value,bi=en.changeOnSelect,Di=en.onChange,Mr=en.displayRender,Gn=en.checkable,Rn=en.autoClearSearchValue,Jn=Rn===void 0?!0:Rn,Ni=en.searchValue,ji=en.onSearch,Gi=en.showSearch,Fr=en.expandTrigger,be=en.options,gn=en.dropdownPrefixCls,li=en.loadData,Hn=en.popupVisible,oi=en.open,ki=en.popupClassName,Ji=en.dropdownClassName,$i=en.dropdownMenuColumnStyle,ir=en.dropdownStyle,Mt=en.popupPlacement,_t=en.placement,At=en.onDropdownVisibleChange,xi=en.onPopupVisibleChange,mi=en.expandIcon,fi=mi===void 0?">":mi,wn=en.loadingIcon,Yn=en.children,Qi=en.dropdownMatchSelectWidth,vr=Qi===void 0?!1:Qi,Dr=en.showCheckedStrategy,Ke=Dr===void 0?we:Dr,Lt=en.optionRender,_n=(0,yt.Z)(en,Sn),ci=(0,at.ZP)(ln),$t=!!Gn,xn=(0,ot.Z)(ii,{value:Vi,postState:Pt}),Xt=(0,St.Z)(xn,2),ri=Xt[0],Hi=Xt[1],gi=We.useMemo(function(){return nt(Yt)},[JSON.stringify(Yt)]),Ii=rt(gi,be),Fi=(0,St.Z)(Ii,3),Cr=Fi[0],xr=Fi[1],Sr=Fi[2],hn=(0,ot.Z)("",{value:Ni,postState:function(_i){return _i||""}}),ro=(0,St.Z)(hn,2),Gr=ro[0],So=ro[1],yn=function(_i,Yi){So(_i),Yi.source!=="blur"&&ji&&ji(_i)},Xn=ni(Gi),rr=(0,St.Z)(Xn,2),er=rr[0],Pr=rr[1],Wr=pe(Gr,Cr,gi,gn||cn,Pr,bi||$t),so=vn(Cr,gi),vo=En($t,ri,xr,Sr,so),po=(0,St.Z)(vo,3),yo=po[0],Nn=po[1],ia=po[2],Tn=We.useMemo(function(){var hi=Ze(yo),_i=Bt(hi,xr,Ke);return[].concat((0,pt.Z)(ia),(0,pt.Z)(Sr(_i)))},[yo,xr,Sr,ia,Ke]),Ar=qt(Tn,Cr,gi,$t,Mr),Bo=(0,Ct.Z)(function(hi){if(Hi(hi),Di){var _i=Pt(hi),Yi=_i.map(function(si){return fn(si,Cr,gi).map(function(yi){return yi.option})}),Ti=$t?_i:_i[0],In=$t?Yi:Yi[0];Di(Ti,In)}}),br=Rt($t,Bo,yo,Nn,ia,xr,Sr,Ke),na=(0,Ct.Z)(function(hi){(!$t||Jn)&&So(""),br(hi)}),Do=function(_i,Yi){if(Yi.type==="clear"){Bo([]);return}var Ti=Yi.values[0],In=Ti.valueCells;na(In)},ho=oi!==void 0?oi:Hn,Jo=Ji||ki,Vt=_t||Mt,jn=function(_i){At==null||At(_i),xi==null||xi(_i)},Gt=We.useMemo(function(){return{options:Cr,fieldNames:gi,values:yo,halfValues:Nn,changeOnSelect:bi,onSelect:na,checkable:Gn,searchOptions:Wr,dropdownPrefixCls:gn,loadData:li,expandTrigger:Fr,expandIcon:fi,loadingIcon:wn,dropdownMenuColumnStyle:$i,optionRender:Lt}},[Cr,gi,yo,Nn,bi,na,Gn,Wr,gn,li,Fr,fi,wn,$i,Lt]),Ie=!(Gr?Wr:Cr).length,ai=Gr&&Pr.matchInputWidth||Ie?{}:{minWidth:"auto"};return We.createElement(dt.Provider,{value:Gt},We.createElement(Oe.Ac,(0,le.Z)({},_n,{ref:Qt,id:ci,prefixCls:cn,autoClearSearchValue:Jn,dropdownMatchSelectWidth:vr,dropdownStyle:(0,Ue.Z)((0,Ue.Z)({},ai),ir),displayValues:Ar,onDisplayValuesChange:Do,mode:$t?"multiple":void 0,searchValue:Gr,onSearch:yn,showSearch:er,OptionList:on,emptyOptions:Ie,open:ho,dropdownClassName:Jo,placement:Vt,onDropdownVisibleChange:jn,getRawInputElement:function(){return Yn}})))});An.SHOW_PARENT=we,An.SHOW_CHILD=Ce,An.Panel=Nt;var Dn=An,Ai=Dn},98535:function(Zn,ei,Le){"use strict";Le.r(ei),Le.d(ei,{Panel:function(){return Pt},default:function(){return Et}});var le=Le(71409),Ue=Le(62730),pt=Le(11036),St=Le(28788),yt=Le(92310),Oe=Le.n(yt),at=Le(18929),Ct=Le(48736),ot=Le(59301),We=Le(39224),Tt=Le(11592),dt=Le(89490),kt=Le(87075),De=Le(77900),ne=Le(10228),te=ot.forwardRef(function(Bt,fn){var qt=Bt.prefixCls,vn=Bt.forceRender,tn=Bt.className,it=Bt.style,rt=Bt.children,dn=Bt.isActive,ni=Bt.role,Kn=Bt.classNames,Rt=Bt.styles,En=ot.useState(dn||vn),Bn=(0,pt.Z)(En,2),ui=Bn[0],It=Bn[1];return ot.useEffect(function(){(vn||dn)&&It(!0)},[vn,dn]),ui?ot.createElement("div",{ref:fn,className:Oe()("".concat(qt,"-content"),(0,kt.Z)((0,kt.Z)({},"".concat(qt,"-content-active"),dn),"".concat(qt,"-content-inactive"),!dn),tn),style:it,role:ni},ot.createElement("div",{className:Oe()("".concat(qt,"-content-box"),Kn==null?void 0:Kn.body),style:Rt==null?void 0:Rt.body},rt)):null});te.displayName="PanelContent";var de=te,se=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],pe=ot.forwardRef(function(Bt,fn){var qt=Bt.showArrow,vn=qt===void 0?!0:qt,tn=Bt.headerClass,it=Bt.isActive,rt=Bt.onItemClick,dn=Bt.forceRender,ni=Bt.className,Kn=Bt.classNames,Rt=Kn===void 0?{}:Kn,En=Bt.styles,Bn=En===void 0?{}:En,ui=Bt.prefixCls,It=Bt.collapsible,On=Bt.accordion,ht=Bt.panelKey,kn=Bt.extra,Oi=Bt.header,ze=Bt.expandIcon,Me=Bt.openMotion,Ee=Bt.destroyInactivePanel,Te=Bt.children,He=(0,We.Z)(Bt,se),Ae=It==="disabled",et=kn!=null&&typeof kn!="boolean",on=(0,kt.Z)((0,kt.Z)((0,kt.Z)({onClick:function(){rt==null||rt(ht)},onKeyDown:function(Sn){(Sn.key==="Enter"||Sn.keyCode===ne.Z.ENTER||Sn.which===ne.Z.ENTER)&&(rt==null||rt(ht))},role:On?"tab":"button"},"aria-expanded",it),"aria-disabled",Ae),"tabIndex",Ae?-1:0),Kt=typeof ze=="function"?ze(Bt):ot.createElement("i",{className:"arrow"}),pn=Kt&&ot.createElement("div",(0,le.Z)({className:"".concat(ui,"-expand-icon")},["header","icon"].includes(It)?on:{}),Kt),Nt=Oe()("".concat(ui,"-item"),(0,kt.Z)((0,kt.Z)({},"".concat(ui,"-item-active"),it),"".concat(ui,"-item-disabled"),Ae),ni),Dt=Oe()(tn,"".concat(ui,"-header"),(0,kt.Z)({},"".concat(ui,"-collapsible-").concat(It),!!It),Rt.header),Ot=(0,dt.Z)({className:Dt,style:Bn.header},["header","icon"].includes(It)?{}:on);return ot.createElement("div",(0,le.Z)({},He,{ref:fn,className:Nt}),ot.createElement("div",Ot,vn&&pn,ot.createElement("span",(0,le.Z)({className:"".concat(ui,"-header-text")},It==="header"?on:{}),Oi),et&&ot.createElement("div",{className:"".concat(ui,"-extra")},kn)),ot.createElement(De.default,(0,le.Z)({visible:it,leavedClassName:"".concat(ui,"-content-hidden")},Me,{forceRender:dn,removeOnLeave:Ee}),function(un,Sn){var An=un.className,Dn=un.style;return ot.createElement(de,{ref:Sn,prefixCls:ui,className:An,classNames:Rt,style:Dn,styles:Bn,isActive:it,forceRender:dn,role:On?"tabpanel":void 0},Te)}))}),ye=pe,we=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Ce=function(fn,qt){var vn=qt.prefixCls,tn=qt.accordion,it=qt.collapsible,rt=qt.destroyInactivePanel,dn=qt.onItemClick,ni=qt.activeKey,Kn=qt.openMotion,Rt=qt.expandIcon;return fn.map(function(En,Bn){var ui=En.children,It=En.label,On=En.key,ht=En.collapsible,kn=En.onItemClick,Oi=En.destroyInactivePanel,ze=(0,We.Z)(En,we),Me=String(On!=null?On:Bn),Ee=ht!=null?ht:it,Te=Oi!=null?Oi:rt,He=function(on){Ee!=="disabled"&&(dn(on),kn==null||kn(on))},Ae=!1;return tn?Ae=ni[0]===Me:Ae=ni.indexOf(Me)>-1,ot.createElement(ye,(0,le.Z)({},ze,{prefixCls:vn,key:Me,panelKey:Me,isActive:Ae,accordion:tn,openMotion:Kn,expandIcon:Rt,header:It,collapsible:Ee,onItemClick:He,destroyInactivePanel:Te}),ui)})},_e=function(fn,qt,vn){if(!fn)return null;var tn=vn.prefixCls,it=vn.accordion,rt=vn.collapsible,dn=vn.destroyInactivePanel,ni=vn.onItemClick,Kn=vn.activeKey,Rt=vn.openMotion,En=vn.expandIcon,Bn=fn.key||String(qt),ui=fn.props,It=ui.header,On=ui.headerClass,ht=ui.destroyInactivePanel,kn=ui.collapsible,Oi=ui.onItemClick,ze=!1;it?ze=Kn[0]===Bn:ze=Kn.indexOf(Bn)>-1;var Me=kn!=null?kn:rt,Ee=function(Ae){Me!=="disabled"&&(ni(Ae),Oi==null||Oi(Ae))},Te={key:Bn,panelKey:Bn,header:It,headerClass:On,isActive:ze,prefixCls:tn,destroyInactivePanel:ht!=null?ht:dn,openMotion:Rt,accordion:it,children:fn.props.children,onItemClick:Ee,expandIcon:En,collapsible:Me};return typeof fn.type=="string"?fn:(Object.keys(Te).forEach(function(He){typeof Te[He]=="undefined"&&delete Te[He]}),ot.cloneElement(fn,Te))};function Ze(Bt,fn,qt){return Array.isArray(Bt)?Ce(Bt,qt):(0,Tt.Z)(fn).map(function(vn,tn){return _e(vn,tn,qt)})}var st=Ze,nt=Le(26112);function Ye(Bt){var fn=Bt;if(!Array.isArray(fn)){var qt=(0,St.Z)(fn);fn=qt==="number"||qt==="string"?[fn]:[]}return fn.map(function(vn){return String(vn)})}var ct=ot.forwardRef(function(Bt,fn){var qt=Bt.prefixCls,vn=qt===void 0?"rc-collapse":qt,tn=Bt.destroyInactivePanel,it=tn===void 0?!1:tn,rt=Bt.style,dn=Bt.accordion,ni=Bt.className,Kn=Bt.children,Rt=Bt.collapsible,En=Bt.openMotion,Bn=Bt.expandIcon,ui=Bt.activeKey,It=Bt.defaultActiveKey,On=Bt.onChange,ht=Bt.items,kn=Oe()(vn,ni),Oi=(0,at.Z)([],{value:ui,onChange:function(et){return On==null?void 0:On(et)},defaultValue:It,postState:Ye}),ze=(0,pt.Z)(Oi,2),Me=ze[0],Ee=ze[1],Te=function(et){return Ee(function(){if(dn)return Me[0]===et?[]:[et];var on=Me.indexOf(et),Kt=on>-1;return Kt?Me.filter(function(pn){return pn!==et}):[].concat((0,Ue.Z)(Me),[et])})};(0,Ct.ZP)(!Kn,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var He=st(ht,Kn,{prefixCls:vn,accordion:dn,openMotion:En,expandIcon:Bn,collapsible:Rt,destroyInactivePanel:it,onItemClick:Te,activeKey:Me});return ot.createElement("div",(0,le.Z)({ref:fn,className:kn,style:rt,role:dn?"tablist":void 0},(0,nt.Z)(Bt,{aria:!0,data:!0})),He)}),$e=Object.assign(ct,{Panel:ye}),Et=$e,Pt=$e.Panel},23425:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ze}});var le=Le(87075),Ue=Le(71409),pt=Le(28788),St=Le(89490),yt=Le(11036),Oe=Le(92310),at=Le.n(Oe),Ct=Le(18929),ot=Le(10228),We=Le(26112),Tt=Le(48736),dt=Le(59301),kt=Le(17119),De=[10,20,50,100],ne=function(nt){var Ye=nt.pageSizeOptions,ct=Ye===void 0?De:Ye,$e=nt.locale,Et=nt.changeSize,Pt=nt.pageSize,Bt=nt.goButton,fn=nt.quickGo,qt=nt.rootPrefixCls,vn=nt.disabled,tn=nt.buildOptionText,it=nt.showSizeChanger,rt=nt.sizeChangerRender,dn=dt.useState(""),ni=(0,yt.Z)(dn,2),Kn=ni[0],Rt=ni[1],En=function(){return!Kn||Number.isNaN(Kn)?void 0:Number(Kn)},Bn=typeof tn=="function"?tn:function(Ee){return"".concat(Ee," ").concat($e.items_per_page)},ui=function(Te){Rt(Te.target.value)},It=function(Te){Bt||Kn===""||(Rt(""),!(Te.relatedTarget&&(Te.relatedTarget.className.indexOf("".concat(qt,"-item-link"))>=0||Te.relatedTarget.className.indexOf("".concat(qt,"-item"))>=0))&&(fn==null||fn(En())))},On=function(Te){Kn!==""&&(Te.keyCode===ot.Z.ENTER||Te.type==="click")&&(Rt(""),fn==null||fn(En()))},ht=function(){return ct.some(function(Te){return Te.toString()===Pt.toString()})?ct:ct.concat([Pt]).sort(function(Te,He){var Ae=Number.isNaN(Number(Te))?0:Number(Te),et=Number.isNaN(Number(He))?0:Number(He);return Ae-et})},kn="".concat(qt,"-options");if(!it&&!fn)return null;var Oi=null,ze=null,Me=null;return it&&rt&&(Oi=rt({disabled:vn,size:Pt,onSizeChange:function(Te){Et==null||Et(Number(Te))},"aria-label":$e.page_size,className:"".concat(kn,"-size-changer"),options:ht().map(function(Ee){return{label:Bn(Ee),value:Ee}})})),fn&&(Bt&&(Me=typeof Bt=="boolean"?dt.createElement("button",{type:"button",onClick:On,onKeyUp:On,disabled:vn,className:"".concat(kn,"-quick-jumper-button")},$e.jump_to_confirm):dt.createElement("span",{onClick:On,onKeyUp:On},Bt)),ze=dt.createElement("div",{className:"".concat(kn,"-quick-jumper")},$e.jump_to,dt.createElement("input",{disabled:vn,type:"text",value:Kn,onChange:ui,onKeyUp:On,onBlur:It,"aria-label":$e.page}),$e.page,Me)),dt.createElement("li",{className:kn},Oi,ze)},te=ne,de=function(nt){var Ye=nt.rootPrefixCls,ct=nt.page,$e=nt.active,Et=nt.className,Pt=nt.showTitle,Bt=nt.onClick,fn=nt.onKeyPress,qt=nt.itemRender,vn="".concat(Ye,"-item"),tn=at()(vn,"".concat(vn,"-").concat(ct),(0,le.Z)((0,le.Z)({},"".concat(vn,"-active"),$e),"".concat(vn,"-disabled"),!ct),Et),it=function(){Bt(ct)},rt=function(Kn){fn(Kn,Bt,ct)},dn=qt(ct,"page",dt.createElement("a",{rel:"nofollow"},ct));return dn?dt.createElement("li",{title:Pt?String(ct):null,className:tn,onClick:it,onKeyDown:rt,tabIndex:0},dn):null},se=de,pe=function(nt,Ye,ct){return ct};function ye(){}function we(st){var nt=Number(st);return typeof nt=="number"&&!Number.isNaN(nt)&&isFinite(nt)&&Math.floor(nt)===nt}function Ce(st,nt,Ye){var ct=typeof st=="undefined"?nt:st;return Math.floor((Ye-1)/ct)+1}var _e=function(nt){var Ye=nt.prefixCls,ct=Ye===void 0?"rc-pagination":Ye,$e=nt.selectPrefixCls,Et=$e===void 0?"rc-select":$e,Pt=nt.className,Bt=nt.current,fn=nt.defaultCurrent,qt=fn===void 0?1:fn,vn=nt.total,tn=vn===void 0?0:vn,it=nt.pageSize,rt=nt.defaultPageSize,dn=rt===void 0?10:rt,ni=nt.onChange,Kn=ni===void 0?ye:ni,Rt=nt.hideOnSinglePage,En=nt.align,Bn=nt.showPrevNextJumpers,ui=Bn===void 0?!0:Bn,It=nt.showQuickJumper,On=nt.showLessItems,ht=nt.showTitle,kn=ht===void 0?!0:ht,Oi=nt.onShowSizeChange,ze=Oi===void 0?ye:Oi,Me=nt.locale,Ee=Me===void 0?kt.Z:Me,Te=nt.style,He=nt.totalBoundaryShowSizeChanger,Ae=He===void 0?50:He,et=nt.disabled,on=nt.simple,Kt=nt.showTotal,pn=nt.showSizeChanger,Nt=pn===void 0?tn>Ae:pn,Dt=nt.sizeChangerRender,Ot=nt.pageSizeOptions,un=nt.itemRender,Sn=un===void 0?pe:un,An=nt.jumpPrevIcon,Dn=nt.jumpNextIcon,Ai=nt.prevIcon,en=nt.nextIcon,Qt=dt.useRef(null),ln=(0,Ct.Z)(10,{value:it,defaultValue:dn}),di=(0,yt.Z)(ln,2),cn=di[0],Yt=di[1],ii=(0,Ct.Z)(1,{value:Bt,defaultValue:qt,postState:function(Bo){return Math.max(1,Math.min(Bo,Ce(void 0,cn,tn)))}}),Vi=(0,yt.Z)(ii,2),bi=Vi[0],Di=Vi[1],Mr=dt.useState(bi),Gn=(0,yt.Z)(Mr,2),Rn=Gn[0],Jn=Gn[1];(0,dt.useEffect)(function(){Jn(bi)},[bi]);var Ni=Kn!==ye,ji="current"in nt,Gi=Math.max(1,bi-(On?3:5)),Fr=Math.min(Ce(void 0,cn,tn),bi+(On?3:5));function be(Ar,Bo){var br=Ar||dt.createElement("button",{type:"button","aria-label":Bo,className:"".concat(ct,"-item-link")});return typeof Ar=="function"&&(br=dt.createElement(Ar,(0,St.Z)({},nt))),br}function gn(Ar){var Bo=Ar.target.value,br=Ce(void 0,cn,tn),na;return Bo===""?na=Bo:Number.isNaN(Number(Bo))?na=Rn:Bo>=br?na=br:na=Number(Bo),na}function li(Ar){return we(Ar)&&Ar!==bi&&we(tn)&&tn>0}var Hn=tn>cn?It:!1;function oi(Ar){(Ar.keyCode===ot.Z.UP||Ar.keyCode===ot.Z.DOWN)&&Ar.preventDefault()}function ki(Ar){var Bo=gn(Ar);switch(Bo!==Rn&&Jn(Bo),Ar.keyCode){case ot.Z.ENTER:ir(Bo);break;case ot.Z.UP:ir(Bo-1);break;case ot.Z.DOWN:ir(Bo+1);break;default:break}}function Ji(Ar){ir(gn(Ar))}function $i(Ar){var Bo=Ce(Ar,cn,tn),br=bi>Bo&&Bo!==0?Bo:bi;Yt(Ar),Jn(br),ze==null||ze(bi,Ar),Di(br),Kn==null||Kn(br,Ar)}function ir(Ar){if(li(Ar)&&!et){var Bo=Ce(void 0,cn,tn),br=Ar;return Ar>Bo?br=Bo:Ar<1&&(br=1),br!==Rn&&Jn(br),Di(br),Kn==null||Kn(br,cn),br}return bi}var Mt=bi>1,_t=bi<Ce(void 0,cn,tn);function At(){Mt&&ir(bi-1)}function xi(){_t&&ir(bi+1)}function mi(){ir(Gi)}function fi(){ir(Fr)}function wn(Ar,Bo){if(Ar.key==="Enter"||Ar.charCode===ot.Z.ENTER||Ar.keyCode===ot.Z.ENTER){for(var br=arguments.length,na=new Array(br>2?br-2:0),Do=2;Do<br;Do++)na[Do-2]=arguments[Do];Bo.apply(void 0,na)}}function Yn(Ar){wn(Ar,At)}function Qi(Ar){wn(Ar,xi)}function vr(Ar){wn(Ar,mi)}function Dr(Ar){wn(Ar,fi)}function Ke(Ar){var Bo=Sn(Ar,"prev",be(Ai,"prev page"));return dt.isValidElement(Bo)?dt.cloneElement(Bo,{disabled:!Mt}):Bo}function Lt(Ar){var Bo=Sn(Ar,"next",be(en,"next page"));return dt.isValidElement(Bo)?dt.cloneElement(Bo,{disabled:!_t}):Bo}function _n(Ar){(Ar.type==="click"||Ar.keyCode===ot.Z.ENTER)&&ir(Rn)}var ci=null,$t=(0,We.Z)(nt,{aria:!0,data:!0}),xn=Kt&&dt.createElement("li",{className:"".concat(ct,"-total-text")},Kt(tn,[tn===0?0:(bi-1)*cn+1,bi*cn>tn?tn:bi*cn])),Xt=null,ri=Ce(void 0,cn,tn);if(Rt&&tn<=cn)return null;var Hi=[],gi={rootPrefixCls:ct,onClick:ir,onKeyPress:wn,showTitle:kn,itemRender:Sn,page:-1},Ii=bi-1>0?bi-1:0,Fi=bi+1<ri?bi+1:ri,Cr=It&&It.goButton,xr=(0,pt.Z)(on)==="object"?on.readOnly:!on,Sr=Cr,hn=null;on&&(Cr&&(typeof Cr=="boolean"?Sr=dt.createElement("button",{type:"button",onClick:_n,onKeyUp:_n},Ee.jump_to_confirm):Sr=dt.createElement("span",{onClick:_n,onKeyUp:_n},Cr),Sr=dt.createElement("li",{title:kn?"".concat(Ee.jump_to).concat(bi,"/").concat(ri):null,className:"".concat(ct,"-simple-pager")},Sr)),hn=dt.createElement("li",{title:kn?"".concat(bi,"/").concat(ri):null,className:"".concat(ct,"-simple-pager")},xr?Rn:dt.createElement("input",{type:"text","aria-label":Ee.jump_to,value:Rn,disabled:et,onKeyDown:oi,onKeyUp:ki,onChange:ki,onBlur:Ji,size:3}),dt.createElement("span",{className:"".concat(ct,"-slash")},"/"),ri));var ro=On?1:2;if(ri<=3+ro*2){ri||Hi.push(dt.createElement(se,(0,Ue.Z)({},gi,{key:"noPager",page:1,className:"".concat(ct,"-item-disabled")})));for(var Gr=1;Gr<=ri;Gr+=1)Hi.push(dt.createElement(se,(0,Ue.Z)({},gi,{key:Gr,page:Gr,active:bi===Gr})))}else{var So=On?Ee.prev_3:Ee.prev_5,yn=On?Ee.next_3:Ee.next_5,Xn=Sn(Gi,"jump-prev",be(An,"prev page")),rr=Sn(Fr,"jump-next",be(Dn,"next page"));ui&&(ci=Xn?dt.createElement("li",{title:kn?So:null,key:"prev",onClick:mi,tabIndex:0,onKeyDown:vr,className:at()("".concat(ct,"-jump-prev"),(0,le.Z)({},"".concat(ct,"-jump-prev-custom-icon"),!!An))},Xn):null,Xt=rr?dt.createElement("li",{title:kn?yn:null,key:"next",onClick:fi,tabIndex:0,onKeyDown:Dr,className:at()("".concat(ct,"-jump-next"),(0,le.Z)({},"".concat(ct,"-jump-next-custom-icon"),!!Dn))},rr):null);var er=Math.max(1,bi-ro),Pr=Math.min(bi+ro,ri);bi-1<=ro&&(Pr=1+ro*2),ri-bi<=ro&&(er=ri-ro*2);for(var Wr=er;Wr<=Pr;Wr+=1)Hi.push(dt.createElement(se,(0,Ue.Z)({},gi,{key:Wr,page:Wr,active:bi===Wr})));if(bi-1>=ro*2&&bi!==3&&(Hi[0]=dt.cloneElement(Hi[0],{className:at()("".concat(ct,"-item-after-jump-prev"),Hi[0].props.className)}),Hi.unshift(ci)),ri-bi>=ro*2&&bi!==ri-2){var so=Hi[Hi.length-1];Hi[Hi.length-1]=dt.cloneElement(so,{className:at()("".concat(ct,"-item-before-jump-next"),so.props.className)}),Hi.push(Xt)}er!==1&&Hi.unshift(dt.createElement(se,(0,Ue.Z)({},gi,{key:1,page:1}))),Pr!==ri&&Hi.push(dt.createElement(se,(0,Ue.Z)({},gi,{key:ri,page:ri})))}var vo=Ke(Ii);if(vo){var po=!Mt||!ri;vo=dt.createElement("li",{title:kn?Ee.prev_page:null,onClick:At,tabIndex:po?null:0,onKeyDown:Yn,className:at()("".concat(ct,"-prev"),(0,le.Z)({},"".concat(ct,"-disabled"),po)),"aria-disabled":po},vo)}var yo=Lt(Fi);if(yo){var Nn,ia;on?(Nn=!_t,ia=Mt?0:null):(Nn=!_t||!ri,ia=Nn?null:0),yo=dt.createElement("li",{title:kn?Ee.next_page:null,onClick:xi,tabIndex:ia,onKeyDown:Qi,className:at()("".concat(ct,"-next"),(0,le.Z)({},"".concat(ct,"-disabled"),Nn)),"aria-disabled":Nn},yo)}var Tn=at()(ct,Pt,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(ct,"-start"),En==="start"),"".concat(ct,"-center"),En==="center"),"".concat(ct,"-end"),En==="end"),"".concat(ct,"-simple"),on),"".concat(ct,"-disabled"),et));return dt.createElement("ul",(0,Ue.Z)({className:Tn,style:Te,ref:Qt},$t),xn,vo,on?hn:Hi,yo,dt.createElement(te,{locale:Ee,rootPrefixCls:ct,disabled:et,selectPrefixCls:Et,changeSize:$i,pageSize:cn,pageSizeOptions:Ot,quickGo:Hn?ir:null,goButton:Sr,showSizeChanger:Nt,sizeChangerRender:Dt}))},Ze=_e},738:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(71409),Ue=Le(87075),pt=Le(11036),St=Le(39224),yt=Le(92310),Oe=Le.n(yt),at=Le(18929),Ct=Le(10228),ot=Le(26112),We=Le(59301);function Tt(we,Ce){var _e=we.disabled,Ze=we.prefixCls,st=we.character,nt=we.characterRender,Ye=we.index,ct=we.count,$e=we.value,Et=we.allowHalf,Pt=we.focused,Bt=we.onHover,fn=we.onClick,qt=function(Rt){Bt(Rt,Ye)},vn=function(Rt){fn(Rt,Ye)},tn=function(Rt){Rt.keyCode===Ct.Z.ENTER&&fn(Rt,Ye)},it=Ye+1,rt=new Set([Ze]);$e===0&&Ye===0&&Pt?rt.add("".concat(Ze,"-focused")):Et&&$e+.5>=it&&$e<it?(rt.add("".concat(Ze,"-half")),rt.add("".concat(Ze,"-active")),Pt&&rt.add("".concat(Ze,"-focused"))):(it<=$e?rt.add("".concat(Ze,"-full")):rt.add("".concat(Ze,"-zero")),it===$e&&Pt&&rt.add("".concat(Ze,"-focused")));var dn=typeof st=="function"?st(we):st,ni=We.createElement("li",{className:Oe()(Array.from(rt)),ref:Ce},We.createElement("div",{onClick:_e?null:vn,onKeyDown:_e?null:tn,onMouseMove:_e?null:qt,role:"radio","aria-checked":$e>Ye?"true":"false","aria-posinset":Ye+1,"aria-setsize":ct,tabIndex:_e?-1:0},We.createElement("div",{className:"".concat(Ze,"-first")},dn),We.createElement("div",{className:"".concat(Ze,"-second")},dn)));return nt&&(ni=nt(ni,we)),ni}var dt=We.forwardRef(Tt);function kt(){var we=We.useRef({});function Ce(Ze){return we.current[Ze]}function _e(Ze){return function(st){we.current[Ze]=st}}return[Ce,_e]}function De(we){var Ce=we.pageXOffset,_e="scrollLeft";if(typeof Ce!="number"){var Ze=we.document;Ce=Ze.documentElement[_e],typeof Ce!="number"&&(Ce=Ze.body[_e])}return Ce}function ne(we){var Ce,_e,Ze=we.ownerDocument,st=Ze.body,nt=Ze&&Ze.documentElement,Ye=we.getBoundingClientRect();return Ce=Ye.left,_e=Ye.top,Ce-=nt.clientLeft||st.clientLeft||0,_e-=nt.clientTop||st.clientTop||0,{left:Ce,top:_e}}function te(we){var Ce=ne(we),_e=we.ownerDocument,Ze=_e.defaultView||_e.parentWindow;return Ce.left+=De(Ze),Ce.left}var de=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function se(we,Ce){var _e=we.prefixCls,Ze=_e===void 0?"rc-rate":_e,st=we.className,nt=we.defaultValue,Ye=we.value,ct=we.count,$e=ct===void 0?5:ct,Et=we.allowHalf,Pt=Et===void 0?!1:Et,Bt=we.allowClear,fn=Bt===void 0?!0:Bt,qt=we.keyboard,vn=qt===void 0?!0:qt,tn=we.character,it=tn===void 0?"\u2605":tn,rt=we.characterRender,dn=we.disabled,ni=we.direction,Kn=ni===void 0?"ltr":ni,Rt=we.tabIndex,En=Rt===void 0?0:Rt,Bn=we.autoFocus,ui=we.onHoverChange,It=we.onChange,On=we.onFocus,ht=we.onBlur,kn=we.onKeyDown,Oi=we.onMouseLeave,ze=(0,St.Z)(we,de),Me=kt(),Ee=(0,pt.Z)(Me,2),Te=Ee[0],He=Ee[1],Ae=We.useRef(null),et=function(){if(!dn){var Gi;(Gi=Ae.current)===null||Gi===void 0||Gi.focus()}};We.useImperativeHandle(Ce,function(){return{focus:et,blur:function(){if(!dn){var Gi;(Gi=Ae.current)===null||Gi===void 0||Gi.blur()}}}});var on=(0,at.Z)(nt||0,{value:Ye}),Kt=(0,pt.Z)(on,2),pn=Kt[0],Nt=Kt[1],Dt=(0,at.Z)(null),Ot=(0,pt.Z)(Dt,2),un=Ot[0],Sn=Ot[1],An=function(Gi,Fr){var be=Kn==="rtl",gn=Gi+1;if(Pt){var li=Te(Gi),Hn=te(li),oi=li.clientWidth;(be&&Fr-Hn>oi/2||!be&&Fr-Hn<oi/2)&&(gn-=.5)}return gn},Dn=function(Gi){Nt(Gi),It==null||It(Gi)},Ai=We.useState(!1),en=(0,pt.Z)(Ai,2),Qt=en[0],ln=en[1],di=function(){ln(!0),On==null||On()},cn=function(){ln(!1),ht==null||ht()},Yt=We.useState(null),ii=(0,pt.Z)(Yt,2),Vi=ii[0],bi=ii[1],Di=function(Gi,Fr){var be=An(Fr,Gi.pageX);be!==un&&(bi(be),Sn(null)),ui==null||ui(be)},Mr=function(Gi){dn||(bi(null),Sn(null),ui==null||ui(void 0)),Gi&&(Oi==null||Oi(Gi))},Gn=function(Gi,Fr){var be=An(Fr,Gi.pageX),gn=!1;fn&&(gn=be===pn),Mr(),Dn(gn?0:be),Sn(gn?be:null)},Rn=function(Gi){var Fr=Gi.keyCode,be=Kn==="rtl",gn=Pt?.5:1;vn&&(Fr===Ct.Z.RIGHT&&pn<$e&&!be?(Dn(pn+gn),Gi.preventDefault()):Fr===Ct.Z.LEFT&&pn>0&&!be||Fr===Ct.Z.RIGHT&&pn>0&&be?(Dn(pn-gn),Gi.preventDefault()):Fr===Ct.Z.LEFT&&pn<$e&&be&&(Dn(pn+gn),Gi.preventDefault())),kn==null||kn(Gi)};We.useEffect(function(){Bn&&!dn&&et()},[]);var Jn=new Array($e).fill(0).map(function(ji,Gi){return We.createElement(dt,{ref:He(Gi),index:Gi,count:$e,disabled:dn,prefixCls:"".concat(Ze,"-star"),allowHalf:Pt,value:Vi===null?pn:Vi,onClick:Gn,onHover:Di,key:ji||Gi,character:it,characterRender:rt,focused:Qt})}),Ni=Oe()(Ze,st,(0,Ue.Z)((0,Ue.Z)({},"".concat(Ze,"-disabled"),dn),"".concat(Ze,"-rtl"),Kn==="rtl"));return We.createElement("ul",(0,le.Z)({className:Ni,onMouseLeave:Mr,tabIndex:dn?-1:En,onFocus:dn?null:di,onBlur:dn?null:cn,onKeyDown:dn?null:Rn,ref:Ae},(0,ot.Z)(ze,{aria:!0,data:!0,attr:!0})),Jn)}var pe=We.forwardRef(se),ye=pe},6551:function(Zn,ei,Le){"use strict";Le.d(ei,{ZP:function(){return at}});var le=Le(11036),Ue=Le(59301),pt=Le(47273),St=0,yt=(0,pt.Z)();function Oe(){var Ct;return yt?(Ct=St,St+=1):Ct="TEST_OR_SSR",Ct}function at(Ct){var ot=Ue.useState(),We=(0,le.Z)(ot,2),Tt=We[0],dt=We[1];return Ue.useEffect(function(){dt("rc_select_".concat(Oe()))},[]),Ct||Tt}},37463:function(Zn,ei,Le){"use strict";Le.d(ei,{Ac:function(){return ln},Xo:function(){return cn},Wx:function(){return ii},ZP:function(){return Dr},lk:function(){return ye}});var le=Le(71409),Ue=Le(62730),pt=Le(87075),St=Le(89490),yt=Le(11036),Oe=Le(39224),at=Le(28788),Ct=Le(18929),ot=Le(48736),We=Le(59301),Tt=Le(92310),dt=Le.n(Tt),kt=Le(34280),De=Le(49658),ne=Le(8654),te=function(Lt){var _n=Lt.className,ci=Lt.customizeIcon,$t=Lt.customizeIconProps,xn=Lt.children,Xt=Lt.onMouseDown,ri=Lt.onClick,Hi=typeof ci=="function"?ci($t):ci;return We.createElement("span",{className:_n,onMouseDown:function(Ii){Ii.preventDefault(),Xt==null||Xt(Ii)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ri,"aria-hidden":!0},Hi!==void 0?Hi:We.createElement("span",{className:dt()(_n.split(/\s+/).map(function(gi){return"".concat(gi,"-icon")}))},xn))},de=te,se=function(Lt,_n,ci,$t,xn){var Xt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ri=arguments.length>6?arguments[6]:void 0,Hi=arguments.length>7?arguments[7]:void 0,gi=We.useMemo(function(){if((0,at.Z)($t)==="object")return $t.clearIcon;if(xn)return xn},[$t,xn]),Ii=We.useMemo(function(){return!!(!Xt&&$t&&(ci.length||ri)&&!(Hi==="combobox"&&ri===""))},[$t,Xt,ci.length,ri,Hi]);return{allowClear:Ii,clearIcon:We.createElement(de,{className:"".concat(Lt,"-clear"),onMouseDown:_n,customizeIcon:gi},"\xD7")}},pe=We.createContext(null);function ye(){return We.useContext(pe)}function we(){var Ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Lt=We.useState(!1),_n=(0,yt.Z)(Lt,2),ci=_n[0],$t=_n[1],xn=We.useRef(null),Xt=function(){window.clearTimeout(xn.current)};We.useEffect(function(){return Xt},[]);var ri=function(gi,Ii){Xt(),xn.current=window.setTimeout(function(){$t(gi),Ii&&Ii()},Ke)};return[ci,ri,Xt]}function Ce(){var Ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Lt=We.useRef(null),_n=We.useRef(null);We.useEffect(function(){return function(){window.clearTimeout(_n.current)}},[]);function ci($t){($t||Lt.current===null)&&(Lt.current=$t),window.clearTimeout(_n.current),_n.current=window.setTimeout(function(){Lt.current=null},Ke)}return[function(){return Lt.current},ci]}function _e(Ke,Lt,_n,ci){var $t=We.useRef(null);$t.current={open:Lt,triggerOpen:_n,customizedTrigger:ci},We.useEffect(function(){function xn(Xt){var ri;if(!((ri=$t.current)!==null&&ri!==void 0&&ri.customizedTrigger)){var Hi=Xt.target;Hi.shadowRoot&&Xt.composed&&(Hi=Xt.composedPath()[0]||Hi),$t.current.open&&Ke().filter(function(gi){return gi}).every(function(gi){return!gi.contains(Hi)&&gi!==Hi})&&$t.current.triggerOpen(!1)}}return window.addEventListener("mousedown",xn),function(){return window.removeEventListener("mousedown",xn)}},[])}var Ze=Le(10228);function st(Ke){return Ke&&![Ze.Z.ESC,Ze.Z.SHIFT,Ze.Z.BACKSPACE,Ze.Z.TAB,Ze.Z.WIN_KEY,Ze.Z.ALT,Ze.Z.META,Ze.Z.WIN_KEY_RIGHT,Ze.Z.CTRL,Ze.Z.SEMICOLON,Ze.Z.EQUALS,Ze.Z.CAPS_LOCK,Ze.Z.CONTEXT_MENU,Ze.Z.F1,Ze.Z.F2,Ze.Z.F3,Ze.Z.F4,Ze.Z.F5,Ze.Z.F6,Ze.Z.F7,Ze.Z.F8,Ze.Z.F9,Ze.Z.F10,Ze.Z.F11,Ze.Z.F12].includes(Ke)}var nt=Le(26112),Ye=Le(11780);function ct(Ke,Lt,_n){var ci=(0,St.Z)((0,St.Z)({},Ke),_n?Lt:{});return Object.keys(Lt).forEach(function($t){var xn=Lt[$t];typeof xn=="function"&&(ci[$t]=function(){for(var Xt,ri=arguments.length,Hi=new Array(ri),gi=0;gi<ri;gi++)Hi[gi]=arguments[gi];return xn.apply(void 0,Hi),(Xt=Ke[$t])===null||Xt===void 0?void 0:Xt.call.apply(Xt,[Ke].concat(Hi))})}),ci}var $e=ct,Et=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],Pt=function(Lt,_n){var ci=Lt.prefixCls,$t=Lt.id,xn=Lt.inputElement,Xt=Lt.autoFocus,ri=Lt.autoComplete,Hi=Lt.editable,gi=Lt.activeDescendantId,Ii=Lt.value,Fi=Lt.open,Cr=Lt.attrs,xr=(0,Oe.Z)(Lt,Et),Sr=xn||We.createElement("input",null),hn=Sr,ro=hn.ref,Gr=hn.props;return(0,ot.Kp)(!("maxLength"in Sr.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Sr=We.cloneElement(Sr,(0,St.Z)((0,St.Z)((0,St.Z)({type:"search"},$e(xr,Gr,!0)),{},{id:$t,ref:(0,ne.sQ)(_n,ro),autoComplete:ri||"off",autoFocus:Xt,className:dt()("".concat(ci,"-selection-search-input"),Gr==null?void 0:Gr.className),role:"combobox","aria-expanded":Fi||!1,"aria-haspopup":"listbox","aria-owns":"".concat($t,"_list"),"aria-autocomplete":"list","aria-controls":"".concat($t,"_list"),"aria-activedescendant":Fi?gi:void 0},Cr),{},{value:Hi?Ii:"",readOnly:!Hi,unselectable:Hi?null:"on",style:(0,St.Z)((0,St.Z)({},Gr.style),{},{opacity:Hi?null:0})})),Sr},Bt=We.forwardRef(Pt),fn=Bt;function qt(Ke){return Array.isArray(Ke)?Ke:Ke!==void 0?[Ke]:[]}var vn=typeof window!="undefined"&&window.document&&window.document.documentElement,tn=vn;function it(Ke){return Ke!=null}function rt(Ke){return!Ke&&Ke!==0}function dn(Ke){return["string","number"].includes((0,at.Z)(Ke))}function ni(Ke){var Lt=void 0;return Ke&&(dn(Ke.title)?Lt=Ke.title.toString():dn(Ke.label)&&(Lt=Ke.label.toString())),Lt}function Kn(Ke,Lt){tn?We.useLayoutEffect(Ke,Lt):We.useEffect(Ke,Lt)}function Rt(Ke){var Lt;return(Lt=Ke.key)!==null&&Lt!==void 0?Lt:Ke.value}var En=function(Lt){Lt.preventDefault(),Lt.stopPropagation()},Bn=function(Lt){var _n=Lt.id,ci=Lt.prefixCls,$t=Lt.values,xn=Lt.open,Xt=Lt.searchValue,ri=Lt.autoClearSearchValue,Hi=Lt.inputRef,gi=Lt.placeholder,Ii=Lt.disabled,Fi=Lt.mode,Cr=Lt.showSearch,xr=Lt.autoFocus,Sr=Lt.autoComplete,hn=Lt.activeDescendantId,ro=Lt.tabIndex,Gr=Lt.removeIcon,So=Lt.maxTagCount,yn=Lt.maxTagTextLength,Xn=Lt.maxTagPlaceholder,rr=Xn===void 0?function(yi){return"+ ".concat(yi.length," ...")}:Xn,er=Lt.tagRender,Pr=Lt.onToggleOpen,Wr=Lt.onRemove,so=Lt.onInputChange,vo=Lt.onInputPaste,po=Lt.onInputKeyDown,yo=Lt.onInputMouseDown,Nn=Lt.onInputCompositionStart,ia=Lt.onInputCompositionEnd,Tn=Lt.onInputBlur,Ar=We.useRef(null),Bo=(0,We.useState)(0),br=(0,yt.Z)(Bo,2),na=br[0],Do=br[1],ho=(0,We.useState)(!1),Jo=(0,yt.Z)(ho,2),Vt=Jo[0],jn=Jo[1],Gt="".concat(ci,"-selection"),Ie=xn||Fi==="multiple"&&ri===!1||Fi==="tags"?Xt:"",ai=Fi==="tags"||Fi==="multiple"&&ri===!1||Cr&&(xn||Vt);Kn(function(){Do(Ar.current.scrollWidth)},[Ie]);var hi=function($n,pi,ur,Ki,Bi){return We.createElement("span",{title:ni($n),className:dt()("".concat(Gt,"-item"),(0,pt.Z)({},"".concat(Gt,"-item-disabled"),ur))},We.createElement("span",{className:"".concat(Gt,"-item-content")},pi),Ki&&We.createElement(de,{className:"".concat(Gt,"-item-remove"),onMouseDown:En,onClick:Bi,customizeIcon:Gr},"\xD7"))},_i=function($n,pi,ur,Ki,Bi,Pn){var hr=function(xo){En(xo),Pr(!xn)};return We.createElement("span",{onMouseDown:hr},er({label:pi,value:$n,disabled:ur,closable:Ki,onClose:Bi,isMaxTag:!!Pn}))},Yi=function($n){var pi=$n.disabled,ur=$n.label,Ki=$n.value,Bi=!Ii&&!pi,Pn=ur;if(typeof yn=="number"&&(typeof ur=="string"||typeof ur=="number")){var hr=String(Pn);hr.length>yn&&(Pn="".concat(hr.slice(0,yn),"..."))}var or=function(Yr){Yr&&Yr.stopPropagation(),Wr($n)};return typeof er=="function"?_i(Ki,Pn,pi,Bi,or):hi($n,Pn,pi,Bi,or)},Ti=function($n){if(!$t.length)return null;var pi=typeof rr=="function"?rr($n):rr;return typeof er=="function"?_i(void 0,pi,!1,!1,void 0,!0):hi({title:pi},pi,!1)},In=We.createElement("div",{className:"".concat(Gt,"-search"),style:{width:na},onFocus:function(){jn(!0)},onBlur:function(){jn(!1)}},We.createElement(fn,{ref:Hi,open:xn,prefixCls:ci,id:_n,inputElement:null,disabled:Ii,autoFocus:xr,autoComplete:Sr,editable:ai,activeDescendantId:hn,value:Ie,onKeyDown:po,onMouseDown:yo,onChange:so,onPaste:vo,onCompositionStart:Nn,onCompositionEnd:ia,onBlur:Tn,tabIndex:ro,attrs:(0,nt.Z)(Lt,!0)}),We.createElement("span",{ref:Ar,className:"".concat(Gt,"-search-mirror"),"aria-hidden":!0},Ie,"\xA0")),si=We.createElement(Ye.Z,{prefixCls:"".concat(Gt,"-overflow"),data:$t,renderItem:Yi,renderRest:Ti,suffix:In,itemKey:Rt,maxCount:So});return We.createElement("span",{className:"".concat(Gt,"-wrap")},si,!$t.length&&!Ie&&We.createElement("span",{className:"".concat(Gt,"-placeholder")},gi))},ui=Bn,It=function(Lt){var _n=Lt.inputElement,ci=Lt.prefixCls,$t=Lt.id,xn=Lt.inputRef,Xt=Lt.disabled,ri=Lt.autoFocus,Hi=Lt.autoComplete,gi=Lt.activeDescendantId,Ii=Lt.mode,Fi=Lt.open,Cr=Lt.values,xr=Lt.placeholder,Sr=Lt.tabIndex,hn=Lt.showSearch,ro=Lt.searchValue,Gr=Lt.activeValue,So=Lt.maxLength,yn=Lt.onInputKeyDown,Xn=Lt.onInputMouseDown,rr=Lt.onInputChange,er=Lt.onInputPaste,Pr=Lt.onInputCompositionStart,Wr=Lt.onInputCompositionEnd,so=Lt.onInputBlur,vo=Lt.title,po=We.useState(!1),yo=(0,yt.Z)(po,2),Nn=yo[0],ia=yo[1],Tn=Ii==="combobox",Ar=Tn||hn,Bo=Cr[0],br=ro||"";Tn&&Gr&&!Nn&&(br=Gr),We.useEffect(function(){Tn&&ia(!1)},[Tn,Gr]);var na=Ii!=="combobox"&&!Fi&&!hn?!1:!!br,Do=vo===void 0?ni(Bo):vo,ho=We.useMemo(function(){return Bo?null:We.createElement("span",{className:"".concat(ci,"-selection-placeholder"),style:na?{visibility:"hidden"}:void 0},xr)},[Bo,na,xr,ci]);return We.createElement("span",{className:"".concat(ci,"-selection-wrap")},We.createElement("span",{className:"".concat(ci,"-selection-search")},We.createElement(fn,{ref:xn,prefixCls:ci,id:$t,open:Fi,inputElement:_n,disabled:Xt,autoFocus:ri,autoComplete:Hi,editable:Ar,activeDescendantId:gi,value:br,onKeyDown:yn,onMouseDown:Xn,onChange:function(Vt){ia(!0),rr(Vt)},onPaste:er,onCompositionStart:Pr,onCompositionEnd:Wr,onBlur:so,tabIndex:Sr,attrs:(0,nt.Z)(Lt,!0),maxLength:Tn?So:void 0})),!Tn&&Bo?We.createElement("span",{className:"".concat(ci,"-selection-item"),title:Do,style:na?{visibility:"hidden"}:void 0},Bo.label):null,ho)},On=It,ht=function(Lt,_n){var ci=(0,We.useRef)(null),$t=(0,We.useRef)(!1),xn=Lt.prefixCls,Xt=Lt.open,ri=Lt.mode,Hi=Lt.showSearch,gi=Lt.tokenWithEnter,Ii=Lt.disabled,Fi=Lt.prefix,Cr=Lt.autoClearSearchValue,xr=Lt.onSearch,Sr=Lt.onSearchSubmit,hn=Lt.onToggleOpen,ro=Lt.onInputKeyDown,Gr=Lt.onInputBlur,So=Lt.domRef;We.useImperativeHandle(_n,function(){return{focus:function(Do){ci.current.focus(Do)},blur:function(){ci.current.blur()}}});var yn=Ce(0),Xn=(0,yt.Z)(yn,2),rr=Xn[0],er=Xn[1],Pr=function(Do){var ho=Do.which,Jo=ci.current instanceof HTMLTextAreaElement;!Jo&&Xt&&(ho===Ze.Z.UP||ho===Ze.Z.DOWN)&&Do.preventDefault(),ro&&ro(Do),ho===Ze.Z.ENTER&&ri==="tags"&&!$t.current&&!Xt&&(Sr==null||Sr(Do.target.value)),!(Jo&&!Xt&&~[Ze.Z.UP,Ze.Z.DOWN,Ze.Z.LEFT,Ze.Z.RIGHT].indexOf(ho))&&st(ho)&&hn(!0)},Wr=function(){er(!0)},so=(0,We.useRef)(null),vo=function(Do){xr(Do,!0,$t.current)!==!1&&hn(!0)},po=function(){$t.current=!0},yo=function(Do){$t.current=!1,ri!=="combobox"&&vo(Do.target.value)},Nn=function(Do){var ho=Do.target.value;if(gi&&so.current&&/[\r\n]/.test(so.current)){var Jo=so.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");ho=ho.replace(Jo,so.current)}so.current=null,vo(ho)},ia=function(Do){var ho=Do.clipboardData,Jo=ho==null?void 0:ho.getData("text");so.current=Jo||""},Tn=function(Do){var ho=Do.target;if(ho!==ci.current){var Jo=document.body.style.msTouchAction!==void 0;Jo?setTimeout(function(){ci.current.focus()}):ci.current.focus()}},Ar=function(Do){var ho=rr();Do.target!==ci.current&&!ho&&!(ri==="combobox"&&Ii)&&Do.preventDefault(),(ri!=="combobox"&&(!Hi||!ho)||!Xt)&&(Xt&&Cr!==!1&&xr("",!0,!1),hn())},Bo={inputRef:ci,onInputKeyDown:Pr,onInputMouseDown:Wr,onInputChange:Nn,onInputPaste:ia,onInputCompositionStart:po,onInputCompositionEnd:yo,onInputBlur:Gr},br=ri==="multiple"||ri==="tags"?We.createElement(ui,(0,le.Z)({},Lt,Bo)):We.createElement(On,(0,le.Z)({},Lt,Bo));return We.createElement("div",{ref:So,className:"".concat(xn,"-selector"),onClick:Tn,onMouseDown:Ar},Fi&&We.createElement("div",{className:"".concat(xn,"-prefix")},Fi),br)},kn=We.forwardRef(ht),Oi=kn,ze=Le(65352),Me=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Ee=function(Lt){var _n=Lt===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:_n,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:_n,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:_n,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:_n,adjustY:1},htmlRegion:"scroll"}}},Te=function(Lt,_n){var ci=Lt.prefixCls,$t=Lt.disabled,xn=Lt.visible,Xt=Lt.children,ri=Lt.popupElement,Hi=Lt.animation,gi=Lt.transitionName,Ii=Lt.dropdownStyle,Fi=Lt.dropdownClassName,Cr=Lt.direction,xr=Cr===void 0?"ltr":Cr,Sr=Lt.placement,hn=Lt.builtinPlacements,ro=Lt.dropdownMatchSelectWidth,Gr=Lt.dropdownRender,So=Lt.dropdownAlign,yn=Lt.getPopupContainer,Xn=Lt.empty,rr=Lt.getTriggerDOMNode,er=Lt.onPopupVisibleChange,Pr=Lt.onPopupMouseEnter,Wr=(0,Oe.Z)(Lt,Me),so="".concat(ci,"-dropdown"),vo=ri;Gr&&(vo=Gr(ri));var po=We.useMemo(function(){return hn||Ee(ro)},[hn,ro]),yo=Hi?"".concat(so,"-").concat(Hi):gi,Nn=typeof ro=="number",ia=We.useMemo(function(){return Nn?null:ro===!1?"minWidth":"width"},[ro,Nn]),Tn=Ii;Nn&&(Tn=(0,St.Z)((0,St.Z)({},Tn),{},{width:ro}));var Ar=We.useRef(null);return We.useImperativeHandle(_n,function(){return{getPopupElement:function(){var br;return(br=Ar.current)===null||br===void 0?void 0:br.popupElement}}}),We.createElement(ze.Z,(0,le.Z)({},Wr,{showAction:er?["click"]:[],hideAction:er?["click"]:[],popupPlacement:Sr||(xr==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:po,prefixCls:so,popupTransitionName:yo,popup:We.createElement("div",{onMouseEnter:Pr},vo),ref:Ar,stretch:ia,popupAlign:So,popupVisible:xn,getPopupContainer:yn,popupClassName:dt()(Fi,(0,pt.Z)({},"".concat(so,"-empty"),Xn)),popupStyle:Tn,getTriggerDOMNode:rr,onPopupVisibleChange:er}),Xt)},He=We.forwardRef(Te),Ae=He,et=Le(67900);function on(Ke,Lt){var _n=Ke.key,ci;return"value"in Ke&&(ci=Ke.value),_n!=null?_n:ci!==void 0?ci:"rc-index-key-".concat(Lt)}function Kt(Ke){return typeof Ke!="undefined"&&!Number.isNaN(Ke)}function pn(Ke,Lt){var _n=Ke||{},ci=_n.label,$t=_n.value,xn=_n.options,Xt=_n.groupLabel,ri=ci||(Lt?"children":"label");return{label:ri,value:$t||"value",options:xn||"options",groupLabel:Xt||ri}}function Nt(Ke){var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_n=Lt.fieldNames,ci=Lt.childrenAsData,$t=[],xn=pn(_n,!1),Xt=xn.label,ri=xn.value,Hi=xn.options,gi=xn.groupLabel;function Ii(Fi,Cr){Array.isArray(Fi)&&Fi.forEach(function(xr){if(Cr||!(Hi in xr)){var Sr=xr[ri];$t.push({key:on(xr,$t.length),groupOption:Cr,data:xr,label:xr[Xt],value:Sr})}else{var hn=xr[gi];hn===void 0&&ci&&(hn=xr.label),$t.push({key:on(xr,$t.length),group:!0,data:xr,label:hn}),Ii(xr[Hi],!0)}})}return Ii(Ke,!1),$t}function Dt(Ke){var Lt=(0,St.Z)({},Ke);return"props"in Lt||Object.defineProperty(Lt,"props",{get:function(){return(0,ot.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Lt}}),Lt}var Ot=function(Lt,_n,ci){if(!_n||!_n.length)return null;var $t=!1,xn=function ri(Hi,gi){var Ii=(0,et.Z)(gi),Fi=Ii[0],Cr=Ii.slice(1);if(!Fi)return[Hi];var xr=Hi.split(Fi);return $t=$t||xr.length>1,xr.reduce(function(Sr,hn){return[].concat((0,Ue.Z)(Sr),(0,Ue.Z)(ri(hn,Cr)))},[]).filter(Boolean)},Xt=xn(Lt,_n);return $t?typeof ci!="undefined"?Xt.slice(0,ci):Xt:null},un=We.createContext(null),Sn=un;function An(Ke){var Lt=Ke.visible,_n=Ke.values;if(!Lt)return null;var ci=50;return We.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(_n.slice(0,ci).map(function($t){var xn=$t.label,Xt=$t.value;return["number","string"].includes((0,at.Z)(xn))?xn:Xt}).join(", ")),_n.length>ci?", ...":null)}var Dn=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Ai=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],en=function(Lt){return Lt==="tags"||Lt==="multiple"},Qt=We.forwardRef(function(Ke,Lt){var _n,ci=Ke.id,$t=Ke.prefixCls,xn=Ke.className,Xt=Ke.showSearch,ri=Ke.tagRender,Hi=Ke.direction,gi=Ke.omitDomProps,Ii=Ke.displayValues,Fi=Ke.onDisplayValuesChange,Cr=Ke.emptyOptions,xr=Ke.notFoundContent,Sr=xr===void 0?"Not Found":xr,hn=Ke.onClear,ro=Ke.mode,Gr=Ke.disabled,So=Ke.loading,yn=Ke.getInputElement,Xn=Ke.getRawInputElement,rr=Ke.open,er=Ke.defaultOpen,Pr=Ke.onDropdownVisibleChange,Wr=Ke.activeValue,so=Ke.onActiveValueChange,vo=Ke.activeDescendantId,po=Ke.searchValue,yo=Ke.autoClearSearchValue,Nn=Ke.onSearch,ia=Ke.onSearchSplit,Tn=Ke.tokenSeparators,Ar=Ke.allowClear,Bo=Ke.prefix,br=Ke.suffixIcon,na=Ke.clearIcon,Do=Ke.OptionList,ho=Ke.animation,Jo=Ke.transitionName,Vt=Ke.dropdownStyle,jn=Ke.dropdownClassName,Gt=Ke.dropdownMatchSelectWidth,Ie=Ke.dropdownRender,ai=Ke.dropdownAlign,hi=Ke.placement,_i=Ke.builtinPlacements,Yi=Ke.getPopupContainer,Ti=Ke.showAction,In=Ti===void 0?[]:Ti,si=Ke.onFocus,yi=Ke.onBlur,$n=Ke.onKeyUp,pi=Ke.onKeyDown,ur=Ke.onMouseDown,Ki=(0,Oe.Z)(Ke,Dn),Bi=en(ro),Pn=(Xt!==void 0?Xt:Bi)||ro==="combobox",hr=(0,St.Z)({},Ki);Ai.forEach(function(Io){delete hr[Io]}),gi==null||gi.forEach(function(Io){delete hr[Io]});var or=We.useState(!1),xo=(0,yt.Z)(or,2),Yr=xo[0],qo=xo[1];We.useEffect(function(){qo((0,De.Z)())},[]);var Ko=We.useRef(null),Qo=We.useRef(null),ra=We.useRef(null),Uo=We.useRef(null),wa=We.useRef(null),Wt=We.useRef(!1),Ho=we(),wr=(0,yt.Z)(Ho,3),no=wr[0],bo=wr[1],oo=wr[2];We.useImperativeHandle(Lt,function(){var Io,ca;return{focus:(Io=Uo.current)===null||Io===void 0?void 0:Io.focus,blur:(ca=Uo.current)===null||ca===void 0?void 0:ca.blur,scrollTo:function(gt){var Ht;return(Ht=wa.current)===null||Ht===void 0?void 0:Ht.scrollTo(gt)},nativeElement:Ko.current||Qo.current}});var fa=We.useMemo(function(){var Io;if(ro!=="combobox")return po;var ca=(Io=Ii[0])===null||Io===void 0?void 0:Io.value;return typeof ca=="string"||typeof ca=="number"?String(ca):""},[po,ro,Ii]),ga=ro==="combobox"&&typeof yn=="function"&&yn()||null,Mo=typeof Xn=="function"&&Xn(),Fo=(0,ne.x1)(Qo,Mo==null||(_n=Mo.props)===null||_n===void 0?void 0:_n.ref),vs=We.useState(!1),es=(0,yt.Z)(vs,2),ps=es[0],ms=es[1];(0,kt.Z)(function(){ms(!0)},[]);var Kr=(0,Ct.Z)(!1,{defaultValue:er,value:rr}),Ka=(0,yt.Z)(Kr,2),Ba=Ka[0],ss=Ka[1],Ya=ps?Ba:!1,ls=!Sr&&Cr;(Gr||ls&&Ya&&ro==="combobox")&&(Ya=!1);var Zi=ls?!1:Ya,Xr=We.useCallback(function(Io){var ca=Io!==void 0?Io:!Ya;Gr||(ss(ca),Ya!==ca&&(Pr==null||Pr(ca)))},[Gr,Ya,ss,Pr]),Po=We.useMemo(function(){return(Tn||[]).some(function(Io){return[`
|
|
`,`\r
|
|
`].includes(Io)})},[Tn]),Yo=We.useContext(Sn)||{},ea=Yo.maxCount,Ea=Yo.rawValues,Hr=function(ca,Wa,gt){if(!(Bi&&Kt(ea)&&(Ea==null?void 0:Ea.size)>=ea)){var Ht=!0,Re=ca;so==null||so(null);var lt=Ot(ca,Tn,Kt(ea)?ea-Ea.size:void 0),fr=gt?null:lt;return ro!=="combobox"&&fr&&(Re="",ia==null||ia(fr),Xr(!1),Ht=!1),Nn&&fa!==Re&&Nn(Re,{source:Wa?"typing":"effect"}),Ht}},Ns=function(ca){!ca||!ca.trim()||Nn(ca,{source:"submit"})};We.useEffect(function(){!Ya&&!Bi&&ro!=="combobox"&&Hr("",!1,!1)},[Ya]),We.useEffect(function(){Ba&&Gr&&ss(!1),Gr&&!Wt.current&&bo(!1)},[Gr]);var is=Ce(),Ut=(0,yt.Z)(is,2),Zt=Ut[0],bn=Ut[1],zi=We.useRef(!1),Ei=function(ca){var Wa=Zt(),gt=ca.key,Ht=gt==="Enter";if(Ht&&(ro!=="combobox"&&ca.preventDefault(),Ya||Xr(!0)),bn(!!fa),gt==="Backspace"&&!Wa&&Bi&&!fa&&Ii.length){for(var Re=(0,Ue.Z)(Ii),lt=null,fr=Re.length-1;fr>=0;fr-=1){var sr=Re[fr];if(!sr.disabled){Re.splice(fr,1),lt=sr;break}}lt&&Fi(Re,{type:"remove",values:[lt]})}for(var pr=arguments.length,Ui=new Array(pr>1?pr-1:0),Un=1;Un<pr;Un++)Ui[Un-1]=arguments[Un];if(Ya&&(!Ht||!zi.current)){var Lr;Ht&&(zi.current=!0),(Lr=wa.current)===null||Lr===void 0||Lr.onKeyDown.apply(Lr,[ca].concat(Ui))}pi==null||pi.apply(void 0,[ca].concat(Ui))},Mi=function(ca){for(var Wa=arguments.length,gt=new Array(Wa>1?Wa-1:0),Ht=1;Ht<Wa;Ht++)gt[Ht-1]=arguments[Ht];if(Ya){var Re;(Re=wa.current)===null||Re===void 0||Re.onKeyUp.apply(Re,[ca].concat(gt))}ca.key==="Enter"&&(zi.current=!1),$n==null||$n.apply(void 0,[ca].concat(gt))},wi=function(ca){var Wa=Ii.filter(function(gt){return gt!==ca});Fi(Wa,{type:"remove",values:[ca]})},Fn=function(){zi.current=!1},ti=We.useRef(!1),dr=function(){bo(!0),Gr||(si&&!ti.current&&si.apply(void 0,arguments),In.includes("focus")&&Xr(!0)),ti.current=!0},Tr=function(){Wt.current=!0,bo(!1,function(){ti.current=!1,Wt.current=!1,Xr(!1)}),!Gr&&(fa&&(ro==="tags"?Nn(fa,{source:"submit"}):ro==="multiple"&&Nn("",{source:"blur"})),yi&&yi.apply(void 0,arguments))},Vo=[];We.useEffect(function(){return function(){Vo.forEach(function(Io){return clearTimeout(Io)}),Vo.splice(0,Vo.length)}},[]);var To=function(ca){var Wa,gt=ca.target,Ht=(Wa=ra.current)===null||Wa===void 0?void 0:Wa.getPopupElement();if(Ht&&Ht.contains(gt)){var Re=setTimeout(function(){var pr=Vo.indexOf(Re);if(pr!==-1&&Vo.splice(pr,1),oo(),!Yr&&!Ht.contains(document.activeElement)){var Ui;(Ui=Uo.current)===null||Ui===void 0||Ui.focus()}});Vo.push(Re)}for(var lt=arguments.length,fr=new Array(lt>1?lt-1:0),sr=1;sr<lt;sr++)fr[sr-1]=arguments[sr];ur==null||ur.apply(void 0,[ca].concat(fr))},Ca=We.useState({}),Sa=(0,yt.Z)(Ca,2),mo=Sa[1];function _r(){mo({})}var ar;Mo&&(ar=function(ca){Xr(ca)}),_e(function(){var Io;return[Ko.current,(Io=ra.current)===null||Io===void 0?void 0:Io.getPopupElement()]},Zi,Xr,!!Mo);var oa=We.useMemo(function(){return(0,St.Z)((0,St.Z)({},Ke),{},{notFoundContent:Sr,open:Ya,triggerOpen:Zi,id:ci,showSearch:Pn,multiple:Bi,toggleOpen:Xr})},[Ke,Sr,Zi,Ya,ci,Pn,Bi,Xr]),la=!!br||So,Ma;la&&(Ma=We.createElement(de,{className:dt()("".concat($t,"-arrow"),(0,pt.Z)({},"".concat($t,"-arrow-loading"),So)),customizeIcon:br,customizeIconProps:{loading:So,searchValue:fa,open:Ya,focused:no,showSearch:Pn}}));var za=function(){var ca;hn==null||hn(),(ca=Uo.current)===null||ca===void 0||ca.focus(),Fi([],{type:"clear",values:Ii}),Hr("",!1,!1)},Ro=se($t,za,Ii,Ar,na,Gr,fa,ro),ua=Ro.allowClear,ko=Ro.clearIcon,jr=We.createElement(Do,{ref:wa}),Fa=dt()($t,xn,(0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)({},"".concat($t,"-focused"),no),"".concat($t,"-multiple"),Bi),"".concat($t,"-single"),!Bi),"".concat($t,"-allow-clear"),Ar),"".concat($t,"-show-arrow"),la),"".concat($t,"-disabled"),Gr),"".concat($t,"-loading"),So),"".concat($t,"-open"),Ya),"".concat($t,"-customize-input"),ga),"".concat($t,"-show-search"),Pn)),sa=We.createElement(Ae,{ref:ra,disabled:Gr,prefixCls:$t,visible:Zi,popupElement:jr,animation:ho,transitionName:Jo,dropdownStyle:Vt,dropdownClassName:jn,direction:Hi,dropdownMatchSelectWidth:Gt,dropdownRender:Ie,dropdownAlign:ai,placement:hi,builtinPlacements:_i,getPopupContainer:Yi,empty:Cr,getTriggerDOMNode:function(ca){return Qo.current||ca},onPopupVisibleChange:ar,onPopupMouseEnter:_r},Mo?We.cloneElement(Mo,{ref:Fo}):We.createElement(Oi,(0,le.Z)({},Ke,{domRef:Qo,prefixCls:$t,inputElement:ga,ref:Uo,id:ci,prefix:Bo,showSearch:Pn,autoClearSearchValue:yo,mode:ro,activeDescendantId:vo,tagRender:ri,values:Ii,open:Ya,onToggleOpen:Xr,activeValue:Wr,searchValue:fa,onSearch:Hr,onSearchSubmit:Ns,onRemove:wi,tokenWithEnter:Po,onInputBlur:Fn}))),Xo;return Mo?Xo=sa:Xo=We.createElement("div",(0,le.Z)({className:Fa},hr,{ref:Ko,onMouseDown:To,onKeyDown:Ei,onKeyUp:Mi,onFocus:dr,onBlur:Tr}),We.createElement(An,{visible:no&&!Ya,values:Ii}),sa,Ma,ua&&ko),We.createElement(pe.Provider,{value:oa},Xo)}),ln=Qt,di=function(){return null};di.isSelectOptGroup=!0;var cn=di,Yt=function(){return null};Yt.isSelectOption=!0;var ii=Yt,Vi=Le(80547),bi=Le(2738),Di=Le(65283);function Mr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Gn=["disabled","title","children","style","className"];function Rn(Ke){return typeof Ke=="string"||typeof Ke=="number"}var Jn=function(Lt,_n){var ci=ye(),$t=ci.prefixCls,xn=ci.id,Xt=ci.open,ri=ci.multiple,Hi=ci.mode,gi=ci.searchValue,Ii=ci.toggleOpen,Fi=ci.notFoundContent,Cr=ci.onPopupScroll,xr=We.useContext(Sn),Sr=xr.maxCount,hn=xr.flattenOptions,ro=xr.onActiveValue,Gr=xr.defaultActiveFirstOption,So=xr.onSelect,yn=xr.menuItemSelectedIcon,Xn=xr.rawValues,rr=xr.fieldNames,er=xr.virtual,Pr=xr.direction,Wr=xr.listHeight,so=xr.listItemHeight,vo=xr.optionRender,po="".concat($t,"-item"),yo=(0,Vi.Z)(function(){return hn},[Xt,hn],function(Ti,In){return In[0]&&Ti[1]!==In[1]}),Nn=We.useRef(null),ia=We.useMemo(function(){return ri&&Kt(Sr)&&(Xn==null?void 0:Xn.size)>=Sr},[ri,Sr,Xn==null?void 0:Xn.size]),Tn=function(In){In.preventDefault()},Ar=function(In){var si;(si=Nn.current)===null||si===void 0||si.scrollTo(typeof In=="number"?{index:In}:In)},Bo=We.useCallback(function(Ti){return Hi==="combobox"?!1:Xn.has(Ti)},[Hi,(0,Ue.Z)(Xn).toString(),Xn.size]),br=function(In){for(var si=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,yi=yo.length,$n=0;$n<yi;$n+=1){var pi=(In+$n*si+yi)%yi,ur=yo[pi]||{},Ki=ur.group,Bi=ur.data;if(!Ki&&!(Bi!=null&&Bi.disabled)&&(Bo(Bi.value)||!ia))return pi}return-1},na=We.useState(function(){return br(0)}),Do=(0,yt.Z)(na,2),ho=Do[0],Jo=Do[1],Vt=function(In){var si=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Jo(In);var yi={source:si?"keyboard":"mouse"},$n=yo[In];if(!$n){ro(null,-1,yi);return}ro($n.value,In,yi)};(0,We.useEffect)(function(){Vt(Gr!==!1?br(0):-1)},[yo.length,gi]);var jn=We.useCallback(function(Ti){return Hi==="combobox"?String(Ti).toLowerCase()===gi.toLowerCase():Xn.has(Ti)},[Hi,gi,(0,Ue.Z)(Xn).toString(),Xn.size]);(0,We.useEffect)(function(){var Ti=setTimeout(function(){if(!ri&&Xt&&Xn.size===1){var si=Array.from(Xn)[0],yi=yo.findIndex(function($n){var pi=$n.data;return gi?String(pi.value).startsWith(gi):pi.value===si});yi!==-1&&(Vt(yi),Ar(yi))}});if(Xt){var In;(In=Nn.current)===null||In===void 0||In.scrollTo(void 0)}return function(){return clearTimeout(Ti)}},[Xt,gi]);var Gt=function(In){In!==void 0&&So(In,{selected:!Xn.has(In)}),ri||Ii(!1)};if(We.useImperativeHandle(_n,function(){return{onKeyDown:function(In){var si=In.which,yi=In.ctrlKey;switch(si){case Ze.Z.N:case Ze.Z.P:case Ze.Z.UP:case Ze.Z.DOWN:{var $n=0;if(si===Ze.Z.UP?$n=-1:si===Ze.Z.DOWN?$n=1:Mr()&&yi&&(si===Ze.Z.N?$n=1:si===Ze.Z.P&&($n=-1)),$n!==0){var pi=br(ho+$n,$n);Ar(pi),Vt(pi,!0)}break}case Ze.Z.TAB:case Ze.Z.ENTER:{var ur,Ki=yo[ho];Ki&&!(Ki!=null&&(ur=Ki.data)!==null&&ur!==void 0&&ur.disabled)&&!ia?Gt(Ki.value):Gt(void 0),Xt&&In.preventDefault();break}case Ze.Z.ESC:Ii(!1),Xt&&In.stopPropagation()}},onKeyUp:function(){},scrollTo:function(In){Ar(In)}}}),yo.length===0)return We.createElement("div",{role:"listbox",id:"".concat(xn,"_list"),className:"".concat(po,"-empty"),onMouseDown:Tn},Fi);var Ie=Object.keys(rr).map(function(Ti){return rr[Ti]}),ai=function(In){return In.label};function hi(Ti,In){var si=Ti.group;return{role:si?"presentation":"option",id:"".concat(xn,"_list_").concat(In)}}var _i=function(In){var si=yo[In];if(!si)return null;var yi=si.data||{},$n=yi.value,pi=si.group,ur=(0,nt.Z)(yi,!0),Ki=ai(si);return si?We.createElement("div",(0,le.Z)({"aria-label":typeof Ki=="string"&&!pi?Ki:null},ur,{key:In},hi(si,In),{"aria-selected":jn($n)}),$n):null},Yi={role:"listbox",id:"".concat(xn,"_list")};return We.createElement(We.Fragment,null,er&&We.createElement("div",(0,le.Z)({},Yi,{style:{height:0,width:0,overflow:"hidden"}}),_i(ho-1),_i(ho),_i(ho+1)),We.createElement(Di.Z,{itemKey:"key",ref:Nn,data:yo,height:Wr,itemHeight:so,fullHeight:!1,onMouseDown:Tn,onScroll:Cr,virtual:er,direction:Pr,innerProps:er?null:Yi},function(Ti,In){var si=Ti.group,yi=Ti.groupOption,$n=Ti.data,pi=Ti.label,ur=Ti.value,Ki=$n.key;if(si){var Bi,Pn=(Bi=$n.title)!==null&&Bi!==void 0?Bi:Rn(pi)?pi.toString():void 0;return We.createElement("div",{className:dt()(po,"".concat(po,"-group"),$n.className),title:Pn},pi!==void 0?pi:Ki)}var hr=$n.disabled,or=$n.title,xo=$n.children,Yr=$n.style,qo=$n.className,Ko=(0,Oe.Z)($n,Gn),Qo=(0,bi.Z)(Ko,Ie),ra=Bo(ur),Uo=hr||!ra&&ia,wa="".concat(po,"-option"),Wt=dt()(po,wa,qo,(0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)({},"".concat(wa,"-grouped"),yi),"".concat(wa,"-active"),ho===In&&!Uo),"".concat(wa,"-disabled"),Uo),"".concat(wa,"-selected"),ra)),Ho=ai(Ti),wr=!yn||typeof yn=="function"||ra,no=typeof Ho=="number"?Ho:Ho||ur,bo=Rn(no)?no.toString():void 0;return or!==void 0&&(bo=or),We.createElement("div",(0,le.Z)({},(0,nt.Z)(Qo),er?{}:hi(Ti,In),{"aria-selected":jn(ur),className:Wt,title:bo,onMouseMove:function(){ho===In||Uo||Vt(In)},onClick:function(){Uo||Gt(ur)},style:Yr}),We.createElement("div",{className:"".concat(wa,"-content")},typeof vo=="function"?vo(Ti,{index:In}):no),We.isValidElement(yn)||ra,wr&&We.createElement(de,{className:"".concat(po,"-option-state"),customizeIcon:yn,customizeIconProps:{value:ur,disabled:Uo,isSelected:ra}},ra?"\u2713":null))}))},Ni=We.forwardRef(Jn),ji=Ni,Gi=function(Ke,Lt){var _n=We.useRef({values:new Map,options:new Map}),ci=We.useMemo(function(){var xn=_n.current,Xt=xn.values,ri=xn.options,Hi=Ke.map(function(Fi){if(Fi.label===void 0){var Cr;return(0,St.Z)((0,St.Z)({},Fi),{},{label:(Cr=Xt.get(Fi.value))===null||Cr===void 0?void 0:Cr.label})}return Fi}),gi=new Map,Ii=new Map;return Hi.forEach(function(Fi){gi.set(Fi.value,Fi),Ii.set(Fi.value,Lt.get(Fi.value)||ri.get(Fi.value))}),_n.current.values=gi,_n.current.options=Ii,Hi},[Ke,Lt]),$t=We.useCallback(function(xn){return Lt.get(xn)||_n.current.options.get(xn)},[Lt]);return[ci,$t]};function Fr(Ke,Lt){return qt(Ke).join("").toUpperCase().includes(Lt)}var be=function(Ke,Lt,_n,ci,$t){return We.useMemo(function(){if(!_n||ci===!1)return Ke;var xn=Lt.options,Xt=Lt.label,ri=Lt.value,Hi=[],gi=typeof ci=="function",Ii=_n.toUpperCase(),Fi=gi?ci:function(xr,Sr){return $t?Fr(Sr[$t],Ii):Sr[xn]?Fr(Sr[Xt!=="children"?Xt:"label"],Ii):Fr(Sr[ri],Ii)},Cr=gi?function(xr){return Dt(xr)}:function(xr){return xr};return Ke.forEach(function(xr){if(xr[xn]){var Sr=Fi(_n,Cr(xr));if(Sr)Hi.push(xr);else{var hn=xr[xn].filter(function(ro){return Fi(_n,Cr(ro))});hn.length&&Hi.push((0,St.Z)((0,St.Z)({},xr),{},(0,pt.Z)({},xn,hn)))}return}Fi(_n,Cr(xr))&&Hi.push(xr)}),Hi},[Ke,ci,$t,_n,Lt])},gn=Le(6551),li=Le(11592),Hn=["children","value"],oi=["children"];function ki(Ke){var Lt=Ke,_n=Lt.key,ci=Lt.props,$t=ci.children,xn=ci.value,Xt=(0,Oe.Z)(ci,Hn);return(0,St.Z)({key:_n,value:xn!==void 0?xn:_n,children:$t},Xt)}function Ji(Ke){var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,li.Z)(Ke).map(function(_n,ci){if(!We.isValidElement(_n)||!_n.type)return null;var $t=_n,xn=$t.type.isSelectOptGroup,Xt=$t.key,ri=$t.props,Hi=ri.children,gi=(0,Oe.Z)(ri,oi);return Lt||!xn?ki(_n):(0,St.Z)((0,St.Z)({key:"__RC_SELECT_GRP__".concat(Xt===null?ci:Xt,"__"),label:Xt},gi),{},{options:Ji(Hi)})}).filter(function(_n){return _n})}var $i=function(Lt,_n,ci,$t,xn){return We.useMemo(function(){var Xt=Lt,ri=!Lt;ri&&(Xt=Ji(_n));var Hi=new Map,gi=new Map,Ii=function(xr,Sr,hn){hn&&typeof hn=="string"&&xr.set(Sr[hn],Sr)},Fi=function Cr(xr){for(var Sr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,hn=0;hn<xr.length;hn+=1){var ro=xr[hn];!ro[ci.options]||Sr?(Hi.set(ro[ci.value],ro),Ii(gi,ro,ci.label),Ii(gi,ro,$t),Ii(gi,ro,xn)):Cr(ro[ci.options],!0)}};return Fi(Xt),{options:Xt,valueOptions:Hi,labelOptions:gi}},[Lt,_n,ci,$t,xn])},ir=$i;function Mt(Ke){var Lt=We.useRef();Lt.current=Ke;var _n=We.useCallback(function(){return Lt.current.apply(Lt,arguments)},[]);return _n}function _t(Ke){var Lt=Ke.mode,_n=Ke.options,ci=Ke.children,$t=Ke.backfill,xn=Ke.allowClear,Xt=Ke.placeholder,ri=Ke.getInputElement,Hi=Ke.showSearch,gi=Ke.onSearch,Ii=Ke.defaultOpen,Fi=Ke.autoFocus,Cr=Ke.labelInValue,xr=Ke.value,Sr=Ke.inputValue,hn=Ke.optionLabelProp,ro=isMultiple(Lt),Gr=Hi!==void 0?Hi:ro||Lt==="combobox",So=_n||convertChildrenToData(ci);if(warning(Lt!=="tags"||So.every(function(er){return!er.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Lt==="tags"||Lt==="combobox"){var yn=So.some(function(er){return er.options?er.options.some(function(Pr){return typeof("value"in Pr?Pr.value:Pr.key)=="number"}):typeof("value"in er?er.value:er.key)=="number"});warning(!yn,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Lt!=="combobox"||!hn,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Lt==="combobox"||!$t,"`backfill` only works with `combobox` mode."),warning(Lt==="combobox"||!ri,"`getInputElement` only work with `combobox` mode."),noteOnce(Lt!=="combobox"||!ri||!xn||!Xt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),gi&&!Gr&&Lt!=="combobox"&&Lt!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Ii||Fi,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),xr!=null){var Xn=toArray(xr);warning(!Cr||Xn.every(function(er){return _typeof(er)==="object"&&("key"in er||"value"in er)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!ro||Array.isArray(xr),"`value` should be array when `mode` is `multiple` or `tags`")}if(ci){var rr=null;toNodeArray(ci).some(function(er){if(!React.isValidElement(er)||!er.type)return!1;var Pr=er,Wr=Pr.type;if(Wr.isSelectOption)return!1;if(Wr.isSelectOptGroup){var so=toNodeArray(er.props.children).every(function(vo){return!React.isValidElement(vo)||!er.type||vo.type.isSelectOption?!0:(rr=vo.type,!1)});return!so}return rr=Wr,!0}),rr&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(rr.displayName||rr.name||rr,"`.")),warning(Sr===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function At(Ke,Lt){if(Ke){var _n=function ci($t){for(var xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xt=0;Xt<$t.length;Xt++){var ri=$t[Xt];if(ri[Lt==null?void 0:Lt.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!xn&&Array.isArray(ri[Lt==null?void 0:Lt.options])&&ci(ri[Lt==null?void 0:Lt.options],!0))break}};_n(Ke)}}var xi=null,mi=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],fi=["inputValue"];function wn(Ke){return!Ke||(0,at.Z)(Ke)!=="object"}var Yn=We.forwardRef(function(Ke,Lt){var _n=Ke.id,ci=Ke.mode,$t=Ke.prefixCls,xn=$t===void 0?"rc-select":$t,Xt=Ke.backfill,ri=Ke.fieldNames,Hi=Ke.inputValue,gi=Ke.searchValue,Ii=Ke.onSearch,Fi=Ke.autoClearSearchValue,Cr=Fi===void 0?!0:Fi,xr=Ke.onSelect,Sr=Ke.onDeselect,hn=Ke.dropdownMatchSelectWidth,ro=hn===void 0?!0:hn,Gr=Ke.filterOption,So=Ke.filterSort,yn=Ke.optionFilterProp,Xn=Ke.optionLabelProp,rr=Ke.options,er=Ke.optionRender,Pr=Ke.children,Wr=Ke.defaultActiveFirstOption,so=Ke.menuItemSelectedIcon,vo=Ke.virtual,po=Ke.direction,yo=Ke.listHeight,Nn=yo===void 0?200:yo,ia=Ke.listItemHeight,Tn=ia===void 0?20:ia,Ar=Ke.labelRender,Bo=Ke.value,br=Ke.defaultValue,na=Ke.labelInValue,Do=Ke.onChange,ho=Ke.maxCount,Jo=(0,Oe.Z)(Ke,mi),Vt=(0,gn.ZP)(_n),jn=en(ci),Gt=!!(!rr&&Pr),Ie=We.useMemo(function(){return Gr===void 0&&ci==="combobox"?!1:Gr},[Gr,ci]),ai=We.useMemo(function(){return pn(ri,Gt)},[JSON.stringify(ri),Gt]),hi=(0,Ct.Z)("",{value:gi!==void 0?gi:Hi,postState:function(Po){return Po||""}}),_i=(0,yt.Z)(hi,2),Yi=_i[0],Ti=_i[1],In=ir(rr,Pr,ai,yn,Xn),si=In.valueOptions,yi=In.labelOptions,$n=In.options,pi=We.useCallback(function(Xr){var Po=qt(Xr);return Po.map(function(Yo){var ea,Ea,Hr,Ns,is;if(wn(Yo))ea=Yo;else{var Ut;Hr=Yo.key,Ea=Yo.label,ea=(Ut=Yo.value)!==null&&Ut!==void 0?Ut:Hr}var Zt=si.get(ea);if(Zt){var bn;if(Ea===void 0&&(Ea=Zt==null?void 0:Zt[Xn||ai.label]),Hr===void 0&&(Hr=(bn=Zt==null?void 0:Zt.key)!==null&&bn!==void 0?bn:ea),Ns=Zt==null?void 0:Zt.disabled,is=Zt==null?void 0:Zt.title,0)var zi}return{label:Ea,value:ea,key:Hr,disabled:Ns,title:is}})},[ai,Xn,si]),ur=(0,Ct.Z)(br,{value:Bo}),Ki=(0,yt.Z)(ur,2),Bi=Ki[0],Pn=Ki[1],hr=We.useMemo(function(){var Xr,Po=jn&&Bi===null?[]:Bi,Yo=pi(Po);return ci==="combobox"&&rt((Xr=Yo[0])===null||Xr===void 0?void 0:Xr.value)?[]:Yo},[Bi,pi,ci,jn]),or=Gi(hr,si),xo=(0,yt.Z)(or,2),Yr=xo[0],qo=xo[1],Ko=We.useMemo(function(){if(!ci&&Yr.length===1){var Xr=Yr[0];if(Xr.value===null&&(Xr.label===null||Xr.label===void 0))return[]}return Yr.map(function(Po){var Yo;return(0,St.Z)((0,St.Z)({},Po),{},{label:(Yo=typeof Ar=="function"?Ar(Po):Po.label)!==null&&Yo!==void 0?Yo:Po.value})})},[ci,Yr,Ar]),Qo=We.useMemo(function(){return new Set(Yr.map(function(Xr){return Xr.value}))},[Yr]);We.useEffect(function(){if(ci==="combobox"){var Xr,Po=(Xr=Yr[0])===null||Xr===void 0?void 0:Xr.value;Ti(it(Po)?String(Po):"")}},[Yr]);var ra=Mt(function(Xr,Po){var Yo=Po!=null?Po:Xr;return(0,pt.Z)((0,pt.Z)({},ai.value,Xr),ai.label,Yo)}),Uo=We.useMemo(function(){if(ci!=="tags")return $n;var Xr=(0,Ue.Z)($n),Po=function(ea){return si.has(ea)};return(0,Ue.Z)(Yr).sort(function(Yo,ea){return Yo.value<ea.value?-1:1}).forEach(function(Yo){var ea=Yo.value;Po(ea)||Xr.push(ra(ea,Yo.label))}),Xr},[ra,$n,si,Yr,ci]),wa=be(Uo,ai,Yi,Ie,yn),Wt=We.useMemo(function(){return ci!=="tags"||!Yi||wa.some(function(Xr){return Xr[yn||"value"]===Yi})||wa.some(function(Xr){return Xr[ai.value]===Yi})?wa:[ra(Yi)].concat((0,Ue.Z)(wa))},[ra,yn,ci,wa,Yi,ai]),Ho=function Xr(Po){var Yo=(0,Ue.Z)(Po).sort(function(ea,Ea){return So(ea,Ea,{searchValue:Yi})});return Yo.map(function(ea){return Array.isArray(ea.options)?(0,St.Z)((0,St.Z)({},ea),{},{options:ea.options.length>0?Xr(ea.options):ea.options}):ea})},wr=We.useMemo(function(){return So?Ho(Wt):Wt},[Wt,So,Yi]),no=We.useMemo(function(){return Nt(wr,{fieldNames:ai,childrenAsData:Gt})},[wr,ai,Gt]),bo=function(Po){var Yo=pi(Po);if(Pn(Yo),Do&&(Yo.length!==Yr.length||Yo.some(function(Hr,Ns){var is;return((is=Yr[Ns])===null||is===void 0?void 0:is.value)!==(Hr==null?void 0:Hr.value)}))){var ea=na?Yo:Yo.map(function(Hr){return Hr.value}),Ea=Yo.map(function(Hr){return Dt(qo(Hr.value))});Do(jn?ea:ea[0],jn?Ea:Ea[0])}},oo=We.useState(null),fa=(0,yt.Z)(oo,2),ga=fa[0],Mo=fa[1],Fo=We.useState(0),vs=(0,yt.Z)(Fo,2),es=vs[0],ps=vs[1],ms=Wr!==void 0?Wr:ci!=="combobox",Kr=We.useCallback(function(Xr,Po){var Yo=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ea=Yo.source,Ea=ea===void 0?"keyboard":ea;ps(Po),Xt&&ci==="combobox"&&Xr!==null&&Ea==="keyboard"&&Mo(String(Xr))},[Xt,ci]),Ka=function(Po,Yo,ea){var Ea=function(){var wi,Fn=qo(Po);return[na?{label:Fn==null?void 0:Fn[ai.label],value:Po,key:(wi=Fn==null?void 0:Fn.key)!==null&&wi!==void 0?wi:Po}:Po,Dt(Fn)]};if(Yo&&xr){var Hr=Ea(),Ns=(0,yt.Z)(Hr,2),is=Ns[0],Ut=Ns[1];xr(is,Ut)}else if(!Yo&&Sr&&ea!=="clear"){var Zt=Ea(),bn=(0,yt.Z)(Zt,2),zi=bn[0],Ei=bn[1];Sr(zi,Ei)}},Ba=Mt(function(Xr,Po){var Yo,ea=jn?Po.selected:!0;ea?Yo=jn?[].concat((0,Ue.Z)(Yr),[Xr]):[Xr]:Yo=Yr.filter(function(Ea){return Ea.value!==Xr}),bo(Yo),Ka(Xr,ea),ci==="combobox"?Mo(""):(!en||Cr)&&(Ti(""),Mo(""))}),ss=function(Po,Yo){bo(Po);var ea=Yo.type,Ea=Yo.values;(ea==="remove"||ea==="clear")&&Ea.forEach(function(Hr){Ka(Hr.value,!1,ea)})},Ya=function(Po,Yo){if(Ti(Po),Mo(null),Yo.source==="submit"){var ea=(Po||"").trim();if(ea){var Ea=Array.from(new Set([].concat((0,Ue.Z)(Qo),[ea])));bo(Ea),Ka(ea,!0),Ti("")}return}Yo.source!=="blur"&&(ci==="combobox"&&bo(Po),Ii==null||Ii(Po))},ls=function(Po){var Yo=Po;ci!=="tags"&&(Yo=Po.map(function(Ea){var Hr=yi.get(Ea);return Hr==null?void 0:Hr.value}).filter(function(Ea){return Ea!==void 0}));var ea=Array.from(new Set([].concat((0,Ue.Z)(Qo),(0,Ue.Z)(Yo))));bo(ea),ea.forEach(function(Ea){Ka(Ea,!0)})},Zi=We.useMemo(function(){var Xr=vo!==!1&&ro!==!1;return(0,St.Z)((0,St.Z)({},In),{},{flattenOptions:no,onActiveValue:Kr,defaultActiveFirstOption:ms,onSelect:Ba,menuItemSelectedIcon:so,rawValues:Qo,fieldNames:ai,virtual:Xr,direction:po,listHeight:Nn,listItemHeight:Tn,childrenAsData:Gt,maxCount:ho,optionRender:er})},[ho,In,no,Kr,ms,Ba,so,Qo,ai,vo,ro,po,Nn,Tn,Gt,er]);return We.createElement(Sn.Provider,{value:Zi},We.createElement(ln,(0,le.Z)({},Jo,{id:Vt,prefixCls:xn,ref:Lt,omitDomProps:fi,mode:ci,displayValues:Ko,onDisplayValuesChange:ss,direction:po,searchValue:Yi,onSearch:Ya,autoClearSearchValue:Cr,onSearchSplit:ls,dropdownMatchSelectWidth:ro,OptionList:ji,emptyOptions:!no.length,activeValue:ga,activeDescendantId:"".concat(Vt,"_list_").concat(es)})))}),Qi=Yn;Qi.Option=ii,Qi.OptGroup=cn;var vr=Qi,Dr=vr},63158:function(Zn,ei,Le){"use strict";var le=Le(71409),Ue=Le(87075),pt=Le(11036),St=Le(39224),yt=Le(59301),Oe=Le(92310),at=Le.n(Oe),Ct=Le(18929),ot=Le(10228),We=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Tt=yt.forwardRef(function(dt,kt){var De,ne=dt.prefixCls,te=ne===void 0?"rc-switch":ne,de=dt.className,se=dt.checked,pe=dt.defaultChecked,ye=dt.disabled,we=dt.loadingIcon,Ce=dt.checkedChildren,_e=dt.unCheckedChildren,Ze=dt.onClick,st=dt.onChange,nt=dt.onKeyDown,Ye=(0,St.Z)(dt,We),ct=(0,Ct.Z)(!1,{value:se,defaultValue:pe}),$e=(0,pt.Z)(ct,2),Et=$e[0],Pt=$e[1];function Bt(tn,it){var rt=Et;return ye||(rt=tn,Pt(rt),st==null||st(rt,it)),rt}function fn(tn){tn.which===ot.Z.LEFT?Bt(!1,tn):tn.which===ot.Z.RIGHT&&Bt(!0,tn),nt==null||nt(tn)}function qt(tn){var it=Bt(!Et,tn);Ze==null||Ze(it,tn)}var vn=at()(te,de,(De={},(0,Ue.Z)(De,"".concat(te,"-checked"),Et),(0,Ue.Z)(De,"".concat(te,"-disabled"),ye),De));return yt.createElement("button",(0,le.Z)({},Ye,{type:"button",role:"switch","aria-checked":Et,disabled:ye,className:vn,ref:kt,onKeyDown:fn,onClick:qt}),we,yt.createElement("span",{className:"".concat(te,"-inner")},yt.createElement("span",{className:"".concat(te,"-inner-checked")},Ce),yt.createElement("span",{className:"".concat(te,"-inner-unchecked")},_e)))});Tt.displayName="Switch",ei.Z=Tt},86351:function(Zn,ei,Le){"use strict";Le.d(ei,{R:function(){return Ue},w:function(){return le}});var le={},Ue="rc-table-internal-hook"},97347:function(Zn,ei,Le){"use strict";Le.d(ei,{L:function(){return te},Z:function(){return we}});var le=Le(11036),Ue=Le(87075),pt=Le(62730),St=Le(28788),yt=Le(89490),Oe=Le(39224),at=Le(11592),Ct=Le(48736),ot=Le(59301),We=Le(86351),Tt=Le(54451);function dt(Ce){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof _e=="number"?_e:_e.endsWith("%")?Ce*parseFloat(_e)/100:null}function kt(Ce,_e,Ze){return ot.useMemo(function(){if(_e&&_e>0){var st=0,nt=0;Ce.forEach(function(qt){var vn=dt(_e,qt.width);vn?st+=vn:nt+=1});var Ye=Math.max(_e,Ze),ct=Math.max(Ye-st,nt),$e=nt,Et=ct/nt,Pt=0,Bt=Ce.map(function(qt){var vn=(0,yt.Z)({},qt),tn=dt(_e,vn.width);if(tn)vn.width=tn;else{var it=Math.floor(Et);vn.width=$e===1?ct:it,ct-=it,$e-=1}return Pt+=vn.width,vn});if(Pt<Ye){var fn=Ye/Pt;ct=Ye,Bt.forEach(function(qt,vn){var tn=Math.floor(qt.width*fn);qt.width=vn===Bt.length-1?ct:tn,ct-=tn})}return[Bt,Math.max(Pt,Ye)]}return[Ce,_e]},[Ce,_e,Ze])}var De=["children"],ne=["fixed"];function te(Ce){return(0,at.Z)(Ce).filter(function(_e){return ot.isValidElement(_e)}).map(function(_e){var Ze=_e.key,st=_e.props,nt=st.children,Ye=(0,Oe.Z)(st,De),ct=(0,yt.Z)({key:Ze},Ye);return nt&&(ct.children=te(nt)),ct})}function de(Ce){return Ce.filter(function(_e){return _e&&(0,St.Z)(_e)==="object"&&!_e.hidden}).map(function(_e){var Ze=_e.children;return Ze&&Ze.length>0?(0,yt.Z)((0,yt.Z)({},_e),{},{children:de(Ze)}):_e})}function se(Ce){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return Ce.filter(function(Ze){return Ze&&(0,St.Z)(Ze)==="object"}).reduce(function(Ze,st,nt){var Ye=st.fixed,ct=Ye===!0?"left":Ye,$e="".concat(_e,"-").concat(nt),Et=st.children;return Et&&Et.length>0?[].concat((0,pt.Z)(Ze),(0,pt.Z)(se(Et,$e).map(function(Pt){return(0,yt.Z)({fixed:ct},Pt)}))):[].concat((0,pt.Z)(Ze),[(0,yt.Z)((0,yt.Z)({key:$e},st),{},{fixed:ct})])},[])}function pe(Ce){return Ce.map(function(_e){var Ze=_e.fixed,st=(0,Oe.Z)(_e,ne),nt=Ze;return Ze==="left"?nt="right":Ze==="right"&&(nt="left"),(0,yt.Z)({fixed:nt},st)})}function ye(Ce,_e){var Ze=Ce.prefixCls,st=Ce.columns,nt=Ce.children,Ye=Ce.expandable,ct=Ce.expandedKeys,$e=Ce.columnTitle,Et=Ce.getRowKey,Pt=Ce.onTriggerExpand,Bt=Ce.expandIcon,fn=Ce.rowExpandable,qt=Ce.expandIconColumnIndex,vn=Ce.direction,tn=Ce.expandRowByClick,it=Ce.columnWidth,rt=Ce.fixed,dn=Ce.scrollWidth,ni=Ce.clientWidth,Kn=ot.useMemo(function(){var Oi=st||te(nt)||[];return de(Oi.slice())},[st,nt]),Rt=ot.useMemo(function(){if(Ye){var Oi=Kn.slice();if(!Oi.includes(We.w)){var ze=qt||0;ze>=0&&(ze||rt==="left"||!rt)&&Oi.splice(ze,0,We.w),rt==="right"&&Oi.splice(Kn.length,0,We.w)}var Me=Oi.indexOf(We.w);Oi=Oi.filter(function(Ae,et){return Ae!==We.w||et===Me});var Ee=Kn[Me],Te;rt?Te=rt:Te=Ee?Ee.fixed:null;var He=(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)({},Tt.v,{className:"".concat(Ze,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",$e),"fixed",Te),"className","".concat(Ze,"-row-expand-icon-cell")),"width",it),"render",function(et,on,Kt){var pn=Et(on,Kt),Nt=ct.has(pn),Dt=fn?fn(on):!0,Ot=Bt({prefixCls:Ze,expanded:Nt,expandable:Dt,record:on,onExpand:Pt});return tn?ot.createElement("span",{onClick:function(Sn){return Sn.stopPropagation()}},Ot):Ot});return Oi.map(function(Ae){return Ae===We.w?He:Ae})}return Kn.filter(function(Ae){return Ae!==We.w})},[Ye,Kn,Et,ct,Bt,vn]),En=ot.useMemo(function(){var Oi=Rt;return _e&&(Oi=_e(Oi)),Oi.length||(Oi=[{render:function(){return null}}]),Oi},[_e,Rt,vn]),Bn=ot.useMemo(function(){return vn==="rtl"?pe(se(En)):se(En)},[En,vn,dn]),ui=ot.useMemo(function(){for(var Oi=-1,ze=Bn.length-1;ze>=0;ze-=1){var Me=Bn[ze].fixed;if(Me==="left"||Me===!0){Oi=ze;break}}if(Oi>=0)for(var Ee=0;Ee<=Oi;Ee+=1){var Te=Bn[Ee].fixed;if(Te!=="left"&&Te!==!0)return!0}var He=Bn.findIndex(function(on){var Kt=on.fixed;return Kt==="right"});if(He>=0)for(var Ae=He;Ae<Bn.length;Ae+=1){var et=Bn[Ae].fixed;if(et!=="right")return!0}return!1},[Bn]),It=kt(Bn,dn,ni),On=(0,le.Z)(It,2),ht=On[0],kn=On[1];return[En,ht,kn,ui]}var we=ye},4030:function(Zn,ei,Le){"use strict";Le.d(ei,{w2:function(){return le.w},vP:function(){return Rn.v},RQ:function(){return le.R},ER:function(){return pn},Q$:function(){return Gr},TN:function(){return Do}});var le=Le(86351),Ue=Le(11036),pt=Le(6089),St=Le(34280),yt=Le(13697),Oe=Le(59301),at=Le(4676);function Ct(Vt){var jn=Oe.createContext(void 0),Gt=function(ai){var hi=ai.value,_i=ai.children,Yi=Oe.useRef(hi);Yi.current=hi;var Ti=Oe.useState(function(){return{getValue:function(){return Yi.current},listeners:new Set}}),In=(0,Ue.Z)(Ti,1),si=In[0];return(0,St.Z)(function(){(0,at.unstable_batchedUpdates)(function(){si.listeners.forEach(function(yi){yi(hi)})})},[hi]),Oe.createElement(jn.Provider,{value:si},_i)};return{Context:jn,Provider:Gt,defaultValue:Vt}}function ot(Vt,jn){var Gt=(0,pt.Z)(typeof jn=="function"?jn:function(yi){if(jn===void 0)return yi;if(!Array.isArray(jn))return yi[jn];var $n={};return jn.forEach(function(pi){$n[pi]=yi[pi]}),$n}),Ie=Oe.useContext(Vt==null?void 0:Vt.Context),ai=Ie||{},hi=ai.listeners,_i=ai.getValue,Yi=Oe.useRef();Yi.current=Gt(Ie?_i():Vt==null?void 0:Vt.defaultValue);var Ti=Oe.useState({}),In=(0,Ue.Z)(Ti,2),si=In[1];return(0,St.Z)(function(){if(!Ie)return;function yi($n){var pi=Gt($n);(0,yt.Z)(Yi.current,pi,!0)||si({})}return hi.add(yi),function(){hi.delete(yi)}},[Ie]),Yi.current}var We=Le(71409),Tt=Le(8654);function dt(){var Vt=Oe.createContext(null);function jn(){return Oe.useContext(Vt)}function Gt(ai,hi){var _i=(0,Tt.Yr)(ai),Yi=function(In,si){var yi=_i?{ref:si}:{},$n=Oe.useRef(0),pi=Oe.useRef(In),ur=jn();return ur!==null?Oe.createElement(ai,(0,We.Z)({},In,yi)):((!hi||hi(pi.current,In))&&($n.current+=1),pi.current=In,Oe.createElement(Vt.Provider,{value:$n.current},Oe.createElement(ai,(0,We.Z)({},In,yi))))};return _i?Oe.forwardRef(Yi):Yi}function Ie(ai,hi){var _i=(0,Tt.Yr)(ai),Yi=function(In,si){var yi=_i?{ref:si}:{};return jn(),Oe.createElement(ai,(0,We.Z)({},In,yi))};return _i?Oe.memo(Oe.forwardRef(Yi),hi):Oe.memo(Yi,hi)}return{makeImmutable:Gt,responseImmutable:Ie,useImmutableMark:jn}}var kt=dt(),De=kt.makeImmutable,ne=kt.responseImmutable,te=kt.useImmutableMark,de=dt(),se=de.makeImmutable,pe=de.responseImmutable,ye=de.useImmutableMark,we=Ct(),Ce=we;function _e(Vt,jn){var Gt=React.useRef(0);Gt.current+=1;var Ie=React.useRef(Vt),ai=[];Object.keys(Vt||{}).map(function(_i){var Yi;(Vt==null?void 0:Vt[_i])!==((Yi=Ie.current)===null||Yi===void 0?void 0:Yi[_i])&&ai.push(_i)}),Ie.current=Vt;var hi=React.useRef([]);return ai.length&&(hi.current=ai),React.useDebugValue(Gt.current),React.useDebugValue(hi.current.join(", ")),jn&&console.log("".concat(jn,":"),Gt.current,hi.current),Gt.current}var Ze=null,st=null,nt=Le(28788),Ye=Le(89490),ct=Le(87075),$e=Le(92310),Et=Le.n($e),Pt=Le(80547),Bt=Le(97938),fn=Le(48736),qt=Oe.createContext({renderWithProps:!1}),vn=qt,tn="RC_TABLE_KEY";function it(Vt){return Vt==null?[]:Array.isArray(Vt)?Vt:[Vt]}function rt(Vt){var jn=[],Gt={};return Vt.forEach(function(Ie){for(var ai=Ie||{},hi=ai.key,_i=ai.dataIndex,Yi=hi||it(_i).join("-")||tn;Gt[Yi];)Yi="".concat(Yi,"_next");Gt[Yi]=!0,jn.push(Yi)}),jn}function dn(Vt){return Vt!=null}function ni(Vt){return typeof Vt=="number"&&!Number.isNaN(Vt)}function Kn(Vt){return Vt&&(0,nt.Z)(Vt)==="object"&&!Array.isArray(Vt)&&!Oe.isValidElement(Vt)}function Rt(Vt,jn,Gt,Ie,ai,hi){var _i=Oe.useContext(vn),Yi=ye(),Ti=(0,Pt.Z)(function(){if(dn(Ie))return[Ie];var In=jn==null||jn===""?[]:Array.isArray(jn)?jn:[jn],si=(0,Bt.Z)(Vt,In),yi=si,$n=void 0;if(ai){var pi=ai(si,Vt,Gt);Kn(pi)?(yi=pi.children,$n=pi.props,_i.renderWithProps=!0):yi=pi}return[yi,$n]},[Yi,Vt,Ie,jn,ai,Gt],function(In,si){if(hi){var yi=(0,Ue.Z)(In,2),$n=yi[1],pi=(0,Ue.Z)(si,2),ur=pi[1];return hi(ur,$n)}return _i.renderWithProps?!0:!(0,yt.Z)(In,si,!0)});return Ti}function En(Vt,jn,Gt,Ie){var ai=Vt+jn-1;return Vt<=Ie&&ai>=Gt}function Bn(Vt,jn){return ot(Ce,function(Gt){var Ie=En(Vt,jn||1,Gt.hoverStartRow,Gt.hoverEndRow);return[Ie,Gt.onHover]})}var ui=Le(70425),It=function(jn){var Gt=jn.ellipsis,Ie=jn.rowType,ai=jn.children,hi,_i=Gt===!0?{showTitle:!0}:Gt;return _i&&(_i.showTitle||Ie==="header")&&(typeof ai=="string"||typeof ai=="number"?hi=ai.toString():Oe.isValidElement(ai)&&typeof ai.props.children=="string"&&(hi=ai.props.children)),hi};function On(Vt){var jn,Gt,Ie,ai,hi,_i,Yi,Ti,In=Vt.component,si=Vt.children,yi=Vt.ellipsis,$n=Vt.scope,pi=Vt.prefixCls,ur=Vt.className,Ki=Vt.align,Bi=Vt.record,Pn=Vt.render,hr=Vt.dataIndex,or=Vt.renderIndex,xo=Vt.shouldCellUpdate,Yr=Vt.index,qo=Vt.rowType,Ko=Vt.colSpan,Qo=Vt.rowSpan,ra=Vt.fixLeft,Uo=Vt.fixRight,wa=Vt.firstFixLeft,Wt=Vt.lastFixLeft,Ho=Vt.firstFixRight,wr=Vt.lastFixRight,no=Vt.appendNode,bo=Vt.additionalProps,oo=bo===void 0?{}:bo,fa=Vt.isSticky,ga="".concat(pi,"-cell"),Mo=ot(Ce,["supportSticky","allColumnsFixedLeft","rowHoverable"]),Fo=Mo.supportSticky,vs=Mo.allColumnsFixedLeft,es=Mo.rowHoverable,ps=Rt(Bi,hr,or,si,Pn,xo),ms=(0,Ue.Z)(ps,2),Kr=ms[0],Ka=ms[1],Ba={},ss=typeof ra=="number"&&Fo,Ya=typeof Uo=="number"&&Fo;ss&&(Ba.position="sticky",Ba.left=ra),Ya&&(Ba.position="sticky",Ba.right=Uo);var ls=(jn=(Gt=(Ie=Ka==null?void 0:Ka.colSpan)!==null&&Ie!==void 0?Ie:oo.colSpan)!==null&&Gt!==void 0?Gt:Ko)!==null&&jn!==void 0?jn:1,Zi=(ai=(hi=(_i=Ka==null?void 0:Ka.rowSpan)!==null&&_i!==void 0?_i:oo.rowSpan)!==null&&hi!==void 0?hi:Qo)!==null&&ai!==void 0?ai:1,Xr=Bn(Yr,Zi),Po=(0,Ue.Z)(Xr,2),Yo=Po[0],ea=Po[1],Ea=(0,ui.zX)(function(zi){var Ei;Bi&&ea(Yr,Yr+Zi-1),oo==null||(Ei=oo.onMouseEnter)===null||Ei===void 0||Ei.call(oo,zi)}),Hr=(0,ui.zX)(function(zi){var Ei;Bi&&ea(-1,-1),oo==null||(Ei=oo.onMouseLeave)===null||Ei===void 0||Ei.call(oo,zi)});if(ls===0||Zi===0)return null;var Ns=(Yi=oo.title)!==null&&Yi!==void 0?Yi:It({rowType:qo,ellipsis:yi,children:Kr}),is=Et()(ga,ur,(Ti={},(0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)(Ti,"".concat(ga,"-fix-left"),ss&&Fo),"".concat(ga,"-fix-left-first"),wa&&Fo),"".concat(ga,"-fix-left-last"),Wt&&Fo),"".concat(ga,"-fix-left-all"),Wt&&vs&&Fo),"".concat(ga,"-fix-right"),Ya&&Fo),"".concat(ga,"-fix-right-first"),Ho&&Fo),"".concat(ga,"-fix-right-last"),wr&&Fo),"".concat(ga,"-ellipsis"),yi),"".concat(ga,"-with-append"),no),"".concat(ga,"-fix-sticky"),(ss||Ya)&&fa&&Fo),(0,ct.Z)(Ti,"".concat(ga,"-row-hover"),!Ka&&Yo)),oo.className,Ka==null?void 0:Ka.className),Ut={};Ki&&(Ut.textAlign=Ki);var Zt=(0,Ye.Z)((0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({},Ka==null?void 0:Ka.style),Ba),Ut),oo.style),bn=Kr;return(0,nt.Z)(bn)==="object"&&!Array.isArray(bn)&&!Oe.isValidElement(bn)&&(bn=null),yi&&(Wt||Ho)&&(bn=Oe.createElement("span",{className:"".concat(ga,"-content")},bn)),Oe.createElement(In,(0,We.Z)({},Ka,oo,{className:is,style:Zt,title:Ns,scope:$n,onMouseEnter:es?Ea:void 0,onMouseLeave:es?Hr:void 0,colSpan:ls!==1?ls:null,rowSpan:Zi!==1?Zi:null}),no,bn)}var ht=Oe.memo(On);function kn(Vt,jn,Gt,Ie,ai){var hi=Gt[Vt]||{},_i=Gt[jn]||{},Yi,Ti;hi.fixed==="left"?Yi=Ie.left[ai==="rtl"?jn:Vt]:_i.fixed==="right"&&(Ti=Ie.right[ai==="rtl"?Vt:jn]);var In=!1,si=!1,yi=!1,$n=!1,pi=Gt[jn+1],ur=Gt[Vt-1],Ki=pi&&!pi.fixed||ur&&!ur.fixed||Gt.every(function(xo){return xo.fixed==="left"});if(ai==="rtl"){if(Yi!==void 0){var Bi=ur&&ur.fixed==="left";$n=!Bi&&Ki}else if(Ti!==void 0){var Pn=pi&&pi.fixed==="right";yi=!Pn&&Ki}}else if(Yi!==void 0){var hr=pi&&pi.fixed==="left";In=!hr&&Ki}else if(Ti!==void 0){var or=ur&&ur.fixed==="right";si=!or&&Ki}return{fixLeft:Yi,fixRight:Ti,lastFixLeft:In,firstFixRight:si,lastFixRight:yi,firstFixLeft:$n,isSticky:Ie.isSticky}}var Oi=Oe.createContext({}),ze=Oi;function Me(Vt){var jn=Vt.className,Gt=Vt.index,Ie=Vt.children,ai=Vt.colSpan,hi=ai===void 0?1:ai,_i=Vt.rowSpan,Yi=Vt.align,Ti=ot(Ce,["prefixCls","direction"]),In=Ti.prefixCls,si=Ti.direction,yi=Oe.useContext(ze),$n=yi.scrollColumnIndex,pi=yi.stickyOffsets,ur=yi.flattenColumns,Ki=Gt+hi-1,Bi=Ki+1===$n?hi+1:hi,Pn=kn(Gt,Gt+Bi-1,ur,pi,si);return Oe.createElement(ht,(0,We.Z)({className:jn,index:Gt,component:"td",prefixCls:In,record:null,dataIndex:null,align:Yi,colSpan:Bi,rowSpan:_i,render:function(){return Ie}},Pn))}var Ee=Le(39224),Te=["children"];function He(Vt){var jn=Vt.children,Gt=(0,Ee.Z)(Vt,Te);return Oe.createElement("tr",Gt,jn)}function Ae(Vt){var jn=Vt.children;return jn}Ae.Row=He,Ae.Cell=Me;var et=Ae;function on(Vt){var jn=Vt.children,Gt=Vt.stickyOffsets,Ie=Vt.flattenColumns,ai=ot(Ce,"prefixCls"),hi=Ie.length-1,_i=Ie[hi],Yi=Oe.useMemo(function(){return{stickyOffsets:Gt,flattenColumns:Ie,scrollColumnIndex:_i!=null&&_i.scrollbar?hi:null}},[_i,Ie,hi,Gt]);return Oe.createElement(ze.Provider,{value:Yi},Oe.createElement("tfoot",{className:"".concat(ai,"-summary")},jn))}var Kt=pe(on),pn=et,Nt=Le(29301),Dt=Le(24514),Ot=Le(75152),un=Le(26112);function Sn(Vt,jn,Gt,Ie,ai,hi,_i){Vt.push({record:jn,indent:Gt,index:_i});var Yi=hi(jn),Ti=ai==null?void 0:ai.has(Yi);if(jn&&Array.isArray(jn[Ie])&&Ti)for(var In=0;In<jn[Ie].length;In+=1)Sn(Vt,jn[Ie][In],Gt+1,Ie,ai,hi,In)}function An(Vt,jn,Gt,Ie){var ai=Oe.useMemo(function(){if(Gt!=null&&Gt.size){for(var hi=[],_i=0;_i<(Vt==null?void 0:Vt.length);_i+=1){var Yi=Vt[_i];Sn(hi,Yi,0,jn,Gt,Ie,_i)}return hi}return Vt==null?void 0:Vt.map(function(Ti,In){return{record:Ti,indent:0,index:In}})},[Vt,jn,Gt,Ie]);return ai}function Dn(Vt,jn,Gt,Ie){var ai=ot(Ce,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),hi=ai.flattenColumns,_i=ai.expandableType,Yi=ai.expandedKeys,Ti=ai.childrenColumnName,In=ai.onTriggerExpand,si=ai.rowExpandable,yi=ai.onRow,$n=ai.expandRowByClick,pi=ai.rowClassName,ur=_i==="nest",Ki=_i==="row"&&(!si||si(Vt)),Bi=Ki||ur,Pn=Yi&&Yi.has(jn),hr=Ti&&Vt&&Vt[Ti],or=(0,ui.zX)(In),xo=yi==null?void 0:yi(Vt,Gt),Yr=xo==null?void 0:xo.onClick,qo=function(Uo){$n&&Bi&&In(Vt,Uo);for(var wa=arguments.length,Wt=new Array(wa>1?wa-1:0),Ho=1;Ho<wa;Ho++)Wt[Ho-1]=arguments[Ho];Yr==null||Yr.apply(void 0,[Uo].concat(Wt))},Ko;typeof pi=="string"?Ko=pi:typeof pi=="function"&&(Ko=pi(Vt,Gt,Ie));var Qo=rt(hi);return(0,Ye.Z)((0,Ye.Z)({},ai),{},{columnsKey:Qo,nestExpandable:ur,expanded:Pn,hasNestChildren:hr,record:Vt,onTriggerExpand:or,rowSupportExpand:Ki,expandable:Bi,rowProps:(0,Ye.Z)((0,Ye.Z)({},xo),{},{className:Et()(Ko,xo==null?void 0:xo.className),onClick:qo})})}function Ai(Vt){var jn=Vt.prefixCls,Gt=Vt.children,Ie=Vt.component,ai=Vt.cellComponent,hi=Vt.className,_i=Vt.expanded,Yi=Vt.colSpan,Ti=Vt.isEmpty,In=ot(Ce,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),si=In.scrollbarSize,yi=In.fixHeader,$n=In.fixColumn,pi=In.componentWidth,ur=In.horizonScroll,Ki=Gt;return(Ti?ur&&pi:$n)&&(Ki=Oe.createElement("div",{style:{width:pi-(yi&&!Ti?si:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(jn,"-expanded-row-fixed")},Ki)),Oe.createElement(Ie,{className:hi,style:{display:_i?null:"none"}},Oe.createElement(ht,{component:ai,prefixCls:jn,colSpan:Yi},Ki))}var en=Ai;function Qt(Vt){var jn=Vt.prefixCls,Gt=Vt.record,Ie=Vt.onExpand,ai=Vt.expanded,hi=Vt.expandable,_i="".concat(jn,"-row-expand-icon");if(!hi)return Oe.createElement("span",{className:Et()(_i,"".concat(jn,"-row-spaced"))});var Yi=function(In){Ie(Gt,In),In.stopPropagation()};return Oe.createElement("span",{className:Et()(_i,(0,ct.Z)((0,ct.Z)({},"".concat(jn,"-row-expanded"),ai),"".concat(jn,"-row-collapsed"),!ai)),onClick:Yi})}function ln(Vt,jn,Gt){var Ie=[];function ai(hi){(hi||[]).forEach(function(_i,Yi){Ie.push(jn(_i,Yi)),ai(_i[Gt])})}return ai(Vt),Ie}function di(Vt,jn,Gt,Ie){return typeof Vt=="string"?Vt:typeof Vt=="function"?Vt(jn,Gt,Ie):""}function cn(Vt,jn,Gt,Ie,ai){var hi=Vt.record,_i=Vt.prefixCls,Yi=Vt.columnsKey,Ti=Vt.fixedInfoList,In=Vt.expandIconColumnIndex,si=Vt.nestExpandable,yi=Vt.indentSize,$n=Vt.expandIcon,pi=Vt.expanded,ur=Vt.hasNestChildren,Ki=Vt.onTriggerExpand,Bi=Yi[Gt],Pn=Ti[Gt],hr;Gt===(In||0)&&si&&(hr=Oe.createElement(Oe.Fragment,null,Oe.createElement("span",{style:{paddingLeft:"".concat(yi*Ie,"px")},className:"".concat(_i,"-row-indent indent-level-").concat(Ie)}),$n({prefixCls:_i,expanded:pi,expandable:ur,record:hi,onExpand:Ki})));var or;return jn.onCell&&(or=jn.onCell(hi,ai)),{key:Bi,fixedInfo:Pn,appendCellNode:hr,additionalCellProps:or||{}}}function Yt(Vt){var jn=Vt.className,Gt=Vt.style,Ie=Vt.record,ai=Vt.index,hi=Vt.renderIndex,_i=Vt.rowKey,Yi=Vt.indent,Ti=Yi===void 0?0:Yi,In=Vt.rowComponent,si=Vt.cellComponent,yi=Vt.scopeCellComponent,$n=Dn(Ie,_i,ai,Ti),pi=$n.prefixCls,ur=$n.flattenColumns,Ki=$n.expandedRowClassName,Bi=$n.expandedRowRender,Pn=$n.rowProps,hr=$n.expanded,or=$n.rowSupportExpand,xo=Oe.useRef(!1);xo.current||(xo.current=hr);var Yr=di(Ki,Ie,ai,Ti),qo=Oe.createElement(In,(0,We.Z)({},Pn,{"data-row-key":_i,className:Et()(jn,"".concat(pi,"-row"),"".concat(pi,"-row-level-").concat(Ti),Pn==null?void 0:Pn.className,(0,ct.Z)({},Yr,Ti>=1)),style:(0,Ye.Z)((0,Ye.Z)({},Gt),Pn==null?void 0:Pn.style)}),ur.map(function(ra,Uo){var wa=ra.render,Wt=ra.dataIndex,Ho=ra.className,wr=cn($n,ra,Uo,Ti,ai),no=wr.key,bo=wr.fixedInfo,oo=wr.appendCellNode,fa=wr.additionalCellProps;return Oe.createElement(ht,(0,We.Z)({className:Ho,ellipsis:ra.ellipsis,align:ra.align,scope:ra.rowScope,component:ra.rowScope?yi:si,prefixCls:pi,key:no,record:Ie,index:ai,renderIndex:hi,dataIndex:Wt,render:wa,shouldCellUpdate:ra.shouldCellUpdate},bo,{appendNode:oo,additionalProps:fa}))})),Ko;if(or&&(xo.current||hr)){var Qo=Bi(Ie,ai,Ti+1,hr);Ko=Oe.createElement(en,{expanded:hr,className:Et()("".concat(pi,"-expanded-row"),"".concat(pi,"-expanded-row-level-").concat(Ti+1),Yr),prefixCls:pi,component:In,cellComponent:si,colSpan:ur.length,isEmpty:!1},Qo)}return Oe.createElement(Oe.Fragment,null,qo,Ko)}var ii=pe(Yt);function Vi(Vt){var jn=Vt.columnKey,Gt=Vt.onColumnResize,Ie=Oe.useRef();return(0,St.Z)(function(){Ie.current&&Gt(jn,Ie.current.offsetWidth)},[]),Oe.createElement(Nt.Z,{data:jn},Oe.createElement("td",{ref:Ie,style:{padding:0,border:0,height:0}},Oe.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}var bi=Le(29194);function Di(Vt){var jn=Vt.prefixCls,Gt=Vt.columnsKey,Ie=Vt.onColumnResize,ai=Oe.useRef(null);return Oe.createElement("tr",{"aria-hidden":"true",className:"".concat(jn,"-measure-row"),style:{height:0,fontSize:0},ref:ai},Oe.createElement(Nt.Z.Collection,{onBatchResize:function(_i){(0,bi.Z)(ai.current)&&_i.forEach(function(Yi){var Ti=Yi.data,In=Yi.size;Ie(Ti,In.offsetWidth)})}},Gt.map(function(hi){return Oe.createElement(Vi,{key:hi,columnKey:hi,onColumnResize:Ie})})))}function Mr(Vt){var jn=Vt.data,Gt=Vt.measureColumnWidth,Ie=ot(Ce,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),ai=Ie.prefixCls,hi=Ie.getComponent,_i=Ie.onColumnResize,Yi=Ie.flattenColumns,Ti=Ie.getRowKey,In=Ie.expandedKeys,si=Ie.childrenColumnName,yi=Ie.emptyNode,$n=An(jn,si,In,Ti),pi=Oe.useRef({renderWithProps:!1}),ur=hi(["body","wrapper"],"tbody"),Ki=hi(["body","row"],"tr"),Bi=hi(["body","cell"],"td"),Pn=hi(["body","cell"],"th"),hr;jn.length?hr=$n.map(function(xo,Yr){var qo=xo.record,Ko=xo.indent,Qo=xo.index,ra=Ti(qo,Yr);return Oe.createElement(ii,{key:ra,rowKey:ra,record:qo,index:Yr,renderIndex:Qo,rowComponent:Ki,cellComponent:Bi,scopeCellComponent:Pn,indent:Ko})}):hr=Oe.createElement(en,{expanded:!0,className:"".concat(ai,"-placeholder"),prefixCls:ai,component:Ki,cellComponent:Bi,colSpan:Yi.length,isEmpty:!0},yi);var or=rt(Yi);return Oe.createElement(vn.Provider,{value:pi.current},Oe.createElement(ur,{className:"".concat(ai,"-tbody")},Gt&&Oe.createElement(Di,{prefixCls:ai,columnsKey:or,onColumnResize:_i}),hr))}var Gn=pe(Mr),Rn=Le(54451),Jn=["columnType"];function Ni(Vt){for(var jn=Vt.colWidths,Gt=Vt.columns,Ie=Vt.columCount,ai=ot(Ce,["tableLayout"]),hi=ai.tableLayout,_i=[],Yi=Ie||Gt.length,Ti=!1,In=Yi-1;In>=0;In-=1){var si=jn[In],yi=Gt&&Gt[In],$n=void 0,pi=void 0;if(yi&&($n=yi[Rn.v],hi==="auto"&&(pi=yi.minWidth)),si||pi||$n||Ti){var ur=$n||{},Ki=ur.columnType,Bi=(0,Ee.Z)(ur,Jn);_i.unshift(Oe.createElement("col",(0,We.Z)({key:In,style:{width:si,minWidth:pi}},Bi))),Ti=!0}}return Oe.createElement("colgroup",null,_i)}var ji=Ni,Gi=Le(62730),Fr=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function be(Vt,jn){return(0,Oe.useMemo)(function(){for(var Gt=[],Ie=0;Ie<jn;Ie+=1){var ai=Vt[Ie];if(ai!==void 0)Gt[Ie]=ai;else return null}return Gt},[Vt.join("_"),jn])}var gn=Oe.forwardRef(function(Vt,jn){var Gt=Vt.className,Ie=Vt.noData,ai=Vt.columns,hi=Vt.flattenColumns,_i=Vt.colWidths,Yi=Vt.columCount,Ti=Vt.stickyOffsets,In=Vt.direction,si=Vt.fixHeader,yi=Vt.stickyTopOffset,$n=Vt.stickyBottomOffset,pi=Vt.stickyClassName,ur=Vt.onScroll,Ki=Vt.maxContentScroll,Bi=Vt.children,Pn=(0,Ee.Z)(Vt,Fr),hr=ot(Ce,["prefixCls","scrollbarSize","isSticky","getComponent"]),or=hr.prefixCls,xo=hr.scrollbarSize,Yr=hr.isSticky,qo=hr.getComponent,Ko=qo(["header","table"],"table"),Qo=Yr&&!si?0:xo,ra=Oe.useRef(null),Uo=Oe.useCallback(function(fa){(0,Tt.mH)(jn,fa),(0,Tt.mH)(ra,fa)},[]);Oe.useEffect(function(){var fa;function ga(Mo){var Fo=Mo,vs=Fo.currentTarget,es=Fo.deltaX;es&&(ur({currentTarget:vs,scrollLeft:vs.scrollLeft+es}),Mo.preventDefault())}return(fa=ra.current)===null||fa===void 0||fa.addEventListener("wheel",ga,{passive:!1}),function(){var Mo;(Mo=ra.current)===null||Mo===void 0||Mo.removeEventListener("wheel",ga)}},[]);var wa=Oe.useMemo(function(){return hi.every(function(fa){return fa.width})},[hi]),Wt=hi[hi.length-1],Ho={fixed:Wt?Wt.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(or,"-cell-scrollbar")}}},wr=(0,Oe.useMemo)(function(){return Qo?[].concat((0,Gi.Z)(ai),[Ho]):ai},[Qo,ai]),no=(0,Oe.useMemo)(function(){return Qo?[].concat((0,Gi.Z)(hi),[Ho]):hi},[Qo,hi]),bo=(0,Oe.useMemo)(function(){var fa=Ti.right,ga=Ti.left;return(0,Ye.Z)((0,Ye.Z)({},Ti),{},{left:In==="rtl"?[].concat((0,Gi.Z)(ga.map(function(Mo){return Mo+Qo})),[0]):ga,right:In==="rtl"?fa:[].concat((0,Gi.Z)(fa.map(function(Mo){return Mo+Qo})),[0]),isSticky:Yr})},[Qo,Ti,Yr]),oo=be(_i,Yi);return Oe.createElement("div",{style:(0,Ye.Z)({overflow:"hidden"},Yr?{top:yi,bottom:$n}:{}),ref:Uo,className:Et()(Gt,(0,ct.Z)({},pi,!!pi))},Oe.createElement(Ko,{style:{tableLayout:"fixed",visibility:Ie||oo?null:"hidden"}},(!Ie||!Ki||wa)&&Oe.createElement(ji,{colWidths:oo?[].concat((0,Gi.Z)(oo),[Qo]):[],columCount:Yi+1,columns:no}),Bi((0,Ye.Z)((0,Ye.Z)({},Pn),{},{stickyOffsets:bo,columns:wr,flattenColumns:no}))))}),li=Oe.memo(gn),Hn=function(jn){var Gt=jn.cells,Ie=jn.stickyOffsets,ai=jn.flattenColumns,hi=jn.rowComponent,_i=jn.cellComponent,Yi=jn.onHeaderRow,Ti=jn.index,In=ot(Ce,["prefixCls","direction"]),si=In.prefixCls,yi=In.direction,$n;Yi&&($n=Yi(Gt.map(function(ur){return ur.column}),Ti));var pi=rt(Gt.map(function(ur){return ur.column}));return Oe.createElement(hi,$n,Gt.map(function(ur,Ki){var Bi=ur.column,Pn=kn(ur.colStart,ur.colEnd,ai,Ie,yi),hr;return Bi&&Bi.onHeaderCell&&(hr=ur.column.onHeaderCell(Bi)),Oe.createElement(ht,(0,We.Z)({},ur,{scope:Bi.title?ur.colSpan>1?"colgroup":"col":null,ellipsis:Bi.ellipsis,align:Bi.align,component:_i,prefixCls:si,key:pi[Ki]},Pn,{additionalProps:hr,rowType:"header"}))}))},oi=Hn;function ki(Vt){var jn=[];function Gt(_i,Yi){var Ti=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;jn[Ti]=jn[Ti]||[];var In=Yi,si=_i.filter(Boolean).map(function(yi){var $n={key:yi.key,className:yi.className||"",children:yi.title,column:yi,colStart:In},pi=1,ur=yi.children;return ur&&ur.length>0&&(pi=Gt(ur,In,Ti+1).reduce(function(Ki,Bi){return Ki+Bi},0),$n.hasSubColumns=!0),"colSpan"in yi&&(pi=yi.colSpan),"rowSpan"in yi&&($n.rowSpan=yi.rowSpan),$n.colSpan=pi,$n.colEnd=$n.colStart+pi-1,jn[Ti].push($n),In+=pi,pi});return si}Gt(Vt,0);for(var Ie=jn.length,ai=function(Yi){jn[Yi].forEach(function(Ti){!("rowSpan"in Ti)&&!Ti.hasSubColumns&&(Ti.rowSpan=Ie-Yi)})},hi=0;hi<Ie;hi+=1)ai(hi);return jn}var Ji=function(jn){var Gt=jn.stickyOffsets,Ie=jn.columns,ai=jn.flattenColumns,hi=jn.onHeaderRow,_i=ot(Ce,["prefixCls","getComponent"]),Yi=_i.prefixCls,Ti=_i.getComponent,In=Oe.useMemo(function(){return ki(Ie)},[Ie]),si=Ti(["header","wrapper"],"thead"),yi=Ti(["header","row"],"tr"),$n=Ti(["header","cell"],"th");return Oe.createElement(si,{className:"".concat(Yi,"-thead")},In.map(function(pi,ur){var Ki=Oe.createElement(oi,{key:ur,flattenColumns:ai,cells:pi,stickyOffsets:Gt,rowComponent:yi,cellComponent:$n,onHeaderRow:hi,index:ur});return Ki}))},$i=pe(Ji),ir=Le(97347);function Mt(Vt,jn,Gt){var Ie=(0,Rn.g)(Vt),ai=Ie.expandIcon,hi=Ie.expandedRowKeys,_i=Ie.defaultExpandedRowKeys,Yi=Ie.defaultExpandAllRows,Ti=Ie.expandedRowRender,In=Ie.onExpand,si=Ie.onExpandedRowsChange,yi=Ie.childrenColumnName,$n=ai||Qt,pi=yi||"children",ur=Oe.useMemo(function(){return Ti?"row":Vt.expandable&&Vt.internalHooks===le.R&&Vt.expandable.__PARENT_RENDER_ICON__||jn.some(function(Yr){return Yr&&(0,nt.Z)(Yr)==="object"&&Yr[pi]})?"nest":!1},[!!Ti,jn]),Ki=Oe.useState(function(){return _i||(Yi?ln(jn,Gt,pi):[])}),Bi=(0,Ue.Z)(Ki,2),Pn=Bi[0],hr=Bi[1],or=Oe.useMemo(function(){return new Set(hi||Pn||[])},[hi,Pn]),xo=Oe.useCallback(function(Yr){var qo=Gt(Yr,jn.indexOf(Yr)),Ko,Qo=or.has(qo);Qo?(or.delete(qo),Ko=(0,Gi.Z)(or)):Ko=[].concat((0,Gi.Z)(or),[qo]),hr(Ko),In&&In(!Qo,Yr),si&&si(Ko)},[Gt,or,jn,In,si]);return[Ie,ur,or,$n,pi,xo]}function _t(Vt,jn,Gt){var Ie=Vt.map(function(ai,hi){return kn(hi,hi,Vt,jn,Gt)});return(0,Pt.Z)(function(){return Ie},[Ie],function(ai,hi){return!(0,yt.Z)(ai,hi)})}function At(Vt){var jn=(0,Oe.useRef)(Vt),Gt=(0,Oe.useState)({}),Ie=(0,Ue.Z)(Gt,2),ai=Ie[1],hi=(0,Oe.useRef)(null),_i=(0,Oe.useRef)([]);function Yi(Ti){_i.current.push(Ti);var In=Promise.resolve();hi.current=In,In.then(function(){if(hi.current===In){var si=_i.current,yi=jn.current;_i.current=[],si.forEach(function($n){jn.current=$n(jn.current)}),hi.current=null,yi!==jn.current&&ai({})}})}return(0,Oe.useEffect)(function(){return function(){hi.current=null}},[]),[jn.current,Yi]}function xi(Vt){var jn=(0,Oe.useRef)(Vt||null),Gt=(0,Oe.useRef)();function Ie(){window.clearTimeout(Gt.current)}function ai(_i){jn.current=_i,Ie(),Gt.current=window.setTimeout(function(){jn.current=null,Gt.current=void 0},100)}function hi(){return jn.current}return(0,Oe.useEffect)(function(){return Ie},[]),[ai,hi]}function mi(){var Vt=Oe.useState(-1),jn=(0,Ue.Z)(Vt,2),Gt=jn[0],Ie=jn[1],ai=Oe.useState(-1),hi=(0,Ue.Z)(ai,2),_i=hi[0],Yi=hi[1],Ti=Oe.useCallback(function(In,si){Ie(In),Yi(si)},[]);return[Gt,_i,Ti]}var fi=Le(47273),wn=(0,fi.Z)()?window:null;function Yn(Vt,jn){var Gt=(0,nt.Z)(Vt)==="object"?Vt:{},Ie=Gt.offsetHeader,ai=Ie===void 0?0:Ie,hi=Gt.offsetSummary,_i=hi===void 0?0:hi,Yi=Gt.offsetScroll,Ti=Yi===void 0?0:Yi,In=Gt.getContainer,si=In===void 0?function(){return wn}:In,yi=si()||wn,$n=!!Vt;return Oe.useMemo(function(){return{isSticky:$n,stickyClassName:$n?"".concat(jn,"-sticky-holder"):"",offsetHeader:ai,offsetSummary:_i,offsetScroll:Ti,container:yi}},[$n,Ti,ai,_i,jn,yi])}function Qi(Vt,jn,Gt){var Ie=(0,Oe.useMemo)(function(){var ai=jn.length,hi=function(In,si,yi){for(var $n=[],pi=0,ur=In;ur!==si;ur+=yi)$n.push(pi),jn[ur].fixed&&(pi+=Vt[ur]||0);return $n},_i=hi(0,ai,1),Yi=hi(ai-1,-1,-1).reverse();return Gt==="rtl"?{left:Yi,right:_i}:{left:_i,right:Yi}},[Vt,jn,Gt]);return Ie}var vr=Qi;function Dr(Vt){var jn=Vt.className,Gt=Vt.children;return Oe.createElement("div",{className:jn},Gt)}var Ke=Dr,Lt=Le(8224),_n=Le(16089),ci=Le(76846);function $t(Vt){var jn=(0,ci.bn)(Vt),Gt=jn.getBoundingClientRect(),Ie=document.documentElement;return{left:Gt.left+(window.pageXOffset||Ie.scrollLeft)-(Ie.clientLeft||document.body.clientLeft||0),top:Gt.top+(window.pageYOffset||Ie.scrollTop)-(Ie.clientTop||document.body.clientTop||0)}}var xn=function(jn,Gt){var Ie,ai,hi=jn.scrollBodyRef,_i=jn.onScroll,Yi=jn.offsetScroll,Ti=jn.container,In=jn.direction,si=ot(Ce,"prefixCls"),yi=((Ie=hi.current)===null||Ie===void 0?void 0:Ie.scrollWidth)||0,$n=((ai=hi.current)===null||ai===void 0?void 0:ai.clientWidth)||0,pi=yi&&$n*($n/yi),ur=Oe.useRef(),Ki=At({scrollLeft:0,isHiddenScrollBar:!0}),Bi=(0,Ue.Z)(Ki,2),Pn=Bi[0],hr=Bi[1],or=Oe.useRef({delta:0,x:0}),xo=Oe.useState(!1),Yr=(0,Ue.Z)(xo,2),qo=Yr[0],Ko=Yr[1],Qo=Oe.useRef(null);Oe.useEffect(function(){return function(){_n.Z.cancel(Qo.current)}},[]);var ra=function(){Ko(!1)},Uo=function(no){no.persist(),or.current.delta=no.pageX-Pn.scrollLeft,or.current.x=0,Ko(!0),no.preventDefault()},wa=function(no){var bo,oo=no||((bo=window)===null||bo===void 0?void 0:bo.event),fa=oo.buttons;if(!qo||fa===0){qo&&Ko(!1);return}var ga=or.current.x+no.pageX-or.current.x-or.current.delta,Mo=In==="rtl";ga=Math.max(Mo?pi-$n:0,Math.min(Mo?0:$n-pi,ga));var Fo=!Mo||Math.abs(ga)+Math.abs(pi)<$n;Fo&&(_i({scrollLeft:ga/$n*(yi+2)}),or.current.x=no.pageX)},Wt=function(){_n.Z.cancel(Qo.current),Qo.current=(0,_n.Z)(function(){if(hi.current){var no=$t(hi.current).top,bo=no+hi.current.offsetHeight,oo=Ti===window?document.documentElement.scrollTop+window.innerHeight:$t(Ti).top+Ti.clientHeight;bo-(0,Ot.Z)()<=oo||no>=oo-Yi?hr(function(fa){return(0,Ye.Z)((0,Ye.Z)({},fa),{},{isHiddenScrollBar:!0})}):hr(function(fa){return(0,Ye.Z)((0,Ye.Z)({},fa),{},{isHiddenScrollBar:!1})})}})},Ho=function(no){hr(function(bo){return(0,Ye.Z)((0,Ye.Z)({},bo),{},{scrollLeft:no/yi*$n||0})})};return Oe.useImperativeHandle(Gt,function(){return{setScrollLeft:Ho,checkScrollBarVisible:Wt}}),Oe.useEffect(function(){var wr=(0,Lt.Z)(document.body,"mouseup",ra,!1),no=(0,Lt.Z)(document.body,"mousemove",wa,!1);return Wt(),function(){wr.remove(),no.remove()}},[pi,qo]),Oe.useEffect(function(){if(hi.current){for(var wr=[],no=(0,ci.bn)(hi.current);no;)wr.push(no),no=no.parentElement;return wr.forEach(function(bo){return bo.addEventListener("scroll",Wt,!1)}),window.addEventListener("resize",Wt,!1),window.addEventListener("scroll",Wt,!1),Ti.addEventListener("scroll",Wt,!1),function(){wr.forEach(function(bo){return bo.removeEventListener("scroll",Wt)}),window.removeEventListener("resize",Wt),window.removeEventListener("scroll",Wt),Ti.removeEventListener("scroll",Wt)}}},[Ti]),Oe.useEffect(function(){Pn.isHiddenScrollBar||hr(function(wr){var no=hi.current;return no?(0,Ye.Z)((0,Ye.Z)({},wr),{},{scrollLeft:no.scrollLeft/no.scrollWidth*no.clientWidth}):wr})},[Pn.isHiddenScrollBar]),yi<=$n||!pi||Pn.isHiddenScrollBar?null:Oe.createElement("div",{style:{height:(0,Ot.Z)(),width:$n,bottom:Yi},className:"".concat(si,"-sticky-scroll")},Oe.createElement("div",{onMouseDown:Uo,ref:ur,className:Et()("".concat(si,"-sticky-scroll-bar"),(0,ct.Z)({},"".concat(si,"-sticky-scroll-bar-active"),qo)),style:{width:"".concat(pi,"px"),transform:"translate3d(".concat(Pn.scrollLeft,"px, 0, 0)")}}))},Xt=Oe.forwardRef(xn);function ri(Vt){return null}var Hi=ri;function gi(Vt){return null}var Ii=gi,Fi="rc-table",Cr=[],xr={};function Sr(){return"No Data"}function hn(Vt,jn){var Gt=(0,Ye.Z)({rowKey:"key",prefixCls:Fi,emptyText:Sr},Vt),Ie=Gt.prefixCls,ai=Gt.className,hi=Gt.rowClassName,_i=Gt.style,Yi=Gt.data,Ti=Gt.rowKey,In=Gt.scroll,si=Gt.tableLayout,yi=Gt.direction,$n=Gt.title,pi=Gt.footer,ur=Gt.summary,Ki=Gt.caption,Bi=Gt.id,Pn=Gt.showHeader,hr=Gt.components,or=Gt.emptyText,xo=Gt.onRow,Yr=Gt.onHeaderRow,qo=Gt.onScroll,Ko=Gt.internalHooks,Qo=Gt.transformColumns,ra=Gt.internalRefs,Uo=Gt.tailor,wa=Gt.getContainerWidth,Wt=Gt.sticky,Ho=Gt.rowHoverable,wr=Ho===void 0?!0:Ho,no=Yi||Cr,bo=!!no.length,oo=Ko===le.R,fa=Oe.useCallback(function(pa,Oa){return(0,Bt.Z)(hr,pa)||Oa},[hr]),ga=Oe.useMemo(function(){return typeof Ti=="function"?Ti:function(pa){var Oa=pa&&pa[Ti];return Oa}},[Ti]),Mo=fa(["body"]),Fo=mi(),vs=(0,Ue.Z)(Fo,3),es=vs[0],ps=vs[1],ms=vs[2],Kr=Mt(Gt,no,ga),Ka=(0,Ue.Z)(Kr,6),Ba=Ka[0],ss=Ka[1],Ya=Ka[2],ls=Ka[3],Zi=Ka[4],Xr=Ka[5],Po=In==null?void 0:In.x,Yo=Oe.useState(0),ea=(0,Ue.Z)(Yo,2),Ea=ea[0],Hr=ea[1],Ns=(0,ir.Z)((0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({},Gt),Ba),{},{expandable:!!Ba.expandedRowRender,columnTitle:Ba.columnTitle,expandedKeys:Ya,getRowKey:ga,onTriggerExpand:Xr,expandIcon:ls,expandIconColumnIndex:Ba.expandIconColumnIndex,direction:yi,scrollWidth:oo&&Uo&&typeof Po=="number"?Po:null,clientWidth:Ea}),oo?Qo:null),is=(0,Ue.Z)(Ns,4),Ut=is[0],Zt=is[1],bn=is[2],zi=is[3],Ei=bn!=null?bn:Po,Mi=Oe.useMemo(function(){return{columns:Ut,flattenColumns:Zt}},[Ut,Zt]),wi=Oe.useRef(),Fn=Oe.useRef(),ti=Oe.useRef(),dr=Oe.useRef();Oe.useImperativeHandle(jn,function(){return{nativeElement:wi.current,scrollTo:function(Oa){var hs;if(ti.current instanceof HTMLElement){var Os=Oa.index,Rs=Oa.top,Nu=Oa.key;if(ni(Rs)){var Bl;(Bl=ti.current)===null||Bl===void 0||Bl.scrollTo({top:Rs})}else{var Du,zl=Nu!=null?Nu:ga(no[Os]);(Du=ti.current.querySelector('[data-row-key="'.concat(zl,'"]')))===null||Du===void 0||Du.scrollIntoView()}}else(hs=ti.current)!==null&&hs!==void 0&&hs.scrollTo&&ti.current.scrollTo(Oa)}}});var Tr=Oe.useRef(),Vo=Oe.useState(!1),To=(0,Ue.Z)(Vo,2),Ca=To[0],Sa=To[1],mo=Oe.useState(!1),_r=(0,Ue.Z)(mo,2),ar=_r[0],oa=_r[1],la=Oe.useState(new Map),Ma=(0,Ue.Z)(la,2),za=Ma[0],Ro=Ma[1],ua=rt(Zt),ko=ua.map(function(pa){return za.get(pa)}),jr=Oe.useMemo(function(){return ko},[ko.join("_")]),Fa=vr(jr,Zt,yi),sa=In&&dn(In.y),Xo=In&&dn(Ei)||!!Ba.fixed,Io=Xo&&Zt.some(function(pa){var Oa=pa.fixed;return Oa}),ca=Oe.useRef(),Wa=Yn(Wt,Ie),gt=Wa.isSticky,Ht=Wa.offsetHeader,Re=Wa.offsetSummary,lt=Wa.offsetScroll,fr=Wa.stickyClassName,sr=Wa.container,pr=Oe.useMemo(function(){return ur==null?void 0:ur(no)},[ur,no]),Ui=(sa||gt)&&Oe.isValidElement(pr)&&pr.type===et&&pr.props.fixed,Un,Lr,kr;sa&&(Lr={overflowY:bo?"scroll":"auto",maxHeight:In.y}),Xo&&(Un={overflowX:"auto"},sa||(Lr={overflowY:"hidden"}),kr={width:Ei===!0?"auto":Ei,minWidth:"100%"});var Zr=Oe.useCallback(function(pa,Oa){Ro(function(hs){if(hs.get(pa)!==Oa){var Os=new Map(hs);return Os.set(pa,Oa),Os}return hs})},[]),Er=xi(null),Eo=(0,Ue.Z)(Er,2),Wi=Eo[0],Si=Eo[1];function Pi(pa,Oa){Oa&&(typeof Oa=="function"?Oa(pa):Oa.scrollLeft!==pa&&(Oa.scrollLeft=pa,Oa.scrollLeft!==pa&&setTimeout(function(){Oa.scrollLeft=pa},0)))}var Jr=(0,pt.Z)(function(pa){var Oa=pa.currentTarget,hs=pa.scrollLeft,Os=yi==="rtl",Rs=typeof hs=="number"?hs:Oa.scrollLeft,Nu=Oa||xr;if(!Si()||Si()===Nu){var Bl;Wi(Nu),Pi(Rs,Fn.current),Pi(Rs,ti.current),Pi(Rs,Tr.current),Pi(Rs,(Bl=ca.current)===null||Bl===void 0?void 0:Bl.setScrollLeft)}var Du=Oa||Fn.current;if(Du){var zl=oo&&Uo&&typeof Ei=="number"?Ei:Du.scrollWidth,uu=Du.clientWidth;if(zl===uu){Sa(!1),oa(!1);return}Os?(Sa(-Rs<zl-uu),oa(-Rs>0)):(Sa(Rs>0),oa(Rs<zl-uu))}}),Ur=(0,pt.Z)(function(pa){Jr(pa),qo==null||qo(pa)}),Nr=function(){if(Xo&&ti.current){var Oa;Jr({currentTarget:(0,ci.bn)(ti.current),scrollLeft:(Oa=ti.current)===null||Oa===void 0?void 0:Oa.scrollLeft})}else Sa(!1),oa(!1)},Lo=function(Oa){var hs,Os=Oa.width;(hs=ca.current)===null||hs===void 0||hs.checkScrollBarVisible();var Rs=wi.current?wi.current.offsetWidth:Os;oo&&wa&&wi.current&&(Rs=wa(wi.current,Rs)||Rs),Rs!==Ea&&(Nr(),Hr(Rs))},yr=Oe.useRef(!1);Oe.useEffect(function(){yr.current&&Nr()},[Xo,Yi,Ut.length]),Oe.useEffect(function(){yr.current=!0},[]);var Qr=Oe.useState(0),tr=(0,Ue.Z)(Qr,2),Ir=tr[0],uo=tr[1],Zo=Oe.useState(!0),ha=(0,Ue.Z)(Zo,2),La=ha[0],zr=ha[1];(0,St.Z)(function(){(!Uo||!oo)&&(ti.current instanceof Element?uo((0,Ot.o)(ti.current).width):uo((0,Ot.o)(dr.current).width)),zr((0,Dt.G)("position","sticky"))},[]),Oe.useEffect(function(){oo&&ra&&(ra.body.current=ti.current)});var bs=Oe.useCallback(function(pa){return Oe.createElement(Oe.Fragment,null,Oe.createElement($i,pa),Ui==="top"&&Oe.createElement(Kt,pa,pr))},[Ui,pr]),eo=Oe.useCallback(function(pa){return Oe.createElement(Kt,pa,pr)},[pr]),ka=fa(["table"],"table"),wo=Oe.useMemo(function(){return si||(Io?Ei==="max-content"?"auto":"fixed":sa||gt||Zt.some(function(pa){var Oa=pa.ellipsis;return Oa})?"fixed":"auto")},[sa,Io,Zt,si,gt]),ts,Ha={colWidths:jr,columCount:Zt.length,stickyOffsets:Fa,onHeaderRow:Yr,fixHeader:sa,scroll:In},rs=Oe.useMemo(function(){return bo?null:typeof or=="function"?or():or},[bo,or]),Ol=Oe.createElement(Gn,{data:no,measureColumnWidth:sa||Xo||gt}),su=Oe.createElement(ji,{colWidths:Zt.map(function(pa){var Oa=pa.width;return Oa}),columns:Zt}),Rl=Ki!=null?Oe.createElement("caption",{className:"".concat(Ie,"-caption")},Ki):void 0,lu=(0,un.Z)(Gt,{data:!0}),Da=(0,un.Z)(Gt,{aria:!0});if(sa||gt){var al;typeof Mo=="function"?(al=Mo(no,{scrollbarSize:Ir,ref:ti,onScroll:Jr}),Ha.colWidths=Zt.map(function(pa,Oa){var hs=pa.width,Os=Oa===Zt.length-1?hs-Ir:hs;return typeof Os=="number"&&!Number.isNaN(Os)?Os:0})):al=Oe.createElement("div",{style:(0,Ye.Z)((0,Ye.Z)({},Un),Lr),onScroll:Ur,ref:ti,className:Et()("".concat(Ie,"-body"))},Oe.createElement(ka,(0,We.Z)({style:(0,Ye.Z)((0,Ye.Z)({},kr),{},{tableLayout:wo})},Da),Rl,su,Ol,!Ui&&pr&&Oe.createElement(Kt,{stickyOffsets:Fa,flattenColumns:Zt},pr)));var jl=(0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({noData:!no.length,maxContentScroll:Xo&&Ei==="max-content"},Ha),Mi),{},{direction:yi,stickyClassName:fr,onScroll:Jr});ts=Oe.createElement(Oe.Fragment,null,Pn!==!1&&Oe.createElement(li,(0,We.Z)({},jl,{stickyTopOffset:Ht,className:"".concat(Ie,"-header"),ref:Fn}),bs),al,Ui&&Ui!=="top"&&Oe.createElement(li,(0,We.Z)({},jl,{stickyBottomOffset:Re,className:"".concat(Ie,"-summary"),ref:Tr}),eo),gt&&ti.current&&ti.current instanceof Element&&Oe.createElement(Xt,{ref:ca,offsetScroll:lt,scrollBodyRef:ti,onScroll:Jr,container:sr,direction:yi}))}else ts=Oe.createElement("div",{style:(0,Ye.Z)((0,Ye.Z)({},Un),Lr),className:Et()("".concat(Ie,"-content")),onScroll:Jr,ref:ti},Oe.createElement(ka,(0,We.Z)({style:(0,Ye.Z)((0,Ye.Z)({},kr),{},{tableLayout:wo})},Da),Rl,su,Pn!==!1&&Oe.createElement($i,(0,We.Z)({},Ha,Mi)),Ol,pr&&Oe.createElement(Kt,{stickyOffsets:Fa,flattenColumns:Zt},pr)));var nl=Oe.createElement("div",(0,We.Z)({className:Et()(Ie,ai,(0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)({},"".concat(Ie,"-rtl"),yi==="rtl"),"".concat(Ie,"-ping-left"),Ca),"".concat(Ie,"-ping-right"),ar),"".concat(Ie,"-layout-fixed"),si==="fixed"),"".concat(Ie,"-fixed-header"),sa),"".concat(Ie,"-fixed-column"),Io),"".concat(Ie,"-fixed-column-gapped"),Io&&zi),"".concat(Ie,"-scroll-horizontal"),Xo),"".concat(Ie,"-has-fix-left"),Zt[0]&&Zt[0].fixed),"".concat(Ie,"-has-fix-right"),Zt[Zt.length-1]&&Zt[Zt.length-1].fixed==="right")),style:_i,id:Bi,ref:wi},lu),$n&&Oe.createElement(Ke,{className:"".concat(Ie,"-title")},$n(no)),Oe.createElement("div",{ref:dr,className:"".concat(Ie,"-container")},ts),pi&&Oe.createElement(Ke,{className:"".concat(Ie,"-footer")},pi(no)));Xo&&(nl=Oe.createElement(Nt.Z,{onResize:Lo},nl));var oh=_t(Zt,Fa,yi),dl=Oe.useMemo(function(){return{scrollX:Ei,prefixCls:Ie,getComponent:fa,scrollbarSize:Ir,direction:yi,fixedInfoList:oh,isSticky:gt,supportSticky:La,componentWidth:Ea,fixHeader:sa,fixColumn:Io,horizonScroll:Xo,tableLayout:wo,rowClassName:hi,expandedRowClassName:Ba.expandedRowClassName,expandIcon:ls,expandableType:ss,expandRowByClick:Ba.expandRowByClick,expandedRowRender:Ba.expandedRowRender,onTriggerExpand:Xr,expandIconColumnIndex:Ba.expandIconColumnIndex,indentSize:Ba.indentSize,allColumnsFixedLeft:Zt.every(function(pa){return pa.fixed==="left"}),emptyNode:rs,columns:Ut,flattenColumns:Zt,onColumnResize:Zr,hoverStartRow:es,hoverEndRow:ps,onHover:ms,rowExpandable:Ba.rowExpandable,onRow:xo,getRowKey:ga,expandedKeys:Ya,childrenColumnName:Zi,rowHoverable:wr}},[Ei,Ie,fa,Ir,yi,oh,gt,La,Ea,sa,Io,Xo,wo,hi,Ba.expandedRowClassName,ls,ss,Ba.expandRowByClick,Ba.expandedRowRender,Xr,Ba.expandIconColumnIndex,Ba.indentSize,rs,Ut,Zt,Zr,es,ps,ms,Ba.rowExpandable,xo,ga,Ya,Zi,wr]);return Oe.createElement(Ce.Provider,{value:dl},nl)}var ro=Oe.forwardRef(hn);function Gr(Vt){return se(ro,Vt)}var So=Gr();So.EXPAND_COLUMN=le.w,So.INTERNAL_HOOKS=le.R,So.Column=Hi,So.ColumnGroup=Ii,So.Summary=pn;var yn=So,Xn=Le(65283),rr=Ct(null),er=Ct(null);function Pr(Vt,jn,Gt){var Ie=jn||1;return Gt[Vt+Ie]-(Gt[Vt]||0)}function Wr(Vt){var jn=Vt.rowInfo,Gt=Vt.column,Ie=Vt.colIndex,ai=Vt.indent,hi=Vt.index,_i=Vt.component,Yi=Vt.renderIndex,Ti=Vt.record,In=Vt.style,si=Vt.className,yi=Vt.inverse,$n=Vt.getHeight,pi=Gt.render,ur=Gt.dataIndex,Ki=Gt.className,Bi=Gt.width,Pn=ot(er,["columnsOffset"]),hr=Pn.columnsOffset,or=cn(jn,Gt,Ie,ai,hi),xo=or.key,Yr=or.fixedInfo,qo=or.appendCellNode,Ko=or.additionalCellProps,Qo=Ko.style,ra=Ko.colSpan,Uo=ra===void 0?1:ra,wa=Ko.rowSpan,Wt=wa===void 0?1:wa,Ho=Ie-1,wr=Pr(Ho,Uo,hr),no=Uo>1?Bi-wr:0,bo=(0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({},Qo),In),{},{flex:"0 0 ".concat(wr,"px"),width:"".concat(wr,"px"),marginRight:no,pointerEvents:"auto"}),oo=Oe.useMemo(function(){return yi?Wt<=1:Uo===0||Wt===0||Wt>1},[Wt,Uo,yi]);oo?bo.visibility="hidden":yi&&(bo.height=$n==null?void 0:$n(Wt));var fa=oo?function(){return null}:pi,ga={};return(Wt===0||Uo===0)&&(ga.rowSpan=1,ga.colSpan=1),Oe.createElement(ht,(0,We.Z)({className:Et()(Ki,si),ellipsis:Gt.ellipsis,align:Gt.align,scope:Gt.rowScope,component:_i,prefixCls:jn.prefixCls,key:xo,record:Ti,index:hi,renderIndex:Yi,dataIndex:ur,render:fa,shouldCellUpdate:Gt.shouldCellUpdate},Yr,{appendNode:qo,additionalProps:(0,Ye.Z)((0,Ye.Z)({},Ko),{},{style:bo},ga)}))}var so=Wr,vo=["data","index","className","rowKey","style","extra","getHeight"],po=Oe.forwardRef(function(Vt,jn){var Gt=Vt.data,Ie=Vt.index,ai=Vt.className,hi=Vt.rowKey,_i=Vt.style,Yi=Vt.extra,Ti=Vt.getHeight,In=(0,Ee.Z)(Vt,vo),si=Gt.record,yi=Gt.indent,$n=Gt.index,pi=ot(Ce,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),ur=pi.scrollX,Ki=pi.flattenColumns,Bi=pi.prefixCls,Pn=pi.fixColumn,hr=pi.componentWidth,or=ot(rr,["getComponent"]),xo=or.getComponent,Yr=Dn(si,hi,Ie,yi),qo=xo(["body","row"],"div"),Ko=xo(["body","cell"],"div"),Qo=Yr.rowSupportExpand,ra=Yr.expanded,Uo=Yr.rowProps,wa=Yr.expandedRowRender,Wt=Yr.expandedRowClassName,Ho;if(Qo&&ra){var wr=wa(si,Ie,yi+1,ra),no=di(Wt,si,Ie,yi),bo={};Pn&&(bo={style:(0,ct.Z)({},"--virtual-width","".concat(hr,"px"))});var oo="".concat(Bi,"-expanded-row-cell");Ho=Oe.createElement(qo,{className:Et()("".concat(Bi,"-expanded-row"),"".concat(Bi,"-expanded-row-level-").concat(yi+1),no)},Oe.createElement(ht,{component:Ko,prefixCls:Bi,className:Et()(oo,(0,ct.Z)({},"".concat(oo,"-fixed"),Pn)),additionalProps:bo},wr))}var fa=(0,Ye.Z)((0,Ye.Z)({},_i),{},{width:ur});Yi&&(fa.position="absolute",fa.pointerEvents="none");var ga=Oe.createElement(qo,(0,We.Z)({},Uo,In,{"data-row-key":hi,ref:Qo?null:jn,className:Et()(ai,"".concat(Bi,"-row"),Uo==null?void 0:Uo.className,(0,ct.Z)({},"".concat(Bi,"-row-extra"),Yi)),style:(0,Ye.Z)((0,Ye.Z)({},fa),Uo==null?void 0:Uo.style)}),Ki.map(function(Mo,Fo){return Oe.createElement(so,{key:Fo,component:Ko,rowInfo:Yr,column:Mo,colIndex:Fo,indent:yi,index:Ie,renderIndex:$n,record:si,inverse:Yi,getHeight:Ti})}));return Qo?Oe.createElement("div",{ref:jn},ga,Ho):ga}),yo=pe(po),Nn=yo,ia=Oe.forwardRef(function(Vt,jn){var Gt=Vt.data,Ie=Vt.onScroll,ai=ot(Ce,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),hi=ai.flattenColumns,_i=ai.onColumnResize,Yi=ai.getRowKey,Ti=ai.expandedKeys,In=ai.prefixCls,si=ai.childrenColumnName,yi=ai.scrollX,$n=ai.direction,pi=ot(rr),ur=pi.sticky,Ki=pi.scrollY,Bi=pi.listItemHeight,Pn=pi.getComponent,hr=pi.onScroll,or=Oe.useRef(),xo=An(Gt,si,Ti,Yi),Yr=Oe.useMemo(function(){var Ho=0;return hi.map(function(wr){var no=wr.width,bo=wr.key;return Ho+=no,[bo,no,Ho]})},[hi]),qo=Oe.useMemo(function(){return Yr.map(function(Ho){return Ho[2]})},[Yr]);Oe.useEffect(function(){Yr.forEach(function(Ho){var wr=(0,Ue.Z)(Ho,2),no=wr[0],bo=wr[1];_i(no,bo)})},[Yr]),Oe.useImperativeHandle(jn,function(){var Ho,wr={scrollTo:function(bo){var oo;(oo=or.current)===null||oo===void 0||oo.scrollTo(bo)},nativeElement:(Ho=or.current)===null||Ho===void 0?void 0:Ho.nativeElement};return Object.defineProperty(wr,"scrollLeft",{get:function(){var bo;return((bo=or.current)===null||bo===void 0?void 0:bo.getScrollInfo().x)||0},set:function(bo){var oo;(oo=or.current)===null||oo===void 0||oo.scrollTo({left:bo})}}),wr});var Ko=function(wr,no){var bo,oo=(bo=xo[no])===null||bo===void 0?void 0:bo.record,fa=wr.onCell;if(fa){var ga,Mo=fa(oo,no);return(ga=Mo==null?void 0:Mo.rowSpan)!==null&&ga!==void 0?ga:1}return 1},Qo=function(wr){var no=wr.start,bo=wr.end,oo=wr.getSize,fa=wr.offsetY;if(bo<0)return null;for(var ga=hi.filter(function(ls){return Ko(ls,no)===0}),Mo=no,Fo=function(Zi){if(ga=ga.filter(function(Xr){return Ko(Xr,Zi)===0}),!ga.length)return Mo=Zi,1},vs=no;vs>=0&&!Fo(vs);vs-=1);for(var es=hi.filter(function(ls){return Ko(ls,bo)!==1}),ps=bo,ms=function(Zi){if(es=es.filter(function(Xr){return Ko(Xr,Zi)!==1}),!es.length)return ps=Math.max(Zi-1,bo),1},Kr=bo;Kr<xo.length&&!ms(Kr);Kr+=1);for(var Ka=[],Ba=function(Zi){var Xr=xo[Zi];if(!Xr)return 1;hi.some(function(Po){return Ko(Po,Zi)>1})&&Ka.push(Zi)},ss=Mo;ss<=ps;ss+=1)Ba(ss);var Ya=Ka.map(function(ls){var Zi=xo[ls],Xr=Yi(Zi.record,ls),Po=function(Ea){var Hr=ls+Ea-1,Ns=Yi(xo[Hr].record,Hr),is=oo(Xr,Ns);return is.bottom-is.top},Yo=oo(Xr);return Oe.createElement(Nn,{key:ls,data:Zi,rowKey:Xr,index:ls,style:{top:-fa+Yo.top},extra:!0,getHeight:Po})});return Ya},ra=Oe.useMemo(function(){return{columnsOffset:qo}},[qo]),Uo="".concat(In,"-tbody"),wa=Pn(["body","wrapper"]),Wt={};return ur&&(Wt.position="sticky",Wt.bottom=0,(0,nt.Z)(ur)==="object"&&ur.offsetScroll&&(Wt.bottom=ur.offsetScroll)),Oe.createElement(er.Provider,{value:ra},Oe.createElement(Xn.Z,{fullHeight:!1,ref:or,prefixCls:"".concat(Uo,"-virtual"),styles:{horizontalScrollBar:Wt},className:Uo,height:Ki,itemHeight:Bi||24,data:xo,itemKey:function(wr){return Yi(wr.record)},component:wa,scrollWidth:yi,direction:$n,onVirtualScroll:function(wr){var no,bo=wr.x;Ie({currentTarget:(no=or.current)===null||no===void 0?void 0:no.nativeElement,scrollLeft:bo})},onScroll:hr,extraRender:Qo},function(Ho,wr,no){var bo=Yi(Ho.record,wr);return Oe.createElement(Nn,{data:Ho,rowKey:bo,index:wr,style:no.style})}))}),Tn=pe(ia),Ar=Tn,Bo=function(jn,Gt){var Ie=Gt.ref,ai=Gt.onScroll;return Oe.createElement(Ar,{ref:Ie,data:jn,onScroll:ai})};function br(Vt,jn){var Gt=Vt.data,Ie=Vt.columns,ai=Vt.scroll,hi=Vt.sticky,_i=Vt.prefixCls,Yi=_i===void 0?Fi:_i,Ti=Vt.className,In=Vt.listItemHeight,si=Vt.components,yi=Vt.onScroll,$n=ai||{},pi=$n.x,ur=$n.y;typeof pi!="number"&&(pi=1),typeof ur!="number"&&(ur=500);var Ki=(0,ui.zX)(function(hr,or){return(0,Bt.Z)(si,hr)||or}),Bi=(0,ui.zX)(yi),Pn=Oe.useMemo(function(){return{sticky:hi,scrollY:ur,listItemHeight:In,getComponent:Ki,onScroll:Bi}},[hi,ur,In,Ki,Bi]);return Oe.createElement(rr.Provider,{value:Pn},Oe.createElement(yn,(0,We.Z)({},Vt,{className:Et()(Ti,"".concat(Yi,"-virtual")),scroll:(0,Ye.Z)((0,Ye.Z)({},ai),{},{x:pi}),components:(0,Ye.Z)((0,Ye.Z)({},si),{},{body:Gt!=null&&Gt.length?Bo:void 0}),columns:Ie,internalHooks:le.R,tailor:!0,ref:jn})))}var na=Oe.forwardRef(br);function Do(Vt){return se(na,Vt)}var ho=Do(),Jo=null},54451:function(Zn,ei,Le){"use strict";Le.d(ei,{g:function(){return Oe},v:function(){return yt}});var le=Le(89490),Ue=Le(39224),pt=Le(48736),St=["expandable"],yt="RC_TABLE_INTERNAL_COL_DEFINE";function Oe(at){var Ct=at.expandable,ot=(0,Ue.Z)(at,St),We;return"expandable"in at?We=(0,le.Z)((0,le.Z)({},ot),Ct):We=ot,We.showExpandColumn===!1&&(We.expandIconColumnIndex=-1),We}},22711:function(Zn,ei,Le){"use strict";Le.r(ei),Le.d(ei,{ResizableTextArea:function(){return $e},default:function(){return fn}});var le=Le(71409),Ue=Le(87075),pt=Le(89490),St=Le(62730),yt=Le(11036),Oe=Le(39224),at=Le(92310),Ct=Le.n(at),ot=Le(36901),We=Le(66003),Tt=Le(30292),dt=Le(18929),kt=Le(59301),De=Le(28788),ne=Le(29301),te=Le(34280),de=Le(16089),se=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,pe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],ye={},we;function Ce(qt){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,tn=qt.getAttribute("id")||qt.getAttribute("data-reactid")||qt.getAttribute("name");if(vn&&ye[tn])return ye[tn];var it=window.getComputedStyle(qt),rt=it.getPropertyValue("box-sizing")||it.getPropertyValue("-moz-box-sizing")||it.getPropertyValue("-webkit-box-sizing"),dn=parseFloat(it.getPropertyValue("padding-bottom"))+parseFloat(it.getPropertyValue("padding-top")),ni=parseFloat(it.getPropertyValue("border-bottom-width"))+parseFloat(it.getPropertyValue("border-top-width")),Kn=pe.map(function(En){return"".concat(En,":").concat(it.getPropertyValue(En))}).join(";"),Rt={sizingStyle:Kn,paddingSize:dn,borderSize:ni,boxSizing:rt};return vn&&tn&&(ye[tn]=Rt),Rt}function _e(qt){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,tn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,it=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;we||(we=document.createElement("textarea"),we.setAttribute("tab-index","-1"),we.setAttribute("aria-hidden","true"),we.setAttribute("name","hiddenTextarea"),document.body.appendChild(we)),qt.getAttribute("wrap")?we.setAttribute("wrap",qt.getAttribute("wrap")):we.removeAttribute("wrap");var rt=Ce(qt,vn),dn=rt.paddingSize,ni=rt.borderSize,Kn=rt.boxSizing,Rt=rt.sizingStyle;we.setAttribute("style","".concat(Rt,";").concat(se)),we.value=qt.value||qt.placeholder||"";var En=void 0,Bn=void 0,ui,It=we.scrollHeight;if(Kn==="border-box"?It+=ni:Kn==="content-box"&&(It-=dn),tn!==null||it!==null){we.value=" ";var On=we.scrollHeight-dn;tn!==null&&(En=On*tn,Kn==="border-box"&&(En=En+dn+ni),It=Math.max(En,It)),it!==null&&(Bn=On*it,Kn==="border-box"&&(Bn=Bn+dn+ni),ui=It>Bn?"":"hidden",It=Math.min(Bn,It))}var ht={height:It,overflowY:ui,resize:"none"};return En&&(ht.minHeight=En),Bn&&(ht.maxHeight=Bn),ht}var Ze=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],st=0,nt=1,Ye=2,ct=kt.forwardRef(function(qt,vn){var tn=qt,it=tn.prefixCls,rt=tn.defaultValue,dn=tn.value,ni=tn.autoSize,Kn=tn.onResize,Rt=tn.className,En=tn.style,Bn=tn.disabled,ui=tn.onChange,It=tn.onInternalAutoSize,On=(0,Oe.Z)(tn,Ze),ht=(0,dt.Z)(rt,{value:dn,postState:function(ii){return ii!=null?ii:""}}),kn=(0,yt.Z)(ht,2),Oi=kn[0],ze=kn[1],Me=function(ii){ze(ii.target.value),ui==null||ui(ii)},Ee=kt.useRef();kt.useImperativeHandle(vn,function(){return{textArea:Ee.current}});var Te=kt.useMemo(function(){return ni&&(0,De.Z)(ni)==="object"?[ni.minRows,ni.maxRows]:[]},[ni]),He=(0,yt.Z)(Te,2),Ae=He[0],et=He[1],on=!!ni,Kt=function(){try{if(document.activeElement===Ee.current){var ii=Ee.current,Vi=ii.selectionStart,bi=ii.selectionEnd,Di=ii.scrollTop;Ee.current.setSelectionRange(Vi,bi),Ee.current.scrollTop=Di}}catch(Mr){}},pn=kt.useState(Ye),Nt=(0,yt.Z)(pn,2),Dt=Nt[0],Ot=Nt[1],un=kt.useState(),Sn=(0,yt.Z)(un,2),An=Sn[0],Dn=Sn[1],Ai=function(){Ot(st)};(0,te.Z)(function(){on&&Ai()},[dn,Ae,et,on]),(0,te.Z)(function(){if(Dt===st)Ot(nt);else if(Dt===nt){var Yt=_e(Ee.current,!1,Ae,et);Ot(Ye),Dn(Yt)}else Kt()},[Dt]);var en=kt.useRef(),Qt=function(){de.Z.cancel(en.current)},ln=function(ii){Dt===Ye&&(Kn==null||Kn(ii),ni&&(Qt(),en.current=(0,de.Z)(function(){Ai()})))};kt.useEffect(function(){return Qt},[]);var di=on?An:null,cn=(0,pt.Z)((0,pt.Z)({},En),di);return(Dt===st||Dt===nt)&&(cn.overflowY="hidden",cn.overflowX="hidden"),kt.createElement(ne.Z,{onResize:ln,disabled:!(ni||Kn)},kt.createElement("textarea",(0,le.Z)({},On,{ref:Ee,style:cn,className:Ct()(it,Rt,(0,Ue.Z)({},"".concat(it,"-disabled"),Bn)),disabled:Bn,value:Oi,onChange:Me})))}),$e=ct,Et=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],Pt=kt.forwardRef(function(qt,vn){var tn,it=qt.defaultValue,rt=qt.value,dn=qt.onFocus,ni=qt.onBlur,Kn=qt.onChange,Rt=qt.allowClear,En=qt.maxLength,Bn=qt.onCompositionStart,ui=qt.onCompositionEnd,It=qt.suffix,On=qt.prefixCls,ht=On===void 0?"rc-textarea":On,kn=qt.showCount,Oi=qt.count,ze=qt.className,Me=qt.style,Ee=qt.disabled,Te=qt.hidden,He=qt.classNames,Ae=qt.styles,et=qt.onResize,on=qt.onClear,Kt=qt.onPressEnter,pn=qt.readOnly,Nt=qt.autoSize,Dt=qt.onKeyDown,Ot=(0,Oe.Z)(qt,Et),un=(0,dt.Z)(it,{value:rt,defaultValue:it}),Sn=(0,yt.Z)(un,2),An=Sn[0],Dn=Sn[1],Ai=An==null?"":String(An),en=kt.useState(!1),Qt=(0,yt.Z)(en,2),ln=Qt[0],di=Qt[1],cn=kt.useRef(!1),Yt=kt.useState(null),ii=(0,yt.Z)(Yt,2),Vi=ii[0],bi=ii[1],Di=(0,kt.useRef)(null),Mr=(0,kt.useRef)(null),Gn=function(){var Qi;return(Qi=Mr.current)===null||Qi===void 0?void 0:Qi.textArea},Rn=function(){Gn().focus()};(0,kt.useImperativeHandle)(vn,function(){var Yn;return{resizableTextArea:Mr.current,focus:Rn,blur:function(){Gn().blur()},nativeElement:((Yn=Di.current)===null||Yn===void 0?void 0:Yn.nativeElement)||Gn()}}),(0,kt.useEffect)(function(){di(function(Yn){return!Ee&&Yn})},[Ee]);var Jn=kt.useState(null),Ni=(0,yt.Z)(Jn,2),ji=Ni[0],Gi=Ni[1];kt.useEffect(function(){if(ji){var Yn;(Yn=Gn()).setSelectionRange.apply(Yn,(0,St.Z)(ji))}},[ji]);var Fr=(0,We.Z)(Oi,kn),be=(tn=Fr.max)!==null&&tn!==void 0?tn:En,gn=Number(be)>0,li=Fr.strategy(Ai),Hn=!!be&&li>be,oi=function(Qi,vr){var Dr=vr;!cn.current&&Fr.exceedFormatter&&Fr.max&&Fr.strategy(vr)>Fr.max&&(Dr=Fr.exceedFormatter(vr,{max:Fr.max}),vr!==Dr&&Gi([Gn().selectionStart||0,Gn().selectionEnd||0])),Dn(Dr),(0,Tt.rJ)(Qi.currentTarget,Qi,Kn,Dr)},ki=function(Qi){cn.current=!0,Bn==null||Bn(Qi)},Ji=function(Qi){cn.current=!1,oi(Qi,Qi.currentTarget.value),ui==null||ui(Qi)},$i=function(Qi){oi(Qi,Qi.target.value)},ir=function(Qi){Qi.key==="Enter"&&Kt&&Kt(Qi),Dt==null||Dt(Qi)},Mt=function(Qi){di(!0),dn==null||dn(Qi)},_t=function(Qi){di(!1),ni==null||ni(Qi)},At=function(Qi){Dn(""),Rn(),(0,Tt.rJ)(Gn(),Qi,Kn)},xi=It,mi;Fr.show&&(Fr.showFormatter?mi=Fr.showFormatter({value:Ai,count:li,maxLength:be}):mi="".concat(li).concat(gn?" / ".concat(be):""),xi=kt.createElement(kt.Fragment,null,xi,kt.createElement("span",{className:Ct()("".concat(ht,"-data-count"),He==null?void 0:He.count),style:Ae==null?void 0:Ae.count},mi)));var fi=function(Qi){var vr;et==null||et(Qi),(vr=Gn())!==null&&vr!==void 0&&vr.style.height&&bi(!0)},wn=!Nt&&!kn&&!Rt;return kt.createElement(ot.BaseInput,{ref:Di,value:Ai,allowClear:Rt,handleReset:At,suffix:xi,prefixCls:ht,classNames:(0,pt.Z)((0,pt.Z)({},He),{},{affixWrapper:Ct()(He==null?void 0:He.affixWrapper,(0,Ue.Z)((0,Ue.Z)({},"".concat(ht,"-show-count"),kn),"".concat(ht,"-textarea-allow-clear"),Rt))}),disabled:Ee,focused:ln,className:Ct()(ze,Hn&&"".concat(ht,"-out-of-range")),style:(0,pt.Z)((0,pt.Z)({},Me),Vi&&!wn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof mi=="string"?mi:void 0}},hidden:Te,readOnly:pn,onClear:on},kt.createElement($e,(0,le.Z)({},Ot,{autoSize:Nt,maxLength:En,onKeyDown:ir,onChange:$i,onFocus:Mt,onBlur:_t,onCompositionStart:ki,onCompositionEnd:Ji,className:Ct()(He==null?void 0:He.textarea),style:(0,pt.Z)((0,pt.Z)({},Ae==null?void 0:Ae.textarea),{},{resize:Me==null?void 0:Me.resize}),disabled:Ee,prefixCls:ht,onResize:fi,ref:Mr,readOnly:pn})))}),Bt=Pt,fn=Bt},639:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(71409),Ue=Le(87075),pt=Le(89490),St=Le(11036),yt=Le(39224),Oe=Le(59301),at=Le(92310),Ct=Le.n(at),ot=Le(26112),We=Le(30699),Tt=function(Ce){for(var _e=Ce.prefixCls,Ze=Ce.level,st=Ce.isStart,nt=Ce.isEnd,Ye="".concat(_e,"-indent-unit"),ct=[],$e=0;$e<Ze;$e+=1)ct.push(Oe.createElement("span",{key:$e,className:Ct()(Ye,(0,Ue.Z)((0,Ue.Z)({},"".concat(Ye,"-start"),st[$e]),"".concat(Ye,"-end"),nt[$e]))}));return Oe.createElement("span",{"aria-hidden":"true",className:"".concat(_e,"-indent")},ct)},dt=Oe.memo(Tt),kt=Le(65065),De=Le(34061),ne=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],te="open",de="close",se="---",pe=function(Ce){var _e,Ze,st,nt=Ce.eventKey,Ye=Ce.className,ct=Ce.style,$e=Ce.dragOver,Et=Ce.dragOverGapTop,Pt=Ce.dragOverGapBottom,Bt=Ce.isLeaf,fn=Ce.isStart,qt=Ce.isEnd,vn=Ce.expanded,tn=Ce.selected,it=Ce.checked,rt=Ce.halfChecked,dn=Ce.loading,ni=Ce.domRef,Kn=Ce.active,Rt=Ce.data,En=Ce.onMouseMove,Bn=Ce.selectable,ui=(0,yt.Z)(Ce,ne),It=Oe.useContext(We.k),On=Oe.useContext(We.y),ht=Oe.useRef(null),kn=Oe.useState(!1),Oi=(0,St.Z)(kn,2),ze=Oi[0],Me=Oi[1],Ee=!!(It.disabled||Ce.disabled||(_e=On.nodeDisabled)!==null&&_e!==void 0&&_e.call(On,Rt)),Te=Oe.useMemo(function(){return!It.checkable||Ce.checkable===!1?!1:It.checkable},[It.checkable,Ce.checkable]),He=function(li){Ee||It.onNodeSelect(li,(0,De.F)(Ce))},Ae=function(li){Ee||!Te||Ce.disableCheckbox||It.onNodeCheck(li,(0,De.F)(Ce),!it)},et=Oe.useMemo(function(){return typeof Bn=="boolean"?Bn:It.selectable},[Bn,It.selectable]),on=function(li){It.onNodeClick(li,(0,De.F)(Ce)),et?He(li):Ae(li)},Kt=function(li){It.onNodeDoubleClick(li,(0,De.F)(Ce))},pn=function(li){It.onNodeMouseEnter(li,(0,De.F)(Ce))},Nt=function(li){It.onNodeMouseLeave(li,(0,De.F)(Ce))},Dt=function(li){It.onNodeContextMenu(li,(0,De.F)(Ce))},Ot=Oe.useMemo(function(){return!!(It.draggable&&(!It.draggable.nodeDraggable||It.draggable.nodeDraggable(Rt)))},[It.draggable,Rt]),un=function(li){li.stopPropagation(),Me(!0),It.onNodeDragStart(li,Ce);try{li.dataTransfer.setData("text/plain","")}catch(Hn){}},Sn=function(li){li.preventDefault(),li.stopPropagation(),It.onNodeDragEnter(li,Ce)},An=function(li){li.preventDefault(),li.stopPropagation(),It.onNodeDragOver(li,Ce)},Dn=function(li){li.stopPropagation(),It.onNodeDragLeave(li,Ce)},Ai=function(li){li.stopPropagation(),Me(!1),It.onNodeDragEnd(li,Ce)},en=function(li){li.preventDefault(),li.stopPropagation(),Me(!1),It.onNodeDrop(li,Ce)},Qt=function(li){dn||It.onNodeExpand(li,(0,De.F)(Ce))},ln=Oe.useMemo(function(){var gn=(0,kt.Z)(It.keyEntities,nt)||{},li=gn.children;return!!(li||[]).length},[It.keyEntities,nt]),di=Oe.useMemo(function(){return Bt===!1?!1:Bt||!It.loadData&&!ln||It.loadData&&Ce.loaded&&!ln},[Bt,It.loadData,ln,Ce.loaded]);Oe.useEffect(function(){dn||typeof It.loadData=="function"&&vn&&!di&&!Ce.loaded&&It.onNodeLoad((0,De.F)(Ce))},[dn,It.loadData,It.onNodeLoad,vn,di,Ce]);var cn=Oe.useMemo(function(){var gn;return(gn=It.draggable)!==null&&gn!==void 0&&gn.icon?Oe.createElement("span",{className:"".concat(It.prefixCls,"-draggable-icon")},It.draggable.icon):null},[It.draggable]),Yt=function(li){var Hn=Ce.switcherIcon||It.switcherIcon;return typeof Hn=="function"?Hn((0,pt.Z)((0,pt.Z)({},Ce),{},{isLeaf:li})):Hn},ii=function(){if(di){var li=Yt(!0);return li!==!1?Oe.createElement("span",{className:Ct()("".concat(It.prefixCls,"-switcher"),"".concat(It.prefixCls,"-switcher-noop"))},li):null}var Hn=Yt(!1);return Hn!==!1?Oe.createElement("span",{onClick:Qt,className:Ct()("".concat(It.prefixCls,"-switcher"),"".concat(It.prefixCls,"-switcher_").concat(vn?te:de))},Hn):null},Vi=Oe.useMemo(function(){if(!Te)return null;var gn=typeof Te!="boolean"?Te:null;return Oe.createElement("span",{className:Ct()("".concat(It.prefixCls,"-checkbox"),(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)({},"".concat(It.prefixCls,"-checkbox-checked"),it),"".concat(It.prefixCls,"-checkbox-indeterminate"),!it&&rt),"".concat(It.prefixCls,"-checkbox-disabled"),Ee||Ce.disableCheckbox)),onClick:Ae,role:"checkbox","aria-checked":rt?"mixed":it,"aria-disabled":Ee||Ce.disableCheckbox,"aria-label":"Select ".concat(typeof Ce.title=="string"?Ce.title:"tree node")},gn)},[Te,it,rt,Ee,Ce.disableCheckbox,Ce.title]),bi=Oe.useMemo(function(){return di?null:vn?te:de},[di,vn]),Di=Oe.useMemo(function(){return Oe.createElement("span",{className:Ct()("".concat(It.prefixCls,"-iconEle"),"".concat(It.prefixCls,"-icon__").concat(bi||"docu"),(0,Ue.Z)({},"".concat(It.prefixCls,"-icon_loading"),dn))})},[It.prefixCls,bi,dn]),Mr=Oe.useMemo(function(){var gn=!!It.draggable,li=!Ce.disabled&&gn&&It.dragOverNodeKey===nt;return li?It.dropIndicatorRender({dropPosition:It.dropPosition,dropLevelOffset:It.dropLevelOffset,indent:It.indent,prefixCls:It.prefixCls,direction:It.direction}):null},[It.dropPosition,It.dropLevelOffset,It.indent,It.prefixCls,It.direction,It.draggable,It.dragOverNodeKey,It.dropIndicatorRender]),Gn=Oe.useMemo(function(){var gn=Ce.title,li=gn===void 0?se:gn,Hn="".concat(It.prefixCls,"-node-content-wrapper"),oi;if(It.showIcon){var ki=Ce.icon||It.icon;oi=ki?Oe.createElement("span",{className:Ct()("".concat(It.prefixCls,"-iconEle"),"".concat(It.prefixCls,"-icon__customize"))},typeof ki=="function"?ki(Ce):ki):Di}else It.loadData&&dn&&(oi=Di);var Ji;return typeof li=="function"?Ji=li(Rt):It.titleRender?Ji=It.titleRender(Rt):Ji=li,Oe.createElement("span",{ref:ht,title:typeof li=="string"?li:"",className:Ct()(Hn,"".concat(Hn,"-").concat(bi||"normal"),(0,Ue.Z)({},"".concat(It.prefixCls,"-node-selected"),!Ee&&(tn||ze))),onMouseEnter:pn,onMouseLeave:Nt,onContextMenu:Dt,onClick:on,onDoubleClick:Kt},oi,Oe.createElement("span",{className:"".concat(It.prefixCls,"-title")},Ji),Mr)},[It.prefixCls,It.showIcon,Ce,It.icon,Di,It.titleRender,Rt,bi,pn,Nt,Dt,on,Kt]),Rn=(0,ot.Z)(ui,{aria:!0,data:!0}),Jn=(0,kt.Z)(It.keyEntities,nt)||{},Ni=Jn.level,ji=qt[qt.length-1],Gi=!Ee&&Ot,Fr=It.draggingNodeKey===nt,be=Bn!==void 0?{"aria-selected":!!Bn}:void 0;return Oe.createElement("div",(0,le.Z)({ref:ni,role:"treeitem","aria-expanded":Bt?void 0:vn,className:Ct()(Ye,"".concat(It.prefixCls,"-treenode"),(st={},(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)(st,"".concat(It.prefixCls,"-treenode-disabled"),Ee),"".concat(It.prefixCls,"-treenode-switcher-").concat(vn?"open":"close"),!Bt),"".concat(It.prefixCls,"-treenode-checkbox-checked"),it),"".concat(It.prefixCls,"-treenode-checkbox-indeterminate"),rt),"".concat(It.prefixCls,"-treenode-selected"),tn),"".concat(It.prefixCls,"-treenode-loading"),dn),"".concat(It.prefixCls,"-treenode-active"),Kn),"".concat(It.prefixCls,"-treenode-leaf-last"),ji),"".concat(It.prefixCls,"-treenode-draggable"),Ot),"dragging",Fr),(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)(st,"drop-target",It.dropTargetKey===nt),"drop-container",It.dropContainerKey===nt),"drag-over",!Ee&&$e),"drag-over-gap-top",!Ee&&Et),"drag-over-gap-bottom",!Ee&&Pt),"filter-node",(Ze=It.filterTreeNode)===null||Ze===void 0?void 0:Ze.call(It,(0,De.F)(Ce))),"".concat(It.prefixCls,"-treenode-leaf"),di))),style:ct,draggable:Gi,onDragStart:Gi?un:void 0,onDragEnter:Ot?Sn:void 0,onDragOver:Ot?An:void 0,onDragLeave:Ot?Dn:void 0,onDrop:Ot?en:void 0,onDragEnd:Ot?Ai:void 0,onMouseMove:En},be,Rn),Oe.createElement(dt,{prefixCls:It.prefixCls,level:Ni,isStart:fn,isEnd:qt}),cn,ii(),Vi,Gn)};pe.isTreeNode=1;var ye=pe},30699:function(Zn,ei,Le){"use strict";Le.d(ei,{k:function(){return Ue},y:function(){return pt}});var le=Le(59301),Ue=le.createContext(null),pt=le.createContext({})},62379:function(Zn,ei,Le){"use strict";Le.d(ei,{OF:function(){return nt.Z},y6:function(){return de.y},ZP:function(){return Ee}});var le=Le(71409),Ue=Le(28788),pt=Le(89490),St=Le(62730),yt=Le(16552),Oe=Le(19210),at=Le(90264),Ct=Le(46654),ot=Le(37205),We=Le(87075),Tt=Le(92310),dt=Le.n(Tt),kt=Le(10228),De=Le(26112),ne=Le(48736),te=Le(59301),de=Le(30699),se=function(He){var Ae=He.dropPosition,et=He.dropLevelOffset,on=He.indent,Kt={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Ae){case-1:Kt.top=0,Kt.left=-et*on;break;case 1:Kt.bottom=0,Kt.left=-et*on;break;case 0:Kt.bottom=0,Kt.left=on;break}return te.createElement("div",{style:Kt})},pe=se;function ye(Te){if(Te==null)throw new TypeError("Cannot destructure "+Te)}var we=Le(11036),Ce=Le(39224),_e=Le(34280),Ze=Le(65283),st=Le(77900),nt=Le(639);function Ye(Te,He){var Ae=te.useState(!1),et=(0,we.Z)(Ae,2),on=et[0],Kt=et[1];(0,_e.Z)(function(){if(on)return Te(),function(){He()}},[on]),(0,_e.Z)(function(){return Kt(!0),function(){Kt(!1)}},[])}var ct=Ye,$e=Le(34061),Et=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],Pt=te.forwardRef(function(Te,He){var Ae=Te.className,et=Te.style,on=Te.motion,Kt=Te.motionNodes,pn=Te.motionType,Nt=Te.onMotionStart,Dt=Te.onMotionEnd,Ot=Te.active,un=Te.treeNodeRequiredProps,Sn=(0,Ce.Z)(Te,Et),An=te.useState(!0),Dn=(0,we.Z)(An,2),Ai=Dn[0],en=Dn[1],Qt=te.useContext(de.k),ln=Qt.prefixCls,di=Kt&&pn!=="hide";(0,_e.Z)(function(){Kt&&di!==Ai&&en(di)},[Kt]);var cn=function(){Kt&&Nt()},Yt=te.useRef(!1),ii=function(){Kt&&!Yt.current&&(Yt.current=!0,Dt())};ct(cn,ii);var Vi=function(Di){di===Di&&ii()};return Kt?te.createElement(st.default,(0,le.Z)({ref:He,visible:Ai},on,{motionAppear:pn==="show",onVisibleChanged:Vi}),function(bi,Di){var Mr=bi.className,Gn=bi.style;return te.createElement("div",{ref:Di,className:dt()("".concat(ln,"-treenode-motion"),Mr),style:Gn},Kt.map(function(Rn){var Jn=Object.assign({},(ye(Rn.data),Rn.data)),Ni=Rn.title,ji=Rn.key,Gi=Rn.isStart,Fr=Rn.isEnd;delete Jn.children;var be=(0,$e.H8)(ji,un);return te.createElement(nt.Z,(0,le.Z)({},Jn,be,{title:Ni,active:Ot,data:Rn.data,key:ji,isStart:Gi,isEnd:Fr}))}))}):te.createElement(nt.Z,(0,le.Z)({domRef:He,className:Ae,style:et},Sn,{active:Ot}))}),Bt=Pt;function fn(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ae=Te.length,et=He.length;if(Math.abs(Ae-et)!==1)return{add:!1,key:null};function on(Kt,pn){var Nt=new Map;Kt.forEach(function(Ot){Nt.set(Ot,!0)});var Dt=pn.filter(function(Ot){return!Nt.has(Ot)});return Dt.length===1?Dt[0]:null}return Ae<et?{add:!0,key:on(Te,He)}:{add:!1,key:on(He,Te)}}function qt(Te,He,Ae){var et=Te.findIndex(function(Nt){return Nt.key===Ae}),on=Te[et+1],Kt=He.findIndex(function(Nt){return Nt.key===Ae});if(on){var pn=He.findIndex(function(Nt){return Nt.key===on.key});return He.slice(Kt+1,pn)}return He.slice(Kt+1)}var vn=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],tn={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},it=function(){},rt="RC_TREE_MOTION_".concat(Math.random()),dn={key:rt},ni={key:rt,level:0,index:0,pos:"0",node:dn,nodes:[dn]},Kn={parent:null,children:[],pos:ni.pos,data:dn,title:null,key:rt,isStart:[],isEnd:[]};function Rt(Te,He,Ae,et){return He===!1||!Ae?Te:Te.slice(0,Math.ceil(Ae/et)+1)}function En(Te){var He=Te.key,Ae=Te.pos;return(0,$e.km)(He,Ae)}function Bn(Te){for(var He=String(Te.data.key),Ae=Te;Ae.parent;)Ae=Ae.parent,He="".concat(Ae.data.key," > ").concat(He);return He}var ui=te.forwardRef(function(Te,He){var Ae=Te.prefixCls,et=Te.data,on=Te.selectable,Kt=Te.checkable,pn=Te.expandedKeys,Nt=Te.selectedKeys,Dt=Te.checkedKeys,Ot=Te.loadedKeys,un=Te.loadingKeys,Sn=Te.halfCheckedKeys,An=Te.keyEntities,Dn=Te.disabled,Ai=Te.dragging,en=Te.dragOverNodeKey,Qt=Te.dropPosition,ln=Te.motion,di=Te.height,cn=Te.itemHeight,Yt=Te.virtual,ii=Te.scrollWidth,Vi=Te.focusable,bi=Te.activeItem,Di=Te.focused,Mr=Te.tabIndex,Gn=Te.onKeyDown,Rn=Te.onFocus,Jn=Te.onBlur,Ni=Te.onActiveChange,ji=Te.onListChangeStart,Gi=Te.onListChangeEnd,Fr=(0,Ce.Z)(Te,vn),be=te.useRef(null),gn=te.useRef(null);te.useImperativeHandle(He,function(){return{scrollTo:function(ri){be.current.scrollTo(ri)},getIndentWidth:function(){return gn.current.offsetWidth}}});var li=te.useState(pn),Hn=(0,we.Z)(li,2),oi=Hn[0],ki=Hn[1],Ji=te.useState(et),$i=(0,we.Z)(Ji,2),ir=$i[0],Mt=$i[1],_t=te.useState(et),At=(0,we.Z)(_t,2),xi=At[0],mi=At[1],fi=te.useState([]),wn=(0,we.Z)(fi,2),Yn=wn[0],Qi=wn[1],vr=te.useState(null),Dr=(0,we.Z)(vr,2),Ke=Dr[0],Lt=Dr[1],_n=te.useRef(et);_n.current=et;function ci(){var Xt=_n.current;Mt(Xt),mi(Xt),Qi([]),Lt(null),Gi()}(0,_e.Z)(function(){ki(pn);var Xt=fn(oi,pn);if(Xt.key!==null)if(Xt.add){var ri=ir.findIndex(function(xr){var Sr=xr.key;return Sr===Xt.key}),Hi=Rt(qt(ir,et,Xt.key),Yt,di,cn),gi=ir.slice();gi.splice(ri+1,0,Kn),mi(gi),Qi(Hi),Lt("show")}else{var Ii=et.findIndex(function(xr){var Sr=xr.key;return Sr===Xt.key}),Fi=Rt(qt(et,ir,Xt.key),Yt,di,cn),Cr=et.slice();Cr.splice(Ii+1,0,Kn),mi(Cr),Qi(Fi),Lt("hide")}else ir!==et&&(Mt(et),mi(et))},[pn,et]),te.useEffect(function(){Ai||ci()},[Ai]);var $t=ln?xi:et,xn={expandedKeys:pn,selectedKeys:Nt,loadedKeys:Ot,loadingKeys:un,checkedKeys:Dt,halfCheckedKeys:Sn,dragOverNodeKey:en,dropPosition:Qt,keyEntities:An};return te.createElement(te.Fragment,null,Di&&bi&&te.createElement("span",{style:tn,"aria-live":"assertive"},Bn(bi)),te.createElement("div",null,te.createElement("input",{style:tn,disabled:Vi===!1||Dn,tabIndex:Vi!==!1?Mr:null,onKeyDown:Gn,onFocus:Rn,onBlur:Jn,value:"",onChange:it,"aria-label":"for screen reader"})),te.createElement("div",{className:"".concat(Ae,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},te.createElement("div",{className:"".concat(Ae,"-indent")},te.createElement("div",{ref:gn,className:"".concat(Ae,"-indent-unit")}))),te.createElement(Ze.Z,(0,le.Z)({},Fr,{data:$t,itemKey:En,height:di,fullHeight:!1,virtual:Yt,itemHeight:cn,scrollWidth:ii,prefixCls:"".concat(Ae,"-list"),ref:be,role:"tree",onVisibleChange:function(ri){ri.every(function(Hi){return En(Hi)!==rt})&&ci()}}),function(Xt){var ri=Xt.pos,Hi=Object.assign({},(ye(Xt.data),Xt.data)),gi=Xt.title,Ii=Xt.key,Fi=Xt.isStart,Cr=Xt.isEnd,xr=(0,$e.km)(Ii,ri);delete Hi.key,delete Hi.children;var Sr=(0,$e.H8)(xr,xn);return te.createElement(Bt,(0,le.Z)({},Hi,Sr,{title:gi,active:!!bi&&Ii===bi.key,pos:ri,data:Xt.data,isStart:Fi,isEnd:Cr,motion:ln,motionNodes:Ii===rt?Yn:null,motionType:Ke,onMotionStart:ji,onMotionEnd:ci,treeNodeRequiredProps:xn,onMouseMove:function(){Ni(null)}}))}))}),It=ui,On=Le(82661),ht=Le(34643),kn=Le(65065),Oi=10,ze=function(Te){(0,Ct.Z)(Ae,Te);var He=(0,ot.Z)(Ae);function Ae(){var et;(0,yt.Z)(this,Ae);for(var on=arguments.length,Kt=new Array(on),pn=0;pn<on;pn++)Kt[pn]=arguments[pn];return et=He.call.apply(He,[this].concat(Kt)),(0,We.Z)((0,at.Z)(et),"destroyed",!1),(0,We.Z)((0,at.Z)(et),"delayedDragEnterLogic",void 0),(0,We.Z)((0,at.Z)(et),"loadingRetryTimes",{}),(0,We.Z)((0,at.Z)(et),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,$e.w$)()}),(0,We.Z)((0,at.Z)(et),"dragStartMousePosition",null),(0,We.Z)((0,at.Z)(et),"dragNodeProps",null),(0,We.Z)((0,at.Z)(et),"currentMouseOverDroppableNodeKey",null),(0,We.Z)((0,at.Z)(et),"listRef",te.createRef()),(0,We.Z)((0,at.Z)(et),"onNodeDragStart",function(Nt,Dt){var Ot=et.state,un=Ot.expandedKeys,Sn=Ot.keyEntities,An=et.props.onDragStart,Dn=Dt.eventKey;et.dragNodeProps=Dt,et.dragStartMousePosition={x:Nt.clientX,y:Nt.clientY};var Ai=(0,On._5)(un,Dn);et.setState({draggingNodeKey:Dn,dragChildrenKeys:(0,On.wA)(Dn,Sn),indent:et.listRef.current.getIndentWidth()}),et.setExpandedKeys(Ai),window.addEventListener("dragend",et.onWindowDragEnd),An==null||An({event:Nt,node:(0,$e.F)(Dt)})}),(0,We.Z)((0,at.Z)(et),"onNodeDragEnter",function(Nt,Dt){var Ot=et.state,un=Ot.expandedKeys,Sn=Ot.keyEntities,An=Ot.dragChildrenKeys,Dn=Ot.flattenNodes,Ai=Ot.indent,en=et.props,Qt=en.onDragEnter,ln=en.onExpand,di=en.allowDrop,cn=en.direction,Yt=Dt.pos,ii=Dt.eventKey;if(et.currentMouseOverDroppableNodeKey!==ii&&(et.currentMouseOverDroppableNodeKey=ii),!et.dragNodeProps){et.resetDragState();return}var Vi=(0,On.OM)(Nt,et.dragNodeProps,Dt,Ai,et.dragStartMousePosition,di,Dn,Sn,un,cn),bi=Vi.dropPosition,Di=Vi.dropLevelOffset,Mr=Vi.dropTargetKey,Gn=Vi.dropContainerKey,Rn=Vi.dropTargetPos,Jn=Vi.dropAllowed,Ni=Vi.dragOverNodeKey;if(An.includes(Mr)||!Jn){et.resetDragState();return}if(et.delayedDragEnterLogic||(et.delayedDragEnterLogic={}),Object.keys(et.delayedDragEnterLogic).forEach(function(ji){clearTimeout(et.delayedDragEnterLogic[ji])}),et.dragNodeProps.eventKey!==Dt.eventKey&&(Nt.persist(),et.delayedDragEnterLogic[Yt]=window.setTimeout(function(){if(et.state.draggingNodeKey!==null){var ji=(0,St.Z)(un),Gi=(0,kn.Z)(Sn,Dt.eventKey);Gi&&(Gi.children||[]).length&&(ji=(0,On.L0)(un,Dt.eventKey)),et.props.hasOwnProperty("expandedKeys")||et.setExpandedKeys(ji),ln==null||ln(ji,{node:(0,$e.F)(Dt),expanded:!0,nativeEvent:Nt.nativeEvent})}},800)),et.dragNodeProps.eventKey===Mr&&Di===0){et.resetDragState();return}et.setState({dragOverNodeKey:Ni,dropPosition:bi,dropLevelOffset:Di,dropTargetKey:Mr,dropContainerKey:Gn,dropTargetPos:Rn,dropAllowed:Jn}),Qt==null||Qt({event:Nt,node:(0,$e.F)(Dt),expandedKeys:un})}),(0,We.Z)((0,at.Z)(et),"onNodeDragOver",function(Nt,Dt){var Ot=et.state,un=Ot.dragChildrenKeys,Sn=Ot.flattenNodes,An=Ot.keyEntities,Dn=Ot.expandedKeys,Ai=Ot.indent,en=et.props,Qt=en.onDragOver,ln=en.allowDrop,di=en.direction;if(et.dragNodeProps){var cn=(0,On.OM)(Nt,et.dragNodeProps,Dt,Ai,et.dragStartMousePosition,ln,Sn,An,Dn,di),Yt=cn.dropPosition,ii=cn.dropLevelOffset,Vi=cn.dropTargetKey,bi=cn.dropContainerKey,Di=cn.dropTargetPos,Mr=cn.dropAllowed,Gn=cn.dragOverNodeKey;un.includes(Vi)||!Mr||(et.dragNodeProps.eventKey===Vi&&ii===0?et.state.dropPosition===null&&et.state.dropLevelOffset===null&&et.state.dropTargetKey===null&&et.state.dropContainerKey===null&&et.state.dropTargetPos===null&&et.state.dropAllowed===!1&&et.state.dragOverNodeKey===null||et.resetDragState():Yt===et.state.dropPosition&&ii===et.state.dropLevelOffset&&Vi===et.state.dropTargetKey&&bi===et.state.dropContainerKey&&Di===et.state.dropTargetPos&&Mr===et.state.dropAllowed&&Gn===et.state.dragOverNodeKey||et.setState({dropPosition:Yt,dropLevelOffset:ii,dropTargetKey:Vi,dropContainerKey:bi,dropTargetPos:Di,dropAllowed:Mr,dragOverNodeKey:Gn}),Qt==null||Qt({event:Nt,node:(0,$e.F)(Dt)}))}}),(0,We.Z)((0,at.Z)(et),"onNodeDragLeave",function(Nt,Dt){et.currentMouseOverDroppableNodeKey===Dt.eventKey&&!Nt.currentTarget.contains(Nt.relatedTarget)&&(et.resetDragState(),et.currentMouseOverDroppableNodeKey=null);var Ot=et.props.onDragLeave;Ot==null||Ot({event:Nt,node:(0,$e.F)(Dt)})}),(0,We.Z)((0,at.Z)(et),"onWindowDragEnd",function(Nt){et.onNodeDragEnd(Nt,null,!0),window.removeEventListener("dragend",et.onWindowDragEnd)}),(0,We.Z)((0,at.Z)(et),"onNodeDragEnd",function(Nt,Dt){var Ot=et.props.onDragEnd;et.setState({dragOverNodeKey:null}),et.cleanDragState(),Ot==null||Ot({event:Nt,node:(0,$e.F)(Dt)}),et.dragNodeProps=null,window.removeEventListener("dragend",et.onWindowDragEnd)}),(0,We.Z)((0,at.Z)(et),"onNodeDrop",function(Nt,Dt){var Ot,un=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Sn=et.state,An=Sn.dragChildrenKeys,Dn=Sn.dropPosition,Ai=Sn.dropTargetKey,en=Sn.dropTargetPos,Qt=Sn.dropAllowed;if(Qt){var ln=et.props.onDrop;if(et.setState({dragOverNodeKey:null}),et.cleanDragState(),Ai!==null){var di=(0,pt.Z)((0,pt.Z)({},(0,$e.H8)(Ai,et.getTreeNodeRequiredProps())),{},{active:((Ot=et.getActiveItem())===null||Ot===void 0?void 0:Ot.key)===Ai,data:(0,kn.Z)(et.state.keyEntities,Ai).node}),cn=An.includes(Ai);(0,ne.ZP)(!cn,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Yt=(0,On.yx)(en),ii={event:Nt,node:(0,$e.F)(di),dragNode:et.dragNodeProps?(0,$e.F)(et.dragNodeProps):null,dragNodesKeys:[et.dragNodeProps.eventKey].concat(An),dropToGap:Dn!==0,dropPosition:Dn+Number(Yt[Yt.length-1])};un||ln==null||ln(ii),et.dragNodeProps=null}}}),(0,We.Z)((0,at.Z)(et),"cleanDragState",function(){var Nt=et.state.draggingNodeKey;Nt!==null&&et.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),et.dragStartMousePosition=null,et.currentMouseOverDroppableNodeKey=null}),(0,We.Z)((0,at.Z)(et),"triggerExpandActionExpand",function(Nt,Dt){var Ot=et.state,un=Ot.expandedKeys,Sn=Ot.flattenNodes,An=Dt.expanded,Dn=Dt.key,Ai=Dt.isLeaf;if(!(Ai||Nt.shiftKey||Nt.metaKey||Nt.ctrlKey)){var en=Sn.filter(function(ln){return ln.key===Dn})[0],Qt=(0,$e.F)((0,pt.Z)((0,pt.Z)({},(0,$e.H8)(Dn,et.getTreeNodeRequiredProps())),{},{data:en.data}));et.setExpandedKeys(An?(0,On._5)(un,Dn):(0,On.L0)(un,Dn)),et.onNodeExpand(Nt,Qt)}}),(0,We.Z)((0,at.Z)(et),"onNodeClick",function(Nt,Dt){var Ot=et.props,un=Ot.onClick,Sn=Ot.expandAction;Sn==="click"&&et.triggerExpandActionExpand(Nt,Dt),un==null||un(Nt,Dt)}),(0,We.Z)((0,at.Z)(et),"onNodeDoubleClick",function(Nt,Dt){var Ot=et.props,un=Ot.onDoubleClick,Sn=Ot.expandAction;Sn==="doubleClick"&&et.triggerExpandActionExpand(Nt,Dt),un==null||un(Nt,Dt)}),(0,We.Z)((0,at.Z)(et),"onNodeSelect",function(Nt,Dt){var Ot=et.state.selectedKeys,un=et.state,Sn=un.keyEntities,An=un.fieldNames,Dn=et.props,Ai=Dn.onSelect,en=Dn.multiple,Qt=Dt.selected,ln=Dt[An.key],di=!Qt;di?en?Ot=(0,On.L0)(Ot,ln):Ot=[ln]:Ot=(0,On._5)(Ot,ln);var cn=Ot.map(function(Yt){var ii=(0,kn.Z)(Sn,Yt);return ii?ii.node:null}).filter(Boolean);et.setUncontrolledState({selectedKeys:Ot}),Ai==null||Ai(Ot,{event:"select",selected:di,node:Dt,selectedNodes:cn,nativeEvent:Nt.nativeEvent})}),(0,We.Z)((0,at.Z)(et),"onNodeCheck",function(Nt,Dt,Ot){var un=et.state,Sn=un.keyEntities,An=un.checkedKeys,Dn=un.halfCheckedKeys,Ai=et.props,en=Ai.checkStrictly,Qt=Ai.onCheck,ln=Dt.key,di,cn={event:"check",node:Dt,checked:Ot,nativeEvent:Nt.nativeEvent};if(en){var Yt=Ot?(0,On.L0)(An,ln):(0,On._5)(An,ln),ii=(0,On._5)(Dn,ln);di={checked:Yt,halfChecked:ii},cn.checkedNodes=Yt.map(function(Rn){return(0,kn.Z)(Sn,Rn)}).filter(Boolean).map(function(Rn){return Rn.node}),et.setUncontrolledState({checkedKeys:Yt})}else{var Vi=(0,ht.S)([].concat((0,St.Z)(An),[ln]),!0,Sn),bi=Vi.checkedKeys,Di=Vi.halfCheckedKeys;if(!Ot){var Mr=new Set(bi);Mr.delete(ln);var Gn=(0,ht.S)(Array.from(Mr),{checked:!1,halfCheckedKeys:Di},Sn);bi=Gn.checkedKeys,Di=Gn.halfCheckedKeys}di=bi,cn.checkedNodes=[],cn.checkedNodesPositions=[],cn.halfCheckedKeys=Di,bi.forEach(function(Rn){var Jn=(0,kn.Z)(Sn,Rn);if(Jn){var Ni=Jn.node,ji=Jn.pos;cn.checkedNodes.push(Ni),cn.checkedNodesPositions.push({node:Ni,pos:ji})}}),et.setUncontrolledState({checkedKeys:bi},!1,{halfCheckedKeys:Di})}Qt==null||Qt(di,cn)}),(0,We.Z)((0,at.Z)(et),"onNodeLoad",function(Nt){var Dt,Ot=Nt.key,un=et.state.keyEntities,Sn=(0,kn.Z)(un,Ot);if(!(Sn!=null&&(Dt=Sn.children)!==null&&Dt!==void 0&&Dt.length)){var An=new Promise(function(Dn,Ai){et.setState(function(en){var Qt=en.loadedKeys,ln=Qt===void 0?[]:Qt,di=en.loadingKeys,cn=di===void 0?[]:di,Yt=et.props,ii=Yt.loadData,Vi=Yt.onLoad;if(!ii||ln.includes(Ot)||cn.includes(Ot))return null;var bi=ii(Nt);return bi.then(function(){var Di=et.state.loadedKeys,Mr=(0,On.L0)(Di,Ot);Vi==null||Vi(Mr,{event:"load",node:Nt}),et.setUncontrolledState({loadedKeys:Mr}),et.setState(function(Gn){return{loadingKeys:(0,On._5)(Gn.loadingKeys,Ot)}}),Dn()}).catch(function(Di){if(et.setState(function(Gn){return{loadingKeys:(0,On._5)(Gn.loadingKeys,Ot)}}),et.loadingRetryTimes[Ot]=(et.loadingRetryTimes[Ot]||0)+1,et.loadingRetryTimes[Ot]>=Oi){var Mr=et.state.loadedKeys;(0,ne.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),et.setUncontrolledState({loadedKeys:(0,On.L0)(Mr,Ot)}),Dn()}Ai(Di)}),{loadingKeys:(0,On.L0)(cn,Ot)}})});return An.catch(function(){}),An}}),(0,We.Z)((0,at.Z)(et),"onNodeMouseEnter",function(Nt,Dt){var Ot=et.props.onMouseEnter;Ot==null||Ot({event:Nt,node:Dt})}),(0,We.Z)((0,at.Z)(et),"onNodeMouseLeave",function(Nt,Dt){var Ot=et.props.onMouseLeave;Ot==null||Ot({event:Nt,node:Dt})}),(0,We.Z)((0,at.Z)(et),"onNodeContextMenu",function(Nt,Dt){var Ot=et.props.onRightClick;Ot&&(Nt.preventDefault(),Ot({event:Nt,node:Dt}))}),(0,We.Z)((0,at.Z)(et),"onFocus",function(){var Nt=et.props.onFocus;et.setState({focused:!0});for(var Dt=arguments.length,Ot=new Array(Dt),un=0;un<Dt;un++)Ot[un]=arguments[un];Nt==null||Nt.apply(void 0,Ot)}),(0,We.Z)((0,at.Z)(et),"onBlur",function(){var Nt=et.props.onBlur;et.setState({focused:!1}),et.onActiveChange(null);for(var Dt=arguments.length,Ot=new Array(Dt),un=0;un<Dt;un++)Ot[un]=arguments[un];Nt==null||Nt.apply(void 0,Ot)}),(0,We.Z)((0,at.Z)(et),"getTreeNodeRequiredProps",function(){var Nt=et.state,Dt=Nt.expandedKeys,Ot=Nt.selectedKeys,un=Nt.loadedKeys,Sn=Nt.loadingKeys,An=Nt.checkedKeys,Dn=Nt.halfCheckedKeys,Ai=Nt.dragOverNodeKey,en=Nt.dropPosition,Qt=Nt.keyEntities;return{expandedKeys:Dt||[],selectedKeys:Ot||[],loadedKeys:un||[],loadingKeys:Sn||[],checkedKeys:An||[],halfCheckedKeys:Dn||[],dragOverNodeKey:Ai,dropPosition:en,keyEntities:Qt}}),(0,We.Z)((0,at.Z)(et),"setExpandedKeys",function(Nt){var Dt=et.state,Ot=Dt.treeData,un=Dt.fieldNames,Sn=(0,$e.oH)(Ot,Nt,un);et.setUncontrolledState({expandedKeys:Nt,flattenNodes:Sn},!0)}),(0,We.Z)((0,at.Z)(et),"onNodeExpand",function(Nt,Dt){var Ot=et.state.expandedKeys,un=et.state,Sn=un.listChanging,An=un.fieldNames,Dn=et.props,Ai=Dn.onExpand,en=Dn.loadData,Qt=Dt.expanded,ln=Dt[An.key];if(!Sn){var di=Ot.includes(ln),cn=!Qt;if((0,ne.ZP)(Qt&&di||!Qt&&!di,"Expand state not sync with index check"),Ot=cn?(0,On.L0)(Ot,ln):(0,On._5)(Ot,ln),et.setExpandedKeys(Ot),Ai==null||Ai(Ot,{node:Dt,expanded:cn,nativeEvent:Nt.nativeEvent}),cn&&en){var Yt=et.onNodeLoad(Dt);Yt&&Yt.then(function(){var ii=(0,$e.oH)(et.state.treeData,Ot,An);et.setUncontrolledState({flattenNodes:ii})}).catch(function(){var ii=et.state.expandedKeys,Vi=(0,On._5)(ii,ln);et.setExpandedKeys(Vi)})}}}),(0,We.Z)((0,at.Z)(et),"onListChangeStart",function(){et.setUncontrolledState({listChanging:!0})}),(0,We.Z)((0,at.Z)(et),"onListChangeEnd",function(){setTimeout(function(){et.setUncontrolledState({listChanging:!1})})}),(0,We.Z)((0,at.Z)(et),"onActiveChange",function(Nt){var Dt=et.state.activeKey,Ot=et.props,un=Ot.onActiveChange,Sn=Ot.itemScrollOffset,An=Sn===void 0?0:Sn;Dt!==Nt&&(et.setState({activeKey:Nt}),Nt!==null&&et.scrollTo({key:Nt,offset:An}),un==null||un(Nt))}),(0,We.Z)((0,at.Z)(et),"getActiveItem",function(){var Nt=et.state,Dt=Nt.activeKey,Ot=Nt.flattenNodes;return Dt===null?null:Ot.find(function(un){var Sn=un.key;return Sn===Dt})||null}),(0,We.Z)((0,at.Z)(et),"offsetActiveKey",function(Nt){var Dt=et.state,Ot=Dt.flattenNodes,un=Dt.activeKey,Sn=Ot.findIndex(function(Ai){var en=Ai.key;return en===un});Sn===-1&&Nt<0&&(Sn=Ot.length),Sn=(Sn+Nt+Ot.length)%Ot.length;var An=Ot[Sn];if(An){var Dn=An.key;et.onActiveChange(Dn)}else et.onActiveChange(null)}),(0,We.Z)((0,at.Z)(et),"onKeyDown",function(Nt){var Dt=et.state,Ot=Dt.activeKey,un=Dt.expandedKeys,Sn=Dt.checkedKeys,An=Dt.fieldNames,Dn=et.props,Ai=Dn.onKeyDown,en=Dn.checkable,Qt=Dn.selectable;switch(Nt.which){case kt.Z.UP:{et.offsetActiveKey(-1),Nt.preventDefault();break}case kt.Z.DOWN:{et.offsetActiveKey(1),Nt.preventDefault();break}}var ln=et.getActiveItem();if(ln&&ln.data){var di=et.getTreeNodeRequiredProps(),cn=ln.data.isLeaf===!1||!!(ln.data[An.children]||[]).length,Yt=(0,$e.F)((0,pt.Z)((0,pt.Z)({},(0,$e.H8)(Ot,di)),{},{data:ln.data,active:!0}));switch(Nt.which){case kt.Z.LEFT:{cn&&un.includes(Ot)?et.onNodeExpand({},Yt):ln.parent&&et.onActiveChange(ln.parent.key),Nt.preventDefault();break}case kt.Z.RIGHT:{cn&&!un.includes(Ot)?et.onNodeExpand({},Yt):ln.children&&ln.children.length&&et.onActiveChange(ln.children[0].key),Nt.preventDefault();break}case kt.Z.ENTER:case kt.Z.SPACE:{en&&!Yt.disabled&&Yt.checkable!==!1&&!Yt.disableCheckbox?et.onNodeCheck({},Yt,!Sn.includes(Ot)):!en&&Qt&&!Yt.disabled&&Yt.selectable!==!1&&et.onNodeSelect({},Yt);break}}}Ai==null||Ai(Nt)}),(0,We.Z)((0,at.Z)(et),"setUncontrolledState",function(Nt){var Dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!et.destroyed){var un=!1,Sn=!0,An={};Object.keys(Nt).forEach(function(Dn){if(et.props.hasOwnProperty(Dn)){Sn=!1;return}un=!0,An[Dn]=Nt[Dn]}),un&&(!Dt||Sn)&&et.setState((0,pt.Z)((0,pt.Z)({},An),Ot))}}),(0,We.Z)((0,at.Z)(et),"scrollTo",function(Nt){et.listRef.current.scrollTo(Nt)}),et}return(0,Oe.Z)(Ae,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var on=this.props,Kt=on.activeKey,pn=on.itemScrollOffset,Nt=pn===void 0?0:pn;Kt!==void 0&&Kt!==this.state.activeKey&&(this.setState({activeKey:Kt}),Kt!==null&&this.scrollTo({key:Kt,offset:Nt}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var on=this.state,Kt=on.focused,pn=on.flattenNodes,Nt=on.keyEntities,Dt=on.draggingNodeKey,Ot=on.activeKey,un=on.dropLevelOffset,Sn=on.dropContainerKey,An=on.dropTargetKey,Dn=on.dropPosition,Ai=on.dragOverNodeKey,en=on.indent,Qt=this.props,ln=Qt.prefixCls,di=Qt.className,cn=Qt.style,Yt=Qt.showLine,ii=Qt.focusable,Vi=Qt.tabIndex,bi=Vi===void 0?0:Vi,Di=Qt.selectable,Mr=Qt.showIcon,Gn=Qt.icon,Rn=Qt.switcherIcon,Jn=Qt.draggable,Ni=Qt.checkable,ji=Qt.checkStrictly,Gi=Qt.disabled,Fr=Qt.motion,be=Qt.loadData,gn=Qt.filterTreeNode,li=Qt.height,Hn=Qt.itemHeight,oi=Qt.scrollWidth,ki=Qt.virtual,Ji=Qt.titleRender,$i=Qt.dropIndicatorRender,ir=Qt.onContextMenu,Mt=Qt.onScroll,_t=Qt.direction,At=Qt.rootClassName,xi=Qt.rootStyle,mi=(0,De.Z)(this.props,{aria:!0,data:!0}),fi;Jn&&((0,Ue.Z)(Jn)==="object"?fi=Jn:typeof Jn=="function"?fi={nodeDraggable:Jn}:fi={});var wn={prefixCls:ln,selectable:Di,showIcon:Mr,icon:Gn,switcherIcon:Rn,draggable:fi,draggingNodeKey:Dt,checkable:Ni,checkStrictly:ji,disabled:Gi,keyEntities:Nt,dropLevelOffset:un,dropContainerKey:Sn,dropTargetKey:An,dropPosition:Dn,dragOverNodeKey:Ai,indent:en,direction:_t,dropIndicatorRender:$i,loadData:be,filterTreeNode:gn,titleRender:Ji,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return te.createElement(de.k.Provider,{value:wn},te.createElement("div",{className:dt()(ln,di,At,(0,We.Z)((0,We.Z)((0,We.Z)({},"".concat(ln,"-show-line"),Yt),"".concat(ln,"-focused"),Kt),"".concat(ln,"-active-focused"),Ot!==null)),style:xi},te.createElement(It,(0,le.Z)({ref:this.listRef,prefixCls:ln,style:cn,data:pn,disabled:Gi,selectable:Di,checkable:!!Ni,motion:Fr,dragging:Dt!==null,height:li,itemHeight:Hn,virtual:ki,focusable:ii,focused:Kt,tabIndex:bi,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ir,onScroll:Mt,scrollWidth:oi},this.getTreeNodeRequiredProps(),mi))))}}],[{key:"getDerivedStateFromProps",value:function(on,Kt){var pn=Kt.prevProps,Nt={prevProps:on};function Dt(bi){return!pn&&on.hasOwnProperty(bi)||pn&&pn[bi]!==on[bi]}var Ot,un=Kt.fieldNames;if(Dt("fieldNames")&&(un=(0,$e.w$)(on.fieldNames),Nt.fieldNames=un),Dt("treeData")?Ot=on.treeData:Dt("children")&&((0,ne.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Ot=(0,$e.zn)(on.children)),Ot){Nt.treeData=Ot;var Sn=(0,$e.I8)(Ot,{fieldNames:un});Nt.keyEntities=(0,pt.Z)((0,We.Z)({},rt,ni),Sn.keyEntities)}var An=Nt.keyEntities||Kt.keyEntities;if(Dt("expandedKeys")||pn&&Dt("autoExpandParent"))Nt.expandedKeys=on.autoExpandParent||!pn&&on.defaultExpandParent?(0,On.r7)(on.expandedKeys,An):on.expandedKeys;else if(!pn&&on.defaultExpandAll){var Dn=(0,pt.Z)({},An);delete Dn[rt];var Ai=[];Object.keys(Dn).forEach(function(bi){var Di=Dn[bi];Di.children&&Di.children.length&&Ai.push(Di.key)}),Nt.expandedKeys=Ai}else!pn&&on.defaultExpandedKeys&&(Nt.expandedKeys=on.autoExpandParent||on.defaultExpandParent?(0,On.r7)(on.defaultExpandedKeys,An):on.defaultExpandedKeys);if(Nt.expandedKeys||delete Nt.expandedKeys,Ot||Nt.expandedKeys){var en=(0,$e.oH)(Ot||Kt.treeData,Nt.expandedKeys||Kt.expandedKeys,un);Nt.flattenNodes=en}if(on.selectable&&(Dt("selectedKeys")?Nt.selectedKeys=(0,On.BT)(on.selectedKeys,on):!pn&&on.defaultSelectedKeys&&(Nt.selectedKeys=(0,On.BT)(on.defaultSelectedKeys,on))),on.checkable){var Qt;if(Dt("checkedKeys")?Qt=(0,On.E6)(on.checkedKeys)||{}:!pn&&on.defaultCheckedKeys?Qt=(0,On.E6)(on.defaultCheckedKeys)||{}:Ot&&(Qt=(0,On.E6)(on.checkedKeys)||{checkedKeys:Kt.checkedKeys,halfCheckedKeys:Kt.halfCheckedKeys}),Qt){var ln=Qt,di=ln.checkedKeys,cn=di===void 0?[]:di,Yt=ln.halfCheckedKeys,ii=Yt===void 0?[]:Yt;if(!on.checkStrictly){var Vi=(0,ht.S)(cn,!0,An);cn=Vi.checkedKeys,ii=Vi.halfCheckedKeys}Nt.checkedKeys=cn,Nt.halfCheckedKeys=ii}}return Dt("loadedKeys")&&(Nt.loadedKeys=on.loadedKeys),Nt}}]),Ae}(te.Component);(0,We.Z)(ze,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:pe,allowDrop:function(){return!0},expandAction:!1}),(0,We.Z)(ze,"TreeNode",nt.Z);var Me=ze,Ee=Me},82661:function(Zn,ei,Le){"use strict";Le.d(ei,{BT:function(){return te},E6:function(){return pe},L0:function(){return We},OM:function(){return ne},_5:function(){return ot},r7:function(){return ye},wA:function(){return dt},yx:function(){return Tt}});var le=Le(62730),Ue=Le(28788),pt=Le(48736),St=Le(59301),yt=Le(639),Oe=Le(65065),at=Le(34061),Ct=null;function ot(we,Ce){if(!we)return[];var _e=we.slice(),Ze=_e.indexOf(Ce);return Ze>=0&&_e.splice(Ze,1),_e}function We(we,Ce){var _e=(we||[]).slice();return _e.indexOf(Ce)===-1&&_e.push(Ce),_e}function Tt(we){return we.split("-")}function dt(we,Ce){var _e=[],Ze=(0,Oe.Z)(Ce,we);function st(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];nt.forEach(function(Ye){var ct=Ye.key,$e=Ye.children;_e.push(ct),st($e)})}return st(Ze.children),_e}function kt(we){if(we.parent){var Ce=Tt(we.pos);return Number(Ce[Ce.length-1])===we.parent.children.length-1}return!1}function De(we){var Ce=Tt(we.pos);return Number(Ce[Ce.length-1])===0}function ne(we,Ce,_e,Ze,st,nt,Ye,ct,$e,Et){var Pt,Bt=we.clientX,fn=we.clientY,qt=we.target.getBoundingClientRect(),vn=qt.top,tn=qt.height,it=(Et==="rtl"?-1:1)*(((st==null?void 0:st.x)||0)-Bt),rt=(it-12)/Ze,dn=$e.filter(function(Ee){var Te;return(Te=ct[Ee])===null||Te===void 0||(Te=Te.children)===null||Te===void 0?void 0:Te.length}),ni=(0,Oe.Z)(ct,_e.eventKey);if(fn<vn+tn/2){var Kn=Ye.findIndex(function(Ee){return Ee.key===ni.key}),Rt=Kn<=0?0:Kn-1,En=Ye[Rt].key;ni=(0,Oe.Z)(ct,En)}var Bn=ni.key,ui=ni,It=ni.key,On=0,ht=0;if(!dn.includes(Bn))for(var kn=0;kn<rt&&kt(ni);kn+=1)ni=ni.parent,ht+=1;var Oi=Ce.data,ze=ni.node,Me=!0;return De(ni)&&ni.level===0&&fn<vn+tn/2&&nt({dragNode:Oi,dropNode:ze,dropPosition:-1})&&ni.key===_e.eventKey?On=-1:(ui.children||[]).length&&dn.includes(It)?nt({dragNode:Oi,dropNode:ze,dropPosition:0})?On=0:Me=!1:ht===0?rt>-1.5?nt({dragNode:Oi,dropNode:ze,dropPosition:1})?On=1:Me=!1:nt({dragNode:Oi,dropNode:ze,dropPosition:0})?On=0:nt({dragNode:Oi,dropNode:ze,dropPosition:1})?On=1:Me=!1:nt({dragNode:Oi,dropNode:ze,dropPosition:1})?On=1:Me=!1,{dropPosition:On,dropLevelOffset:ht,dropTargetKey:ni.key,dropTargetPos:ni.pos,dragOverNodeKey:It,dropContainerKey:On===0?null:((Pt=ni.parent)===null||Pt===void 0?void 0:Pt.key)||null,dropAllowed:Me}}function te(we,Ce){if(we){var _e=Ce.multiple;return _e?we.slice():we.length?[we[0]]:we}}var de=function(Ce){return Ce};function se(we,Ce){if(!we)return[];var _e=Ce||{},Ze=_e.processProps,st=Ze===void 0?de:Ze,nt=Array.isArray(we)?we:[we];return nt.map(function(Ye){var ct=Ye.children,$e=_objectWithoutProperties(Ye,Ct),Et=se(ct,Ce);return React.createElement(TreeNode,_extends({key:$e.key},st($e)),Et)})}function pe(we){if(!we)return null;var Ce;if(Array.isArray(we))Ce={checkedKeys:we,halfCheckedKeys:void 0};else if((0,Ue.Z)(we)==="object")Ce={checkedKeys:we.checked||void 0,halfCheckedKeys:we.halfChecked||void 0};else return(0,pt.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return Ce}function ye(we,Ce){var _e=new Set;function Ze(st){if(!_e.has(st)){var nt=(0,Oe.Z)(Ce,st);if(nt){_e.add(st);var Ye=nt.parent,ct=nt.node;ct.disabled||Ye&&Ze(Ye.key)}}}return(we||[]).forEach(function(st){Ze(st)}),(0,le.Z)(_e)}},34643:function(Zn,ei,Le){"use strict";Le.d(ei,{S:function(){return at}});var le=Le(48736),Ue=Le(65065);function pt(Ct,ot){var We=new Set;return Ct.forEach(function(Tt){ot.has(Tt)||We.add(Tt)}),We}function St(Ct){var ot=Ct||{},We=ot.disabled,Tt=ot.disableCheckbox,dt=ot.checkable;return!!(We||Tt)||dt===!1}function yt(Ct,ot,We,Tt){for(var dt=new Set(Ct),kt=new Set,De=0;De<=We;De+=1){var ne=ot.get(De)||new Set;ne.forEach(function(pe){var ye=pe.key,we=pe.node,Ce=pe.children,_e=Ce===void 0?[]:Ce;dt.has(ye)&&!Tt(we)&&_e.filter(function(Ze){return!Tt(Ze.node)}).forEach(function(Ze){dt.add(Ze.key)})})}for(var te=new Set,de=We;de>=0;de-=1){var se=ot.get(de)||new Set;se.forEach(function(pe){var ye=pe.parent,we=pe.node;if(!(Tt(we)||!pe.parent||te.has(pe.parent.key))){if(Tt(pe.parent.node)){te.add(ye.key);return}var Ce=!0,_e=!1;(ye.children||[]).filter(function(Ze){return!Tt(Ze.node)}).forEach(function(Ze){var st=Ze.key,nt=dt.has(st);Ce&&!nt&&(Ce=!1),!_e&&(nt||kt.has(st))&&(_e=!0)}),Ce&&dt.add(ye.key),_e&&kt.add(ye.key),te.add(ye.key)}})}return{checkedKeys:Array.from(dt),halfCheckedKeys:Array.from(pt(kt,dt))}}function Oe(Ct,ot,We,Tt,dt){for(var kt=new Set(Ct),De=new Set(ot),ne=0;ne<=Tt;ne+=1){var te=We.get(ne)||new Set;te.forEach(function(ye){var we=ye.key,Ce=ye.node,_e=ye.children,Ze=_e===void 0?[]:_e;!kt.has(we)&&!De.has(we)&&!dt(Ce)&&Ze.filter(function(st){return!dt(st.node)}).forEach(function(st){kt.delete(st.key)})})}De=new Set;for(var de=new Set,se=Tt;se>=0;se-=1){var pe=We.get(se)||new Set;pe.forEach(function(ye){var we=ye.parent,Ce=ye.node;if(!(dt(Ce)||!ye.parent||de.has(ye.parent.key))){if(dt(ye.parent.node)){de.add(we.key);return}var _e=!0,Ze=!1;(we.children||[]).filter(function(st){return!dt(st.node)}).forEach(function(st){var nt=st.key,Ye=kt.has(nt);_e&&!Ye&&(_e=!1),!Ze&&(Ye||De.has(nt))&&(Ze=!0)}),_e||kt.delete(we.key),Ze&&De.add(we.key),de.add(we.key)}})}return{checkedKeys:Array.from(kt),halfCheckedKeys:Array.from(pt(De,kt))}}function at(Ct,ot,We,Tt){var dt=[],kt;Tt?kt=Tt:kt=St;var De=new Set(Ct.filter(function(se){var pe=!!(0,Ue.Z)(We,se);return pe||dt.push(se),pe})),ne=new Map,te=0;Object.keys(We).forEach(function(se){var pe=We[se],ye=pe.level,we=ne.get(ye);we||(we=new Set,ne.set(ye,we)),we.add(pe),te=Math.max(te,ye)}),(0,le.ZP)(!dt.length,"Tree missing follow keys: ".concat(dt.slice(0,100).map(function(se){return"'".concat(se,"'")}).join(", ")));var de;return ot===!0?de=yt(De,ne,te,kt):de=Oe(De,ot.halfCheckedKeys,ne,te,kt),de}},65065:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return le}});function le(Ue,pt){return Ue[pt]}},34061:function(Zn,ei,Le){"use strict";Le.d(ei,{F:function(){return ye},H8:function(){return pe},I8:function(){return se},km:function(){return dt},oH:function(){return te},w$:function(){return kt},zn:function(){return ne}});var le=Le(28788),Ue=Le(62730),pt=Le(89490),St=Le(39224),yt=Le(11592),Oe=Le(2738),at=Le(48736),Ct=Le(65065),ot=["children"];function We(we,Ce){return"".concat(we,"-").concat(Ce)}function Tt(we){return we&&we.type&&we.type.isTreeNode}function dt(we,Ce){return we!=null?we:Ce}function kt(we){var Ce=we||{},_e=Ce.title,Ze=Ce._title,st=Ce.key,nt=Ce.children,Ye=_e||"title";return{title:Ye,_title:Ze||[Ye],key:st||"key",children:nt||"children"}}function De(we,Ce){var _e=new Map;function Ze(st){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(st||[]).forEach(function(Ye){var ct=Ye[Ce.key],$e=Ye[Ce.children];warning(ct!=null,"Tree node must have a certain key: [".concat(nt).concat(ct,"]"));var Et=String(ct);warning(!_e.has(Et)||ct===null||ct===void 0,"Same 'key' exist in the Tree: ".concat(Et)),_e.set(Et,!0),Ze($e,"".concat(nt).concat(Et," > "))})}Ze(we)}function ne(we){function Ce(_e){var Ze=(0,yt.Z)(_e);return Ze.map(function(st){if(!Tt(st))return(0,at.ZP)(!st,"Tree/TreeNode can only accept TreeNode as children."),null;var nt=st.key,Ye=st.props,ct=Ye.children,$e=(0,St.Z)(Ye,ot),Et=(0,pt.Z)({key:nt},$e),Pt=Ce(ct);return Pt.length&&(Et.children=Pt),Et}).filter(function(st){return st})}return Ce(we)}function te(we,Ce,_e){var Ze=kt(_e),st=Ze._title,nt=Ze.key,Ye=Ze.children,ct=new Set(Ce===!0?[]:Ce),$e=[];function Et(Pt){var Bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Pt.map(function(fn,qt){for(var vn=We(Bt?Bt.pos:"0",qt),tn=dt(fn[nt],vn),it,rt=0;rt<st.length;rt+=1){var dn=st[rt];if(fn[dn]!==void 0){it=fn[dn];break}}var ni=Object.assign((0,Oe.Z)(fn,[].concat((0,Ue.Z)(st),[nt,Ye])),{title:it,key:tn,parent:Bt,pos:vn,children:null,data:fn,isStart:[].concat((0,Ue.Z)(Bt?Bt.isStart:[]),[qt===0]),isEnd:[].concat((0,Ue.Z)(Bt?Bt.isEnd:[]),[qt===Pt.length-1])});return $e.push(ni),Ce===!0||ct.has(tn)?ni.children=Et(fn[Ye]||[],ni):ni.children=[],ni})}return Et(we),$e}function de(we,Ce,_e){var Ze={};(0,le.Z)(_e)==="object"?Ze=_e:Ze={externalGetKey:_e},Ze=Ze||{};var st=Ze,nt=st.childrenPropName,Ye=st.externalGetKey,ct=st.fieldNames,$e=kt(ct),Et=$e.key,Pt=$e.children,Bt=nt||Pt,fn;Ye?typeof Ye=="string"?fn=function(tn){return tn[Ye]}:typeof Ye=="function"&&(fn=function(tn){return Ye(tn)}):fn=function(tn,it){return dt(tn[Et],it)};function qt(vn,tn,it,rt){var dn=vn?vn[Bt]:we,ni=vn?We(it.pos,tn):"0",Kn=vn?[].concat((0,Ue.Z)(rt),[vn]):[];if(vn){var Rt=fn(vn,ni),En={node:vn,index:tn,pos:ni,key:Rt,parentPos:it.node?it.pos:null,level:it.level+1,nodes:Kn};Ce(En)}dn&&dn.forEach(function(Bn,ui){qt(Bn,ui,{node:vn,pos:ni,level:it?it.level+1:-1},Kn)})}qt(null)}function se(we){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=Ce.initWrapper,Ze=Ce.processEntity,st=Ce.onProcessFinished,nt=Ce.externalGetKey,Ye=Ce.childrenPropName,ct=Ce.fieldNames,$e=arguments.length>2?arguments[2]:void 0,Et=nt||$e,Pt={},Bt={},fn={posEntities:Pt,keyEntities:Bt};return _e&&(fn=_e(fn)||fn),de(we,function(qt){var vn=qt.node,tn=qt.index,it=qt.pos,rt=qt.key,dn=qt.parentPos,ni=qt.level,Kn=qt.nodes,Rt={node:vn,nodes:Kn,index:tn,key:rt,pos:it,level:ni},En=dt(rt,it);Pt[it]=Rt,Bt[En]=Rt,Rt.parent=Pt[dn],Rt.parent&&(Rt.parent.children=Rt.parent.children||[],Rt.parent.children.push(Rt)),Ze&&Ze(Rt,fn)},{externalGetKey:Et,childrenPropName:Ye,fieldNames:ct}),st&&st(fn),fn}function pe(we,Ce){var _e=Ce.expandedKeys,Ze=Ce.selectedKeys,st=Ce.loadedKeys,nt=Ce.loadingKeys,Ye=Ce.checkedKeys,ct=Ce.halfCheckedKeys,$e=Ce.dragOverNodeKey,Et=Ce.dropPosition,Pt=Ce.keyEntities,Bt=(0,Ct.Z)(Pt,we),fn={eventKey:we,expanded:_e.indexOf(we)!==-1,selected:Ze.indexOf(we)!==-1,loaded:st.indexOf(we)!==-1,loading:nt.indexOf(we)!==-1,checked:Ye.indexOf(we)!==-1,halfChecked:ct.indexOf(we)!==-1,pos:String(Bt?Bt.pos:""),dragOver:$e===we&&Et===0,dragOverGapTop:$e===we&&Et===-1,dragOverGapBottom:$e===we&&Et===1};return fn}function ye(we){var Ce=we.data,_e=we.expanded,Ze=we.selected,st=we.checked,nt=we.loaded,Ye=we.loading,ct=we.halfChecked,$e=we.dragOver,Et=we.dragOverGapTop,Pt=we.dragOverGapBottom,Bt=we.pos,fn=we.active,qt=we.eventKey,vn=(0,pt.Z)((0,pt.Z)({},Ce),{},{expanded:_e,selected:Ze,checked:st,loaded:nt,loading:Ye,halfChecked:ct,dragOver:$e,dragOverGapTop:Et,dragOverGapBottom:Pt,pos:Bt,active:fn,key:qt});return"props"in vn||Object.defineProperty(vn,"props",{get:function(){return(0,at.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),we}}),vn}},8224:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ue}});var le=Le(4676);function Ue(pt,St,yt,Oe){var at=le.unstable_batchedUpdates?function(ot){le.unstable_batchedUpdates(yt,ot)}:yt;return pt!=null&&pt.addEventListener&&pt.addEventListener(St,at,Oe),{remove:function(){pt!=null&&pt.removeEventListener&&pt.removeEventListener(St,at,Oe)}}}},24514:function(Zn,ei,Le){"use strict";Le.d(ei,{G:function(){return St}});var le=Le(47273),Ue=function(Oe){if((0,le.Z)()&&window.document.documentElement){var at=Array.isArray(Oe)?Oe:[Oe],Ct=window.document.documentElement;return at.some(function(ot){return ot in Ct.style})}return!1},pt=function(Oe,at){if(!Ue(Oe))return!1;var Ct=document.createElement("div"),ot=Ct.style[Oe];return Ct.style[Oe]=at,Ct.style[Oe]!==ot};function St(yt,Oe){return!Array.isArray(yt)&&Oe!==void 0?pt(yt,Oe):Ue(yt)}},65283:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Oi}});var le=Le(71409),Ue=Le(28788),pt=Le(89490),St=Le(87075),yt=Le(11036),Oe=Le(39224),at=Le(92310),Ct=Le.n(at),ot=Le(29301),We=Le(70425),Tt=Le(34280),dt=Le(59301),kt=Le(4676),De=dt.forwardRef(function(ze,Me){var Ee=ze.height,Te=ze.offsetY,He=ze.offsetX,Ae=ze.children,et=ze.prefixCls,on=ze.onInnerResize,Kt=ze.innerProps,pn=ze.rtl,Nt=ze.extra,Dt={},Ot={display:"flex",flexDirection:"column"};return Te!==void 0&&(Dt={height:Ee,position:"relative",overflow:"hidden"},Ot=(0,pt.Z)((0,pt.Z)({},Ot),{},(0,St.Z)((0,St.Z)((0,St.Z)((0,St.Z)((0,St.Z)({transform:"translateY(".concat(Te,"px)")},pn?"marginRight":"marginLeft",-He),"position","absolute"),"left",0),"right",0),"top",0))),dt.createElement("div",{style:Dt},dt.createElement(ot.Z,{onResize:function(Sn){var An=Sn.offsetHeight;An&&on&&on()}},dt.createElement("div",(0,le.Z)({style:Ot,className:Ct()((0,St.Z)({},"".concat(et,"-holder-inner"),et)),ref:Me},Kt),Ae,Nt)))});De.displayName="Filler";var ne=De;function te(ze){var Me=ze.children,Ee=ze.setRef,Te=dt.useCallback(function(He){Ee(He)},[]);return dt.cloneElement(Me,{ref:Te})}function de(ze,Me,Ee,Te,He,Ae,et,on){var Kt=on.getKey;return ze.slice(Me,Ee+1).map(function(pn,Nt){var Dt=Me+Nt,Ot=et(pn,Dt,{style:{width:Te},offsetX:He}),un=Kt(pn);return dt.createElement(te,{key:un,setRef:function(An){return Ae(pn,An)}},Ot)})}function se(ze,Me,Ee,Te){var He=Ee-ze,Ae=Me-Ee,et=Math.min(He,Ae)*2;if(Te<=et){var on=Math.floor(Te/2);return Te%2?Ee+on+1:Ee-on}return He>Ae?Ee-(Te-Ae):Ee+(Te-He)}function pe(ze,Me,Ee){var Te=ze.length,He=Me.length,Ae,et;if(Te===0&&He===0)return null;Te<He?(Ae=ze,et=Me):(Ae=Me,et=ze);var on={__EMPTY_ITEM__:!0};function Kt(Sn){return Sn!==void 0?Ee(Sn):on}for(var pn=null,Nt=Math.abs(Te-He)!==1,Dt=0;Dt<et.length;Dt+=1){var Ot=Kt(Ae[Dt]),un=Kt(et[Dt]);if(Ot!==un){pn=Dt,Nt=Nt||Ot!==Kt(et[Dt+1]);break}}return pn===null?null:{index:pn,multiple:Nt}}function ye(ze,Me,Ee){var Te=dt.useState(ze),He=(0,yt.Z)(Te,2),Ae=He[0],et=He[1],on=dt.useState(null),Kt=(0,yt.Z)(on,2),pn=Kt[0],Nt=Kt[1];return dt.useEffect(function(){var Dt=pe(Ae||[],ze||[],Me);(Dt==null?void 0:Dt.index)!==void 0&&(Ee==null||Ee(Dt.index),Nt(ze[Dt.index])),et(ze)},[ze]),[pn]}var we=Le(16089),Ce=(typeof navigator=="undefined"?"undefined":(0,Ue.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),_e=Ce,Ze=function(ze,Me,Ee,Te){var He=(0,dt.useRef)(!1),Ae=(0,dt.useRef)(null);function et(){clearTimeout(Ae.current),He.current=!0,Ae.current=setTimeout(function(){He.current=!1},50)}var on=(0,dt.useRef)({top:ze,bottom:Me,left:Ee,right:Te});return on.current.top=ze,on.current.bottom=Me,on.current.left=Ee,on.current.right=Te,function(Kt,pn){var Nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Dt=Kt?pn<0&&on.current.left||pn>0&&on.current.right:pn<0&&on.current.top||pn>0&&on.current.bottom;return Nt&&Dt?(clearTimeout(Ae.current),He.current=!1):(!Dt||He.current)&&et(),!He.current&&Dt}};function st(ze,Me,Ee,Te,He,Ae,et){var on=(0,dt.useRef)(0),Kt=(0,dt.useRef)(null),pn=(0,dt.useRef)(null),Nt=(0,dt.useRef)(!1),Dt=Ze(Me,Ee,Te,He);function Ot(en,Qt){if(we.Z.cancel(Kt.current),!Dt(!1,Qt)){var ln=en;if(!ln._virtualHandled)ln._virtualHandled=!0;else return;on.current+=Qt,pn.current=Qt,_e||ln.preventDefault(),Kt.current=(0,we.Z)(function(){var di=Nt.current?10:1;et(on.current*di,!1),on.current=0})}}function un(en,Qt){et(Qt,!0),_e||en.preventDefault()}var Sn=(0,dt.useRef)(null),An=(0,dt.useRef)(null);function Dn(en){if(ze){we.Z.cancel(An.current),An.current=(0,we.Z)(function(){Sn.current=null},2);var Qt=en.deltaX,ln=en.deltaY,di=en.shiftKey,cn=Qt,Yt=ln;(Sn.current==="sx"||!Sn.current&&di&&ln&&!Qt)&&(cn=ln,Yt=0,Sn.current="sx");var ii=Math.abs(cn),Vi=Math.abs(Yt);Sn.current===null&&(Sn.current=Ae&&ii>Vi?"x":"y"),Sn.current==="y"?Ot(en,Yt):un(en,cn)}}function Ai(en){ze&&(Nt.current=en.detail===pn.current)}return[Dn,Ai]}function nt(ze,Me,Ee,Te){var He=dt.useMemo(function(){return[new Map,[]]},[ze,Ee.id,Te]),Ae=(0,yt.Z)(He,2),et=Ae[0],on=Ae[1],Kt=function(Nt){var Dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nt,Ot=et.get(Nt),un=et.get(Dt);if(Ot===void 0||un===void 0)for(var Sn=ze.length,An=on.length;An<Sn;An+=1){var Dn,Ai=ze[An],en=Me(Ai);et.set(en,An);var Qt=(Dn=Ee.get(en))!==null&&Dn!==void 0?Dn:Te;if(on[An]=(on[An-1]||0)+Qt,en===Nt&&(Ot=An),en===Dt&&(un=An),Ot!==void 0&&un!==void 0)break}return{top:on[Ot-1]||0,bottom:on[un]}};return Kt}var Ye=Le(16552),ct=Le(19210),$e=function(){function ze(){(0,Ye.Z)(this,ze),(0,St.Z)(this,"maps",void 0),(0,St.Z)(this,"id",0),(0,St.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,ct.Z)(ze,[{key:"set",value:function(Ee,Te){this.diffRecords.set(Ee,this.maps[Ee]),this.maps[Ee]=Te,this.id+=1}},{key:"get",value:function(Ee){return this.maps[Ee]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ze}(),Et=$e;function Pt(ze){var Me=parseFloat(ze);return isNaN(Me)?0:Me}function Bt(ze,Me,Ee){var Te=dt.useState(0),He=(0,yt.Z)(Te,2),Ae=He[0],et=He[1],on=(0,dt.useRef)(new Map),Kt=(0,dt.useRef)(new Et),pn=(0,dt.useRef)(0);function Nt(){pn.current+=1}function Dt(){var un=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Nt();var Sn=function(){var Ai=!1;on.current.forEach(function(en,Qt){if(en&&en.offsetParent){var ln=en.offsetHeight,di=getComputedStyle(en),cn=di.marginTop,Yt=di.marginBottom,ii=Pt(cn),Vi=Pt(Yt),bi=ln+ii+Vi;Kt.current.get(Qt)!==bi&&(Kt.current.set(Qt,bi),Ai=!0)}}),Ai&&et(function(en){return en+1})};if(un)Sn();else{pn.current+=1;var An=pn.current;Promise.resolve().then(function(){An===pn.current&&Sn()})}}function Ot(un,Sn){var An=ze(un),Dn=on.current.get(An);Sn?(on.current.set(An,Sn),Dt()):on.current.delete(An),!Dn!=!Sn&&(Sn?Me==null||Me(un):Ee==null||Ee(un))}return(0,dt.useEffect)(function(){return Nt},[]),[Ot,Dt,Kt.current,Ae]}var fn=14/15;function qt(ze,Me,Ee){var Te=(0,dt.useRef)(!1),He=(0,dt.useRef)(0),Ae=(0,dt.useRef)(0),et=(0,dt.useRef)(null),on=(0,dt.useRef)(null),Kt,pn=function(un){if(Te.current){var Sn=Math.ceil(un.touches[0].pageX),An=Math.ceil(un.touches[0].pageY),Dn=He.current-Sn,Ai=Ae.current-An,en=Math.abs(Dn)>Math.abs(Ai);en?He.current=Sn:Ae.current=An;var Qt=Ee(en,en?Dn:Ai,!1,un);Qt&&un.preventDefault(),clearInterval(on.current),Qt&&(on.current=setInterval(function(){en?Dn*=fn:Ai*=fn;var ln=Math.floor(en?Dn:Ai);(!Ee(en,ln,!0)||Math.abs(ln)<=.1)&&clearInterval(on.current)},16))}},Nt=function(){Te.current=!1,Kt()},Dt=function(un){Kt(),un.touches.length===1&&!Te.current&&(Te.current=!0,He.current=Math.ceil(un.touches[0].pageX),Ae.current=Math.ceil(un.touches[0].pageY),et.current=un.target,et.current.addEventListener("touchmove",pn,{passive:!1}),et.current.addEventListener("touchend",Nt,{passive:!0}))};Kt=function(){et.current&&(et.current.removeEventListener("touchmove",pn),et.current.removeEventListener("touchend",Nt))},(0,Tt.Z)(function(){return ze&&Me.current.addEventListener("touchstart",Dt,{passive:!0}),function(){var Ot;(Ot=Me.current)===null||Ot===void 0||Ot.removeEventListener("touchstart",Dt),Kt(),clearInterval(on.current)}},[ze])}function vn(ze){return Math.floor(Math.pow(ze,.5))}function tn(ze,Me){var Ee="touches"in ze?ze.touches[0]:ze;return Ee[Me?"pageX":"pageY"]-window[Me?"scrollX":"scrollY"]}function it(ze,Me,Ee){dt.useEffect(function(){var Te=Me.current;if(ze&&Te){var He=!1,Ae,et,on=function(){we.Z.cancel(Ae)},Kt=function Ot(){on(),Ae=(0,we.Z)(function(){Ee(et),Ot()})},pn=function(un){if(!(un.target.draggable||un.button!==0)){var Sn=un;Sn._virtualHandled||(Sn._virtualHandled=!0,He=!0)}},Nt=function(){He=!1,on()},Dt=function(un){if(He){var Sn=tn(un,!1),An=Te.getBoundingClientRect(),Dn=An.top,Ai=An.bottom;if(Sn<=Dn){var en=Dn-Sn;et=-vn(en),Kt()}else if(Sn>=Ai){var Qt=Sn-Ai;et=vn(Qt),Kt()}else on()}};return Te.addEventListener("mousedown",pn),Te.ownerDocument.addEventListener("mouseup",Nt),Te.ownerDocument.addEventListener("mousemove",Dt),function(){Te.removeEventListener("mousedown",pn),Te.ownerDocument.removeEventListener("mouseup",Nt),Te.ownerDocument.removeEventListener("mousemove",Dt),on()}}},[ze])}var rt=10;function dn(ze,Me,Ee,Te,He,Ae,et,on){var Kt=dt.useRef(),pn=dt.useState(null),Nt=(0,yt.Z)(pn,2),Dt=Nt[0],Ot=Nt[1];return(0,Tt.Z)(function(){if(Dt&&Dt.times<rt){if(!ze.current){Ot(function(Fr){return(0,pt.Z)({},Fr)});return}Ae();var un=Dt.targetAlign,Sn=Dt.originAlign,An=Dt.index,Dn=Dt.offset,Ai=ze.current.clientHeight,en=!1,Qt=un,ln=null;if(Ai){for(var di=un||Sn,cn=0,Yt=0,ii=0,Vi=Math.min(Me.length-1,An),bi=0;bi<=Vi;bi+=1){var Di=He(Me[bi]);Yt=cn;var Mr=Ee.get(Di);ii=Yt+(Mr===void 0?Te:Mr),cn=ii}for(var Gn=di==="top"?Dn:Ai-Dn,Rn=Vi;Rn>=0;Rn-=1){var Jn=He(Me[Rn]),Ni=Ee.get(Jn);if(Ni===void 0){en=!0;break}if(Gn-=Ni,Gn<=0)break}switch(di){case"top":ln=Yt-Dn;break;case"bottom":ln=ii-Ai+Dn;break;default:{var ji=ze.current.scrollTop,Gi=ji+Ai;Yt<ji?Qt="top":ii>Gi&&(Qt="bottom")}}ln!==null&&et(ln),ln!==Dt.lastTop&&(en=!0)}en&&Ot((0,pt.Z)((0,pt.Z)({},Dt),{},{times:Dt.times+1,targetAlign:Qt,lastTop:ln}))}},[Dt,ze.current]),function(un){if(un==null){on();return}if(we.Z.cancel(Kt.current),typeof un=="number")et(un);else if(un&&(0,Ue.Z)(un)==="object"){var Sn,An=un.align;"index"in un?Sn=un.index:Sn=Me.findIndex(function(en){return He(en)===un.key});var Dn=un.offset,Ai=Dn===void 0?0:Dn;Ot({times:0,index:Sn,offset:Ai,originAlign:An})}}}var ni=dt.forwardRef(function(ze,Me){var Ee=ze.prefixCls,Te=ze.rtl,He=ze.scrollOffset,Ae=ze.scrollRange,et=ze.onStartMove,on=ze.onStopMove,Kt=ze.onScroll,pn=ze.horizontal,Nt=ze.spinSize,Dt=ze.containerSize,Ot=ze.style,un=ze.thumbStyle,Sn=ze.showScrollBar,An=dt.useState(!1),Dn=(0,yt.Z)(An,2),Ai=Dn[0],en=Dn[1],Qt=dt.useState(null),ln=(0,yt.Z)(Qt,2),di=ln[0],cn=ln[1],Yt=dt.useState(null),ii=(0,yt.Z)(Yt,2),Vi=ii[0],bi=ii[1],Di=!Te,Mr=dt.useRef(),Gn=dt.useRef(),Rn=dt.useState(Sn),Jn=(0,yt.Z)(Rn,2),Ni=Jn[0],ji=Jn[1],Gi=dt.useRef(),Fr=function(){Sn===!0||Sn===!1||(clearTimeout(Gi.current),ji(!0),Gi.current=setTimeout(function(){ji(!1)},3e3))},be=Ae-Dt||0,gn=Dt-Nt||0,li=dt.useMemo(function(){if(He===0||be===0)return 0;var At=He/be;return At*gn},[He,be,gn]),Hn=function(xi){xi.stopPropagation(),xi.preventDefault()},oi=dt.useRef({top:li,dragging:Ai,pageY:di,startTop:Vi});oi.current={top:li,dragging:Ai,pageY:di,startTop:Vi};var ki=function(xi){en(!0),cn(tn(xi,pn)),bi(oi.current.top),et(),xi.stopPropagation(),xi.preventDefault()};dt.useEffect(function(){var At=function(wn){wn.preventDefault()},xi=Mr.current,mi=Gn.current;return xi.addEventListener("touchstart",At,{passive:!1}),mi.addEventListener("touchstart",ki,{passive:!1}),function(){xi.removeEventListener("touchstart",At),mi.removeEventListener("touchstart",ki)}},[]);var Ji=dt.useRef();Ji.current=be;var $i=dt.useRef();$i.current=gn,dt.useEffect(function(){if(Ai){var At,xi=function(wn){var Yn=oi.current,Qi=Yn.dragging,vr=Yn.pageY,Dr=Yn.startTop;we.Z.cancel(At);var Ke=Mr.current.getBoundingClientRect(),Lt=Dt/(pn?Ke.width:Ke.height);if(Qi){var _n=(tn(wn,pn)-vr)*Lt,ci=Dr;!Di&&pn?ci-=_n:ci+=_n;var $t=Ji.current,xn=$i.current,Xt=xn?ci/xn:0,ri=Math.ceil(Xt*$t);ri=Math.max(ri,0),ri=Math.min(ri,$t),At=(0,we.Z)(function(){Kt(ri,pn)})}},mi=function(){en(!1),on()};return window.addEventListener("mousemove",xi,{passive:!0}),window.addEventListener("touchmove",xi,{passive:!0}),window.addEventListener("mouseup",mi,{passive:!0}),window.addEventListener("touchend",mi,{passive:!0}),function(){window.removeEventListener("mousemove",xi),window.removeEventListener("touchmove",xi),window.removeEventListener("mouseup",mi),window.removeEventListener("touchend",mi),we.Z.cancel(At)}}},[Ai]),dt.useEffect(function(){return Fr(),function(){clearTimeout(Gi.current)}},[He]),dt.useImperativeHandle(Me,function(){return{delayHidden:Fr}});var ir="".concat(Ee,"-scrollbar"),Mt={position:"absolute",visibility:Ni?null:"hidden"},_t={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return pn?(Mt.height=8,Mt.left=0,Mt.right=0,Mt.bottom=0,_t.height="100%",_t.width=Nt,Di?_t.left=li:_t.right=li):(Mt.width=8,Mt.top=0,Mt.bottom=0,Di?Mt.right=0:Mt.left=0,_t.width="100%",_t.height=Nt,_t.top=li),dt.createElement("div",{ref:Mr,className:Ct()(ir,(0,St.Z)((0,St.Z)((0,St.Z)({},"".concat(ir,"-horizontal"),pn),"".concat(ir,"-vertical"),!pn),"".concat(ir,"-visible"),Ni)),style:(0,pt.Z)((0,pt.Z)({},Mt),Ot),onMouseDown:Hn,onMouseMove:Fr},dt.createElement("div",{ref:Gn,className:Ct()("".concat(ir,"-thumb"),(0,St.Z)({},"".concat(ir,"-thumb-moving"),Ai)),style:(0,pt.Z)((0,pt.Z)({},_t),un),onMouseDown:ki}))}),Kn=ni,Rt=20;function En(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ee=ze/Me*ze;return isNaN(Ee)&&(Ee=0),Ee=Math.max(Ee,Rt),Math.floor(Ee)}var Bn=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],ui=[],It={overflowY:"auto",overflowAnchor:"none"};function On(ze,Me){var Ee=ze.prefixCls,Te=Ee===void 0?"rc-virtual-list":Ee,He=ze.className,Ae=ze.height,et=ze.itemHeight,on=ze.fullHeight,Kt=on===void 0?!0:on,pn=ze.style,Nt=ze.data,Dt=ze.children,Ot=ze.itemKey,un=ze.virtual,Sn=ze.direction,An=ze.scrollWidth,Dn=ze.component,Ai=Dn===void 0?"div":Dn,en=ze.onScroll,Qt=ze.onVirtualScroll,ln=ze.onVisibleChange,di=ze.innerProps,cn=ze.extraRender,Yt=ze.styles,ii=ze.showScrollBar,Vi=ii===void 0?"optional":ii,bi=(0,Oe.Z)(ze,Bn),Di=dt.useCallback(function(In){return typeof Ot=="function"?Ot(In):In==null?void 0:In[Ot]},[Ot]),Mr=Bt(Di,null,null),Gn=(0,yt.Z)(Mr,4),Rn=Gn[0],Jn=Gn[1],Ni=Gn[2],ji=Gn[3],Gi=!!(un!==!1&&Ae&&et),Fr=dt.useMemo(function(){return Object.values(Ni.maps).reduce(function(In,si){return In+si},0)},[Ni.id,Ni.maps]),be=Gi&&Nt&&(Math.max(et*Nt.length,Fr)>Ae||!!An),gn=Sn==="rtl",li=Ct()(Te,(0,St.Z)({},"".concat(Te,"-rtl"),gn),He),Hn=Nt||ui,oi=(0,dt.useRef)(),ki=(0,dt.useRef)(),Ji=(0,dt.useRef)(),$i=(0,dt.useState)(0),ir=(0,yt.Z)($i,2),Mt=ir[0],_t=ir[1],At=(0,dt.useState)(0),xi=(0,yt.Z)(At,2),mi=xi[0],fi=xi[1],wn=(0,dt.useState)(!1),Yn=(0,yt.Z)(wn,2),Qi=Yn[0],vr=Yn[1],Dr=function(){vr(!0)},Ke=function(){vr(!1)},Lt={getKey:Di};function _n(In){_t(function(si){var yi;typeof In=="function"?yi=In(si):yi=In;var $n=Wr(yi);return oi.current.scrollTop=$n,$n})}var ci=(0,dt.useRef)({start:0,end:Hn.length}),$t=(0,dt.useRef)(),xn=ye(Hn,Di),Xt=(0,yt.Z)(xn,1),ri=Xt[0];$t.current=ri;var Hi=dt.useMemo(function(){if(!Gi)return{scrollHeight:void 0,start:0,end:Hn.length-1,offset:void 0};if(!be){var In;return{scrollHeight:((In=ki.current)===null||In===void 0?void 0:In.offsetHeight)||0,start:0,end:Hn.length-1,offset:void 0}}for(var si=0,yi,$n,pi,ur=Hn.length,Ki=0;Ki<ur;Ki+=1){var Bi=Hn[Ki],Pn=Di(Bi),hr=Ni.get(Pn),or=si+(hr===void 0?et:hr);or>=Mt&&yi===void 0&&(yi=Ki,$n=si),or>Mt+Ae&&pi===void 0&&(pi=Ki),si=or}return yi===void 0&&(yi=0,$n=0,pi=Math.ceil(Ae/et)),pi===void 0&&(pi=Hn.length-1),pi=Math.min(pi+1,Hn.length-1),{scrollHeight:si,start:yi,end:pi,offset:$n}},[be,Gi,Mt,Hn,ji,Ae]),gi=Hi.scrollHeight,Ii=Hi.start,Fi=Hi.end,Cr=Hi.offset;ci.current.start=Ii,ci.current.end=Fi,dt.useLayoutEffect(function(){var In=Ni.getRecord();if(In.size===1){var si=Array.from(In.keys())[0],yi=In.get(si),$n=Hn[Ii];if($n&&yi===void 0){var pi=Di($n);if(pi===si){var ur=Ni.get(si),Ki=ur-et;_n(function(Bi){return Bi+Ki})}}}Ni.resetRecord()},[gi]);var xr=dt.useState({width:0,height:Ae}),Sr=(0,yt.Z)(xr,2),hn=Sr[0],ro=Sr[1],Gr=function(si){ro({width:si.offsetWidth,height:si.offsetHeight})},So=(0,dt.useRef)(),yn=(0,dt.useRef)(),Xn=dt.useMemo(function(){return En(hn.width,An)},[hn.width,An]),rr=dt.useMemo(function(){return En(hn.height,gi)},[hn.height,gi]),er=gi-Ae,Pr=(0,dt.useRef)(er);Pr.current=er;function Wr(In){var si=In;return Number.isNaN(Pr.current)||(si=Math.min(si,Pr.current)),si=Math.max(si,0),si}var so=Mt<=0,vo=Mt>=er,po=mi<=0,yo=mi>=An,Nn=Ze(so,vo,po,yo),ia=function(){return{x:gn?-mi:mi,y:Mt}},Tn=(0,dt.useRef)(ia()),Ar=(0,We.zX)(function(In){if(Qt){var si=(0,pt.Z)((0,pt.Z)({},ia()),In);(Tn.current.x!==si.x||Tn.current.y!==si.y)&&(Qt(si),Tn.current=si)}});function Bo(In,si){var yi=In;si?((0,kt.flushSync)(function(){fi(yi)}),Ar()):_n(yi)}function br(In){var si=In.currentTarget.scrollTop;si!==Mt&&_n(si),en==null||en(In),Ar()}var na=function(si){var yi=si,$n=An?An-hn.width:0;return yi=Math.max(yi,0),yi=Math.min(yi,$n),yi},Do=(0,We.zX)(function(In,si){si?((0,kt.flushSync)(function(){fi(function(yi){var $n=yi+(gn?-In:In);return na($n)})}),Ar()):_n(function(yi){var $n=yi+In;return $n})}),ho=st(Gi,so,vo,po,yo,!!An,Do),Jo=(0,yt.Z)(ho,2),Vt=Jo[0],jn=Jo[1];qt(Gi,oi,function(In,si,yi,$n){var pi=$n;return Nn(In,si,yi)?!1:!pi||!pi._virtualHandled?(pi&&(pi._virtualHandled=!0),Vt({preventDefault:function(){},deltaX:In?si:0,deltaY:In?0:si}),!0):!1}),it(be,oi,function(In){_n(function(si){return si+In})}),(0,Tt.Z)(function(){function In(yi){var $n=so&&yi.detail<0,pi=vo&&yi.detail>0;Gi&&!$n&&!pi&&yi.preventDefault()}var si=oi.current;return si.addEventListener("wheel",Vt,{passive:!1}),si.addEventListener("DOMMouseScroll",jn,{passive:!0}),si.addEventListener("MozMousePixelScroll",In,{passive:!1}),function(){si.removeEventListener("wheel",Vt),si.removeEventListener("DOMMouseScroll",jn),si.removeEventListener("MozMousePixelScroll",In)}},[Gi,so,vo]),(0,Tt.Z)(function(){if(An){var In=na(mi);fi(In),Ar({x:In})}},[hn.width,An]);var Gt=function(){var si,yi;(si=So.current)===null||si===void 0||si.delayHidden(),(yi=yn.current)===null||yi===void 0||yi.delayHidden()},Ie=dn(oi,Hn,Ni,et,Di,function(){return Jn(!0)},_n,Gt);dt.useImperativeHandle(Me,function(){return{nativeElement:Ji.current,getScrollInfo:ia,scrollTo:function(si){function yi($n){return $n&&(0,Ue.Z)($n)==="object"&&("left"in $n||"top"in $n)}yi(si)?(si.left!==void 0&&fi(na(si.left)),Ie(si.top)):Ie(si)}}}),(0,Tt.Z)(function(){if(ln){var In=Hn.slice(Ii,Fi+1);ln(In,Hn)}},[Ii,Fi,Hn]);var ai=nt(Hn,Di,Ni,et),hi=cn==null?void 0:cn({start:Ii,end:Fi,virtual:be,offsetX:mi,offsetY:Cr,rtl:gn,getSize:ai}),_i=de(Hn,Ii,Fi,An,mi,Rn,Dt,Lt),Yi=null;Ae&&(Yi=(0,pt.Z)((0,St.Z)({},Kt?"height":"maxHeight",Ae),It),Gi&&(Yi.overflowY="hidden",An&&(Yi.overflowX="hidden"),Qi&&(Yi.pointerEvents="none")));var Ti={};return gn&&(Ti.dir="rtl"),dt.createElement("div",(0,le.Z)({ref:Ji,style:(0,pt.Z)((0,pt.Z)({},pn),{},{position:"relative"}),className:li},Ti,bi),dt.createElement(ot.Z,{onResize:Gr},dt.createElement(Ai,{className:"".concat(Te,"-holder"),style:Yi,ref:oi,onScroll:br,onMouseEnter:Gt},dt.createElement(ne,{prefixCls:Te,height:gi,offsetX:mi,offsetY:Cr,scrollWidth:An,onInnerResize:Jn,ref:ki,innerProps:di,rtl:gn,extra:hi},_i))),be&&gi>Ae&&dt.createElement(Kn,{ref:So,prefixCls:Te,scrollOffset:Mt,scrollRange:gi,rtl:gn,onScroll:Bo,onStartMove:Dr,onStopMove:Ke,spinSize:rr,containerSize:hn.height,style:Yt==null?void 0:Yt.verticalScrollBar,thumbStyle:Yt==null?void 0:Yt.verticalScrollBarThumb,showScrollBar:Vi}),be&&An>hn.width&&dt.createElement(Kn,{ref:yn,prefixCls:Te,scrollOffset:mi,scrollRange:An,rtl:gn,onScroll:Bo,onStartMove:Dr,onStopMove:Ke,spinSize:Xn,containerSize:hn.width,horizontal:!0,style:Yt==null?void 0:Yt.horizontalScrollBar,thumbStyle:Yt==null?void 0:Yt.horizontalScrollBarThumb,showScrollBar:Vi}))}var ht=dt.forwardRef(On);ht.displayName="List";var kn=ht,Oi=kn},71426:function(Zn,ei,Le){"use strict";Le.d(ei,{Z5:function(){return fg},_l:function(){return fl},bK:function(){return gu}});var le=Le(59301),Ue=Le(51317);function pt(ve,Se){ve.prototype=Object.create(Se.prototype),ve.prototype.constructor=ve,(0,Ue.Z)(ve,Se)}var St=Le(71409),yt=Le(59781),Oe=le.createContext(null),at=null;function Ct(ve){ve()}var ot=Ct,We=function(Se){return ot=Se},Tt=function(){return ot};function dt(){var ve=Tt(),Se=null,Be=null;return{clear:function(){Se=null,Be=null},notify:function(){ve(function(){for(var tt=Se;tt;)tt.callback(),tt=tt.next})},get:function(){for(var tt=[],qe=Se;qe;)tt.push(qe),qe=qe.next;return tt},subscribe:function(tt){var qe=!0,mt=Be={callback:tt,next:null,prev:Be};return mt.prev?mt.prev.next=mt:Se=mt,function(){!qe||Se===null||(qe=!1,mt.next?mt.next.prev=mt.prev:Be=mt.prev,mt.prev?mt.prev.next=mt.next:Se=mt.next)}}}}var kt={notify:function(){},get:function(){return[]}};function De(ve,Se){var Be,je=kt;function tt(rn){return Jt(),je.subscribe(rn)}function qe(){je.notify()}function mt(){sn.onStateChange&&sn.onStateChange()}function wt(){return!!Be}function Jt(){Be||(Be=Se?Se.addNestedSub(mt):ve.subscribe(mt),je=dt())}function mn(){Be&&(Be(),Be=void 0,je.clear(),je=kt)}var sn={addNestedSub:tt,notifyNestedSubs:qe,handleChangeWrapper:mt,isSubscribed:wt,trySubscribe:Jt,tryUnsubscribe:mn,getListeners:function(){return je}};return sn}var ne=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?le.useLayoutEffect:le.useEffect;function te(ve){var Se=ve.store,Be=ve.context,je=ve.children,tt=(0,le.useMemo)(function(){var wt=De(Se);return{store:Se,subscription:wt}},[Se]),qe=(0,le.useMemo)(function(){return Se.getState()},[Se]);ne(function(){var wt=tt.subscription;return wt.onStateChange=wt.notifyNestedSubs,wt.trySubscribe(),qe!==Se.getState()&&wt.notifyNestedSubs(),function(){wt.tryUnsubscribe(),wt.onStateChange=null}},[tt,qe]);var mt=Be||Oe;return le.createElement(mt.Provider,{value:tt},je)}var de=te,se=Le(91204),pe=Le(94266),ye=Le.n(pe),we=Le(53410),Ce=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],_e=["reactReduxForwardedRef"],Ze=[],st=[null,null],nt=function(Se){try{return JSON.stringify(Se)}catch(Be){return String(Se)}};function Ye(ve,Se){var Be=ve[1];return[Se.payload,Be+1]}function ct(ve,Se,Be){ne(function(){return ve.apply(void 0,Se)},Be)}function $e(ve,Se,Be,je,tt,qe,mt){ve.current=je,Se.current=tt,Be.current=!1,qe.current&&(qe.current=null,mt())}function Et(ve,Se,Be,je,tt,qe,mt,wt,Jt,mn){if(ve){var sn=!1,rn=null,nn=function(){if(!sn){var Or=Se.getState(),Vr,ao;try{Vr=je(Or,tt.current)}catch(Co){ao=Co,rn=Co}ao||(rn=null),Vr===qe.current?mt.current||Jt():(qe.current=Vr,wt.current=Vr,mt.current=!0,mn({type:"STORE_UPDATED",payload:{error:ao}}))}};Be.onStateChange=nn,Be.trySubscribe(),nn();var Ln=function(){if(sn=!0,Be.tryUnsubscribe(),Be.onStateChange=null,rn)throw rn};return Ln}}var Pt=function(){return[null,0]};function Bt(ve,Se){Se===void 0&&(Se={});var Be=Se,je=Be.getDisplayName,tt=je===void 0?function(Za){return"ConnectAdvanced("+Za+")"}:je,qe=Be.methodName,mt=qe===void 0?"connectAdvanced":qe,wt=Be.renderCountProp,Jt=wt===void 0?void 0:wt,mn=Be.shouldHandleStateChanges,sn=mn===void 0?!0:mn,rn=Be.storeKey,nn=rn===void 0?"store":rn,Ln=Be.withRef,Li=Ln===void 0?!1:Ln,Or=Be.forwardRef,Vr=Or===void 0?!1:Or,ao=Be.context,Co=ao===void 0?Oe:ao,Go=(0,se.Z)(Be,Ce);if(0)var jo;var da=Co;return function(ns){var el=ns.displayName||ns.name||"Component",$a=tt(el),Ys=(0,St.Z)({},Go,{getDisplayName:tt,methodName:mt,renderCountProp:Jt,shouldHandleStateChanges:sn,storeKey:nn,displayName:$a,wrappedComponentName:el,WrappedComponent:ns}),Nl=Go.pure;function Kl(zs){return ve(zs.dispatch,Ys)}var fh=Nl?le.useMemo:function(zs){return zs()};function bu(zs){var Mh=(0,le.useMemo)(function(){var Ws=zs.reactReduxForwardedRef,ju=(0,se.Z)(zs,_e);return[zs.context,Ws,ju]},[zs]),Xs=Mh[0],gh=Mh[1],Dc=Mh[2],ph=(0,le.useMemo)(function(){return Xs&&Xs.Consumer&&(0,we.isContextConsumer)(le.createElement(Xs.Consumer,null))?Xs:da},[Xs,da]),$o=(0,le.useContext)(ph),Xd=!!zs.store&&!!zs.store.getState&&!!zs.store.dispatch,Sg=!!$o&&!!$o.store,mh=Xd?zs.store:$o.store,Uh=(0,le.useMemo)(function(){return Kl(mh)},[mh]),Cd=(0,le.useMemo)(function(){if(!sn)return st;var Ws=De(mh,Xd?null:$o.subscription),ju=Ws.notifyNestedSubs.bind(Ws);return[Ws,ju]},[mh,Xd,$o]),mu=Cd[0],kf=Cd[1],Af=(0,le.useMemo)(function(){return Xd?$o:(0,St.Z)({},$o,{subscription:mu})},[Xd,$o,mu]),ip=(0,le.useReducer)(Ye,Ze,Pt),Gp=ip[0],wg=Gp[0],Tc=ip[1];if(wg&&wg.error)throw wg.error;var rp=(0,le.useRef)(),Pg=(0,le.useRef)(Dc),Ic=(0,le.useRef)(),_c=(0,le.useRef)(!1),Eg=fh(function(){return Ic.current&&Dc===Pg.current?Ic.current:Uh(mh.getState(),Dc)},[mh,wg,Dc]);ct($e,[Pg,rp,_c,Dc,Eg,Ic,kf]),ct(Et,[sn,mh,mu,Uh,Pg,rp,_c,Ic,kf,Tc],[mh,mu,Uh]);var ba=(0,le.useMemo)(function(){return le.createElement(ns,(0,St.Z)({},Eg,{ref:gh}))},[gh,ns,Eg]),Ul=(0,le.useMemo)(function(){return sn?le.createElement(ph.Provider,{value:Af},ba):ba},[ph,ba,Af]);return Ul}var pu=Nl?le.memo(bu):bu;if(pu.WrappedComponent=ns,pu.displayName=bu.displayName=$a,Vr){var pl=le.forwardRef(function(Mh,Xs){return le.createElement(pu,(0,St.Z)({},Mh,{reactReduxForwardedRef:Xs}))});return pl.displayName=$a,pl.WrappedComponent=ns,ye()(pl,ns)}return ye()(pu,ns)}}function fn(ve,Se){return ve===Se?ve!==0||Se!==0||1/ve===1/Se:ve!==ve&&Se!==Se}function qt(ve,Se){if(fn(ve,Se))return!0;if(typeof ve!="object"||ve===null||typeof Se!="object"||Se===null)return!1;var Be=Object.keys(ve),je=Object.keys(Se);if(Be.length!==je.length)return!1;for(var tt=0;tt<Be.length;tt++)if(!Object.prototype.hasOwnProperty.call(Se,Be[tt])||!fn(ve[Be[tt]],Se[Be[tt]]))return!1;return!0}function vn(ve,Se){var Be={},je=function(mt){var wt=ve[mt];typeof wt=="function"&&(Be[mt]=function(){return Se(wt.apply(void 0,arguments))})};for(var tt in ve)je(tt);return Be}function tn(ve){return function(Be,je){var tt=ve(Be,je);function qe(){return tt}return qe.dependsOnOwnProps=!1,qe}}function it(ve){return ve.dependsOnOwnProps!==null&&ve.dependsOnOwnProps!==void 0?!!ve.dependsOnOwnProps:ve.length!==1}function rt(ve,Se){return function(je,tt){var qe=tt.displayName,mt=function(Jt,mn){return mt.dependsOnOwnProps?mt.mapToProps(Jt,mn):mt.mapToProps(Jt)};return mt.dependsOnOwnProps=!0,mt.mapToProps=function(Jt,mn){mt.mapToProps=ve,mt.dependsOnOwnProps=it(ve);var sn=mt(Jt,mn);return typeof sn=="function"&&(mt.mapToProps=sn,mt.dependsOnOwnProps=it(sn),sn=mt(Jt,mn)),sn},mt}}function dn(ve){return typeof ve=="function"?rt(ve,"mapDispatchToProps"):void 0}function ni(ve){return ve?void 0:tn(function(Se){return{dispatch:Se}})}function Kn(ve){return ve&&typeof ve=="object"?tn(function(Se){return vn(ve,Se)}):void 0}var Rt=[dn,ni,Kn];function En(ve){return typeof ve=="function"?rt(ve,"mapStateToProps"):void 0}function Bn(ve){return ve?void 0:tn(function(){return{}})}var ui=[En,Bn];function It(ve,Se,Be){return(0,St.Z)({},Be,ve,Se)}function On(ve){return function(Be,je){var tt=je.displayName,qe=je.pure,mt=je.areMergedPropsEqual,wt=!1,Jt;return function(sn,rn,nn){var Ln=ve(sn,rn,nn);return wt?(!qe||!mt(Ln,Jt))&&(Jt=Ln):(wt=!0,Jt=Ln),Jt}}}function ht(ve){return typeof ve=="function"?On(ve):void 0}function kn(ve){return ve?void 0:function(){return It}}var Oi=[ht,kn],ze=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Me(ve,Se,Be,je){return function(qe,mt){return Be(ve(qe,mt),Se(je,mt),mt)}}function Ee(ve,Se,Be,je,tt){var qe=tt.areStatesEqual,mt=tt.areOwnPropsEqual,wt=tt.areStatePropsEqual,Jt=!1,mn,sn,rn,nn,Ln;function Li(Go,jo){return mn=Go,sn=jo,rn=ve(mn,sn),nn=Se(je,sn),Ln=Be(rn,nn,sn),Jt=!0,Ln}function Or(){return rn=ve(mn,sn),Se.dependsOnOwnProps&&(nn=Se(je,sn)),Ln=Be(rn,nn,sn),Ln}function Vr(){return ve.dependsOnOwnProps&&(rn=ve(mn,sn)),Se.dependsOnOwnProps&&(nn=Se(je,sn)),Ln=Be(rn,nn,sn),Ln}function ao(){var Go=ve(mn,sn),jo=!wt(Go,rn);return rn=Go,jo&&(Ln=Be(rn,nn,sn)),Ln}function Co(Go,jo){var da=!mt(jo,sn),Za=!qe(Go,mn,jo,sn);return mn=Go,sn=jo,da&&Za?Or():da?Vr():Za?ao():Ln}return function(jo,da){return Jt?Co(jo,da):Li(jo,da)}}function Te(ve,Se){var Be=Se.initMapStateToProps,je=Se.initMapDispatchToProps,tt=Se.initMergeProps,qe=(0,se.Z)(Se,ze),mt=Be(ve,qe),wt=je(ve,qe),Jt=tt(ve,qe),mn=qe.pure?Ee:Me;return mn(mt,wt,Jt,ve,qe)}var He=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function Ae(ve,Se,Be){for(var je=Se.length-1;je>=0;je--){var tt=Se[je](ve);if(tt)return tt}return function(qe,mt){throw new Error("Invalid value of type "+typeof ve+" for "+Be+" argument when connecting component "+mt.wrappedComponentName+".")}}function et(ve,Se){return ve===Se}function on(ve){var Se=ve===void 0?{}:ve,Be=Se.connectHOC,je=Be===void 0?Bt:Be,tt=Se.mapStateToPropsFactories,qe=tt===void 0?ui:tt,mt=Se.mapDispatchToPropsFactories,wt=mt===void 0?Rt:mt,Jt=Se.mergePropsFactories,mn=Jt===void 0?Oi:Jt,sn=Se.selectorFactory,rn=sn===void 0?Te:sn;return function(Ln,Li,Or,Vr){Vr===void 0&&(Vr={});var ao=Vr,Co=ao.pure,Go=Co===void 0?!0:Co,jo=ao.areStatesEqual,da=jo===void 0?et:jo,Za=ao.areOwnPropsEqual,ns=Za===void 0?qt:Za,el=ao.areStatePropsEqual,$a=el===void 0?qt:el,Ys=ao.areMergedPropsEqual,Nl=Ys===void 0?qt:Ys,Kl=(0,se.Z)(ao,He),fh=Ae(Ln,qe,"mapStateToProps"),bu=Ae(Li,wt,"mapDispatchToProps"),pu=Ae(Or,mn,"mergeProps");return je(rn,(0,St.Z)({methodName:"connect",getDisplayName:function(zs){return"Connect("+zs+")"},shouldHandleStateChanges:!!Ln,initMapStateToProps:fh,initMapDispatchToProps:bu,initMergeProps:pu,pure:Go,areStatesEqual:da,areOwnPropsEqual:ns,areStatePropsEqual:$a,areMergedPropsEqual:Nl},Kl))}}var Kt=on();function pn(){var ve=useContext(ReactReduxContext);return ve}function Nt(ve){ve===void 0&&(ve=ReactReduxContext);var Se=ve===ReactReduxContext?useDefaultReduxContext:function(){return useContext(ve)};return function(){var je=Se(),tt=je.store;return tt}}var Dt=null;function Ot(ve){ve===void 0&&(ve=ReactReduxContext);var Se=ve===ReactReduxContext?useDefaultStore:createStoreHook(ve);return function(){var je=Se();return je.dispatch}}var un=null,Sn=function(Se,Be){return Se===Be};function An(ve,Se,Be,je){var tt=useReducer(function(Li){return Li+1},0),qe=tt[1],mt=useMemo(function(){return createSubscription(Be,je)},[Be,je]),wt=useRef(),Jt=useRef(),mn=useRef(),sn=useRef(),rn=Be.getState(),nn;try{if(ve!==Jt.current||rn!==mn.current||wt.current){var Ln=ve(rn);sn.current===void 0||!Se(Ln,sn.current)?nn=Ln:nn=sn.current}else nn=sn.current}catch(Li){throw wt.current&&(Li.message+=`
|
|
The error may be correlated with this previous error:
|
|
`+wt.current.stack+`
|
|
|
|
`),Li}return useIsomorphicLayoutEffect(function(){Jt.current=ve,mn.current=rn,sn.current=nn,wt.current=void 0}),useIsomorphicLayoutEffect(function(){function Li(){try{var Or=Be.getState();if(Or===mn.current)return;var Vr=Jt.current(Or);if(Se(Vr,sn.current))return;sn.current=Vr,mn.current=Or}catch(ao){wt.current=ao}qe()}return mt.onStateChange=Li,mt.trySubscribe(),Li(),function(){return mt.tryUnsubscribe()}},[Be,mt]),nn}function Dn(ve){ve===void 0&&(ve=ReactReduxContext);var Se=ve===ReactReduxContext?useDefaultReduxContext:function(){return useContext(ve)};return function(je,tt){tt===void 0&&(tt=Sn);var qe=Se(),mt=qe.store,wt=qe.subscription,Jt=An(je,tt,mt,wt);return useDebugValue(Jt),Jt}}var Ai=null,en=Le(4676);We(en.unstable_batchedUpdates);function Qt(ve,Se){if(ve.length!==Se.length)return!1;for(var Be=0;Be<ve.length;Be++)if(ve[Be]!==Se[Be])return!1;return!0}function ln(ve,Se){var Be=(0,le.useState)(function(){return{inputs:Se,result:ve()}})[0],je=(0,le.useRef)(!0),tt=(0,le.useRef)(Be),qe=je.current||!!(Se&&tt.current.inputs&&Qt(Se,tt.current.inputs)),mt=qe?tt.current:{inputs:Se,result:ve()};return(0,le.useEffect)(function(){je.current=!1,tt.current=mt},[mt]),mt.result}function di(ve,Se){return ln(function(){return ve},Se)}var cn=ln,Yt=di,ii=!0,Vi="Invariant failed";function bi(ve,Se){if(!ve){if(ii)throw new Error(Vi);var Be=typeof Se=="function"?Se():Se,je=Be?"".concat(Vi,": ").concat(Be):Vi;throw new Error(je)}}var Di=function(Se){var Be=Se.top,je=Se.right,tt=Se.bottom,qe=Se.left,mt=je-qe,wt=tt-Be,Jt={top:Be,right:je,bottom:tt,left:qe,width:mt,height:wt,x:qe,y:Be,center:{x:(je+qe)/2,y:(tt+Be)/2}};return Jt},Mr=function(Se,Be){return{top:Se.top-Be.top,left:Se.left-Be.left,bottom:Se.bottom+Be.bottom,right:Se.right+Be.right}},Gn=function(Se,Be){return{top:Se.top+Be.top,left:Se.left+Be.left,bottom:Se.bottom-Be.bottom,right:Se.right-Be.right}},Rn=function(Se,Be){return{top:Se.top+Be.y,left:Se.left+Be.x,bottom:Se.bottom+Be.y,right:Se.right+Be.x}},Jn={top:0,right:0,bottom:0,left:0},Ni=function(Se){var Be=Se.borderBox,je=Se.margin,tt=je===void 0?Jn:je,qe=Se.border,mt=qe===void 0?Jn:qe,wt=Se.padding,Jt=wt===void 0?Jn:wt,mn=Di(Mr(Be,tt)),sn=Di(Gn(Be,mt)),rn=Di(Gn(sn,Jt));return{marginBox:mn,borderBox:Di(Be),paddingBox:sn,contentBox:rn,margin:tt,border:mt,padding:Jt}},ji=function(Se){var Be=Se.slice(0,-2),je=Se.slice(-2);if(je!=="px")return 0;var tt=Number(Be);return isNaN(tt)&&bi(!1),tt},Gi=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Fr=function(Se,Be){var je=Se.borderBox,tt=Se.border,qe=Se.margin,mt=Se.padding,wt=Rn(je,Be);return Ni({borderBox:wt,border:tt,margin:qe,padding:mt})},be=function(Se,Be){return Be===void 0&&(Be=Gi()),Fr(Se,Be)},gn=function(Se,Be){var je={top:ji(Be.marginTop),right:ji(Be.marginRight),bottom:ji(Be.marginBottom),left:ji(Be.marginLeft)},tt={top:ji(Be.paddingTop),right:ji(Be.paddingRight),bottom:ji(Be.paddingBottom),left:ji(Be.paddingLeft)},qe={top:ji(Be.borderTopWidth),right:ji(Be.borderRightWidth),bottom:ji(Be.borderBottomWidth),left:ji(Be.borderLeftWidth)};return Ni({borderBox:Se,margin:je,padding:tt,border:qe})},li=function(Se){var Be=Se.getBoundingClientRect(),je=window.getComputedStyle(Se);return gn(Be,je)},Hn=Number.isNaN||function(Se){return typeof Se=="number"&&Se!==Se};function oi(ve,Se){return!!(ve===Se||Hn(ve)&&Hn(Se))}function ki(ve,Se){if(ve.length!==Se.length)return!1;for(var Be=0;Be<ve.length;Be++)if(!oi(ve[Be],Se[Be]))return!1;return!0}function Ji(ve,Se){Se===void 0&&(Se=ki);var Be,je=[],tt,qe=!1;function mt(){for(var wt=[],Jt=0;Jt<arguments.length;Jt++)wt[Jt]=arguments[Jt];return qe&&Be===this&&Se(wt,je)||(tt=ve.apply(this,wt),qe=!0,Be=this,je=wt),tt}return mt}var $i=Ji,ir=function(Se){var Be=[],je=null,tt=function(){for(var mt=arguments.length,wt=new Array(mt),Jt=0;Jt<mt;Jt++)wt[Jt]=arguments[Jt];Be=wt,!je&&(je=requestAnimationFrame(function(){je=null,Se.apply(void 0,Be)}))};return tt.cancel=function(){je&&(cancelAnimationFrame(je),je=null)},tt},Mt=ir,_t=!0,At=/[ \t]{2,}/g,xi=/^[ \t]*/gm,mi=function(Se){return Se.replace(At," ").replace(xi,"").trim()},fi=function(Se){return mi(`
|
|
%creact-beautiful-dnd
|
|
|
|
%c`+mi(Se)+`
|
|
|
|
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
|
|
`)},wn=function(Se){return[fi(Se),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},Yn="__react-beautiful-dnd-disable-dev-warnings";function Qi(ve,Se){var Be;_t||typeof window!="undefined"&&window[Yn]||(Be=console)[ve].apply(Be,wn(Se))}var vr=Qi.bind(null,"warn"),Dr=Qi.bind(null,"error");function Ke(){}function Lt(ve,Se){return(0,St.Z)({},ve,{},Se)}function _n(ve,Se,Be){var je=Se.map(function(tt){var qe=Lt(Be,tt.options);return ve.addEventListener(tt.eventName,tt.fn,qe),function(){ve.removeEventListener(tt.eventName,tt.fn,qe)}});return function(){je.forEach(function(qe){qe()})}}var ci=!0,$t="Invariant failed";function xn(ve){this.message=ve}xn.prototype.toString=function(){return this.message};function Xt(ve,Se){if(!ve)throw ci?new xn($t):new xn($t+": "+(Se||""))}var ri=function(ve){pt(Se,ve);function Se(){for(var je,tt=arguments.length,qe=new Array(tt),mt=0;mt<tt;mt++)qe[mt]=arguments[mt];return je=ve.call.apply(ve,[this].concat(qe))||this,je.callbacks=null,je.unbind=Ke,je.onWindowError=function(wt){var Jt=je.getCallbacks();Jt.isDragging()&&Jt.tryAbort();var mn=wt.error;mn instanceof xn&&wt.preventDefault()},je.getCallbacks=function(){if(!je.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return je.callbacks},je.setCallbacks=function(wt){je.callbacks=wt},je}var Be=Se.prototype;return Be.componentDidMount=function(){this.unbind=_n(window,[{eventName:"error",fn:this.onWindowError}])},Be.componentWillUnmount=function(){this.unbind()},Be.componentDidCatch=function(tt){if(tt instanceof xn){this.setState({});return}throw tt},Be.render=function(){return this.props.children(this.setCallbacks)},Se}(le.Component),Hi=`
|
|
Press space bar to start a drag.
|
|
When dragging you can use the arrow keys to move the item around and escape to cancel.
|
|
Some screen readers may require you to be in focus mode or to use your pass through key
|
|
`,gi=function(Se){return Se+1},Ii=function(Se){return`
|
|
You have lifted an item in position `+gi(Se.source.index)+`
|
|
`},Fi=function(Se,Be){var je=Se.droppableId===Be.droppableId,tt=gi(Se.index),qe=gi(Be.index);return je?`
|
|
You have moved the item from position `+tt+`
|
|
to position `+qe+`
|
|
`:`
|
|
You have moved the item from position `+tt+`
|
|
in list `+Se.droppableId+`
|
|
to list `+Be.droppableId+`
|
|
in position `+qe+`
|
|
`},Cr=function(Se,Be,je){var tt=Be.droppableId===je.droppableId;return tt?`
|
|
The item `+Se+`
|
|
has been combined with `+je.draggableId:`
|
|
The item `+Se+`
|
|
in list `+Be.droppableId+`
|
|
has been combined with `+je.draggableId+`
|
|
in list `+je.droppableId+`
|
|
`},xr=function(Se){var Be=Se.destination;if(Be)return Fi(Se.source,Be);var je=Se.combine;return je?Cr(Se.draggableId,Se.source,je):"You are over an area that cannot be dropped on"},Sr=function(Se){return`
|
|
The item has returned to its starting position
|
|
of `+gi(Se.index)+`
|
|
`},hn=function(Se){if(Se.reason==="CANCEL")return`
|
|
Movement cancelled.
|
|
`+Sr(Se.source)+`
|
|
`;var Be=Se.destination,je=Se.combine;return Be?`
|
|
You have dropped the item.
|
|
`+Fi(Se.source,Be)+`
|
|
`:je?`
|
|
You have dropped the item.
|
|
`+Cr(Se.draggableId,Se.source,je)+`
|
|
`:`
|
|
The item has been dropped while not over a drop area.
|
|
`+Sr(Se.source)+`
|
|
`},ro={dragHandleUsageInstructions:Hi,onDragStart:Ii,onDragUpdate:xr,onDragEnd:hn},Gr={x:0,y:0},So=function(Se,Be){return{x:Se.x+Be.x,y:Se.y+Be.y}},yn=function(Se,Be){return{x:Se.x-Be.x,y:Se.y-Be.y}},Xn=function(Se,Be){return Se.x===Be.x&&Se.y===Be.y},rr=function(Se){return{x:Se.x!==0?-Se.x:0,y:Se.y!==0?-Se.y:0}},er=function(Se,Be,je){var tt;return je===void 0&&(je=0),tt={},tt[Se]=Be,tt[Se==="x"?"y":"x"]=je,tt},Pr=function(Se,Be){return Math.sqrt(Math.pow(Be.x-Se.x,2)+Math.pow(Be.y-Se.y,2))},Wr=function(Se,Be){return Math.min.apply(Math,Be.map(function(je){return Pr(Se,je)}))},so=function(Se){return function(Be){return{x:Se(Be.x),y:Se(Be.y)}}},vo=function(ve,Se){var Be=Di({top:Math.max(Se.top,ve.top),right:Math.min(Se.right,ve.right),bottom:Math.min(Se.bottom,ve.bottom),left:Math.max(Se.left,ve.left)});return Be.width<=0||Be.height<=0?null:Be},po=function(Se,Be){return{top:Se.top+Be.y,left:Se.left+Be.x,bottom:Se.bottom+Be.y,right:Se.right+Be.x}},yo=function(Se){return[{x:Se.left,y:Se.top},{x:Se.right,y:Se.top},{x:Se.left,y:Se.bottom},{x:Se.right,y:Se.bottom}]},Nn={top:0,right:0,bottom:0,left:0},ia=function(Se,Be){return Be?po(Se,Be.scroll.diff.displacement):Se},Tn=function(Se,Be,je){if(je&&je.increasedBy){var tt;return(0,St.Z)({},Se,(tt={},tt[Be.end]=Se[Be.end]+je.increasedBy[Be.line],tt))}return Se},Ar=function(Se,Be){return Be&&Be.shouldClipSubject?vo(Be.pageMarginBox,Se):Di(Se)},Bo=function(ve){var Se=ve.page,Be=ve.withPlaceholder,je=ve.axis,tt=ve.frame,qe=ia(Se.marginBox,tt),mt=Tn(qe,je,Be),wt=Ar(mt,tt);return{page:Se,withPlaceholder:Be,active:wt}},br=function(ve,Se){ve.frame||Xt(!1);var Be=ve.frame,je=yn(Se,Be.scroll.initial),tt=rr(je),qe=(0,St.Z)({},Be,{scroll:{initial:Be.scroll.initial,current:Se,diff:{value:je,displacement:tt},max:Be.scroll.max}}),mt=Bo({page:ve.subject.page,withPlaceholder:ve.subject.withPlaceholder,axis:ve.axis,frame:qe}),wt=(0,St.Z)({},ve,{frame:qe,subject:mt});return wt};function na(ve){return Number.isInteger?Number.isInteger(ve):typeof ve=="number"&&isFinite(ve)&&Math.floor(ve)===ve}function Do(ve){return Object.values?Object.values(ve):Object.keys(ve).map(function(Se){return ve[Se]})}function ho(ve,Se){if(ve.findIndex)return ve.findIndex(Se);for(var Be=0;Be<ve.length;Be++)if(Se(ve[Be]))return Be;return-1}function Jo(ve,Se){if(ve.find)return ve.find(Se);var Be=ho(ve,Se);if(Be!==-1)return ve[Be]}function Vt(ve){return Array.prototype.slice.call(ve)}var jn=$i(function(ve){return ve.reduce(function(Se,Be){return Se[Be.descriptor.id]=Be,Se},{})}),Gt=$i(function(ve){return ve.reduce(function(Se,Be){return Se[Be.descriptor.id]=Be,Se},{})}),Ie=$i(function(ve){return Do(ve)}),ai=$i(function(ve){return Do(ve)}),hi=$i(function(ve,Se){var Be=ai(Se).filter(function(je){return ve===je.descriptor.droppableId}).sort(function(je,tt){return je.descriptor.index-tt.descriptor.index});return Be});function _i(ve){return ve.at&&ve.at.type==="REORDER"?ve.at.destination:null}function Yi(ve){return ve.at&&ve.at.type==="COMBINE"?ve.at.combine:null}var Ti=$i(function(ve,Se){return Se.filter(function(Be){return Be.descriptor.id!==ve.descriptor.id})}),In=function(ve){var Se=ve.isMovingForward,Be=ve.draggable,je=ve.destination,tt=ve.insideDestination,qe=ve.previousImpact;if(!je.isCombineEnabled)return null;var mt=_i(qe);if(!mt)return null;function wt(Or){var Vr={type:"COMBINE",combine:{draggableId:Or,droppableId:je.descriptor.id}};return(0,St.Z)({},qe,{at:Vr})}var Jt=qe.displaced.all,mn=Jt.length?Jt[0]:null;if(Se)return mn?wt(mn):null;var sn=Ti(Be,tt);if(!mn){if(!sn.length)return null;var rn=sn[sn.length-1];return wt(rn.descriptor.id)}var nn=ho(sn,function(Or){return Or.descriptor.id===mn});nn===-1&&Xt(!1);var Ln=nn-1;if(Ln<0)return null;var Li=sn[Ln];return wt(Li.descriptor.id)},si=function(ve,Se){return ve.descriptor.droppableId===Se.descriptor.id},yi={point:Gr,value:0},$n={invisible:{},visible:{},all:[]},pi={displaced:$n,displacedBy:yi,at:null},ur=function(ve,Se){return function(Be){return ve<=Be&&Be<=Se}},Ki=function(ve){var Se=ur(ve.top,ve.bottom),Be=ur(ve.left,ve.right);return function(je){var tt=Se(je.top)&&Se(je.bottom)&&Be(je.left)&&Be(je.right);if(tt)return!0;var qe=Se(je.top)||Se(je.bottom),mt=Be(je.left)||Be(je.right),wt=qe&&mt;if(wt)return!0;var Jt=je.top<ve.top&&je.bottom>ve.bottom,mn=je.left<ve.left&&je.right>ve.right,sn=Jt&&mn;if(sn)return!0;var rn=Jt&&mt||mn&&qe;return rn}},Bi=function(ve){var Se=ur(ve.top,ve.bottom),Be=ur(ve.left,ve.right);return function(je){var tt=Se(je.top)&&Se(je.bottom)&&Be(je.left)&&Be(je.right);return tt}},Pn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},hr={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},or=function(ve){return function(Se){var Be=ur(Se.top,Se.bottom),je=ur(Se.left,Se.right);return function(tt){return ve===Pn?Be(tt.top)&&Be(tt.bottom):je(tt.left)&&je(tt.right)}}},xo=function(Se,Be){var je=Be.frame?Be.frame.scroll.diff.displacement:Gr;return po(Se,je)},Yr=function(Se,Be,je){return Be.subject.active?je(Be.subject.active)(Se):!1},qo=function(Se,Be,je){return je(Be)(Se)},Ko=function(Se){var Be=Se.target,je=Se.destination,tt=Se.viewport,qe=Se.withDroppableDisplacement,mt=Se.isVisibleThroughFrameFn,wt=qe?xo(Be,je):Be;return Yr(wt,je,mt)&&qo(wt,tt,mt)},Qo=function(Se){return Ko((0,St.Z)({},Se,{isVisibleThroughFrameFn:Ki}))},ra=function(Se){return Ko((0,St.Z)({},Se,{isVisibleThroughFrameFn:Bi}))},Uo=function(Se){return Ko((0,St.Z)({},Se,{isVisibleThroughFrameFn:or(Se.destination.axis)}))},wa=function(Se,Be,je){if(typeof je=="boolean")return je;if(!Be)return!0;var tt=Be.invisible,qe=Be.visible;if(tt[Se])return!1;var mt=qe[Se];return mt?mt.shouldAnimate:!0};function Wt(ve,Se){var Be=ve.page.marginBox,je={top:Se.point.y,right:0,bottom:0,left:Se.point.x};return Di(Mr(Be,je))}function Ho(ve){var Se=ve.afterDragging,Be=ve.destination,je=ve.displacedBy,tt=ve.viewport,qe=ve.forceShouldAnimate,mt=ve.last;return Se.reduce(function(Jt,mn){var sn=Wt(mn,je),rn=mn.descriptor.id;Jt.all.push(rn);var nn=Qo({target:sn,destination:Be,viewport:tt,withDroppableDisplacement:!0});if(!nn)return Jt.invisible[mn.descriptor.id]=!0,Jt;var Ln=wa(rn,mt,qe),Li={draggableId:rn,shouldAnimate:Ln};return Jt.visible[rn]=Li,Jt},{all:[],visible:{},invisible:{}})}function wr(ve,Se){if(!ve.length)return 0;var Be=ve[ve.length-1].descriptor.index;return Se.inHomeList?Be:Be+1}function no(ve){var Se=ve.insideDestination,Be=ve.inHomeList,je=ve.displacedBy,tt=ve.destination,qe=wr(Se,{inHomeList:Be});return{displaced:$n,displacedBy:je,at:{type:"REORDER",destination:{droppableId:tt.descriptor.id,index:qe}}}}function bo(ve){var Se=ve.draggable,Be=ve.insideDestination,je=ve.destination,tt=ve.viewport,qe=ve.displacedBy,mt=ve.last,wt=ve.index,Jt=ve.forceShouldAnimate,mn=si(Se,je);if(wt==null)return no({insideDestination:Be,inHomeList:mn,displacedBy:qe,destination:je});var sn=Jo(Be,function(Or){return Or.descriptor.index===wt});if(!sn)return no({insideDestination:Be,inHomeList:mn,displacedBy:qe,destination:je});var rn=Ti(Se,Be),nn=Be.indexOf(sn),Ln=rn.slice(nn),Li=Ho({afterDragging:Ln,destination:je,displacedBy:qe,last:mt,viewport:tt.frame,forceShouldAnimate:Jt});return{displaced:Li,displacedBy:qe,at:{type:"REORDER",destination:{droppableId:je.descriptor.id,index:wt}}}}function oo(ve,Se){return!!Se.effected[ve]}var fa=function(ve){var Se=ve.isMovingForward,Be=ve.destination,je=ve.draggables,tt=ve.combine,qe=ve.afterCritical;if(!Be.isCombineEnabled)return null;var mt=tt.draggableId,wt=je[mt],Jt=wt.descriptor.index,mn=oo(mt,qe);return mn?Se?Jt:Jt-1:Se?Jt+1:Jt},ga=function(ve){var Se=ve.isMovingForward,Be=ve.isInHomeList,je=ve.insideDestination,tt=ve.location;if(!je.length)return null;var qe=tt.index,mt=Se?qe+1:qe-1,wt=je[0].descriptor.index,Jt=je[je.length-1].descriptor.index,mn=Be?Jt:Jt+1;return mt<wt||mt>mn?null:mt},Mo=function(ve){var Se=ve.isMovingForward,Be=ve.isInHomeList,je=ve.draggable,tt=ve.draggables,qe=ve.destination,mt=ve.insideDestination,wt=ve.previousImpact,Jt=ve.viewport,mn=ve.afterCritical,sn=wt.at;if(sn||Xt(!1),sn.type==="REORDER"){var rn=ga({isMovingForward:Se,isInHomeList:Be,location:sn.destination,insideDestination:mt});return rn==null?null:bo({draggable:je,insideDestination:mt,destination:qe,viewport:Jt,last:wt.displaced,displacedBy:wt.displacedBy,index:rn})}var nn=fa({isMovingForward:Se,destination:qe,displaced:wt.displaced,draggables:tt,combine:sn.combine,afterCritical:mn});return nn==null?null:bo({draggable:je,insideDestination:mt,destination:qe,viewport:Jt,last:wt.displaced,displacedBy:wt.displacedBy,index:nn})},Fo=function(ve){var Se=ve.displaced,Be=ve.afterCritical,je=ve.combineWith,tt=ve.displacedBy,qe=!!(Se.visible[je]||Se.invisible[je]);return oo(je,Be)?qe?Gr:rr(tt.point):qe?tt.point:Gr},vs=function(ve){var Se=ve.afterCritical,Be=ve.impact,je=ve.draggables,tt=Yi(Be);tt||Xt(!1);var qe=tt.draggableId,mt=je[qe].page.borderBox.center,wt=Fo({displaced:Be.displaced,afterCritical:Se,combineWith:qe,displacedBy:Be.displacedBy});return So(mt,wt)},es=function(Se,Be){return Be.margin[Se.start]+Be.borderBox[Se.size]/2},ps=function(Se,Be){return Be.margin[Se.end]+Be.borderBox[Se.size]/2},ms=function(Se,Be,je){return Be[Se.crossAxisStart]+je.margin[Se.crossAxisStart]+je.borderBox[Se.crossAxisSize]/2},Kr=function(Se){var Be=Se.axis,je=Se.moveRelativeTo,tt=Se.isMoving;return er(Be.line,je.marginBox[Be.end]+es(Be,tt),ms(Be,je.marginBox,tt))},Ka=function(Se){var Be=Se.axis,je=Se.moveRelativeTo,tt=Se.isMoving;return er(Be.line,je.marginBox[Be.start]-ps(Be,tt),ms(Be,je.marginBox,tt))},Ba=function(Se){var Be=Se.axis,je=Se.moveInto,tt=Se.isMoving;return er(Be.line,je.contentBox[Be.start]+es(Be,tt),ms(Be,je.contentBox,tt))},ss=function(ve){var Se=ve.impact,Be=ve.draggable,je=ve.draggables,tt=ve.droppable,qe=ve.afterCritical,mt=hi(tt.descriptor.id,je),wt=Be.page,Jt=tt.axis;if(!mt.length)return Ba({axis:Jt,moveInto:tt.page,isMoving:wt});var mn=Se.displaced,sn=Se.displacedBy,rn=mn.all[0];if(rn){var nn=je[rn];if(oo(rn,qe))return Ka({axis:Jt,moveRelativeTo:nn.page,isMoving:wt});var Ln=Fr(nn.page,sn.point);return Ka({axis:Jt,moveRelativeTo:Ln,isMoving:wt})}var Li=mt[mt.length-1];if(Li.descriptor.id===Be.descriptor.id)return wt.borderBox.center;if(oo(Li.descriptor.id,qe)){var Or=Fr(Li.page,rr(qe.displacedBy.point));return Kr({axis:Jt,moveRelativeTo:Or,isMoving:wt})}return Kr({axis:Jt,moveRelativeTo:Li.page,isMoving:wt})},Ya=function(ve,Se){var Be=ve.frame;return Be?So(Se,Be.scroll.diff.displacement):Se},ls=function(Se){var Be=Se.impact,je=Se.draggable,tt=Se.droppable,qe=Se.draggables,mt=Se.afterCritical,wt=je.page.borderBox.center,Jt=Be.at;return!tt||!Jt?wt:Jt.type==="REORDER"?ss({impact:Be,draggable:je,draggables:qe,droppable:tt,afterCritical:mt}):vs({impact:Be,draggables:qe,afterCritical:mt})},Zi=function(ve){var Se=ls(ve),Be=ve.droppable,je=Be?Ya(Be,Se):Se;return je},Xr=function(ve,Se){var Be=yn(Se,ve.scroll.initial),je=rr(Be),tt=Di({top:Se.y,bottom:Se.y+ve.frame.height,left:Se.x,right:Se.x+ve.frame.width}),qe={frame:tt,scroll:{initial:ve.scroll.initial,max:ve.scroll.max,current:Se,diff:{value:Be,displacement:je}}};return qe};function Po(ve,Se){return ve.map(function(Be){return Se[Be]})}function Yo(ve,Se){for(var Be=0;Be<Se.length;Be++){var je=Se[Be].visible[ve];if(je)return je}return null}var ea=function(ve){var Se=ve.impact,Be=ve.viewport,je=ve.destination,tt=ve.draggables,qe=ve.maxScrollChange,mt=Xr(Be,So(Be.scroll.current,qe)),wt=je.frame?br(je,So(je.frame.scroll.current,qe)):je,Jt=Se.displaced,mn=Ho({afterDragging:Po(Jt.all,tt),destination:je,displacedBy:Se.displacedBy,viewport:mt.frame,last:Jt,forceShouldAnimate:!1}),sn=Ho({afterDragging:Po(Jt.all,tt),destination:wt,displacedBy:Se.displacedBy,viewport:Be.frame,last:Jt,forceShouldAnimate:!1}),rn={},nn={},Ln=[Jt,mn,sn];Jt.all.forEach(function(Or){var Vr=Yo(Or,Ln);if(Vr){nn[Or]=Vr;return}rn[Or]=!0});var Li=(0,St.Z)({},Se,{displaced:{all:Jt.all,invisible:rn,visible:nn}});return Li},Ea=function(ve,Se){return So(ve.scroll.diff.displacement,Se)},Hr=function(ve){var Se=ve.pageBorderBoxCenter,Be=ve.draggable,je=ve.viewport,tt=Ea(je,Se),qe=yn(tt,Be.page.borderBox.center);return So(Be.client.borderBox.center,qe)},Ns=function(ve){var Se=ve.draggable,Be=ve.destination,je=ve.newPageBorderBoxCenter,tt=ve.viewport,qe=ve.withDroppableDisplacement,mt=ve.onlyOnMainAxis,wt=mt===void 0?!1:mt,Jt=yn(je,Se.page.borderBox.center),mn=po(Se.page.borderBox,Jt),sn={target:mn,destination:Be,withDroppableDisplacement:qe,viewport:tt};return wt?Uo(sn):ra(sn)},is=function(ve){var Se=ve.isMovingForward,Be=ve.draggable,je=ve.destination,tt=ve.draggables,qe=ve.previousImpact,mt=ve.viewport,wt=ve.previousPageBorderBoxCenter,Jt=ve.previousClientSelection,mn=ve.afterCritical;if(!je.isEnabled)return null;var sn=hi(je.descriptor.id,tt),rn=si(Be,je),nn=In({isMovingForward:Se,draggable:Be,destination:je,insideDestination:sn,previousImpact:qe})||Mo({isMovingForward:Se,isInHomeList:rn,draggable:Be,draggables:tt,destination:je,insideDestination:sn,previousImpact:qe,viewport:mt,afterCritical:mn});if(!nn)return null;var Ln=Zi({impact:nn,draggable:Be,droppable:je,draggables:tt,afterCritical:mn}),Li=Ns({draggable:Be,destination:je,newPageBorderBoxCenter:Ln,viewport:mt.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(Li){var Or=Hr({pageBorderBoxCenter:Ln,draggable:Be,viewport:mt});return{clientSelection:Or,impact:nn,scrollJumpRequest:null}}var Vr=yn(Ln,wt),ao=ea({impact:nn,viewport:mt,destination:je,draggables:tt,maxScrollChange:Vr});return{clientSelection:Jt,impact:ao,scrollJumpRequest:Vr}},Ut=function(Se){var Be=Se.subject.active;return Be||Xt(!1),Be},Zt=function(ve){var Se=ve.isMovingForward,Be=ve.pageBorderBoxCenter,je=ve.source,tt=ve.droppables,qe=ve.viewport,mt=je.subject.active;if(!mt)return null;var wt=je.axis,Jt=ur(mt[wt.start],mt[wt.end]),mn=Ie(tt).filter(function(rn){return rn!==je}).filter(function(rn){return rn.isEnabled}).filter(function(rn){return!!rn.subject.active}).filter(function(rn){return Ki(qe.frame)(Ut(rn))}).filter(function(rn){var nn=Ut(rn);return Se?mt[wt.crossAxisEnd]<nn[wt.crossAxisEnd]:nn[wt.crossAxisStart]<mt[wt.crossAxisStart]}).filter(function(rn){var nn=Ut(rn),Ln=ur(nn[wt.start],nn[wt.end]);return Jt(nn[wt.start])||Jt(nn[wt.end])||Ln(mt[wt.start])||Ln(mt[wt.end])}).sort(function(rn,nn){var Ln=Ut(rn)[wt.crossAxisStart],Li=Ut(nn)[wt.crossAxisStart];return Se?Ln-Li:Li-Ln}).filter(function(rn,nn,Ln){return Ut(rn)[wt.crossAxisStart]===Ut(Ln[0])[wt.crossAxisStart]});if(!mn.length)return null;if(mn.length===1)return mn[0];var sn=mn.filter(function(rn){var nn=ur(Ut(rn)[wt.start],Ut(rn)[wt.end]);return nn(Be[wt.line])});return sn.length===1?sn[0]:sn.length>1?sn.sort(function(rn,nn){return Ut(rn)[wt.start]-Ut(nn)[wt.start]})[0]:mn.sort(function(rn,nn){var Ln=Wr(Be,yo(Ut(rn))),Li=Wr(Be,yo(Ut(nn)));return Ln!==Li?Ln-Li:Ut(rn)[wt.start]-Ut(nn)[wt.start]})[0]},bn=function(Se,Be){var je=Se.page.borderBox.center;return oo(Se.descriptor.id,Be)?yn(je,Be.displacedBy.point):je},zi=function(Se,Be){var je=Se.page.borderBox;return oo(Se.descriptor.id,Be)?po(je,rr(Be.displacedBy.point)):je},Ei=function(ve){var Se=ve.pageBorderBoxCenter,Be=ve.viewport,je=ve.destination,tt=ve.insideDestination,qe=ve.afterCritical,mt=tt.filter(function(wt){return ra({target:zi(wt,qe),destination:je,viewport:Be.frame,withDroppableDisplacement:!0})}).sort(function(wt,Jt){var mn=Pr(Se,Ya(je,bn(wt,qe))),sn=Pr(Se,Ya(je,bn(Jt,qe)));return mn<sn?-1:sn<mn?1:wt.descriptor.index-Jt.descriptor.index});return mt[0]||null},Mi=$i(function(Se,Be){var je=Be[Se.line];return{value:je,point:er(Se.line,je)}}),wi=function(Se,Be,je){var tt=Se.axis;if(Se.descriptor.mode==="virtual")return er(tt.line,Be[tt.line]);var qe=Se.subject.page.contentBox[tt.size],mt=hi(Se.descriptor.id,je),wt=mt.reduce(function(sn,rn){return sn+rn.client.marginBox[tt.size]},0),Jt=wt+Be[tt.line],mn=Jt-qe;return mn<=0?null:er(tt.line,mn)},Fn=function(Se,Be){return(0,St.Z)({},Se,{scroll:(0,St.Z)({},Se.scroll,{max:Be})})},ti=function(Se,Be,je){var tt=Se.frame;si(Be,Se)&&Xt(!1),Se.subject.withPlaceholder&&Xt(!1);var qe=Mi(Se.axis,Be.displaceBy).point,mt=wi(Se,qe,je),wt={placeholderSize:qe,increasedBy:mt,oldFrameMaxScroll:Se.frame?Se.frame.scroll.max:null};if(!tt){var Jt=Bo({page:Se.subject.page,withPlaceholder:wt,axis:Se.axis,frame:Se.frame});return(0,St.Z)({},Se,{subject:Jt})}var mn=mt?So(tt.scroll.max,mt):tt.scroll.max,sn=Fn(tt,mn),rn=Bo({page:Se.subject.page,withPlaceholder:wt,axis:Se.axis,frame:sn});return(0,St.Z)({},Se,{subject:rn,frame:sn})},dr=function(Se){var Be=Se.subject.withPlaceholder;Be||Xt(!1);var je=Se.frame;if(!je){var tt=Bo({page:Se.subject.page,axis:Se.axis,frame:null,withPlaceholder:null});return(0,St.Z)({},Se,{subject:tt})}var qe=Be.oldFrameMaxScroll;qe||Xt(!1);var mt=Fn(je,qe),wt=Bo({page:Se.subject.page,axis:Se.axis,frame:mt,withPlaceholder:null});return(0,St.Z)({},Se,{subject:wt,frame:mt})},Tr=function(ve){var Se=ve.previousPageBorderBoxCenter,Be=ve.moveRelativeTo,je=ve.insideDestination,tt=ve.draggable,qe=ve.draggables,mt=ve.destination,wt=ve.viewport,Jt=ve.afterCritical;if(!Be){if(je.length)return null;var mn={displaced:$n,displacedBy:yi,at:{type:"REORDER",destination:{droppableId:mt.descriptor.id,index:0}}},sn=Zi({impact:mn,draggable:tt,droppable:mt,draggables:qe,afterCritical:Jt}),rn=si(tt,mt)?mt:ti(mt,tt,qe),nn=Ns({draggable:tt,destination:rn,newPageBorderBoxCenter:sn,viewport:wt.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return nn?mn:null}var Ln=Se[mt.axis.line]<=Be.page.borderBox.center[mt.axis.line],Li=function(){var Vr=Be.descriptor.index;return Be.descriptor.id===tt.descriptor.id||Ln?Vr:Vr+1}(),Or=Mi(mt.axis,tt.displaceBy);return bo({draggable:tt,insideDestination:je,destination:mt,viewport:wt,displacedBy:Or,last:$n,index:Li})},Vo=function(ve){var Se=ve.isMovingForward,Be=ve.previousPageBorderBoxCenter,je=ve.draggable,tt=ve.isOver,qe=ve.draggables,mt=ve.droppables,wt=ve.viewport,Jt=ve.afterCritical,mn=Zt({isMovingForward:Se,pageBorderBoxCenter:Be,source:tt,droppables:mt,viewport:wt});if(!mn)return null;var sn=hi(mn.descriptor.id,qe),rn=Ei({pageBorderBoxCenter:Be,viewport:wt,destination:mn,insideDestination:sn,afterCritical:Jt}),nn=Tr({previousPageBorderBoxCenter:Be,destination:mn,draggable:je,draggables:qe,moveRelativeTo:rn,insideDestination:sn,viewport:wt,afterCritical:Jt});if(!nn)return null;var Ln=Zi({impact:nn,draggable:je,droppable:mn,draggables:qe,afterCritical:Jt}),Li=Hr({pageBorderBoxCenter:Ln,draggable:je,viewport:wt});return{clientSelection:Li,impact:nn,scrollJumpRequest:null}},To=function(ve){var Se=ve.at;return Se?Se.type==="REORDER"?Se.destination.droppableId:Se.combine.droppableId:null},Ca=function(Se,Be){var je=To(Se);return je?Be[je]:null},Sa=function(ve){var Se=ve.state,Be=ve.type,je=Ca(Se.impact,Se.dimensions.droppables),tt=!!je,qe=Se.dimensions.droppables[Se.critical.droppable.id],mt=je||qe,wt=mt.axis.direction,Jt=wt==="vertical"&&(Be==="MOVE_UP"||Be==="MOVE_DOWN")||wt==="horizontal"&&(Be==="MOVE_LEFT"||Be==="MOVE_RIGHT");if(Jt&&!tt)return null;var mn=Be==="MOVE_DOWN"||Be==="MOVE_RIGHT",sn=Se.dimensions.draggables[Se.critical.draggable.id],rn=Se.current.page.borderBoxCenter,nn=Se.dimensions,Ln=nn.draggables,Li=nn.droppables;return Jt?is({isMovingForward:mn,previousPageBorderBoxCenter:rn,draggable:sn,destination:mt,draggables:Ln,viewport:Se.viewport,previousClientSelection:Se.current.client.selection,previousImpact:Se.impact,afterCritical:Se.afterCritical}):Vo({isMovingForward:mn,previousPageBorderBoxCenter:rn,draggable:sn,isOver:mt,draggables:Ln,droppables:Li,viewport:Se.viewport,afterCritical:Se.afterCritical})};function mo(ve){return ve.phase==="DRAGGING"||ve.phase==="COLLECTING"}function _r(ve){var Se=ur(ve.top,ve.bottom),Be=ur(ve.left,ve.right);return function(tt){return Se(tt.y)&&Be(tt.x)}}function ar(ve,Se){return ve.left<Se.right&&ve.right>Se.left&&ve.top<Se.bottom&&ve.bottom>Se.top}function oa(ve){var Se=ve.pageBorderBox,Be=ve.draggable,je=ve.candidates,tt=Be.page.borderBox.center,qe=je.map(function(mt){var wt=mt.axis,Jt=er(mt.axis.line,Se.center[wt.line],mt.page.borderBox.center[wt.crossAxisLine]);return{id:mt.descriptor.id,distance:Pr(tt,Jt)}}).sort(function(mt,wt){return wt.distance-mt.distance});return qe[0]?qe[0].id:null}function la(ve){var Se=ve.pageBorderBox,Be=ve.draggable,je=ve.droppables,tt=Ie(je).filter(function(qe){if(!qe.isEnabled)return!1;var mt=qe.subject.active;if(!mt||!ar(Se,mt))return!1;if(_r(mt)(Se.center))return!0;var wt=qe.axis,Jt=mt.center[wt.crossAxisLine],mn=Se[wt.crossAxisStart],sn=Se[wt.crossAxisEnd],rn=ur(mt[wt.crossAxisStart],mt[wt.crossAxisEnd]),nn=rn(mn),Ln=rn(sn);return!nn&&!Ln?!0:nn?mn<Jt:sn>Jt});return tt.length?tt.length===1?tt[0].descriptor.id:oa({pageBorderBox:Se,draggable:Be,candidates:tt}):null}var Ma=function(Se,Be){return Di(po(Se,Be))},za=function(ve,Se){var Be=ve.frame;return Be?Ma(Se,Be.scroll.diff.value):Se};function Ro(ve){var Se=ve.displaced,Be=ve.id;return!!(Se.visible[Be]||Se.invisible[Be])}function ua(ve){var Se=ve.draggable,Be=ve.closest,je=ve.inHomeList;return Be?je&&Be.descriptor.index>Se.descriptor.index?Be.descriptor.index-1:Be.descriptor.index:null}var ko=function(ve){var Se=ve.pageBorderBoxWithDroppableScroll,Be=ve.draggable,je=ve.destination,tt=ve.insideDestination,qe=ve.last,mt=ve.viewport,wt=ve.afterCritical,Jt=je.axis,mn=Mi(je.axis,Be.displaceBy),sn=mn.value,rn=Se[Jt.start],nn=Se[Jt.end],Ln=Ti(Be,tt),Li=Jo(Ln,function(Vr){var ao=Vr.descriptor.id,Co=Vr.page.borderBox.center[Jt.line],Go=oo(ao,wt),jo=Ro({displaced:qe,id:ao});return Go?jo?nn<=Co:rn<Co-sn:jo?nn<=Co+sn:rn<Co}),Or=ua({draggable:Be,closest:Li,inHomeList:si(Be,je)});return bo({draggable:Be,insideDestination:tt,destination:je,viewport:mt,last:qe,displacedBy:mn,index:Or})},jr=4,Fa=function(ve){var Se=ve.draggable,Be=ve.pageBorderBoxWithDroppableScroll,je=ve.previousImpact,tt=ve.destination,qe=ve.insideDestination,mt=ve.afterCritical;if(!tt.isCombineEnabled)return null;var wt=tt.axis,Jt=Mi(tt.axis,Se.displaceBy),mn=Jt.value,sn=Be[wt.start],rn=Be[wt.end],nn=Ti(Se,qe),Ln=Jo(nn,function(Or){var Vr=Or.descriptor.id,ao=Or.page.borderBox,Co=ao[wt.size],Go=Co/jr,jo=oo(Vr,mt),da=Ro({displaced:je.displaced,id:Vr});return jo?da?rn>ao[wt.start]+Go&&rn<ao[wt.end]-Go:sn>ao[wt.start]-mn+Go&&sn<ao[wt.end]-mn-Go:da?rn>ao[wt.start]+mn+Go&&rn<ao[wt.end]+mn-Go:sn>ao[wt.start]+Go&&sn<ao[wt.end]-Go});if(!Ln)return null;var Li={displacedBy:Jt,displaced:je.displaced,at:{type:"COMBINE",combine:{draggableId:Ln.descriptor.id,droppableId:tt.descriptor.id}}};return Li},sa=function(ve){var Se=ve.pageOffset,Be=ve.draggable,je=ve.draggables,tt=ve.droppables,qe=ve.previousImpact,mt=ve.viewport,wt=ve.afterCritical,Jt=Ma(Be.page.borderBox,Se),mn=la({pageBorderBox:Jt,draggable:Be,droppables:tt});if(!mn)return pi;var sn=tt[mn],rn=hi(sn.descriptor.id,je),nn=za(sn,Jt);return Fa({pageBorderBoxWithDroppableScroll:nn,draggable:Be,previousImpact:qe,destination:sn,insideDestination:rn,afterCritical:wt})||ko({pageBorderBoxWithDroppableScroll:nn,draggable:Be,destination:sn,insideDestination:rn,last:qe.displaced,viewport:mt,afterCritical:wt})},Xo=function(ve,Se){var Be;return(0,St.Z)({},ve,(Be={},Be[Se.descriptor.id]=Se,Be))},Io=function(Se){var Be=Se.previousImpact,je=Se.impact,tt=Se.droppables,qe=To(Be),mt=To(je);if(!qe||qe===mt)return tt;var wt=tt[qe];if(!wt.subject.withPlaceholder)return tt;var Jt=dr(wt);return Xo(tt,Jt)},ca=function(ve){var Se=ve.draggable,Be=ve.draggables,je=ve.droppables,tt=ve.previousImpact,qe=ve.impact,mt=Io({previousImpact:tt,impact:qe,droppables:je}),wt=To(qe);if(!wt)return mt;var Jt=je[wt];if(si(Se,Jt)||Jt.subject.withPlaceholder)return mt;var mn=ti(Jt,Se,Be);return Xo(mt,mn)},Wa=function(ve){var Se=ve.state,Be=ve.clientSelection,je=ve.dimensions,tt=ve.viewport,qe=ve.impact,mt=ve.scrollJumpRequest,wt=tt||Se.viewport,Jt=je||Se.dimensions,mn=Be||Se.current.client.selection,sn=yn(mn,Se.initial.client.selection),rn={offset:sn,selection:mn,borderBoxCenter:So(Se.initial.client.borderBoxCenter,sn)},nn={selection:So(rn.selection,wt.scroll.current),borderBoxCenter:So(rn.borderBoxCenter,wt.scroll.current),offset:So(rn.offset,wt.scroll.diff.value)},Ln={client:rn,page:nn};if(Se.phase==="COLLECTING")return(0,St.Z)({phase:"COLLECTING"},Se,{dimensions:Jt,viewport:wt,current:Ln});var Li=Jt.draggables[Se.critical.draggable.id],Or=qe||sa({pageOffset:nn.offset,draggable:Li,draggables:Jt.draggables,droppables:Jt.droppables,previousImpact:Se.impact,viewport:wt,afterCritical:Se.afterCritical}),Vr=ca({draggable:Li,impact:Or,previousImpact:Se.impact,draggables:Jt.draggables,droppables:Jt.droppables}),ao=(0,St.Z)({},Se,{current:Ln,dimensions:{draggables:Jt.draggables,droppables:Vr},impact:Or,viewport:wt,scrollJumpRequest:mt||null,forceShouldAnimate:mt?!1:null});return ao};function gt(ve,Se){return ve.map(function(Be){return Se[Be]})}var Ht=function(ve){var Se=ve.impact,Be=ve.viewport,je=ve.draggables,tt=ve.destination,qe=ve.forceShouldAnimate,mt=Se.displaced,wt=gt(mt.all,je),Jt=Ho({afterDragging:wt,destination:tt,displacedBy:Se.displacedBy,viewport:Be.frame,forceShouldAnimate:qe,last:mt});return(0,St.Z)({},Se,{displaced:Jt})},Re=function(ve){var Se=ve.impact,Be=ve.draggable,je=ve.droppable,tt=ve.draggables,qe=ve.viewport,mt=ve.afterCritical,wt=Zi({impact:Se,draggable:Be,draggables:tt,droppable:je,afterCritical:mt});return Hr({pageBorderBoxCenter:wt,draggable:Be,viewport:qe})},lt=function(ve){var Se=ve.state,Be=ve.dimensions,je=ve.viewport;Se.movementMode!=="SNAP"&&Xt(!1);var tt=Se.impact,qe=je||Se.viewport,mt=Be||Se.dimensions,wt=mt.draggables,Jt=mt.droppables,mn=wt[Se.critical.draggable.id],sn=To(tt);sn||Xt(!1);var rn=Jt[sn],nn=Ht({impact:tt,viewport:qe,destination:rn,draggables:wt}),Ln=Re({impact:nn,draggable:mn,droppable:rn,draggables:wt,viewport:qe,afterCritical:Se.afterCritical});return Wa({impact:nn,clientSelection:Ln,state:Se,dimensions:mt,viewport:qe})},fr=function(ve){return{index:ve.index,droppableId:ve.droppableId}},sr=function(ve){var Se=ve.draggable,Be=ve.home,je=ve.draggables,tt=ve.viewport,qe=Mi(Be.axis,Se.displaceBy),mt=hi(Be.descriptor.id,je),wt=mt.indexOf(Se);wt===-1&&Xt(!1);var Jt=mt.slice(wt+1),mn=Jt.reduce(function(Ln,Li){return Ln[Li.descriptor.id]=!0,Ln},{}),sn={inVirtualList:Be.descriptor.mode==="virtual",displacedBy:qe,effected:mn},rn=Ho({afterDragging:Jt,destination:Be,displacedBy:qe,last:null,viewport:tt.frame,forceShouldAnimate:!1}),nn={displaced:rn,displacedBy:qe,at:{type:"REORDER",destination:fr(Se.descriptor)}};return{impact:nn,afterCritical:sn}},pr=function(ve,Se){return{draggables:ve.draggables,droppables:Xo(ve.droppables,Se)}},Ui=function(Se){},Un=function(Se){},Lr=function(ve){var Se=ve.draggable,Be=ve.offset,je=ve.initialWindowScroll,tt=Fr(Se.client,Be),qe=be(tt,je),mt=(0,St.Z)({},Se,{placeholder:(0,St.Z)({},Se.placeholder,{client:tt}),client:tt,page:qe});return mt},kr=function(ve){var Se=ve.frame;return Se||Xt(!1),Se},Zr=function(ve){var Se=ve.additions,Be=ve.updatedDroppables,je=ve.viewport,tt=je.scroll.diff.value;return Se.map(function(qe){var mt=qe.descriptor.droppableId,wt=Be[mt],Jt=kr(wt),mn=Jt.scroll.diff.value,sn=So(tt,mn),rn=Lr({draggable:qe,offset:sn,initialWindowScroll:je.scroll.initial});return rn})},Er=function(ve){var Se=ve.state,Be=ve.published;Ui();var je=Be.modified.map(function(Go){var jo=Se.dimensions.droppables[Go.droppableId],da=br(jo,Go.scroll);return da}),tt=(0,St.Z)({},Se.dimensions.droppables,{},jn(je)),qe=Gt(Zr({additions:Be.additions,updatedDroppables:tt,viewport:Se.viewport})),mt=(0,St.Z)({},Se.dimensions.draggables,{},qe);Be.removals.forEach(function(Go){delete mt[Go]});var wt={droppables:tt,draggables:mt},Jt=To(Se.impact),mn=Jt?wt.droppables[Jt]:null,sn=wt.draggables[Se.critical.draggable.id],rn=wt.droppables[Se.critical.droppable.id],nn=sr({draggable:sn,home:rn,draggables:mt,viewport:Se.viewport}),Ln=nn.impact,Li=nn.afterCritical,Or=mn&&mn.isCombineEnabled?Se.impact:Ln,Vr=sa({pageOffset:Se.current.page.offset,draggable:wt.draggables[Se.critical.draggable.id],draggables:wt.draggables,droppables:wt.droppables,previousImpact:Or,viewport:Se.viewport,afterCritical:Li});Un();var ao=(0,St.Z)({phase:"DRAGGING"},Se,{phase:"DRAGGING",impact:Vr,onLiftImpact:Ln,dimensions:wt,afterCritical:Li,forceShouldAnimate:!1});if(Se.phase==="COLLECTING")return ao;var Co=(0,St.Z)({phase:"DROP_PENDING"},ao,{phase:"DROP_PENDING",reason:Se.reason,isWaiting:!1});return Co},Eo=function(Se){return Se.movementMode==="SNAP"},Wi=function(Se,Be,je){var tt=pr(Se.dimensions,Be);return!Eo(Se)||je?Wa({state:Se,dimensions:tt}):lt({state:Se,dimensions:tt})};function Si(ve){return ve.isDragging&&ve.movementMode==="SNAP"?(0,St.Z)({phase:"DRAGGING"},ve,{scrollJumpRequest:null}):ve}var Pi={phase:"IDLE",completed:null,shouldFlush:!1},Jr=function(ve,Se){if(ve===void 0&&(ve=Pi),Se.type==="FLUSH")return(0,St.Z)({},Pi,{shouldFlush:!0});if(Se.type==="INITIAL_PUBLISH"){ve.phase!=="IDLE"&&Xt(!1);var Be=Se.payload,je=Be.critical,tt=Be.clientSelection,qe=Be.viewport,mt=Be.dimensions,wt=Be.movementMode,Jt=mt.draggables[je.draggable.id],mn=mt.droppables[je.droppable.id],sn={selection:tt,borderBoxCenter:Jt.client.borderBox.center,offset:Gr},rn={client:sn,page:{selection:So(sn.selection,qe.scroll.initial),borderBoxCenter:So(sn.selection,qe.scroll.initial),offset:So(sn.selection,qe.scroll.diff.value)}},nn=Ie(mt.droppables).every(function(Af){return!Af.isFixedOnPage}),Ln=sr({draggable:Jt,home:mn,draggables:mt.draggables,viewport:qe}),Li=Ln.impact,Or=Ln.afterCritical,Vr={phase:"DRAGGING",isDragging:!0,critical:je,movementMode:wt,dimensions:mt,initial:rn,current:rn,isWindowScrollAllowed:nn,impact:Li,afterCritical:Or,onLiftImpact:Li,viewport:qe,scrollJumpRequest:null,forceShouldAnimate:null};return Vr}if(Se.type==="COLLECTION_STARTING"){if(ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING")return ve;ve.phase!=="DRAGGING"&&Xt(!1);var ao=(0,St.Z)({phase:"COLLECTING"},ve,{phase:"COLLECTING"});return ao}if(Se.type==="PUBLISH_WHILE_DRAGGING")return ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING"||Xt(!1),Er({state:ve,published:Se.payload});if(Se.type==="MOVE"){if(ve.phase==="DROP_PENDING")return ve;mo(ve)||Xt(!1);var Co=Se.payload.client;return Xn(Co,ve.current.client.selection)?ve:Wa({state:ve,clientSelection:Co,impact:Eo(ve)?ve.impact:null})}if(Se.type==="UPDATE_DROPPABLE_SCROLL"){if(ve.phase==="DROP_PENDING"||ve.phase==="COLLECTING")return Si(ve);mo(ve)||Xt(!1);var Go=Se.payload,jo=Go.id,da=Go.newScroll,Za=ve.dimensions.droppables[jo];if(!Za)return ve;var ns=br(Za,da);return Wi(ve,ns,!1)}if(Se.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(ve.phase==="DROP_PENDING")return ve;mo(ve)||Xt(!1);var el=Se.payload,$a=el.id,Ys=el.isEnabled,Nl=ve.dimensions.droppables[$a];Nl||Xt(!1),Nl.isEnabled===Ys&&Xt(!1);var Kl=(0,St.Z)({},Nl,{isEnabled:Ys});return Wi(ve,Kl,!0)}if(Se.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(ve.phase==="DROP_PENDING")return ve;mo(ve)||Xt(!1);var fh=Se.payload,bu=fh.id,pu=fh.isCombineEnabled,pl=ve.dimensions.droppables[bu];pl||Xt(!1),pl.isCombineEnabled===pu&&Xt(!1);var zs=(0,St.Z)({},pl,{isCombineEnabled:pu});return Wi(ve,zs,!0)}if(Se.type==="MOVE_BY_WINDOW_SCROLL"){if(ve.phase==="DROP_PENDING"||ve.phase==="DROP_ANIMATING")return ve;mo(ve)||Xt(!1),ve.isWindowScrollAllowed||Xt(!1);var Mh=Se.payload.newScroll;if(Xn(ve.viewport.scroll.current,Mh))return Si(ve);var Xs=Xr(ve.viewport,Mh);return Eo(ve)?lt({state:ve,viewport:Xs}):Wa({state:ve,viewport:Xs})}if(Se.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!mo(ve))return ve;var gh=Se.payload.maxScroll;if(Xn(gh,ve.viewport.scroll.max))return ve;var Dc=(0,St.Z)({},ve.viewport,{scroll:(0,St.Z)({},ve.viewport.scroll,{max:gh})});return(0,St.Z)({phase:"DRAGGING"},ve,{viewport:Dc})}if(Se.type==="MOVE_UP"||Se.type==="MOVE_DOWN"||Se.type==="MOVE_LEFT"||Se.type==="MOVE_RIGHT"){if(ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING")return ve;ve.phase!=="DRAGGING"&&Xt(!1);var ph=Sa({state:ve,type:Se.type});return ph?Wa({state:ve,impact:ph.impact,clientSelection:ph.clientSelection,scrollJumpRequest:ph.scrollJumpRequest}):ve}if(Se.type==="DROP_PENDING"){var $o=Se.payload.reason;ve.phase!=="COLLECTING"&&Xt(!1);var Xd=(0,St.Z)({phase:"DROP_PENDING"},ve,{phase:"DROP_PENDING",isWaiting:!0,reason:$o});return Xd}if(Se.type==="DROP_ANIMATE"){var Sg=Se.payload,mh=Sg.completed,Uh=Sg.dropDuration,Cd=Sg.newHomeClientOffset;ve.phase==="DRAGGING"||ve.phase==="DROP_PENDING"||Xt(!1);var mu={phase:"DROP_ANIMATING",completed:mh,dropDuration:Uh,newHomeClientOffset:Cd,dimensions:ve.dimensions};return mu}if(Se.type==="DROP_COMPLETE"){var kf=Se.payload.completed;return{phase:"IDLE",completed:kf,shouldFlush:!1}}return ve},Ur=function(Se){return{type:"BEFORE_INITIAL_CAPTURE",payload:Se}},Nr=function(Se){return{type:"LIFT",payload:Se}},Lo=function(Se){return{type:"INITIAL_PUBLISH",payload:Se}},yr=function(Se){return{type:"PUBLISH_WHILE_DRAGGING",payload:Se}},Qr=function(){return{type:"COLLECTION_STARTING",payload:null}},tr=function(Se){return{type:"UPDATE_DROPPABLE_SCROLL",payload:Se}},Ir=function(Se){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:Se}},uo=function(Se){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:Se}},Zo=function(Se){return{type:"MOVE",payload:Se}},ha=function(Se){return{type:"MOVE_BY_WINDOW_SCROLL",payload:Se}},La=function(Se){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:Se}},zr=function(){return{type:"MOVE_UP",payload:null}},bs=function(){return{type:"MOVE_DOWN",payload:null}},eo=function(){return{type:"MOVE_RIGHT",payload:null}},ka=function(){return{type:"MOVE_LEFT",payload:null}},wo=function(){return{type:"FLUSH",payload:null}},ts=function(Se){return{type:"DROP_ANIMATE",payload:Se}},Ha=function(Se){return{type:"DROP_COMPLETE",payload:Se}},rs=function(Se){return{type:"DROP",payload:Se}},Ol=function(Se){return{type:"DROP_PENDING",payload:Se}},su=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function Rl(ve){if(!(ve.length<=1)){for(var Se=ve.map(function(wt){return wt.descriptor.index}),Be={},je=1;je<Se.length;je++){var tt=Se[je],qe=Se[je-1];tt!==qe+1&&(Be[tt]=!0)}if(Object.keys(Be).length)var mt=Se.map(function(wt){var Jt=!!Be[wt];return Jt?"[\u{1F525}"+wt+"]":""+wt}).join(", ")}}function lu(ve,Se){if(0)var Be}var Da=function(ve){return function(Se){var Be=Se.getState,je=Se.dispatch;return function(tt){return function(qe){if(qe.type!=="LIFT"){tt(qe);return}var mt=qe.payload,wt=mt.id,Jt=mt.clientSelection,mn=mt.movementMode,sn=Be();sn.phase==="DROP_ANIMATING"&&je(Ha({completed:sn.completed})),Be().phase!=="IDLE"&&Xt(!1),je(wo()),je(Ur({draggableId:wt,movementMode:mn}));var rn={shouldPublishImmediately:mn==="SNAP"},nn={draggableId:wt,scrollOptions:rn},Ln=ve.startPublishing(nn),Li=Ln.critical,Or=Ln.dimensions,Vr=Ln.viewport;lu(Li,Or),je(Lo({critical:Li,dimensions:Or,clientSelection:Jt,movementMode:mn,viewport:Vr}))}}}},al=function(ve){return function(){return function(Se){return function(Be){Be.type==="INITIAL_PUBLISH"&&ve.dragging(),Be.type==="DROP_ANIMATE"&&ve.dropping(Be.payload.completed.result.reason),(Be.type==="FLUSH"||Be.type==="DROP_COMPLETE")&&ve.resting(),Se(Be)}}}},jl={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},nl={opacity:{drop:0,combining:.7},scale:{drop:.75}},oh={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},dl=oh.outOfTheWay+"s "+jl.outOfTheWay,pa={fluid:"opacity "+dl,snap:"transform "+dl+", opacity "+dl,drop:function(Se){var Be=Se+"s "+jl.drop;return"transform "+Be+", opacity "+Be},outOfTheWay:"transform "+dl,placeholder:"height "+dl+", width "+dl+", margin "+dl},Oa=function(Se){return Xn(Se,Gr)?null:"translate("+Se.x+"px, "+Se.y+"px)"},hs={moveTo:Oa,drop:function(Se,Be){var je=Oa(Se);return je?Be?je+" scale("+nl.scale.drop+")":je:null}},Os=oh.minDropTime,Rs=oh.maxDropTime,Nu=Rs-Os,Bl=1500,Du=.6,zl=function(ve){var Se=ve.current,Be=ve.destination,je=ve.reason,tt=Pr(Se,Be);if(tt<=0)return Os;if(tt>=Bl)return Rs;var qe=tt/Bl,mt=Os+Nu*qe,wt=je==="CANCEL"?mt*Du:mt;return Number(wt.toFixed(2))},uu=function(ve){var Se=ve.impact,Be=ve.draggable,je=ve.dimensions,tt=ve.viewport,qe=ve.afterCritical,mt=je.draggables,wt=je.droppables,Jt=To(Se),mn=Jt?wt[Jt]:null,sn=wt[Be.descriptor.droppableId],rn=Re({impact:Se,draggable:Be,draggables:mt,afterCritical:qe,droppable:mn||sn,viewport:tt}),nn=yn(rn,Be.client.borderBox.center);return nn},of=function(ve){var Se=ve.draggables,Be=ve.reason,je=ve.lastImpact,tt=ve.home,qe=ve.viewport,mt=ve.onLiftImpact;if(!je.at||Be!=="DROP"){var wt=Ht({draggables:Se,impact:mt,destination:tt,viewport:qe,forceShouldAnimate:!0});return{impact:wt,didDropInsideDroppable:!1}}if(je.at.type==="REORDER")return{impact:je,didDropInsideDroppable:!0};var Jt=(0,St.Z)({},je,{displaced:$n});return{impact:Jt,didDropInsideDroppable:!0}},af=function(ve){var Se=ve.getState,Be=ve.dispatch;return function(je){return function(tt){if(tt.type!=="DROP"){je(tt);return}var qe=Se(),mt=tt.payload.reason;if(qe.phase==="COLLECTING"){Be(Ol({reason:mt}));return}if(qe.phase!=="IDLE"){var wt=qe.phase==="DROP_PENDING"&&qe.isWaiting;wt&&Xt(!1),qe.phase==="DRAGGING"||qe.phase==="DROP_PENDING"||Xt(!1);var Jt=qe.critical,mn=qe.dimensions,sn=mn.draggables[qe.critical.draggable.id],rn=of({reason:mt,lastImpact:qe.impact,afterCritical:qe.afterCritical,onLiftImpact:qe.onLiftImpact,home:qe.dimensions.droppables[qe.critical.droppable.id],viewport:qe.viewport,draggables:qe.dimensions.draggables}),nn=rn.impact,Ln=rn.didDropInsideDroppable,Li=Ln?_i(nn):null,Or=Ln?Yi(nn):null,Vr={index:Jt.draggable.index,droppableId:Jt.droppable.id},ao={draggableId:sn.descriptor.id,type:sn.descriptor.type,source:Vr,reason:mt,mode:qe.movementMode,destination:Li,combine:Or},Co=uu({impact:nn,draggable:sn,dimensions:mn,viewport:qe.viewport,afterCritical:qe.afterCritical}),Go={critical:qe.critical,afterCritical:qe.afterCritical,result:ao,impact:nn},jo=!Xn(qe.current.client.offset,Co)||!!ao.combine;if(!jo){Be(Ha({completed:Go}));return}var da=zl({current:qe.current.client.offset,destination:Co,reason:mt}),Za={newHomeClientOffset:Co,dropDuration:da,completed:Go};Be(ts(Za))}}}},mc=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function sf(ve){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(Be){Be.target!==window&&Be.target!==window.document||ve()}}}function Es(ve){var Se=ve.onWindowScroll;function Be(){Se(mc())}var je=Mt(Be),tt=sf(je),qe=Ke;function mt(){return qe!==Ke}function wt(){mt()&&Xt(!1),qe=_n(window,[tt])}function Jt(){mt()||Xt(!1),je.cancel(),qe(),qe=Ke}return{start:wt,stop:Jt,isActive:mt}}var Wn=function(Se){return Se.type==="DROP_COMPLETE"||Se.type==="DROP_ANIMATE"||Se.type==="FLUSH"},gr=function(ve){var Se=Es({onWindowScroll:function(je){ve.dispatch(ha({newScroll:je}))}});return function(Be){return function(je){!Se.isActive()&&je.type==="INITIAL_PUBLISH"&&Se.start(),Se.isActive()&&Wn(je)&&Se.stop(),Be(je)}}},_o=function(ve){var Se=!1,Be=!1,je=setTimeout(function(){Be=!0}),tt=function(mt){Se||Be||(Se=!0,ve(mt),clearTimeout(je))};return tt.wasCalled=function(){return Se},tt},io=function(){var ve=[],Se=function(qe){var mt=ho(ve,function(mn){return mn.timerId===qe});mt===-1&&Xt(!1);var wt=ve.splice(mt,1),Jt=wt[0];Jt.callback()},Be=function(qe){var mt=setTimeout(function(){return Se(mt)}),wt={timerId:mt,callback:qe};ve.push(wt)},je=function(){if(ve.length){var qe=[].concat(ve);ve.length=0,qe.forEach(function(mt){clearTimeout(mt.timerId),mt.callback()})}};return{add:Be,flush:je}},nr=function(Se,Be){return Se==null&&Be==null?!0:Se==null||Be==null?!1:Se.droppableId===Be.droppableId&&Se.index===Be.index},Aa=function(Se,Be){return Se==null&&Be==null?!0:Se==null||Be==null?!1:Se.draggableId===Be.draggableId&&Se.droppableId===Be.droppableId},ma=function(Se,Be){if(Se===Be)return!0;var je=Se.draggable.id===Be.draggable.id&&Se.draggable.droppableId===Be.draggable.droppableId&&Se.draggable.type===Be.draggable.type&&Se.draggable.index===Be.draggable.index,tt=Se.droppable.id===Be.droppable.id&&Se.droppable.type===Be.droppable.type;return je&&tt},Ua=function(Se,Be){Ui(),Be(),Un()},Pa=function(Se,Be){return{draggableId:Se.draggable.id,type:Se.droppable.type,source:{droppableId:Se.droppable.id,index:Se.draggable.index},mode:Be}},Ks=function(Se,Be,je,tt){if(!Se){je(tt(Be));return}var qe=_o(je),mt={announce:qe};Se(Be,mt),qe.wasCalled()||je(tt(Be))},Ra=function(ve,Se){var Be=io(),je=null,tt=function(nn,Ln){je&&Xt(!1),Ua("onBeforeCapture",function(){var Li=ve().onBeforeCapture;if(Li){var Or={draggableId:nn,mode:Ln};Li(Or)}})},qe=function(nn,Ln){je&&Xt(!1),Ua("onBeforeDragStart",function(){var Li=ve().onBeforeDragStart;Li&&Li(Pa(nn,Ln))})},mt=function(nn,Ln){je&&Xt(!1);var Li=Pa(nn,Ln);je={mode:Ln,lastCritical:nn,lastLocation:Li.source,lastCombine:null},Be.add(function(){Ua("onDragStart",function(){return Ks(ve().onDragStart,Li,Se,ro.onDragStart)})})},wt=function(nn,Ln){var Li=_i(Ln),Or=Yi(Ln);je||Xt(!1);var Vr=!ma(nn,je.lastCritical);Vr&&(je.lastCritical=nn);var ao=!nr(je.lastLocation,Li);ao&&(je.lastLocation=Li);var Co=!Aa(je.lastCombine,Or);if(Co&&(je.lastCombine=Or),!(!Vr&&!ao&&!Co)){var Go=(0,St.Z)({},Pa(nn,je.mode),{combine:Or,destination:Li});Be.add(function(){Ua("onDragUpdate",function(){return Ks(ve().onDragUpdate,Go,Se,ro.onDragUpdate)})})}},Jt=function(){je||Xt(!1),Be.flush()},mn=function(nn){je||Xt(!1),je=null,Ua("onDragEnd",function(){return Ks(ve().onDragEnd,nn,Se,ro.onDragEnd)})},sn=function(){if(je){var nn=(0,St.Z)({},Pa(je.lastCritical,je.mode),{combine:null,destination:null,reason:"CANCEL"});mn(nn)}};return{beforeCapture:tt,beforeStart:qe,start:mt,update:wt,flush:Jt,drop:mn,abort:sn}},ql=function(ve,Se){var Be=Ra(ve,Se);return function(je){return function(tt){return function(qe){if(qe.type==="BEFORE_INITIAL_CAPTURE"){Be.beforeCapture(qe.payload.draggableId,qe.payload.movementMode);return}if(qe.type==="INITIAL_PUBLISH"){var mt=qe.payload.critical;Be.beforeStart(mt,qe.payload.movementMode),tt(qe),Be.start(mt,qe.payload.movementMode);return}if(qe.type==="DROP_COMPLETE"){var wt=qe.payload.completed.result;Be.flush(),tt(qe),Be.drop(wt);return}if(tt(qe),qe.type==="FLUSH"){Be.abort();return}var Jt=je.getState();Jt.phase==="DRAGGING"&&Be.update(Jt.critical,Jt.impact)}}}},Xa=function(ve){return function(Se){return function(Be){if(Be.type!=="DROP_ANIMATION_FINISHED"){Se(Be);return}var je=ve.getState();je.phase!=="DROP_ANIMATING"&&Xt(!1),ve.dispatch(Ha({completed:je.completed}))}}},Oo=function(ve){var Se=null,Be=null;function je(){Be&&(cancelAnimationFrame(Be),Be=null),Se&&(Se(),Se=null)}return function(tt){return function(qe){if((qe.type==="FLUSH"||qe.type==="DROP_COMPLETE"||qe.type==="DROP_ANIMATION_FINISHED")&&je(),tt(qe),qe.type==="DROP_ANIMATE"){var mt={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var Jt=ve.getState();Jt.phase==="DROP_ANIMATING"&&ve.dispatch(su())}};Be=requestAnimationFrame(function(){Be=null,Se=_n(window,[mt])})}}}},Zl=function(ve){return function(){return function(Se){return function(Be){(Be.type==="DROP_COMPLETE"||Be.type==="FLUSH"||Be.type==="DROP_ANIMATE")&&ve.stopPublishing(),Se(Be)}}}},sl=function(ve){var Se=!1;return function(){return function(Be){return function(je){if(je.type==="INITIAL_PUBLISH"){Se=!0,ve.tryRecordFocus(je.payload.critical.draggable.id),Be(je),ve.tryRestoreFocusRecorded();return}if(Be(je),!!Se){if(je.type==="FLUSH"){Se=!1,ve.tryRestoreFocusRecorded();return}if(je.type==="DROP_COMPLETE"){Se=!1;var tt=je.payload.completed.result;tt.combine&&ve.tryShiftRecord(tt.draggableId,tt.combine.draggableId),ve.tryRestoreFocusRecorded()}}}}}},Ds=function(Se){return Se.type==="DROP_COMPLETE"||Se.type==="DROP_ANIMATE"||Se.type==="FLUSH"},Su=function(ve){return function(Se){return function(Be){return function(je){if(Ds(je)){ve.stop(),Be(je);return}if(je.type==="INITIAL_PUBLISH"){Be(je);var tt=Se.getState();tt.phase!=="DRAGGING"&&Xt(!1),ve.start(tt);return}Be(je),ve.scroll(Se.getState())}}}},Cs=function(ve){return function(Se){return function(Be){if(Se(Be),Be.type==="PUBLISH_WHILE_DRAGGING"){var je=ve.getState();je.phase==="DROP_PENDING"&&(je.isWaiting||ve.dispatch(rs({reason:je.reason})))}}}},Ts=yt.qC,Ml=function(ve){var Se=ve.dimensionMarshal,Be=ve.focusMarshal,je=ve.styleMarshal,tt=ve.getResponders,qe=ve.announce,mt=ve.autoScroller;return(0,yt.MT)(Jr,Ts((0,yt.md)(al(je),Zl(Se),Da(Se),af,Xa,Oo,Cs,Su(mt),gr,sl(Be),ql(tt,qe))))},Js=function(){return{additions:{},removals:{},modified:{}}};function _h(ve){var Se=ve.registry,Be=ve.callbacks,je=Js(),tt=null,qe=function(){tt||(Be.collectionStarting(),tt=requestAnimationFrame(function(){tt=null,Ui();var sn=je,rn=sn.additions,nn=sn.removals,Ln=sn.modified,Li=Object.keys(rn).map(function(ao){return Se.draggable.getById(ao).getDimension(Gr)}).sort(function(ao,Co){return ao.descriptor.index-Co.descriptor.index}),Or=Object.keys(Ln).map(function(ao){var Co=Se.droppable.getById(ao),Go=Co.callbacks.getScrollWhileDragging();return{droppableId:ao,scroll:Go}}),Vr={additions:Li,removals:Object.keys(nn),modified:Or};je=Js(),Un(),Be.publish(Vr)}))},mt=function(sn){var rn=sn.descriptor.id;je.additions[rn]=sn,je.modified[sn.descriptor.droppableId]=!0,je.removals[rn]&&delete je.removals[rn],qe()},wt=function(sn){var rn=sn.descriptor;je.removals[rn.id]=!0,je.modified[rn.droppableId]=!0,je.additions[rn.id]&&delete je.additions[rn.id],qe()},Jt=function(){tt&&(cancelAnimationFrame(tt),tt=null,je=Js())};return{add:mt,remove:wt,stop:Jt}}var Gl=function(ve){var Se=ve.scrollHeight,Be=ve.scrollWidth,je=ve.height,tt=ve.width,qe=yn({x:Be,y:Se},{x:tt,y:je}),mt={x:Math.max(0,qe.x),y:Math.max(0,qe.y)};return mt},js=function(){var ve=document.documentElement;return ve||Xt(!1),ve},Tu=function(){var ve=js(),Se=Gl({scrollHeight:ve.scrollHeight,scrollWidth:ve.scrollWidth,width:ve.clientWidth,height:ve.clientHeight});return Se},hu=function(){var ve=mc(),Se=Tu(),Be=ve.y,je=ve.x,tt=js(),qe=tt.clientWidth,mt=tt.clientHeight,wt=je+qe,Jt=Be+mt,mn=Di({top:Be,left:je,right:wt,bottom:Jt}),sn={frame:mn,scroll:{initial:ve,current:ve,max:Se,diff:{value:Gr,displacement:Gr}}};return sn},ll=function(ve){var Se=ve.critical,Be=ve.scrollOptions,je=ve.registry;Ui();var tt=hu(),qe=tt.scroll.current,mt=Se.droppable,wt=je.droppable.getAllByType(mt.type).map(function(rn){return rn.callbacks.getDimensionAndWatchScroll(qe,Be)}),Jt=je.draggable.getAllByType(Se.draggable.type).map(function(rn){return rn.getDimension(qe)}),mn={draggables:Gt(Jt),droppables:jn(wt)};Un();var sn={dimensions:mn,critical:Se,viewport:tt};return sn};function du(ve,Se,Be){if(Be.descriptor.id===Se.id||Be.descriptor.type!==Se.type)return!1;var je=ve.droppable.getById(Be.descriptor.droppableId);return je.descriptor.mode==="virtual"}var us=function(ve,Se){var Be=null,je=_h({callbacks:{publish:Se.publishWhileDragging,collectionStarting:Se.collectionStarting},registry:ve}),tt=function(Ln,Li){ve.droppable.exists(Ln)||Xt(!1),Be&&Se.updateDroppableIsEnabled({id:Ln,isEnabled:Li})},qe=function(Ln,Li){Be&&(ve.droppable.exists(Ln)||Xt(!1),Se.updateDroppableIsCombineEnabled({id:Ln,isCombineEnabled:Li}))},mt=function(Ln,Li){Be&&(ve.droppable.exists(Ln)||Xt(!1),Se.updateDroppableScroll({id:Ln,newScroll:Li}))},wt=function(Ln,Li){Be&&ve.droppable.getById(Ln).callbacks.scroll(Li)},Jt=function(){if(Be){je.stop();var Ln=Be.critical.droppable;ve.droppable.getAllByType(Ln.type).forEach(function(Li){return Li.callbacks.dragStopped()}),Be.unsubscribe(),Be=null}},mn=function(Ln){Be||Xt(!1);var Li=Be.critical.draggable;Ln.type==="ADDITION"&&du(ve,Li,Ln.value)&&je.add(Ln.value),Ln.type==="REMOVAL"&&du(ve,Li,Ln.value)&&je.remove(Ln.value)},sn=function(Ln){Be&&Xt(!1);var Li=ve.draggable.getById(Ln.draggableId),Or=ve.droppable.getById(Li.descriptor.droppableId),Vr={draggable:Li.descriptor,droppable:Or.descriptor},ao=ve.subscribe(mn);return Be={critical:Vr,unsubscribe:ao},ll({critical:Vr,registry:ve,scrollOptions:Ln.scrollOptions})},rn={updateDroppableIsEnabled:tt,updateDroppableIsCombineEnabled:qe,scrollDroppable:wt,updateDroppableScroll:mt,startPublishing:sn,stopPublishing:Jt};return rn},wu=function(ve,Se){return ve.phase==="IDLE"?!0:ve.phase!=="DROP_ANIMATING"||ve.completed.result.draggableId===Se?!1:ve.completed.result.reason==="DROP"},Fh=function(ve){window.scrollBy(ve.x,ve.y)},Oh=$i(function(ve){return Ie(ve).filter(function(Se){return!(!Se.isEnabled||!Se.frame)})}),od=function(Se,Be){var je=Jo(Oh(Be),function(tt){return tt.frame||Xt(!1),_r(tt.frame.pageMarginBox)(Se)});return je},vc=function(ve){var Se=ve.center,Be=ve.destination,je=ve.droppables;if(Be){var tt=je[Be];return tt.frame?tt:null}var qe=od(Se,je);return qe},Pu={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(Se){return Math.pow(Se,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},yc=function(ve,Se){var Be=ve[Se.size]*Pu.startFromPercentage,je=ve[Se.size]*Pu.maxScrollAtPercentage,tt={startScrollingFrom:Be,maxScrollValueAt:je};return tt},Ta=function(ve){var Se=ve.startOfRange,Be=ve.endOfRange,je=ve.current,tt=Be-Se;if(tt===0)return 0;var qe=je-Se,mt=qe/tt;return mt},ad=1,Uf=function(ve,Se){if(ve>Se.startScrollingFrom)return 0;if(ve<=Se.maxScrollValueAt)return Pu.maxPixelScroll;if(ve===Se.startScrollingFrom)return ad;var Be=Ta({startOfRange:Se.maxScrollValueAt,endOfRange:Se.startScrollingFrom,current:ve}),je=1-Be,tt=Pu.maxPixelScroll*Pu.ease(je);return Math.ceil(tt)},xc=Pu.durationDampening.accelerateAt,Iu=Pu.durationDampening.stopDampeningAt,lf=function(ve,Se){var Be=Se,je=Iu,tt=Date.now(),qe=tt-Be;if(qe>=Iu)return ve;if(qe<xc)return ad;var mt=Ta({startOfRange:xc,endOfRange:je,current:qe}),wt=ve*Pu.ease(mt);return Math.ceil(wt)},Id=function(ve){var Se=ve.distanceToEdge,Be=ve.thresholds,je=ve.dragStartTime,tt=ve.shouldUseTimeDampening,qe=Uf(Se,Be);return qe===0?0:tt?Math.max(lf(qe,je),ad):qe},Wg=function(ve){var Se=ve.container,Be=ve.distanceToEdges,je=ve.dragStartTime,tt=ve.axis,qe=ve.shouldUseTimeDampening,mt=yc(Se,tt),wt=Be[tt.end]<Be[tt.start];return wt?Id({distanceToEdge:Be[tt.end],thresholds:mt,dragStartTime:je,shouldUseTimeDampening:qe}):-1*Id({distanceToEdge:Be[tt.start],thresholds:mt,dragStartTime:je,shouldUseTimeDampening:qe})},_d=function(ve){var Se=ve.container,Be=ve.subject,je=ve.proposedScroll,tt=Be.height>Se.height,qe=Be.width>Se.width;return!qe&&!tt?je:qe&&tt?null:{x:qe?0:je.x,y:tt?0:je.y}},uf=so(function(ve){return ve===0?0:ve}),sd=function(ve){var Se=ve.dragStartTime,Be=ve.container,je=ve.subject,tt=ve.center,qe=ve.shouldUseTimeDampening,mt={top:tt.y-Be.top,right:Be.right-tt.x,bottom:Be.bottom-tt.y,left:tt.x-Be.left},wt=Wg({container:Be,distanceToEdges:mt,dragStartTime:Se,axis:Pn,shouldUseTimeDampening:qe}),Jt=Wg({container:Be,distanceToEdges:mt,dragStartTime:Se,axis:hr,shouldUseTimeDampening:qe}),mn=uf({x:Jt,y:wt});if(Xn(mn,Gr))return null;var sn=_d({container:Be,subject:je,proposedScroll:mn});return sn?Xn(sn,Gr)?null:sn:null},Sc=so(function(ve){return ve===0?0:ve>0?1:-1}),ld=function(){var ve=function(Be,je){return Be<0?Be:Be>je?Be-je:0};return function(Se){var Be=Se.current,je=Se.max,tt=Se.change,qe=So(Be,tt),mt={x:ve(qe.x,je.x),y:ve(qe.y,je.y)};return Xn(mt,Gr)?null:mt}}(),hf=function(Se){var Be=Se.max,je=Se.current,tt=Se.change,qe={x:Math.max(je.x,Be.x),y:Math.max(je.y,Be.y)},mt=Sc(tt),wt=ld({max:qe,current:je,change:mt});return!wt||mt.x!==0&&wt.x===0||mt.y!==0&&wt.y===0},ud=function(Se,Be){return hf({current:Se.scroll.current,max:Se.scroll.max,change:Be})},Od=function(Se,Be){if(!ud(Se,Be))return null;var je=Se.scroll.max,tt=Se.scroll.current;return ld({current:tt,max:je,change:Be})},ah=function(Se,Be){var je=Se.frame;return je?hf({current:je.scroll.current,max:je.scroll.max,change:Be}):!1},kl=function(Se,Be){var je=Se.frame;return!je||!ah(Se,Be)?null:ld({current:je.scroll.current,max:je.scroll.max,change:Be})},sh=function(ve){var Se=ve.viewport,Be=ve.subject,je=ve.center,tt=ve.dragStartTime,qe=ve.shouldUseTimeDampening,mt=sd({dragStartTime:tt,container:Se.frame,subject:Be,center:je,shouldUseTimeDampening:qe});return mt&&ud(Se,mt)?mt:null},df=function(ve){var Se=ve.droppable,Be=ve.subject,je=ve.center,tt=ve.dragStartTime,qe=ve.shouldUseTimeDampening,mt=Se.frame;if(!mt)return null;var wt=sd({dragStartTime:tt,container:mt.pageMarginBox,subject:Be,center:je,shouldUseTimeDampening:qe});return wt&&ah(Se,wt)?wt:null},lh=function(ve){var Se=ve.state,Be=ve.dragStartTime,je=ve.shouldUseTimeDampening,tt=ve.scrollWindow,qe=ve.scrollDroppable,mt=Se.current.page.borderBoxCenter,wt=Se.dimensions.draggables[Se.critical.draggable.id],Jt=wt.page.marginBox;if(Se.isWindowScrollAllowed){var mn=Se.viewport,sn=sh({dragStartTime:Be,viewport:mn,subject:Jt,center:mt,shouldUseTimeDampening:je});if(sn){tt(sn);return}}var rn=vc({center:mt,destination:To(Se.impact),droppables:Se.dimensions.droppables});if(rn){var nn=df({dragStartTime:Be,droppable:rn,subject:Jt,center:mt,shouldUseTimeDampening:je});nn&&qe(rn.descriptor.id,nn)}},cf=function(ve){var Se=ve.scrollWindow,Be=ve.scrollDroppable,je=Mt(Se),tt=Mt(Be),qe=null,mt=function(sn){qe||Xt(!1);var rn=qe,nn=rn.shouldUseTimeDampening,Ln=rn.dragStartTime;lh({state:sn,scrollWindow:je,scrollDroppable:tt,dragStartTime:Ln,shouldUseTimeDampening:nn})},wt=function(sn){Ui(),qe&&Xt(!1);var rn=Date.now(),nn=!1,Ln=function(){nn=!0};lh({state:sn,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:Ln,scrollDroppable:Ln}),qe={dragStartTime:rn,shouldUseTimeDampening:nn},Un(),nn&&mt(sn)},Jt=function(){qe&&(je.cancel(),tt.cancel(),qe=null)};return{start:wt,stop:Jt,scroll:mt}},ff=function(ve){var Se=ve.move,Be=ve.scrollDroppable,je=ve.scrollWindow,tt=function(mn,sn){var rn=So(mn.current.client.selection,sn);Se({client:rn})},qe=function(mn,sn){if(!ah(mn,sn))return sn;var rn=kl(mn,sn);if(!rn)return Be(mn.descriptor.id,sn),null;var nn=yn(sn,rn);Be(mn.descriptor.id,nn);var Ln=yn(sn,nn);return Ln},mt=function(mn,sn,rn){if(!mn||!ud(sn,rn))return rn;var nn=Od(sn,rn);if(!nn)return je(rn),null;var Ln=yn(rn,nn);je(Ln);var Li=yn(rn,Ln);return Li},wt=function(mn){var sn=mn.scrollJumpRequest;if(sn){var rn=To(mn.impact);rn||Xt(!1);var nn=qe(mn.dimensions.droppables[rn],sn);if(nn){var Ln=mn.viewport,Li=mt(mn.isWindowScrollAllowed,Ln,nn);Li&&tt(mn,Li)}}};return wt},Hg=function(ve){var Se=ve.scrollDroppable,Be=ve.scrollWindow,je=ve.move,tt=cf({scrollWindow:Be,scrollDroppable:Se}),qe=ff({move:je,scrollWindow:Be,scrollDroppable:Se}),mt=function(mn){if(mn.phase==="DRAGGING"){if(mn.movementMode==="FLUID"){tt.scroll(mn);return}mn.scrollJumpRequest&&qe(mn)}},wt={scroll:mt,start:tt.start,stop:tt.stop};return wt},Eu="data-rbd",_u=function(){var ve=Eu+"-drag-handle";return{base:ve,draggableId:ve+"-draggable-id",contextId:ve+"-context-id"}}(),gf=function(){var ve=Eu+"-draggable";return{base:ve,contextId:ve+"-context-id",id:ve+"-id"}}(),pf=function(){var ve=Eu+"-droppable";return{base:ve,contextId:ve+"-context-id",id:ve+"-id"}}(),cl={contextId:Eu+"-scroll-container-context-id"},hd=function(Se){return function(Be){return"["+Be+'="'+Se+'"]'}},dd=function(Se,Be){return Se.map(function(je){var tt=je.styles[Be];return tt?je.selector+" { "+tt+" }":""}).join(" ")},wc="pointer-events: none;",Pc=function(ve){var Se=hd(ve),Be=function(){var wt=`
|
|
cursor: -webkit-grab;
|
|
cursor: grab;
|
|
`;return{selector:Se(_u.contextId),styles:{always:`
|
|
-webkit-touch-callout: none;
|
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
touch-action: manipulation;
|
|
`,resting:wt,dragging:wc,dropAnimating:wt}}}(),je=function(){var wt=`
|
|
transition: `+pa.outOfTheWay+`;
|
|
`;return{selector:Se(gf.contextId),styles:{dragging:wt,dropAnimating:wt,userCancel:wt}}}(),tt={selector:Se(pf.contextId),styles:{always:"overflow-anchor: none;"}},qe={selector:"body",styles:{dragging:`
|
|
cursor: grabbing;
|
|
cursor: -webkit-grabbing;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
overflow-anchor: none;
|
|
`}},mt=[je,Be,tt,qe];return{always:dd(mt,"always"),resting:dd(mt,"resting"),dragging:dd(mt,"dragging"),dropAnimating:dd(mt,"dropAnimating"),userCancel:dd(mt,"userCancel")}},il=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?le.useLayoutEffect:le.useEffect,cd=function(){var Se=document.querySelector("head");return Se||Xt(!1),Se},mf=function(Se){var Be=document.createElement("style");return Se&&Be.setAttribute("nonce",Se),Be.type="text/css",Be};function Zs(ve,Se){var Be=cn(function(){return Pc(ve)},[ve]),je=(0,le.useRef)(null),tt=(0,le.useRef)(null),qe=Yt($i(function(rn){var nn=tt.current;nn||Xt(!1),nn.textContent=rn}),[]),mt=Yt(function(rn){var nn=je.current;nn||Xt(!1),nn.textContent=rn},[]);il(function(){!je.current&&!tt.current||Xt(!1);var rn=mf(Se),nn=mf(Se);return je.current=rn,tt.current=nn,rn.setAttribute(Eu+"-always",ve),nn.setAttribute(Eu+"-dynamic",ve),cd().appendChild(rn),cd().appendChild(nn),mt(Be.always),qe(Be.resting),function(){var Ln=function(Or){var Vr=Or.current;Vr||Xt(!1),cd().removeChild(Vr),Or.current=null};Ln(je),Ln(tt)}},[Se,mt,qe,Be.always,Be.resting,ve]);var wt=Yt(function(){return qe(Be.dragging)},[qe,Be.dragging]),Jt=Yt(function(rn){if(rn==="DROP"){qe(Be.dropAnimating);return}qe(Be.userCancel)},[qe,Be.dropAnimating,Be.userCancel]),mn=Yt(function(){tt.current&&qe(Be.resting)},[qe,Be.resting]),sn=cn(function(){return{dragging:wt,dropping:Jt,resting:mn}},[wt,Jt,mn]);return sn}var Rd=function(ve){return ve&&ve.ownerDocument?ve.ownerDocument.defaultView:window};function Ou(ve){return ve instanceof Rd(ve).HTMLElement}function Rh(ve,Se){var Be="["+_u.contextId+'="'+ve+'"]',je=Vt(document.querySelectorAll(Be));if(!je.length)return null;var tt=Jo(je,function(qe){return qe.getAttribute(_u.draggableId)===Se});return!tt||!Ou(tt)?null:tt}function Ec(ve){var Se=(0,le.useRef)({}),Be=(0,le.useRef)(null),je=(0,le.useRef)(null),tt=(0,le.useRef)(!1),qe=Yt(function(nn,Ln){var Li={id:nn,focus:Ln};return Se.current[nn]=Li,function(){var Vr=Se.current,ao=Vr[nn];ao!==Li&&delete Vr[nn]}},[]),mt=Yt(function(nn){var Ln=Rh(ve,nn);Ln&&Ln!==document.activeElement&&Ln.focus()},[ve]),wt=Yt(function(nn,Ln){Be.current===nn&&(Be.current=Ln)},[]),Jt=Yt(function(){je.current||tt.current&&(je.current=requestAnimationFrame(function(){je.current=null;var nn=Be.current;nn&&mt(nn)}))},[mt]),mn=Yt(function(nn){Be.current=null;var Ln=document.activeElement;Ln&&Ln.getAttribute(_u.draggableId)===nn&&(Be.current=nn)},[]);il(function(){return tt.current=!0,function(){tt.current=!1;var nn=je.current;nn&&cancelAnimationFrame(nn)}},[]);var sn=cn(function(){return{register:qe,tryRecordFocus:mn,tryRestoreFocusRecorded:Jt,tryShiftRecord:wt}},[qe,mn,Jt,wt]);return sn}function Yf(){var ve={draggables:{},droppables:{}},Se=[];function Be(rn){return Se.push(rn),function(){var Ln=Se.indexOf(rn);Ln!==-1&&Se.splice(Ln,1)}}function je(rn){Se.length&&Se.forEach(function(nn){return nn(rn)})}function tt(rn){return ve.draggables[rn]||null}function qe(rn){var nn=tt(rn);return nn||Xt(!1),nn}var mt={register:function(nn){ve.draggables[nn.descriptor.id]=nn,je({type:"ADDITION",value:nn})},update:function(nn,Ln){var Li=ve.draggables[Ln.descriptor.id];Li&&Li.uniqueId===nn.uniqueId&&(delete ve.draggables[Ln.descriptor.id],ve.draggables[nn.descriptor.id]=nn)},unregister:function(nn){var Ln=nn.descriptor.id,Li=tt(Ln);Li&&nn.uniqueId===Li.uniqueId&&(delete ve.draggables[Ln],je({type:"REMOVAL",value:nn}))},getById:qe,findById:tt,exists:function(nn){return!!tt(nn)},getAllByType:function(nn){return Do(ve.draggables).filter(function(Ln){return Ln.descriptor.type===nn})}};function wt(rn){return ve.droppables[rn]||null}function Jt(rn){var nn=wt(rn);return nn||Xt(!1),nn}var mn={register:function(nn){ve.droppables[nn.descriptor.id]=nn},unregister:function(nn){var Ln=wt(nn.descriptor.id);Ln&&nn.uniqueId===Ln.uniqueId&&delete ve.droppables[nn.descriptor.id]},getById:Jt,findById:wt,exists:function(nn){return!!wt(nn)},getAllByType:function(nn){return Do(ve.droppables).filter(function(Ln){return Ln.descriptor.type===nn})}};function sn(){ve.draggables={},ve.droppables={},Se.length=0}return{draggable:mt,droppable:mn,subscribe:Be,clean:sn}}function jd(){var ve=cn(Yf,[]);return(0,le.useEffect)(function(){return function(){requestAnimationFrame(ve.clean)}},[ve]),ve}var vf=le.createContext(null),Ku=function(){var ve=document.body;return ve||Xt(!1),ve},Cu={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Vg=function(Se){return"rbd-announcement-"+Se};function Xf(ve){var Se=cn(function(){return Vg(ve)},[ve]),Be=(0,le.useRef)(null);(0,le.useEffect)(function(){var qe=document.createElement("div");return Be.current=qe,qe.id=Se,qe.setAttribute("aria-live","assertive"),qe.setAttribute("aria-atomic","true"),(0,St.Z)(qe.style,Cu),Ku().appendChild(qe),function(){setTimeout(function(){var Jt=Ku();Jt.contains(qe)&&Jt.removeChild(qe),qe===Be.current&&(Be.current=null)})}},[Se]);var je=Yt(function(tt){var qe=Be.current;if(qe){qe.textContent=tt;return}},[]);return je}var jh=0,zd={separator:"::"};function Fs(){jh=0}function Uu(ve,Se){return Se===void 0&&(Se=zd),cn(function(){return""+ve+Se.separator+jh++},[Se.separator,ve])}function Kg(ve){var Se=ve.contextId,Be=ve.uniqueId;return"rbd-hidden-text-"+Se+"-"+Be}function yf(ve){var Se=ve.contextId,Be=ve.text,je=Uu("hidden-text",{separator:"-"}),tt=cn(function(){return Kg({contextId:Se,uniqueId:je})},[je,Se]);return(0,le.useEffect)(function(){var mt=document.createElement("div");return mt.id=tt,mt.textContent=Be,mt.style.display="none",Ku().appendChild(mt),function(){var Jt=Ku();Jt.contains(mt)&&Jt.removeChild(mt)}},[tt,Be]),tt}var Cc=le.createContext(null),jt={react:"^16.8.5","react-dom":"^16.8.5"},fd=/(\d+)\.(\d+)\.(\d+)/,Yu=function(Se){var Be=fd.exec(Se);Be==null&&Xt(!1);var je=Number(Be[1]),tt=Number(Be[2]),qe=Number(Be[3]);return{major:je,minor:tt,patch:qe,raw:Se}},Ug=function(Se,Be){return Be.major>Se.major?!0:Be.major<Se.major?!1:Be.minor>Se.minor?!0:Be.minor<Se.minor?!1:Be.patch>=Se.patch},Jf=function(ve,Se){var Be=Yu(ve),je=Yu(Se);Ug(Be,je)},zp=`
|
|
We expect a html5 doctype: <!doctype html>
|
|
This is to ensure consistent browser layout and measurement
|
|
|
|
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
|
|
`,Qf=function(ve){var Se=ve.doctype;Se&&(Se.name.toLowerCase(),Se.publicId)};function Om(ve){}function Us(ve,Se){}function bc(){Us(function(){Jf(jt.react,le.version),Qf(document)},[])}function Fc(ve){var Se=(0,le.useRef)(ve);return(0,le.useEffect)(function(){Se.current=ve}),Se}function Yg(){var ve=null;function Se(){return!!ve}function Be(mt){return mt===ve}function je(mt){ve&&Xt(!1);var wt={abandon:mt};return ve=wt,wt}function tt(){ve||Xt(!1),ve=null}function qe(){ve&&(ve.abandon(),tt())}return{isClaimed:Se,isActive:Be,claim:je,release:tt,tryAbandon:qe}}var Xg=9,Jg=13,xf=27,Sf=32,cu=33,Zd=34,$f=35,uh=36,Lc=37,wf=38,Bc=39,eu=40,Gd,qf=(Gd={},Gd[Jg]=!0,Gd[Xg]=!0,Gd),fu=function(ve){qf[ve.keyCode]&&ve.preventDefault()},Lh=function(){var ve="visibilitychange";if(typeof document=="undefined")return ve;var Se=[ve,"ms"+ve,"webkit"+ve,"moz"+ve,"o"+ve],Be=Jo(Se,function(je){return"on"+je in document});return Be||ve}(),Pf=0,eg=5;function gd(ve,Se){return Math.abs(Se.x-ve.x)>=eg||Math.abs(Se.y-ve.y)>=eg}var Wl={type:"IDLE"};function tg(ve){var Se=ve.cancel,Be=ve.completed,je=ve.getPhase,tt=ve.setPhase;return[{eventName:"mousemove",fn:function(mt){var wt=mt.button,Jt=mt.clientX,mn=mt.clientY;if(wt===Pf){var sn={x:Jt,y:mn},rn=je();if(rn.type==="DRAGGING"){mt.preventDefault(),rn.actions.move(sn);return}rn.type!=="PENDING"&&Xt(!1);var nn=rn.point;if(gd(nn,sn)){mt.preventDefault();var Ln=rn.actions.fluidLift(sn);tt({type:"DRAGGING",actions:Ln})}}}},{eventName:"mouseup",fn:function(mt){var wt=je();if(wt.type!=="DRAGGING"){Se();return}mt.preventDefault(),wt.actions.drop({shouldBlockNextClick:!0}),Be()}},{eventName:"mousedown",fn:function(mt){je().type==="DRAGGING"&&mt.preventDefault(),Se()}},{eventName:"keydown",fn:function(mt){var wt=je();if(wt.type==="PENDING"){Se();return}if(mt.keyCode===xf){mt.preventDefault(),Se();return}fu(mt)}},{eventName:"resize",fn:Se},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){je().type==="PENDING"&&Se()}},{eventName:"webkitmouseforcedown",fn:function(mt){var wt=je();if(wt.type==="IDLE"&&Xt(!1),wt.actions.shouldRespectForcePress()){Se();return}mt.preventDefault()}},{eventName:Lh,fn:Se}]}function Gs(ve){var Se=(0,le.useRef)(Wl),Be=(0,le.useRef)(Ke),je=cn(function(){return{eventName:"mousedown",fn:function(rn){if(!rn.defaultPrevented&&rn.button===Pf&&!(rn.ctrlKey||rn.metaKey||rn.shiftKey||rn.altKey)){var nn=ve.findClosestDraggableId(rn);if(nn){var Ln=ve.tryGetLock(nn,mt,{sourceEvent:rn});if(Ln){rn.preventDefault();var Li={x:rn.clientX,y:rn.clientY};Be.current(),mn(Ln,Li)}}}}}},[ve]),tt=cn(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(rn){if(!rn.defaultPrevented){var nn=ve.findClosestDraggableId(rn);if(nn){var Ln=ve.findOptionsForDraggable(nn);Ln&&(Ln.shouldRespectForcePress||ve.canGetLock(nn)&&rn.preventDefault())}}}}},[ve]),qe=Yt(function(){var rn={passive:!1,capture:!0};Be.current=_n(window,[tt,je],rn)},[tt,je]),mt=Yt(function(){var sn=Se.current;sn.type!=="IDLE"&&(Se.current=Wl,Be.current(),qe())},[qe]),wt=Yt(function(){var sn=Se.current;mt(),sn.type==="DRAGGING"&&sn.actions.cancel({shouldBlockNextClick:!0}),sn.type==="PENDING"&&sn.actions.abort()},[mt]),Jt=Yt(function(){var rn={capture:!0,passive:!1},nn=tg({cancel:wt,completed:mt,getPhase:function(){return Se.current},setPhase:function(Li){Se.current=Li}});Be.current=_n(window,nn,rn)},[wt,mt]),mn=Yt(function(rn,nn){Se.current.type!=="IDLE"&&Xt(!1),Se.current={type:"PENDING",point:nn,actions:rn},Jt()},[Jt]);il(function(){return qe(),function(){Be.current()}},[qe])}var hh;function Ef(){}var zh=(hh={},hh[Zd]=!0,hh[cu]=!0,hh[uh]=!0,hh[$f]=!0,hh);function Wd(ve,Se){function Be(){Se(),ve.cancel()}function je(){Se(),ve.drop()}return[{eventName:"keydown",fn:function(qe){if(qe.keyCode===xf){qe.preventDefault(),Be();return}if(qe.keyCode===Sf){qe.preventDefault(),je();return}if(qe.keyCode===eu){qe.preventDefault(),ve.moveDown();return}if(qe.keyCode===wf){qe.preventDefault(),ve.moveUp();return}if(qe.keyCode===Bc){qe.preventDefault(),ve.moveRight();return}if(qe.keyCode===Lc){qe.preventDefault(),ve.moveLeft();return}if(zh[qe.keyCode]){qe.preventDefault();return}fu(qe)}},{eventName:"mousedown",fn:Be},{eventName:"mouseup",fn:Be},{eventName:"click",fn:Be},{eventName:"touchstart",fn:Be},{eventName:"resize",fn:Be},{eventName:"wheel",fn:Be,options:{passive:!0}},{eventName:Lh,fn:Be}]}function Hd(ve){var Se=(0,le.useRef)(Ef),Be=cn(function(){return{eventName:"keydown",fn:function(qe){if(qe.defaultPrevented||qe.keyCode!==Sf)return;var mt=ve.findClosestDraggableId(qe);if(!mt)return;var wt=ve.tryGetLock(mt,sn,{sourceEvent:qe});if(!wt)return;qe.preventDefault();var Jt=!0,mn=wt.snapLift();Se.current();function sn(){Jt||Xt(!1),Jt=!1,Se.current(),je()}Se.current=_n(window,Wd(mn,sn),{capture:!0,passive:!1})}}},[ve]),je=Yt(function(){var qe={passive:!1,capture:!0};Se.current=_n(window,[Be],qe)},[Be]);il(function(){return je(),function(){Se.current()}},[je])}var Mc={type:"IDLE"},Vd=120,ng=.15;function dh(ve){var Se=ve.cancel,Be=ve.getPhase;return[{eventName:"orientationchange",fn:Se},{eventName:"resize",fn:Se},{eventName:"contextmenu",fn:function(tt){tt.preventDefault()}},{eventName:"keydown",fn:function(tt){if(Be().type!=="DRAGGING"){Se();return}tt.keyCode===xf&&tt.preventDefault(),Se()}},{eventName:Lh,fn:Se}]}function pd(ve){var Se=ve.cancel,Be=ve.completed,je=ve.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(qe){var mt=je();if(mt.type!=="DRAGGING"){Se();return}mt.hasMoved=!0;var wt=qe.touches[0],Jt=wt.clientX,mn=wt.clientY,sn={x:Jt,y:mn};qe.preventDefault(),mt.actions.move(sn)}},{eventName:"touchend",fn:function(qe){var mt=je();if(mt.type!=="DRAGGING"){Se();return}qe.preventDefault(),mt.actions.drop({shouldBlockNextClick:!0}),Be()}},{eventName:"touchcancel",fn:function(qe){if(je().type!=="DRAGGING"){Se();return}qe.preventDefault(),Se()}},{eventName:"touchforcechange",fn:function(qe){var mt=je();mt.type==="IDLE"&&Xt(!1);var wt=qe.touches[0];if(wt){var Jt=wt.force>=ng;if(Jt){var mn=mt.actions.shouldRespectForcePress();if(mt.type==="PENDING"){mn&&Se();return}if(mn){if(mt.hasMoved){qe.preventDefault();return}Se();return}qe.preventDefault()}}}},{eventName:Lh,fn:Se}]}function Cf(ve){var Se=(0,le.useRef)(Mc),Be=(0,le.useRef)(Ke),je=Yt(function(){return Se.current},[]),tt=Yt(function(Ln){Se.current=Ln},[]),qe=cn(function(){return{eventName:"touchstart",fn:function(Ln){if(!Ln.defaultPrevented){var Li=ve.findClosestDraggableId(Ln);if(Li){var Or=ve.tryGetLock(Li,wt,{sourceEvent:Ln});if(Or){var Vr=Ln.touches[0],ao=Vr.clientX,Co=Vr.clientY,Go={x:ao,y:Co};Be.current(),rn(Or,Go)}}}}}},[ve]),mt=Yt(function(){var Ln={capture:!0,passive:!1};Be.current=_n(window,[qe],Ln)},[qe]),wt=Yt(function(){var nn=Se.current;nn.type!=="IDLE"&&(nn.type==="PENDING"&&clearTimeout(nn.longPressTimerId),tt(Mc),Be.current(),mt())},[mt,tt]),Jt=Yt(function(){var nn=Se.current;wt(),nn.type==="DRAGGING"&&nn.actions.cancel({shouldBlockNextClick:!0}),nn.type==="PENDING"&&nn.actions.abort()},[wt]),mn=Yt(function(){var Ln={capture:!0,passive:!1},Li={cancel:Jt,completed:wt,getPhase:je},Or=_n(window,pd(Li),Ln),Vr=_n(window,dh(Li),Ln);Be.current=function(){Or(),Vr()}},[Jt,je,wt]),sn=Yt(function(){var Ln=je();Ln.type!=="PENDING"&&Xt(!1);var Li=Ln.actions.fluidLift(Ln.point);tt({type:"DRAGGING",actions:Li,hasMoved:!1})},[je,tt]),rn=Yt(function(Ln,Li){je().type!=="IDLE"&&Xt(!1);var Or=setTimeout(sn,Vd);tt({type:"PENDING",point:Li,actions:Ln,longPressTimerId:Or}),mn()},[mn,je,tt,sn]);il(function(){return mt(),function(){Be.current();var Li=je();Li.type==="PENDING"&&(clearTimeout(Li.longPressTimerId),tt(Mc))}},[je,mt,tt]),il(function(){var Ln=_n(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return Ln},[])}function bf(ve){}var Ff={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Zh(ve,Se){if(Se==null)return!1;var Be=!!Ff[Se.tagName.toLowerCase()];if(Be)return!0;var je=Se.getAttribute("contenteditable");return je==="true"||je===""?!0:Se===ve?!1:Zh(ve,Se.parentElement)}function ig(ve,Se){var Be=Se.target;return Ou(Be)?Zh(ve,Be):!1}var rg=function(ve){return Di(ve.getBoundingClientRect()).center};function og(ve){return ve instanceof Rd(ve).Element}var Xu=function(){var ve="matches";if(typeof document=="undefined")return ve;var Se=[ve,"msMatchesSelector","webkitMatchesSelector"],Be=Jo(Se,function(je){return je in Element.prototype});return Be||ve}();function ag(ve,Se){return ve==null?null:ve[Xu](Se)?ve:ag(ve.parentElement,Se)}function sg(ve,Se){return ve.closest?ve.closest(Se):ag(ve,Se)}function Kd(ve){return"["+_u.contextId+'="'+ve+'"]'}function md(ve,Se){var Be=Se.target;if(!og(Be))return null;var je=Kd(ve),tt=sg(Be,je);return!tt||!Ou(tt)?null:tt}function lg(ve,Se){var Be=md(ve,Se);return Be?Be.getAttribute(_u.draggableId):null}function Ju(ve,Se){var Be="["+gf.contextId+'="'+ve+'"]',je=Vt(document.querySelectorAll(Be)),tt=Jo(je,function(qe){return qe.getAttribute(gf.id)===Se});return!tt||!Ou(tt)?null:tt}function ug(ve){ve.preventDefault()}function vd(ve){var Se=ve.expected,Be=ve.phase,je=ve.isLockActive,tt=ve.shouldWarn;return!(!je()||Se!==Be)}function hg(ve){var Se=ve.lockAPI,Be=ve.store,je=ve.registry,tt=ve.draggableId;if(Se.isClaimed())return!1;var qe=je.draggable.findById(tt);return!(!qe||!qe.options.isEnabled||!wu(Be.getState(),tt))}function dg(ve){var Se=ve.lockAPI,Be=ve.contextId,je=ve.store,tt=ve.registry,qe=ve.draggableId,mt=ve.forceSensorStop,wt=ve.sourceEvent,Jt=hg({lockAPI:Se,store:je,registry:tt,draggableId:qe});if(!Jt)return null;var mn=tt.draggable.getById(qe),sn=Ju(Be,mn.descriptor.id);if(!sn||wt&&!mn.options.canDragInteractiveElements&&ig(sn,wt))return null;var rn=Se.claim(mt||Ke),nn="PRE_DRAG";function Ln(){return mn.options.shouldRespectForcePress}function Li(){return Se.isActive(rn)}function Or(Za,ns){vd({expected:Za,phase:nn,isLockActive:Li,shouldWarn:!0})&&je.dispatch(ns())}var Vr=Or.bind(null,"DRAGGING");function ao(Za){function ns(){Se.release(),nn="COMPLETED"}nn!=="PRE_DRAG"&&(ns(),nn!=="PRE_DRAG"&&Xt(!1)),je.dispatch(Nr(Za.liftActionArgs)),nn="DRAGGING";function el($a,Ys){if(Ys===void 0&&(Ys={shouldBlockNextClick:!1}),Za.cleanup(),Ys.shouldBlockNextClick){var Nl=_n(window,[{eventName:"click",fn:ug,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(Nl)}ns(),je.dispatch(rs({reason:$a}))}return(0,St.Z)({isActive:function(){return vd({expected:"DRAGGING",phase:nn,isLockActive:Li,shouldWarn:!1})},shouldRespectForcePress:Ln,drop:function(Ys){return el("DROP",Ys)},cancel:function(Ys){return el("CANCEL",Ys)}},Za.actions)}function Co(Za){var ns=Mt(function($a){Vr(function(){return Zo({client:$a})})}),el=ao({liftActionArgs:{id:qe,clientSelection:Za,movementMode:"FLUID"},cleanup:function(){return ns.cancel()},actions:{move:ns}});return(0,St.Z)({},el,{move:ns})}function Go(){var Za={moveUp:function(){return Vr(zr)},moveRight:function(){return Vr(eo)},moveDown:function(){return Vr(bs)},moveLeft:function(){return Vr(ka)}};return ao({liftActionArgs:{id:qe,clientSelection:rg(sn),movementMode:"SNAP"},cleanup:Ke,actions:Za})}function jo(){var Za=vd({expected:"PRE_DRAG",phase:nn,isLockActive:Li,shouldWarn:!0});Za&&Se.release()}var da={isActive:function(){return vd({expected:"PRE_DRAG",phase:nn,isLockActive:Li,shouldWarn:!1})},shouldRespectForcePress:Ln,fluidLift:Co,snapLift:Go,abort:jo};return da}var cg=[Gs,Hd,Cf];function Zp(ve){var Se=ve.contextId,Be=ve.store,je=ve.registry,tt=ve.customSensors,qe=ve.enableDefaultSensors,mt=[].concat(qe?cg:[],tt||[]),wt=(0,le.useState)(function(){return Yg()})[0],Jt=Yt(function(Co,Go){Co.isDragging&&!Go.isDragging&&wt.tryAbandon()},[wt]);il(function(){var Co=Be.getState(),Go=Be.subscribe(function(){var jo=Be.getState();Jt(Co,jo),Co=jo});return Go},[wt,Be,Jt]),il(function(){return wt.tryAbandon},[wt.tryAbandon]);var mn=Yt(function(ao){return hg({lockAPI:wt,registry:je,store:Be,draggableId:ao})},[wt,je,Be]),sn=Yt(function(ao,Co,Go){return dg({lockAPI:wt,registry:je,contextId:Se,store:Be,draggableId:ao,forceSensorStop:Co,sourceEvent:Go&&Go.sourceEvent?Go.sourceEvent:null})},[Se,wt,je,Be]),rn=Yt(function(ao){return lg(Se,ao)},[Se]),nn=Yt(function(ao){var Co=je.draggable.findById(ao);return Co?Co.options:null},[je.draggable]),Ln=Yt(function(){wt.isClaimed()&&(wt.tryAbandon(),Be.getState().phase!=="IDLE"&&Be.dispatch(wo()))},[wt,Be]),Li=Yt(wt.isClaimed,[wt]),Or=cn(function(){return{canGetLock:mn,tryGetLock:sn,findClosestDraggableId:rn,findOptionsForDraggable:nn,tryReleaseLock:Ln,isLockClaimed:Li}},[mn,sn,rn,nn,Ln,Li]);bf(mt);for(var Vr=0;Vr<mt.length;Vr++)mt[Vr](Or)}var Qg=function(Se){return{onBeforeCapture:Se.onBeforeCapture,onBeforeDragStart:Se.onBeforeDragStart,onDragStart:Se.onDragStart,onDragEnd:Se.onDragEnd,onDragUpdate:Se.onDragUpdate}};function Gh(ve){return ve.current||Xt(!1),ve.current}function Lf(ve){var Se=ve.contextId,Be=ve.setCallbacks,je=ve.sensors,tt=ve.nonce,qe=ve.dragHandleUsageInstructions,mt=(0,le.useRef)(null);bc();var wt=Fc(ve),Jt=Yt(function(){return Qg(wt.current)},[wt]),mn=Xf(Se),sn=yf({contextId:Se,text:qe}),rn=Zs(Se,tt),nn=Yt(function($a){Gh(mt).dispatch($a)},[]),Ln=cn(function(){return(0,yt.DE)({publishWhileDragging:yr,updateDroppableScroll:tr,updateDroppableIsEnabled:Ir,updateDroppableIsCombineEnabled:uo,collectionStarting:Qr},nn)},[nn]),Li=jd(),Or=cn(function(){return us(Li,Ln)},[Li,Ln]),Vr=cn(function(){return Hg((0,St.Z)({scrollWindow:Fh,scrollDroppable:Or.scrollDroppable},(0,yt.DE)({move:Zo},nn)))},[Or.scrollDroppable,nn]),ao=Ec(Se),Co=cn(function(){return Ml({announce:mn,autoScroller:Vr,dimensionMarshal:Or,focusMarshal:ao,getResponders:Jt,styleMarshal:rn})},[mn,Vr,Or,ao,Jt,rn]);mt.current=Co;var Go=Yt(function(){var $a=Gh(mt),Ys=$a.getState();Ys.phase!=="IDLE"&&$a.dispatch(wo())},[]),jo=Yt(function(){var $a=Gh(mt).getState();return $a.isDragging||$a.phase==="DROP_ANIMATING"},[]),da=cn(function(){return{isDragging:jo,tryAbort:Go}},[jo,Go]);Be(da);var Za=Yt(function($a){return wu(Gh(mt).getState(),$a)},[]),ns=Yt(function(){return mo(Gh(mt).getState())},[]),el=cn(function(){return{marshal:Or,focus:ao,contextId:Se,canLift:Za,isMovementAllowed:ns,dragHandleUsageInstructionsId:sn,registry:Li}},[Se,Or,sn,ao,Za,ns,Li]);return Zp({contextId:Se,store:Co,registry:Li,customSensors:je,enableDefaultSensors:ve.enableDefaultSensors!==!1}),(0,le.useEffect)(function(){return Go},[Go]),le.createElement(Cc.Provider,{value:el},le.createElement(de,{context:vf,store:Co},ve.children))}var kc=0;function $g(){kc=0}function Bf(){return cn(function(){return""+kc++},[])}function yd(){$g(),Fs()}function fg(ve){var Se=Bf(),Be=ve.dragHandleUsageInstructions||ro.dragHandleUsageInstructions;return le.createElement(ri,null,function(je){return le.createElement(Lf,{nonce:ve.nonce,contextId:Se,setCallbacks:je,dragHandleUsageInstructions:Be,enableDefaultSensors:ve.enableDefaultSensors,sensors:ve.sensors,onBeforeCapture:ve.onBeforeCapture,onBeforeDragStart:ve.onBeforeDragStart,onDragStart:ve.onDragStart,onDragUpdate:ve.onDragUpdate,onDragEnd:ve.onDragEnd},ve.children)})}var xd=function(Se){return function(Be){return Se===Be}},qg=xd("scroll"),Mf=xd("auto"),ep=xd("visible"),Ja=function(Se,Be){return Be(Se.overflowX)||Be(Se.overflowY)},Ud=function(Se,Be){return Be(Se.overflowX)&&Be(Se.overflowY)},Wh=function(Se){var Be=window.getComputedStyle(Se),je={overflowX:Be.overflowX,overflowY:Be.overflowY};return Ja(je,qg)||Ja(je,Mf)},rl=function(){return!1;var Se,Be,je,tt},Al=function ve(Se){return Se==null?null:Se===document.body?rl()?Se:null:Se===document.documentElement?null:Wh(Se)?Se:ve(Se.parentElement)},Yd=function(ve){if(ve)var Se=Al(ve.parentElement)},Sd=function(ve){return{x:ve.scrollLeft,y:ve.scrollTop}},gg=function ve(Se){if(!Se)return!1;var Be=window.getComputedStyle(Se);return Be.position==="fixed"?!0:ve(Se.parentElement)},pg=function(ve){var Se=Al(ve),Be=gg(ve);return{closestScrollable:Se,isFixedOnPage:Be}},mg=function(ve){var Se=ve.descriptor,Be=ve.isEnabled,je=ve.isCombineEnabled,tt=ve.isFixedOnPage,qe=ve.direction,mt=ve.client,wt=ve.page,Jt=ve.closest,mn=function(){if(!Jt)return null;var Ln=Jt.scrollSize,Li=Jt.client,Or=Gl({scrollHeight:Ln.scrollHeight,scrollWidth:Ln.scrollWidth,height:Li.paddingBox.height,width:Li.paddingBox.width});return{pageMarginBox:Jt.page.marginBox,frameClient:Li,scrollSize:Ln,shouldClipSubject:Jt.shouldClipSubject,scroll:{initial:Jt.scroll,current:Jt.scroll,max:Or,diff:{value:Gr,displacement:Gr}}}}(),sn=qe==="vertical"?Pn:hr,rn=Bo({page:wt,withPlaceholder:null,axis:sn,frame:mn}),nn={descriptor:Se,isCombineEnabled:je,isFixedOnPage:tt,axis:sn,isEnabled:Be,client:mt,page:wt,frame:mn,subject:rn};return nn},vg=function(Se,Be){var je=li(Se);if(!Be||Se!==Be)return je;var tt=je.paddingBox.top-Be.scrollTop,qe=je.paddingBox.left-Be.scrollLeft,mt=tt+Be.scrollHeight,wt=qe+Be.scrollWidth,Jt={top:tt,right:wt,bottom:mt,left:qe},mn=Mr(Jt,je.border),sn=Ni({borderBox:mn,margin:je.margin,border:je.border,padding:je.padding});return sn},yg=function(ve){var Se=ve.ref,Be=ve.descriptor,je=ve.env,tt=ve.windowScroll,qe=ve.direction,mt=ve.isDropDisabled,wt=ve.isCombineEnabled,Jt=ve.shouldClipSubject,mn=je.closestScrollable,sn=vg(Se,mn),rn=be(sn,tt),nn=function(){if(!mn)return null;var Li=li(mn),Or={scrollHeight:mn.scrollHeight,scrollWidth:mn.scrollWidth};return{client:Li,page:be(Li,tt),scroll:Sd(mn),scrollSize:Or,shouldClipSubject:Jt}}(),Ln=mg({descriptor:Be,isEnabled:!mt,isCombineEnabled:wt,isFixedOnPage:je.isFixedOnPage,direction:qe,client:sn,page:rn,closest:nn});return Ln},Hh={passive:!1},Ac={passive:!0},Bh=function(ve){return ve.shouldPublishImmediately?Hh:Ac};function os(ve){var Se=(0,le.useContext)(ve);return Se||Xt(!1),Se}var wd=function(Se){return Se&&Se.env.closestScrollable||null};function xg(ve){var Se=(0,le.useRef)(null),Be=os(Cc),je=Uu("droppable"),tt=Be.registry,qe=Be.marshal,mt=Fc(ve),wt=cn(function(){return{id:ve.droppableId,type:ve.type,mode:ve.mode}},[ve.droppableId,ve.mode,ve.type]),Jt=(0,le.useRef)(wt),mn=cn(function(){return $i(function(jo,da){Se.current||Xt(!1);var Za={x:jo,y:da};qe.updateDroppableScroll(wt.id,Za)})},[wt.id,qe]),sn=Yt(function(){var jo=Se.current;return!jo||!jo.env.closestScrollable?Gr:Sd(jo.env.closestScrollable)},[]),rn=Yt(function(){var jo=sn();mn(jo.x,jo.y)},[sn,mn]),nn=cn(function(){return Mt(rn)},[rn]),Ln=Yt(function(){var jo=Se.current,da=wd(jo);jo&&da||Xt(!1);var Za=jo.scrollOptions;if(Za.shouldPublishImmediately){rn();return}nn()},[nn,rn]),Li=Yt(function(jo,da){Se.current&&Xt(!1);var Za=mt.current,ns=Za.getDroppableRef();ns||Xt(!1);var el=pg(ns),$a={ref:ns,descriptor:wt,env:el,scrollOptions:da};Se.current=$a;var Ys=yg({ref:ns,descriptor:wt,env:el,windowScroll:jo,direction:Za.direction,isDropDisabled:Za.isDropDisabled,isCombineEnabled:Za.isCombineEnabled,shouldClipSubject:!Za.ignoreContainerClipping}),Nl=el.closestScrollable;return Nl&&(Nl.setAttribute(cl.contextId,Be.contextId),Nl.addEventListener("scroll",Ln,Bh($a.scrollOptions))),Ys},[Be.contextId,wt,Ln,mt]),Or=Yt(function(){var jo=Se.current,da=wd(jo);return jo&&da||Xt(!1),Sd(da)},[]),Vr=Yt(function(){var jo=Se.current;jo||Xt(!1);var da=wd(jo);Se.current=null,da&&(nn.cancel(),da.removeAttribute(cl.contextId),da.removeEventListener("scroll",Ln,Bh(jo.scrollOptions)))},[Ln,nn]),ao=Yt(function(jo){var da=Se.current;da||Xt(!1);var Za=wd(da);Za||Xt(!1),Za.scrollTop+=jo.y,Za.scrollLeft+=jo.x},[]),Co=cn(function(){return{getDimensionAndWatchScroll:Li,getScrollWhileDragging:Or,dragStopped:Vr,scroll:ao}},[Vr,Li,Or,ao]),Go=cn(function(){return{uniqueId:je,descriptor:wt,callbacks:Co}},[Co,wt,je]);il(function(){return Jt.current=Go.descriptor,tt.droppable.register(Go),function(){Se.current&&Vr(),tt.droppable.unregister(Go)}},[Co,wt,Vr,Go,qe,tt.droppable]),il(function(){Se.current&&qe.updateDroppableIsEnabled(Jt.current.id,!ve.isDropDisabled)},[ve.isDropDisabled,qe]),il(function(){Se.current&&qe.updateDroppableIsCombineEnabled(Jt.current.id,ve.isCombineEnabled)},[ve.isCombineEnabled,qe])}function Vh(){}var Pd={width:0,height:0,margin:Nn},Nc=function(Se){var Be=Se.isAnimatingOpenOnMount,je=Se.placeholder,tt=Se.animate;return Be||tt==="close"?Pd:{height:je.client.borderBox.height,width:je.client.borderBox.width,margin:je.client.margin}},tp=function(Se){var Be=Se.isAnimatingOpenOnMount,je=Se.placeholder,tt=Se.animate,qe=Nc({isAnimatingOpenOnMount:Be,placeholder:je,animate:tt});return{display:je.display,boxSizing:"border-box",width:qe.width,height:qe.height,marginTop:qe.margin.top,marginRight:qe.margin.right,marginBottom:qe.margin.bottom,marginLeft:qe.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:tt!=="none"?pa.placeholder:null}};function Qs(ve){var Se=(0,le.useRef)(null),Be=Yt(function(){Se.current&&(clearTimeout(Se.current),Se.current=null)},[]),je=ve.animate,tt=ve.onTransitionEnd,qe=ve.onClose,mt=ve.contextId,wt=(0,le.useState)(ve.animate==="open"),Jt=wt[0],mn=wt[1];(0,le.useEffect)(function(){return Jt?je!=="open"?(Be(),mn(!1),Vh):Se.current?Vh:(Se.current=setTimeout(function(){Se.current=null,mn(!1)}),Be):Vh},[je,Jt,Be]);var sn=Yt(function(nn){nn.propertyName==="height"&&(tt(),je==="close"&&qe())},[je,qe,tt]),rn=tp({isAnimatingOpenOnMount:Jt,animate:ve.animate,placeholder:ve.placeholder});return le.createElement(ve.placeholder.tagName,{style:rn,"data-rbd-placeholder-context-id":mt,onTransitionEnd:sn,ref:ve.innerRef})}var np=le.memo(Qs),Kh=le.createContext(null);function ch(ve){ve&&Ou(ve)||Xt(!1)}function Ed(ve){return typeof ve=="boolean"}function ie(ve,Se){Se.forEach(function(Be){return Be(ve)})}var ae=[function(Se){var Be=Se.props;Be.droppableId||Xt(!1),typeof Be.droppableId!="string"&&Xt(!1)},function(Se){var Be=Se.props;Ed(Be.isDropDisabled)||Xt(!1),Ed(Be.isCombineEnabled)||Xt(!1),Ed(Be.ignoreContainerClipping)||Xt(!1)},function(Se){var Be=Se.getDroppableRef;ch(Be())}],fe=[function(Se){var Be=Se.props,je=Se.getPlaceholderRef;if(Be.placeholder)var tt=je()}],ce=[function(Se){var Be=Se.props;Be.renderClone||Xt(!1)},function(Se){var Be=Se.getPlaceholderRef;Be()&&Xt(!1)}];function me(ve){Us(function(){ie(ve,ae),ve.props.mode==="standard"&&ie(ve,fe),ve.props.mode==="virtual"&&ie(ve,ce)})}var ke=function(ve){pt(Se,ve);function Se(){for(var je,tt=arguments.length,qe=new Array(tt),mt=0;mt<tt;mt++)qe[mt]=arguments[mt];return je=ve.call.apply(ve,[this].concat(qe))||this,je.state={isVisible:!!je.props.on,data:je.props.on,animate:je.props.shouldAnimate&&je.props.on?"open":"none"},je.onClose=function(){je.state.animate==="close"&&je.setState({isVisible:!1})},je}Se.getDerivedStateFromProps=function(tt,qe){return tt.shouldAnimate?tt.on?{isVisible:!0,data:tt.on,animate:"open"}:qe.isVisible?{isVisible:!0,data:qe.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!tt.on,data:tt.on,animate:"none"}};var Be=Se.prototype;return Be.render=function(){if(!this.state.isVisible)return null;var tt={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(tt)},Se}(le.PureComponent),Ge={dragging:5e3,dropAnimating:4500},Qe=function(Se,Be){return Be?pa.drop(Be.duration):Se?pa.snap:pa.fluid},Xe=function(Se,Be){return Se?Be?nl.opacity.drop:nl.opacity.combining:null},xt=function(Se){return Se.forceShouldAnimate!=null?Se.forceShouldAnimate:Se.mode==="SNAP"};function an(ve){var Se=ve.dimension,Be=Se.client,je=ve.offset,tt=ve.combineWith,qe=ve.dropping,mt=!!tt,wt=xt(ve),Jt=!!qe,mn=Jt?hs.drop(je,mt):hs.moveTo(je),sn={position:"fixed",top:Be.marginBox.top,left:Be.marginBox.left,boxSizing:"border-box",width:Be.borderBox.width,height:Be.borderBox.height,transition:Qe(wt,qe),transform:mn,opacity:Xe(mt,Jt),zIndex:Jt?Ge.dropAnimating:Ge.dragging,pointerEvents:"none"};return sn}function Ft(ve){return{transform:hs.moveTo(ve.offset),transition:ve.shouldAnimateDisplacement?null:"none"}}function zn(ve){return ve.type==="DRAGGING"?an(ve):Ft(ve)}function Mn(ve,Se,Be){Be===void 0&&(Be=Gr);var je=window.getComputedStyle(Se),tt=Se.getBoundingClientRect(),qe=gn(tt,je),mt=be(qe,Be),wt={client:qe,tagName:Se.tagName.toLowerCase(),display:je.display},Jt={x:qe.marginBox.width,y:qe.marginBox.height},mn={descriptor:ve,placeholder:wt,displaceBy:Jt,client:qe,page:mt};return mn}function qi(ve){var Se=Uu("draggable"),Be=ve.descriptor,je=ve.registry,tt=ve.getDraggableRef,qe=ve.canDragInteractiveElements,mt=ve.shouldRespectForcePress,wt=ve.isEnabled,Jt=cn(function(){return{canDragInteractiveElements:qe,shouldRespectForcePress:mt,isEnabled:wt}},[qe,wt,mt]),mn=Yt(function(Ln){var Li=tt();return Li||Xt(!1),Mn(Be,Li,Ln)},[Be,tt]),sn=cn(function(){return{uniqueId:Se,descriptor:Be,options:Jt,getDimension:mn}},[Be,mn,Jt,Se]),rn=(0,le.useRef)(sn),nn=(0,le.useRef)(!0);il(function(){return je.draggable.register(rn.current),function(){return je.draggable.unregister(rn.current)}},[je.draggable]),il(function(){if(nn.current){nn.current=!1;return}var Ln=rn.current;rn.current=sn,je.draggable.update(sn,Ln)},[sn,je.draggable])}function cr(ve,Se,Be){Us(function(){function je(qe){return"Draggable[id: "+qe+"]: "}var tt=ve.draggableId;tt||Xt(!1),typeof tt!="string"&&Xt(!1),na(ve.index)||Xt(!1),ve.mapped.type!=="DRAGGING"&&(ch(Be()),ve.isEnabled&&(Rh(Se,tt)||Xt(!1)))})}function Br(ve){}function $r(ve){ve.preventDefault()}function No(ve){var Se=(0,le.useRef)(null),Be=Yt(function($a){Se.current=$a},[]),je=Yt(function(){return Se.current},[]),tt=os(Cc),qe=tt.contextId,mt=tt.dragHandleUsageInstructionsId,wt=tt.registry,Jt=os(Kh),mn=Jt.type,sn=Jt.droppableId,rn=cn(function(){return{id:ve.draggableId,index:ve.index,type:mn,droppableId:sn}},[ve.draggableId,ve.index,mn,sn]),nn=ve.children,Ln=ve.draggableId,Li=ve.isEnabled,Or=ve.shouldRespectForcePress,Vr=ve.canDragInteractiveElements,ao=ve.isClone,Co=ve.mapped,Go=ve.dropAnimationFinished;if(cr(ve,qe,je),Br(ao),!ao){var jo=cn(function(){return{descriptor:rn,registry:wt,getDraggableRef:je,canDragInteractiveElements:Vr,shouldRespectForcePress:Or,isEnabled:Li}},[rn,wt,je,Vr,Or,Li]);qi(jo)}var da=cn(function(){return Li?{tabIndex:0,role:"button","aria-describedby":mt,"data-rbd-drag-handle-draggable-id":Ln,"data-rbd-drag-handle-context-id":qe,draggable:!1,onDragStart:$r}:null},[qe,mt,Ln,Li]),Za=Yt(function($a){Co.type==="DRAGGING"&&Co.dropping&&$a.propertyName==="transform"&&Go()},[Go,Co]),ns=cn(function(){var $a=zn(Co),Ys=Co.type==="DRAGGING"&&Co.dropping?Za:null,Nl={innerRef:Be,draggableProps:{"data-rbd-draggable-context-id":qe,"data-rbd-draggable-id":Ln,style:$a,onTransitionEnd:Ys},dragHandleProps:da};return Nl},[qe,da,Ln,Co,Za,Be]),el=cn(function(){return{draggableId:rn.id,type:rn.type,source:{index:rn.index,droppableId:rn.droppableId}}},[rn.droppableId,rn.id,rn.index,rn.type]);return nn(ns,Co.snapshot,el)}var co=function(ve,Se){return ve===Se},zo=function(ve){var Se=ve.combine,Be=ve.destination;return Be?Be.droppableId:Se?Se.droppableId:null},va=function(Se){return Se.combine?Se.combine.draggableId:null},fo=function(Se){return Se.at&&Se.at.type==="COMBINE"?Se.at.combine.draggableId:null};function ja(){var ve=$i(function(tt,qe){return{x:tt,y:qe}}),Se=$i(function(tt,qe,mt,wt,Jt){return{isDragging:!0,isClone:qe,isDropAnimating:!!Jt,dropAnimation:Jt,mode:tt,draggingOver:mt,combineWith:wt,combineTargetFor:null}}),Be=$i(function(tt,qe,mt,wt,Jt,mn,sn){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:Jt,combineWith:mn,mode:qe,offset:tt,dimension:mt,forceShouldAnimate:sn,snapshot:Se(qe,wt,Jt,mn,null)}}}),je=function(qe,mt){if(qe.isDragging){if(qe.critical.draggable.id!==mt.draggableId)return null;var wt=qe.current.client.offset,Jt=qe.dimensions.draggables[mt.draggableId],mn=To(qe.impact),sn=fo(qe.impact),rn=qe.forceShouldAnimate;return Be(ve(wt.x,wt.y),qe.movementMode,Jt,mt.isClone,mn,sn,rn)}if(qe.phase==="DROP_ANIMATING"){var nn=qe.completed;if(nn.result.draggableId!==mt.draggableId)return null;var Ln=mt.isClone,Li=qe.dimensions.draggables[mt.draggableId],Or=nn.result,Vr=Or.mode,ao=zo(Or),Co=va(Or),Go=qe.dropDuration,jo={duration:Go,curve:jl.drop,moveTo:qe.newHomeClientOffset,opacity:Co?nl.opacity.drop:null,scale:Co?nl.scale.drop:null};return{mapped:{type:"DRAGGING",offset:qe.newHomeClientOffset,dimension:Li,dropping:jo,draggingOver:ao,combineWith:Co,mode:Vr,forceShouldAnimate:null,snapshot:Se(Vr,Ln,ao,Co,jo)}}}return null};return je}function ys(ve){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:ve,combineWith:null}}var ol={mapped:{type:"SECONDARY",offset:Gr,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:ys(null)}};function Ls(){var ve=$i(function(mt,wt){return{x:mt,y:wt}}),Se=$i(ys),Be=$i(function(mt,wt,Jt){return wt===void 0&&(wt=null),{mapped:{type:"SECONDARY",offset:mt,combineTargetFor:wt,shouldAnimateDisplacement:Jt,snapshot:Se(wt)}}}),je=function(wt){return wt?Be(Gr,wt,!0):null},tt=function(wt,Jt,mn,sn){var rn=mn.displaced.visible[wt],nn=!!(sn.inVirtualList&&sn.effected[wt]),Ln=Yi(mn),Li=Ln&&Ln.draggableId===wt?Jt:null;if(!rn){if(!nn)return je(Li);if(mn.displaced.invisible[wt])return null;var Or=rr(sn.displacedBy.point),Vr=ve(Or.x,Or.y);return Be(Vr,Li,!0)}if(nn)return je(Li);var ao=mn.displacedBy.point,Co=ve(ao.x,ao.y);return Be(Co,Li,rn.shouldAnimate)},qe=function(wt,Jt){if(wt.isDragging)return wt.critical.draggable.id===Jt.draggableId?null:tt(Jt.draggableId,wt.critical.draggable.id,wt.impact,wt.afterCritical);if(wt.phase==="DROP_ANIMATING"){var mn=wt.completed;return mn.result.draggableId===Jt.draggableId?null:tt(Jt.draggableId,mn.result.draggableId,mn.impact,mn.afterCritical)}return null};return qe}var Hl=function(){var Se=ja(),Be=Ls(),je=function(qe,mt){return Se(qe,mt)||Be(qe,mt)||ol};return je},xl={dropAnimationFinished:su},$s=Kt(Hl,xl,null,{context:vf,pure:!0,areStatePropsEqual:co})(No);function Vl(ve){var Se=os(Kh),Be=Se.isUsingCloneFor;return Be===ve.draggableId&&!ve.isClone?null:le.createElement($s,ve)}function fl(ve){var Se=typeof ve.isDragDisabled=="boolean"?!ve.isDragDisabled:!0,Be=!!ve.disableInteractiveElementBlocking,je=!!ve.shouldRespectForcePress;return le.createElement(Vl,(0,St.Z)({},ve,{isClone:!1,isEnabled:Se,canDragInteractiveElements:Be,shouldRespectForcePress:je}))}function qs(ve){var Se=(0,le.useContext)(Cc);Se||Xt(!1);var Be=Se.contextId,je=Se.isMovementAllowed,tt=(0,le.useRef)(null),qe=(0,le.useRef)(null),mt=ve.children,wt=ve.droppableId,Jt=ve.type,mn=ve.mode,sn=ve.direction,rn=ve.ignoreContainerClipping,nn=ve.isDropDisabled,Ln=ve.isCombineEnabled,Li=ve.snapshot,Or=ve.useClone,Vr=ve.updateViewportMaxScroll,ao=ve.getContainerForClone,Co=Yt(function(){return tt.current},[]),Go=Yt(function(Kl){tt.current=Kl},[]),jo=Yt(function(){return qe.current},[]),da=Yt(function(Kl){qe.current=Kl},[]);me({props:ve,getDroppableRef:Co,getPlaceholderRef:jo});var Za=Yt(function(){je()&&Vr({maxScroll:Tu()})},[je,Vr]);xg({droppableId:wt,type:Jt,mode:mn,direction:sn,isDropDisabled:nn,isCombineEnabled:Ln,ignoreContainerClipping:rn,getDroppableRef:Co});var ns=le.createElement(ke,{on:ve.placeholder,shouldAnimate:ve.shouldAnimatePlaceholder},function(Kl){var fh=Kl.onClose,bu=Kl.data,pu=Kl.animate;return le.createElement(np,{placeholder:bu,onClose:fh,innerRef:da,animate:pu,contextId:Be,onTransitionEnd:Za})}),el=cn(function(){return{innerRef:Go,placeholder:ns,droppableProps:{"data-rbd-droppable-id":wt,"data-rbd-droppable-context-id":Be}}},[Be,wt,ns,Go]),$a=Or?Or.dragging.draggableId:null,Ys=cn(function(){return{droppableId:wt,type:Jt,isUsingCloneFor:$a}},[wt,$a,Jt]);function Nl(){if(!Or)return null;var Kl=Or.dragging,fh=Or.render,bu=le.createElement(Vl,{draggableId:Kl.draggableId,index:Kl.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(pu,pl){return fh(pu,pl,Kl)});return en.createPortal(bu,ao())}return le.createElement(Kh.Provider,{value:Ys},mt(el,Li),Nl())}var Qa=function(Se,Be){return Se===Be.droppable.type},Bs=function(Se,Be){return Be.draggables[Se.draggable.id]},ul=function(){var Se={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},Be=(0,St.Z)({},Se,{shouldAnimatePlaceholder:!1}),je=$i(function(mt){return{draggableId:mt.id,type:mt.type,source:{index:mt.index,droppableId:mt.droppableId}}}),tt=$i(function(mt,wt,Jt,mn,sn,rn){var nn=sn.descriptor.id,Ln=sn.descriptor.droppableId===mt;if(Ln){var Li=rn?{render:rn,dragging:je(sn.descriptor)}:null,Or={isDraggingOver:Jt,draggingOverWith:Jt?nn:null,draggingFromThisWith:nn,isUsingPlaceholder:!0};return{placeholder:sn.placeholder,shouldAnimatePlaceholder:!1,snapshot:Or,useClone:Li}}if(!wt)return Be;if(!mn)return Se;var Vr={isDraggingOver:Jt,draggingOverWith:nn,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:sn.placeholder,shouldAnimatePlaceholder:!0,snapshot:Vr,useClone:null}}),qe=function(wt,Jt){var mn=Jt.droppableId,sn=Jt.type,rn=!Jt.isDropDisabled,nn=Jt.renderClone;if(wt.isDragging){var Ln=wt.critical;if(!Qa(sn,Ln))return Be;var Li=Bs(Ln,wt.dimensions),Or=To(wt.impact)===mn;return tt(mn,rn,Or,Or,Li,nn)}if(wt.phase==="DROP_ANIMATING"){var Vr=wt.completed;if(!Qa(sn,Vr.critical))return Be;var ao=Bs(Vr.critical,wt.dimensions);return tt(mn,rn,zo(Vr.result)===mn,To(Vr.impact)===mn,ao,nn)}if(wt.phase==="IDLE"&&wt.completed&&!wt.shouldFlush){var Co=wt.completed;if(!Qa(sn,Co.critical))return Be;var Go=To(Co.impact)===mn,jo=!!(Co.impact.at&&Co.impact.at.type==="COMBINE"),da=Co.critical.droppable.id===mn;return Go?jo?Se:Be:da?Se:Be}return Be};return qe},gl={updateViewportMaxScroll:La};function Ru(){return document.body||Xt(!1),document.body}var Ms={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:Ru},gu=Kt(ul,gl,null,{context:vf,pure:!0,areStatePropsEqual:co})(qs);gu.defaultProps=Ms},38486:function(Zn,ei){"use strict";var Le;var le=60103,Ue=60106,pt=60107,St=60108,yt=60114,Oe=60109,at=60110,Ct=60112,ot=60113,We=60120,Tt=60115,dt=60116,kt=60121,De=60122,ne=60117,te=60129,de=60131;if(typeof Symbol=="function"&&Symbol.for){var se=Symbol.for;le=se("react.element"),Ue=se("react.portal"),pt=se("react.fragment"),St=se("react.strict_mode"),yt=se("react.profiler"),Oe=se("react.provider"),at=se("react.context"),Ct=se("react.forward_ref"),ot=se("react.suspense"),We=se("react.suspense_list"),Tt=se("react.memo"),dt=se("react.lazy"),kt=se("react.block"),De=se("react.server.block"),ne=se("react.fundamental"),te=se("react.debug_trace_mode"),de=se("react.legacy_hidden")}function pe(Et){if(typeof Et=="object"&&Et!==null){var Pt=Et.$$typeof;switch(Pt){case le:switch(Et=Et.type,Et){case pt:case yt:case St:case ot:case We:return Et;default:switch(Et=Et&&Et.$$typeof,Et){case at:case Ct:case dt:case Tt:case Oe:return Et;default:return Pt}}case Ue:return Pt}}}var ye=Oe,we=le,Ce=Ct,_e=pt,Ze=dt,st=Tt,nt=Ue,Ye=yt,ct=St,$e=ot;Le=at,Le=ye,Le=we,Le=Ce,Le=_e,Le=Ze,Le=st,Le=nt,Le=Ye,Le=ct,Le=$e,Le=function(){return!1},Le=function(){return!1},ei.isContextConsumer=function(Et){return pe(Et)===at},Le=function(Et){return pe(Et)===Oe},Le=function(Et){return typeof Et=="object"&&Et!==null&&Et.$$typeof===le},Le=function(Et){return pe(Et)===Ct},Le=function(Et){return pe(Et)===pt},Le=function(Et){return pe(Et)===dt},Le=function(Et){return pe(Et)===Tt},Le=function(Et){return pe(Et)===Ue},Le=function(Et){return pe(Et)===yt},Le=function(Et){return pe(Et)===St},Le=function(Et){return pe(Et)===ot},Le=function(Et){return typeof Et=="string"||typeof Et=="function"||Et===pt||Et===yt||Et===te||Et===St||Et===ot||Et===We||Et===de||typeof Et=="object"&&Et!==null&&(Et.$$typeof===dt||Et.$$typeof===Tt||Et.$$typeof===Oe||Et.$$typeof===at||Et.$$typeof===Ct||Et.$$typeof===ne||Et.$$typeof===kt||Et[0]===De)},Le=pe},53410:function(Zn,ei,Le){"use strict";Zn.exports=Le(38486)},32637:function(Zn,ei,Le){"use strict";Zn.exports=Le.p+"static/AssistantCode3.a8740efb.jpeg"},93314:function(Zn){"use strict";Zn.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=="},73631:function(Zn){"use strict";Zn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAZxJREFUOBGtlL1Ow0AMgH2XUIkOLFXVASgTsDHxBIAEzAwMPBQjT8AATGVBgEBCYmHmFcICYmBogCbNYSe52HUTVZWwFJ3PP599Z+WMcy6Af5SwYkWnLYifTyBzq5XNK8YNwbbvYP381ZuaVlN1+HJwAc4d1QYaA+gDsHYANrhGHTdCMtSDMILtwSMDn7ZiANPKwyjeQ0Reo4r1gEoEwRkDb7spdPcBeocMk1Cv00oii5L+fgPwcR/zHfb3AJY2sEpUVLOUhB/l+w7I1iS9TYDFrM3AzhqGDstPZ3li2Z12U2WLvk4fGJh+F0elYN8ZrbWiA7igAP4WR6sFzDAKPgPHP0VnlMsFS5IyyIGoeAamCKybYI5UQLWVE2fgGI/s72wqQXRd9jyxiHgGJtihFxGQm8Qd5XvtF3fEQOrQH9mDm1Z9hyJuEphXIq9uSWSQqv8a4RbAUTFdcs7gifwplYGjT3wzbPFz6Q70EZv8WZoxMP66ApMc86inirNBA8njcFIuvOTXhowPyzuQJiukzi3hQgS7b+I9nJtQn/AHsLGsvlcPPWsAAAAASUVORK5CYII="},31328:function(Zn){"use strict";Zn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAodJREFUOBGtU0trFEEQ/qZnM5NsWBCfSEjwQdSggmAieAv4uOnFg5eIXgTvEY+ePJqToDf9AcZDFAUF8SgEQUxAjC6+QlhX4xo0G93ZnRnr697umSyKBCyY/aqqq76q6uoF/rN4lu/BmzSsLGFM7P4kAZQCiBTR64nCw/MHvRnj+fuvI7zxtDWJJD1lQulO5TPHnkAqpuAUFKZUqg8da8xI35+/cMh77AjHJ5cakh/oqHa2ZhGHpSb+STxJZA3lqesFG1CuLAdsqLfbb/dlTwQ7GdmG9VGVBuoNfT/nHGHUSnByeAN2binmmDK1gyM7aGvl6gruPvtadCOfvVlxN0PFjsF4qxMptjl7BflirsPAVxJoQjy5eUMqq6bkMgbWF7C4HGMlsnRmZE82xtEdYSwGnRTuhCvVqG3T8bGhHpweKaFWj3HpzqI7Z16SmHxHmKbcVE7yBs+k1uBm8wh6Q4VQJvrZMkEp98EGBB2h3pFUMWJmPLKniKGtXZhZiLC/L8CLhQbmqhHefmmi3pRYOwInY65gRiiM+ZEP9Ic4c7ik+Ye3dePK/W94/bmpbVNO4u2S2rmrOmRvtkEmlHraC9EUgEzo/optVwZM4IiCLivR1WhywwrT75p4WYlkqhTT7xs4vreIke2h3KWHTaUClC/ZnsR3fOTWMnarZi/QulYhr2l0MMDorhA7NhbwodbC5Xs/9FT5d+s6lJJSzHxWJ9ov9Xw8KceYX9LrQ9+6LF6pgs4luqVIIl+G69gp0id1tk+8/byJ77+AV9UEiRTJMnQMOYycuPZpNuhS+7TF+fgkiBSr55+J9eXOm1E86wjpPzrx8aI8hd3U1yryrOcejQ9cXWveP+N/A79g8eaXNDk4AAAAAElFTkSuQmCC"},96908:function(Zn){"use strict";Zn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAA8CAYAAADogBFvAAAAAXNSR0IArs4c6QAADzxJREFUeF7tnQl4VcUVx3/3JSEBARFEFllcQAMJuKDUD7FqtVbFtUqtS6ufS1soxaW1Si0KBaFVWy2ittqqdQ9xpYq4tLgVFWUThYQlJIEkkJXs63u333lzL+/mrfeF9/KSeM/35Xv3zZw5c+bM/83MOTN3ouGQY4EuZAGtC+niqOJYAAeQDgi6lAU0fUayHqCR5gJXEriS/T6TICkZNOMzIN/gFx7/8vvLiFxDtpfP4G2Xb5Ej6SaPKddav6mPtb5g9e/PF9nSvmTVlpD1S36Sr63WOj1ukD/d+PR+b1NpAekmj5Gve8Dd5lc2ivK4G2lzV4K7Eo/8eSrQ3ZW424rw6J/ST1utTb2jtkuhLAplwgDS7BDj09txdgFqgsjCbwVOKMCYAPH+IAzABIDf8qPYz+OygMus0+8HFQDmYDpaypj1mp+m/qKbgMoKQO+zxwIyCzhNPhOIQQFrAas/uK3l5dlt/SEY9bbn0ZsrS1obynfXNJQXFTeUbPugua5utQZrM7PZHgU2EsIaHJAJUcWp1JYFklKgVx/fX0oqpPSBgw6BASOh/xAlxgC+u6WJqh0bqdi2nrb66gI0sjQXL2W8xHpb9XUykwPITjZ43KuTpcnBw2HA4TBwFBw81Dt66+42aoq2U7FjAw0Ve8R52KxpLB6v86KWjTvuetmswAGkTUN1W7aDBsHIieiHjkVDlhpuavbkU7ThE9wtjQLMbTosyFzGc5pGoD/RyQ13ANnJBk9YdSm9YVg6+tB0NC2ZtqZ6dn/1P+rKirwqaRqrknVuSM9mZ8J0FD2CetmJ1MipO74WkPXn0VOg72CvY1ZRuJU9uRvQPW4ZLes0jdszlvG3+CoRWroDyERZPtH1Dk1HH56B5vHQWFvJzrUf42lrUaMlPJ4BMxOxtnQAmWhgJLL+3gPQR5+E1qsPDdXl5G9YjUdipIreGpzGFUOfpb4zVXQA2ZnW7op1paSiH30qWlIqdVWlFGz6Al1ipmqkXH0wnD0ym8bOUt0BZGdZuivXk9IH/ajJaK4Uasr3UJizUQX/Fb2WOZ7LtfniosefHEDG38bdo4bUvuijJqG5XFQU5VOSv22/3hr8NTObWzqjIQ4gO8PK3aWO3v3RR57gHR13blpHQ121FZTTM7N5Od5NcQAZbwt3N/mDjvDu8jQ11rHj6/XoskevqKxXMuOPfZHyeDbJAWQ8rdsdZct2zYjj0VJS2bu7gLLiXdZRMiszmx/Hs1kOIONp3e4qO60/+rBx6O5WdmzeRHOTz8lO0pg2fhkr4tU0B5Dxsmx3lytTd99B1FZVUZC31dqanMzxTNDmsz9gGcumOoCMpTV7kixXEvrwCV4HZ1vuZlqamqytu2VCNn+NR3MdQMbDqj1Epj5wBFqfgVSU7qWkWB3CENKgEhibme39jCklBpCysf/H3aohrY1w64CYNqrLCJOziRJg1hN+qqtjJklJQx88xrudmJuzBY+cVveBcmlmNr/qmODQpRIHyPuKlVYtjXBL/1i3K7HyDh4Gp94IU2+Ee0+A+pgPJJ3WPn3QEWgpvSkpKaaiosJabxsuJk7IYksslXEAGUtrmrIW5sHAkerb7UO6NSBJ6wcDhnvXkFu354HlDK8GKzOzOS+WJnQAGUtrmrIW5atXCHoCIDXwDDwSlyuJvIICGhran7OIdRjIAaQDyIgW0PsNRkvtR2l5OaXlAcuPmIaBuh4gp1wP/QYrI338ODRUBRpM0+Cc36p0OVT6nwd9PIcdAydcqr7nroL8NXDi5TBmKoyepPgL16n0dS+3dzgGjoaTjY0If7n+Wow+GdK/p1Jr9sC+Ihg1SX0X3Xob6+K3F0FLg0r/egUUbWovSRy8SdNh5PEw4jho2Ae71sOuDbDhVaWvP1nbWLIZvvo3TLwQvjtDvdQlaf+eB2Uxeuu1V2/oP4yGhnryCn3etqmWS+PmjGUsiYhsGwxdD5C/WwsjJirV7xkX3KjyPvZSY+poqoXbBvqaetzF8HPjDMAbc2HIWDjlp8FNsfldePIaH+iTU2FxIRxkyHvgu5D3afCyM5dDprF8emuBN4jM6TPDm/zZG+HTf/l4xpwG1z/nXaMFpYIv4fHpUGVEJEwmaxu/eBFyP4Br/t5exMPnwZb3bUDADouGPmiU9+3FnLxC3BZvW0rHMgzUswEpI5O8Q9LaDAVroHgzDE2H0SdB6kGqJyryYdFJ0GicbLnsfjjLOGn1yT/ghRmBPSajmgBXLg+Qwwd3j4WzboXTDV4J95jkPZxghH2e+xl89ozKEVDdlKVu8RAq/lqNikm91Eg++GiVXlsGD52tRr1ggCz+BgaPAXk/20oxBSTo/YagJfdiV8lequuMEd9SnwYxCQP1bECKwerK4ZELQUYbk2RbbNZbMOQYlbJyMSy/Wz3LdDjvG/XcWAN3Hg6t7XYp4IxZ8CNjmSCj7NJp7cEQyamRH8m8zT7H54WZ8MkTPhlyO4ZM+xcvUGkb3oDHLw8OSDP1m3fgw0ehtlSBWUb2ysL2eh3It7T+iMddVV1LUVnQMFZMwkA9H5CPXQqb3gzsChlVBBSyHm2uh7ljFHiFbn4Pjj1DPT/1U5Bp0Uq/XQ1HnKxSnrgC1r8aHSAvnAfn3aXKfPYsPHN9cKiYywIJrC+a5Ft/WqfsSDIOBITWsnJjRr/DaG1pIbewJKjUWISBejYgZTqeOzZ0l9zyPhxzusp/7BLY9JZ6FifjhhfUc85/YckPfDKsI6iMRnNGq3t+rBRphJyzBuQgrNBD34etHwTXcfLVcN3TKu/d++H136lnKyDlx3TXkcGdv1iB0ZTT7zDv0/aiMppaWoNKP9AwUM8G5Fdvwt8MjzuY+ab/Bc40dr+yfw2rDEdRRgMBlXSArAFl9KwyzgVaR7f3HoDX5gRKjgTIh6rV2lZow+uBSwJTojhX489R32QUltHYH5A7P4P7T4s19ILLk2k7JY3SqhpK99WFqvOAwkA9G5Af/R1emhW6s865HS5ZpPJXLYXsW328Fy+EH9yhvi+/B1YafH/YCoceqdLnZUBpu6NZKj0cICVgLvnRkoSCFk8OBOSXy+DJq6OV1jH+5F6Q1p/G5mZ2lAQJxxlSDyQMFHtATpgGR56iVNvyHmz7KLDxstcrXqpQUx3cdoiPJ5ZhnzUvwNPXhjb+tLth2lyV/86f4I3f+3jF8Zmfq+6SLNsB96TDUVPgNx8qHmnXg2cFlx0OkDIyPrhPrV2FJNbqe8MvtK4S3go2Zcv6Vta5nUGicp9B3vuBcooraXMHfxHxQMJAsQfkRQvg3DuVeazeq9Vgo06EOz9XKXu3wvwMX651fbXgeCgxPF5reQlgLzSCvuHikOJpSiwxFF3zBEy5TuU+exN8aqzXTP5fvgkZxvrxz2fC5CvhtJ+p3KevgzXPRw9IKWHd6w41yoYDmH8csrMAKTql9vWGqoqr6qisaw6pZUfDQLEH5Hd+Atc+qRRdmw3/vCpQaStPzn9gybk+nl+8BhMvUN+XXgCb3wksf+1T8J1rVHo4QMoux7xxwcMfElwXUJt7zg+cDnmr29clux+/MDxoGW0zzlVBc9lNmTMy9Nov0hpy1goY/31Vl3/Ix6rB8ZfACT9UKRJe+vw59ZxIQMq0nZJGbUMzBRVhL7XoUBgo9oCUoPMdxu6GBKQXTIByy4VaKWnwm4/VVpnQf5fAy7/2dcP0B+FMY90XbMo9fCLM+UJNpZEAKflfZqndGH8SZ0acGiEJSC82wjhWPokH3pvnA62ZJ/G+rJsDZZop1nWmePni7VvpuIvg56+oFNlynJ8JzX5OgswCd63zbUH+5Xuw/ePEA1KWGvIOt9vNlr21eDyhz3p2JAwUe0CKyWavhHRjfVVXoUAni38x8ik/geHGFC33yMgIZu2wcWfDr972dZ/slnz+PNTuhaNPhUvuVd6vSeFGSPGQBbjrXoH3/gxl22BIOpz0I593LXIevQi+ttRpBc/5c+ECI2hupt8rMcGvQgPSGk6SsFHO+2rPXLxyk2a8DrLeFirdrtaHEryXy0ZlmTD5Kt9uzTcrVXDfpESOkKKD7G3rOruqmqhuCv9qjcvF+RlZhDBuoAnjA0iJ1ckoaR4wCNV1794HrxsBYivPze/CsWcGLyUgWz5XAVMoHCAFiEInXhZcloBkxQKQvehQJFP6wh2+Lb78L+C+KaH5JUeWE7Ks8KdZaeqqZaFDRsCMN3z79qEk7t4IMjo21XQdQLpSvP8QoKaxlcJ9odeRorCmsSVjHBPtvhQWH0CKJtKRVz3mO4BgNXhFgQrHyC8/GMmhUNlTPvWG9rnVJarcphX2DleIByrOxxVL1Mhsxv5EqkyVWbNh4/Lw4JLc2e/4TvbI3raM2pFo6k1wxkwYPNa3z2wFpJSXeOf5v1d751bdJE/WqfJDkeWBf+A90SOkTNtJvdA9bWwpa8ET4RWNaMJA8QOk2WF9DlEHGmS6FhDszVX7rXao76EwdJy6yF2OjJXLieUIFKqzpPMlHCWjdsFadWTMDglQFhVAnwFqi/HOEYHrPTtywvFIBx96FAzPVODbk6PW3XbCQQdad0fLiz11D7urW9nXHP4eqmjCQPEHZEcb3NFysR49JMxz5SNKm9VPgZzYcQjE4ZOzKy1u8qtt3Jmv8fCEZcyOZDoHkJEsNHcjDBuvuO6bCvlG/DRSuW9Dvly74tHZUumOOG3LUWo7L4U5gAwHHHGsxMESkvOKC40DEd8GsEXRxqI6D1VNka+P1ODtzGzOD7t66XGX3sdyypaguATHhbJvg1UPR9FN3x7WxjbYsc/ezSqRwkA9b4QclqE8aiEJeH/5UseQITs5F81X/+tQSPa6g73f0zHpPaqUhMa3VrppDRMkNxscKQzU8wDZo7q6+zSmtFGntN6GcwOECwM5gOw+fd6lNW31QG6lADLytTHhwkAOILt0N3cv5XZWe6gXZNqhEGEgB5B2jOfw2LLAvmad3bX2pu1QYSAHkLZM7TDZsYD4NDn2YpJeccHCQA4g7Vja4bFtgeJ6D5WNNqdtcXD8TgM5gLRtaofRjgWa3LC9yl5M0jtK+p0GcgBpx8oOT1QWyKt209Aa2ds2hbpczM7Iwrvr4AAyKlM7zHYsEKVz0+5uIAeQdizs8Ni2gIyL8icxSbeNnZv9go0wkANI26Z2GKOxwJ56D+VRODdmGMgBZDRWdnhtW6C6WWeX/Zjk/jDQ/wHkSLPJ/mcrgQAAAABJRU5ErkJggg=="},57177:function(Zn){"use strict";Zn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAAA8CAYAAAAeyZT3AAAAAXNSR0IArs4c6QAAEpJJREFUeF7tXQeYFdUV/mcbS1F6UUEsoLC7IGKNJWpERbEgSoxGo7HEQFDRWCAGgdASNBbEhglqsC1rAxVBNGg0qNgLsJRddmFhe3vby3uT7393ZmfeezOv7M57W3LP9/EtM3Pn3DPn3n/uvf85c58CKdID0gOOeUBxTJNUJD0gPQAJKNkJpAcc9EALoNRpCaqt3rh4QIkDvH/jxV/zuZZjrVy8uRzvSzDdrx3HxWnnEnz1eevhOf/79HpNdrAs6wrQr9VvtiMc+/kc0HSan9Nrq8Uzt9hquuZjv8kPev26r8x16X5VPYDHDYT7Vy/L8vo94d7P8u5mcV+w+1U34GEZ7a+5Tg/vV31tbrmu36ff23JcB9VdBo9a5v2rekq14/1wN30GNXGzctPKKgf7eExVKUGBpJsSEkgWYPMHXEuH0sHlB5iW8jrAtE6sd9AW8GidVD9mR/fvxDrAzJ3Yp/ObAGL3srC1XweJnf0awHUQWgGJ52i3P+D9OyOP/QHSAjYT8Lwd3gRGH3Bp5dza34D7LUDsD04vmPzuN9cZGkSAF3xm4JttNoFWdasNlRVNta4SV21l6YHakvyPGurrNivA12kZ2B1TdLSisvAA1QrF8hbpAUsP8EWVkAwkdgMSugHxiUB8EpDcC+g1AOjeG+BciSBWPXA3NaA8Pxel+7LRXF+bCwXpShxeTX0V33ZED0tAdcRW+X+2iaN3j35Ar/7iX/e+XnCpbg9cZfkozctBrauci/9tioIlKSpeUTLg7iguk4DqKC0h7bD2QPJBQP/hUHsNhsIVv+qBq7QI+7O2w93USGDtUoEFaavxoqJ4x7Z2FQmodnW/rDxsD3Ba2PcwqL0PhaLEobmxAXnZmaiuKPOqUBRsSlBx06gM7AlbZxQKSkBFwalSZRQ9kJAEDD4GSD7Yyz6WFu5HQV4uVI+Ho1W1ouCe1NV4OooWBFUtAdVenpf1ts0DfQ6F2mcoOMurq6nCnp2Z8DAMwNEKWJEKTG+PtZUEVNuaVd7dnh5I6gF1wFFQEpJQW+1CTtYueBgeEPLuwGRcNWQVamJpogRULL0t63LeA/GJUAeNhBKXgOpqF3Kzs6Ey3iVGqs29gQnDMlDnfMXWGiWgYuVpWU/0PBCfBHXQ0VCUeLgqK7B3b67I4BDyZloKrlTmQ6AsyiIBFWUHS/Ux8kBCMtT+w70MYGlJMfILCloqVoDH0jIwMxaWSEDFwsuyjth4IKk71D7DGKzCnj05qK0zZnoKMDUtA69F2xAJqGh7WOqPrQeYvtSjL+rr65C1JxeqMfUrTkpAyrGvoCSaBklARdO7UnfsPaAAat/DocTFo7C4FMWlIvBLUYD0tAz8KppGSUBF07tSd/t4ILE71N5DoHrcyMrJQ0NjY4sd8QompazGumgZJgEVLc9Kve3rgZ79gW49UVVdg9wDhWZbMtNSMEaZDxEFdlgkoBx2qFTXQTygxHnz/gAPdu3NR2Njk9mwmWMy8Fg0LJWAioZXpU7DA/0OB479hTguyQZ2/Sdm3lF79IWS2B2llVXILylvqVcBuLAamZbh/euotA+geg0E/ponHqSpDrizj6MP1WGU8WM671eq7fhVweTFwIQ/Cpe8PRfY8NfYuue4y4BbNbb6y1eA534Tu/rjEqEeNAAejxs7cgvg4VfGmijA8rQM3Oa0Me0HqKUHxLM01gEzD3b6udpXX+9DgNNvBs64GVh0PFDj+Isw/Oe7fAlw3t2i/NoHgPVLwr/XiZLtCShGpHr29zJ++aWVKHX5pPU1Iw5jx6RjuxOP2QLUsPaUcLJG6uII1ZUBtTAb6McAI4B7BktAtdcIRf/zM/vkg9HY3IydeQxBGbMFBVifloELnezecoRy0pu6rsU5QJ/DJKDogXYeoWiCp2c/7mWF7MJy1Nb7kBNwmkaXgJKAioYHDJ0dAFBqt55Q4ruhyFWDooqArzkcpdE7HqBOuxE4aKBokE9WALUGO9PSStxc4Px7xWFzI/DhI0YDDjoGOP5ycbxjE5CzBRh/JTDiDGD4CaL83m/E+W9e8yUM+g0HTtIC6f56/bvd8JOAURp75SoAKvYDh58gStG27tq68L3FQGOtOP/TOmD/j76aOP09YSowbBww9DigtgLY9y2w7zvguzeEvf5ifsb8bcAPbwNjLwF+Pg3oPQTgubfnAcW7ASfXUAOOBH52PTB0nKiHn6UXZwFFu4DPVwEFFssRK0BRz7gpwn/0U+7XQM6XwFfpYrsxpyUhEUjqhdqGJmQXVgRoj1NwR+pqLHOi2o4HqD99DQwdK55t7mjRKfyF++4t1xIf66uAu/oZJcwNuGYOMHgkcKoNs7TtfWDltQZoOd9eshfoqel76OdA9mfWfp6+FkjTpt/vLhA79Jw1PXibrLoZ+OwFo8yIM4EbXwT6MF5iIblfASumAuUaI6oX8e+kOz4Crn3GV8HjFwLbP3AOUJfMBybO9m7eYCnuJmDjQ4L4MIu/rR8+Bty2zvCxuezuT4AVVwHVxU70bR8dao8+XsY1c38F3Ca2j4WcpNG7NqA4MiT1AJoagNwtwIFtwJBRwPATvVF0r5TmAItPBOoqxfEVDwLnapn+n/4DeHlaYONyVCHw4hPErqoPjATOvRM4Syvr3RVWE2/jaQvhF38HfP4vcYEd7ZZ0sWsu5cBPYlTiW58j6cCjxfmqYuDRCWLU0cXcSQ9sBQaOEPvcmcVJQF08F7joz4b2sr3iRcOX2eHjxT9dVl4HfPWqta0cnRmX4r58WZ8CRbsD24Mvj8UnOE7kqN16eT/t2FdWjcrawFHfKRq9awOKzVpdAjxxCcC3vS79jwBmvCs2+6CQStbfrJxOzdsqzte5gFmHAU31vp317BnAL7VpJke55ZN8r4ciJQjyedsM4uLl6cCnzxo6uDcdp42XLRDnvlsDrLjSupPqZ7duAD5+EqgqEmBkh2fHb+uUjy+eJXliI0rK6/f6TrF5ji+TK5aK65wCzh1lbyvb48nJQM4XRpkBRwHT3gIOGS3Obfw78OYsX5+29YgvnLgklNc0YH+FNgX31ekIjd71AfXU5cCP7wQ2B9/q7NScwjTUAHNGCPBR7tgIHHu2+D8DkQxImuXezcARJ4kzz14FfPuG7/VQgLpkHnDh/eIerj3+daN1d9GnlQwM862tr7/MI1QoHW0FFNdLE+8ToQ6uFTlFtpJFe4C+Q8WVmb2NdaO/rS/cCHyxyro95m4Ve9ozNsn24MvBKeHW10nd0dTsxo5C663TnaDRuzagOJ2bM9K+SWZ+ABxzlrj+1GTgx3fF/0kS3PSy+H/mv4FlFxg6zCMYG3z28MCFdChAzd4CDDte6Hz0PGDnR9Y2nvxr4IbnxbX3HwTe+pP4v7mT8mVw/5HW5A3LthVQ4XboO94Hjj1HlF403hr8ZfsEULQ9HwJUz1gHpJwnTj89RZAtTgpHW9WD3cU1qG+y/iK+rTR61wbUD+8AT2uMn1XDTH0YOEfLPsn4I7BJI3q43zZBcdAgsUZiJyjfJzSYRxcuwt+cHag5FKAerRRrO8p3bwVOKXWNJEdSzhdHHAU5GvoDas/nwINn2nc7JwHF2NrxUwCydP2PFEQMiRzulcdjfV1Ke2iXv61b14vpt52Y169v3Ad88LCTcBJ2KvEoqmpAUbUFeypqaxON3rUB9Z9ngFdn2DfK+fcAzHWjbFoOZNxplL1sIXDBfeJ47VxgvVbuLztFh6LMSwWKdgbqDwYodkpej1RIpS85ObCTfrUaWPnr6AKKDNlVy4DxUwURE0rsABWqPZhzOEXLNfz4KSD99lA1RXbd+1NCiahrdCOrzH4jpLbQ6M4Daswk4MhTxYNu32idXcxcN7JklPpq4K6+hmOcpM23vAw8f7290yc9AEyaI65v+BuwxsRkkbiYv0PM6fWF9lGnAXd/LMoza/qRc611BwMUR6ZHKgz6mbE2uymQWTsZNaspX6iE07aOUInJwO0bgKNPM9qL8bHCXUBVoRhdmxuAibOMaawdoL54EXjht/btYR791y0E3pkfGWBClSbjH0c21IPM4no0e6yTlttCozsPqEsXCOdSzOyZ+WFJs87SWJ7CncD8VOOqeX2xYByQrzFu5vsZgF2oxaeCxaHIdDGWZCfXPgucdoO4uuoW4DNtvaKX/8M7QKq2fvr7OcDJVwNn/k5cff4GYMtLkQOKd5hz/exGuWCdI5Lsg7YCimzj5EXCmrzvBYXP4LO/zPrcCGzbASrYS4j6rvuHCBxT7MiLUKAJdZ3Teag44GpCWZ39j3a0lkZ3HlCnXAdcv1I81tcZwD+vCXxEc5nMD4FlE40yv38TGHuxOF5+MbBtQ+D91z8HnKKxTcEAxSyDeaMFfewvDA4TlHrO3UNnAdmbfUsx++D3GoPH0S51oghIskPNHma/9gm1hjIvvv0pc7MF4yaLNQuF9Dzf8JRYAop0NmcdlGeuBL5fE+hL/qbT0gJjOmgHKLbHn48CXD5f0Ap9bA/67eDB4njp6SKbxWnRfjmzqr4ZuZVBszJaRaM7DygGTe/TsgsYUF0wBigx/SACpxB3fyJSbSj/Xga8pn2vw+OpjwDnaOseqynbYWOB2V+KqRglGKB4neksVlQvyQiSEhQGVJdoNLi5ARkPWpRtgE6/xnhP+h32TW1eZ5FlJNtoluMuBW59XZxhytL8NKCh2rcMR+H7vzFSmB7+BcBMAkosAWWegvPlyJekv5hBx2t2gOK1/64EXro1UMeEu4ApfxPnmYa0VJti2nu59Vfi4r27y24vaYYnyLdqraHRnQcUH/P29cAobX1RXSpAw8U7O8mp1wGHalM8bu7OEcTc4UZPAG57z3AWsxW+eEnM148+XUw/yL7pEgxQZOgIvG9eF8HC4l3A4FHAib802D3qefJS4CdTneamumgOcLFfOs0ixoR+sG9QMx1P2j3zA5EzSFZQF3MnZMYA10cMPvOzbU4zT77GyJbwZ8daCyjq58sjHPlhrfDJb1aKNqMU7gBemgZk/VdkeHCtfPliY82s6w0GKJYhkULSgdN5Zq4wTKGzrbzOGQtnLtES9gmPB/uqPKhsCL6hbFwcLkpNh03nCDQwOoBirIajlJ4gaueY95cCb2kBTnMZc0zD/16CZO0cY14fDFAEEmX8FdYWsJOvWwAwF89OOCVcmGWkCIXz9uR0lNNSf5mRLH6rlsIg6LQ1Rt6iXf1ct3B0qncZJVoLqEg6qM5sWrUlM0hIruiM386PBdj09aUdoLZtFOSGTq8HtK1bZKywX0RVvL/cBlejir2u4D9+qCjYnjoaY8Pd1CU6gKIz2BGvecpIIDU7qDRX0Nl881oJf7WOMYnTb/K9Wpkv7vtxXXjJsWTASB6Q8uVbVo/9UCunWqRlv18buunIcumZ5czt46gZSs64BTh7OjBwpJFnZwYU7+cCmTlyzB0028ZrXKcR6Jxe+mdgxxJQtOWIU4CrHzdYPP3Z2Y7fvi5GV+b7MXmWYgcopi0xiM2g+aARvh7kfhP0LUf0GAk5vu2l7qDTPpoSCY0ePUDpTunRVwzrnO6xE/NNFm5KCXcBHTJaLFT5yQWdHkrsOhs7L6co+ucCTKMJR9jRF+cCjMUwK2HW0MD1Tjh6gpVh+hPz2Q5NE+ApyBTrznDo9LbWHe79tHFIigACaXJOH/VUrXB1mMuxTbne1j+nqSltjZY235NX5UFFiGlfJDR69AHV5keOUEEkb+9wVHMac/UTouTm5wBmjEvpMh6oblKRUxnGb14reHzMaoSMNEtAheoac74HDkkRpZae4ZslHepeeb3De4DL6O1load9/JQ1nE1dJKCCNTmTPUmQUPi90kItobXDdxNpYCQe2F/tQXl96J+PUoD30jJwUdDZe7vsehTJ00Za1skpH4O6DO5SMu4CNj0eqTWyfCfwQF0zkFUR3qf3oWj0rjdCHZJqxE0YczF/PRpJ4zJyf+l8b3ayV5jrZ7W/RSQ6ZdkO6QGyfTvL3Giyye0zGx2KRu96gOqQTSaN6ugeKKpTUVQTBjkRgkaXgOroLS3ti4kH+L3hjjICKvS22cFodAmomDSXrKQzeGBPpQc1Nl/yBthvQ6NLQHWGlpY2xsQDFQ0q8qrCm/bZ0egSUDFpKllJZ/AAOYnM8GJS3sexotEloDpDS0sbY+aBAzUelNWFjknpBvnT6BJQMWsqWVFn8EC9G9hdHl5MyjtK+WWjS0B1hlaWNsbUA9mVbtQ2hWb7TKPU7anp8Eb9JaBi2lSyss7ggQjJCZ+90SWgOkMLSxtj5gGOS/zHmJQ7jMyJFsM0Gl0CKmZNJSvqTB4oqPGgJAJyQqfRJaA6UytLW2PmgcoGFfvCj0m10Oj/A9jGm+feuyEMAAAAAElFTkSuQmCC"},81378:function(Zn){"use strict";Zn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},16722:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ct}});const le=ot=>typeof ot=="object"&&ot!=null&&ot.nodeType===1,Ue=(ot,We)=>(!We||ot!=="hidden")&&ot!=="visible"&&ot!=="clip",pt=(ot,We)=>{if(ot.clientHeight<ot.scrollHeight||ot.clientWidth<ot.scrollWidth){const Tt=getComputedStyle(ot,null);return Ue(Tt.overflowY,We)||Ue(Tt.overflowX,We)||(dt=>{const kt=(De=>{if(!De.ownerDocument||!De.ownerDocument.defaultView)return null;try{return De.ownerDocument.defaultView.frameElement}catch(ne){return null}})(dt);return!!kt&&(kt.clientHeight<dt.scrollHeight||kt.clientWidth<dt.scrollWidth)})(ot)}return!1},St=(ot,We,Tt,dt,kt,De,ne,te)=>De<ot&&ne>We||De>ot&&ne<We?0:De<=ot&&te<=Tt||ne>=We&&te>=Tt?De-ot-dt:ne>We&&te<Tt||De<ot&&te>Tt?ne-We+kt:0,yt=ot=>{const We=ot.parentElement;return We==null?ot.getRootNode().host||null:We},Oe=(ot,We)=>{var Tt,dt,kt,De;if(typeof document=="undefined")return[];const{scrollMode:ne,block:te,inline:de,boundary:se,skipOverflowHiddenElements:pe}=We,ye=typeof se=="function"?se:Kn=>Kn!==se;if(!le(ot))throw new TypeError("Invalid target");const we=document.scrollingElement||document.documentElement,Ce=[];let _e=ot;for(;le(_e)&&ye(_e);){if(_e=yt(_e),_e===we){Ce.push(_e);break}_e!=null&&_e===document.body&&pt(_e)&&!pt(document.documentElement)||_e!=null&&pt(_e,pe)&&Ce.push(_e)}const Ze=(dt=(Tt=window.visualViewport)==null?void 0:Tt.width)!=null?dt:innerWidth,st=(De=(kt=window.visualViewport)==null?void 0:kt.height)!=null?De:innerHeight,{scrollX:nt,scrollY:Ye}=window,{height:ct,width:$e,top:Et,right:Pt,bottom:Bt,left:fn}=ot.getBoundingClientRect(),{top:qt,right:vn,bottom:tn,left:it}=(Kn=>{const Rt=window.getComputedStyle(Kn);return{top:parseFloat(Rt.scrollMarginTop)||0,right:parseFloat(Rt.scrollMarginRight)||0,bottom:parseFloat(Rt.scrollMarginBottom)||0,left:parseFloat(Rt.scrollMarginLeft)||0}})(ot);let rt=te==="start"||te==="nearest"?Et-qt:te==="end"?Bt+tn:Et+ct/2-qt+tn,dn=de==="center"?fn+$e/2-it+vn:de==="end"?Pt+vn:fn-it;const ni=[];for(let Kn=0;Kn<Ce.length;Kn++){const Rt=Ce[Kn],{height:En,width:Bn,top:ui,right:It,bottom:On,left:ht}=Rt.getBoundingClientRect();if(ne==="if-needed"&&Et>=0&&fn>=0&&Bt<=st&&Pt<=Ze&&(Rt===we&&!pt(Rt)||Et>=ui&&Bt<=On&&fn>=ht&&Pt<=It))return ni;const kn=getComputedStyle(Rt),Oi=parseInt(kn.borderLeftWidth,10),ze=parseInt(kn.borderTopWidth,10),Me=parseInt(kn.borderRightWidth,10),Ee=parseInt(kn.borderBottomWidth,10);let Te=0,He=0;const Ae="offsetWidth"in Rt?Rt.offsetWidth-Rt.clientWidth-Oi-Me:0,et="offsetHeight"in Rt?Rt.offsetHeight-Rt.clientHeight-ze-Ee:0,on="offsetWidth"in Rt?Rt.offsetWidth===0?0:Bn/Rt.offsetWidth:0,Kt="offsetHeight"in Rt?Rt.offsetHeight===0?0:En/Rt.offsetHeight:0;if(we===Rt)Te=te==="start"?rt:te==="end"?rt-st:te==="nearest"?St(Ye,Ye+st,st,ze,Ee,Ye+rt,Ye+rt+ct,ct):rt-st/2,He=de==="start"?dn:de==="center"?dn-Ze/2:de==="end"?dn-Ze:St(nt,nt+Ze,Ze,Oi,Me,nt+dn,nt+dn+$e,$e),Te=Math.max(0,Te+Ye),He=Math.max(0,He+nt);else{Te=te==="start"?rt-ui-ze:te==="end"?rt-On+Ee+et:te==="nearest"?St(ui,On,En,ze,Ee+et,rt,rt+ct,ct):rt-(ui+En/2)+et/2,He=de==="start"?dn-ht-Oi:de==="center"?dn-(ht+Bn/2)+Ae/2:de==="end"?dn-It+Me+Ae:St(ht,It,Bn,Oi,Me+Ae,dn,dn+$e,$e);const{scrollLeft:pn,scrollTop:Nt}=Rt;Te=Kt===0?0:Math.max(0,Math.min(Nt+Te/Kt,Rt.scrollHeight-En/Kt+et)),He=on===0?0:Math.max(0,Math.min(pn+He/on,Rt.scrollWidth-Bn/on+Ae)),rt+=Nt-Te,dn+=pn-He}ni.push({el:Rt,top:Te,left:He})}return ni},at=ot=>ot===!1?{block:"end",inline:"nearest"}:(We=>We===Object(We)&&Object.keys(We).length!==0)(ot)?ot:{block:"start",inline:"nearest"};function Ct(ot,We){if(!ot.isConnected||!(kt=>{let De=kt;for(;De&&De.parentNode;){if(De.parentNode===document)return!0;De=De.parentNode instanceof ShadowRoot?De.parentNode.host:De.parentNode}return!1})(ot))return;const Tt=(kt=>{const De=window.getComputedStyle(kt);return{top:parseFloat(De.scrollMarginTop)||0,right:parseFloat(De.scrollMarginRight)||0,bottom:parseFloat(De.scrollMarginBottom)||0,left:parseFloat(De.scrollMarginLeft)||0}})(ot);if((kt=>typeof kt=="object"&&typeof kt.behavior=="function")(We))return We.behavior(Oe(ot,We));const dt=typeof We=="boolean"||We==null?void 0:We.behavior;for(const{el:kt,top:De,left:ne}of Oe(ot,at(We))){const te=De-Tt.top+Tt.bottom,de=ne-Tt.left+Tt.right;kt.scroll({top:te,left:de,behavior:dt})}}}}]);
|